/* table-cards.css: the look of the tables that assets/table-cards.js shows as cards on a phone (640px and narrower).
   .tcard: a table with a heading row; each row is a card, each cell stands under the heading of its column.
   .tstack: label and value pairs; each label stands above its value.
   .twide: a long register; it stays a table that is pushed sideways, with a readable width for its columns of long text.
   Colors are not touched: a cell keeps its own ground and letters, and the small heading above it takes the color
   of the cell's own letters. Wider screens and print are not touched. 18 Nov 2026; revised 19 Nov 2026 after the audit:
   an empty cell is hidden from the eye only, so a screen reader still counts it and reads every later cell under its own heading;
   the small heading above a cell is for the eye only (a screen reader has the column heading already). */
@media screen and (max-width: 640px) {
  html table.tcard:not(#_):not(#_), html table.tstack:not(#_):not(#_) { display: block; width: 100% !important; min-width: 0 !important; max-width: 100% !important; overflow: visible !important; border: 0 !important; box-shadow: none !important; margin-left: 0 !important; margin-right: 0 !important; }
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot), html table.tstack:not(#_):not(#_) > :is(tbody, tfoot) { display: block; }
  /* one card for each row */
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr { display: block; margin: 0 0 0.8rem; padding: 0; overflow: hidden; border: 1px solid var(--m-line, #d8c8a8); border-radius: 6px; }
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr > :is(td, th) { display: block; position: static !important; width: auto !important; min-width: 0 !important; max-width: none !important; height: auto !important; padding: 0.5rem 0.85rem 0.55rem !important; border: 0 !important; border-radius: 0 !important; text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; }
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr > :is(td, th):not(.tcard-none) ~ :is(td, th):not(.tcard-none) { border-top: 1px solid var(--m-line, #d8c8a8) !important; }
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr > [data-th]::before { content: attr(data-th); content: attr(data-th) / ""; display: block; margin: 0 0 0.1rem; font-family: 'Source Serif 4', Georgia, serif; font-size: 0.72rem; font-weight: 700; font-style: normal; line-height: 1.35; letter-spacing: 0.07em; text-transform: uppercase; color: inherit; }
  /* a long heading (more than 40 letters) is set as a line of text, not in spaced capitals */
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr > [data-th].tcard-long::before { font-size: 0.8rem; letter-spacing: 0; text-transform: none; }
  /* an empty cell takes no room, and stays in the page for screen readers */
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr > .tcard-none { position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
  /* the heading row stays in the page for screen readers */
  html table.tcard:not(#_):not(#_) > thead, html table.tcard:not(#_):not(#_) > tbody > tr.tcard-head { display: block; position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
  /* a line that spans the table (a heading inside the table) is not a card */
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr.tcard-group { border: 0; border-radius: 0; margin: 0 0 0.4rem; }
  html table.tcard:not(#_):not(#_) > :is(tbody, tfoot) > tr.tcard-group > :is(td, th) { padding: 0.4rem 0 0.2rem !important; }
  /* a long register: a table that is pushed sideways inside its own frame */
  html table.twide:not(#_):not(#_) { display: block; max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  html table.twide:not(#_):not(#_) > :is(thead, tbody, tfoot) > tr > .twide-long { min-width: 15rem !important; }
  /* label and value pairs */
  html table.tstack:not(#_):not(#_) > :is(tbody, tfoot) > tr { display: block; padding: 0.6rem 0; border-bottom: 1px solid var(--m-line, #d8c8a8); }
  html table.tstack:not(#_):not(#_) > :is(tbody, tfoot) > tr:last-child { border-bottom: 0; }
  html table.tstack:not(#_):not(#_) > :is(tbody, tfoot) > tr > :is(td, th) { display: block; width: auto !important; min-width: 0 !important; max-width: none !important; padding: 0 0.85rem !important; border: 0 !important; text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; }
  html table.tstack:not(#_):not(#_) > :is(tbody, tfoot) > tr > :is(td, th):first-child:not(:only-child) { margin: 0 0 0.15rem; }
}
