/* ===========================================================
   Aegis — modern fintech-grade UI. Light + dark. Big-text friendly.
   =========================================================== */
:root {
  --scale: 1;
  --bg: #eef1f8;
  --bg2: #e7ebf6;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --ink: #131a2b;
  --muted: #5c6785;
  --line: #e4e8f2;
  --line-2: #eef1f8;
  --brand: #3b63f6;
  --brand-2: #6a5cff;
  --brand-ink: #2a49c8;
  --brand-soft: rgba(59,99,246,.10);
  --ok: #10a05a;      --ok-soft: rgba(16,160,90,.12);
  --warn: #c1740a;    --warn-soft: rgba(224,148,20,.14);
  --danger: #e0364e;  --danger-soft: rgba(224,54,78,.12);
  --radius: 20px;
  --radius-sm: 13px;
  --shadow-s: 0 1px 2px rgba(19,26,43,.05), 0 2px 8px rgba(19,26,43,.05);
  --shadow-m: 0 6px 20px rgba(19,26,43,.08), 0 2px 6px rgba(19,26,43,.05);
  --shadow-l: 0 18px 50px rgba(19,26,43,.14);
  --glow: rgba(59,99,246,.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { color-scheme: dark; } }
:root:not([data-theme]) { }

/* dark palette (auto via media query OR forced via data-theme=dark) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b14; --bg2: #0b1020; --surface: #121829; --surface-2: #0e1422;
    --ink: #eaeefb; --muted: #97a3c2; --line: #232c42; --line-2: #1a2236;
    --brand: #6e93ff; --brand-2: #8a7bff; --brand-ink: #9db6ff; --brand-soft: rgba(110,147,255,.14);
    --ok:#34cc81; --ok-soft:rgba(52,204,129,.15); --warn:#f5b13c; --warn-soft:rgba(245,177,60,.16);
    --danger:#ff5c76; --danger-soft:rgba(255,92,118,.15);
    --shadow-s: 0 1px 2px rgba(0,0,0,.4); --shadow-m: 0 8px 26px rgba(0,0,0,.45);
    --shadow-l: 0 24px 60px rgba(0,0,0,.6); --glow: rgba(110,147,255,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080b14; --bg2: #0b1020; --surface: #121829; --surface-2: #0e1422;
  --ink: #eaeefb; --muted: #97a3c2; --line: #232c42; --line-2: #1a2236;
  --brand: #6e93ff; --brand-2: #8a7bff; --brand-ink: #9db6ff; --brand-soft: rgba(110,147,255,.14);
  --ok:#34cc81; --ok-soft:rgba(52,204,129,.15); --warn:#f5b13c; --warn-soft:rgba(245,177,60,.16);
  --danger:#ff5c76; --danger-soft:rgba(255,92,118,.15);
  --shadow-s: 0 1px 2px rgba(0,0,0,.4); --shadow-m: 0 8px 26px rgba(0,0,0,.45);
  --shadow-l: 0 24px 60px rgba(0,0,0,.6); --glow: rgba(110,147,255,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: calc(16.5px * var(--scale)); }
body {
  margin: 0; color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55; letter-spacing: -0.011em;
  background:
    radial-gradient(1100px 500px at 80% -8%, var(--brand-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 8%, rgba(106,92,255,.08), transparent 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand .mark { filter: drop-shadow(0 3px 6px var(--glow)); }
.wordmark { font-weight: 800; font-size: 1.32rem; letter-spacing: -0.02em; }
.demo-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--brand-ink); background: var(--brand-soft); padding: 3px 7px; border-radius: 999px; }

#roleswitch { display: flex; gap: 4px; margin-left: auto; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
#roleswitch button {
  border: none; background: transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; font-size: .92rem; cursor: pointer; font-weight: 650;
  transition: color .18s, background .18s, box-shadow .18s;
}
#roleswitch button:hover { color: var(--ink); }
#roleswitch button.active {
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px var(--glow);
}

.controls { display: flex; align-items: center; gap: 8px; }
.icon-btn, .textsize button {
  height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); cursor: pointer; font-weight: 700; font-size: .92rem;
}
.icon-btn { width: 38px; }
.textsize { display: flex; gap: 5px; }
.textsize button { width: 40px; }
.icon-btn:hover, .textsize button:hover { border-color: var(--brand); }

/* ---------- layout ---------- */
main { max-width: 680px; margin: 0 auto; padding: 22px 18px 96px; }
.view { display: none; animation: viewIn .35s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 0 0 16px; box-shadow: var(--shadow-m);
}
.card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 1.18rem; font-weight: 750; letter-spacing: -0.02em; }
.chip-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: var(--brand-soft); font-size: 1.15rem; }
.chip-ico.warn { background: var(--warn-soft); } .chip-ico.ok { background: var(--ok-soft); }
h1 { font-size: 2.05rem; line-height: 1.1; margin: 0 0 10px; font-weight: 820; letter-spacing: -0.035em; }
.muted { color: var(--muted); } .small { font-size: .9rem; } .mb { margin-bottom: 14px; }
.hint { color: var(--muted); font-weight: 500; font-size: .84rem; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line); border-radius: 26px; padding: 40px 26px 30px; margin-bottom: 16px;
  background:
    radial-gradient(120% 90% at 50% -20%, var(--brand-soft), transparent 62%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-l);
}
.hero-glow { position: absolute; inset: -40% 20% auto 20%; height: 260px;
  background: radial-gradient(closest-side, var(--glow), transparent); filter: blur(30px); opacity: .7; }
.hero-emblem { position: relative; display: inline-grid; place-items: center; margin-bottom: 14px;
  width: 92px; height: 92px; border-radius: 26px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-m); }
.hero-emblem svg { filter: drop-shadow(0 6px 14px var(--glow)); }
.hero h1 { position: relative; }
.grad { background: linear-gradient(115deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { position: relative; max-width: 44ch; margin: 0 auto 22px; color: var(--muted); font-size: 1.06rem; }
.hero-actions { position: relative; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.trust-row { position: relative; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.trust { font-size: .84rem; font-weight: 600; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; }

/* ---------- buttons ---------- */
.btn { border: none; border-radius: 13px; font-weight: 700; cursor: pointer; font-size: 1rem;
  padding: 12px 20px; transition: transform .12s, box-shadow .18s, background .18s, filter .18s; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn.lg { padding: 15px 24px; font-size: 1.05rem; border-radius: 15px; }
.btn.block { width: 100%; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px var(--glow); }
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 12px 28px var(--glow); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; box-shadow: var(--shadow-s); }
.step-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; margin-bottom: 9px;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; }
.step b { display: block; font-size: .98rem; margin-bottom: 2px; }
.step span { color: var(--muted); font-size: .86rem; }

/* ---------- form ---------- */
.field { margin-bottom: 15px; }
.row2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
label { display: block; font-weight: 650; margin-bottom: 7px; font-size: .96rem; }
input[type=text], input[type=number], input:not([type]), select {
  width: 100%; padding: 14px 15px; font-size: 1.02rem; font-family: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 18px center, right 13px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.amt { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface-2); padding-left: 15px; }
.amt:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.amt span { font-size: 1.1rem; color: var(--muted); font-weight: 700; }
.amt input { border: none; background: transparent; box-shadow: none; }
.amt input:focus { box-shadow: none; }
label.check { display: flex; align-items: center; gap: 11px; font-weight: 550; cursor: pointer; margin-bottom: 16px; }
label.check input { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
label.check > span { flex: 1; min-width: 0; }

/* ---------- presets ---------- */
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset { text-align: left; padding: 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink);
  display: flex; flex-direction: column; gap: 3px; transition: transform .12s, border-color .15s, box-shadow .15s; }
.preset b { font-size: .96rem; } .preset span { color: var(--muted); font-size: .82rem; }
.preset:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.preset.scam:hover { border-color: var(--danger); }
.preset.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.preset.ok:hover { border-color: var(--ok); }

/* ---------- result cards ---------- */
.result { display: flex; gap: 16px; align-items: flex-start; }
.result .rico { font-size: 2.2rem; line-height: 1; flex: none; }
.result h2 { margin: 0 0 4px; font-size: 1.2rem; }
.result.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: linear-gradient(180deg, var(--ok-soft), var(--surface)); }
.result.hold { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: linear-gradient(180deg, var(--warn-soft), var(--surface)); }
.reasons { margin: 10px 0; padding-left: 20px; }
.reasons li { margin: 5px 0; font-weight: 650; }
.scamnote { background: var(--warn-soft); border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-weight: 550; font-size: .95rem; }
.pop { animation: pop .34s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- setup: modes + rules + chips ---------- */
.modes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; }
.mode { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.mode:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.mode input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.mode b { display: block; font-size: 1.02rem; margin-bottom: 2px; }
.mode span { color: var(--muted); font-size: .9rem; }
.rulegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.rulegrid label.check { margin-bottom: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.addrow { display: flex; gap: 9px; } .addrow input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--line);
  padding: 7px 9px 7px 13px; border-radius: 999px; font-weight: 600; font-size: .92rem; }
.chip button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0; line-height: 1; }
.chip button:hover { color: var(--danger); }

/* ---------- approver identity + stats ---------- */
.identity { text-align: center; }
.who { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 12px; }
.avatar { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; font-size: 1.7rem;
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1.5px solid var(--line); box-shadow: var(--shadow-s); }
.avatar.appr { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); box-shadow: 0 0 0 4px var(--brand-soft); }
.link-line { display: flex; align-items: center; gap: 4px; }
.link-line .dot { width: 26px; height: 2px; background: linear-gradient(90deg, var(--line), var(--brand)); }
.shield-mini { font-size: 1.25rem; }
.identity-line { margin: 0; color: var(--muted); }
.identity-line b { color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; box-shadow: var(--shadow-s); }
.stat-ico { font-size: 1.05rem; } .stat-n { font-size: 1.5rem; font-weight: 820; letter-spacing: -0.03em; line-height: 1.1; }
.stat-l { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat.ok .stat-n { color: var(--ok); } .stat.brand .stat-n { color: var(--brand); }
.stat.danger .stat-n { color: var(--danger); } .stat.warn .stat-n { color: var(--warn); }

/* ---------- pending requests ---------- */
.count { margin-left: auto; min-width: 28px; height: 28px; padding: 0 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 999px; font-weight: 800; font-size: .9rem; }
.req { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 17px; margin-bottom: 12px;
  background: var(--surface-2); transition: box-shadow .25s, border-color .25s, transform .25s; }
.req:last-child { margin-bottom: 0; }
.req.spotlight { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-m); transform: translateY(-2px); }
.req-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.amt-big { font-size: 1.5rem; font-weight: 820; letter-spacing: -0.03em; }
.to { color: var(--muted); font-weight: 600; } .ago { margin-left: auto; color: var(--muted); font-size: .82rem; }
.req-cat { color: var(--muted); margin: 3px 0 8px; font-size: .92rem; }
.flag { color: var(--warn); font-weight: 700; }
.cooling { background: var(--warn-soft); border-radius: 11px; padding: 10px 13px; margin: 9px 0; font-weight: 650; color: var(--warn); }
.cooling.ready { background: var(--ok-soft); color: var(--ok); }
.req-actions { display: flex; gap: 10px; margin-top: 13px; }
.req-actions .btn { flex: 1; color: #fff; }
.req-actions .approve { background: linear-gradient(135deg, var(--ok), #16b46a); box-shadow: 0 6px 16px var(--ok-soft); }
.req-actions .deny { background: linear-gradient(135deg, var(--danger), #ff6a80); box-shadow: 0 6px 16px var(--danger-soft); }

/* ---------- activity timeline ---------- */
.timeline .act { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.timeline .act:last-child { border-bottom: none; }
.act-ico { font-size: 1.1rem; width: 22px; text-align: center; }
.act-main { flex: 1; display: flex; flex-direction: column; }
.act-top { font-size: .98rem; } .act-why { color: var(--muted); font-size: .84rem; }
.act.blocked .act-why { color: var(--danger); }
.act-time { color: var(--muted); font-size: .8rem; white-space: nowrap; padding-top: 1px; }
.empty { padding: 8px 0; }

/* ---------- two-phone demo stage ---------- */
#demostage { position: fixed; inset: 0; z-index: 80; display: none; padding: 20px;
  align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(59,99,246,.16), transparent 60%), color-mix(in srgb, var(--bg) 82%, #000 60%);
  backdrop-filter: blur(10px); }
#demostage.show { display: flex; animation: viewIn .3s ease; }
.stage-panel { width: min(720px, 100%); max-height: 96vh; overflow: auto;
  background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid var(--line);
  border-radius: 26px; box-shadow: var(--shadow-l); padding: 20px 20px 18px; }
.stage-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stage-kicker { font-weight: 750; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; }
.mini-shield { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); }
.stage-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); cursor: pointer; font-size: 1rem; }
.stage-close:hover { color: var(--danger); border-color: var(--danger); }

.phones { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 18px); margin: 6px 0 14px; }
.phone { flex: 0 1 auto; min-width: 0; width: clamp(150px, 42vw, 250px); transition: transform .35s, opacity .35s, filter .35s; }
.phone.dim { opacity: .45; filter: saturate(.6); transform: scale(.95); }
.phone.active { transform: scale(1.03); }
.phone-notch { display: block; width: 34%; height: 6px; border-radius: 999px; background: #05070d; margin: 0 auto -6px; position: relative; z-index: 2; }
.phone-screen { position: relative; border: 7px solid #05070d; border-radius: 32px; background: var(--surface);
  aspect-ratio: 9 / 18.5; overflow: hidden; box-shadow: var(--shadow-m), inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; transition: box-shadow .35s; }
.phone.active .phone-screen { box-shadow: 0 0 0 3px var(--brand), 0 18px 40px var(--glow); }
.phone-top { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-weight: 750; font-size: .82rem;
  border-bottom: 1px solid var(--line-2); color: var(--ink); }
.pt-mark { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--brand-soft); font-size: .7rem; }
.phone-body { flex: 1; padding: 13px; display: flex; flex-direction: column; }
.phone-label { text-align: center; margin-top: 9px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.phone.active .phone-label { color: var(--ink); }

.phone-flow { flex: none; align-self: center; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s); font-size: 1.1rem; }
.phone-flow.pulse { animation: flowpulse 1s ease; }
@keyframes flowpulse { 0%,100% { box-shadow: var(--shadow-s); } 50% { box-shadow: 0 0 0 8px var(--brand-soft); transform: scale(1.12); } }
@media (max-width: 420px) { .phone-flow { display: none; } }

/* phone screen content */
.screencard { display: flex; flex-direction: column; flex: 1; animation: pop .3s cubic-bezier(.2,.9,.3,1.3); }
.sc-head { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.sc-sub { color: var(--muted); font-size: .82rem; margin: 6px 0 0; line-height: 1.4; }
.sc-hint { margin-top: auto; font-size: .74rem; font-weight: 650; color: var(--brand-ink); background: var(--brand-soft); padding: 7px 9px; border-radius: 9px; }
.sc-label, .sc-inc { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sc-inc { color: var(--warn); }
.sc-payee { font-weight: 700; font-size: .92rem; margin-top: 2px; }
.sc-amt { font-size: 1.7rem; font-weight: 850; letter-spacing: -0.04em; margin: 4px 0; }
.sc-cat { color: var(--muted); font-size: .8rem; }
.sc-sending { margin-top: auto; color: var(--muted); font-size: .8rem; font-weight: 600; }
.sc-sending::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }
.sc-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 8px; }
.sc-badge.ok { background: var(--ok-soft); } .sc-badge.hold { background: var(--warn-soft); } .sc-badge.block { background: var(--danger-soft); }
.sc-title { font-weight: 820; font-size: 1.15rem; letter-spacing: -0.02em; }
.sc-empty { margin: auto; color: var(--ok); font-weight: 700; }
.sc-reasons { margin: 8px 0 0; padding-left: 16px; }
.sc-reasons li { font-size: .8rem; font-weight: 650; margin: 3px 0; }
.sc-btns { margin-top: auto; display: flex; gap: 6px; padding-top: 10px; }
.sc-approve, .sc-block { flex: 1; text-align: center; padding: 8px; border-radius: 9px; font-weight: 750; font-size: .82rem; color: #fff; }
.sc-approve { background: linear-gradient(135deg, var(--ok), #16b46a); } .sc-block { background: linear-gradient(135deg, var(--danger), #ff6a80); }
.sc-approve.tap { animation: tapflash .5s ease; } .sc-block.tap { animation: tapflash .5s ease; }
@keyframes tapflash { 0%,100% { filter: none; } 50% { filter: brightness(1.35); transform: scale(.96); } }

.stage-narration { display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin-top: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.demobar-pulse { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--brand);
  box-shadow: 0 0 0 0 var(--glow); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--glow); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
#demoText { margin: 0; flex: 1; font-weight: 600; font-size: .96rem; }
.stage-progress { height: 4px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 10px 0 12px; }
.stage-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.stage-controls { display: flex; gap: 10px; justify-content: flex-end; }
#demoReplay { display: none; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: 999px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 70; box-shadow: var(--shadow-l); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  #topbar { gap: 8px 10px; padding: 10px 13px; }
  #roleswitch { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  #roleswitch button { flex: 1; text-align: center; padding: 9px 6px; font-size: .88rem; }
  .controls { margin-left: auto; }
  main { padding: 18px 13px 96px; }
  .card, .hero { padding: 18px; }
  .hero { padding: 32px 18px 24px; }
  h1 { font-size: 1.7rem; }
  .steps { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .rulegrid { grid-template-columns: 1fr; }
  .stage-panel { padding: 16px 13px 14px; }
  .phones { gap: 10px; min-height: 360px; }
  .phone { width: 43vw; }
  .phone.active, .phone.dim { transform: none; }
  /* one phone at a time during the action — narration names whose phone it is */
  .phone.dim { display: none; }
  .phone.active { width: min(250px, 74vw); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
