/* Mobile tables: all information visible at the viewport width. */
@media screen and (max-width: 900px) {
  main .tbl-wrap, main .table-wrap { width: 100%; max-width: 100%; min-width: 0; }
  main table { width: 100%; min-width: 0; max-width: 100%; table-layout: fixed; }
  main table th, main table td { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  main table th { padding: 6px 7px; }
  main table td { padding: 6px 7px; }
  main table[data-guide-mobile-table="fit"] tr > :nth-child(1) { width: 25%; }
  main table[data-guide-mobile-table="fit"] tr > :nth-child(2) { width: 28%; }
  main table[data-guide-mobile-table="fit"] tr > :nth-child(3) { width: 47%; }
  main table[data-guide-table-kind="situation"] tr > :nth-child(1) { width: 29%; }
  main table[data-guide-table-kind="situation"] tr > :nth-child(2) { width: 25%; }
  main table[data-guide-table-kind="situation"] tr > :nth-child(3) { width: 46%; }
  main table[data-guide-table-kind="need"] tr > :nth-child(1) { width: 27%; }
  main table[data-guide-table-kind="need"] tr > :nth-child(2) { width: 34%; }
  main table[data-guide-table-kind="need"] tr > :nth-child(3) { width: 39%; }
  main table[data-guide-table-kind="region"] tr > :nth-child(1) { width: 25%; }
  main table[data-guide-table-kind="region"] tr > :nth-child(2) { width: 39%; }
  main table[data-guide-table-kind="region"] tr > :nth-child(3) { width: 36%; }
}

/* Comparisons that contain substantial explanations are presented as an
   ordered list of table rows. The column headings are retained for assistive
   technology and repeated next to the corresponding fields for sighted readers. */
@media screen and (max-width: 700px) {
  main table[data-guide-mobile-table="stack"] { display: block; position: relative; border: 0; background: transparent; }
  main table[data-guide-mobile-table="stack"] thead,
  main table[data-guide-mobile-table="stack"] tbody { display: block; width: 100%; }
  main table[data-guide-mobile-table="stack"] tr[data-guide-mobile-header] {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  main table[data-guide-mobile-table="stack"] tr:not([data-guide-mobile-header]) {
    display: block; width: 100%; max-width: 100%; border: 1px solid var(--line);
    border-radius: 4px; overflow: hidden; margin: 0 0 7px; background: var(--card);
  }
  main table[data-guide-mobile-table="stack"] tr:not([data-guide-mobile-header]) > td {
    display: block; width: 100%; max-width: 100%; min-width: 0;
    border-bottom: 0; padding: 6px 9px; font-size: 13px; line-height: 1.43;
    background: var(--card); white-space: normal; overflow-wrap: anywhere;
  }
  main table[data-guide-mobile-table="stack"] tr:not([data-guide-mobile-header]) > td:first-child {
    background: #f1eee7; color: var(--ink); border-bottom: 1px solid var(--line);
    font-size: 13.5px; font-weight: 700; line-height: 1.4; padding: 7px 9px;
  }
  main table[data-guide-mobile-table="stack"] tr:not([data-guide-mobile-header]) > td:not(:first-child)::before {
    content: attr(data-guide-mobile-label); display: block; color: var(--accent-dark);
    font-size: 11px; font-weight: 700; line-height: 1.3; padding-bottom: 2px;
  }
  main table[data-guide-mobile-table="stack"] tr:not([data-guide-mobile-header]) > td:nth-child(n+3) { border-top: 1px solid #ede9e2; }
  main table[data-guide-mobile-table="stack"] tr:not([data-guide-mobile-header]) > td:last-child { padding-bottom: 8px; }
  main table[data-guide-mobile-table="stack"] tr:last-child { margin-bottom: 0; }
  main table[data-guide-mobile-table="fit"] { font-size: 12.5px; line-height: 1.4; }
  main table[data-guide-mobile-table="fit"] th, main table[data-guide-mobile-table="fit"] td { padding: 5px 5px; }
}
