/* RecoverFlow — design tokens */
[data-theme='dark'] {
  --bg: #07100c; --bg-2: #0a1510; --panel: #0e1a14; --panel-2: #12221b; --raise: #17291f;
  --line: rgba(190, 255, 220, .09); --line-2: rgba(190, 255, 220, .16);
  --text: #eaf3ee; --muted: #8ea599; --faint: #5d7468;
  --lime: #c9f24d; --lime-ink: #10201a; --lime-text: #c9f24d;
  --green: #3ddc97; --amber: #f6b94c; --red: #ff7a7a; --blue: #7cc4ff;
  --glow: rgba(201, 242, 77, .14); --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #faf9f6; --bg-2: #f4f2ec; --panel: #ffffff; --panel-2: #f8f7f3; --raise: #f1efe8;
  --line: rgba(24, 32, 28, .08); --line-2: rgba(24, 32, 28, .15);
  --text: #121a16; --muted: #5f6b64; --faint: #93a09a;
  --lime: #c6f135; --lime-ink: #0f1a14; --lime-text: #2f6b12;
  --green: #0c8f5f; --amber: #b36b00; --red: #c53a3a; --blue: #2f5fe0;
  --glow: rgba(198, 241, 53, .35); --shadow: 0 30px 60px -30px rgba(30, 50, 40, .28), 0 2px 6px rgba(30, 50, 40, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 40% at 80% -5%, var(--glow), transparent 70%), radial-gradient(40% 30% at 0% 100%, rgba(61, 220, 151, .07), transparent 70%); }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
code, kbd, .mono { font-family: 'DM Mono', ui-monospace, monospace; }
em { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: fixed; left: 12px; top: -48px; z-index: 100; background: var(--lime); color: var(--lime-ink); padding: 8px 12px; border-radius: 8px; font-weight: 700; transition: top .15s; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--lime-text); outline-offset: 2px; border-radius: 6px; }
svg { width: 18px; height: 18px; flex: none; }

/* shell */
.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 26px 18px 18px; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(14px); border-right: 1px solid var(--line); z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); box-shadow: 0 6px 20px -6px var(--lime); }
.brand-word em { color: var(--lime-text); font-size: 1.12em; letter-spacing: 0; }
.side-label { font: 500 10px 'DM Mono'; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 38px 10px 10px; }
.nav { display: grid; gap: 3px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; transition: background .2s, color .2s; }
.nav a svg { width: 17px; height: 17px; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--lime); }
.badge { margin-left: auto; min-width: 20px; text-align: center; background: var(--lime); color: var(--lime-ink); border-radius: 99px; font: 500 10px 'DM Mono'; padding: 2px 6px; }
.side-bottom { margin-top: auto; display: grid; gap: 12px; }
.safe-box { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--line-2); border-radius: 12px; background: linear-gradient(160deg, var(--panel-2), var(--panel)); }
.safe-box strong { display: block; font-size: 12.5px; }
.safe-box small { color: var(--muted); font-size: 11px; }
.pulse, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: 5px; box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: ping 2s infinite; flex: none; }
.live-dot { margin: 0 0 0 auto; }
.side-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font: 500 10px 'DM Mono'; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--muted); transition: .2s; }
.icon-btn:hover { color: var(--text); background: var(--panel-2); transform: translateY(-1px); }
[data-theme='dark'] .sun, [data-theme='light'] .moon { display: none; }
.menu-btn, .scrim { display: none; }

.content { margin-left: 248px; width: calc(100% - 248px); max-width: 1320px; padding: 44px clamp(20px, 4vw, 56px) 0; }

/* hero */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: end; margin-bottom: 36px; }
.eyebrow { display: flex; align-items: center; gap: 9px; font: 500 10.5px 'DM Mono'; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.hero h1 { font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.hero h1 em { font-size: 1.08em; letter-spacing: -.02em; background: linear-gradient(95deg, var(--lime), var(--green) 60%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.subhead { margin-top: 20px; max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hint { color: var(--faint); font-size: 12px; margin-left: 6px; }
kbd { font: 500 10.5px 'DM Mono'; padding: 2px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); background: var(--panel); }
.status-card { border: 1px solid var(--line-2); border-radius: 18px; padding: 8px; background: linear-gradient(170deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow); }
.status-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.status-foot { padding: 12px 14px 8px; font: 500 10px 'DM Mono'; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px; transition: transform .18s, box-shadow .25s, background .2s, opacity .2s; }
.btn svg { width: 16px; height: 16px; transition: transform .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--lime); color: var(--lime-ink); box-shadow: 0 10px 30px -10px var(--lime), inset 0 1px 0 rgba(255, 255, 255, .5); position: relative; overflow: hidden; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -10px var(--lime), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-130%) skewX(-20deg); animation: shine 4s ease-in-out infinite; pointer-events: none; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-block { width: 100%; }

.chip { font: 500 10px 'DM Mono'; letter-spacing: .08em; padding: 5px 9px; border-radius: 99px; text-transform: uppercase; }
.chip-idle { background: var(--raise); color: var(--muted); }
.chip-ok { background: rgba(61, 220, 151, .14); color: var(--green); }
.chip-warn { background: rgba(246, 185, 76, .15); color: var(--amber); }
.chip-bad { background: rgba(255, 122, 122, .14); color: var(--red); }
.tag { font: 500 10px 'DM Mono'; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 8px; background: var(--raise); color: var(--muted); }
.tag-live { background: var(--glow); color: var(--lime-text); }
.tag.on { background: rgba(61, 220, 151, .14); color: var(--green); }

/* cards */
.card { position: relative; background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 80%, var(--bg))); border: 1px solid var(--line); border-radius: 20px; padding: 24px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card h2 { font-size: 20px; letter-spacing: -.03em; font-weight: 800; }
.card-foot { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.card-foot strong { color: var(--green); }
.muted-text { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.muted { color: var(--faint); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.empty { color: var(--faint); font-size: 13px; padding: 18px 0; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); transition: transform .25s, border-color .25s; }
.kpi:hover { transform: translateY(-3px); border-color: var(--line-2); }
.kpi p { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.kpi strong { display: block; font-size: 32px; letter-spacing: -.05em; font-weight: 800; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--faint); font-size: 12px; }
.pos { color: var(--green); }
.kpi-hot { border-color: color-mix(in srgb, var(--lime) 35%, var(--line)); background: linear-gradient(160deg, var(--glow), var(--panel) 60%); }
.kpi-bar { height: 4px; border-radius: 4px; background: var(--raise); margin-top: 16px; overflow: hidden; }
.kpi-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--green), var(--lime)); transition: width 1s cubic-bezier(.2, .7, .2, 1); }
.kpi-dots { display: flex; gap: 6px; margin-top: 18px; height: 8px; }
.kpi-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: pop .4s both; }

/* flow */
.flow { display: flex; align-items: stretch; margin: 6px 0 22px; }
.node { flex: 1; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); position: relative; transition: border-color .4s, background .4s, transform .4s; }
.node-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); font: 500 10px 'DM Mono'; color: var(--muted); margin-bottom: 12px; }
.node strong { display: block; font-size: 14px; }
.node small { display: block; color: var(--faint); font-size: 11.5px; margin: 3px 0 14px; line-height: 1.4; }
.node b { font: 500 26px 'DM Mono'; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.node.lit { border-color: color-mix(in srgb, var(--lime) 55%, var(--line)); background: linear-gradient(160deg, var(--glow), var(--panel-2)); transform: translateY(-3px); }
.node.lit .node-n { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.node-final.lit b { color: var(--green); }
.link { flex: 0 0 26px; align-self: center; height: 2px; background: var(--line-2); position: relative; overflow: hidden; border-radius: 2px; }
.link i { position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--lime), transparent); transform: translateX(-120%); }
.link.run i { animation: flow .7s ease-in-out; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--raise); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.note svg { color: var(--lime-text); margin-top: 2px; }
.note strong { color: var(--text); }

/* drivers */
.driver-bars { display: grid; gap: 12px; margin-top: 18px; }
.driver { display: grid; gap: 6px; animation: rise .5s both; }
.driver-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.driver-top span { color: var(--muted); }
.driver-top b { font: 500 12px 'DM Mono'; }
.driver-track { height: 8px; border-radius: 8px; background: var(--raise); overflow: hidden; }
.driver-track i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--green), var(--lime)); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.driver.top .driver-track i { background: linear-gradient(90deg, var(--lime), #f0ff9a); box-shadow: 0 0 14px var(--lime); }

/* table */
.seg { display: flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg-2); }
.seg-btn { padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); transition: .2s; }
.seg-btn.is-on { background: var(--lime); color: var(--lime-ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th { text-align: left; font: 500 10px 'DM Mono'; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 0 12px 12px; }
td { padding: 15px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
tbody tr { transition: background .2s; animation: rise .45s both; }
tbody tr:hover { background: var(--panel-2); }
.customer { display: block; font-weight: 700; }
.payment { display: block; font: 11px 'DM Mono'; color: var(--faint); margin-top: 2px; }
.amount { font: 500 14px 'DM Mono'; }
.cause { max-width: 190px; color: var(--muted); line-height: 1.45; }
.meter { display: flex; align-items: center; gap: 8px; width: 120px; font: 500 11px 'DM Mono'; color: var(--muted); }
.meter i { flex: 1; height: 5px; border-radius: 5px; background: var(--raise); overflow: hidden; position: relative; }
.meter i::after { content: ''; position: absolute; inset: 0; width: var(--w); border-radius: 5px; background: var(--c, var(--green)); animation: grow .9s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
.action { color: var(--lime-text); font-weight: 700; max-width: 220px; display: block; line-height: 1.4; }
.pill { display: inline-flex; font: 500 9.5px 'DM Mono'; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.pill.approve { background: rgba(246, 185, 76, .14); color: var(--amber); }
.pill.hold { background: rgba(255, 122, 122, .13); color: var(--red); }
.pill.done { background: rgba(61, 220, 151, .14); color: var(--green); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mini { padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 700; transition: .2s; }
.mini:hover { background: var(--raise); }
.mini.go { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }

/* live */
.live-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; }
.endpoint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0; padding: 8px 8px 8px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); }
.endpoint code { font-size: 12px; color: var(--lime-text); overflow-wrap: anywhere; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.9; }
code { font-size: .92em; }
.feed { display: grid; gap: 8px; align-content: start; max-height: 320px; overflow: auto; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); animation: rise .4s both; }
.feed-item b { font-size: 13px; }
.feed-item p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.feed-item time { font: 10px 'DM Mono'; color: var(--faint); }

/* lab */
.lab { display: grid; grid-template-columns: 1fr 1.25fr; gap: 36px; padding: 32px; margin-bottom: 16px; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--lime) 22%, var(--line)); background: radial-gradient(70% 90% at 0% 0%, var(--glow), transparent 70%), linear-gradient(180deg, var(--panel), var(--bg-2)); }
.lab h2 { font-size: 30px; letter-spacing: -.04em; font-weight: 800; margin-bottom: 12px; }
.lab-copy > p:not(.eyebrow) { color: var(--muted); max-width: 420px; line-height: 1.65; }
.ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.ticks li::before { content: '✓'; color: var(--lime-text); font-weight: 800; margin-right: 10px; }
.console { border: 1px solid var(--line-2); border-radius: 16px; background: #050b08; padding: 16px; box-shadow: var(--shadow); }
[data-theme='light'] .console { background: #0d1b14; }
.console { color: #dff0e6; }
.console-top { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.console-top i { width: 9px; height: 9px; border-radius: 50%; background: #2c4a3c; }
.console-top i:nth-child(1) { background: #ff6b6b; } .console-top i:nth-child(2) { background: #f6b94c; } .console-top i:nth-child(3) { background: #3ddc97; }
.console-top span { margin-left: 10px; font: 11px 'DM Mono'; color: #7ea08f; }
.console-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.console-row label { font: 11px 'DM Mono'; color: #7ea08f; }
select, textarea { font: inherit; color: inherit; }
select { background: #0f1f17; color: #e8f3ec; border: 1px solid #28463a; border-radius: 9px; padding: 9px 12px; font-size: 12.5px; flex: 1; min-width: 0; }
.card select { background: var(--bg-2); color: var(--text); border-color: var(--line-2); }
textarea { width: 100%; background: #0a1510; color: #bfe8cf; border: 1px solid #28463a; border-radius: 10px; padding: 12px; font: 12px/1.6 'DM Mono', monospace; resize: vertical; margin-bottom: 12px; }
textarea:focus, select:focus { outline: 2px solid var(--lime); outline-offset: 0; }
.decision { margin-top: 14px; padding-top: 14px; border-top: 1px solid #1d352a; font-size: 12.5px; line-height: 1.65; color: #c5dccf; min-height: 64px; }
.decision .verdict { display: inline-flex; align-items: center; gap: 8px; font: 500 11px 'DM Mono'; letter-spacing: .06em; padding: 5px 10px; border-radius: 8px; margin-bottom: 8px; }
.verdict.ok { background: rgba(201, 242, 77, .14); color: #c9f24d; } .verdict.hold { background: rgba(246, 185, 76, .15); color: #f6b94c; }
.decision pre { margin: 10px 0 0; padding: 12px; background: #0a1510; border: 1px solid #1d352a; border-radius: 10px; font: 11.5px/1.6 'DM Mono', monospace; overflow: auto; max-height: 200px; }
.j-k { color: #7cc4ff; } .j-s { color: #c9f24d; } .j-n { color: #f6b94c; }

/* simulator */
.sim-controls { display: grid; gap: 6px; min-width: 280px; }
.sim-controls label { font: 500 10px 'DM Mono'; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.vs-col { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.vs-col h3 { font-size: 15px; } .vs-col small { color: var(--faint); font-size: 12px; }
.vs-col dl { margin: 18px 0; display: grid; gap: 12px; }
.vs-col dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.vs-col dt { color: var(--muted); font-size: 12.5px; } .vs-col dd { margin: 0; font: 500 16px 'DM Mono'; letter-spacing: -.03em; }
.vs-win { border-color: color-mix(in srgb, var(--lime) 40%, var(--line)); background: linear-gradient(160deg, var(--glow), var(--panel-2) 65%); }
.vs-win dd { color: var(--green); }
.vs-bar { height: 8px; border-radius: 8px; background: var(--raise); overflow: hidden; }
.vs-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--faint); transition: width 1s cubic-bezier(.2, .7, .2, 1); }
.vs-win .vs-bar i { background: linear-gradient(90deg, var(--green), var(--lime)); }
.sim-note { margin-top: 16px; padding: 13px 15px; border-radius: 12px; background: var(--raise); color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.sim-note strong { color: var(--text); }

/* audit */
.audit-log { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.audit-item { display: flex; justify-content: space-between; gap: 18px; padding: 13px 16px; border: 1px solid var(--line); border-left: 3px solid var(--lime); border-radius: 12px; background: var(--panel-2); animation: rise .4s both; }
.audit-item strong { font-size: 13px; }
.audit-item p { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.5; }
.audit-item time { font: 10.5px 'DM Mono'; color: var(--faint); white-space: nowrap; }

/* policy */
.policy { margin: 40px 0; }
.policy-head { margin-bottom: 22px; }
.policy-head h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.045em; font-weight: 800; }
.policy-head em { font-size: 1.1em; color: var(--lime-text); }
.policy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.policy-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); transition: transform .25s, border-color .25s; }
.policy-grid article:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--lime) 40%, var(--line)); }
.policy-grid svg { width: 26px; height: 26px; color: var(--lime-text); margin-bottom: 36px; }
.policy-grid h3 { font-size: 15px; margin-bottom: 8px; }
.policy-grid p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.policy-grid code { font-size: 11px; padding: 4px 8px; border-radius: 6px; background: var(--raise); color: var(--lime-text); }

/* footer */
.footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 44px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; }
.foot-text { color: var(--muted); font-size: 13px; max-width: 280px; margin-top: 14px; line-height: 1.6; }
.foot-grid h4 { font: 500 10px 'DM Mono'; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.foot-grid a:not(.brand) { display: block; color: var(--muted); text-decoration: none; font-size: 13px; padding: 5px 0; transition: color .2s, transform .2s; }
.foot-grid a:not(.brand):hover { color: var(--text); transform: translateX(3px); }
.foot-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }

/* dialogs + toasts */
dialog { width: min(520px, 92vw); border: 1px solid var(--line-2); border-radius: 20px; padding: 28px; background: var(--panel); color: var(--text); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7); }
dialog[open] { animation: dialogIn .28s cubic-bezier(.2, .7, .2, 1); }
dialog::backdrop { background: rgba(2, 8, 5, .66); backdrop-filter: blur(6px); }
dialog h2 { font-size: 22px; letter-spacing: -.03em; margin-top: 4px; }
.close { float: right; width: 30px; height: 30px; font-size: 22px; border-radius: 8px; color: var(--muted); }
.close:hover { background: var(--raise); }
.dialog-case { margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--raise); font-size: 13px; line-height: 1.7; color: var(--muted); }
.dialog-case strong { color: var(--text); }
.dialog-actions, .case-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
#caseDialog { width: min(640px, 94vw); }
.case-summary { display: flex; justify-content: space-between; align-items: center; margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--raise); }
.case-summary strong { font-size: 15px; } .case-summary small { display: block; font: 11px 'DM Mono'; color: var(--faint); margin-top: 3px; }
.case-amount { font: 500 20px 'DM Mono'; color: var(--green); }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.case-field { padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.case-field > span { display: block; font: 500 10px 'DM Mono'; letter-spacing: .1em; color: var(--faint); margin-bottom: 6px; text-transform: uppercase; }
.case-field b { font-size: 13px; line-height: 1.5; }
.evidence-list { list-style: none; margin: 8px 0 0; padding: 0; }
.evidence-list li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.evidence-list li::before { content: '↳'; color: var(--lime-text); margin-right: 8px; }
.message-tools { display: flex; gap: 8px; margin-top: 10px; }
.message-output { display: none; margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--lime); background: var(--raise); border-radius: 0 10px 10px 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.message-output.visible { display: block; }
.message-output small { display: block; margin-top: 8px; color: var(--faint); font-size: 11px; }
.timeline { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.timeline h3 { font-size: 13px; margin-bottom: 12px; }
.timeline-item { position: relative; padding: 0 0 14px 20px; border-left: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.timeline-item::before { content: ''; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.timeline-item span { display: block; font: 10px 'DM Mono'; color: var(--faint); margin-bottom: 2px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; animation: toastIn .35s cubic-bezier(.2, .7, .2, 1) both; }
.toast.out { animation: toastOut .25s both; }
.toast svg { color: var(--green); width: 16px; height: 16px; }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); } }
@keyframes flow { to { transform: translateX(260%); } }
@keyframes shine { 0% { transform: translateX(-130%) skewX(-20deg); } 55%, 100% { transform: translateX(330%) skewX(-20deg); } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.hero > * { animation: rise .7s both; } .hero > *:nth-child(2) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* responsive */
@media (max-width: 1100px) {
  .hero, .grid-2, .live-grid, .lab { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .policy-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-102%); transition: transform .3s cubic-bezier(.2, .7, .2, 1); width: min(300px, 86vw); background: var(--bg-2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; place-items: center; position: fixed; top: 14px; left: 14px; z-index: 25; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(2, 8, 5, .6); backdrop-filter: blur(3px); }
  .scrim[hidden] { display: none; }
  .content { margin: 0; width: 100%; padding: 74px 16px 0; }
  .versus, .case-grid { grid-template-columns: 1fr; }
  .flow { flex-direction: column; } .link { flex: 0 0 22px; width: 2px; height: 22px; align-self: center; } .link i { width: 100%; height: 40%; transform: translateY(-120%); }
  @keyframes flow { to { transform: translateY(260%); } }
  .lab { padding: 20px; } .card { padding: 18px; }
  .sim-head { flex-direction: column; } .sim-controls { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
  .kpis, .policy-grid, .foot-grid { grid-template-columns: 1fr; }
  .kpi strong { font-size: 28px; }
}


/* ---- Light theme: editorial, airy, premium ---- */
[data-theme='light'] body::before {
  background:
    radial-gradient(48% 38% at 88% -8%, rgba(198,241,53,.38), transparent 70%),
    radial-gradient(42% 36% at 6% 8%, rgba(120,170,255,.20), transparent 70%),
    radial-gradient(50% 40% at 50% 112%, rgba(61,220,151,.16), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(-1.5%, 1.5%, 0) scale(1.04); } }
[data-theme='light'] .sidebar { background: rgba(255,255,255,.72); backdrop-filter: blur(22px) saturate(1.4); }
[data-theme='light'] .nav a.active { background: #fff; box-shadow: 0 1px 0 var(--line), 0 8px 20px -10px rgba(30,50,40,.25), inset 2px 0 0 var(--lime-text); }
[data-theme='light'] .brand-mark { box-shadow: 0 8px 22px -6px rgba(150,200,20,.7); }
[data-theme='light'] h1, [data-theme='light'] h2 { letter-spacing: -.035em; }
[data-theme='light'] .safe-box { background: #fff; box-shadow: var(--shadow); }
[data-theme='light'] .badge { background: var(--text); color: #fff; }
[data-theme='light'] .icon-btn { background: #fff; box-shadow: 0 1px 2px rgba(30,50,40,.06); }
[data-theme='light'] .card, [data-theme='light'] .status-card, [data-theme='light'] .metric {
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  [data-theme='light'] .card, [data-theme='light'] .metric { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
  [data-theme='light'] .card:hover, [data-theme='light'] .metric:hover { transform: translateY(-3px); box-shadow: 0 40px 70px -34px rgba(30,50,40,.35); }
}
