/* Benchwell agent scan, concept D. Production stylesheet, light theme only.
   Tokens match demo/assets/landing.css. Fonts: load Host Grotesk 300/400/500 and Geist Mono 400 in <head>.
   Layout: left = the agent's work (step rail + knowledge notes), right = stream (summary, answers, result). */

:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #fbfbf9;
  --tile: #e9e8e2;
  --ink: #121413;
  --ink-2: #4a4e49;
  --ink-3: #7a7e77;
  --ink-4: #a9aca5;
  --line: #dddbd4;
  --line-strong: #c3c0b6;
  --accent: #c9f03a;
  --accent-2: #b9e224;
  --accent-ink: #0c0e0b;
  --pass: #0b8a80;
  --fail: #cf3a2b;
  --comp: #9c6500;
  --font: "Host Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gut: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
p, h1, h2, h3, h4, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gut); display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.brand svg { width: 24px; height: 24px; }
.top-tag { font-size: 15px; color: var(--ink-3); padding-left: 14px; border-left: 1px solid var(--line-strong); line-height: 1.1; }
.top-right { margin-left: auto; font-size: 15px; display: flex; align-items: center; gap: 16px; }
.top-right a { text-decoration: none; color: var(--ink-2); }
.top-right a:hover { color: var(--ink); }
.narrow { --maxw: 1160px; }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 26px; border-radius: 999px; font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); transition: background .2s, border-color .2s; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn[disabled] { opacity: .5; cursor: progress; }
.field { width: 100%; height: 50px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: 400 16px/1 var(--font); outline: none; }
.field:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field::placeholder { color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 15px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.link:hover { color: var(--ink); }

/* ---------- status words (sans, colour only) ---------- */
.st { font-weight: 500; white-space: nowrap; }
.st-ok { color: var(--pass); }
.st-warn { color: var(--comp); }
.st-fail { color: var(--fail); }
.st-info { color: var(--ink-3); }
.st-wait { color: var(--ink-3); font-weight: 400; }
.ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-strong); border-top-color: var(--ink); animation: bw-spin 1s linear infinite; vertical-align: -1px; margin-left: 6px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: bw-pulse 1.6s infinite; flex: none; }
@keyframes bw-spin { to { transform: rotate(360deg); } }
@keyframes bw-pulse { 0% { box-shadow: 0 0 0 0 rgba(18,20,19,.35); } 70% { box-shadow: 0 0 0 7px rgba(18,20,19,0); } 100% { box-shadow: 0 0 0 0 rgba(18,20,19,0); } }
@keyframes bw-fresh { from { background: rgba(201,240,58,.22); } to { background: transparent; } }
@keyframes bw-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- start page ---------- */
.start { max-width: 1160px; margin: 0 auto; padding: clamp(48px, 11vh, 130px) var(--gut) 90px; }
.start h1 { font-weight: 300; font-size: clamp(40px, 5vw, 72px); line-height: 1.04; letter-spacing: -0.04em; max-width: 17ch; text-wrap: balance; }
.start .lede { margin: 26px 0 38px; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; color: var(--ink-2); max-width: 46ch; }
.url-form { display: flex; gap: 8px; max-width: 620px; }
.url-form .field { flex: 1; min-width: 0; height: 60px; font-size: 19px; padding: 0 24px; }
.url-form .btn { height: 60px; padding: 0 30px; font-size: 17px; }
.start .hint { margin-top: 14px; font-size: 15px; color: var(--ink-3); }
.start .hint.err { color: var(--fail); }
.form-err { margin-top: 10px; font-size: 15px; color: var(--fail); }
.start-qs { margin-top: 84px; border-top: 1px solid var(--ink); }
.start-qs li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); font-weight: 300; font-size: clamp(20px, 1.8vw, 24px); letter-spacing: -0.015em; }
.start-qs small { font-weight: 400; font-size: 15px; letter-spacing: 0; color: var(--ink-4); white-space: nowrap; }

/* ---------- scan layout ---------- */
.app { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 clamp(40px, 5vw, 80px); }
.stage { align-self: start; padding: 28px 0 48px; min-width: 0; }
/* the stage scrolls with the page: a sticky panel taller than the screen would hide its end */
.side { border-left: 1px solid var(--line); padding: 28px 0 96px clamp(32px, 4vw, 64px); min-width: 0; }
.stream { min-width: 0; }

.s-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 20px; flex-wrap: wrap; padding-bottom: 26px; }
.site { font-weight: 300; font-size: clamp(36px, 3.6vw, 52px); line-height: 1; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.state { margin-top: 14px; font-size: 15px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.state .now { color: var(--ink); display: inline-flex; gap: 10px; align-items: center; }
.state .closed { color: var(--fail); font-weight: 500; }
.replay { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.replay:hover { border-color: var(--ink); color: var(--ink); }
.replay svg { width: 10px; height: 10px; fill: currentColor; }
.m-only { display: none; }

/* ---------- map: one grid row per top-level step ---------- */
.lanes, .map { display: grid; grid-template-columns: 52px minmax(0, 300px) minmax(0, 1fr); gap: 0 18px; }
.lanes { font-size: 14px; color: var(--ink-3); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.map { position: relative; align-content: start; transition: min-height .45s var(--ease); }
.map > .t { grid-column: 1; font: 400 12px/1 var(--mono); color: var(--ink-3); padding-top: 25px; }
.map > .act { grid-column: 2; position: relative; padding: 16px 0; min-width: 0; }
.map > .act::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.map > .act.first::before { top: 30px; }
.map > .act.last::before { bottom: auto; height: 30px; }
.map > .notes { grid-column: 3; display: grid; gap: 8px; padding: 12px 0; align-content: start; position: relative; min-width: 0; }
.map > .notes:not(:empty)::before { content: ""; position: absolute; left: -18px; top: 30px; width: 14px; border-top: 1px dashed var(--line-strong); }
.map .kids { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; margin: 8px 0 0 28px; }

.pill { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 30px; max-width: 100%; padding: 0 11px 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: 400 12.5px/1 var(--mono); color: var(--ink); white-space: nowrap; cursor: default; transition: opacity .2s, border-color .3s, background .3s, color .3s; }
.pill > span { overflow: hidden; text-overflow: ellipsis; }
.pill svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pill.sub { height: 26px; font-size: 12px; color: var(--ink-2); background: transparent; border-color: var(--line); }
.pill.bad { color: var(--fail); border-color: #e3b1a8; }
.pill.bad svg { stroke: var(--fail); }
.pill.now { background: var(--accent); border-color: var(--accent-2); color: var(--accent-ink); }
.pill.now svg { stroke: var(--accent-ink); }
.pill.ghost { color: var(--ink-4); border-style: dashed; background: transparent; }
.pill.ghost svg { stroke: var(--ink-4); }
.map.dim .pill:not(.hl) { opacity: .28; }
.map.dim .note:not(.hl) { opacity: .35; }
.pill.hl { border-color: var(--ink); }

.map .note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px 12px; cursor: default; transition: border-color .15s, opacity .2s; }
.map .note:hover, .map .note.on { border-color: var(--ink-3); }
.map .note h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 500; line-height: 1.3; }
.map .note h3 .st { font-size: 14px; }
.map .note p { margin-top: 4px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.map .note.missing { border-style: dashed; background: transparent; }
.map .note.hl { border-color: var(--ink); }

.v-img { position: relative; aspect-ratio: 16 / 10; background: var(--tile); }
.v-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .45s var(--ease); }
.v-img img.on { opacity: 1; }
.map-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; color: var(--ink-3); }
.map-foot b { font-weight: 500; color: var(--ink); }

/* step card and knowledge popover */
.tip, .pop { position: absolute; top: 0; left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(18,20,19,.35); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; transform: translateX(-4px); }
.tip.below, .pop.below { transform: translateY(4px); }
.tip.on, .pop.on { opacity: 1; transform: none; }
.tip { width: 320px; padding: 12px; font-size: 13.5px; }
.tip img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 7px; border: 1px solid var(--line); margin-bottom: 12px; }
.tip dl { display: grid; grid-template-columns: 70px 1fr; gap: 5px 12px; padding: 0 2px; }
.tip dt { color: var(--ink-3); }
.tip dd { overflow-wrap: anywhere; }
.tip dd.m { font: 400 12.5px/1.5 var(--mono); }
.pop { width: 340px; padding: 16px 18px; font-size: 14.5px; line-height: 1.45; }
.pop h4 { margin-bottom: 8px; font-size: 16px; font-weight: 500; display: flex; justify-content: space-between; gap: 12px; }
.pop li { padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.pop .src { margin-top: 10px; font: 400 12px var(--mono); color: var(--ink-3); }

/* ---------- stream ---------- */
.blk { padding-bottom: 32px; }
.blk + .blk { border-top: 1px solid var(--line); padding-top: 24px; }
.blk > h2 { font-weight: 400; font-size: 15px; color: var(--ink-3); margin-bottom: 12px; }
.verdict { font-weight: 300; font-size: clamp(24px, 2.1vw, 30px); line-height: 1.25; letter-spacing: -0.02em; text-wrap: pretty; }
.meta { margin-top: 16px; display: flex; gap: 20px; }
.summary { font-weight: 300; font-size: 23px; line-height: 1.35; letter-spacing: -0.015em; }
.tags { margin-top: 10px; font-size: 14.5px; color: var(--ink-3); }
.ticker { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink-2); }
.next { font-size: 14px; color: var(--ink-3); }

/* answers: question rows that open into their checks */
.qa { border-top: 1px solid var(--ink); }
.q { border-bottom: 1px solid var(--line); }
.q > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; gap: 2px 16px; align-items: baseline; padding: 13px 0 12px; }
.q > summary::-webkit-details-marker { display: none; }
.q-t { font-size: 17px; line-height: 1.35; }
.q-a { font-size: 17px; font-weight: 500; text-align: right; }
.q-n { grid-column: 1 / 3; font-size: 13.5px; color: var(--ink-3); }
.q-pm { grid-column: 3; grid-row: 1; position: relative; width: 12px; height: 12px; align-self: center; }
.q-pm::before, .q-pm::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 1.5px; background: var(--ink-3); transition: transform .3s var(--ease); }
.q-pm::after { transform: rotate(90deg); }
.q[open] .q-pm::after { transform: rotate(0); }
.q > summary:hover .q-pm::before, .q > summary:hover .q-pm::after { background: var(--ink); }
.q.fresh > summary { animation: bw-fresh 2.4s var(--ease); }
.q-checks { margin: 0 0 14px 1px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.q-checks li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 1px 12px; padding: 8px 0; }
.q-checks li + li { border-top: 1px solid var(--line); }
.q-checks .st { font-size: 13.5px; line-height: 1.45; }
.q-checks .c-t { font-size: 15px; line-height: 1.4; }
.q-checks .c-ev { grid-column: 2; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); overflow-wrap: anywhere; }
.q-checks li.fresh { animation: bw-fresh 2.4s var(--ease); }
.ref { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }

/* AI search */
.query { font-size: 18px; line-height: 1.4; }
.ai { margin-top: 12px; }
.ai li { display: grid; grid-template-columns: 118px 92px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.ai .pos { font-weight: 500; white-space: nowrap; }
.ai .n { font-size: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai .n b { color: var(--ink); font-weight: 500; }
.ai li.wait { color: var(--ink-3); }
.fine { margin-top: 10px; font-size: 13px; color: var(--ink-3); }

/* compact label lists: what's at stake, tasks */
.kv li { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.45; }
.kv li:first-child { border-top: 0; padding-top: 0; }
.kv .k { color: var(--ink-3); }

/* request form: calm, no panel */
.ask h3 { font-weight: 300; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
.ask .l { margin: 8px 0 16px; font-size: 15px; color: var(--ink-3); }
.ask form { display: grid; gap: 10px; }
.ask .r { display: flex; gap: 8px; margin-top: 6px; }
.ask .r .field { flex: 1; min-width: 0; }
.ask .small { font-size: 13.5px; color: var(--ink-3); }
.ask.sent form { opacity: .5; pointer-events: none; }

/* closed: attempts */
.tries li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 1px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.tries li:first-child { border-top: 0; padding-top: 0; }
.tries .how { grid-column: 2; font-size: 13.5px; color: var(--ink-3); }
.lead-p { margin-top: 14px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .stage { padding-bottom: 24px; }
  .side { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 80px; }
  .stage > .eye-slot { padding-bottom: 8px; }
  .m-only { display: block; }
  .meta.m-only { display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .s-head .verdict { margin-top: 20px; }
  .stream .d-only { display: none; }
  .stream .d-only + .blk { border-top: 0; padding-top: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top-tag { display: none; }
  .lanes { display: none; }
  .map { grid-template-columns: 38px minmax(0, 1fr); }
  .map > .t { font-size: 11px; }
  .map > .notes { grid-column: 2; padding: 0 0 14px 28px; }
  .map > .notes:not(:empty)::before { display: none; }
  .map:not(.live) > .notes:empty { display: none; }
  .map > .act { padding-bottom: 8px; }
  .map > .act.last::before { height: 100%; }
  .map > .act.last.alone::before { height: 30px; }
  .s-head .replay { display: none; }
  .url-form { flex-direction: column; }
  .url-form .field, .url-form .btn { height: 54px; flex: none; }
  .start-qs { margin-top: 56px; }
  .start-qs li { flex-direction: column; gap: 2px; }
  .ai li { grid-template-columns: 118px 1fr; }
  .ai .n { grid-column: 1 / -1; white-space: normal; }
  .kv li { grid-template-columns: 1fr; gap: 1px; }
  .ask .r { flex-direction: column; }
  .ask .r .field { flex: none; }
  .tip { width: 280px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
.blk.d-only + .blk.cont { border-top: 0; padding-top: 0; margin-top: -14px; }
.blk.cont .lead-p { margin-top: 0; }

/* assistant marks */
svg.logo { width: 15px; height: 15px; fill: currentColor; stroke: none; flex: none; }
.ai .vn { display: inline-flex; align-items: center; gap: 9px; }
.pill svg.logo { width: 12px; height: 12px; }

/* motion: new things rise in, changed things glow once; nothing bounces */
@keyframes bw-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bw-fade { from { opacity: .35; } to { opacity: 1; } }
.enter { animation: bw-rise .34s var(--ease) both; }
.flash { animation: bw-fresh 1.8s var(--ease); }
.swap { animation: bw-fade .4s var(--ease); }
.q-n.ev { color: var(--ink-2); }
.fine-ev { font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.fine-ev + .fine-ev { margin-top: 8px; }

/* language menu: copied 1:1 from demo/assets/landing.css */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 58px; padding: 0 14px 0 16px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: inherit; cursor: pointer;
  font: 400 13px/1 var(--font); letter-spacing: 0.06em; transition: border-color .2s;
}
.lang-btn:hover { border-color: currentColor; }
.lang-btn svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.lang.open .lang-btn svg { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 160px; padding: 6px;
  background: #f4f3ef; color: #121417; border: 1px solid rgba(18,20,23,.1); border-radius: 14px;
  box-shadow: 0 14px 40px -16px rgba(18,20,23,.35); opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility 0s .18s;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s; }
.lang-menu a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 9px;
  color: inherit; text-decoration: none; font: 400 13px/1.2 var(--font); letter-spacing: 0.06em;
}
.lang-menu a:hover { background: rgba(18,20,23,.05); }
.lang-menu a[aria-current="true"] { font-weight: 500; }
.lang-menu a[aria-current="true"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9cc61c; align-self: center; margin-left: -8px; order: 3; }
@media (prefers-reduced-motion: reduce) { .lang-menu, .lang-btn svg { transition: none; } }

/* "What the agent sees": fixed block at the top of the right column during the run */
.eye { padding-bottom: 26px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.eye h2 { font-weight: 400; font-size: 15px; color: var(--ink-3); margin-bottom: 12px; }
.eye figure { margin: 0; }
.eye .v-img { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.eye .v-img img { transition: opacity .5s var(--ease), filter .5s var(--ease); }
.eye.away .v-img img.on { opacity: .55; filter: saturate(.6); }
.eye .ph { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14.5px; color: var(--ink-3); transition: opacity .4s var(--ease); }
.eye.has .ph { opacity: 0; pointer-events: none; }
.eye figcaption { margin-top: 10px; display: grid; gap: 2px; font-size: 13.5px; line-height: 1.45; }
.eye .cap-a, .eye .cap-b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eye .cap-a { color: var(--ink-2); }
.eye .cap-b { color: var(--ink-3); }
@media (max-width: 760px) { .top-right .ext { display: none; } .state .pg { display: none; } .state { flex-wrap: nowrap; white-space: nowrap; } }
