/* Recon Hub — design system
   Tokens first; light theme by default, dark via [data-theme=dark] or the OS setting (unless forced light). */

:root {
  --bg: #f4f5fa; --bg-glow-1: rgba(99, 102, 241, .10); --bg-glow-2: rgba(14, 165, 233, .08);
  --panel: #ffffff; --panel-2: #f8f9fc; --panel-3: #f1f3f9; --line: #e4e7f0; --line-strong: #d3d8e6;
  --text: #0f1222; --text-2: #343a52; --muted: #6b7189;
  --accent: #4f46e5; --accent-2: #7c3aed; --accent-3: #0ea5e9; --accent-weak: #eef0ff; --accent-ring: rgba(79, 70, 229, .22);
  --ok: #0f9960; --ok-weak: #e6f7ef; --warn: #b76e00; --warn-weak: #fff4e0;
  --bad: #dc3545; --bad-weak: #fdecee; --info: #7c3aed; --info-weak: #f3edff; --neutral-weak: #eef0f5;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 55%, #c026d3 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,70,229,.10), rgba(124,58,237,.08) 60%, rgba(14,165,233,.08));
  --side-bg: #0c0f1d; --side-bg-2: #141833; --side-text: #a8afcc; --side-text-hi: #ffffff; --side-line: rgba(255,255,255,.07);
  --radius: 14px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 45, .05);
  --shadow: 0 1px 2px rgba(16, 20, 45, .04), 0 4px 16px -6px rgba(16, 20, 45, .08);
  --shadow-lg: 0 2px 6px rgba(16, 20, 45, .05), 0 18px 40px -12px rgba(16, 20, 45, .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090b14; --bg-glow-1: rgba(99, 102, 241, .16); --bg-glow-2: rgba(14, 165, 233, .09);
    --panel: #11141f; --panel-2: #151927; --panel-3: #1b2032; --line: #232839; --line-strong: #2f3550;
    --text: #eceefa; --text-2: #c5c9de; --muted: #8b91ad;
    --accent: #818cf8; --accent-2: #a78bfa; --accent-weak: #1d2142; --accent-ring: rgba(129, 140, 248, .28);
    --ok: #34d399; --ok-weak: #0f2a22; --warn: #fbbf24; --warn-weak: #2c2310;
    --bad: #f87171; --bad-weak: #321619; --info: #c4b5fd; --info-weak: #241c3d; --neutral-weak: #1d2131;
    --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
    --side-bg: #07080f; --side-bg-2: #0e1122;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090b14; --bg-glow-1: rgba(99, 102, 241, .16); --bg-glow-2: rgba(14, 165, 233, .09);
  --panel: #11141f; --panel-2: #151927; --panel-3: #1b2032; --line: #232839; --line-strong: #2f3550;
  --text: #eceefa; --text-2: #c5c9de; --muted: #8b91ad;
  --accent: #818cf8; --accent-2: #a78bfa; --accent-weak: #1d2142; --accent-ring: rgba(129, 140, 248, .28);
  --ok: #34d399; --ok-weak: #0f2a22; --warn: #fbbf24; --warn-weak: #2c2310;
  --bad: #f87171; --bad-weak: #321619; --info: #c4b5fd; --info-weak: #241c3d; --neutral-weak: #1d2131;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --side-bg: #07080f; --side-bg-2: #0e1122;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
body { background:
  radial-gradient(1100px 520px at 85% -10%, var(--bg-glow-1), transparent 60%),
  radial-gradient(900px 480px at 30% -20%, var(--bg-glow-2), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-ring); }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.025em; font-weight: 750; }
h2 { font-size: 16px; margin: 0 0 14px; letter-spacing: -.01em; font-weight: 680; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
details summary { list-style: none; } details summary::-webkit-details-marker { display: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ------------------------------------------------------------------ shell & sidebar */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  background: radial-gradient(400px 300px at 0% 0%, rgba(99,102,241,.22), transparent 70%), linear-gradient(180deg, var(--side-bg-2), var(--side-bg));
  color: var(--side-text); padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-line); overflow-y: auto;
}
.brand { font-weight: 750; font-size: 16.5px; display: flex; gap: 11px; align-items: center; padding: 2px 10px 22px; color: var(--side-text-hi); letter-spacing: -.01em; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--side-text); letter-spacing: .02em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 16px; flex: none;
  box-shadow: 0 6px 18px -4px rgba(124, 58, 237, .6), inset 0 1px 0 rgba(255,255,255,.25); animation: logo-in .8s var(--spring) both; }
.logo svg { width: 18px; height: 18px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(168,175,204,.55); padding: 14px 12px 6px; }
nav { position: relative; }
nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-text); font-weight: 550; margin-bottom: 2px; font-size: 13.5px;
  transition: color .2s, background .2s, transform .2s var(--ease); }
nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; transition: opacity .2s, transform .3s var(--spring); }
nav a:hover { background: rgba(255,255,255,.05); color: var(--side-text-hi); }
nav a:hover svg { opacity: 1; transform: scale(1.08); }
nav a.active { color: #fff; background: linear-gradient(90deg, rgba(129,140,248,.22), rgba(129,140,248,.06)); box-shadow: inset 0 0 0 1px rgba(129,140,248,.18); }
nav a.active svg { opacity: 1; color: #a5b4fc; }
nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); animation: grow-y .35s var(--ease); }
nav a .kbd { margin-left: auto; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--side-text); padding: 14px 6px 4px; border-top: 1px solid var(--side-line); }
.side-foot .who { color: var(--side-text-hi); }
.side-foot .btn, .side-foot button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); color: var(--side-text-hi); }
.side-foot .btn:hover, .side-foot button:hover { background: rgba(255,255,255,.12); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.side-tools { display: flex; gap: 6px; margin: 0 0 12px; }
.side-tools button { flex: 1; justify-content: center; font-size: 12px; font-weight: 600; padding: 7px 8px; }
.side-tools button svg { width: 15px; height: 15px; }
.view { padding: 34px 40px 72px; max-width: 1320px; width: 100%; min-width: 0; }

/* page entrance: children rise in, staggered; class is removed after the first paint so in-page redraws stay still */
.view.page-enter > * { animation: rise .55s var(--ease) both; }
.view.page-enter > *:nth-child(2) { animation-delay: .05s; } .view.page-enter > *:nth-child(3) { animation-delay: .1s; }
.view.page-enter > *:nth-child(4) { animation-delay: .15s; } .view.page-enter > *:nth-child(5) { animation-delay: .2s; }
.view.page-enter > *:nth-child(n+6) { animation-delay: .25s; }
.view.page-enter .kpis > * { animation: rise .6s var(--ease) both; }
.view.page-enter .kpis > *:nth-child(2) { animation-delay: .06s; } .view.page-enter .kpis > *:nth-child(3) { animation-delay: .12s; }
.view.page-enter .kpis > *:nth-child(4) { animation-delay: .18s; } .view.page-enter .kpis > *:nth-child(5) { animation-delay: .24s; }
.view.page-enter .kpis > *:nth-child(6) { animation-delay: .3s; }
.view.page-enter tbody tr { animation: fade-in .5s var(--ease) both; }
.view.page-enter tbody tr:nth-child(-n+12) { animation-delay: calc(.15s + var(--r, 0) * 25ms); }

/* top progress bar while a page loads */
.top-progress { position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 50; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); box-shadow: 0 0 10px var(--accent-ring); opacity: 0; }
.top-progress.go { opacity: 1; animation: progress 1.6s var(--ease) forwards; }
.top-progress.done { opacity: 0; transform: scaleX(1); transition: opacity .35s .1s, transform .2s; }

/* ------------------------------------------------------------------ surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; position: relative; }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; } .grid + .card, .grid + .grid { margin-top: 18px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--kpi-c, var(--line-strong)); opacity: .9; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--kpi-glow, transparent), transparent 70%); pointer-events: none; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { overflow-wrap: anywhere; font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.ok { --kpi-c: var(--ok); --kpi-glow: color-mix(in srgb, var(--ok) 9%, transparent); } .kpi.ok .value { color: var(--ok); }
.kpi.bad { --kpi-c: var(--bad); --kpi-glow: color-mix(in srgb, var(--bad) 8%, transparent); } .kpi.bad .value { color: var(--bad); }
.kpi.warn { --kpi-c: var(--warn); --kpi-glow: color-mix(in srgb, var(--warn) 9%, transparent); } .kpi.warn .value { color: var(--warn); }
.kpi:not(.ok):not(.bad):not(.warn) { --kpi-c: var(--grad); }

/* ------------------------------------------------------------------ layout helpers & forms */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
  transition: border-color .2s, box-shadow .2s, background .2s; box-shadow: var(--shadow-sm); }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7189' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; box-shadow: none; }
.field { margin-bottom: 14px; min-width: 0; }

button, .btn { position: relative; font: inherit; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: var(--radius-sm); padding: 8px 15px;
  cursor: pointer; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; box-shadow: var(--shadow-sm); overflow: hidden; isolation: isolate;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s, filter .2s; }
button:hover, .btn:hover { background: var(--panel-2); border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); transform: translateY(-1px); box-shadow: var(--shadow); }
button:active, .btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
button.primary, .btn.primary { background: var(--grad); background-size: 160% 160%; border-color: transparent; color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 16px -6px rgba(99, 70, 229, .6); }
button.primary:hover, .btn.primary:hover { background-position: 100% 50%; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 10px 24px -8px rgba(99, 70, 229, .7); filter: saturate(1.1); }
button.primary::after, .btn.primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); }
button.primary:hover::after, .btn.primary:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }
button.ok { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .6); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 5px 8px; box-shadow: none; }
button.ghost:hover { color: var(--bad); background: var(--bad-weak); transform: none; box-shadow: none; }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.3); }
button.small, .btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .22; pointer-events: none; animation: ripple .6s var(--ease); z-index: -1; }
.kbd { font: 600 10.5px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--side-line); color: var(--side-text); background: rgba(255,255,255,.04); }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { text-align: left; font-weight: 650; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 1; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; transition: background .15s; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-weak) 45%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.table-wrap td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.table-wrap td.reason { white-space: normal; min-width: 220px; color: var(--warn); }
tr.clickable { cursor: pointer; }
tr.clickable td:first-child { box-shadow: inset 0 0 0 transparent; transition: box-shadow .2s, background .15s; }
tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td.sep, th.sep { border-left: 2px solid var(--line-strong); }

/* ------------------------------------------------------------------ pills, bars, tabs, steps */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; padding: 3px 10px 3px 9px; border-radius: 999px; background: var(--neutral-weak); color: var(--muted); white-space: nowrap; letter-spacing: .01em; vertical-align: middle; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.matched, .pill.done { background: var(--ok-weak); color: var(--ok); }
.pill.mismatch, .pill.running { background: var(--warn-weak); color: var(--warn); }
.pill.running::before { animation: pulse-dot 1.2s ease-in-out infinite; }
.pill.unmatched_a, .pill.unmatched_b, .pill.failed { background: var(--bad-weak); color: var(--bad); }
.pill.queued { background: var(--info-weak); color: var(--info); } .pill.queued::before { animation: pulse-dot 1.6s ease-in-out infinite; }
.pill.claude { background: var(--grad-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.pill.claude::before { background: var(--grad); animation: pulse-dot 2.4s ease-in-out infinite; }

.bar { position: relative; height: 8px; background: var(--neutral-weak); border-radius: 99px; overflow: hidden; min-width: 90px; }
.bar > span { position: relative; display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10b981, #34d399); animation: bar-grow 1.1s var(--ease) both; overflow: hidden; }
.bar > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: shimmer 2.4s 1.1s ease-in-out; }
.bar.low > span { background: linear-gradient(90deg, #ef4444, #f87171); } .bar.mid > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { position: relative; padding: 9px 14px; border: 0; background: none; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; box-shadow: none; }
.tab:hover { background: var(--panel-2); color: var(--text); transform: none; box-shadow: none; }
.tab.active { color: var(--accent); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--grad); animation: grow-x .35s var(--ease); }
.tab .count { font-weight: 650; font-size: 11.5px; color: var(--muted); margin-left: 6px; background: var(--neutral-weak); border-radius: 99px; padding: 1px 7px; }
.tab.active .count { background: var(--accent-weak); color: var(--accent); }

.steps { display: flex; gap: 0; margin-bottom: 24px; flex-wrap: wrap; counter-reset: s; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.step { display: flex; align-items: center; gap: 9px; padding: 7px 16px 7px 7px; border-radius: 999px; background: transparent; border: 0; color: var(--muted); font-weight: 600; font-size: 13px; box-shadow: none; }
.step:hover { transform: none; box-shadow: none; background: var(--panel-2); }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-weak); font-size: 12px; transition: background .3s, transform .4s var(--spring); }
.step.active { color: #fff; background: var(--grad); box-shadow: 0 6px 16px -6px rgba(99,70,229,.6); } .step.active .n { background: rgba(255,255,255,.22); color: #fff; transform: scale(1.06); }
.step.active:hover { background: var(--grad); }
.step.done { color: var(--ok); } .step.done .n { background: var(--ok); color: #fff; animation: pop .45s var(--spring); }

/* ------------------------------------------------------------------ uploads */
.drop { position: relative; display: block; border-radius: var(--radius); padding: 26px 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--panel-2); margin: 0; font-weight: 500; font-size: 13.5px;
  border: 1.5px dashed var(--line-strong); transition: border-color .25s, background .25s, transform .25s var(--ease), box-shadow .25s; }
.drop:not(.has)::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; background: var(--accent-weak) no-repeat center/22px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0-4 4m4-4 4 4'/%3E%3Cpath d='M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E");
  transition: transform .35s var(--spring); }
.drop strong { color: var(--text); font-size: 14px; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); box-shadow: 0 0 0 4px var(--accent-ring); }
.drop:hover::before, .drop.over::before { transform: translateY(-3px) scale(1.06); }
.drop.over { transform: scale(1.015); animation: dash-pulse 1s ease-in-out infinite; }
.drop.has { border-style: solid; border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: linear-gradient(180deg, var(--ok-weak), var(--panel) 85%); color: var(--ok); text-align: left; animation: settle .5s var(--ease); }
.drop.has strong { color: var(--ok); }
.drop.has:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.drop input { display: none; }
.drop .bar { margin-top: 12px; height: 6px; } .drop .bar > span { animation: none; transition: width .25s var(--ease); background: var(--grad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 11.5px; padding: 3px 9px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); font-family: var(--mono); transition: all .2s var(--ease); }
.chip.click { cursor: pointer; } .chip.click:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); transform: translateY(-1px); }
.examples { display: flex; flex-direction: column; gap: 8px; }
.example { text-align: left; white-space: normal; font-weight: 500; color: var(--text-2); font-size: 13px; line-height: 1.5; padding: 10px 12px; background: var(--panel-2); }
.example:hover { color: var(--accent); }

/* ------------------------------------------------------------------ rule explanation & editor */
.explain { list-style: none; padding: 0; margin: 0; }
.explain li { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-weak); border-radius: 0 10px 10px 0; margin-bottom: 7px; animation: slide-in .45s var(--ease) both; }
.explain li:nth-child(2) { animation-delay: .05s; } .explain li:nth-child(3) { animation-delay: .1s; } .explain li:nth-child(n+4) { animation-delay: .15s; }
.explain li.filter { border-left-color: var(--warn); background: var(--warn-weak); }
.explain li.note { border-left-color: var(--muted); background: var(--neutral-weak); }
.explain li.route { border-left-color: var(--info); background: var(--info-weak); }
.notes { margin: 10px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; }
.errors { margin: 10px 0 0; padding: 11px 14px 11px 32px; color: var(--bad); background: var(--bad-weak); border-radius: var(--radius-sm); font-size: 13px; border: 1px solid color-mix(in srgb, var(--bad) 20%, transparent); animation: shake .4s var(--ease); }
.card.errors { padding-left: 22px; }

.pass { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: var(--panel-2); overflow: visible; animation: rise .4s var(--ease) both; }
.pass-head { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pass-head .idx { font-weight: 750; font-size: 12px; color: #fff; background: var(--grad); padding: 3px 10px; border-radius: 99px; }
.pass-head input { max-width: 300px; }
.pass-head select { width: auto; }
.cond { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1.2fr) minmax(0,1.3fr) 90px minmax(0,1.3fr) 32px; gap: 8px; padding: 8px 14px; align-items: center; }
.cond-labels { font-size: 11px; font-weight: 650; color: var(--muted); padding-bottom: 0; text-transform: uppercase; letter-spacing: .04em; }
.norms { display: flex; gap: 4px; flex-wrap: wrap; position: relative; }
.norms[open] > .card { animation: pop-in .2s var(--ease); box-shadow: var(--shadow-lg); }
.norm-pop { position: absolute; z-index: 5; margin-top: 4px; padding: 12px; width: 280px; display: grid; gap: 6px; }
.norm-pop .pop-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ext-fields { display: grid; gap: 6px; }
.chip.has-ext { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.cond > :nth-child(5) .norms:last-child .norm-pop { right: 0; }
.rel-row { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.rel-row:first-of-type { border-top: 0; }
.rel-bar { width: 6px; height: 100%; min-height: 40px; border-radius: 6px; background: var(--neutral-weak); display: flex; flex-direction: column-reverse; overflow: hidden; }
.rel-bar span { display: block; width: 100%; height: var(--h, 100%); background: var(--grad); border-radius: 6px; }
.rel-pct { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--accent); }
.filter-row { display: grid; grid-template-columns: 110px minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) 32px; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ------------------------------------------------------------------ misc */
.chart { width: 100%; height: 170px; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart rect { transform-box: fill-box; transform-origin: 50% 100%; animation: rise-bar .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 16px; }
.empty::before { content: ""; display: block; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--grad-soft) no-repeat center/26px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h18M3 12h18M3 17h10'/%3E%3C/svg%3E"); animation: float 4s ease-in-out infinite; }
.toast-stack { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 60; pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent); color: var(--text); font-weight: 550;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); backdrop-filter: blur(12px); max-width: 420px; pointer-events: auto; animation: toast-in .45s var(--spring) both; position: relative; overflow: hidden; }
.toast .ti { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--ok); font-size: 12px; margin-top: 1px; }
.toast.err .ti { background: var(--bad); }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--ok); transform-origin: 0; animation: drain var(--life, 3s) linear forwards; }
.toast.err::after { background: var(--bad); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: sp .7s linear infinite; vertical-align: -2px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: var(--muted); }
.verdict { position: relative; display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--radius); background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin-bottom: 18px; flex-wrap: wrap; box-shadow: var(--shadow); overflow: hidden; }
.verdict::before { content: ""; position: absolute; inset: -1px; background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%); transform: translateX(-100%); animation: sweep 3s 0.6s ease-in-out; pointer-events: none; }
.verdict p { margin: 0; flex: 1; min-width: 240px; }

/* skeletons */
.skel { display: grid; gap: 18px; }
.skel .sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--panel-3) 25%, var(--panel-2) 37%, var(--panel-3) 63%); background-size: 400% 100%; animation: skel 1.3s ease infinite; }
.skel .sk.h { height: 30px; width: 260px; border-radius: 8px; } .skel .sk.s { height: 14px; width: 420px; max-width: 80%; border-radius: 6px; margin-top: -8px; }
.skel .sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; } .skel .sk-row .sk { height: 100px; }
.skel .sk.big { height: 280px; }

/* ------------------------------------------------------------------ command palette */
.cmdk { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding-top: 14vh; background: rgba(8, 10, 22, .45); backdrop-filter: blur(6px); animation: fade-in .2s ease; }
.cmdk-box { width: min(560px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); overflow: hidden; animation: pop-in .28s var(--spring); }
.cmdk-box input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 15.5px; box-shadow: none; }
.cmdk-box input:focus { box-shadow: none; }
.cmdk-list { max-height: 340px; overflow: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); cursor: pointer; font-weight: 550; }
.cmdk-item svg { width: 17px; height: 17px; color: var(--muted); }
.cmdk-item.sel { background: var(--accent-weak); color: var(--accent); } .cmdk-item.sel svg { color: var(--accent); }
.cmdk-item .hint { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: var(--panel-2); }
.cmdk-foot .kbd { color: var(--muted); border-color: var(--line); background: var(--panel); }

/* ------------------------------------------------------------------ builder */
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; white-space: normal; padding: 20px; font-weight: 500; height: 100%; border-radius: var(--radius); color: var(--text-2); }
.mode-card strong { font-size: 15.5px; color: var(--text); }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mode-card.active { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: 0 12px 30px -12px rgba(99,70,229,.45); }
.mode-card.active .mode-icon { background: var(--grad); color: #fff; border-color: transparent; }
.mode-icon { font-size: 13px; color: var(--accent); background: var(--accent-weak); border: 1px solid transparent; border-radius: 8px; padding: 4px 10px; transition: all .3s var(--ease); }
.source-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel-2); min-width: 0; transition: box-shadow .25s, border-color .25s; }
.source-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.src-badge { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-weak); border-radius: 7px; padding: 3px 9px; white-space: nowrap; letter-spacing: .02em; }
.link-tab { gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); display: inline-block; transition: background .3s; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
button.primary .dot { background: rgba(255,255,255,.5); } button.primary .dot.ok { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.route-card { border-color: color-mix(in srgb, var(--info) 40%, var(--line)); background: linear-gradient(180deg, var(--info-weak), var(--panel) 70%); }
#b-suggest-card { border: 1.5px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; box-shadow: 0 14px 40px -18px rgba(99,70,229,.45); }
#b-suggest-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grad-soft); opacity: .6; pointer-events: none; }
#b-suggest-card > * { position: relative; }
#b-suggest-card h2 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#b-suggest-out > * { animation: rise .5s var(--ease) both; }

#bstep.step-enter > * { animation: rise .5s var(--ease) both; }
#bstep.step-enter > *:nth-child(2) { animation-delay: .06s; } #bstep.step-enter > *:nth-child(3) { animation-delay: .12s; } #bstep.step-enter > *:nth-child(n+4) { animation-delay: .18s; }
.ai-think { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); font-weight: 600; color: var(--text-2); }
.ai-think .orb { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 0deg, #6366f1, #a855f7, #ec4899, #0ea5e9, #6366f1); animation: sp 1.4s linear infinite; position: relative; flex: none; filter: saturate(1.2); }
.ai-think .orb::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel); }
.ai-phase { animation: slide-in .4s var(--ease); }
.ai-think .dots { display: inline-flex; gap: 4px; margin-left: auto; }
.ai-think .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.1s ease-in-out infinite; }
.ai-think .dots i:nth-child(2) { animation-delay: .15s; } .ai-think .dots i:nth-child(3) { animation-delay: .3s; }

/* AI Rule Studio */
.studio-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--grad); font-size: 18px; flex: none; box-shadow: 0 8px 20px -8px rgba(124,58,237,.7); animation: float 5s ease-in-out infinite; }
#b-suggest-card h2 { -webkit-text-fill-color: transparent; }
.file-id { padding: 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); }
.studio-result { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--neutral-weak); }
.ring .val { stroke-linecap: round; stroke: var(--ok); animation: ring-fill 1.2s var(--ease) both; }
.ring.warn .val { stroke: var(--warn); } .ring.bad .val { stroke: var(--bad); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; }
.ring.ok span { color: var(--ok); } .ring.warn span { color: var(--warn); } .ring.bad span { color: var(--bad); }
.delta { display: inline-flex; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--neutral-weak); color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { background: var(--ok-weak); color: var(--ok); } .delta.down { background: var(--bad-weak); color: var(--bad); }
.ask { margin-top: 18px; padding: 16px; border-radius: var(--radius-sm); background: var(--panel); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ask h3 { font-size: 15px; }
.ask-box { display: flex; gap: 10px; align-items: stretch; }
.ask-box textarea { min-height: 52px; flex: 1; }
.ask-box button { align-self: stretch; }
.convo { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.turn { display: flex; flex-direction: column; gap: 6px; animation: rise .4s var(--ease) both; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; }
.bubble.you { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; box-shadow: 0 6px 16px -8px rgba(99,70,229,.6); }
.bubble.ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.ai ul { margin: 0 0 6px; padding-left: 18px; }
details.manual { margin-bottom: 18px; }
details.manual > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 14px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); font-weight: 650; box-shadow: var(--shadow); transition: background .2s; }
details.manual > summary:hover { background: var(--panel-2); }
details.manual > summary span:first-child::before { content: "▸"; display: inline-block; margin-right: 10px; color: var(--accent); transition: transform .25s var(--ease); }
details.manual[open] > summary span:first-child::before { transform: rotate(90deg); }
details.manual[open] > summary { margin-bottom: 14px; }
details.manual[open] > .grid { animation: rise .35s var(--ease); }

/* trace drawer */
.drawer-wrap { position: fixed; inset: 0; z-index: 65; background: rgba(8, 10, 22, .42); backdrop-filter: blur(4px); animation: fade-in .25s ease; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--bg); border-left: 1px solid var(--line); box-shadow: -30px 0 80px -30px rgba(0,0,0,.45); overflow-y: auto; animation: drawer-in .45s var(--ease) both; }
.drawer-wrap.out { animation: fade-out .28s ease forwards; } .drawer-wrap.out .drawer { animation: drawer-out .28s var(--ease) forwards; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 12px; align-items: flex-start; padding: 22px 26px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 22px 26px 40px; position: relative; }
.tl { position: relative; padding: 0 0 22px 48px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms + .1s); }
.tl::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: linear-gradient(var(--line-strong), var(--line)); }
.tl:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; background: var(--grad); box-shadow: 0 0 0 4px var(--bg), 0 6px 14px -6px rgba(99,70,229,.6); }
.tl.test .tl-dot { background: linear-gradient(135deg, #10b981, #059669); } .tl.refine .tl-dot { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tl.adjust .tl-dot { background: linear-gradient(135deg, #ec4899, #a855f7); } .tl.notes .tl-dot { background: linear-gradient(135deg, #64748b, #475569); }
.tl-body { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tl-title { font-weight: 700; margin-bottom: 10px; font-size: 14.5px; }
.mini-file { flex: 1; min-width: 200px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.mini-file .mono { margin-top: 6px; }
.map-row { padding: 10px 0; border-top: 1px solid var(--line); } .map-row:first-child { border-top: 0; padding-top: 0; }
.map-cols { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-arrow { color: var(--accent); font-weight: 700; }
.role { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; background: var(--accent-weak); color: var(--accent); }
.role.amount { background: var(--ok-weak); color: var(--ok); } .role.date { background: var(--info-weak); color: var(--info); } .role.text { background: var(--warn-weak); color: var(--warn); }
.map-why { margin: 6px 0; font-size: 13px; color: var(--text-2); }
.map-samples { display: grid; gap: 4px; font-size: 12px; }
.map-samples code, .t-line code { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: var(--panel-3); }
.t-pass { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; }
.t-pass-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.t-pass .idx { font-weight: 750; font-size: 11px; color: #fff; background: var(--grad); padding: 2px 9px; border-radius: 99px; }
.t-line { font-size: 13px; color: var(--text-2); }
.t-why { margin-top: 6px; font-size: 13px; color: var(--accent); }
.t-warn { color: var(--warn); margin: 8px 0 0; font-weight: 550; }
.t-list { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; } .t-list.warn { color: var(--warn); }
.t-sub { margin: 14px 0 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr.grp td { border-top: 2px solid var(--line-strong); }
.tl .bubble.you { display: inline-block; margin-bottom: 8px; }

/* combined uploads */
.drop-wrap { min-width: 0; }
.parts { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 14px 14px 12px; background: var(--panel); margin-top: -8px; }
.part { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.part .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--warn); margin: 8px 0 0; font-size: 13px; }
.dup input { width: auto; }

/* ------------------------------------------------------------------ auth */
body.signed-out .side { display: none; }
body.signed-out .shell { grid-template-columns: 1fr; }
body.signed-out .view { max-width: none; padding: 0; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #0c0f1d, #1a1550 55%, #2a1065); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; }
.auth-hero .b1 { width: 420px; height: 420px; background: #6366f1; top: -120px; left: -80px; }
.auth-hero .b2 { width: 360px; height: 360px; background: #d946ef; bottom: -100px; right: -60px; animation-delay: -5s; }
.auth-hero .b3 { width: 260px; height: 260px; background: #0ea5e9; top: 40%; left: 45%; animation-delay: -9s; opacity: .35; }
.auth-hero > * { position: relative; }
.auth-hero .brand { padding: 0; color: #fff; }
.auth-hero h2 { font-size: 40px; line-height: 1.1; letter-spacing: -.035em; font-weight: 780; margin: 0 0 14px; max-width: 480px; }
.auth-hero h2 span { background: linear-gradient(90deg, #a5b4fc, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: rgba(255,255,255,.72); font-size: 15.5px; max-width: 440px; margin: 0; }
.auth-feats { display: grid; gap: 12px; margin-top: 34px; }
.auth-feats div { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.86); font-weight: 500; animation: slide-in .6s var(--ease) both; }
.auth-feats div:nth-child(2) { animation-delay: .1s; } .auth-feats div:nth-child(3) { animation-delay: .2s; }
.auth-feats i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); font-style: normal; font-size: 14px; }
.auth-side { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 410px; margin: 0; padding: 32px; animation: pop-in .6s var(--spring) both; box-shadow: var(--shadow-lg); }
.auth-card button.primary { padding: 11px 15px; }

.who { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; color: var(--text); min-width: 0; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
label.check, label.radio { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); margin: 0; font-size: 13.5px; cursor: pointer; }
label.check input, label.radio input { width: 16px; }
nav a[hidden] { display: none; }

/* ------------------------------------------------------------------ keyframes */
@keyframes sp { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes bar-grow { from { width: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes rise-bar { from { transform: scaleY(0); } }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.6); opacity: .4; } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes progress { 0% { transform: scaleX(0); } 40% { transform: scaleX(.55); } 100% { transform: scaleX(.9); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px) scale(.97); } }
@keyframes drain { to { transform: scaleX(0); } }
@keyframes skel { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes settle { from { transform: scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes dash-pulse { 50% { border-color: var(--accent-2); } }
@keyframes float { 50% { transform: translateY(-5px); } }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }
@keyframes ring-fill { from { stroke-dashoffset: var(--c); } }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-out { to { transform: translateX(60px); opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes logo-in { from { transform: scale(.5) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) { .auth { grid-template-columns: 1fr; } .auth-hero { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 6px; }
  .brand { padding: 0 8px 0 0; } .brand small, .nav-label { display: none; }
  nav { display: flex; gap: 2px; overflow-x: auto; width: 100%; order: 3; padding-bottom: 2px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 14px; }
  nav a { white-space: nowrap; padding: 7px 10px; } nav a .kbd { display: none; }
  nav a.active::before { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 6px; align-items: center; }
  .side-foot .who, .side-foot #engine-badge, .side-foot .acct { display: none; }
  .side-tools { margin: 0; }
  .view { padding: 22px 16px 56px; }
  h1 { font-size: 22px; }
  .kpi .value { font-size: 22px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .cond { grid-template-columns: 1fr 1fr; }
  .cond-labels { display: none; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .steps { border-radius: var(--radius); }
  .toast-stack { left: 16px; right: 16px; bottom: 16px; }
  .ask-box { flex-direction: column; }
  .bubble { max-width: 100%; }
  .timeline { padding: 18px 16px 32px; } .drawer-head { padding: 18px 16px 14px; }
}
