/* mm3lab.dev styles. Palette and type come from docs/assets/*.svg (ink navy, MAK blue, MDL green, Inter over the
   system stack); light is the base, dark redefines the same tokens. No web fonts, no framework, no external assets. */
:root {
  --bg: #f6f8fc; --surface: #ffffff; --card: #eef3fa; --line: #cbd6e6;
  --ink: #0f1b2d; --muted: #465872; --blue: #0a6aa1; --green: #3a8213; --amber: #b07a00;
  --btn-bg: #2f7a10; --btn-ink: #ffffff; --btn-hover: #266509;
  --code-bg: #0f1b2d; --code-ink: #e6edf7; --code-line: #24344f;
  --glow1: rgba(10, 106, 161, .16); --glow2: rgba(79, 159, 28, .16);
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 12px 32px -12px rgba(15, 27, 45, .18);
  --pass: #2f7a10; --fail: #b3261e; --unsure: #9a5b00; --pass-bg: #e3f2d9; --fail-bg: #fbe4e2; --unsure-bg: #fdefd0; --track: #dbe4f0;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050914; --surface: #0b1424; --card: #101b2e; --line: #24344f;
    --ink: #f5f8ff; --muted: #93a7bd; --blue: #9bdcff; --green: #b7ff83; --amber: #ffcd57;
    --btn-bg: #b7ff83; --btn-ink: #050914; --btn-hover: #d0ffae;
    --code-bg: #0b1424; --code-ink: #e6edf7; --code-line: #24344f;
    --pass: #b7ff83; --fail: #ff8d85; --unsure: #ffcd57; --pass-bg: #17300d; --fail-bg: #3a1614; --unsure-bg: #33260a; --track: #1c2b44;
    --glow1: rgba(155, 220, 255, .14); --glow2: rgba(183, 255, 131, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-wrap: break-word; }
img, picture { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
code, pre { font-family: var(--mono); }
code { font-size: .9em; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .08em .38em; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 800; margin-bottom: .5rem; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 1.6rem 0 .4rem; }
p { margin: .8rem 0; }
.wrap { width: min(1080px, 100%); margin-inline: auto; padding-inline: 20px; }
section.wrap { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.sub { color: var(--muted); font-size: 1.05rem; }
.eyebrow { font-size: .85rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; }
.brand { font-weight: 900; font-size: 1.5rem; letter-spacing: -.04em; color: var(--ink); text-decoration: none; line-height: 1; }
.brand .m-make { color: var(--blue); }
.brand .m-model { color: var(--green); }
.brand .beta { display: inline-block; margin-left: .4em; padding: .15em .55em; border: 1.5px solid var(--amber); border-radius: 999px; color: var(--amber); font-size: .45em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; vertical-align: super; }
.top nav { display: flex; align-items: center; gap: 1.1rem; font-size: .95rem; font-weight: 600; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav .gh { color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem; background: var(--surface); }
@media (max-width: 600px) { .top nav a:not(.gh) { display: none; } }

/* hero */
.hero { position: relative; overflow: hidden; text-align: center; background:
  radial-gradient(60% 70% at 18% 0%, var(--glow1), transparent 70%),
  radial-gradient(55% 65% at 85% 10%, var(--glow2), transparent 70%); }
.hero-in { padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 7vw, 4.5rem); }
.hero h1 img { width: min(560px, 82vw); height: auto; margin-inline: auto; }
.tagline { font-size: clamp(1.9rem, 5.6vw, 3.4rem); font-weight: 900; line-height: 1.1; letter-spacing: -.03em; margin: 1.6rem auto .4rem; max-width: 20ch; }
.lede { font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--muted); max-width: 36em; margin: 1rem auto 0; }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: 2rem 0 .5rem; }
.btn { display: inline-block; padding: .8rem 1.6rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; box-shadow: var(--shadow); }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.fine { color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: no-preference) {
  .hero-in > * { animation: rise .7s ease-out both; }
  .hero-in > :nth-child(2) { animation-delay: .08s; } .hero-in > :nth-child(3) { animation-delay: .16s; }
  .hero-in > :nth-child(4) { animation-delay: .24s; } .hero-in > :nth-child(5) { animation-delay: .32s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* how it works */
.how { text-align: center; }
.big { margin: 2rem auto 0; max-width: 860px; }
.big img { width: 100%; border-radius: 28px; box-shadow: var(--shadow); }

/* numbers strip */
.numbers { padding-block: 1rem 2rem; }
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.strip a { display: flex; flex-direction: column; justify-content: space-between; gap: .9rem; height: 100%; padding: 1.3rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 16px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.strip a:hover { border-top-color: var(--blue); }
.stat { font-size: 1.25rem; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.strip .meth { font-size: .88rem; font-weight: 600; color: var(--blue); }
.strip .meth::after { content: ' \2192'; }

/* generic content */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 2.5rem; }
.cols > div > h3:first-child { margin-top: 1.2rem; }
.code { position: relative; margin: .8rem 0; }
.code pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line); border-radius: 14px; padding: 1.1rem 1.2rem; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.copy { position: absolute; top: .55rem; right: .55rem; font: 600 .78rem var(--sans); color: var(--code-ink); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; padding: .3rem .7rem; cursor: pointer; }
.copy:focus-visible { outline-color: var(--code-ink); }
.copy:hover { background: rgba(255, 255, 255, .2); }
details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 700; color: var(--blue); padding: .3rem 0; }
.demo { margin: 1.5rem 0; }
.demo img { width: 100%; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* table */
.tablewrap { margin: 1.5rem 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 1rem 1.1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--card); }
tbody th { font-weight: 600; width: 22%; }
td code { display: block; width: max-content; margin-bottom: .3rem; font-weight: 700; font-size: 1rem; }
.k { display: block; font-size: 1.15rem; font-weight: 900; letter-spacing: .02em; }
.k.mak { color: var(--blue); } .k.mdl { color: var(--green); }
@media (max-width: 720px) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody, tr, th, td { display: block; }
  tbody th { width: auto; background: var(--card); }
  td { border-bottom: 1px solid var(--line); }
  td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
}

/* use-case cards */
.cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; font-size: 1.15rem; }
.card p { margin: .5rem 0; color: var(--muted); font-size: .98rem; }
.card .start { color: var(--ink); font-size: .9rem; }

.plain { padding-left: 1.2rem; }
.plain li { margin: .7rem 0; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.foot-in { padding-block: 2.2rem; color: var(--muted); font-size: .95rem; }
.foot-in p { margin: .5rem 0; }
.brand.small { font-size: 1.3rem; color: var(--ink); }

@media (max-width: 600px) { .code.has-copy pre { padding-top: 2.7rem; } }


/* demo player: two stories of real runs, one agent session per step (markup from scripts/build-demo.ts, behaviour in site/player.js).
   The step is a 16:9 stage on wide screens (the README GIF is the same markup at 1600x900) and stacks below 960px. */
.player { width: min(1480px, 100vw - 48px); margin-block: 1.5rem; margin-inline: calc((100% - min(1480px, 100vw - 48px)) / 2); }
.player [hidden] { display: none !important; }
.pstory, .pscene { --bar: var(--blue); }
.pstory.fam-mdl, .pscene.fam-mdl { --bar: var(--green); }
.pintro { margin: 0 0 .9rem; color: var(--muted); font-size: .98rem; max-width: 62rem; }

/* story tabs and step chips */
.pstabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: .6rem; margin-bottom: 1rem; }
.pstab { display: flex; flex-direction: column; gap: .15rem; padding: .7rem 1rem; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--bar); border-radius: 14px; text-decoration: none; cursor: pointer; }
.pstab.fam-mak { --bar: var(--blue); } .pstab.fam-mdl { --bar: var(--green); }
.pstab b { font: 800 1.05rem var(--sans); } .pstab span { color: var(--muted); font-size: .9rem; }
.pstab:hover { border-color: var(--bar); }
.pstab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); border-left-color: var(--bar); } .pstab[aria-selected="true"] span { color: inherit; opacity: .85; }
.pstory { margin-bottom: 2rem; }
.player.js .pstory { margin-bottom: 0; }
.shead h3 { margin: 0; font-size: 1.3rem; }
.spin { margin: .2rem 0 0; font: 600 .78rem var(--mono); color: var(--muted); }
.sabout { margin: .3rem 0 0; font-size: .92rem; color: var(--muted); max-width: 62rem; }
.dnum { display: inline-grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--bar); color: var(--bg); font: 800 .8rem var(--sans); }
.task { display: flex; gap: .8rem; align-items: flex-start; margin: .8rem 0; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--bar); border-radius: 14px; }
.tlabel { font: 800 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tq { margin: .2rem 0 0; font-size: 1.05rem; line-height: 1.45; }
.tfull { margin: .3rem 0 0; } .tfull summary { font-size: .85rem; }
.psteps { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.pstep { display: inline-flex; align-items: center; gap: .4rem; font: 700 .88rem var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .34rem .9rem; text-decoration: none; cursor: pointer; }
.pstep i { font-style: normal; font-weight: 900; color: var(--bar); } .pstep span { color: var(--muted); font-weight: 600; font-size: .78rem; }
.pstep:hover { border-color: var(--bar); }
.pstep[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); } .pstep[aria-selected="true"] i, .pstep[aria-selected="true"] span { color: inherit; }

/* the step */
.pscene { container-type: inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem .9rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.player.js .pscene { margin-bottom: 0; }
.phead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .8rem; }
.phead h3 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.stepno { display: inline-grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--ink); color: var(--bg); font: 900 1rem var(--sans); }
.goal { min-width: 0; overflow-wrap: anywhere; }
.gt { font-style: normal; font-weight: 600; color: var(--muted); margin-right: .15em; } .goalgate { flex: none; }
.flow { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; font: 700 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.flow li { padding: .18rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); white-space: nowrap; }
.pmain, .pbottom { display: grid; gap: .8rem; grid-template-columns: minmax(0, 1fr); }
.pbottom { margin-top: .8rem; }
@container (min-width: 960px) {
  .pmain { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); align-items: start; }
  .pbottom { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
@container (max-width: 720px) { .flow { display: none; } }

/* the code card: request and response, dark in both themes like the site's code blocks */
.codecard { --t-com: #8aa0bb; background: #0b1424; color: #e6edf7; border: 1px solid #24344f; border-radius: 12px; overflow: hidden; min-width: 0; }
.pane-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .8rem; font: 700 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--t-com, var(--muted)); background: #101b2e; border-bottom: 1px solid #24344f; }
.pane-h em { font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .8; } .pane-h b { color: #b7ff83; }
.pane-h i, .codetabs i { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; margin-right: .3rem; border-radius: 50%; background: #b7ff83; color: #050914; font: 800 .68rem var(--sans); font-style: normal; }
.codetabs { display: none; align-items: center; gap: .3rem; padding: .35rem .5rem; background: #101b2e; border-bottom: 1px solid #24344f; }
.tabbed .codetabs { display: flex; flex-wrap: wrap; } .tabbed .code .pane-h { display: none; }
.codetabs button { font: 700 .82rem var(--mono); color: var(--t-com); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: .32rem .75rem; cursor: pointer; }
.codetabs button:hover { color: #fff; } .codetabs button[aria-selected="true"] { color: #fff; background: #1b2b47; border-color: #34496b; }
.cmeta { margin-left: auto; font: 600 .72rem var(--mono); color: var(--t-com); } .cpage { font: 700 .72rem var(--mono); color: #ffcd57; }
.tabbed .pscene[data-show="request"] .code[data-pane="response"], .tabbed .pscene[data-show="response"] .code[data-pane="request"] { display: none; }
.code + .code { border-top: 1px solid #24344f; } .tabbed .code + .code { border-top: 0; }
.cbody { --t-key: #9bdcff; --t-num: #b7ff83; max-height: 34rem; overflow: auto; padding: .55rem 0; font: .8rem/1.55 var(--mono); }
.cbody:focus-visible { outline: 2px solid #9bdcff; outline-offset: -2px; border-radius: 0; }
.ln { display: block; padding: 0 .9rem 0 calc(.9rem + (var(--i, 0) + 2) * 1ch); text-indent: calc((var(--x, 0) + 2) * -1ch); white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid transparent; }
.ln[data-q] { padding-left: calc(.9rem - 3px + (var(--i, 0) + 2) * 1ch); }
.yk { color: #9bdcff; } .yk.pass { color: #ffcd57; } .yk.ytop { font-weight: 800; } .yk.ytop-mdl { color: #b7ff83; } .yk.ytop-next, .yk.ytop-notes { color: #c9d7ea; }
.yq { color: #b7ff83; font-weight: 800; } .yn { color: #ffb86b; } .ys { color: #e6edf7; } .yb { color: #c4a7ff; } .yc { color: #7f93ad; font-style: italic; } .yp { color: #6f829c; }
.code .yg.pass { color: #b7ff83; font-weight: 700; } .code .yg.fail { color: #ff8d85; font-weight: 700; } .code .yg.unsure { color: #ffcd57; font-weight: 700; }
.ph { color: #ffcd57; }
.rq { cursor: default; }
.ln.rq:hover, .ln.rq:focus-visible, .ln.rq.hl { background: rgba(155, 220, 255, .16); border-left-color: #9bdcff; outline: none; }
.ln.rq:focus-visible { box-shadow: inset 0 0 0 2px #9bdcff; }
.yq.hl { background: rgba(183, 255, 131, .28); border-radius: 4px; box-shadow: 0 0 0 2px #b7ff83; }

/* quick read (the colour-coded verdict) */
.verdict { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.verdict .pane-h { background: var(--surface); color: var(--muted); border-bottom-color: var(--line); } .verdict .pane-h b { color: var(--ink); }
.verdict .pane-h i { background: var(--bar); color: var(--bg); }
.verdict-body { padding: .8rem .8rem .9rem; display: grid; align-content: start; gap: .5rem; max-height: 42rem; overflow: auto; }
.vhead { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.vhead small, .lbl, .rank-h, .fact em, .fx em, .cons small, .esc small, .big-gate small { font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-style: normal; }
.big-gate { display: inline-flex; flex-direction: column; padding: .3rem .9rem .4rem; border-radius: 12px; font: 900 1.7rem/1 var(--sans); text-transform: uppercase; letter-spacing: -.01em; border: 2px solid currentColor; }
.big-gate small { color: inherit; opacity: .8; margin-bottom: .15rem; letter-spacing: .14em; font-size: .58rem; }
.pass, .big-gate.pass { color: var(--pass); } .fail, .big-gate.fail { color: var(--fail); } .unsure, .big-gate.unsure { color: var(--unsure); }
.big-gate.pass { background: var(--pass-bg); } .big-gate.fail { background: var(--fail-bg); } .big-gate.unsure { background: var(--unsure-bg); }
.vmeta { display: flex; gap: .4rem; flex-wrap: wrap; }
.cons, .esc { display: inline-flex; flex-direction: column; padding: .25rem .7rem .3rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: 800 .95rem/1.1 var(--sans); color: var(--ink); }
.cons small, .esc small { color: var(--muted); font-size: .56rem; }
.cons-strong { border-color: var(--blue); } .cons-split, .cons-weak { border-color: var(--unsure); color: var(--unsure); }
.esc.on { border-color: var(--fail); color: var(--fail); background: var(--fail-bg); } .esc.off { color: var(--muted); }
.vstat { margin-left: auto; font-size: .82rem; color: var(--muted); } .vstat b { color: var(--ink); font: 800 1.15rem var(--sans); } .vstat span { opacity: .5; }
.vstat.burst { flex-basis: 100%; margin: 0; padding: .35rem .8rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--bar); font-size: .9rem; color: var(--ink); } .vstat.burst b { font-size: 1.7rem; color: var(--bar); }
.vrow { display: grid; grid-template-columns: 7rem auto minmax(0, 1fr); align-items: center; gap: .3rem .6rem; padding: .4rem .6rem; background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; border-radius: 10px; }
.vrow.pass { border-left-color: var(--pass); } .vrow.fail { border-left-color: var(--fail); } .vrow.unsure { border-left-color: var(--unsure); }
.cat { font: 700 .85rem var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.chip { display: inline-block; white-space: nowrap; font: 800 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: .12rem .5rem; border-radius: 999px; border: 1px solid currentColor; }
.chip.pass { background: var(--pass-bg); } .chip.fail { background: var(--fail-bg); } .chip.unsure { background: var(--unsure-bg); }
.chip::before { margin-right: .3em; } .chip.pass::before { content: '\2713'; } .chip.fail::before { content: '\2717'; } .chip.unsure::before { content: '?'; }
.qs { display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.q { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .3rem; border-radius: 6px; font: .72rem var(--mono); color: var(--muted); }
.q b { color: var(--ink); font-weight: 700; min-width: 2.1em; }
.q .qn, .qref { font: 800 .68rem var(--mono); color: var(--bar); min-width: 1.3em; text-align: right; }
.q .pick { font: 700 .72rem var(--mono); color: var(--ink); }
.pb { display: inline-block; width: 3.6rem; height: .55rem; border-radius: 99px; background: linear-gradient(to right, var(--bar) calc(var(--p) * 100%), var(--track) 0); }
.pb.mini { width: 3px; height: 1.3rem; border-radius: 1px; background: linear-gradient(to top, var(--bar) calc(var(--p) * 100%), var(--track) 0); }
.q.hl, .qref.hl, .pb.mini.hl { background-color: color-mix(in srgb, var(--bar) 24%, transparent); box-shadow: 0 0 0 2px var(--bar); }
.pb.mini.hl { position: relative; z-index: 1; }
.q:hover { background: color-mix(in srgb, var(--bar) 14%, transparent); }
.ba { display: inline-flex; align-items: center; gap: .3rem; } .arr { color: var(--muted); font-weight: 800; }
.fx { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .3rem; grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.fx em { color: var(--muted); margin-right: .1rem; } .qref { display: inline-block; min-width: 1.4em; padding: 0 .25em; text-align: center; border: 1px solid var(--line); border-radius: 5px; background: var(--card); } .fx em + .qref { margin-left: 0; }
.probes { margin-left: auto; color: var(--ink); font: 800 .8rem var(--mono); }
.ranked { display: grid; gap: .2rem; } .rank-h { color: var(--muted); padding: .1rem .2rem; }
.urow { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; padding: .28rem .5rem; background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; }
.urow.pass { border-left-color: var(--pass); } .urow.fail { border-left-color: var(--fail); } .urow.unsure { border-left-color: var(--unsure); }
.rk { font: 800 .72rem var(--mono); color: var(--muted); text-align: right; }
.unit { color: var(--ink); font: 600 .74rem var(--mono); overflow-wrap: anywhere; }
.dots { display: inline-flex; gap: 3px; } .dot { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; } .dot.pass { color: var(--pass); } .dot.fail { color: var(--fail); } .dot.unsure { color: var(--unsure); }
.mini-bars { display: inline-flex; align-items: flex-end; gap: 1px; max-width: 9rem; flex-wrap: nowrap; overflow: hidden; }
.facts { display: flex; flex-wrap: wrap; gap: .3rem; } .fact { font-size: .78rem; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.fact em { color: var(--muted); margin-right: .45rem; }
.plainresp { white-space: pre-wrap; font-size: .78rem; }

/* the decision it infers, and what the ledger now holds */
.decision, .knowledge { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.decision { border: 2px solid var(--bar); } .decision.fail { border-color: var(--fail); } .decision.unsure { border-color: var(--unsure); } .decision.pass { border-color: var(--pass); }
.dhead { display: flex; align-items: center; gap: .5rem; padding: .35rem .7rem; font: 800 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--card); border-bottom: 1px solid var(--line); }
.decision .dhead { color: var(--ink); }
.decision.pass, .decision.fail, .decision.unsure { color: var(--ink); } .decision.fail .dmain { color: var(--fail); } .decision.unsure .dmain { color: var(--unsure); } .decision.pass .dmain { color: var(--pass); }
.dhead .dnum { width: 1.3rem; height: 1.3rem; font-size: .72rem; }
.dbody { padding: .55rem .8rem .65rem; display: grid; gap: .3rem; }
.dmain { margin: 0; font: 900 1.55rem/1.15 var(--sans); letter-spacing: -.02em; }
.dwhat { margin: 0; color: var(--muted); font-size: .84rem; }
.dcmd { display: block; font: 600 .78rem var(--mono); background: var(--ink); color: var(--bg); border: 0; border-radius: 8px; padding: .4rem .65rem; overflow-wrap: anywhere; }
.dwhy { margin: .15rem 0 0; padding-left: 1.1rem; font-size: .86rem; line-height: 1.4; } .dwhy li { margin: .1rem 0; }
.kbody { margin: 0; padding: .5rem .8rem .6rem; display: grid; gap: .3rem; }
.kbody > div { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .6rem; align-items: baseline; }
.kbody dt { font: 800 .66rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kbody dd { margin: 0; font-size: .86rem; line-height: 1.38; overflow-wrap: anywhere; }

.pfoot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin: .8rem 0 0; font: .76rem var(--mono); color: var(--muted); }
.real { font: 800 .66rem var(--mono); text-transform: uppercase; letter-spacing: .1em; padding: .12rem .55rem; border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink); }
.psrc { opacity: .8; } .pf { color: var(--ink); overflow-wrap: anywhere; } .pdate { opacity: .8; } .ppin { font-weight: 700; color: var(--bar); }
.raw { margin: .6rem 0 0; } .rawcode { margin: .5rem 0 0; padding: .8rem 1rem; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line); border-radius: 12px; overflow: auto; font-size: .78rem; line-height: 1.55; max-height: 24rem; }
.rawcode code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.pctl { display: flex; justify-content: space-between; gap: .5rem; margin-top: .9rem; }
.pctl button { font: 700 .9rem var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .55rem 1.1rem; cursor: pointer; }
.pctl button:hover { border-color: var(--blue); } .pctl button:disabled { opacity: .4; cursor: default; }

/* the reveal (replay on the site, frames in the README): a step with data-phase shows only what has happened so far */
.pscene[data-phase] :is(.verdict-body, .dbody, .kbody) { visibility: hidden; }
.pscene[data-phase] :is(.verdict, .decision, .knowledge) { opacity: .18; }
.pscene:is([data-phase="1"], [data-phase="2"], [data-phase="3"]) .verdict-body, .pscene:is([data-phase="1"], [data-phase="2"], [data-phase="3"]) .verdict { visibility: visible; opacity: 1; }
.pscene:is([data-phase="2"], [data-phase="3"]) :is(.dbody, .decision) { visibility: visible; opacity: 1; }
.pscene[data-phase="3"] :is(.kbody, .knowledge) { visibility: visible; opacity: 1; }
.pscene[data-phase] .flow li { opacity: .5; }
.pscene[data-phase="0"] .flow li:nth-child(-n+2), .pscene[data-phase="1"] .flow li:nth-child(-n+4), .pscene[data-phase="2"] .flow li:nth-child(-n+5), .pscene[data-phase="3"] .flow li { opacity: 1; background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .pscene[data-phase] :is(.verdict, .decision, .knowledge) { transition: opacity .3s; }
}

/* narrow: everything stacks, panes grow to their content, rows wrap */
@container (max-width: 720px) {
  .verdict-body { max-height: none; } .cbody { max-height: 22rem; }
  .vrow { grid-template-columns: minmax(0, 1fr) auto; } .vrow .qs, .vrow .fx { grid-column: 1 / -1; } .vstat { margin-left: 0; }
  .urow { grid-template-columns: 1.3rem minmax(0, 1fr) auto; } .urow .mini-bars { grid-column: 2 / -1; max-width: none; }
  .dmain { font-size: 1.3rem; } .kbody > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cmeta { display: none; }
}
