/* The mapping bench — obot report family tokens (executive overview 2026-07-21,
   goal atlas 2026-07-24, platform gap analysis 2026-07-25).

   Three-state light/dark contract: the full light palette on bare :root, the dark
   palette redefined under prefers-color-scheme guarded against an explicit light
   choice, and again under [data-theme="dark"] so a toggle wins in both directions.

   The bench mockup breaks from this on purpose and renders in open.gismo's own
   espresso theme (site/src/style.css: #271810 rail, #faf6f1 paper, #c2410c accent),
   fixed light in both modes, because a mock of a product should look like the
   product rather than like the page it is printed on. Those tokens are namespaced
   --og-* and never leak into the report chrome.

   Every state mark carries a glyph AND a written word. No colour-only encoding
   anywhere. Nothing is fetched at view time — system font stacks, no CDN. */

:root {
  --ground: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --ink: #16232d;
  --muted: #536470;
  --faint: #7f929e;
  --border: #dde4e7;
  --hairline: #e8edef;
  --accent: #0e7c86;
  --accent-deep: #0a5b63;
  --accent-tint: #e2f1f2;

  --good: #0ca30c;
  --good-ink: #0a6b0a;
  --good-tint: #e6f5e6;
  --warn: #fab219;
  --warn-ink: #8a5d00;
  --warn-tint: #fdf3dd;
  --bad: #d03b3b;
  --bad-ink: #a32424;
  --bad-tint: #fbe9e9;

  --f-display: "SF Pro Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Iowan Old Style", "Palatino Linotype", Charter, Georgia, Cambria, "Times New Roman", serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(20, 40, 55, .05), 0 8px 24px -12px rgba(20, 40, 55, .14);
  --shadow-soft: 0 1px 2px rgba(20, 40, 55, .04);

  /* open.gismo espresso — fixed in both modes, mock only */
  --og-rail: #271810;
  --og-rail-ink: #f0e6dc;
  --og-rail-dim: #b39c8a;
  --og-paper: #faf6f1;
  --og-card: #ffffff;
  --og-ink: #2b1c12;
  --og-mute: #7a6555;
  --og-line: #e6dbcf;
  --og-accent: #c2410c;
  --og-accent-soft: #fdeee5;
  --og-green: #15803d;
  --og-green-soft: #e7f5ec;
  --og-amber: #a16207;
  --og-amber-soft: #fdf3d8;
  --og-red: #b91c1c;
  --og-red-soft: #fceceb;
  --og-blue: #1d4ed8;
  --og-blue-soft: #e8eeff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d141a; --surface: #141e26; --surface-2: #1a2831;
    --ink: #e7eef2; --muted: #9aabb6; --faint: #6f828e;
    --border: #263640; --hairline: #1f2d36;
    --accent: #3cc3d0; --accent-deep: #7fd8e0; --accent-tint: #0f2e33;
    --good-ink: #6fd36f; --good-tint: #12291a;
    --warn-ink: #e8bf62; --warn-tint: #2d2409;
    --bad-ink: #f08b8b; --bad-tint: #2e1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25);
  }
}

:root[data-theme="dark"] {
  --ground: #0d141a; --surface: #141e26; --surface-2: #1a2831;
  --ink: #e7eef2; --muted: #9aabb6; --faint: #6f828e;
  --border: #263640; --hairline: #1f2d36;
  --accent: #3cc3d0; --accent-deep: #7fd8e0; --accent-tint: #0f2e33;
  --good-ink: #6fd36f; --good-tint: #12291a;
  --warn-ink: #e8bf62; --warn-tint: #2d2409;
  --bad-ink: #f08b8b; --bad-tint: #2e1414;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem 6rem; }
.wide { max-width: 82rem; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 2.75rem 0 2rem;
  margin-bottom: 2.5rem;
}
.eyebrow {
  font-size: .74rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 650; margin: 0 0 .7rem;
}
h1 {
  font-family: var(--f-serif); font-weight: 600; font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .9rem;
}
.standfirst { font-size: 1.13rem; color: var(--muted); margin: 0 0 1.25rem; max-width: 46rem; }
.byline { font-size: .84rem; color: var(--faint); margin: 0; }

nav.pages { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
nav.pages a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .42rem .85rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--ink); text-decoration: none;
  font-size: .87rem; font-weight: 550;
}
nav.pages a:hover { border-color: var(--accent); color: var(--accent-deep); }
nav.pages a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
nav.pages a[aria-current="page"]:hover { color: #fff; }

/* ---------- type ---------- */

h2 {
  font-family: var(--f-serif); font-weight: 600; font-size: 1.72rem; line-height: 1.2;
  letter-spacing: -.01em; margin: 3.2rem 0 .5rem; padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
}
h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 2rem; }
h3 { font-size: 1.06rem; font-weight: 680; margin: 2rem 0 .4rem; letter-spacing: -.005em; }
h4 { font-size: .93rem; font-weight: 680; margin: 1.4rem 0 .3rem; color: var(--muted); }
p { margin: 0 0 1rem; }
a { color: var(--accent-deep); text-underline-offset: 2px; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
li { margin-bottom: .42rem; }
li > ul, li > ol { margin-top: .42rem; }
code, kbd { font-family: var(--f-mono); font-size: .875em; }
p code, li code, td code, th code {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 4px; padding: .06em .34em;
}
hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.6rem 0; }
.lede { font-size: 1.05rem; color: var(--muted); }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- blocks ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow-soft); margin: 1.4rem 0;
}
.callout {
  border-left: 3px solid var(--accent); background: var(--accent-tint);
  border-radius: 0 10px 10px 0; padding: 1rem 1.2rem; margin: 1.4rem 0;
}
.callout.warn { border-left-color: var(--warn); background: var(--warn-tint); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-tint); }
.callout.good { border-left-color: var(--good); background: var(--good-tint); }
.callout > :last-child, .card > :last-child { margin-bottom: 0; }
.callout > :first-child, .card > :first-child { margin-top: 0; }
.callout h3, .card h3 { margin-top: 0; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.4rem 0; }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.stat .n { font-family: var(--f-serif); font-size: 2.05rem; line-height: 1; font-weight: 600; display: block; }
.stat .lbl { font-size: .82rem; color: var(--muted); display: block; margin-top: .45rem; }

pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .95rem 1.1rem; overflow-x: auto; font-family: var(--f-mono);
  font-size: .8rem; line-height: 1.55; margin: 1.1rem 0;
}
pre.terminal { background: #16232d; color: #dbe6ec; border-color: #16232d; }
pre.terminal .err { color: #ff9b9b; }
pre.terminal .ok { color: #8fe08f; }
pre.terminal .dim { color: #7f929e; }

.scroll { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.scroll table { min-width: 34rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem;
  border-radius: 999px; font-size: .74rem; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.tag.good { background: var(--good-tint); color: var(--good-ink); border-color: var(--good-ink); }
.tag.warn { background: var(--warn-tint); color: var(--warn-ink); border-color: var(--warn-ink); }
.tag.bad { background: var(--bad-tint); color: var(--bad-ink); border-color: var(--bad-ink); }
.tag.flat { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.footnote { font-size: .84rem; color: var(--muted); border-top: 1px solid var(--hairline); margin-top: 3rem; padding-top: 1.2rem; }

details.fold { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: .7rem 1rem; margin: 1rem 0; }
details.fold > summary { cursor: pointer; font-weight: 650; font-size: .93rem; }
details.fold[open] > summary { margin-bottom: .7rem; }

.dispo { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; font-size: .8rem; }
.dot { width: .62rem; height: .62rem; border-radius: 2px; display: inline-block; flex: none; }
.dot.bound { background: var(--og-green); }
.dot.derived { background: var(--og-blue); }
.dot.const { background: #6b21a8; }
.dot.declined { background: var(--og-mute); }
.dot.open { background: transparent; border: 1.5px dashed var(--faint); }

@media (max-width: 34rem) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 1rem 4rem; }
  .masthead { padding: 2rem 0 1.5rem; }
  .stat .n { font-size: 1.7rem; }
}

/* A long inline identifier (regexp_replace(subjid, '^SITE[0-9]+-', '')) pushed the
   hard-case list past a 390px viewport. Inline code wraps; <pre> still scrolls in
   its own box. Verified with an iframe probe at exactly 390px. */
p code, li code, td code, th code, dd code { overflow-wrap: anywhere; }
p, li, dd, td, th { overflow-wrap: break-word; }

/* A .tag in flowing prose must wrap. The real culprit at 390px was
   "⚠ 217 participants (LOCAL lab) — no reference range delivered" at 395px inside
   a 337px list item, held on one line by the nowrap that keeps table pills tidy.
   Table cells keep nowrap; prose does not. */
li .tag, p .tag { white-space: normal; display: inline; max-width: 100%; }
