/* Keyboard-state input: site styles.
   Three colours carry meaning everywhere: ink = text as meant; vermilion = text as typed (the
   keyboard-state form); blue = the model was told the keyboard state. Greys are neutral. */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"), url("../fonts/IBMPlexMono-Regular.otf") format("opentype");
  font-weight: 400 500; font-style: normal; font-display: swap;  /* one weight serves 400 and 500: 43 KB less to load */
}

:root {
  --bg: #ffffff;
  --bg-2: #f5f5f3;
  --ink: #111111;
  --ink-2: #4d4d4d;     /* 8.5:1 on white */
  --ink-3: #6e6e6e;     /* 5.1:1 on white */
  --rule: #d6d6d6;
  --rule-2: #ebebeb;
  --typed: #c8341a;     /* 5.30:1 on white */
  --told: #1f5aa6;      /* 6.84:1 on white */
  --pale: #e6e6e6;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --fs-0: 0.8125rem;   /* 13 */
  --fs-1: 0.9375rem;   /* 15 */
  --fs-2: 1.0625rem;   /* 17 body */
  --fs-3: 1.25rem;     /* 20 lead */
  --fs-4: 1.625rem;    /* 26 h3 / big */
  --fs-5: 2.125rem;    /* 34 h2 */
  --gap: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #141414; --bg-2: #1d1d1d; --ink: #ededed; --ink-2: #b5b5b5; --ink-3: #8c8c8c;
    --rule: #3a3a3a; --rule-2: #2a2a2a; --typed: #f2735a; --told: #7ea8f0; --pale: #3a3a3a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --bg-2: #1d1d1d; --ink: #ededed; --ink-2: #b5b5b5; --ink-3: #8c8c8c;
  --rule: #3a3a3a; --rule-2: #2a2a2a; --typed: #f2735a; --told: #7ea8f0; --pale: #3a3a3a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: var(--fs-2); line-height: 1.5;
  font-variant-numeric: tabular-nums; overflow-wrap: break-word;
}
.no-js .js-only, html:not(.js) .js-only { display: none !important; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
code, .mono, .mid { font-family: var(--mono); font-size: 0.92em; }
.mid { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
[lang|="zh"] { font-family: var(--cjk); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--bg); padding: 8px 12px; border: 2px solid var(--ink); z-index: 10; }
.skip:focus { top: 8px; }
.small { font-size: var(--fs-0); color: var(--ink-2); line-height: 1.45; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gap); }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-5); font-weight: 700; }
h3 { font-size: var(--fs-3); font-weight: 700; margin-top: 1.6em; margin-bottom: 0.4em; }
p { margin: 0.6em 0; max-width: 68ch; }
.lede { font-size: var(--fs-2); color: var(--ink-2); max-width: 64ch; }
.nojs { border-left: 3px solid var(--ink-3); padding-left: 12px; }

/* ---------------------------------------------------------------- header */
[id] { scroll-margin-top: 60px; }
.bar { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: 1180px; margin: 0 auto; padding: 0 var(--gap); display: flex; align-items: center; gap: 10px; min-height: 50px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: var(--fs-1); flex: 0 0 auto; min-height: 44px; }
.brand-key { position: relative; width: 30px; height: 30px; border: 1.5px solid var(--ink); border-radius: 5px; flex: 0 0 auto; }
.bk-t { position: absolute; left: 4px; top: 0; font-family: var(--mono); font-weight: 500; color: var(--typed); font-size: 0.95rem; line-height: 1.2; }
.bk-m { position: absolute; right: 4px; bottom: 1px; font-size: 0.62rem; line-height: 1; }
.brand-txt { display: none; }
.nav { display: flex; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; font-size: 0.875rem; padding: 14px 6px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.theme-btn { font: inherit; font-size: var(--fs-0); background: none; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 4px; min-height: 36px; min-width: 36px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; flex: 0 0 auto; }
.theme-txt { display: none; }
.theme-ico { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
@media (min-width: 560px) { .theme-txt { display: inline; } }
@media (min-width: 760px) {
  .bar-in { min-height: 52px; }
  .brand-txt { display: inline; }
  .nav { justify-content: flex-end; }
  .nav a { font-size: var(--fs-1); padding: 14px 8px; }
}

/* ---------------------------------------------------------------- shared controls */
.seg {
  font: inherit; font-size: var(--fs-1); color: var(--ink); background: var(--bg);
  border: 1px solid var(--ink-3); border-radius: 4px; min-height: 44px; padding: 6px 12px; cursor: pointer;
  line-height: 1.2; text-align: center;
}
.seg:hover { border-color: var(--ink); }
.seg[aria-pressed="true"], .seg[aria-checked="true"], .seg[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg .seg-sub { display: block; font-size: var(--fs-0); opacity: 0.8; }
.seg.nodata { border-style: dashed; color: var(--ink-2); }
.seg.nodata[aria-checked="true"] { color: var(--bg); }
.seggroup { display: flex; gap: 6px; }
.wrapline { flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-lbl { font-size: var(--fs-0); color: var(--ink-2); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
select {
  font: inherit; font-size: var(--fs-1); color: var(--ink); background: var(--bg); border: 1px solid var(--ink-3);
  border-radius: 4px; min-height: 44px; padding: 6px 10px; max-width: 100%; width: 100%;
}

/* ---------------------------------------------------------------- hero */
.hero { padding: 14px 0 6px; }
.kicker { font-size: var(--fs-0); color: var(--ink-2); margin: 0 0 8px; }
.flip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.flip-lbl { font-size: var(--fs-0); color: var(--ink-2); margin-right: 4px; }
.flip .seg { min-height: 36px; font-size: var(--fs-0); padding: 4px 10px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.headline {
  font-size: clamp(1.9rem, 4.2vw + 0.9rem, 3.4rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 10px;
}
.headline .hl { display: block; }
.headline.is-typed .hl { font-family: var(--mono); font-weight: 500; color: var(--typed); letter-spacing: -0.04em; font-size: 0.8em; line-height: 1.12; overflow-wrap: anywhere; }
.hl-note { font-size: var(--fs-1); color: var(--ink-2); margin: 10px 0 0; }
@media (min-width: 900px) {
  .hero { padding-top: 24px; }
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0; }
  .hcol-g { padding-right: 32px; }
  .hcol-a { border-left: 1px solid var(--rule); padding-left: 32px; }
  .headline { font-size: clamp(2.6rem, 4.1vw, 3.6rem); min-height: 2.1em; }
}
.ex { margin: 0; }
/* typed keys, an arrow, the text as meant: in one row on narrow screens (labels below), stacked from 900 px */
.ex-row { display: grid; grid-template-columns: min-content 26px minmax(0, 1fr); grid-template-areas: "keys arrow word" "lab1 . lab2";
          column-gap: 8px; row-gap: 4px; align-items: center; }
.ex-side { display: contents; }
.ex-side:first-child .ex-keys { grid-area: keys; }
.ex-side:first-child .ex-lab { grid-area: lab1; align-self: start; }
.ex-side:last-child > :first-child { grid-area: word; }
.ex-side:last-child .ex-lab { grid-area: lab2; align-self: start; }
.ex-arrow { grid-area: arrow; }
.ex-keys { display: flex; gap: 3px; flex-wrap: nowrap; }
.cap {
  position: relative; width: clamp(1.55rem, 6.7vw, 2.4rem); aspect-ratio: 1; border: 1.5px solid var(--ink);
  border-radius: 5px; background: var(--bg); flex: 0 0 auto;
}
.cap-t { position: absolute; left: 11%; top: 0; font-family: var(--mono); font-weight: 500; color: var(--typed); font-size: clamp(0.9rem, 3.9vw, 1.3rem); line-height: 1.15; }
.cap-m { position: absolute; right: 10%; bottom: 4%; font-size: clamp(0.6rem, 2.4vw, 0.8rem); color: var(--ink); line-height: 1; }
.ex-lab { font-size: var(--fs-0); color: var(--ink-2); margin: 0; line-height: 1.3; }
.lab-typed { color: var(--typed); font-weight: 700; }
.lab-meant { color: var(--ink); font-weight: 700; }
.ex-arrow { position: relative; width: 22px; height: 2px; background: var(--ink); justify-self: center; }
.ex-arrow::after { content: ""; position: absolute; right: -2px; top: -6px; border: 7px solid transparent; border-left: 9px solid var(--ink); border-right: 0; }
.ex-word-row { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ex-word { font-size: clamp(1.55rem, 7vw, 2.3rem); font-weight: 500; line-height: 1; letter-spacing: -0.01em; }
.gloss { color: var(--ink-2); font-size: var(--fs-0); }
.toned { font-family: var(--mono); font-size: var(--fs-0); }
.ex-words { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ex-w { display: flex; align-items: baseline; gap: 8px; }
.ex-w .ex-word { font-size: clamp(1.4rem, 6.2vw, 2.2rem); }
.ex-or { color: var(--ink-2); font-size: var(--fs-0); line-height: 1; }
.ex-sub { font-size: var(--fs-0); white-space: nowrap; }
.ex-cap { font-size: var(--fs-0); color: var(--ink-2); max-width: 52ch; margin-top: 8px; line-height: 1.45; }
.ex-cap strong { color: var(--ink); }
@media (min-width: 900px) {
  .ex-row { display: block; }
  .ex-side { display: block; }
  .ex-side:first-child .ex-lab { margin-top: 6px; }
  .ex-side:last-child .ex-lab { margin-top: 6px; }
  .cap { width: clamp(2.6rem, 4.2vw, 3.5rem); border-radius: 7px; }
  .cap-t { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
  .cap-m { font-size: clamp(0.85rem, 1.2vw, 1.1rem); }
  .ex-keys { gap: 6px; }
  .ex-arrow { display: block; width: 2px; height: 24px; margin: 10px 0 14px calc(clamp(2.6rem, 4.2vw, 3.5rem) / 2 - 1px); }
  .ex-arrow::after { right: auto; left: -6px; top: auto; bottom: -8px; border: 7px solid transparent; border-top: 9px solid var(--ink); border-bottom: 0; }
  .ex-word-row { flex-direction: row; align-items: baseline; gap: 10px; }
  .ex-word { font-size: clamp(2.6rem, 4.6vw, 3.8rem); }
  .gloss { font-size: var(--fs-1); }
  .ex-words { flex-direction: row; gap: 18px; }
  .ex-w { flex-direction: column; gap: 4px; }
  .ex-w .ex-word { font-size: clamp(2.4rem, 4.2vw, 3.4rem); }
  .ex-or { font-size: var(--fs-1); margin-top: 0.9em; }
  .toned, .ex-sub, .ex-sub .gloss { font-size: var(--fs-1); }
  .ex-cap { font-size: var(--fs-1); margin-top: 12px; }
}
/* the result in three numbers, the status, and where to go next */
.hero-result { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.hero-tag { font-size: var(--fs-0); color: var(--ink-2); margin: 0 0 6px; }
.deck { font-size: var(--fs-2); line-height: 1.42; max-width: 60ch; margin: 0 0 10px; }
.hero-nums { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 12px; }
.hero-nums li { display: contents; }
.hn-big, .hn-txt { border-top: 1px solid var(--rule-2); padding: 6px 0; }
.hn-big { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; white-space: nowrap; }
.hn-big .num { white-space: nowrap; }
.hn-txt { font-size: var(--fs-1); line-height: 1.38; color: var(--ink); }
.hero-floor { margin: 6px 0 0; max-width: 70ch; }
@media (min-width: 900px) {
  .deck { font-size: var(--fs-3); line-height: 1.38; max-width: 56ch; }
  .hero-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
  .hero-nums li { display: block; border-top: 2px solid var(--ink); padding-top: 8px; }
  .hn-big, .hn-txt { border-top: 0; padding: 0; }
  .hn-big { display: block; font-size: clamp(2rem, 2.8vw, 2.6rem); line-height: 1.1; margin-bottom: 4px; }
  .hn-txt { display: block; }
}
.status-line { font-size: var(--fs-0); color: var(--ink-2); max-width: 78ch; margin-top: 10px; }
.st { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--ink-2); border-radius: 3px; color: var(--ink-2); vertical-align: 0.1em; white-space: nowrap; }
.st-interim { border-style: dashed; }
.st-final { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.st-none { border-style: dotted; color: var(--ink-3); border-color: var(--ink-3); }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: var(--fs-1); }
.jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-weight: 500; text-decoration: none;
          border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: 0 2px 0 var(--ink); }
.jump a:hover { text-decoration: underline; }
.jump a:active { box-shadow: none; transform: translateY(2px); }

/* ---------------------------------------------------------------- converter */
.try { padding: 26px 0 36px; border-top: 1px solid var(--rule); margin-top: 22px; }
.try h2 { font-size: var(--fs-4); }
.conv { margin-top: 16px; }
.conv-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.conv-row .field { flex: 1 1 260px; }
.io { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 760px) { .io { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.io-lbl { display: block; font-size: var(--fs-0); color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.io-lbl .lab-typed, .io-lbl .lab-meant { text-transform: none; }
textarea, output#conv-out {
  display: block; width: 100%; min-height: 6.2em; font-family: var(--mono); font-size: 1.12rem; line-height: 1.45;
  border: 1px solid var(--ink-3); border-radius: 4px; padding: 10px 12px; background: var(--bg); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
textarea { resize: vertical; }
@media (max-width: 620px) { textarea, output#conv-out { min-height: 4.2em; } }
output#conv-out { background: var(--bg-2); border-color: var(--rule); }
output#conv-out.as-typed { color: var(--typed); }
#conv-in.as-typed { color: var(--typed); caret-color: var(--typed); }
.io-meta { font-size: var(--fs-0); color: var(--ink-2); margin: 6px 0 0; }
.conv-note { margin: 8px 0 0; max-width: 80ch; }
.conv-ch { font-family: var(--mono); font-size: 0.95em; padding: 0 3px; border: 1px solid var(--rule); border-radius: 3px; white-space: pre; unicode-bidi: isolate; }
.conv-q { unicode-bidi: isolate; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.presets .seg { font-size: var(--fs-0); min-height: 40px; max-width: 100%; text-align: left; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.presets .seg span[lang] { unicode-bidi: isolate; }
.pre-txt.as-typed { font-family: var(--mono); color: var(--typed); }
.pre-src { font-size: 0.75rem; color: var(--ink-2); }
.kbd-wrap { margin-top: 18px; max-width: 760px; }
.kbd-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kbd-key { font-size: var(--fs-0); color: var(--ink-2); margin: 0; }
.kbd-dead { text-decoration: underline dotted; }
.kbd-head .seg { min-height: 40px; font-size: var(--fs-0); }
.kbd { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; -webkit-user-select: none; user-select: none; }
.kbd-row { display: flex; gap: 4px; }
.k {
  position: relative; flex: 1 1 0; min-width: 0; aspect-ratio: 1 / 1.06; border: 1px solid var(--ink-3); border-radius: 5px;
  background: var(--bg); padding: 0; margin: 0; font: inherit; color: var(--ink); cursor: pointer; overflow: hidden;
  -webkit-appearance: none; appearance: none;
}
.k:focus-visible { outline-offset: 1px; z-index: 1; }
.k.k-space { flex: 8 1 0; aspect-ratio: auto; height: 34px; }
.k-gap { flex: 0.5 1 0; }
.k-gap2 { flex: 1 1 0; }
.k-gap3 { flex: 2.5 1 0; }
.k .ka { position: absolute; left: 10%; top: 4%; font-family: var(--mono); color: var(--typed); font-size: clamp(0.72rem, 2.6vw, 1.05rem); line-height: 1.1; }
.k .ki { position: absolute; right: 9%; bottom: 5%; font-size: clamp(0.66rem, 2.4vw, 0.95rem); line-height: 1; }
.k .ks { font-size: var(--fs-0); color: var(--ink-2); }
.k .dead { text-decoration: underline dotted; }
.k.hit { border: 2px solid var(--ink); background: var(--bg-2); }
.k.same .ki { color: var(--ink-3); }
/* phones: taller keys, the two characters stacked and centred, larger glyphs; the keyboard takes the full width */
@media (max-width: 560px) {
  .kbd-wrap { max-width: none; }
  .kbd, .kbd-row { gap: 3px; }
  .k { aspect-ratio: auto; height: 2.9rem; border-radius: 4px; }
  .k .ka, .k .ki { left: 0; right: 0; text-align: center; white-space: nowrap; }
  .k .ka { top: 2px; font-size: 1rem; }
  .k .ki { bottom: 3px; font-size: 0.95rem; }
  .k.k-space { height: 2.4rem; }
}
.k-pop { position: absolute; z-index: 5; background: var(--bg); border: 1px solid var(--ink); border-radius: 4px; padding: 6px 10px; font-size: var(--fs-0); box-shadow: none; pointer-events: none; white-space: nowrap; }
.lossy { margin-top: 30px; }
.lossy h3 { margin-top: 0; }
.lossy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 0 18px; margin-top: 10px; }
.lc { border-top: 1px solid var(--rule); padding: 10px 0 12px; }
.lc-typed { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.typed-txt { font-family: var(--mono); color: var(--typed); font-size: 1.2rem; font-weight: 500; }
.lc-n { font-size: var(--fs-0); color: var(--ink-2); }
.lc ul { list-style: none; margin: 0; padding: 0; font-size: var(--fs-1); }
.lc li { margin: 2px 0; }
.lw { font-size: 1.15rem; }

/* ---------------------------------------------------------------- findings */
.findings { border-top: 1px solid var(--rule); padding: 34px 0 10px; }
.finding { margin-bottom: 52px; }
.fhead { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
.fhead h2 { font-size: var(--fs-5); }
.fhead .tag { grid-column: 1 / -1; }
.key-chip { position: relative; width: 38px; height: 38px; border: 1.5px solid var(--ink); border-radius: 5px; margin: 0; }
.kc-t { position: absolute; left: 6px; top: 1px; font-family: var(--mono); color: var(--typed); font-weight: 500; font-size: 1.1rem; }
.kc-m { position: absolute; right: 5px; bottom: 2px; font-size: 0.7rem; }
.tag { font-size: var(--fs-0); color: var(--ink-2); margin: 8px 0 0; max-width: none; }
.lead { font-size: var(--fs-3); font-weight: 700; line-height: 1.3; max-width: 52ch; margin-top: 16px; }
.callouts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 28px; margin: 20px 0 8px; }
@media (min-width: 760px) { .callouts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.callout { border-top: 1px solid var(--ink); padding-top: 8px; }
.callout p { margin: 0 0 6px; font-size: var(--fs-1); }
.callout p.big { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 4px; }
@media (max-width: 759px) {
  .callouts { grid-template-columns: max-content minmax(0, 1fr); gap: 0 12px; }
  .callout { display: contents; }
  .callout p { border-top: 1px solid var(--ink); padding: 6px 0; margin: 0; }
  .callout p.big { font-size: 1.2rem; line-height: 1.25; white-space: nowrap; margin: 0; }
}
.big { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 700; font-stretch: condensed; letter-spacing: -0.02em; line-height: 1.05; font-family: "Helvetica Neue", "Arial Narrow", var(--sans); }
.notes { columns: 1; column-gap: 32px; margin-top: 10px; }
@media (min-width: 900px) { .notes { columns: 2; } }
.notes p { font-size: var(--fs-0); color: var(--ink-2); margin: 0 0 8px; break-inside: avoid; }
.steps-lead { font-size: var(--fs-3); max-width: 52ch; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--rule); }
.steps { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule-2); counter-increment: step; }
.step::before { content: counter(step); grid-row: 1 / span 2; width: 36px; height: 36px; border: 1.5px solid var(--ink); border-radius: 5px; font-family: var(--mono); font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.step-fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.sf { font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 700; font-stretch: condensed; letter-spacing: -0.02em; line-height: 1.05; }
.sf.typed::before, .sf.told::before { content: ""; display: inline-block; width: 0.32em; height: 0.32em; margin-right: 0.18em; vertical-align: 0.28em; }
.sf.typed::before { background: var(--typed); border-radius: 50%; }
.sf.told::before { background: var(--told); }
.sf-arrow { font-size: 1.6rem; }
.sf-lab { width: 100%; display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: var(--fs-0); color: var(--ink-2); margin: 2px 0 0; }
.step-txt { grid-column: 2; margin: 8px 0 0; }
@media (min-width: 900px) {
  .step { grid-template-columns: 44px minmax(300px, 5fr) minmax(0, 6fr); }
  .step::before { grid-row: auto; }
  .step-txt { grid-column: 3; margin: 0; }
}
.rules h2 { font-size: var(--fs-4); }
.rule-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; }
@media (min-width: 900px) { .rule-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rule-cols p { border-top: 1px solid var(--rule); padding-top: 10px; }

/* ---------------------------------------------------------------- charts */
.chart { margin: 22px 0 8px; position: relative; }
.chart figcaption { font-size: var(--fs-1); max-width: 70ch; }
.fig-n { font-weight: 700; }
.chart-tools { display: flex; justify-content: flex-end; gap: 6px; margin: 6px 0; }
.chart-tools .seg { min-height: 36px; font-size: var(--fs-0); padding: 2px 10px; }
.chart-body { position: relative; }
.chart-body svg { display: block; width: 100%; height: auto; overflow: visible; max-width: 100%; }
.chart-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 900px) { .chart-pair { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 24px; } }
.chart-pair > div, .chart-body > div { min-width: 0; }
svg text { fill: var(--ink); font-family: var(--sans); font-size: 13px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
svg .t-2 { fill: var(--ink-2); }
svg .t-mono { font-family: var(--mono); font-size: 12.5px; }
svg .t-b { font-weight: 700; }
svg .t-s { font-size: 12px; }
svg .ax { stroke: var(--ink-3); stroke-width: 1; }
svg .grid { stroke: var(--rule-2); stroke-width: 1; }
svg .conn { stroke: var(--rule); stroke-width: 2; }
svg .ci { stroke: var(--ink-3); stroke-width: 1.5; }
svg .ci-typed { stroke: var(--typed); stroke-width: 1.5; opacity: 0.75; }
svg .ci-told { stroke: var(--told); stroke-width: 1.5; opacity: 0.75; }
svg .m-native { fill: var(--bg); stroke: var(--ink); stroke-width: 1.8; }
svg .m-typed { fill: var(--typed); stroke: var(--bg); stroke-width: 1; }
svg .m-told { fill: var(--told); stroke: var(--bg); stroke-width: 1; }
svg .m-none { fill: var(--pale); stroke: var(--ink-3); stroke-width: 1; }
svg .m-ctrl { fill: var(--ink-3); }
svg .m-outline-typed { fill: var(--bg); stroke: var(--typed); stroke-width: 2; }
svg .ref-floor { stroke: var(--ink-2); stroke-width: 1.5; }
svg .ref-chance { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 4 3; }
svg .ref-bound { stroke: var(--ink); stroke-width: 2.5; }
svg .ref-floor-row { stroke: var(--ink-2); stroke-width: 2; }
svg .whisk { stroke: var(--ink); stroke-width: 1.5; }
svg .whisk-halo { stroke: var(--bg); stroke-width: 4.5; }
svg .t-xs { font-size: 10.5px; }
svg .hit { fill: transparent; cursor: pointer; }
svg .row:hover .hit, svg .row:focus .hit { fill: var(--bg-2); }
svg .row.sel .hit { fill: var(--bg-2); }
svg .row:focus { outline: none; }
svg .row:focus-visible .hit { stroke: var(--ink); stroke-width: 2; }
svg .nodata { fill: var(--ink-3); font-style: italic; }
.axis-cap { text-align: right; margin: -2px 0 0; max-width: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-0); color: var(--ink-2); margin: 4px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.lg-native { border: 1.8px solid var(--ink); background: var(--bg); }
.lg-typed { background: var(--typed); }
.lg-told { background: var(--told); border-radius: 2px; }
.lg-none { background: var(--pale); border: 1px solid var(--ink-3); border-radius: 2px; }
.lg-ctrl { background: var(--ink-3); border-radius: 2px; }
.lg-floor { width: 18px; height: 0; border-top: 1.5px solid var(--ink-2); border-radius: 0; }
.lg-floor-row { width: 2px; height: 14px; background: var(--ink-2); border-radius: 0; }
.lg-wrong { background: var(--pale); border: 1px solid var(--ink-3); border-radius: 2px; }
.lg-unsplit { border-radius: 2px; border: 1px solid var(--ink-3); background: radial-gradient(var(--ink-3) 1px, var(--bg) 1.5px) 0 0 / 4px 4px; }
.lg-chance { width: 18px; height: 0; border-top: 1.5px dashed var(--ink-3); border-radius: 0; }
.lg-correct { background: var(--ink); border-radius: 2px; }
.lg-novalid { border-radius: 2px; border: 1px solid var(--ink-3); background: repeating-linear-gradient(45deg, var(--ink-3) 0 3px, var(--bg) 3px 6px); }
.tip {
  position: absolute; z-index: 20; max-width: min(320px, calc(100vw - 24px)); background: var(--bg); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 4px; padding: 8px 10px; font-size: var(--fs-0); line-height: 1.4; pointer-events: none;
}
.tip strong { font-weight: 700; }
.tip .tip-act { display: block; margin-top: 4px; font-weight: 700; }
.tip .tt-row { display: flex; justify-content: space-between; gap: 12px; }

/* tables (chart table views and explorer tables); rows become blocks on phones */
.dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-1); margin: 6px 0; }
.dtable th, .dtable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.dtable th { font-size: var(--fs-0); color: var(--ink-2); font-weight: 500; border-bottom: 1px solid var(--rule); }
.dtable td.n, .dtable th.n { text-align: right; white-space: nowrap; }
.dtable tr.sel td { background: var(--bg-2); }
.dtable caption { text-align: left; font-size: var(--fs-0); color: var(--ink-2); padding: 4px 0; }
@media (max-width: 620px) {
  .dtable.stack, .dtable.stack tbody, .dtable.stack caption { display: block; width: 100%; }
  .dtable.stack thead { display: none; }
  .dtable.stack tr { display: block; border-bottom: 1px solid var(--rule); padding: 6px 0; }
  .dtable.stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 2px 0; text-align: right; }
  .dtable.stack td::before { content: attr(data-label); color: var(--ink-2); font-size: var(--fs-0); text-align: left; white-space: normal; flex: 0 0 auto; max-width: 46%; }
  .dtable.stack td { overflow-wrap: anywhere; }
  .dtable.stack td:first-child { font-weight: 700; text-align: left; }
  .dtable.stack td:first-child::before { content: none; }
}

/* ---------------------------------------------------------------- explorer */
.explore { border-top: 1px solid var(--rule); padding: 34px 0 30px; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 18px 0 14px; border: 1px solid var(--ink); border-radius: 5px; overflow: hidden; }
.tabs [role="tab"] { font: inherit; font-size: var(--fs-1); min-height: 46px; border: 0; border-right: 1px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; padding: 4px 4px; white-space: nowrap; min-width: 0; }
.tabs [role="tab"]:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.tabs [role="tab"][aria-selected="true"]:focus-visible { outline-color: var(--bg); }
@media (max-width: 400px) { .tabs [role="tab"] { font-size: 0.875rem; letter-spacing: -0.01em; } }
.tabs [role="tab"]:last-child { border-right: 0; }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .ctl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ctl .seg { min-height: 40px; font-size: var(--fs-0); padding: 4px 10px; }
.ctl .seg.st-notrun { border-style: dashed; color: var(--ink-2); }
.ctl .seg.st-pooled { border-style: dotted; border-width: 2px; color: var(--ink-2); }
.ctl .seg.st-notdesign { border-color: var(--rule); background: var(--bg-2); color: var(--ink-3); }
.ctl .seg.st-notplanned { border-style: dashed; color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.ctl .seg[aria-checked="true"] { color: var(--bg); background: var(--ink); text-decoration: none; }
.ctl-legend { grid-column: 1 / -1; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.ctl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chip-key { display: inline-block; width: 22px; height: 14px; border: 1px solid var(--ink-3); border-radius: 3px; }
.chip-key.st-notrun { border-style: dashed; }
.chip-key.st-pooled { border-style: dotted; border-width: 2px; }
.chip-key.st-notdesign { border-color: var(--rule); background: var(--bg-2); }
.chip-key.st-notplanned { border-style: dashed; background: linear-gradient(transparent 45%, var(--ink-3) 45% 55%, transparent 55%); }
.explore-notice { border-left: 3px solid var(--ink-2); padding: 6px 10px; margin: 10px 0 0; font-size: var(--fs-1); }
.view { padding-top: 16px; }
.d-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.d-title { font-size: var(--fs-3); font-weight: 700; margin: 0; line-height: 1.25; }
.d-title .mid { font-size: 0.95em; white-space: normal; overflow-wrap: anywhere; }
.view h4 { font-size: var(--fs-2); font-weight: 700; margin: 1.4em 0 0.3em; }
.d-sub .mid { white-space: normal; overflow-wrap: anywhere; }
.warn { border-left: 3px solid var(--ink-3); padding-left: 8px; }
.d-sub { color: var(--ink-2); font-size: var(--fs-1); margin: 2px 0 0; }
.d-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 24px; margin-top: 14px; }
@media (min-width: 900px) { .d-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule-2); }
.kv .k-l { color: var(--ink-2); font-size: var(--fs-1); }
.kv .k-l { flex: 1 1 auto; }
.kv .k-v { text-align: right; flex: 0 1 auto; }
.nw { white-space: nowrap; }
.bigacc { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 700; font-stretch: condensed; letter-spacing: -0.02em; line-height: 1; }
.ci-txt { color: var(--ink-2); font-size: var(--fs-1); white-space: nowrap; }
.acc-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.acc-pair.one { grid-template-columns: minmax(0, 1fr); max-width: 360px; }
.acc-box .ci-txt { white-space: normal; font-size: var(--fs-0); }
@media (max-width: 330px) { .acc-pair { grid-template-columns: minmax(0, 1fr); } }
.acc-box { border-top: 2px solid var(--ink); padding-top: 6px; }
.acc-box .lbl { font-size: var(--fs-0); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.acc-box .meta { font-size: var(--fs-0); color: var(--ink-2); }
.notrun { border: 1px dashed var(--ink-3); border-radius: 4px; padding: 12px 14px; color: var(--ink-2); margin: 12px 0; }
.notrun strong { color: var(--ink); }
.outbar { display: flex; height: 22px; border: 1px solid var(--ink-3); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.outbar span { display: block; height: 100%; }
.ob-correct { background: var(--ink); }
.ob-wrong { background: var(--pale); }
.ob-novalid { background: repeating-linear-gradient(45deg, var(--ink-3) 0 3px, var(--bg) 3px 6px); }
.ob-unsplit { background: radial-gradient(var(--ink-3) 1px, var(--bg) 1.5px) 0 0 / 4px 4px; }
.dtable .ind { padding-left: 14px; display: inline-block; }
.linkbtn { font: inherit; background: none; border: 0; padding: 6px 0; color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; text-align: left; min-height: 44px; }
.others { list-style: none; padding: 0; margin: 6px 0; }
.others li { border-top: 1px solid var(--rule-2); }
.others button { font: inherit; font-size: var(--fs-1); background: none; border: 0; color: var(--ink); width: 100%; text-align: left; padding: 10px 0; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 44px; }
.others button:hover .o-l { text-decoration: underline; }
.o-v { color: var(--ink-2); white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin-bottom: 10px; }
.filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.chks { display: flex; flex-wrap: wrap; }
.filters legend { font-size: var(--fs-0); color: var(--ink-2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px; padding: 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-right: 10px; font-size: var(--fs-1); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--ink); }
details > summary { cursor: pointer; padding: 10px 0; font-weight: 700; min-height: 44px; }
details > summary::marker { color: var(--ink-3); }
.notrun-box { border-top: 1px solid var(--rule-2); }
details.fold { border-top: 1px solid var(--rule-2); margin-top: 10px; }
details.fold > summary { font-size: var(--fs-2); }
@media (min-width: 900px) { .chart-pair details.fold { border-top: 0; margin-top: 0; } .chart-pair details.fold > summary { display: none; } }
.notrun-box summary { font-weight: 500; }
.wide-table .tscroll { overflow-x: auto; }
.notrun-list { font-size: var(--fs-1); color: var(--ink-2); columns: 1; column-gap: 28px; }
@media (min-width: 760px) { .notrun-list { columns: 2; } }
.notrun-list p { margin: 0 0 4px; break-inside: avoid; }
.lgrid-head { margin-top: 26px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 4px; margin-top: 8px; }
.lt { border: 1px solid var(--rule); border-radius: 3px; padding: 5px 6px; min-height: 58px; font-size: 0.72rem; line-height: 1.25; background: var(--bg); color: var(--ink); text-align: left; font-family: inherit; cursor: default; }
.lt .lt-c { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); display: block; }
.lt .lt-n { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt .lt-v { display: block; color: var(--ink-2); }
.lt.has { border-color: var(--ink); }
.lt.none { border-style: dashed; color: var(--ink-2); }
.lt.off { border-color: var(--rule); color: var(--ink-3); }
.lt-track { position: relative; display: block; height: 10px; margin: 4px 4px 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); background: linear-gradient(var(--rule), var(--rule)) 0 50% / 100% 1px no-repeat; }
.lt-m { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; }
.lt-nat { border: 1.5px solid var(--ink); background: var(--bg); }
.lt-lossy { background: var(--typed); }
.lt:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.script-h { font-size: var(--fs-0); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; margin: 14px 0 0; }

/* ---------------------------------------------------------------- method, about */
.method, .about { border-top: 1px solid var(--rule); padding: 34px 0 26px; }
.mcols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; }
@media (min-width: 900px) { .mcols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.arms { margin: 0; }
.arms-box { border-top: 1px solid var(--rule); }
.arms-box > summary { font-size: var(--fs-1); }
.arm-row { padding: 8px 0; border-top: 1px solid var(--rule-2); }
.arms dt { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.arms dd { margin: 2px 0 0 20px; font-size: var(--fs-1); color: var(--ink-2); }
.arm-kind { display: block; font-size: var(--fs-0); color: var(--ink-3); }
.sw { width: 12px; height: 12px; flex: 0 0 auto; }
.sw-meant { border: 1.8px solid var(--ink); border-radius: 50%; }
.sw-typed { background: var(--typed); border-radius: 50%; }
.sw-told { background: var(--told); border-radius: 2px; }
.plain-steps { padding-left: 1.3em; }
.plain-steps li { margin: 6px 0; }
.hyp { padding-left: 1.2em; font-size: var(--fs-1); }
.hyp li { margin: 6px 0; }
.status-dl { margin: 0; }
.st-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--rule-2); }
.st-row dd { margin: 0; font-size: var(--fs-1); }
.credits { padding-left: 1.1em; font-size: var(--fs-1); }
.credits li { margin: 6px 0; }
.foot { border-top: 1px solid var(--rule); padding: 18px 0 40px; }
