/* NeuronLens B2C: the Agent Lens v6 console design (agentlens_v6/app/frontend/app/globals.css,
   README_design_change.md 2026-10-10): cool white/grey surfaces, ink-indigo accent, navy primary,
   amber signal dot, Geist + Geist Mono, uppercase mono labels, 6px corners, square-ish chips,
   threshold tick on every probe bar; green allow / amber review / red block keep their meaning. */
@font-face { font-family: "Geist"; src: url("/static/fonts/Geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/GeistMono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FFFFFF; --panel: #F6F7F8; --elevated: #F1F3F5; --card: #FFFFFF;
  --border: #E4E7EA; --border-strong: #D3D8DD;
  --text: #0F1B22; --body: #3D4A53; --secondary: #5B6872; --muted: #8A969E;
  --navy: #1C2541; --indigo: #3B4A8C; --indigo-soft: #EEF0FA; --indigo-pale: #DCE1F4; --amber: #E8A317;
  --allow: #3E9B6B; --allow-bg: #DCFCE7; --allow-border: #86EFAC; --allow-text: #166534;
  --review: #D6A300; --review-bg: #FEF3C7; --review-border: #FCD34D; --review-text: #92400E;
  --block: #D9534A; --block-bg: #FEE2E2; --block-border: #FCA5A5; --block-text: #991B1B;
  --track: #E4E7EA; --btn: #1C2541; --btn-text: #FFFFFF;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E131A; --panel: #141A22; --elevated: #1A212B; --card: #11171F;
    --border: #26303B; --border-strong: #33404D;
    --text: #E8ECF0; --body: #C3CBD2; --secondary: #9AA5AE; --muted: #74808A;
    --indigo: #8E9BD6; --indigo-soft: #1B2240; --indigo-pale: #26305A;
    --allow: #5CC58A; --allow-bg: #12301F; --allow-border: #23573A; --allow-text: #8FE0B0;
    --review: #E8B324; --review-bg: #33270A; --review-border: #6B5214; --review-text: #F2CF6B;
    --block: #EC6A62; --block-bg: #3A1A18; --block-border: #6B2C28; --block-text: #F5A39D;
    --track: #26303B; --btn: #DCE1F4; --btn-text: #1C2541;
  }
}
:root[data-theme="dark"] {
  --bg: #0E131A; --panel: #141A22; --elevated: #1A212B; --card: #11171F;
  --border: #26303B; --border-strong: #33404D;
  --text: #E8ECF0; --body: #C3CBD2; --secondary: #9AA5AE; --muted: #74808A;
  --indigo: #8E9BD6; --indigo-soft: #1B2240; --indigo-pale: #26305A;
  --allow: #5CC58A; --allow-bg: #12301F; --allow-border: #23573A; --allow-text: #8FE0B0;
  --review: #E8B324; --review-bg: #33270A; --review-border: #6B5214; --review-text: #F2CF6B;
  --block: #EC6A62; --block-bg: #3A1A18; --block-border: #6B2C28; --block-text: #F5A39D;
  --track: #26303B; --btn: #DCE1F4; --btn-text: #1C2541;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 "Geist", "Inter", ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: "Geist Mono", ui-monospace, "SF Mono", monospace; }

/* top bar: the console's sidebar mark + brand, the header's model pill */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark { width: 32px; height: 32px; border-radius: var(--radius); background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--secondary); line-height: 1.2; }
.top-right { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.pill .label { margin-right: 2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }

/* site nav: the way back to neuronlens.com and across to the sibling apps. Sits under the
   topbar so the console's own identity (brand + model pill) is untouched. */
.navsite { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 20px;
  border-bottom: 1px solid var(--border); background: var(--card); }
.navsite ul { display: flex; align-items: center; gap: 16px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.navsite a { color: var(--secondary); font-size: 13px; font-weight: 500; }
.navsite a:hover { color: var(--text); text-decoration: none; }
.navsite a.back { color: var(--text); font-weight: 600; }
.navsite a[aria-current="page"] { color: var(--indigo); font-weight: 600; }
.navsite .navsite-sep { width: 1px; height: 12px; background: var(--border); flex: none; }

.wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
.al-title { font-size: 21px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.sub { margin: 0 0 24px; color: var(--secondary); font-size: 13px; }
.label { font-family: "Geist Mono", ui-monospace, monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px; }
.card + .card, #result { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.examples button { font: inherit; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--panel); color: var(--body); cursor: pointer; }
.examples button:hover { border-color: var(--border-strong); color: var(--text); }
.examples button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

textarea { width: 100%; resize: vertical; padding: 11px 12px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--secondary); margin: 8px 0 0; }
.eyebrow { margin-bottom: 10px; color: var(--indigo); }
.hero { padding: 4px 0 24px; }
.hero-title { font-size: 34px; line-height: 1.12; font-weight: 650; letter-spacing: -0.03em; margin: 0 0 12px; color: var(--text); }
.hero-sub { margin: 0 0 16px; font-size: 17px; line-height: 1.4; color: var(--secondary); }
.probe-list { display: flex; gap: 8px; flex-wrap: wrap; }
.probe-tag { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); }
.probe-tag.live .dot { background: var(--allow); }
.probe-tag.soon { color: var(--muted); font-weight: 500; border-style: dashed; background: transparent; }
@media (max-width: 560px) { .hero-title { font-size: 26px; } .hero-title br { display: none; } }
.modes { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.seg button:first-child { border-radius: 5px 0 0 5px; }
.seg button:last-child { border-radius: 0 5px 5px 0; }
.seg button { font: inherit; font-size: 12px; font-weight: 500; padding: 6px 12px; border: 0; background: transparent; color: var(--secondary); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--navy); color: #fff; font-weight: 600; }
.seg button { position: relative; }
.seg button[data-tip]:hover::after, .seg button[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 10; width: 250px;
  padding: 8px 10px; border-radius: var(--radius); background: var(--navy); color: #fff; font-size: 12px; font-weight: 400;
  line-height: 1.45; text-align: left; white-space: normal; box-shadow: 0 4px 14px rgba(15, 27, 34, 0.18); pointer-events: none; }
.cot { padding: 0; }
.cot summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.cot summary::-webkit-details-marker { display: none; }
.cot-hint { font-size: 12px; color: var(--indigo); }
.cot[open] .cot-hint { font-size: 0; }
.cot[open] .cot-hint::after { content: "hide"; font-size: 12px; }
.cot-note { margin: 0 16px 8px; font-size: 11px; color: var(--muted); }
.cot #cot-text { padding: 0 16px 16px; font-size: 13px; color: var(--secondary); }
#run { font: inherit; font-weight: 600; font-size: 13px; padding: 9px 22px; border: 0; border-radius: var(--radius);
  background: var(--btn); color: var(--btn-text); cursor: pointer; white-space: nowrap; }
#run:hover { filter: brightness(1.15); }
#run:disabled { opacity: 0.5; cursor: progress; }

/* answer with the token view */
.answer { word-break: break-word; line-height: 1.75; color: var(--body); font-size: 14px; }
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer p { margin: 0 0 12px; }
.answer h3, .answer h4 { margin: 18px 0 8px; color: var(--text); font-weight: 600; line-height: 1.3; }
.answer h3 { font-size: 16px; }
.answer h4 { font-size: 14px; }
.answer strong { color: var(--text); font-weight: 600; }
.answer ul, .answer ol { margin: 0 0 12px; padding-left: 22px; }
.answer li { margin: 3px 0; }
.answer li > ul, .answer li > ol { margin: 4px 0 0; }
.answer hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.answer code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; background: var(--panel); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; }
.md-table { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.md-table table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.5; }
.md-table th, .md-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border);
  word-break: normal; overflow-wrap: normal; min-width: 90px; }
.math-block { margin: 6px 0 10px; overflow-x: auto; color: var(--text); }
.math { color: var(--text); }
.math-block code, .math code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; }
.md-table th { background: var(--panel); color: var(--text); font-weight: 600; }
.md-table tr:last-child td { border-bottom: 0; }
/* one colour per failure mode: background = strongest probe on the token, underline = the second one */
.tok.warm, .tok.hot { background: color-mix(in srgb, var(--c, var(--block)) var(--w, 20%), transparent); border-radius: 2px; color: var(--text); cursor: help; }
.tok.both { border-bottom: 2px var(--ls, solid) var(--u); }
.tok.hot { font-weight: 600; }
.tok.in-sent { background-color: var(--indigo-soft); }
.tok.in-sent.warm, .tok.in-sent.hot { background: color-mix(in srgb, var(--c) calc(var(--w) + 10%), transparent); }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11px; font-weight: 600; color: var(--text);
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); cursor: pointer; }
.legend .key[aria-pressed="false"] { color: var(--muted); font-weight: 500; }
.legend .key[aria-pressed="false"] .sw { opacity: 0.25; }
.sw { display: inline-block; width: 14px; height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--c) 45%, transparent);
  border-bottom: 2px var(--ls, solid) var(--c); }

/* prompt card rows: failure modes, examples. Label column, then chips (square-ish, like the console) */
.row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fm { position: relative; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12px; font-weight: 500; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--muted); cursor: pointer; }
.fm .sw { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--c); opacity: 0.3; }
.fm[aria-pressed="true"] { border-color: color-mix(in srgb, var(--c) 55%, var(--border)); background: color-mix(in srgb, var(--c) 8%, var(--card));
  color: var(--text); font-weight: 600; }
.fm[aria-pressed="true"] .sw { opacity: 1; }
.fm:hover { border-color: var(--border-strong); }
.soon { font-size: 12px; color: var(--muted); padding-left: 4px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 6px; } }
.fm[data-tip]:hover::after, .fm[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 10; width: 240px;
  padding: 8px 10px; border-radius: var(--radius); background: var(--navy); color: #fff; font-size: 12px; font-weight: 400;
  line-height: 1.45; text-align: left; white-space: normal; box-shadow: 0 4px 14px rgba(15, 27, 34, 0.18); pointer-events: none; }

/* probe readings: bar with a threshold tick, like the console trace */
.probe { display: grid; grid-template-columns: 128px 1fr 44px 74px; align-items: center; gap: 12px; padding: 8px 0; }
.probe + .probe { border-top: 1px solid var(--border); }
.probe.na { opacity: 0.55; }
.probe-name { font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.probe-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.bar { height: 6px; background: var(--track); border-radius: 3px; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--indigo); }
.bar.fired > i { background: var(--block); }
.bar > b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.55; border-radius: 1px; }
.num { font-family: "Geist Mono", ui-monospace, monospace; font-weight: 600; font-size: 13px; text-align: right; }
.num.fired { color: var(--block); }
.chip { justify-self: start; font-family: "Geist Mono", ui-monospace, monospace; font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); background: var(--panel); }
.chip.fired { color: var(--block-text); background: var(--block-bg); border-color: var(--block-border); }

/* verdict: allow = green, escalate = amber (review), deny = red (block) */
.verdict { display: grid; grid-template-columns: auto 84px 1fr; align-items: center; gap: 18px; margin-top: 16px;
  padding: 14px 16px; border: 1px solid var(--review-border); border-radius: var(--radius); background: var(--review-bg); }
.verdict .v-word { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--review-text); }
.verdict.allow { border-color: var(--allow-border); background: var(--allow-bg); }
.verdict.allow .v-word { color: var(--allow-text); }
.verdict.deny { border-color: var(--block-border); background: var(--block-bg); }
.verdict.deny .v-word { color: var(--block-text); }
.v-why { font-size: 13px; color: var(--body); }
.dial { width: 84px; height: 50px; }
.dial-track, .dial-fill { fill: none; stroke-width: 9; stroke-linecap: round; }
.dial-track { stroke: color-mix(in srgb, var(--text) 10%, transparent); }
.dial-fill { stroke: var(--review); }
.verdict.allow .dial-fill { stroke: var(--allow); }
.verdict.deny .dial-fill { stroke: var(--block); }
.dial-thr { stroke: var(--text); stroke-width: 2; opacity: 0.55; }
.dial text { font-family: "Geist Mono", ui-monospace, monospace; font-size: 15px; font-weight: 600; fill: var(--text); }
.timing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.timing > div { background: var(--card); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.t-num { font-family: "Geist Mono", ui-monospace, monospace; font-size: 16px; font-weight: 600; color: var(--text); }
#t-probe { color: var(--indigo); }
@media (max-width: 560px) { .timing { grid-template-columns: 1fr; } .timing > div { flex-direction: row; justify-content: space-between; align-items: baseline; } }
.meta { margin-top: 10px; font-size: 11px; color: var(--muted); }

.error { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--block-border);
  background: var(--block-bg); color: var(--block-text); font-size: 13px; }

.callout { margin-top: 40px; padding: 14px 16px; border: 1px solid var(--indigo-pale); border-radius: var(--radius);
  background: var(--indigo-soft); font-size: 13px; color: var(--body); }
.callout strong { color: var(--text); }
.fine { margin-top: 12px; font-size: 12px; color: var(--muted); }

@media (max-width: 560px) {
  .topbar { padding: 10px 16px; }
  .brand-sub, .pill .label, .pill .long { display: none; }
  .navsite { padding: 7px 16px; }
  .navsite ul { gap: 12px; }
  .wrap { padding: 24px 16px 48px; }
  .probe { grid-template-columns: 112px 1fr 40px; }
  .probe .chip { display: none; }
  .verdict { grid-template-columns: 1fr auto; }
  .v-why { grid-column: 1 / -1; }
}

/* docs page */
.docs h2 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; }
.docs p, .docs td { color: var(--body); }
.docs pre { background: var(--navy); color: #E8ECF0; border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.55; }
.docs code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.9em; color: var(--indigo); }
.docs pre code { color: inherit; }
.docs table { border-collapse: collapse; width: 100%; font-size: 13px; }
.docs td, .docs th { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs th { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; font-weight: 500; color: var(--secondary); white-space: nowrap; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.docs h2 { scroll-margin-top: 12px; }
