:root {
  --bg: #f6f7fb; --card: #ffffff; --field: #fafbff; --line: #d7dce8;
  --ink: #171a21; --mut: #667085; --soft: #eef2ff;
  --accent: #2f6df6; --accent-strong: #174ec6;
  --warn: #b7791f; --bad: #c24132; --good: #2f6df6;
  --shadow: 0 18px 50px rgba(38, 47, 77, .1);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--ink);
  font: 15px/1.5 "Avenir Next", "Gill Sans", Verdana, sans-serif;
  background: linear-gradient(180deg, #f7f8fc 0, #ffffff 44%, #edf2ff 100%);
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 22px 72px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.brand { font-size: 15px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.pill { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7);
  color: var(--mut); font-size: 12px; font-weight: 800; padding: 6px 10px; }
h1 { font-size: 40px; line-height: 1.04; margin: 0 0 10px; }
.sub { color: var(--mut); font-size: 17px; margin: 0 0 22px; max-width: 640px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 700; color: var(--mut); margin-bottom: 6px; }
input, select { width: 100%; background: var(--field); border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 12px; font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(47,109,246,.18); border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 12px; align-items: end; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 12px 22px; font: inherit; font-weight: 900; cursor: pointer;
  box-shadow: 0 12px 28px rgba(47,109,246,.22); }
button:hover { background: var(--accent-strong); }
button:disabled { opacity: .6; cursor: default; }
.hide { display: none; }
.progress { color: var(--mut); font-size: 14px; }
.scoreboard { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
.score-card { display: grid; place-items: center; text-align: center;
  background: linear-gradient(180deg,#fff,#f4f7ff); border: 1px solid var(--line);
  border-radius: 8px; padding: 20px; }
.score-num { font-size: 60px; font-weight: 950; line-height: 1; }
.score-label { font-size: 14px; font-weight: 900; color: var(--mut); margin-top: 6px; }
.site-title { font-size: 20px; font-weight: 900; margin: 0; word-break: break-all; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mini { background: var(--soft); border-radius: 999px; color: #334155;
  font-size: 12px; font-weight: 800; padding: 5px 9px; }
.bars { display: grid; gap: 10px; margin-top: 6px; }
.bar { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.bar .t { color: var(--mut); font-weight: 800; }
.track { height: 9px; background: #e7eaf3; border-radius: 999px; overflow: hidden; }
.fill { height: 100%; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.check, .rec, .prow { border: 1px solid var(--line); border-radius: 8px; padding: 11px; margin-bottom: 8px; background: #fff; }
.check { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: start; }
.tag { font-size: 11px; font-weight: 900; border-radius: 999px; padding: 4px 8px; text-align: center; height: fit-content; }
.pass { background: #e8efff; color: var(--good); }
.warn { background: #fff4dd; color: var(--warn); }
.fail { background: #ffe8e4; color: var(--bad); }
.ev { color: var(--mut); font-size: 12px; overflow-wrap: anywhere; }
.rec b { display: block; }
.rec span { color: var(--mut); font-size: 13px; }
.prow { display: grid; grid-template-columns: 1fr 90px 120px; gap: 10px; align-items: center; font-size: 13px; }
.prow .u { word-break: break-all; }
.muted { color: var(--mut); font-size: 12px; }
.err { color: var(--bad); border-color: #f1aaa3; background: #fff7f6; }
a.dl { color: var(--accent); font-weight: 800; }
pre { background: #fafbff; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow: auto; font-size: 12px; max-height: 260px; }
.footer { margin-top: 20px; color: var(--mut); font-size: 12px; }
.conf-sec { margin-bottom: 12px; }
.conf-sec-h { font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
  color: var(--mut); margin: 10px 0 6px; }
.conf-row { display: grid; grid-template-columns: 74px 128px minmax(0, 1fr); gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; margin-bottom: 6px; background: #fff; }
.conf-id { font-weight: 800; font-size: 12px; }
.conf-str { color: var(--mut); font-weight: 700; font-size: 11px; }
.conf-name { font-size: 13px; overflow-wrap: anywhere; }
.state { font-size: 11px; font-weight: 900; border-radius: 999px; padding: 4px 8px; text-align: center; }
.state.met { background: #e8efff; color: var(--good); }
.state.unmet { background: #ffe8e4; color: var(--bad); }
.state.na { background: #eef1f6; color: var(--mut); }
.about { margin-top: 22px; }
.about h2 { font-size: 18px; margin: 20px 0 8px; }
.about p { color: var(--mut); margin: 8px 0; max-width: 680px; }
.about ul, .about ol { color: var(--mut); padding-left: 20px; margin: 8px 0; max-width: 680px; }
.about li { margin: 5px 0; }
.about code { background: var(--soft); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.about a { color: var(--accent); font-weight: 700; }

/* Stakes-first hero (L1-D) */
.lede { font-size: 19px; line-height: 1.45; margin: 0 0 12px; max-width: 690px; color: var(--ink); }
.whynow { font-size: 14px; color: var(--mut); margin: 0 0 18px; max-width: 660px; }
a.pill { text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s; }
a.pill:hover { border-color: var(--accent); color: var(--accent); }

/* Example audits (cached, no live crawl) */
.examples { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 18px; }
.ex-label { font-size: 13px; font-weight: 800; color: var(--mut); }
.ex-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.ex-chip { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; cursor: pointer; box-shadow: none; color: var(--ink); }
.ex-chip:hover { border-color: var(--accent); background: #fbfcff; }
.ex-score { font-size: 26px; font-weight: 950; line-height: 1; min-width: 34px; text-align: center; }
.ex-text { display: grid; gap: 2px; min-width: 0; }
.ex-text b { font-size: 14px; }
.ex-text span { font-size: 12px; color: var(--mut); }

/* Agent's-eye view panel */
.agentview { border-left: 5px solid var(--line); }
.agentview.av-bad { border-left-color: var(--bad); }
.agentview.av-warn { border-left-color: var(--warn); }
.agentview.av-good { border-left-color: var(--good); }
.av-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px; }
.av-head h2 { font-size: 20px; margin: 0; line-height: 1.2; }
.av-sub { font-size: 13px; font-weight: 800; color: var(--mut); }
.av-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.av-screen-h { font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase;
  color: var(--mut); margin-bottom: 6px; }
#avMarkdown { margin: 0; max-height: 240px; white-space: pre-wrap; word-break: break-word; }
#avMarkdown.empty { color: var(--bad); font-style: italic; }
.av-misses .miss { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; background: #fff; }
.av-misses .miss b { display: block; font-size: 13px; margin-bottom: 2px; }
.av-misses .miss span { font-size: 12px; color: var(--mut); }
.av-misses .miss.ok b { color: var(--good); }

@media (max-width: 820px) {
  .scoreboard, .grid2, .form-row, .av-grid { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
}

/* ===== L1-E story arc ===== */
.beat-h { font-size: 20px; margin: 0 0 14px; }

/* Beat 1 — example tiles as mini split-screens */
.ex-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ex-tile { display: grid; gap: 10px; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; cursor: pointer; box-shadow: none; color: var(--ink); }
.ex-tile:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tile-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; height: 74px; }
.tile-human { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px;
  display: grid; gap: 5px; align-content: start; }
.tile-human i { height: 6px; border-radius: 3px; background: #dfe4ee; display: block; }
.tile-human i:nth-child(1) { width: 60%; height: 8px; background: #c3cadb; }
.tile-human i:nth-child(2) { width: 92%; }
.tile-human i:nth-child(3) { width: 74%; }
.tile-agent { background: #0f1320; color: #7fe7c4; border-radius: 6px; padding: 8px;
  font: 11px/1.4 ui-monospace, Menlo, monospace; display: flex; align-items: center;
  justify-content: center; text-align: center; }
.tile-agent.empty { color: #e0736b; }
.tile-text b { font-size: 14px; display: block; }
.tile-text span { font-size: 12px; color: var(--mut); }

/* Beat 2 — the mirror */
.mirror-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.browser, .agentpane { margin: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); position: relative; background: #fff; }
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #eef1f7; border-bottom: 1px solid var(--line); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #cfd6e4; display: block; }
.addr { font-size: 12px; color: var(--mut); background: #fff; border-radius: 6px; padding: 3px 8px;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-body { padding: 16px; min-height: 220px; display: grid; gap: 9px; align-content: start; }
.pg-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pg-nav span { font-size: 11px; color: var(--mut); font-weight: 700; }
.pg-title { font-size: 18px; font-weight: 900; }
.pg-h1 { font-size: 16px; font-weight: 800; }
.pg-h2 { font-size: 13px; font-weight: 700; color: #48506a; }
.pg-img { height: 46px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--mut);
  background: repeating-linear-gradient(45deg,#eef1f7,#eef1f7 8px,#e6eaf3 8px,#e6eaf3 16px); }
.pg-bar { height: 8px; border-radius: 4px; background: #edf0f6; }
.pg-bar:nth-of-type(even) { width: 92%; }
.agentpane { background: #0f1320; border-color: #0f1320; }
.agent-bar { padding: 8px 12px; background: #171c2c; color: #9fb0cf; font-size: 12px;
  font-weight: 800; letter-spacing: .03em; }
.agent-body { padding: 16px; min-height: 220px; display: grid; gap: 8px; align-content: start;
  font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; color: #7fe7c4; }
.agent-body.sparse { align-content: center; }
.ag-h { color: #cfe8ff; font-weight: 700; }
.ag-t { color: #86e8c6; opacity: .92; }
.ag-ghost { color: #f0958d; background: rgba(224,115,107,.08);
  border: 1px dashed rgba(224,115,107,.5); border-radius: 6px; padding: 8px 10px; }
.frame-tag { position: absolute; bottom: 8px; right: 10px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: var(--mut);
  background: rgba(255,255,255,.85); padding: 2px 7px; border-radius: 999px; }
.agentpane .frame-tag { color: #9fb0cf; background: rgba(23,28,44,.85); }
.mirror-counter { margin: 14px 0 0; font-size: 15px; font-weight: 700; }

/* Beat 3 — verdict */
.verdict-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.score-ring { --c: var(--accent); --p: 0; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; flex: none; text-align: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e7eaf3 0); }
.score-ring::before { content: ""; position: absolute; width: 84px; height: 84px;
  background: var(--card); border-radius: 50%; }
.score-ring .score-num { position: relative; font-size: 34px; font-weight: 950; line-height: 1; }
.score-ring .score-den { position: relative; font-size: 11px; color: var(--mut); }
.verdict-words { min-width: 0; }
.verdict-line { font-size: 21px; font-weight: 800; margin: 0 0 4px; }
.verdict-site { font-size: 13px; color: var(--mut); margin: 0; word-break: break-all; }
.problems { display: grid; gap: 8px; margin: 16px 0; }
.prob { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; }
.prob-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.prob-dot.bad { background: var(--bad); }
.prob-dot.warn { background: var(--warn); }
.prob-dot.ok { background: var(--good); }
.cats-wrap summary { cursor: pointer; color: var(--mut); font-weight: 700; font-size: 13px; }
.cats-wrap .cats { margin-top: 12px; display: grid; gap: 10px; }

/* Beat 4 — fix kit */
.fixkit-sub { color: var(--mut); max-width: 560px; }
button.big, a.dl.big { font-size: 16px; padding: 14px 26px; display: inline-block; text-decoration: none; }
a.dl.big { background: var(--accent); color: #fff; border-radius: 8px; font-weight: 900;
  box-shadow: 0 12px 28px rgba(47,109,246,.22); }
.stages { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.stage { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--mut); opacity: .5; }
.stage.active { color: var(--ink); opacity: 1; }
.stage.done { color: var(--good); opacity: 1; }
.stage .spin { width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--line); border-top-color: var(--accent); }
.stage.active .spin { animation: spin .7s linear infinite; }
.stage.done .spin { border: 2px solid var(--good); background: var(--good); animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.kit-card { text-align: center; padding: 8px; }
.kit-check { width: 54px; height: 54px; border-radius: 50%; background: var(--good); color: #fff;
  font-size: 30px; font-weight: 900; display: grid; place-items: center; margin: 0 auto 10px; }
.kit-card h3 { font-size: 22px; margin: 0 0 8px; }
.kit-card p { color: var(--mut); max-width: 520px; margin: 0 auto 16px; }
.cover-wrap { margin-top: 14px; text-align: left; }
.cover-wrap summary { cursor: pointer; color: var(--mut); font-weight: 700; font-size: 13px; }

/* Beat 5 — stakes + technical toggle */
.stakes { text-align: center; }
.stakes-line { font-size: 17px; margin: 0 0 14px; }
.stakes-actions { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.tech-toggle { color: var(--mut); font-weight: 700; font-size: 13px; text-decoration: underline; }
.na-toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px;
  color: var(--mut); cursor: pointer; }
.conf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 4px; }
#technicalView:not(.hide) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 4px; }

@media (max-width: 820px) {
  .mirror-grid { grid-template-columns: 1fr; }
}
