@font-face { font-family: "Inter"; src: url("/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ffffff;
  --bg-2: #fafafb;
  --bg-3: #f3f3f5;
  --bg-hover: #f4f4f6;
  --bg-active: #ececef;
  --line: #ebebee;
  --line-2: #dedee3;
  --text: #16161a;
  --text-2: #55565f;
  --text-3: #70717b;
  --ink: #16161a;
  --ink-text: #ffffff;
  --accent: #2b55f0;
  --accent-soft: #edf1ff;
  --accent-line: #c9d5ff;
  --allow: #0b7a45;
  --allow-bg: #e6f5ec;
  --deny: #c62a22;
  --deny-bg: #fdebe9;
  --esc: #a85d00;
  --esc-bg: #fdf1dc;
  --ref: #55565f;
  --ref-bg: #efeff2;
  --shadow-1: 0 1px 2px rgba(18, 18, 23, .06);
  --shadow-2: 0 4px 14px -2px rgba(18, 18, 23, .10), 0 2px 4px -2px rgba(18, 18, 23, .06);
  --shadow-3: 0 24px 60px -12px rgba(18, 18, 23, .22), 0 8px 20px -8px rgba(18, 18, 23, .12);
  --r-1: 6px;
  --r-2: 8px;
  --r-3: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-2: #121215;
  --bg-3: #19191d;
  --bg-hover: #18181c;
  --bg-active: #212126;
  --line: #222227;
  --line-2: #303037;
  --text: #ededf1;
  --text-2: #a3a4ae;
  --text-3: #83848f;
  --ink: #ededf1;
  --ink-text: #0d0d0f;
  --accent: #7d97ff;
  --accent-soft: #171d3a;
  --accent-line: #2c3a78;
  --allow: #4cc38a;
  --allow-bg: #0f2a1d;
  --deny: #ff7a70;
  --deny-bg: #351513;
  --esc: #f0b057;
  --esc-bg: #33240c;
  --ref: #a3a4ae;
  --ref-bg: #1e1e23;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 18px -2px rgba(0, 0, 0, .5);
  --shadow-3: 0 28px 70px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--sans); font-feature-settings: "cv11", "ss03", "calt";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #fff; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 550; color: var(--text-2); }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: .92em; font-feature-settings: "zero"; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---- controls ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-1); background: var(--bg); color: var(--text);
  font-weight: 500; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background .15s, border-color .15s, transform .1s var(--ease), opacity .15s;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="dark"] .btn.accent { color: #0d0d0f; }
.btn.accent:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.danger { color: var(--deny); }
.btn.danger.solid { background: var(--deny); border-color: var(--deny); color: #fff; }
.btn.lg { height: 40px; padding: 0 16px; font-size: 14px; border-radius: var(--r-2); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn .spin { width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--deny); }
.input, .textarea, .select {
  width: 100%; height: 36px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: var(--r-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.bad { border-color: var(--deny); }
.input.lg { height: 42px; font-size: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 5px;
  background: var(--bg-3); color: var(--text-2); font-size: 12px; font-family: var(--mono); white-space: nowrap;
}
.chip button { all: unset; cursor: pointer; display: grid; place-items: center; opacity: .6; }
.chip button:hover { opacity: 1; }
.chip.esc { background: var(--esc-bg); color: var(--esc); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chipbox { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; min-height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg); cursor: text; }
.chipbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chipbox input { flex: 1; min-width: 90px; border: 0; outline: 0; background: transparent; height: 22px; font-family: var(--mono); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.allow { color: var(--allow); background: var(--allow-bg); }
.badge.deny { color: var(--deny); background: var(--deny-bg); }
.badge.escalate { color: var(--esc); background: var(--esc-bg); }
.badge.refused, .badge.neutral { color: var(--ref); background: var(--ref-bg); }
.badge.info { color: var(--accent); background: var(--accent-soft); }
.kbd { font: 500 11px var(--sans); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; background: var(--bg); }

.avatar { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; flex: none; letter-spacing: 0; }
.avatar.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 17px; }

/* ---- brand ---- */
.mark { width: 22px; height: 22px; flex: none; }
.wordmark { font-weight: 620; letter-spacing: -.02em; font-size: 15px; }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 10px; gap: 2px; min-height: 0; }
.ws { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-1); border: 0; background: transparent; text-align: left; width: 100%; margin-bottom: 8px; }
.ws:hover { background: var(--bg-hover); }
.ws b { font-weight: 600; font-size: 13.5px; }
.nav { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: var(--r-1); color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 450; border: 0; background: transparent; width: 100%; text-align: left; }
.nav:hover { background: var(--bg-hover); color: var(--text); }
.nav.on { background: var(--bg-active); color: var(--text); font-weight: 550; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: var(--esc-bg); color: var(--esc); }
.side-label { font-size: 11.5px; font-weight: 550; color: var(--text-3); padding: 14px 8px 4px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.signer { margin: 8px 0 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg); font-size: 12px; color: var(--text-2); line-height: 1.45; }
.signer b { color: var(--text); font-weight: 550; display: block; margin-bottom: 2px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.top { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.top h2 { font-size: 15px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--allow); box-shadow: 0 0 0 0 var(--allow); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--allow) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.body { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 24px 28px 60px; max-width: 1040px; }
.page.narrow { max-width: 760px; }
.page > .lede { color: var(--text-2); max-width: 62ch; margin: 6px 0 22px; }

.tabs { display: flex; gap: 2px; padding: 8px 20px; border-bottom: 1px solid var(--line); flex: none; align-items: center; }
.tab { height: 28px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--r-1); color: var(--text-2); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--bg-hover); color: var(--text); }
.tab.on { background: var(--bg-active); color: var(--text); }
.tab .n { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---- table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--bg); text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { height: 42px; padding: 0 12px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl tbody tr.sel { background: var(--accent-soft); }
.tbl tbody tr.new td { animation: rowin .5s var(--ease); }
@keyframes rowin { from { background: var(--accent-soft); opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tbl .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tbl .act { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tbl .act b { font-weight: 500; font-family: var(--mono); font-size: 12.5px; flex: none; }
.tbl .act span { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }

/* ---- drawer ---- */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); display: flex; flex-direction: column; z-index: 5; animation: drawer .26s var(--ease); }
@keyframes drawer { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 9px 12px; font-size: 13px; align-items: baseline; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sect { display: flex; flex-direction: column; gap: 10px; }
.sect > h3 { display: flex; align-items: center; gap: 6px; }
.verdict { padding: 14px; border-radius: var(--r-3); display: flex; flex-direction: column; gap: 4px; }
.verdict b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.verdict.allow { background: var(--allow-bg); color: var(--allow); }
.verdict.deny { background: var(--deny-bg); color: var(--deny); }
.verdict.escalate { background: var(--esc-bg); color: var(--esc); }
.verdict.refused { background: var(--ref-bg); color: var(--ref); }
.verdict span { font-size: 13px; color: var(--text); opacity: .86; }
.checks { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks .ok { color: var(--allow); }
.checks .no { color: var(--deny); }
.checks .wait { color: var(--text-3); }

.card { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg); }
.card.pad { padding: 18px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-2); background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); line-height: 1.5; }
.callout b { color: var(--text); font-weight: 550; }
.code { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; overflow: auto; white-space: pre; color: var(--text); }
.code .copy { position: absolute; top: 6px; right: 6px; }
.code .c { color: var(--text-3); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 72px 24px; color: var(--text-2); }
.empty .glyph { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-3); display: grid; place-items: center; color: var(--text-2); margin-bottom: 4px; }
.empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { max-width: 44ch; font-size: 13.5px; }
.skel { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--bg-3), var(--bg-hover), var(--bg-3)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; }
.toast { background: var(--ink); color: var(--ink-text); padding: 9px 14px; border-radius: var(--r-2); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-2); display: flex; gap: 8px; align-items: center; animation: toast .3s var(--ease); }
.toast.bad { background: var(--deny); color: #fff; }
@keyframes toast { from { transform: translateY(10px); opacity: 0; } }

.menu { position: fixed; z-index: 40; min-width: 200px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-2); box-shadow: var(--shadow-2); padding: 4px; animation: pop .14s var(--ease); }
@keyframes pop { from { transform: scale(.97) translateY(-3px); opacity: 0; } }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border: 0; background: transparent; border-radius: 5px; font-size: 13px; text-align: left; }
.menu button:hover { background: var(--bg-hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .who { padding: 8px; font-size: 12px; color: var(--text-3); }
.menu .who b { display: block; color: var(--text); font-size: 13px; font-weight: 550; }

/* ---- passport: the one rich object ---- */
.passport { position: relative; width: 100%; max-width: 400px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); overflow: hidden; }
.passport .p-top { padding: 20px 20px 16px; display: flex; gap: 14px; align-items: center; }
.passport .p-name { font-size: 18px; font-weight: 620; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.passport .p-sub { font-size: 12.5px; color: var(--text-3); }
.passport .p-rows { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.passport .p-row { display: flex; flex-direction: column; gap: 5px; }
.passport .p-row > span { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.passport .p-row > div { font-size: 13px; }
.passport .p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.passport .p-mrz { border-top: 1px dashed var(--line-2); background: var(--bg-2); padding: 12px 20px 14px; font-family: var(--mono); font-size: 10.5px; line-height: 1.6; color: var(--text-3); letter-spacing: .04em; overflow-wrap: anywhere; min-height: 62px; }
.passport .p-mrz b { color: var(--text-2); font-weight: 500; }
.passport .seal { position: absolute; top: 16px; right: 16px; width: 54px; height: 54px; color: var(--allow); opacity: 0; transform: scale(1.5) rotate(-18deg); }
.passport.signed .seal { opacity: 1; transform: rotate(-8deg); transition: transform .55s var(--ease), opacity .2s; }
.passport.revoked .seal { color: var(--deny); }
.passport.revoked { filter: saturate(.6); }

/* ---- auth ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 520px) 1fr; }
.auth-form { padding: 32px 56px; display: flex; flex-direction: column; }
.auth-form form { margin: auto 0; display: flex; flex-direction: column; gap: 16px; max-width: 380px; width: 100%; }
.auth-form h1 { margin-bottom: 2px; }
.auth-stage { background: var(--bg-2); border-left: 1px solid var(--line); display: grid; place-items: center; padding: 48px; overflow: hidden; position: relative; }
.stage-wrap { width: min(640px, 100%); display: flex; flex-direction: column; gap: 22px; }
.stage-wrap > p { font-size: 22px; line-height: 1.3; font-weight: 550; letter-spacing: -.02em; max-width: 22ch; text-wrap: balance; }
.feed { border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow-3); overflow: hidden; }
.feed-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 550; }
.feed-rows { height: 336px; overflow: hidden; display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 128px 118px 1fr auto; gap: 10px; align-items: center; height: 42px; flex: none; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 13px; animation: rowin .5s var(--ease); }
.feed-row .t { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-row .t span { color: var(--text-3); }
.feed-row .s { color: var(--text-3); font-size: 12px; font-family: var(--mono); }
.steps-mini { display: flex; flex-direction: column; gap: 10px; color: var(--text-2); font-size: 13.5px; }

/* ---- onboarding ---- */
.ob { min-height: 100vh; display: grid; grid-template-columns: minmax(460px, 560px) 1fr; }
.ob-left { display: flex; flex-direction: column; padding: 28px 56px 32px; min-height: 100vh; }
.ob-head { display: flex; align-items: center; gap: 10px; }
.ob-prog { display: flex; gap: 5px; margin: 34px 0 30px; }
.ob-prog i { height: 3px; flex: 1; border-radius: 3px; background: var(--line-2); transition: background .3s; }
.ob-prog i.on { background: var(--ink); }
.ob-step { display: flex; flex-direction: column; gap: 22px; animation: stepin .4s var(--ease); flex: 1; }
@keyframes stepin { from { opacity: 0; transform: translateY(8px); } }
.ob-step > p.lede { color: var(--text-2); font-size: 15px; margin-top: -12px; max-width: 46ch; }
.ob-foot { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.ob-right { background: var(--bg-2); border-left: 1px solid var(--line); display: grid; place-items: center; padding: 40px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg); text-align: left; transition: border-color .15s, background .15s, box-shadow .15s; }
.pick:hover { border-color: var(--text-3); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.pick .pi { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-3); display: grid; place-items: center; flex: none; }
.pick.on .pi { background: var(--bg); color: var(--accent); }
.pick b { font-size: 13.5px; font-weight: 550; display: block; }
.pick span { font-size: 12px; color: var(--text-3); }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .mono { font-size: 12.5px; }
.sw { position: relative; width: 30px; height: 18px; border-radius: 99px; background: var(--line-2); border: 0; flex: none; transition: background .18s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.sw[aria-checked="true"] { background: var(--ink); }
:root[data-theme="dark"] .sw[aria-checked="true"]::after { background: #0d0d0f; }
.sw[aria-checked="true"]::after { transform: translateX(12px); }
.seg { display: inline-flex; padding: 2px; background: var(--bg-3); border-radius: var(--r-2); gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border: 0; background: transparent; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: var(--shadow-1); }
.sim { width: min(560px, 100%); display: flex; flex-direction: column; gap: 14px; }
.sim .feed-rows { height: auto; min-height: 294px; }
.sim-note { font-size: 13px; color: var(--text-2); min-height: 40px; }
.approve-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--esc-bg); color: var(--esc); font-size: 13px; font-weight: 500; animation: stepin .3s var(--ease); }
.approve-bar span { color: var(--text); font-weight: 400; }

.listen { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); font-size: 13.5px; }
.listen .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--esc); animation: pulse2 1.4s infinite; flex: none; }
.listen.ok { border-color: var(--allow); background: var(--allow-bg); color: var(--allow); }
.listen.ok .dot { background: var(--allow); animation: none; }
@keyframes pulse2 { 50% { opacity: .3; } }

.rule { border: 1px solid var(--line); border-radius: var(--r-3); padding: 14px; display: grid; grid-template-columns: 130px 1fr auto; gap: 10px 12px; align-items: start; background: var(--bg); }
.rule .textarea { font-family: var(--mono); font-size: 12.5px; }
.rule .full { grid-column: 1 / -1; }
.statline { display: flex; gap: 28px; padding: 16px 0 20px; }
.statline div { display: flex; flex-direction: column; }
.statline b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.statline span { font-size: 12px; color: var(--text-3); }

@media (max-width: 900px) {
  .auth, .ob { grid-template-columns: 1fr; }
  .auth-stage, .ob-right { display: none; }
  .auth-form, .ob-left { padding: 24px 20px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .page { padding: 20px 16px 60px; }
  .tbl .hide-sm { display: none; }
  .picks { grid-template-columns: 1fr; }
  .rule { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* refinements after first render */
.seg { align-self: flex-start; }
.code, .mono, .chip, .passport .p-mrz { font-variant-ligatures: none; }
.pick b { color: var(--text); }
.sim-note { font-size: 15px; color: var(--text); line-height: 1.5; min-height: 68px; max-width: 44ch; }
.sim-note b { font-weight: 600; }
.approve-bar { box-shadow: 0 0 0 1px var(--esc), var(--shadow-2); }
textarea, input, select { font-variant-ligatures: none; }
.rule { grid-template-columns: 170px 1fr auto; }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2370717b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.mnav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-rows: 1fr auto; }
  .mnav { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); background: var(--bg-2); padding: 4px 4px max(4px, env(safe-area-inset-bottom)); }
  .mnav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: var(--r-1); text-decoration: none; color: var(--text-3); font-size: 10.5px; font-weight: 500; }
  .mnav a.on { color: var(--text); background: var(--bg-active); }
  .mnav a i { position: absolute; top: 3px; left: 54%; min-width: 15px; height: 15px; border-radius: 99px; background: var(--esc); color: #fff; font-style: normal; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
  .top { padding: 0 16px; }
  .top .input[type="search"] { width: 150px !important; }
  .tabs { overflow-x: auto; padding: 8px 12px; }
  .tab { flex: none; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .drawer { width: 100%; }
  .kv { grid-template-columns: 104px 1fr; }
  .page > div[style*="grid-template-columns"], .drawer-body > div[style*="grid-template-columns:1fr 1fr 1fr"], .ob-step > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .statline { flex-wrap: wrap; gap: 18px; }
  h1 { font-size: 24px; }
}

.live.still i { animation: none; }

/* ================= product polish pass ================= */
:root { --canvas: #f5f5f7; }
:root[data-theme="dark"] { --canvas: #070709; }
.shell { background: var(--canvas); }
.side { background: transparent; border-right: 0; padding: 10px 8px 10px 10px; }
.main { margin: 8px 8px 8px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-1); }
.signer { background: var(--bg); box-shadow: var(--shadow-1); }
.nav.on { background: var(--bg); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
:root[data-theme="dark"] .nav.on { background: var(--bg-active); }
.ws:hover, .nav:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.top { height: 54px; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.crumb .muted { font-weight: 450; }
.crumb b { font-weight: 600; letter-spacing: -.01em; }

/* command palette trigger and dialog */
.kbtn { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; margin: 0 0 10px; width: 100%; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg); color: var(--text-3); font-size: 13px; box-shadow: var(--shadow-1); }
.kbtn:hover { border-color: var(--line-2); color: var(--text-2); }
.kbtn .kbd { margin-left: auto; }
.scrim { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, #0b0b0f 38%, transparent); backdrop-filter: blur(3px); display: grid; place-items: start center; padding-top: 14vh; animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } }
.palette { width: min(560px, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-3); overflow: hidden; animation: pop .18s var(--ease); }
.palette input { width: 100%; height: 50px; border: 0; outline: 0; background: transparent; padding: 0 18px; font-size: 15px; border-bottom: 1px solid var(--line); }
.palette .list { max-height: 340px; overflow: auto; padding: 6px; }
.palette .grp { font-size: 11.5px; font-weight: 550; color: var(--text-3); padding: 8px 10px 4px; }
.palette .opt { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.palette .opt.on { background: var(--bg-hover); }
.palette .opt .hint { margin-left: auto; color: var(--text-3); font-size: 12px; }
.palette .none { padding: 26px; text-align: center; color: var(--text-3); font-size: 13px; }

/* sidebar agents */
.side-agents { display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow: auto; }
.sa { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r-1); border: 0; background: transparent; width: 100%; text-align: left; font-size: 13px; color: var(--text-2); }
.sa:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.sa .avatar { width: 18px; height: 18px; border-radius: 5px; font-size: 9px; }
.sa .st { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.sa .st.live { background: var(--allow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--allow) 22%, transparent); }
.sa .st.off { background: var(--deny); }

/* activity band */
.band { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.band-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.band-head b { font-size: 22px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.band-head span { font-size: 13px; color: var(--text-3); }
.band svg { display: block; width: 100%; height: 64px; overflow: visible; }
.band svg rect { transition: opacity .12s; }
.band svg g:hover rect { opacity: .7; }
.band .axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.mix { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 22px; padding-bottom: 20px; }
.mix button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 3px 6px; margin: -3px -6px; border-radius: 6px; }
.mix button:hover, .mix button.on { background: var(--bg-hover); color: var(--text); }
.mix button:focus-visible { outline: 2px solid var(--accent); }
.mix i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mix b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); min-width: 1.5ch; }
.c-allow { background: var(--allow); fill: var(--allow); } .c-deny { background: var(--deny); fill: var(--deny); }
.c-escalate { background: var(--esc); fill: var(--esc); } .c-refused { background: var(--text-3); fill: var(--text-3); }
.c-admin { background: var(--line-2); fill: var(--line-2); }
.tbl td.cost { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.tbl tbody tr td:first-child { position: relative; }
.tbl tbody tr.sel td:first-child::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }

/* receipt timeline */
.life { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.life li { position: relative; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding-bottom: 16px; font-size: 13px; }
.life li:last-child { padding-bottom: 0; }
.life li::before { content: ""; position: absolute; left: 10.5px; top: 20px; bottom: 0; width: 1px; background: var(--line-2); }
.life li:last-child::before { display: none; }
.life .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); color: var(--text-2); z-index: 1; }
.life .dot svg { width: 12px; height: 12px; stroke-width: 2; }
.life .dot.allow { background: var(--allow-bg); color: var(--allow); } .life .dot.deny { background: var(--deny-bg); color: var(--deny); }
.life .dot.escalate { background: var(--esc-bg); color: var(--esc); } .life .dot.refused { background: var(--ref-bg); color: var(--ref); }
.life .dot.wait { background: transparent; border: 1px dashed var(--line-2); }
.life b { font-weight: 550; display: block; }
.life p { color: var(--text-2); font-size: 12.5px; margin-top: 1px; }
.life time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* agent cards */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding: 20px; }
.acard { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-align: left; transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); position: relative; overflow: hidden; }
.acard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.acard.off { background: var(--bg-2); }
.acard.off .avatar { filter: grayscale(1); opacity: .7; }
.acard-top { display: flex; align-items: center; gap: 11px; }
.acard-top .avatar { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
.acard-top b { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; display: block; }
.acard-top span.sub { font-size: 12px; color: var(--text-3); }
.acard .chips { max-height: 48px; overflow: hidden; }
.mixbar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--bg-3); gap: 1px; }
.mixbar i { height: 100%; }
.acard-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.acard-foot b { color: var(--text-2); font-weight: 500; }
.acard.new-card { border-style: dashed; align-items: center; justify-content: center; color: var(--text-2); min-height: 196px; gap: 8px; font-size: 13.5px; font-weight: 500; background: transparent; }
.acard.new-card:hover { color: var(--text); background: var(--bg-2); transform: none; box-shadow: none; }

/* approvals */
.ticket { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow-1); }
.ticket-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.ticket-body { padding: 14px 16px; background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ticket-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.ticket .ask-line { font-family: var(--mono); font-size: 13.5px; font-variant-ligatures: none; overflow-wrap: anywhere; }
.ticket .ask-line span { color: var(--text-3); }

/* chain strip */
.chain { display: flex; flex-wrap: wrap; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-2); }
.chain i { width: 12px; height: 12px; border-radius: 3px; opacity: 0; transform: scale(.4); animation: cell .28s var(--ease) forwards; }
@keyframes cell { to { opacity: 1; transform: none; } }
.chain i.bad { background: var(--deny) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--deny) 25%, transparent); }
.chain i.void { background: transparent !important; border: 1px dashed var(--line-2); }
.chain-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 8px; }
.chain-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chain-legend i { width: 9px; height: 9px; border-radius: 2px; }

@media (max-width: 900px) {
  .main { margin: 0; border: 0; border-radius: 0; }
  .band { grid-template-columns: 1fr; gap: 12px; }
  .mix { padding-bottom: 0; grid-template-columns: repeat(4, auto); justify-content: start; }
  .agrid { padding: 12px; }
}
@media (max-width: 900px) { .hide-sm { display: none !important; } }
.acard { font: inherit; color: inherit; cursor: pointer; }
.top .btn.primary { height: 30px; }

/* ---- visual policy builder ---- */
.page.pol { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.pol-aside { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; }
.rcard { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color .15s, box-shadow .2s; }
.rcard:hover { border-color: var(--line-2); }
.rcard.open { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.rhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-radius: 14px; min-height: 50px; }
.rhead:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rnum { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-3); color: var(--text-2); font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; font-variant-numeric: tabular-nums; }
.rsent { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.ractions { display: flex; gap: 0; opacity: 0; transition: opacity .12s; }
.rhead:hover .ractions, .rcard.open .ractions, .ractions:focus-within { opacity: 1; }
.i.flip { transform: rotate(180deg); }
.i.chev { color: var(--text-3); transition: transform .2s var(--ease); }
.rcard.open .i.chev { transform: rotate(90deg); }
.rbody { padding: 4px 14px 14px 44px; display: flex; flex-direction: column; gap: 14px; animation: stepin .25s var(--ease); }
.rline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.rlabel { width: 104px; flex: none; font-size: 13px; font-weight: 550; color: var(--text); }
.conds { display: flex; flex-direction: column; gap: 8px; padding-left: 114px; margin-top: -6px; }
.cond { display: flex; align-items: flex-start; gap: 6px; }
.cond > .select { width: 128px; flex: none; }
.cond > .select + .select, .cond > input + .select { width: 176px; }
.cond > input.input { width: 150px; flex: none; font-size: 12.5px; }
.cond .chipbox { min-height: 36px; }
.money { display: flex; align-items: center; gap: 6px; }
.money span { color: var(--text-3); }
.money .input { width: 120px; }
.rfoot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.try-result { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-height: 40px; }
@media (max-width: 1100px) { .page.pol { grid-template-columns: 1fr; } .pol-aside { position: static; } }
@media (max-width: 900px) { .rbody { padding-left: 14px; } .conds { padding-left: 0; } .cond { flex-wrap: wrap; } .rlabel { width: auto; } }
.cond { flex-wrap: wrap; }
.cond > .select { width: 118px; }
.cond > .select + .select, .cond > input + .select { width: 168px; }
.cond > input.input { width: 132px; }
.cond > .grow { flex: 1 1 190px; }
.rline .input.grow { flex: 1 1 240px; width: auto; }
.seg { flex-wrap: wrap; }
details > summary { list-style: none; }
details > summary::before { content: "+ "; color: var(--text-3); }
details[open] > summary::before { content: "− "; }
details[open] > summary { margin-bottom: 8px; }
