:root {
  --bg: #f5f2ea;
  --paper: #fffdf8;
  --ink: #1d2433;
  --muted: #4a5163;
  --line: #c9c2b2;
  --soft: #ebe6d9;
  --accent: #1f5a85;
  --accent-ink: #ffffff;
  --mark: #b25e09;
  --dot: #ddd6c6;
  --warn-bg: #fbeee0;
  --warn-line: #d7a879;
  /* fills for terms shared by more than one relative; text on them is --ink */
  --t0: #f6c3b0; --t1: #bfdcf2; --t2: #cfe8bd; --t3: #f3dd96; --t4: #e2cbe9; --t5: #b5e3dc;
  --t6: #f4c4da; --t7: #ddd5c4; --t8: #c9d3f6; --t9: #f7cf9f; --t10: #d8e9a6; --t11: #c4e1ea;
  --t-ink: #1d2433;
  --slab: Rockwell, "Rockwell Nova", "Roboto Slab", "Zilla Slab", "DejaVu Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --paper: #181e27;
    --ink: #e7eaf0;
    --muted: #b0b8c8;
    --line: #394355;
    --soft: #212a36;
    --accent: #8cc0e8;
    --accent-ink: #0d1520;
    --mark: #f2a65a;
    --dot: #273041;
    --warn-bg: #2e231a;
    --warn-line: #7b5634;
    --t0: #7a3b2a; --t1: #24506f; --t2: #3c5f2a; --t3: #6b5512; --t4: #5b3a68; --t5: #1f5b55;
    --t6: #6e2f4d; --t7: #4f4838; --t8: #34437a; --t9: #74481b; --t10: #4d6219; --t11: #275566;
    --t-ink: #f3f5f8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans); }
.wrap { max-width: 78rem; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
[hidden] { display: none !important; }

.mast { padding: 22px 0 4px; }
.mast h1 { font: 700 clamp(1.6rem, 4.4vw, 2.4rem)/1.12 var(--slab); margin: 0 0 6px; }
.lede { margin: 0; max-width: 64ch; color: var(--muted); }
#tool { padding-top: 14px; padding-bottom: 32px; }

.note { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; margin: 0 0 12px; }
.note p { margin: 0 0 6px; }
.note p:last-child { margin: 0; }
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.note.ex { background: var(--soft); }

.lab { display: block; font-weight: 600; font-size: 1rem; margin: 0 0 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
input[type="text"], select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 4px; min-height: 44px; padding: 8px 10px; width: 100%; max-width: 100%;
}
select { padding-right: 6px; }
.btn {
  font: inherit; font-size: 16px; min-height: 44px; padding: 8px 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.quiet { border-color: transparent; background: none; color: var(--accent); text-decoration: underline; padding-left: 0; padding-right: 0; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* language, name, system, speaker */
.bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; }
.bar .seg { grid-column: 1 / -1; display: flex; align-items: center; gap: 0 12px; }
.bar .seg legend { float: left; margin: 0; }
@media (min-width: 48rem) { .bar { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; } .bar .seg { grid-column: auto; display: block; } .bar .seg legend { float: none; margin: 0 0 4px; } }
@media (max-width: 22.49rem) { .bar { grid-template-columns: minmax(0, 1fr); } }
.fld { min-width: 0; }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { padding: 0; }
.seg label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.seg label:first-of-type { border-radius: 4px 0 0 4px; }
.seg label:last-of-type { border-radius: 0 4px 4px 0; margin-left: -1px; }
.seg label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input { width: 18px; height: 18px; margin: 0; accent-color: var(--mark); }
.seg.small { display: flex; }
.seg.small .btn { border-radius: 0; }
.seg.small .btn:first-child { border-radius: 4px 0 0 4px; }
.seg.small .btn:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.sysnote { margin: 8px 0 4px; color: var(--muted); max-width: 72ch; }

.dist { margin: 6px 0 14px; }
.dist summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--accent); }
.dist summary::-webkit-details-marker { display: none; }
.dist summary::before { content: ""; flex: none; width: 8px; height: 8px; margin: 0 12px 0 4px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
.dist[open] summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .dist summary::before { transition: none; } }
.dgrid { display: grid; grid-template-columns: 1fr; gap: 10px 18px; padding: 6px 0 4px; }
@media (min-width: 44rem) { .dgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 70rem) { .dgrid { grid-template-columns: 1fr 1fr 1fr; } }
.chk { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.chk input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }

/* the chart */
.chart { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px 12px; margin: 0 0 22px; }
.chart-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
h2.sec { font: 700 1.25rem/1.25 var(--slab); margin: 4px 0 8px; }
.tree { background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px); background-size: 20px 20px; border-radius: 3px; }
.kin { display: block; width: 100%; height: auto; max-width: 1220px; margin: 0 auto; }
/* below about 1,070 px the tree would shrink its words under 14 px: it keeps that width and scrolls in its own box */
.tree { overflow-x: auto; }
.tree .kin { min-width: 1070px; }
.tree.scrolls { box-shadow: inset -14px 0 12px -10px rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.cue { margin: 0 0 6px; font-weight: 600; color: var(--accent); }
select:disabled { opacity: .6; }
.kin .ln path { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.kin .sym { stroke: var(--ink); stroke-width: 2; }
.kin .fillonly { stroke: none; }
.kin .nofill { fill: none; }
.kin .ego-sym, .mini .ego-sym { fill: var(--ink); stroke: var(--ink); stroke-width: 3; }
.kin .ego .num { fill: var(--bg); font-size: 11px; }
.kin text { text-anchor: middle; fill: var(--ink); font-family: var(--sans); }
.kin .num { font-size: 15px; font-weight: 700; fill: var(--t-ink); }
.kin .num.two { font-size: 11px; }
.kin .code { font-size: 13px; fill: var(--muted); letter-spacing: .02em; }
.kin .wd { font-size: 16px; font-weight: 600; }
.kin .ring { fill: none; stroke: var(--mark); stroke-width: 3.5; }
.kin [data-node] { cursor: pointer; outline: none; }
.kin .hit { fill: transparent; }
.kin [data-node]:focus-visible .sym { stroke: var(--mark); stroke-width: 4; }
.kin .cur .code { fill: var(--ink); font-weight: 700; }
.f-plain { fill: var(--paper); background: var(--paper); }
.f0 { fill: var(--t0); background: var(--t0); } .f1 { fill: var(--t1); background: var(--t1); }
.f2 { fill: var(--t2); background: var(--t2); } .f3 { fill: var(--t3); background: var(--t3); }
.f4 { fill: var(--t4); background: var(--t4); } .f5 { fill: var(--t5); background: var(--t5); }
.f6 { fill: var(--t6); background: var(--t6); } .f7 { fill: var(--t7); background: var(--t7); }
.f8 { fill: var(--t8); background: var(--t8); } .f9 { fill: var(--t9); background: var(--t9); }
.f10 { fill: var(--t10); background: var(--t10); } .f11 { fill: var(--t11); background: var(--t11); }
.key { margin: 8px 0 0; color: var(--muted); }
.pick { margin: 10px 0 0; min-height: 3em; }
.pick .who { font-weight: 700; }

/* the chart as a list (phones) */
.stack section { margin: 0 0 6px; }
.stack h3 { font: 700 1.05rem/1.3 var(--slab); margin: 12px 0 4px; }
.stack ul { list-style: none; margin: 0; padding: 0; }
.stack .kids { margin-left: 21px; padding-left: 12px; border-left: 2px solid var(--ink); }
.nb {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 10px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-radius: 4px;
  padding: 3px 6px; min-height: 46px; cursor: pointer;
}
.nb .syms { display: flex; gap: 2px; }
.nb .cd { color: var(--muted); }
.nb .wds { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-weight: 600; max-width: 11rem; overflow-wrap: anywhere; }
.nb .age, .nb .none { font-weight: 400; color: var(--muted); }
.nb.two { grid-template-columns: auto minmax(0, 1fr); }
.nb.two .wds { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 0 16px; align-items: baseline; text-align: left; max-width: none; }
.nb .nm { min-width: 0; }
.nb.on { background: var(--soft); box-shadow: inset 0 0 0 2px var(--mark); }
.mini { width: 38px; height: 36px; }
.mini .sym { stroke: var(--ink); stroke-width: 2.4; }
.mini text { text-anchor: middle; font: 700 15px var(--sans); fill: var(--t-ink); }

/* words, lookup, actions */
.cols { display: grid; grid-template-columns: 1fr; gap: 22px 32px; }
@media (min-width: 60rem) { .cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.terms { list-style: none; margin: 0; padding: 0; }
.term {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "b t" "b i" "b c";
  gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line);
}
@media (min-width: 36rem) { .term { grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "b t i" "b t c"; } }
.term .badge { grid-area: b; }
.term .tx { grid-area: t; min-width: 0; }
.term input { grid-area: i; align-self: start; }
.term .clash { grid-area: c; margin: 0; color: var(--mark); font-weight: 600; }
.term label { font-weight: 600; display: block; }
.term .cov { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--ink); font-weight: 700; color: var(--t-ink);
}
.badge.f-plain { color: var(--ink); }
.ask .asks { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 30rem) { .ask .asks { grid-template-columns: 1.4fr 1fr; } }
.out { margin: 10px 0 0; }
.out p { margin: 0 0 4px; }
.out ul { margin: 0 0 4px; padding-left: 20px; }
.out .sub { color: var(--muted); }
.acts { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.acts > * + * { margin-top: 12px; }
.add .row select { flex: 1 1 12rem; width: auto; }
.earlier summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }
.earlier ul { margin: 0; padding-left: 18px; }
.earlier li { margin: 4px 0; }

.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(36rem, calc(100% - 32px));
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 4px; display: flex; gap: 12px;
  align-items: center; justify-content: space-between; z-index: 20; pointer-events: none;
}
.toast button { pointer-events: auto; font: inherit; font-weight: 700; background: none; border: 1px solid var(--bg); color: var(--bg); border-radius: 4px; min-height: 40px; padding: 4px 12px; cursor: pointer; }

/* explanation */
.prose { padding-bottom: 36px; max-width: 78rem; }
.prose > p, .prose details, .prose table { max-width: 72ch; }
.prose h2 { font: 700 1.35rem/1.25 var(--slab); margin: 30px 0 10px; }
.systems { border-collapse: collapse; width: 100%; margin: 12px 0; }
.systems caption { text-align: left; font-weight: 600; margin-bottom: 6px; }
.systems th, .systems td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-top: 1px solid var(--line); }
.systems th[scope="row"] { white-space: nowrap; padding-right: 16px; }
.prose details { border-top: 1px solid var(--line); }
.prose details:last-of-type { border-bottom: 1px solid var(--line); }
.prose summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.prose details p { margin: 0 0 14px; }
.small-print { color: var(--muted); margin-top: 22px; }

.site-foot { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); }
.sb-footer p { margin: 0 0 10px; overflow-wrap: anywhere; }
.sb-more a { color: var(--accent); }
.sb-credit a, .sb-privacy a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

#print-root { display: none; }
/* the printed term table; also laid out off screen to measure where its pages break */
.p-measure { position: absolute; left: -10000px; top: 0; width: 255mm; visibility: hidden; }
.p-terms { break-before: page; border-collapse: collapse; width: calc(100% - 2px); margin: 1px; font-size: 10.5pt; }
.p-terms th, .p-terms td { border: 1px solid #777; padding: 3pt 6pt; text-align: left; vertical-align: top; }
.p-terms caption { text-align: left; font: 700 13pt/1.3 var(--slab); padding-bottom: 4pt; }
.p-terms tr { break-inside: avoid; }
.p-terms thead { display: table-header-group; }
.p-terms .p-n { width: 30pt; }
.p-terms .badge { width: 22pt; height: 22pt; font-size: 10pt; border-width: 1.5px; }
.p-terms .p-w { font-weight: 700; width: 22%; }
.p-blank { display: inline-block; width: 100%; min-width: 90pt; border-bottom: 1px solid #000; height: 12pt; }
@media print {
  @page { size: landscape; margin: 11mm 12mm; }
  :root {
    --ink: #000; --muted: #333; --paper: #fff; --bg: #fff; --line: #888; --mark: #000; --t-ink: #000;
    --t0: #f6c3b0; --t1: #bfdcf2; --t2: #cfe8bd; --t3: #f3dd96; --t4: #e2cbe9; --t5: #b5e3dc;
    --t6: #f4c4da; --t7: #ddd5c4; --t8: #c9d3f6; --t9: #f7cf9f; --t10: #d8e9a6; --t11: #c4e1ea;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  body > *:not(#print-root):not(.p-measure) { display: none !important; }
  #print-root { display: block !important; }
  .paper { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-head .p-title { font: 700 18pt/1.2 var(--slab); margin: 0 0 2pt; }
  .p-head p { margin: 0 0 6pt; font-size: 10.5pt; }
  .p-fig { margin: 0 0 4pt; break-inside: avoid; }
  .p-fig + .p-fig { break-before: page; }
  .p-fig figcaption { font-weight: 700; font-size: 11pt; margin: 0 0 2pt; }
  .p-fig .kin { width: 100%; max-width: none; max-height: 150mm; }
  .p-key { font-size: 10pt; margin: 2pt 0 0; }
}
