/* redactify me — console */
:root {
  --bg: #07080b;
  --panel: #0d1016;
  --panel-2: #11151d;
  --line: #1f2531;
  --line-hi: #2e3647;
  --text: #e6e9f0;
  --muted: #8b95a8;
  --dim: #566074;
  --amber: #f0b34c;
  --ok: #5fd394;
  --bad: #ef6a63;
  --info: #6ec4e8;
  --violet: #b69cff;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
  --pad: clamp(14px, 3.2vw, 24px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.55 var(--mono); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; background-image: radial-gradient(1200px 600px at 10% -10%, rgba(240,179,76,.06), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(95,211,148,.04), transparent 60%); }
body.booting { overflow: hidden; }
a { color: var(--info); text-decoration: none; }
button { font: inherit; color: inherit; }
input { font: inherit; }
code { color: var(--amber); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.dim { color: var(--dim); }

.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; display: block; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }

/* ================= TUI ================= */
.tui {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.tui.leaving { opacity: 0; transform: scale(1.03); }
.term {
  width: min(760px, 100%); height: min(640px, calc(100dvh - 70px));
  display: flex; flex-direction: column;
  background: rgba(10, 12, 17, .96); border: 1px solid var(--line-hi); border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.03);
  overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #10131a; border-bottom: 1px solid var(--line); font-size: 12px; }
.term-title { color: var(--muted); flex: 1; text-align: center; }
.term-meta { color: var(--dim); }
.term-body { flex: 1; overflow-y: auto; padding: 18px clamp(14px, 3vw, 22px) 22px; scroll-behavior: smooth; }
.term-body::-webkit-scrollbar { width: 6px; } .term-body::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 3px; }
.tui-foot { margin-top: 12px; color: var(--dim); font-size: 11px; text-align: center; }

.cmd-line { display: flex; align-items: baseline; gap: 10px; font-size: clamp(15px, 2.4vw, 17px); font-weight: 700; margin-bottom: 14px; }
.ps1 { color: var(--ok); }
.cmd { color: var(--text); }
.cmd-arg { color: var(--amber); }
.caret { color: var(--amber); animation: blink 1s steps(2, start) infinite; font-weight: 400; }
.caret.off { display: none; }
@keyframes blink { to { visibility: hidden; } }

.ln { display: flex; gap: 10px; align-items: baseline; padding: 1.5px 0; font-size: 12.5px; color: #cdd3df; animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(3px); } }
.ln.warn { color: var(--amber); }
.boot { margin-bottom: 14px; }
.boot-ln .st { width: 22px; flex: none; color: var(--muted); }
.boot-ln .ok { color: var(--ok); font-weight: 700; }
.boot-ln .bad { color: var(--bad); font-weight: 700; }
.boot-ln .lbl { color: var(--text); white-space: nowrap; }
.boot-ln .dt { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.boot-ln.done .lbl { color: #cdd3df; }

/* intake */
.intake { border-top: 1px dashed var(--line-hi); padding-top: 14px; margin-bottom: 8px; }
.ask { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 13.5px; }
.ask .q, .q-text .q { color: var(--ok); font-weight: 700; }
.ask label, .ask .fl { color: var(--text); font-weight: 600; white-space: nowrap; }
.ask .chev { color: var(--dim); }
.ask input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--amber); padding: 4px 0;
  border-bottom: 1px solid transparent; caret-color: var(--amber); font-size: 16px; /* 16px stops iOS zoom */
}
.ask input:focus { border-bottom-color: var(--line-hi); }
.ask input::placeholder { color: #394155; }
.ask.answered input { color: var(--info); }
.ask.answered .q { color: var(--dim); }
.hint { color: var(--dim); font-size: 11.5px; margin-top: 6px; }
.hint.err { color: var(--bad); }

/* builder */
.builder { border-top: 1px dashed var(--line-hi); padding-top: 12px; margin-top: 6px; }
.sweep { margin-bottom: 10px; }
.sweep-head { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.sweep-head .spin { color: var(--amber); width: 14px; }
.sweep.done .spin { color: var(--ok); }
.sweep-n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), #ffd27f); transition: width .3s ease; }
.sweep.done .bar-fill { background: var(--ok); width: 100% !important; }

.tag { flex: none; min-width: 52px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.tag.hit { color: var(--amber); } .tag.bad { color: var(--bad); } .tag.okt { color: var(--ok); }
.tag.ai { color: var(--violet); } .tag.you { color: var(--info); }
.say-ln .say { color: var(--text); }
.think-ln .sp { color: var(--violet); }
.lock-ln { color: var(--ok); }

.conf { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 11.5px; color: var(--muted); }
.conf-bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.conf-fill { display: block; height: 100%; width: 0; background: var(--amber); transition: width .6s cubic-bezier(.2,.8,.2,1), background .3s; }
.conf.high .conf-fill { background: var(--ok); }
.conf-v { width: 38px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

.question { margin-top: 10px; padding: 12px; border: 1px solid var(--line-hi); border-radius: 8px; background: rgba(255,255,255,.015); animation: rise .25s ease both; }
.q-text { font-weight: 700; margin-bottom: 8px; }
.opts { display: flex; flex-direction: column; gap: 3px; }
.opt { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 8px 10px; cursor: pointer; min-height: 40px; }
.opt-n { color: var(--dim); flex: none; }
.opt-l { flex: 1; min-width: 0; }
.opt-s { color: var(--dim); font-size: 11px; flex: none; }
.opt.sel { border-color: rgba(240,179,76,.45); background: rgba(240,179,76,.08); }
.opt.sel .opt-n, .opt.sel .opt-l { color: var(--amber); }
.opt:focus-visible { outline: 1px dashed var(--amber); }

.id-card { border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 6px; padding: 10px 12px; margin: 0 0 10px; background: #0b0e13; }
.id-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.id-age { margin-left: 10px; color: var(--amber); }
.id-row { display: flex; gap: 10px; font-size: 12.5px; color: #cdd3df; }
.id-row span { width: 64px; flex: none; color: var(--dim); }
.facts { display: flex; flex-direction: column; gap: 2px; }

/* ================= DASHBOARD ================= */
.dash { max-width: 1180px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) max(24px, env(safe-area-inset-bottom)); opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1); }
.dash.in { opacity: 1; transform: none; }
.dash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.logo-arg { color: var(--amber); }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip-btn { background: var(--panel-2); border: 1px solid var(--line-hi); border-radius: 7px; padding: 7px 12px; font-size: 12px; cursor: pointer; color: var(--muted); min-height: 34px; }
.chip-btn:hover { color: var(--text); border-color: #3d475c; }
.chip-btn.primary { background: var(--amber); border-color: var(--amber); color: #1a1405; font-weight: 700; }
.chip-btn[aria-pressed="true"] { color: var(--amber); border-color: rgba(240,179,76,.5); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.k { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-hi); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(95,211,148,.4); background: rgba(95,211,148,.08); }
.pill.bad { color: var(--bad); border-color: rgba(239,106,99,.4); background: rgba(239,106,99,.08); }
.pill.amber { color: var(--amber); border-color: rgba(240,179,76,.4); background: rgba(240,179,76,.08); }

.hero { display: grid; grid-template-columns: minmax(180px, 230px) 1fr; gap: 14px; margin-bottom: 14px; }
.grade { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; --g: var(--bad); border-color: color-mix(in srgb, var(--g) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--g) 14%, transparent), var(--panel) 70%); }
.grade.g-a { --g: var(--ok); } .grade.g-b { --g: var(--info); } .grade.g-c { --g: var(--amber); }
.grade-letter { font-size: clamp(64px, 11vw, 96px); line-height: 1; font-weight: 800; color: var(--g); text-shadow: 0 0 40px color-mix(in srgb, var(--g) 35%, transparent); }
.grade-meter { width: 100%; max-width: 150px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.grade-meter span { display: block; height: 100%; background: var(--g); width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1) .2s; }
.grade-sub { color: var(--muted); font-size: 12px; }

.summary .headline { font-size: clamp(17px, 2.3vw, 22px); line-height: 1.3; margin: 0 0 8px; font-weight: 800; letter-spacing: -.01em; }
.sum-text { margin: 0 0 14px; color: #c9cfdb; max-width: 78ch; }
.who { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.kv span:first-child { color: var(--dim); margin-right: 7px; }
.kv b { color: var(--amber); font-weight: 700; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-chip { font-size: 11px; padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line-hi); color: var(--muted); }
.tag-chip.hot { color: var(--bad); border-color: rgba(239,106,99,.35); background: rgba(239,106,99,.06); }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row-t { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.row-y { color: var(--bad); font-size: 12px; flex: none; }
.row-d { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row-link { font-size: 12px; flex: none; padding: 2px 0 2px 8px; }
.row.broker { border-left: 3px solid var(--amber); }
.row.broker.paid { border-left-color: var(--violet); }
.mini { margin-left: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--violet); font-weight: 600; }
.mini.agent { color: var(--muted); }
.mini.agent.running { color: var(--amber); }
.mini.agent.ok { color: var(--ok); }
.mini.agent.bad { color: var(--bad); }
.row-links { display: flex; gap: 6px; flex: none; }
.optout-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.optout-meta { font-size: 12px; color: var(--muted); }
.otp-box { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.otp-step { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.otp-step input { flex: 1 1 180px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; font: inherit; font-size: 13px; }
.otp-msg { font-size: 12px; color: var(--muted); }
.otp-msg.ok { color: var(--ok); }
.otp-msg.err { color: var(--bad); }
.opt-note { margin-top: 5px; font-size: 11.5px; color: var(--ok); }
.empty { color: var(--ok); font-size: 12.5px; padding: 10px 2px; }
.empty.muted { color: var(--dim); }
.more { color: var(--dim); font-size: 12px; padding: 2px 2px 0; }

.dash-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--dim); font-size: 11px; padding: 16px 2px 0; }

.turnstile-box { margin-top: 10px; }
.capture { margin-top: 14px; }
.cap-text { color: var(--muted); font-size: 13px; margin: 4px 0 12px; line-height: 1.5; }
.cap-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cap-form input[type="email"] { flex: 1 1 220px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; font: inherit; font-size: 13px; }
.cap-chk { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
.cap-msg { margin-top: 9px; font-size: 12px; }
.cap-msg.ok { color: var(--ok); }
.cap-msg.err { color: var(--bad); }

/* redaction */
body.redacted .pii { color: transparent; background: #2a3040; border-radius: 3px; user-select: none; }

/* ================= responsive ================= */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html, body { font-size: 13px; }
  .hero { grid-template-columns: 1fr; }
  .grade { flex-direction: row; justify-content: flex-start; text-align: left; gap: 16px; }
  .grade .k { display: none; }
  .grade-letter { font-size: 60px; }
  .grade-meter { display: none; }
  .grade-sub::before { content: "exposure grade · "; color: var(--dim); }
  .term { height: calc(100dvh - 64px); border-radius: 10px; }
  .tui-foot { font-size: 10px; }
  .boot-ln .dt { display: none; }
  .tag { min-width: 44px; }
  .dash-bar { flex-direction: column; align-items: stretch; }
  .dash-actions { justify-content: stretch; }
  .chip-btn { flex: 1; }
  .who { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
