 :root {color-scheme:light dark} body{margin:0;background:#f5efe4;color:#30251d} .preview-head,.preview-main{max-width:1180px;margin:auto;padding:24px} .preview-head{border-bottom:1px solid #a98761} .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}.card{border:1px solid #a98761;border-radius:12px;padding:20px}.card h2{font-size:1.35rem}.mark{display:inline-block;vertical-align:middle;object-fit:contain;flex-shrink:0;margin-right:8px}.pending{border:1px solid currentColor;padding:12px;display:inline-block}.layout{display:grid;grid-template-columns:265px minmax(0,1fr);gap:32px}.topic-toc{align-self:start;position:sticky;top:12px;max-height:95vh;overflow:auto;font-size:.95rem}.topic-toc ol{padding-left:24px}.topic-toc li{margin:0 0 12px}.prose{max-width:none;min-width:0}.prose h1{font-size:1.7rem}.source-section{border-top:2px solid #a98761;margin-top:40px;padding-top:20px;scroll-margin-top:16px}.source-section article>h2{font-size:1.6rem}.prose img,.prose svg{max-width:100%;height:auto} .prose pre{overflow:auto}.prose table{display:block;max-width:100%;overflow:auto}.prose{overflow-wrap:anywhere}.section-meta{font-size:.85rem}.fallback{border:1px solid #a98761;padding:12px;margin:20px 0}.fallback a{display:inline-block;margin:4px 12px 4px 0}.topic-title{display:flex;align-items:center}.topic-title h1{font-size:2rem} @media(max-width:760px){.layout{display:block}.topic-toc{position:static;max-height:none}.preview-head,.preview-main{padding:16px}.topic-title h1{font-size:1.6rem}} @media(prefers-color-scheme:dark){body{background:#18130f;color:#eee0cc} a{color:#e9b77d}.card,.fallback{background:#231c16}}
/* Only the outer topic nav receives sticky/height/overflow layout. */
.question-id{white-space:nowrap}
:focus-visible{outline:3px solid #b55b16;outline-offset:4px}
[id]{scroll-margin-top:24px}
.site-header{position:relative}
.fallback{font-size:.85rem;padding:8px 12px}
.fallback p{margin:4px 0}
.recovery-links{display:block;white-space:nowrap;overflow-x:auto}
.fallback a{margin:2px 12px 2px 0}
html[data-theme="dark"] body{background:#18130f;color:#eee0cc}
html[data-theme="dark"] .card,html[data-theme="dark"] .fallback{background:#231c16}
html[data-theme="light"] body{background:#f5efe4;color:#30251d}
html[data-theme="light"] .card,html[data-theme="light"] .fallback{background:#f5efe4}
.local-stamp{font-size:.8rem}
.bridge-candidates{list-style:none;margin:6px 0 2px;padding:0}
.bridge-candidates li{margin:0 0 6px;padding:0}
.fallback .bridge-candidates a{display:inline;margin:0}
.fallback #bridge-status{margin:4px 0}

/* Print Addition D: wrap whole-line IGT rows (marked tr.igt-line by the builder) at spaces only. */
@media print{main.preview-main table.igt tr.igt-line>td,main.preview-main table.igt tr.igt-line>th{white-space:normal;overflow-wrap:normal;word-break:normal}}

/* PROPOSED (rev 2): topics-only print rules. Draft, not staged, not rendered.
   Append at the very END of /assets/topics.css. Load order: site.css, print.css[media=print], trees.css, topics.css.
   Scope: main.preview-main exists only on /topics/ pages (verified: no other HTML file has it).
   Topic <body> has no unique class (body.sec-syntax is shared), so the page-level override uses body:has(main.preview-main).
   :has() support: Chromium 105+, Safari 15.4+, Firefox 121+. WeasyPrint/Prince/older engines ignore the whole rule, and the
   page then falls back to print.css (body #fff/#000, already global there). */
@media print {
  /* 0. Paper palette: page-level background only, scoped. Status/border tokens are NOT reset by print.css. */
  body:has(main.preview-main) { background: #fff !important; color: #000 !important; }
  main.preview-main {
    --bg:#fff; --surface:#fff; --raise:#fff; --text:#000; --ink:#000; --muted:#333;
    --rule:#999; --line:#999; --link:#000; --accent:#000;
    /* light-theme badge values from site.css (dark/auto-dark set #8fd6b4-on-#163228 etc., which prints badly) */
    --src:#0f5c3d; --src-bg:#d7efe3; --hyp:#8a4b08; --hyp-bg:#f6e6cf;
    --op:#4a4a4a;  --op-bg:#e4e4e4;  --gr:#4b2a86;  --gr-bg:#e6def5;
    color: #000; background: #fff;
    max-width: none; padding: 0;
  }
  main.preview-main .card,
  main.preview-main .fallback { background: #fff !important; color: #000; border-color: #999; }

  /* 1. Layout: single full-width column */
  main.preview-main .layout { display: block; }
  main.preview-main .prose { max-width: none; min-width: 0; overflow: visible; }

  /* 2. TOC: static, full width, no clamps */
  main.preview-main .topic-toc {
    position: static; top: auto; max-height: none; overflow: visible;
    width: auto; margin: 0 0 8mm; font-size: 10pt; break-inside: auto;
  }
  main.preview-main .topic-toc li { margin: 0 0 2pt; break-inside: avoid; }

  /* 3. Legacy recovery: redundant same-page #links; "scroll sideways" untrue on paper */
  main.preview-main #legacy-recovery { display: none !important; }

  /* 4. Release clipping containers */
  main.preview-main .table-wrap,
  main.preview-main .ex { overflow: visible !important; }
  main.preview-main * { content-visibility: visible; contain: none; }

  /* 5. Data tables (non-.igt). Specificity (0,3,2) beats topics.css .prose table (0,1,1).
        overflow-wrap:normal = break only at spaces/hyphens. An unbroken Navajo token longer than its cell
        WILL overflow visibly (not cut, not hidden): that is a documented exception → .print-wide / landscape (see MD). */
  main.preview-main .prose table:not(.igt) {
    display: table; width: 100%; max-width: 100%; min-width: 0 !important;
    table-layout: auto; border-collapse: collapse; overflow: visible;
    font-size: 9.5pt; line-height: 1.35;
    break-inside: auto !important;
  }
  main.preview-main .prose table:not(.igt) th,
  main.preview-main .prose table:not(.igt) td {
    overflow-wrap: normal; word-break: normal; hyphens: manual;
    white-space: normal; vertical-align: top; padding: 2pt 4pt;
    border-color: #999; background: #fff; color: #000;
  }
  main.preview-main .prose table:not(.igt) th { background: #f2f2f2; }
  main.preview-main .prose table tr { break-inside: avoid; }
  main.preview-main .prose thead { display: table-header-group; }   /* effective only after builder emits <thead> */

  /* 6. IGT. (0,2,2) beats .prose table{display:block;overflow:auto} (0,1,1) and site.css table.igt (0,1,1). */
  main.preview-main table.igt { display: table; width: auto; max-width: none; overflow: visible; break-inside: auto !important; }
  main.preview-main table.igt td { white-space: nowrap; overflow-wrap: normal; border: none; }   /* alignment is data */
  main.preview-main .ex { break-inside: avoid; background: #fff; border-color: #999; }

  /* 7. pre.rules: contains Navajo forms. pre-wrap breaks at spaces only (overflow-wrap normal); long tokens overflow visibly. */
  main.preview-main .prose pre {
    white-space: pre-wrap; overflow: visible !important; overflow-wrap: normal; word-break: normal;
    font-size: 8.5pt; break-inside: auto !important; background: #fff; border-color: #999; color: #000;
  }
  main.preview-main .question-id { white-space: nowrap; }

  /* 8. Pagination */
  main.preview-main .source-section { break-inside: auto; border-top-color: #666; margin-top: 10mm; padding-top: 4mm; }
  main.preview-main .source-section article > h2 { break-after: avoid; font-size: 15pt; }
  main.preview-main .mark { width: 14pt; height: 14pt; }
}

/* ADDITION A (tested in print-stage; Web Designer signed off): IGT full-width rows.
   td[colspan] matches the free-translation (td.tr), "source:" and note rows, and ALSO some .nv/.gl rows
   (18 in T1, 6 in T2) that are whole unsegmented lines rather than word-aligned cells; those wrap at spaces too.
   Ordinary aligned token cells (no colspan) stay nowrap from Rev 2 §6, so word/gloss alignment is preserved. */
@media print {
  main.preview-main table.igt td[colspan], main.preview-main table.igt td.tr { white-space: normal; overflow-wrap: normal; word-break: normal; }
}

/* ADDITION B: link ink in print, independent of screen theme.
   Cause: topics.css line 1 has @media(prefers-color-scheme:dark){ a{color:#e9b77d} } (hard-coded, bypasses --link),
   which still matches during print when the OS/browser is dark; site.css dark tokens also set --link:#eaa877.
   Rev 2 sets --link:#000 on main.preview-main, so route every link (TOC, .section-meta/"was" source lines, .cite,
   .wn-banner, .verbs-on, .tldr-more, inline prose, IGT .tr) back to it. (0,1,2)+ beats the bare `a` (0,0,1). */
@media print {
  main.preview-main a, main.preview-main a:link, main.preview-main a:visited,
  main.preview-main .topic-toc a, main.preview-main .section-meta, main.preview-main .section-meta a {
    color: var(--link, #000) !important; text-decoration-color: currentColor;
  }
  /* Site footer links on topic pages hit the same bare dark `a` rule (found in PDF: #e9b77d, 1.82:1). Topics-only scope. */
  body:has(main.preview-main) footer a { color: #000 !important; }
  /* Not a link, same cause: dark --sec-syntax (#7fc4c9, 1.97:1 on white) colours list numbers in T1 (PDF pp. 15-17).
     Reset to its light-theme value from site.css. */
  main.preview-main { --sec-syntax: #1c5a61; --sec: #1c5a61; }   /* --sec is resolved from --sec-syntax on body.sec-syntax, so reset both */
}

/* T3 (WD T3-REVIEW B2-B4, Artiste label note). */
@media print{main.preview-main table.igt tr.igt-last>td:last-child{white-space:normal;overflow-wrap:normal;word-break:normal}main.preview-main table.igt th{overflow-wrap:normal}main.preview-main table.igt.igt-compact td{font-size:.88rem;padding-right:.6rem}main.preview-main table.igt.igt-compact tr.nv td{font-size:.92rem}main.preview-main table.igt.igt-compact tr.gl td{font-size:.72rem}}
main.preview-main .prose .badge:not(td .badge,th .badge){white-space:normal;max-width:100%;box-sizing:border-box}
main.preview-main table.igt td.igt-label{white-space:nowrap;overflow-wrap:normal}
/* Artiste screen fix (T3 only via .igt-nobreak): beat .prose{overflow-wrap:anywhere} and
   .prose table{display:block}. Restore real table layout + intrinsic width so .ex
   (site.css overflow-x:auto) sideways-scrolls; token/gloss cells nowrap; free-translation
   last cells still wrap at spaces. No global ≤760px IGT rule (keeps T1/T2/T5 screens unchanged). */
@media screen{
  main.preview-main .prose table.igt.igt-nobreak{
    display:table;width:auto;max-width:none;overflow:visible
  }
  main.preview-main table.igt.igt-nobreak td,
  main.preview-main table.igt.igt-nobreak th{
    overflow-wrap:normal;word-break:normal;white-space:nowrap
  }
  main.preview-main table.igt.igt-nobreak tr.igt-last>td:last-child,
  main.preview-main table.igt.igt-nobreak td.tr{
    white-space:normal;overflow-wrap:normal;word-break:normal;min-width:14em
  }
}
@media screen{main.preview-main table.igt.igt-nobreak .igt-nw{white-space:nowrap}}
@media screen{main.preview-main .ex[data-igt-scroll]:focus-visible{outline:3px solid #b55b16;outline-offset:2px}}

/* T4 print reflow (allowlisted via igt-last-rows.json print_reflow_tables; possessor-yi (7)): stacked row groups 2,3,4/5,6, glosses at normal IGT size. */
@media print{main.preview-main table.igt.igt-reflow{display:grid;grid-template-columns:auto repeat(3,auto);justify-content:start;column-gap:.9rem;width:auto;max-width:100%}
main.preview-main table.igt.igt-reflow>tbody,main.preview-main table.igt.igt-reflow tr{display:contents}main.preview-main table.igt.igt-reflow td{display:block;padding:.05rem 0;white-space:nowrap}
main.preview-main table.igt.igt-reflow td.tr{white-space:normal;grid-column:1/-1;margin:0 0 .45rem}
main.preview-main table.igt.igt-reflow tr:nth-child(1)>td:nth-child(1){grid-row:1;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(1)>td:nth-child(2){grid-row:1;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(1)>td:nth-child(3){grid-row:1;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(1)>td:nth-child(4){grid-row:1;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(1)>td:nth-child(5){grid-row:3;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(1)>td:nth-child(6){grid-row:3;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(2)>td:nth-child(1){grid-row:2;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(2)>td:nth-child(2){grid-row:2;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(2)>td:nth-child(3){grid-row:2;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(2)>td:nth-child(4){grid-row:2;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(2)>td:nth-child(5){grid-row:4;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(2)>td:nth-child(6){grid-row:4;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(3)>td{grid-row:5}
main.preview-main table.igt.igt-reflow tr:nth-child(4)>td:nth-child(1){grid-row:6;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(4)>td:nth-child(2){grid-row:6;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(4)>td:nth-child(3){grid-row:6;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(4)>td:nth-child(4){grid-row:6;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(4)>td:nth-child(5){grid-row:8;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(4)>td:nth-child(6){grid-row:8;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(5)>td:nth-child(1){grid-row:7;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(5)>td:nth-child(2){grid-row:7;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(5)>td:nth-child(3){grid-row:7;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(5)>td:nth-child(4){grid-row:7;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(5)>td:nth-child(5){grid-row:9;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(5)>td:nth-child(6){grid-row:9;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(6)>td{grid-row:10}
main.preview-main table.igt.igt-reflow tr:nth-child(7)>td:nth-child(1){grid-row:11;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(7)>td:nth-child(2){grid-row:11;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(7)>td:nth-child(3){grid-row:11;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(7)>td:nth-child(4){grid-row:11;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(7)>td:nth-child(5){grid-row:13;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(7)>td:nth-child(6){grid-row:13;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(8)>td:nth-child(1){grid-row:12;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(8)>td:nth-child(2){grid-row:12;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(8)>td:nth-child(3){grid-row:12;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(8)>td:nth-child(4){grid-row:12;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(8)>td:nth-child(5){grid-row:14;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(8)>td:nth-child(6){grid-row:14;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(9)>td{grid-row:15}
main.preview-main table.igt.igt-reflow tr:nth-child(10)>td:nth-child(1){grid-row:16;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(10)>td:nth-child(2){grid-row:16;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(10)>td:nth-child(3){grid-row:16;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(10)>td:nth-child(4){grid-row:16;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(10)>td:nth-child(5){grid-row:18;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(10)>td:nth-child(6){grid-row:18;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(11)>td:nth-child(1){grid-row:17;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(11)>td:nth-child(2){grid-row:17;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(11)>td:nth-child(3){grid-row:17;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(11)>td:nth-child(4){grid-row:17;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(11)>td:nth-child(5){grid-row:19;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(11)>td:nth-child(6){grid-row:19;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(12)>td{grid-row:20}
main.preview-main table.igt.igt-reflow tr:nth-child(13)>td:nth-child(1){grid-row:21;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(13)>td:nth-child(2){grid-row:21;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(13)>td:nth-child(3){grid-row:21;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(13)>td:nth-child(4){grid-row:21;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(13)>td:nth-child(5){grid-row:23;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(13)>td:nth-child(6){grid-row:23;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(14)>td:nth-child(1){grid-row:22;grid-column:1}
main.preview-main table.igt.igt-reflow tr:nth-child(14)>td:nth-child(2){grid-row:22;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(14)>td:nth-child(3){grid-row:22;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(14)>td:nth-child(4){grid-row:22;grid-column:4}
main.preview-main table.igt.igt-reflow tr:nth-child(14)>td:nth-child(5){grid-row:24;grid-column:2}
main.preview-main table.igt.igt-reflow tr:nth-child(14)>td:nth-child(6){grid-row:24;grid-column:3}
main.preview-main table.igt.igt-reflow tr:nth-child(15)>td{grid-row:25}}
/* IGT scroll cue (screen only; boxes igt-scroll.js marks data-igt-scroll, i.e. pages with .igt-nobreak = T3, T4).
   Right-edge shadow that disappears at the scroll end (local cover over a fixed shadow), plus a visual-only
   'scroll' hint floated in the example caption (aria-label already says 'scrollable'). */
@media screen{main.preview-main .ex[data-igt-scroll]{background:linear-gradient(to left,var(--raise) 45%,transparent) right center/2.75rem 100% no-repeat local,linear-gradient(to left,color-mix(in srgb,var(--text) 24%,transparent),transparent) right center/1.1rem 100% no-repeat scroll,var(--raise)}
main.preview-main .ex[data-igt-scroll]>.num::after{content:"Scroll sideways"/"";float:right;margin-left:1rem;padding:0 .4rem;border:1px solid var(--line);border-radius:3px;font-weight:400;font-size:.75rem;line-height:1.5;color:var(--muted)}}

/* ADDITION C (T5 stage, not yet signed off): reset the other sections' dark colour variables in print.
   Light-theme values copied from site.css :root. Topics-only scope (main.preview-main / body:has()). */
@media print {
  main.preview-main, body:has(main.preview-main) {
    --sec-vocab: #8a3510; --sec-background: #55602a; --sec-essays: #6e3560; --sec-subscribe: #8a4b00;
    --sec-syntax: #1c5a61; --sec: #1c5a61;
  }
}
