/* HeOCR shared site system · one stylesheet for every page, EN (LTR) and HE (RTL).
   Light is the default whatever the OS setting; night mode only via [data-theme="dark"]
   on <html> (set by theme.js). Logical properties throughout, so RTL needs no overrides.
   Breakpoints are container queries on .site (put class="site" on <body>). */

/* ---------- 1. Tokens: Bounding Box ---------- */
:root {
  --bg: #ffffff;
  --surface: #f6f7fc;
  --text: #0c1222;
  --muted: #56607a;
  --line: #dfe3f2;
  --line-strong: #b9c1de;
  --accent: #2447f9;
  --accent-soft: #eef1ff;
  --tag: #eef0f7;
  --on-accent: #ffffff;
  --grid: #f1f3fb;
  /* chart series: heocr = good green, best other tool = error red, Tesseract = neutral */
  --series-ours: #15803d;
  --series-alt: #dc2626;
  --series-tess: #64748b;
  --ok: #166534;
  --ok-soft: #e7f4ec;
  --no: #a12a22;
  --no-soft: #fbe9e7;

  --font-display: "JetBrains Mono", "Noto Sans Hebrew", ui-monospace, monospace;
  --font-body: "Noto Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Noto Sans Hebrew", ui-monospace, Menlo, Consolas, monospace;

  --fs-h1: clamp(1.9rem, 1.3rem + 2.6cqi, 2.9rem);
  --fs-h2: 1.45rem;
  --fs-h3: 1.02rem;
  --fs-lede: 1.1rem;
  --fs-body: 1rem;
  --fs-small: 0.9rem;
  --fs-micro: 0.76rem;

  --radius: 2px;
  --radius-sm: 2px;
  --wrap: 1160px;
  --gutter: 24px;
}
[data-theme="dark"] {
  /* today's night neutrals, unchanged */
  --bg: #141414;
  --surface: #1c1c1c;
  --text: #ecebe8;
  --muted: #a29d94;
  --line: #2e2d2b;
  --tag: #262523;
  /* brand blue, lifted for the dark ground (today: #7fb6dd / #1d2a33) */
  --accent: #8fa3ff;
  --accent-soft: #1b2040;
  --line-strong: #4a4844;
  --on-accent: #0b1020;
  --grid: #1a1a1a;
  --series-ours: #1f9d55;
  --series-alt: #f0564a;
  --series-tess: #8892a0;
  --ok: #7fcf9f;
  --ok-soft: #18281f;
  --no: #ee9a8b;
  --no-soft: #31201c;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
.site {
  container: site / inline-size;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.6 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
.site a { color: var(--accent); text-decoration: none; }
.site a:hover { text-decoration: underline; }
.site :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
h1, h2 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 16px; }
h2 { font-size: var(--fs-h2); line-height: 1.2; margin: 0; }
h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; margin: 0; }
p { margin: 0 0 12px; text-wrap: pretty; }
code { white-space: nowrap; font-family: var(--font-mono); font-size: 0.88em; background: var(--tag); padding: 1px 5px; border-radius: 4px; }
.lede { font-size: var(--fs-lede); max-width: 44em; margin: 0 0 14px; }
.sub { color: var(--muted); max-width: 46em; margin: 0 0 20px; }
.note { font-size: var(--fs-small); color: var(--muted); }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; inset-inline-start: 8px; top: -48px; background: var(--bg); padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); z-index: 5; }
.skip:focus { top: 8px; }

/* ---------- 3. Header: brand, nav, language switch, theme toggle ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; min-height: 64px; padding-block: 10px; }
.site .brand { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1; color: var(--text); letter-spacing: -0.01em; }
.site .brand:hover { text-decoration: none; color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 4px; flex: 1 1 auto; }
.site .site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.site .site-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.site .site-nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; font-size: 0.88rem; font-weight: 600; background: var(--bg); }
.site .lang-toggle a, .lang-toggle span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; color: var(--muted); line-height: 1.2; }
.site .lang-toggle a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.lang-toggle [aria-current] { background: var(--accent); color: var(--on-accent); }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text); font: 600 0.88rem/1.2 var(--font-body); cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- 4. Page head and sections ---------- */
.page-head { padding-block: 36px 8px; }
.page-head .note { margin: 0; }
.site main section, .domain { padding-block: 44px 4px; }
.domain-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.status { display: inline-flex; align-items: center; gap: 6px; background: var(--tag); color: var(--muted); padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.status.scored { background: var(--accent-soft); color: var(--text); }
.status.scored::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 0; margin-block: 36px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.site .toc a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; color: var(--text); font-size: var(--fs-small); font-weight: 600; line-height: 1.35; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.site .toc a:hover { background: var(--surface); text-decoration: none; }
.toc a small { font-size: var(--fs-micro); font-weight: 500; color: var(--muted); }
.warn { display: flex; gap: 10px; align-items: flex-start; background: var(--tag); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 18px; max-width: 46em; font-size: 0.95rem; }
.warn .ico { margin-top: 4px; color: var(--muted); }

/* ---------- 5. Hero chart ---------- */
.hero-chart { margin-block: 26px 0; }
.hero-chart .panel { border: 1px solid var(--line-strong); border-radius: 10px; padding: 26px 28px 22px; background: var(--bg); }
.kicker { font-size: var(--fs-micro); font-weight: 600; color: var(--muted); letter-spacing: 0.02em; margin: 0 0 4px; }
.hc-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 8px; }
.dir { font: 600 var(--fs-micro)/1.5 var(--font-body); color: var(--muted); white-space: nowrap; }
.dir::before { content: "\2193\00a0"; }
.dir.up::before { content: "\2191\00a0"; }
.hc-title .dir { background: var(--tag); padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; }
.hc-finding { font-size: 1.05rem; max-width: 46em; margin: 0 0 16px; }
.hc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 26px; padding: 0; margin: 0 0 14px; font-size: var(--fs-small); }
.hc-legend li { display: flex; align-items: baseline; gap: 8px; }
.hc-legend svg { width: 14px; height: 14px; flex: none; overflow: visible; position: relative; top: 2px; }
.hc-legend small { color: var(--muted); font-size: var(--fs-micro); }
.hc-legend b { font-weight: 500; }
.hc-legend .ours b { font-weight: 700; }
.hc { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.hc-narrow { display: none; max-width: 520px; }
.hc text { fill: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.hc .a-s { text-anchor: start; }
.hc .a-e { text-anchor: end; }
.hc .a-m { text-anchor: middle; }
.hc .d-ltr { direction: ltr; unicode-bidi: isolate; }
.hc .d-rtl { direction: rtl; unicode-bidi: isolate; }
.hc .hc-tick, .hc .hc-colh { fill: var(--muted); font-size: 11.5px; }
.hc .hc-type { font-weight: 600; }
.hc .hc-desc, .hc .hc-n { fill: var(--muted); font-size: 12px; font-weight: 400; }
.hc .hc-name.ours, .hc .hc-val.ours { font-weight: 700; }
.hc .hc-name.none { fill: var(--muted); }
.hc .hc-civ { fill: var(--muted); font-size: 11.5px; }
.hc .hc-miss { fill: var(--muted); font-size: 12px; }
.hc-narrow text { font-size: 12.5px; }
.hc-narrow .hc-civ, .hc-narrow .hc-tick { font-size: 10.5px; }
.hc-narrow .hc-desc, .hc-narrow .hc-n, .hc-narrow .hc-miss { font-size: 11.5px; }
.hc-grid { stroke: var(--line); stroke-width: 1; }
.hc-zero, .hc-rule { stroke: var(--line-strong); stroke-width: 1; }
.hc-sep { stroke: var(--line); stroke-width: 1; }
.hc-hit { fill: transparent; }
.hc-g:hover .hc-hit { fill: var(--surface); }
.s-ours { --s: var(--series-ours); }
.s-alt { --s: var(--series-alt); }
.s-tess { --s: var(--series-tess); }
.hc-bar { fill: var(--s); opacity: 0.3; }
.hc-ci { stroke: var(--s); stroke-width: 1.5; fill: none; }
.hc-mark { fill: var(--s); stroke: var(--bg); stroke-width: 1.5; }
.hc-mark.hollow { fill: var(--bg); stroke: var(--s); stroke-width: 2; }
.hc-foot { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.hc-run { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--fs-small); margin: 0 0 8px; }
.hc-run .sep { color: var(--line-strong); }
.hc-foot .note { margin: 0 0 4px; max-width: 62em; font-size: 0.84rem; }

/* ---------- 6. Tables and interval display ---------- */
.site main h3 { margin: 26px 0 8px; }
h3 .note { font-weight: 400; margin-inline-start: 4px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); margin: 0 0 6px; }
.tablewrap.narrow { max-width: 760px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-small); line-height: 1.45; }
th, td { padding: 7px 9px; text-align: start; vertical-align: baseline; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--bg); }
tbody:last-child tr:last-child > * { border-bottom: 0; }
thead .thx { background: var(--surface); border-bottom-color: var(--line-strong); }
thead th { white-space: normal; min-width: 7.6em; vertical-align: bottom; background: var(--surface); color: var(--text); font-size: 0.8rem; font-weight: 600; line-height: 1.35; border-bottom-color: var(--line-strong); }
thead th .dir, thead th .ci { display: block; white-space: nowrap; font-weight: 500; font-size: var(--fs-micro); color: var(--muted); margin: 0; }
th:first-child, td:first-child { position: sticky; inset-inline-start: 0; z-index: 1; }
td.num { font-variant-numeric: tabular-nums; }
.v { display: inline-block; min-width: 3.5em; text-align: end; font-weight: 500; }
.ci { color: var(--muted); font-size: var(--fs-micro); margin-inline-start: 7px; font-variant-numeric: tabular-nums; }
.ci.stack { display: block; margin: 0; }
tr.ours > td { background: var(--accent-soft); }
tr.ours > td:first-child { font-weight: 700; }
.tag-ours { display: inline-block; margin-inline-start: 8px; padding: 0 6px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-size: 0.68rem; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
.tag-n { margin-inline-start: 8px; color: var(--muted); font-size: var(--fs-micro); font-weight: 400; white-space: nowrap; }
.tag-n.block { display: block; margin: 0; }
tr.group > th { position: static; vertical-align: bottom; background: var(--bg); padding-top: 18px; font-size: 0.95rem; font-weight: 600; scroll-margin-top: 12px; }
tbody:first-of-type tr.group > th { padding-top: 12px; }
tr.group > th.colh { vertical-align: bottom; white-space: normal; font-size: 0.8rem; line-height: 1.35; }
tr.group > th.colh .dir { display: block; font-weight: 500; white-space: nowrap; }
.gtitle { position: sticky; inset-inline-start: 12px; display: inline-block; max-width: min(100%, calc(100cqi - 76px)); white-space: normal; }
tr.group .note { font-weight: 400; }
tr.group .verdict { margin-inline-start: 10px; vertical-align: 1px; }
tr.group .gnote { display: block; font-weight: 400; font-size: var(--fs-micro); color: var(--muted); margin-top: 2px; max-width: 62em; }
.legend-note { font-size: var(--fs-micro); color: var(--muted); margin: 6px 0 0; }
td.na { color: var(--muted); }
.method { margin: 14px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.method > summary { cursor: pointer; padding: 10px 14px; font-size: var(--fs-small); font-weight: 600; }
.method[open] > summary { border-bottom: 1px solid var(--line); }
.facts { font-size: 0.85rem; color: var(--muted); margin: 0; padding: 12px 14px 12px 32px; padding-inline: 32px 14px; }
.facts li { margin: 0 0 4px; }
.facts strong { color: var(--text); font-weight: 600; }

/* ---------- 7. Empty state: "No data yet" ---------- */
.empty { position: relative; display: flex; align-items: center; min-height: 84px; padding: 18px 20px; padding-inline-start: 104px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--muted); max-width: 760px; }
.empty::before { content: ""; position: absolute; inset-inline-start: 24px; top: 50%; width: 56px; height: 40px; transform: translateY(-50%); border-inline-start: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); background: repeating-linear-gradient(to bottom, transparent 0 9px, var(--line-strong) 9px 10px); background-size: 44px 30px; background-repeat: no-repeat; background-position: center 2px; opacity: 0.8; }

/* ---------- 8. Verdict badge and release-gate summary ---------- */
.verdict { display: inline-flex; align-items: center; gap: 6px; padding-block: 3px; padding-inline: 8px 11px; border: 1px solid transparent; border-radius: 999px; font-size: 0.8rem; font-weight: 600; line-height: 1.45; white-space: nowrap; }
.verdict .ico { width: 14px; height: 14px; stroke-width: 2; }
.verdict.supported { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.verdict.unsupported { background: var(--no-soft); color: var(--no); border-color: var(--no); }
.verdict.partial { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.verdict.pending { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.verdict.lg { font-size: 0.95rem; padding-block: 6px; padding-inline: 11px 15px; }
.verdict.lg .ico { width: 16px; height: 16px; }
.gate-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 14px; }
.gate-strip { display: flex; gap: 4px; }
.gate-cell { width: 26px; height: 26px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.gate-cell .ico { width: 14px; height: 14px; stroke-width: 2.2; }
.gate-cell.supported { background: var(--ok); color: var(--bg); }
.gate-cell.unsupported { background: var(--no-soft); color: var(--no); border: 1.5px solid var(--no); }
.gate-cell.pending { border: 1.5px dashed var(--line-strong); }
.gate-count { margin: 0; font-size: 0.95rem; }
.gate-count strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-inline-end: 4px; }
.gate-count .sep { color: var(--line-strong); margin-inline: 8px; }
.gate-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); column-gap: 40px; }
.gate-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 48px; }
.site .gate-list a { color: var(--text); font-size: 0.95rem; line-height: 1.35; }
.gate-list .code { display: inline-block; min-width: 7.2em; font-weight: 600; white-space: nowrap; }
.gate-list .name { color: var(--muted); font-size: var(--fs-small); }
.gate-list .why { display: block; color: var(--muted); font-size: var(--fs-micro); line-height: 1.4; margin-top: 2px; }

/* ---------- 9. Home page pieces (class names unchanged from today) ---------- */
.home-hero { padding-block: 56px 44px; border-bottom: 1px solid var(--line); }
.home-hero h1 { font-size: clamp(2.8rem, 2rem + 5cqi, 4.2rem); }
.he, .tag { font-family: var(--font-display); color: var(--muted); font-size: 1.15rem; margin: 0 0 8px; }
.site .he { direction: rtl; text-align: left; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.site .btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); color: var(--text); font-weight: 500; font-size: 0.95rem; }
.site .btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.site .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 30px 0 0; font-size: var(--fs-small); color: var(--muted); }
.flow .step { background: var(--accent-soft); color: var(--text); padding: 4px 11px; border-radius: 999px; font-weight: 500; }
.site main.home section { padding-block: 44px 8px; }
main.home h2 { margin: 0 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.site main .card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.site .card h3 a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.site .card h3 a:hover { color: var(--accent); text-decoration-color: currentColor; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.8rem; }
.meta span { background: var(--tag); padding: 2px 8px; border-radius: var(--radius-sm); color: var(--muted); }
.meta a { font-weight: 500; }
.card .row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: var(--fs-small); font-weight: 500; }

/* ---------- 10. Footer ---------- */
.site-footer { margin-top: 56px; padding-block: 30px 44px; border-top: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: var(--fs-small); }
.site-footer .foot { display: flex; flex-wrap: wrap; gap: 14px 48px; }
.site-footer .foot-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--text); flex: none; line-height: 1.3; }
.site-footer .foot-text { flex: 1 1 320px; }
.site-footer p { margin: 0 0 6px; max-width: 62em; }

/* ---------- 11. Narrow containers ---------- */
@container site (max-width: 820px) {
  .hc-wide { display: none; }
  .hc-narrow { display: block; }
}
@container site (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .site-header .bar { gap: 4px 12px; }
  .site-nav { order: 3; flex-basis: 100%; margin-inline: -8px; }
  .site .site-nav a { min-height: 44px; }
  .site .lang-toggle a, .lang-toggle span, .theme-toggle { min-height: 44px; }
  .theme-toggle { width: 44px; padding: 0; justify-content: center; }
  .theme-toggle .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .page-head { padding-block: 26px 4px; }
  .hero-chart .panel { border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; padding: 18px 0 0; }
  .hc-legend { flex-direction: column; }
  .toc { margin-block: 28px 0; }
  .site main section, .domain { padding-block: 28px 4px; }
  .domain-head { padding-top: 18px; }
  .site main h3 { margin: 20px 0 8px; }
  th, td { padding: 5px 10px; }
  td:first-child { white-space: normal; min-width: 10.5em; max-width: 12em; }
  .empty { min-height: 0; padding: 14px 16px; padding-inline-start: 74px; font-size: 0.95rem; }
  .empty::before { inset-inline-start: 16px; width: 42px; height: 32px; background-size: 32px 22px; }
  .home-hero { padding-block: 34px 32px; }
  .gate-summary { padding: 12px 14px; }
  .gate-list li { min-height: 46px; padding: 7px 0; }
  .gate-list .code { min-width: 0; margin-inline-end: 6px; }
  .site .gate-list a { font-size: 0.88rem; }
  .gate-list .name { font-size: 0.8rem; }
  .site-footer { margin-top: 40px; }
}

/* ---------- 12. Bounding Box brand layer ---------- */
h1, h2 { letter-spacing: -0.035em; }
h1 { line-height: 1.1; }
h3 { font-weight: 700; }
code, .site .site-nav a, .lang-toggle, .theme-toggle, .status, .verdict, .dir, .tag-ours, .tag-n, .kicker, thead th, td.num, .ci,
.site .btn, .method > summary, .toc a small, .gate-list .code, .hc, .hc-run, .gate-count strong, .foot-brand, .meta { font-family: var(--font-mono); }

/* the box: a detected region. Outline, four handles, optional tag */
.bb { position: relative; outline: 1.5px solid var(--accent); outline-offset: 8px; }
.bb::after { content: ""; position: absolute; inset: -12.75px; pointer-events: none;
  background: linear-gradient(var(--accent) 0 0) 0 0 / 8px 8px no-repeat, linear-gradient(var(--accent) 0 0) 100% 0 / 8px 8px no-repeat,
              linear-gradient(var(--accent) 0 0) 0 100% / 8px 8px no-repeat, linear-gradient(var(--accent) 0 0) 100% 100% / 8px 8px no-repeat; }
.bb[data-tag]::before, .bb-tag { content: attr(data-tag); position: absolute; inset-inline-start: -9.5px; bottom: calc(100% + 8px);
  font: 700 0.68rem/1 var(--font-mono); letter-spacing: 0; background: var(--accent); color: var(--on-accent); padding: 4px 7px; white-space: nowrap; }
.gridband { background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 28px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 100%; }

/* logo */
.lockup, .site .brand { display: inline-flex; align-items: center; gap: 0.5em; font: 700 1.3rem/1 var(--font-mono); letter-spacing: -0.03em; color: var(--text); white-space: nowrap; }
.lockup svg, .brand svg { width: 1.5em; height: 1.5em; flex: none; overflow: visible; }
.lockup b, .brand b { color: var(--accent); font-weight: inherit; }
.lockup small { display: block; font: 500 0.36em/1.3 var(--font-body); letter-spacing: 0; color: var(--muted); margin-top: 0.5em; }
.lg-ink { fill: none; stroke: currentColor; stroke-linejoin: miter; }
.lg-box { fill: none; stroke: var(--accent); stroke-linejoin: miter; }
.lg-h { fill: var(--accent); }
.sw2 { stroke-width: 2; } .sw3 { stroke-width: 3; } .sw45 { stroke-width: 4.5; } .sw5 { stroke-width: 5; } .sw55 { stroke-width: 5.5; }

/* header */
.site .site-nav a { font-size: 0.86rem; border-radius: 2px; }
.site .site-nav a[aria-current] { color: var(--accent); box-shadow: none; }
.site .site-nav a[aria-current]::before { content: "["; }
.site .site-nav a[aria-current]::after { content: "]"; }
.lang-toggle, .theme-toggle { border-radius: 2px; font-size: 0.8rem; }

/* chips, badges, buttons */
.status, .verdict, .hc-title .dir, .flow .step { border-radius: 2px; }
.status, .verdict { font-size: 0.74rem; }
.status.scored::before { border-radius: 0; }
.site .btn { font-size: 0.85rem; }
.tag-ours { background: var(--accent); color: var(--on-accent); border-color: var(--accent); border-radius: 0; }

/* tables */
thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }
thead th .dir, tr.group > th.colh .dir { text-transform: none; letter-spacing: 0; }
td.num { font-size: 0.82rem; }
.v { font-weight: 700; }
tr.ours > td { box-shadow: inset 0 1.5px 0 var(--accent), inset 0 -1.5px 0 var(--accent); }

/* hero figure: the whole chart is one detected region */
.hero-chart .panel { position: relative; border: 1.5px solid var(--accent); border-radius: 0; }
.hero-chart .panel::after { content: ""; position: absolute; inset: -4.75px; pointer-events: none;
  background: linear-gradient(var(--accent) 0 0) 0 0 / 8px 8px no-repeat, linear-gradient(var(--accent) 0 0) 100% 0 / 8px 8px no-repeat,
              linear-gradient(var(--accent) 0 0) 0 100% / 8px 8px no-repeat, linear-gradient(var(--accent) 0 0) 100% 100% / 8px 8px no-repeat; }
.hero-chart .panel[data-tag]::before { content: attr(data-tag); position: absolute; inset-inline-start: -1.5px; bottom: 100%;
  font: 700 0.68rem/1 var(--font-mono); background: var(--accent); color: var(--on-accent); padding: 4px 7px; }
.hc text { font-size: 11.5px; }
.hc .hc-colh, .hc .hc-tick { font-size: 10px; letter-spacing: -0.02em; }
.hc .hc-civ { font-size: 10.5px; }
.hc .hc-desc, .hc .hc-n, .hc .hc-miss { font-size: 11px; }

/* empty state: an empty detection */
.empty { border: 1.5px dashed var(--line-strong); border-radius: 0; background: var(--bg); }

/* ---------- 13. Page pieces in the Bounding Box language ---------- */
.band { border-bottom: 1px solid var(--line); }
.band .page-head { padding-block: 58px 30px; }
.page-head h1 { margin: 0 0 28px; }
.bb { display: inline-block; }
.home-hero { padding-block: 64px 44px; }
.home-hero h1 { font-size: clamp(2.3rem, 1.6rem + 3.4cqi, 3.4rem); margin: 34px 0 28px; }
.he, .tag { font-family: var(--font-body); font-weight: 500; }
.site main.home section > h2, main.doc section > h2 { padding-top: 22px; border-top: 1px solid var(--line-strong); margin: 0 0 12px; }
.card, .tablewrap, .method, .toc, .gate-summary { border-radius: 2px; }
.flow .step { font-family: var(--font-mono); font-size: 0.8rem; }
/* document pages (htext, rights) */
main.doc p, main.doc li { max-width: 48em; }
main.doc li { margin: 0 0 8px; }
main.doc li > ul { margin-top: 8px; }
main.doc:not(.ht) > section { max-width: 780px; }
main.doc .status { margin: 0 6px 10px 0; margin-inline: 0 6px; }
main.doc .facts { padding: 4px 0; padding-inline-start: 20px; font-size: 0.9rem; }
main.doc td, main.doc th { vertical-align: top; }
tr.total td { font-weight: 700; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 4px; }
.stat { border: 1px solid var(--line); background: var(--bg); padding: 12px 16px; min-width: 150px; }
.stat b { display: block; font: 700 1.35rem/1.25 var(--font-mono); letter-spacing: -0.03em; }
.stat > span { color: var(--muted); font-size: 0.85rem; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; overflow-x: auto; font-size: 0.82rem; direction: ltr; text-align: left; }
pre code { background: none; padding: 0; white-space: pre; }
.credit { border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; }
@container site (max-width: 820px) {
  .hc-narrow text { font-size: 11.5px; }
  .hc-narrow .hc-name { font-size: 10.5px; }
  .hc-narrow .hc-civ, .hc-narrow .hc-tick { font-size: 10px; }
}
@container site (max-width: 640px) {
  .band .page-head { padding-block: 46px 22px; }
  .hero-chart .panel { border: 0; border-top: 1.5px solid var(--accent); }
  .hero-chart .panel::after, .hero-chart .panel[data-tag]::before { display: none; }
  .home-hero { padding-block: 44px 30px; }
}
