:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #1b2033;
  --muted: #5d6580;
  --border: #dfe3ee;
  --accent: #3b4cca;
  --accent-ink: #ffffff;
  --accent-soft: #e8ebfb;
  --shadow: 0 1px 2px rgba(20, 28, 60, .06), 0 4px 16px rgba(20, 28, 60, .05);
  --radius: 12px;

  --exact-bg: #dcf3e4;   --exact-fg: #14693a;
  --prob-bg:  #e0eefb;   --prob-fg:  #1b5a99;
  --lower-bg: #fdf0d2;   --lower-fg: #8a5a00;
  --upper-bg: #fbe3d6;   --upper-fg: #a04210;
  --unch-bg:  #e9ebf1;   --unch-fg:  #565e78;

  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Dark palette. It applies when the visitor has chosen it with the invert button (data-theme="dark"),
   or when the system prefers dark and the visitor has not chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12151f;
    --surface: #1a1f2e;
    --surface-2: #222839;
    --text: #e6e9f3;
    --muted: #98a1bd;
    --border: #2d3550;
    --accent: #8c9bff;
    --accent-ink: #11142a;
    --accent-soft: #252c4d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);

    --exact-bg: #17382a;  --exact-fg: #7fe0a6;
    --prob-bg:  #1a3250;  --prob-fg:  #8cc4ff;
    --lower-bg: #3d3115;  --lower-fg: #f0c566;
    --upper-bg: #44261a;  --upper-fg: #f5a47a;
    --unch-bg:  #2a3045;  --unch-fg:  #a5aec9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12151f;
  --surface: #1a1f2e;
  --surface-2: #222839;
  --text: #e6e9f3;
  --muted: #98a1bd;
  --border: #2d3550;
  --accent: #8c9bff;
  --accent-ink: #11142a;
  --accent-soft: #252c4d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);

  --exact-bg: #17382a;  --exact-fg: #7fe0a6;
  --prob-bg:  #1a3250;  --prob-fg:  #8cc4ff;
  --lower-bg: #3d3115;  --lower-fg: #f0c566;
  --upper-bg: #44261a;  --upper-fg: #f5a47a;
  --unch-bg:  #2a3045;  --unch-fg:  #a5aec9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; }
.muted { color: var(--muted); }

/* ---------- header and tabs ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { padding-top: 14px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 1rem;
}
.brand h1 { margin: 0; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.01em; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.tabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .95rem; color: var(--muted);
  padding: 10px 16px; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab:focus-visible, .button:focus-visible, select:focus-visible, th button:focus-visible {
  outline: 3px solid var(--accent-soft); outline-offset: 1px; box-shadow: 0 0 0 1px var(--accent);
}

/* ---------- panels ---------- */
main { padding-top: 28px; padding-bottom: 48px; }
.panel h2 { font-size: 1.35rem; margin: 1.6em 0 .5em; letter-spacing: -.01em; }
.panel h2:first-child { margin-top: 0; }
.panel h3 { font-size: 1.05rem; margin: 1.4em 0 .5em; }
.panel p, .panel li { max-width: 66ch; }
/* Justified running text with hyphenation. Tables, charts and figures keep their natural width. */
.panel p, .panel li, .panel dd { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-justify: inter-word; }
.panel td p, .panel td li, .panel .card p, .panel .hint { text-align: left; hyphens: manual; }
.panel td p, .panel td li { max-width: none; }
.cta { margin-top: 1.6rem; }

/* ---------- buttons and form ---------- */
.button {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 10px 20px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.button:hover { border-color: var(--accent); }
.button.primary, .cta .button { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.primary:hover, .cta .button:hover { filter: brightness(1.08); }

.search-form {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.search-form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
select {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-width: 150px;
}
select#sel-type { min-width: 280px; }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.6; min-height: 1.4em; margin: 10px 2px 18px; }

/* ---------- results ---------- */
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin: 4px 2px 12px; }
.result-head h3 { margin: 0; font-size: 1.15rem; }
.summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; font-size: .85rem; color: var(--muted); }
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.result-scroll { max-height: 72vh; overflow: auto; }
table { border-collapse: collapse; width: 100%; }
.data-table th, .data-table td { padding: 9px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td.status, .data-table th.status { text-align: left; }
.data-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  font-size: .85rem; font-weight: 700; color: var(--muted); padding: 0;
}
.data-table th button {
  appearance: none; border: 0; background: transparent; cursor: pointer; width: 100%;
  font: inherit; color: inherit; padding: 11px 16px; text-align: inherit;
  display: inline-flex; align-items: center; justify-content: inherit; gap: 6px;
}
.data-table th:first-child button { justify-content: flex-start; }
.data-table th.status button { justify-content: flex-start; }
.data-table th button:hover { color: var(--text); }
.data-table th[aria-sort="ascending"] button, .data-table th[aria-sort="descending"] button { color: var(--accent); }
.sort-ind { font-size: .7rem; opacity: .35; width: .9em; display: inline-block; text-align: center; }
th[aria-sort="ascending"] .sort-ind, th[aria-sort="descending"] .sort-ind { opacity: 1; }
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.data-table tbody tr:hover { background: var(--accent-soft); }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td.part { font-family: "STIX Two Text", "Latin Modern Roman", "Cambria Math", Cambria, "Times New Roman", serif; font-size: 1.05rem; }
.data-table td.part sup { font-size: .75em; line-height: 0; }
.data-table td.dim { font-weight: 600; }
.data-table td.dim .dir { color: var(--muted); font-weight: 500; margin-right: 3px; }
.data-table td.dim.unchecked { color: var(--muted); font-weight: 400; }
.data-table td.na { color: var(--muted); }

.badge { display: inline-block; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; letter-spacing: .01em; }
.badge.s3 { background: var(--exact-bg); color: var(--exact-fg); }
.badge.s4 { background: var(--prob-bg);  color: var(--prob-fg); }
.badge.s1 { background: var(--lower-bg); color: var(--lower-fg); }
.badge.s2 { background: var(--upper-bg); color: var(--upper-fg); }
.badge.s0 { background: var(--unch-bg);  color: var(--unch-fg); }

.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.empty strong { color: var(--text); }

/* ---------- documentation pieces ---------- */
.doc-table th, .doc-table td { padding: 10px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.doc-table thead th { background: var(--surface-2); font-size: .85rem; color: var(--muted); }
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { white-space: nowrap; }
#coverage-table td, #coverage-table th { font-variant-numeric: tabular-nums; white-space: nowrap; }

.legend { display: grid; gap: 10px; }
.legend > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; max-width: 78ch; }
.legend .badge { margin-right: 8px; min-width: 6.5em; text-align: center; }

.steps { display: grid; gap: 12px; margin: 1rem 0 1.4rem; max-width: 78ch; }
.step { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; margin-top: 2px; }
.refs { padding-left: 1.2rem; }
.refs li { margin-bottom: .7em; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0; font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  .brand h1 { font-size: 1.05rem; }
  .tagline { display: none; }
  .search-form { padding: 14px; gap: 12px; }
  .search-form label { flex: 1 1 130px; }
  select, select#sel-type { min-width: 0; width: 100%; }
  .search-form .button { width: 100%; }
  .data-table th button, .data-table td { padding-left: 10px; padding-right: 10px; }
}

/* ---------- codimension tab ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 12px; flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); padding: 7px 16px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg button:focus-visible { outline: 3px solid var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.codim-desc { min-height: 3.2em; }
.codim-table th, .codim-table td { text-align: right; }
.codim-table th:first-child, .codim-table td:first-child { text-align: left; }
.codim-table th .plain { display: block; padding: 11px 16px; }
.codim-table td a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.codim-table td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.codim-table td.trivial { color: var(--muted); }
.codim-table td.interval { color: var(--lower-fg); }

/* ---------- row hover panel ---------- */
.data-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#row-tip {
  position: fixed; z-index: 60; max-width: min(460px, calc(100vw - 16px)); pointer-events: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(10, 14, 40, .22); padding: 12px 14px; font-size: .84rem; line-height: 1.45;
}
#row-tip .tip-title { font-family: "STIX Two Text", "Latin Modern Roman", "Cambria Math", Cambria, "Times New Roman", serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
#row-tip .tip-title span { font-family: var(--font); font-size: .82rem; font-weight: 500; color: var(--muted); }
#row-tip sup { font-size: .75em; line-height: 0; }
#row-tip dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; }
#row-tip dt { color: var(--muted); }
#row-tip dd { margin: 0; font-variant-numeric: tabular-nums; }
#row-tip .tip-comment { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 14em; overflow: hidden; }

.panel-note { color: var(--muted); max-width: 66ch; margin: 0 0 16px; }
.button.secondary, .cta .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); margin-left: 6px; }
.button.secondary:hover { border-color: var(--accent); filter: none; }

/* link back to the personal site */
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.header-top .back { margin-bottom: 0; }
.theme { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 50%; width: 2rem; height: 2rem; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 0; flex: none; }
.theme:hover, .theme:focus-visible { color: var(--accent); border-color: var(--accent); }
@media print { .theme { display: none; } }
.back { display: inline-block; margin-bottom: 8px; font-size: .85rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); text-decoration: underline; }

/* ---------- statistics tab ---------- */
:root { --st-3: var(--exact-fg); --st-4: var(--prob-fg); --st-2: var(--upper-fg); --st-1: var(--lower-fg); --st-0: color-mix(in srgb, var(--unch-fg) 50%, var(--surface)); }
.st-b3 { fill: var(--st-3); background: var(--st-3); }
.st-b4 { fill: var(--st-4); background: var(--st-4); }
.st-b2 { fill: var(--st-2); background: var(--st-2); }
.st-b1 { fill: var(--st-1); background: var(--st-1); }
.st-b0 { fill: var(--st-0); background: var(--st-0); }
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0 14px; }
.st-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.st-num { font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.st-num small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.st-lab { font-weight: 600; margin-top: 4px; font-size: .92rem; }
.st-sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.st-cards.compact .st-card { padding: 10px 14px; }
.st-cards.compact .st-num { font-size: 1.5rem; }
.st-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 4px 0 8px; }
.st-bar.thin { height: 10px; flex: 1; margin: 0; }
.st-bar span { display: block; min-width: 2px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: var(--muted); margin: 6px 0 12px; }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.st-line { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: 2px; }
.st-legend .st-line { margin-right: 0; }
.st-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 4px 0 12px; }
.st-controls label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.st-controls .seg { margin-bottom: 0; }
.st-clab { font-size: .78rem; font-weight: 600; color: var(--muted); }
.st-scroll { overflow-x: auto; padding-bottom: 4px; }
.st-svg { display: block; }
.st-fluid { width: 100%; height: auto; }
.st-tx { fill: var(--muted); font: 11px var(--font); }
.st-rl { fill: var(--text); font-weight: 650; font-size: 12.5px; }
.st-ttl { font-size: 11.5px; }
.st-grid { stroke: var(--border); stroke-width: 1; }
.st-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.st-empty { fill: none; stroke: var(--border); stroke-dasharray: 3 3; }
.st-cell rect, .st-cell { outline: none; }
a.st-cell:hover g, a.st-cell:focus g { filter: brightness(1.18) saturate(1.2); }
a.st-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-chartttl { font-weight: 650; margin: 2px 0 8px; font-size: .92rem; }
.st-mix { display: grid; gap: 7px; max-width: 760px; margin-bottom: 10px; }
.st-mixrow { display: grid; grid-template-columns: minmax(150px, 280px) 1fr 64px; gap: 12px; align-items: center; font-size: .86rem; }
.st-mixn { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-shapegrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.st-bin rect { stroke: var(--border); stroke-width: 1; transition: filter .12s; cursor: pointer; }
.st-bin:hover rect { filter: brightness(1.12); }
.st-bin.sel rect, .st-bin:focus-visible rect { stroke: var(--text); stroke-width: 2; }
.st-bin { outline: none; }
.st-cnt { font: 600 10.5px var(--font); fill: var(--text); pointer-events: none; mix-blend-mode: normal; paint-order: stroke; stroke: var(--surface); stroke-width: 2.5px; }
.st-plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.st-plist li { display: grid; grid-template-columns: 74px minmax(70px, auto) 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; font-size: .85rem; }
.st-plist .st-pt { font-family: "STIX Two Text", "Latin Modern Roman", "Cambria Math", Cambria, serif; font-size: 1rem; font-weight: 600; }
.st-plist .st-pm { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.st-young { fill: var(--accent); max-width: 74px; height: auto; max-height: 52px; }
#st-tip { position: fixed; z-index: 70; pointer-events: none; max-width: min(360px, calc(100vw - 16px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgba(10,14,40,.22); padding: 9px 12px; font-size: .82rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
#st-tip .muted { color: var(--muted); }
.stat-strip { margin: 6px 0 22px; }
.stat-strip .cta { margin: 0; }
@media (max-width: 860px) { .st-shapegrid { grid-template-columns: 1fr; } .st-mixrow { grid-template-columns: 1fr 70px; } .st-mixname { grid-column: 1 / -1; } }

/* ---------- Theory and trust tab ---------- */
.lead { font-size: 1.08rem; max-width: 66ch; }
.th-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.1rem 0 .4rem; }
.th-nav button { font: inherit; font-size: .88rem; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.th-nav button:hover { border-color: var(--accent); }
#panel-theory p, #panel-theory .steps, #panel-theory .legend { max-width: 66ch; }
#panel-theory h2[id] { scroll-margin-top: 190px; }
#panel-theory h4 { margin: 1.4em 0 .4em; font-size: .98rem; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 1rem 0 1.4rem; max-width: 110ch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 18px 10px; box-shadow: var(--shadow); }
.card h3 { margin-top: 12px; }
.bound-fig { max-width: 560px; margin: 1.2rem 0 1.4rem; }
.bf-line { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); }
.bf-seg { flex: 1; height: 14px; border-radius: 7px;
  position: relative; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.bf-fill { position: absolute; top: 0; bottom: 0; left: 22%; right: 38%; background: var(--exact-bg); border-left: 2px solid var(--lower-fg); border-right: 2px solid var(--upper-fg); }
.bf-marks { display: flex; justify-content: space-between; padding: 0 28px; margin-top: 6px; font-size: .82rem; font-weight: 700; }
.bf-lo { color: var(--lower-fg); } .bf-hi { color: var(--upper-fg); }
.bf-note { margin-top: 6px; color: var(--muted); font-size: .9rem; }
.eqtable { margin: .5rem 0 1rem; display: grid; gap: 6px; max-width: 78ch; }
.eqtable > div { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 14px; }
.evid td { vertical-align: top; }
.faq { max-width: 78ch; display: grid; gap: 8px; margin-bottom: 1.4rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2px 16px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.faq details[open] summary { color: var(--accent); }
.faq details p { margin: 0 0 .9em; }
/* claims map */
.claim-map { border-collapse: separate; border-spacing: 2px; font-size: .72rem; }
.claim-map th { font-weight: 600; color: var(--muted); padding: 2px 1px; text-align: center; min-width: 26px; }
.claim-map tr > th:first-child { text-align: left; padding-right: 8px; white-space: nowrap; font-size: .8rem; }
.claim-map td { padding: 0; }
.cm { width: 100%; min-width: 26px; height: 26px; border: 2px solid transparent; border-radius: 5px; font: inherit; font-size: .68rem; font-weight: 700; cursor: pointer; padding: 0; }
.cm-x { background: var(--exact-bg); color: var(--exact-fg); }
.cm-p { background: var(--prob-bg); color: var(--prob-fg); }
.cm-b { background: var(--lower-bg); color: var(--lower-fg); }
.cm-u { background: var(--unch-bg); color: var(--unch-fg); }
.cm-part { border: 2px dashed currentColor; }
.cm.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.claim-map td.cm-none { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--border) 4px 5px); border-radius: 5px; height: 26px; }
.cm-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--muted); margin: 10px 0; }
.cm-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 2px solid transparent; }
.cm-key.cm-part { border: 2px dashed var(--exact-fg); }
.cm-key.cm-blank { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--border) 3px 4px); border: 1px solid var(--border); }
.cm-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 18px; max-width: 78ch; box-shadow: var(--shadow); }
@media (max-width: 640px) { .th-nav button { font-size: .8rem; } }
.evid { table-layout: fixed; width: 100%; max-width: 110ch; }
.evid td:first-child { white-space: normal; }
.evid th:first-child, .evid td:first-child { width: 46%; }
@media (max-width: 700px) { .evid { table-layout: auto; min-width: 560px; } }

/* Conjectures tab */
.cj-table th { white-space: normal; text-align: left; vertical-align: bottom; }
.cj-table td { white-space: normal; }
#panel-conj .table-scroll { margin-bottom: 12px; }
.cj-table td:nth-child(3) { min-width: 14ch; }
.cj-table td { vertical-align: top; }
.cj-table td .muted { font-size: .85rem; }

/* Motion */
.mo-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px 14px; margin: 4px 0 20px; }
.mo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mo-cap { color: var(--muted); font-size: .92rem; }
.mo-cap b { color: var(--text); font-variant-numeric: tabular-nums; }
.mo-btn, .st-pbtn { flex: none; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; font-size: .85rem; line-height: 1; padding: 0; }
.mo-btn:hover, .st-pbtn:hover, .mo-btn:focus-visible, .st-pbtn:focus-visible { color: var(--accent); border-color: var(--accent); }
.mo-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 14px; margin-top: 12px; min-height: 150px; }
.mo-young rect { fill: none; stroke: var(--muted); stroke-opacity: .55; stroke-width: 1.1; }
.mo-young.on rect { fill: var(--accent); stroke: var(--accent); }
.st-play { display: flex; align-items: center; gap: 12px; margin: 2px 0 10px; max-width: 520px; }
.st-prange { flex: 1; accent-color: var(--accent); min-width: 0; }
.st-pout { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 8.5em; }
.st-cursor { fill: var(--accent); fill-opacity: .10; stroke: var(--accent); stroke-width: 1.5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* coverage grid: light gray tables whose recorded multiplicities are all zero, and the dock-style lens */
.st-zero { fill: var(--zero-gray, #d2d6dd); }
/* the liquid of a cup sloshes when the pointer is over it, and settles by itself */
.st-liq { transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes st-slosh { 0% { transform: rotate(0); } 16% { transform: rotate(-7deg); } 38% { transform: rotate(5.5deg); } 58% { transform: rotate(-3.5deg); } 78% { transform: rotate(1.8deg); } 100% { transform: rotate(0); } }
a.st-cell:hover .st-liq, a.st-cell:focus-visible .st-liq { animation: st-slosh 1.3s ease-in-out; }
@media (prefers-reduced-motion: reduce) { a.st-cell:hover .st-liq, a.st-cell:focus-visible .st-liq { animation: none; } }

/* Conjectures at a glance: fixed columns, the statement may wrap */
.doc-table.glance { table-layout: fixed; width: 100%; }
.doc-table.glance td:first-child { white-space: normal; }

/* certification map: each table is a cup, its empty part shows the partitions with no entry */
.st-cup { fill: var(--cup-bg, rgba(127,127,140,.10)); stroke: var(--border); stroke-width: 1; }

/* wide display equations scroll inside their own box instead of widening the page on phones */
mjx-container[jax="CHTML"][display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; }

/* eight tabs: tighten them so that the row fits the 1080 px column, and shrink a little on mid-size screens */
@media (min-width: 701px) { .tabs { gap: 2px; } .tab { padding: 10px 12px; } }
@media (max-width: 1100px) { .tab { font-size: .9rem; padding-left: 10px; padding-right: 10px; } }
