:root {
  --bg: #070d1d; --bg2: #0a1428; --panel: #0f1b33; --panel2: #132341; --line: #1f3152; --line2: #2a4167;
  --text: #eef4ff; --muted: #a3b3cc; --dim: #7489a8;
  --mint: #66e2c2; --blue: #5aa9ff; --red: #ff7a8a; --amber: #ffc56b;
  --r: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.error { color: var(--red); }
a { color: var(--blue); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 2px; }
.mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--mint), var(--blue)); color: var(--bg); font-weight: 800; letter-spacing: 0; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 80% 10%, #13305a, var(--bg) 60%); }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 8px 0 0; font-size: 24px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea { background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); padding: 9px 11px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
nav a:hover { background: var(--panel); color: var(--text); }
nav a.active { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--mint); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.badge { background: var(--amber); color: #1d1300; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 0 8px; }
.main { padding: 28px 32px 48px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 26px; }
.head p { margin: 4px 0 0; }

/* cards & stats */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 4px; }
.stat .sub { color: var(--dim); font-size: 12px; }
.v-mint { color: var(--mint); } .v-amber { color: var(--amber); } .v-red { color: var(--red); } .v-blue { color: var(--blue); }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; background: var(--bg2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; text-align: right; }
.empty { color: var(--dim); text-align: center; padding: 28px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.pill.allow, .pill.active, .pill.approved, .pill.low { background: rgba(102,226,194,.14); color: var(--mint); }
.pill.hold, .pill.pending, .pill.medium { background: rgba(255,197,107,.16); color: var(--amber); }
.pill.deny, .pill.revoked, .pill.denied, .pill.high { background: rgba(255,122,138,.15); color: var(--red); }
.pill.consumed { background: rgba(90,169,255,.15); color: var(--blue); }

/* buttons */
.btn { border: 1px solid var(--line2); background: var(--panel2); color: var(--text); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--mint); color: #062018; border-color: var(--mint); }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn + .btn { margin-left: 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* forms in modal */
.modal { position: fixed; inset: 0; background: rgba(3,7,16,.7); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-card { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow: auto; }
.modal-card h2 { margin: 0; font-size: 20px; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
.secret { background: var(--bg2); border: 1px dashed var(--mint); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 13px; word-break: break-all; }
pre { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; margin: 0; }
.args { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: pre-wrap; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; flex-direction: row; }
  .main { padding: 20px 16px; }
}

/* ---------- v0.4: dashboard, live traffic, trace, access map ---------- */
.nav-sep { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 14px 12px 4px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(102,226,194,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(102,226,194,.55); } 70% { box-shadow: 0 0 0 8px rgba(102,226,194,0); } 100% { box-shadow: 0 0 0 0 rgba(102,226,194,0); } }

.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--muted); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--panel2); color: var(--text); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.kpi .value { font-size: 28px; }
.dash { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.i-allow { background: var(--mint); } .i-hold { background: var(--amber); } .i-deny { background: var(--red); } .i-lat { background: var(--blue); }
.toplist { display: flex; flex-direction: column; gap: 10px; }
.toprow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.toprow .bar { grid-column: 1 / -1; height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; display: flex; }
.toprow .bar span { display: block; height: 100%; }
.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(90,169,255,.06); }

/* live */
.live-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.live-stat { font-size: 13px; color: var(--muted); }
.live-stat b { color: var(--text); font-size: 16px; }
tr.fresh td { animation: fresh 2.2s ease-out; }
@keyframes fresh { from { background: rgba(102,226,194,.18); } to { background: transparent; } }
.paused { color: var(--amber); font-weight: 600; font-size: 13px; }

/* trace */
.modal-card.wide { max-width: 760px; }
.trace-sum { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.timeline { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line2); margin-left: 10px; }
.tl { position: relative; padding: 6px 0 10px 20px; }
.tl .dot { position: absolute; left: -11px; top: 7px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--panel2); border: 2px solid var(--line2); }
.tl.ok .dot { border-color: var(--mint); color: var(--mint); }
.tl.bad .dot { border-color: var(--red); color: var(--red); }
.tl.wait .dot { border-color: var(--amber); color: var(--amber); }
.tl.info .dot { color: var(--dim); }
.tl .row1 { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.tl .row1 .t { color: var(--dim); font-family: var(--mono); font-size: 12px; font-weight: 400; white-space: nowrap; }
.tl .det { color: var(--muted); font-size: 13px; }
.checks { margin: 8px 0 2px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.checks div { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; }
.checks .c-ok { color: var(--mint); } .checks .c-bad { color: var(--red); } .checks .c-skip { color: var(--dim); }
.checks .cd { color: var(--dim); font-family: var(--mono); font-size: 12px; text-align: right; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* access map */
.amap td, .amap th { text-align: center; vertical-align: middle; }
.amap td:first-child, .amap th:first-child { text-align: left; }
.cell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 8px; min-width: 120px; cursor: pointer; border: 1px solid transparent; }
.cell:hover { border-color: var(--line2); }
.cell .k { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.cell .s { font-size: 12px; color: var(--muted); }
.cell.allow { background: rgba(102,226,194,.10); } .cell.allow .k { color: var(--mint); }
.cell.cond { background: rgba(255,197,107,.10); } .cell.cond .k { color: var(--amber); }
.cell.deny { background: rgba(255,122,138,.10); } .cell.deny .k { color: var(--red); }
.cell.none .k { color: var(--dim); } .cell.none { background: transparent; }
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.finding { font-size: 13px; }
.finding b { display: block; font-size: 22px; margin-bottom: 2px; }
.nowrap { white-space: nowrap; }
a.finding { text-decoration: none; color: var(--muted); }
a.finding:hover { color: var(--text); }
.live-head { margin-bottom: 12px; }

/* =====================================================================
   v0.5 visual refresh
   One loud element (the decision flow on the dashboard); everything else calm.
   ===================================================================== */
:root {
  --bg: #060b18; --bg2: #0a1224; --panel: #0d1730; --panel2: #13203f; --line: #1b2a4a; --line2: #27395f;
  --text: #eaf1fc; --muted: #9fb0cc; --dim: #6f83a6;
  --mint: #5fe0bf; --amber: #ffc25f; --red: #ff6f82; --blue: #5aa9ff;
  --head: "Sora", "Inter", system-ui, sans-serif;
}
body { font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .head h1, .section-title { font-family: var(--head); letter-spacing: -0.01em; }
.head h1 { font-size: 28px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* shell: sidebar + column with top bar */
.shell { grid-template-columns: 232px 1fr; }
.col { min-width: 0; display: flex; flex-direction: column; }
.side { background: linear-gradient(180deg, #0a1326 0%, #070d1c 100%); gap: 22px; }
.side .brand { padding: 2px 8px; }
nav a { justify-content: flex-start; gap: 11px; }
nav a .ico { width: 18px; height: 18px; flex: none; opacity: .75; }
nav a.active .ico, nav a:hover .ico { opacity: 1; }
nav a .badge, nav a .live-dot { margin-left: auto; }
nav a.active { background: linear-gradient(90deg, rgba(95,224,191,.12), rgba(95,224,191,0) 85%); box-shadow: inset 2px 0 0 var(--mint); }
.nav-sep { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--dim); }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 12px 32px;
  background: rgba(6,11,24,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.env { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.env .env-tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: rgba(90,169,255,.14); color: var(--blue); }
.health { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.light { display: inline-flex; align-items: center; gap: 6px; }
.light i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.light.ok i { background: var(--mint); box-shadow: 0 0 0 3px rgba(95,224,191,.15); }
.light.bad i { background: var(--red); box-shadow: 0 0 0 3px rgba(255,111,130,.18); }
.search { margin-left: auto; flex: 0 1 360px; min-width: 140px; }
.search input { width: 100%; background: var(--bg2); border-color: var(--line); padding: 8px 12px 8px 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f83a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px 50%; }
.main { padding: 26px 32px 56px; }

/* cards: quiet by default */
.card { background: var(--panel); border-color: var(--line); border-radius: 14px; }
.section-title { font-size: 15px; font-weight: 600; }
.table-wrap { border-radius: 14px; }
th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--dim); background: rgba(10,18,36,.7); }
td { border-bottom-color: rgba(27,42,74,.7); }
tbody tr:hover td { background: rgba(90,169,255,.04); }
.pill { letter-spacing: .02em; text-transform: none; font-size: 12px; padding: 2px 10px; }
.pill.allow::before, .pill.hold::before, .pill.deny::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.btn { border-radius: 9px; transition: border-color .15s, background .15s; }
.btn.primary { background: linear-gradient(135deg, #6ae8c7, #4fd0b0); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }

/* KPI cards with trend line and change vs previous period */
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; padding: 16px 18px 14px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-family: var(--head); font-size: 30px; font-weight: 600; margin: 2px 0 0; }
.kpi .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .sub { font-size: 12px; color: var(--dim); }
.delta { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: rgba(159,176,204,.12); color: var(--muted); white-space: nowrap; }
.delta.up-good, .delta.down-good { background: rgba(95,224,191,.13); color: var(--mint); }
.delta.up-bad, .delta.down-bad { background: rgba(255,111,130,.14); color: var(--red); }
.spark { display: block; width: 100%; height: 30px; margin-top: 8px; }

/* decision flow: the one loud element */
.flow-card { position: relative; padding: 18px 20px 14px; margin-bottom: 16px; border-radius: 18px;
  background: radial-gradient(120% 140% at 50% 0%, #11234a 0%, #0b1530 46%, #091128 100%); border: 1px solid #22355e;
  box-shadow: 0 30px 80px -40px rgba(90,169,255,.35); }
.flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.flow-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.flow-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.flow svg { width: 100%; height: auto; display: block; }
.flow-foot { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.flow-foot i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 30; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: #13203f; border: 1px solid var(--line2);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .2s ease-out; }
.toast i { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--blue); }
.toast.ok i { background: var(--mint); } .toast.warn i { background: var(--amber); } .toast.err i { background: var(--red); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal { backdrop-filter: blur(4px); }
.modal-card { border-radius: 18px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.8); }

/* empty states */
.empty { padding: 36px 20px; }

@media (max-width: 900px) {
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .health { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, tr.fresh td, .toast { animation: none !important; }
}
.kpi .row { align-items: baseline; }
.kpi .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .row { flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
.kpi .value { white-space: nowrap; }
.delta { flex: none; }

/* =====================================================================
   Light theme (default). Dark stays available from the top bar.
   ===================================================================== */
:root { --c-lane: #2a4170; --c-grid: #1f3152; --c-cp1: #173061; --c-cp2: #0c1833; }
:root[data-theme="light"] {
  --bg: #f3f6fb; --bg2: #edf1f7; --panel: #ffffff; --panel2: #eef3fa; --line: #e1e7f0; --line2: #cdd7e6;
  --text: #13213b; --muted: #4c5c78; --dim: #74849f;
  --mint: #0d9b76; --amber: #b86e00; --red: #d3344b; --blue: #2c6bd9;
  --c-lane: #c6d5ea; --c-grid: #e5ebf3; --c-cp1: #ffffff; --c-cp2: #eaf3ff;
  color-scheme: light;
}
[data-theme="light"] body { background: var(--bg); }
[data-theme="light"] .login { background: radial-gradient(circle at 80% 10%, #dff0ff, var(--bg) 60%); }
[data-theme="light"] .login-card, [data-theme="light"] .card, [data-theme="light"] .table-wrap { box-shadow: 0 1px 2px rgba(19,33,59,.04), 0 8px 24px -16px rgba(19,33,59,.18); }
[data-theme="light"] .side { background: #ffffff; border-right-color: var(--line); }
[data-theme="light"] nav a:hover { background: var(--bg2); }
[data-theme="light"] nav a.active { background: linear-gradient(90deg, rgba(13,155,118,.12), rgba(13,155,118,0) 85%); color: var(--text); }
[data-theme="light"] .topbar { background: rgba(255,255,255,.86); }
[data-theme="light"] th { background: #f6f8fc; color: var(--dim); }
[data-theme="light"] td { border-bottom-color: var(--line); }
[data-theme="light"] tbody tr:hover td, [data-theme="light"] tr.clickable:hover td { background: #f5f9ff; }
[data-theme="light"] .pill.allow, [data-theme="light"] .pill.active, [data-theme="light"] .pill.approved, [data-theme="light"] .pill.low { background: #e3f6ef; color: #087a5c; }
[data-theme="light"] .pill.hold, [data-theme="light"] .pill.pending, [data-theme="light"] .pill.medium { background: #fdf0d8; color: #925600; }
[data-theme="light"] .pill.deny, [data-theme="light"] .pill.revoked, [data-theme="light"] .pill.denied, [data-theme="light"] .pill.high { background: #fde6e9; color: #b4223a; }
[data-theme="light"] .pill.consumed { background: #e4eefd; color: #1f57b8; }
[data-theme="light"] .btn { background: #ffffff; border-color: var(--line2); color: var(--text); }
[data-theme="light"] .btn:hover { border-color: var(--blue); }
[data-theme="light"] .btn.ghost { background: transparent; }
[data-theme="light"] .btn.primary { background: linear-gradient(135deg, #14b38a, #0d9b76); color: #ffffff; border-color: transparent; }
[data-theme="light"] .btn.danger { color: var(--red); }
[data-theme="light"] .seg { border-color: var(--line2); background: #ffffff; }
[data-theme="light"] .seg button.on { background: #e8eef8; color: var(--text); }
[data-theme="light"] .badge { background: #ffcf6e; color: #3d2600; }
[data-theme="light"] .delta { background: #eef2f8; color: var(--muted); }
[data-theme="light"] .delta.up-good, [data-theme="light"] .delta.down-good { background: #e3f6ef; color: #087a5c; }
[data-theme="light"] .delta.up-bad, [data-theme="light"] .delta.down-bad { background: #fde6e9; color: #b4223a; }
[data-theme="light"] .env .env-tag { background: #e4eefd; color: #1f57b8; }
[data-theme="light"] .light.ok i { box-shadow: 0 0 0 3px rgba(13,155,118,.15); }
[data-theme="light"] .flow-card { background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%); border-color: #d9e4f3;
  box-shadow: 0 1px 2px rgba(19,33,59,.04), 0 30px 60px -36px rgba(44,107,217,.35); }
[data-theme="light"] .toast { background: #ffffff; border-color: var(--line2); box-shadow: 0 18px 40px -18px rgba(19,33,59,.35); }
[data-theme="light"] .modal { background: rgba(19,33,59,.28); }
[data-theme="light"] .modal-card { background: #ffffff; border-color: var(--line); box-shadow: 0 40px 90px -30px rgba(19,33,59,.45); }
[data-theme="light"] .trace-sum, [data-theme="light"] pre, [data-theme="light"] .secret { background: #f6f8fc; }
[data-theme="light"] .tl .dot { background: #ffffff; }
[data-theme="light"] .cell.allow { background: #e8f7f1; } [data-theme="light"] .cell.cond { background: #fdf3e0; }
[data-theme="light"] .cell.deny { background: #fdecee; } [data-theme="light"] .cell:hover { border-color: var(--line2); }
[data-theme="light"] .toprow .bar { background: #edf1f7; }
[data-theme="light"] .mark { color: #ffffff; }
[data-theme="light"] a.finding:hover { color: var(--text); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #ffffff; }
[data-theme="light"] .search input { background-color: var(--bg2); border-color: var(--line); }
@keyframes fresh-light { from { background: #dff6ee; } to { background: transparent; } }
[data-theme="light"] tr.fresh td { animation-name: fresh-light; }
.pill { white-space: nowrap; }
[data-theme="light"] .search input {
  background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2374849f' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px 50%;
  border-color: var(--line);
}

/* ---------- v0.6: sign-in, trial, plans ---------- */
.login { align-items: center; }
.login-wrap { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.1fr 400px; gap: 56px; align-items: center; }
.login-pitch h1 { font-family: var(--head); font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; margin: 28px 0 14px; max-width: 16ch; }
.login-pitch .lead { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 46ch; margin: 0 0 20px; }
.ticks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; color: var(--text); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--mint); opacity: .18; }
.ticks li::after { content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 4px; border-left: 2px solid var(--mint); border-bottom: 2px solid var(--mint); transform: rotate(-45deg); }
.trial-note { color: var(--muted); margin: 0; }
.trial-note b { color: var(--text); }
.login-card h2 { margin: 0; font-size: 20px; }
.login-card .stack { display: grid; gap: 10px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { width: 100%; }
.btn.social { width: 100%; text-align: center; padding: 11px 14px; font-weight: 500; }
.btn.social + .btn.social { margin-left: 0; }
.stack .btn { margin-left: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.switch { margin: 0; color: var(--muted); }
.switch a, .staff a { color: var(--blue); text-decoration: none; }
.switch a:hover, .staff a:hover { text-decoration: underline; }
.staff { margin: 6px 0 0; text-align: center; }
.staff a { color: var(--dim); }
.dev-login { border-top: 1px dashed var(--line2); padding-top: 14px; }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; gap: 28px; max-width: 440px; }
  .login-pitch h1 { font-size: 26px; margin-top: 18px; }
  .login-pitch .ticks { display: none; }
}

/* plan tag in the top bar */
.plan-tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); text-decoration: none; white-space: nowrap; }
.plan-tag.warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.plan-tag.bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.env { display: flex; align-items: center; gap: 8px; }

/* banner under the top bar */
.banner { padding: 0 32px; margin-top: 16px; display: grid; gap: 8px; }
.banner-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.banner-row.warn { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 9%, var(--panel)); }
.banner-row.bad { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: color-mix(in srgb, var(--red) 8%, var(--panel)); }
.banner-row.op { border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: color-mix(in srgb, var(--blue) 7%, var(--panel)); }
.banner-row .btn { flex: none; text-decoration: none; }

/* account */
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.plan-status { margin: 4px 0 18px; color: var(--muted); }
.plan-status.grace { color: var(--amber); } .plan-status.expired, .plan-status.suspended { color: var(--red); }
.meter { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.meter-head b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-bar { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.meter-bar.near i { background: var(--amber); } .meter-bar.full i { background: var(--red); }
.grid.plans { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 12px; }
.card.plan { display: flex; flex-direction: column; gap: 6px; }
.card.plan h3 { margin: 0; font-size: 17px; }
.card.plan .price { font-family: var(--head); font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.card.plan.current { border-color: var(--mint); }
.plan-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; flex: 1; }
.card.plan .btn, .card.plan .pill { align-self: flex-start; text-decoration: none; }
.kv dd .btn { margin-left: 10px; font-family: inherit; }
.small-select { padding: 3px 6px; font-size: 12px; margin-bottom: 4px; }
td.actions { white-space: nowrap; }
td.actions .btn + .btn { margin-left: 4px; }
td.num { font-variant-numeric: tabular-nums; }
.small-kpis .kpi .value { font-size: 28px; }

/* get started */
.get-started { margin-bottom: 18px; }
.gs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.gs-head h2 { margin: 0 0 4px; }
.gs-head p { margin: 0; }
.gs-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 2px; }
.gs-steps li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.gs-steps li b { font-weight: 600; }
.gs-steps li p { margin: 2px 0 0; }
.gs-steps .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; font-size: 12px; color: #fff; }
.gs-steps li.done .tick { background: var(--mint); border-color: var(--mint); }
.gs-steps li.done b { color: var(--muted); }
.gs-steps .btn { text-decoration: none; }
pre.code { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }
@media (max-width: 700px) { .banner { padding: 0 16px; } .banner-row { flex-direction: column; align-items: flex-start; } }
.topbar .btn { white-space: nowrap; }
.kv.plain dd { font-family: inherit; font-size: 14px; word-break: normal; overflow-wrap: anywhere; }
.kv.plain dd.mono { font-family: var(--mono); font-size: 12px; }
.kv.plain { row-gap: 10px; align-items: center; }
h2.section-title { margin-top: 26px; }
.plan-list { align-content: start; }
.table-scroll { overflow-x: auto; }
.op-table td { vertical-align: top; }
.op-table td.owner { min-width: 190px; max-width: 260px; overflow-wrap: anywhere; }
.op-table td.actions { white-space: normal; width: 1%; }
.op-table td.actions > div { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px; justify-content: end; }
.op-table td.actions .btn + .btn { margin-left: 0; }
.ellip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-card .notice { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: color-mix(in srgb, var(--mint) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--mint) 35%, transparent); }
.op-table td.op-sub { min-width: 220px; }
.op-table td.op-sub .pill { display: inline-block; margin-bottom: 4px; white-space: normal; }
.op-table td.op-sub a { display: inline-block; margin-top: 4px; }
.op-table tr.attn-row td:first-child { box-shadow: inset 3px 0 0 var(--amber, #d98a00); }
.op-table tr.own-row td { background: color-mix(in srgb, var(--blue) 5%, transparent); }

/* ---------- v0.7: emergency stop, pausing, guardrails ---------- */
.btn.estop { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: transparent; white-space: nowrap; }
.btn.estop:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
.btn.estop.on { background: var(--red); color: #fff; border-color: var(--red); }
.btn.estop.on:hover { filter: brightness(0.95); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: transparent; }
.banner-row.estop-row { border-width: 2px; }
.gchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gchip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.gchip.hold { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.gchip.block { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.gchip.redact { background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); }
.gtable td { vertical-align: top; }
.gtable .ex { margin-top: 4px; color: var(--muted); }
.gsel { min-width: 170px; font-weight: 600; }
.gsel.hold { color: var(--amber); } .gsel.block { color: var(--red); } .gsel.redact { color: var(--mint); } .gsel.off { color: var(--dim); }
.gtest textarea { width: 100%; font-family: var(--mono); font-size: 13px; margin: 8px 0; }
.gtest-out { display: grid; gap: 8px; margin-top: 12px; }
.gtest-line b { margin-right: 8px; }
.card.events { margin-bottom: 16px; }
.card.events h2 { margin: 0 0 8px; font-size: 16px; }
.card.events td { padding: 6px 10px; font-size: 13px; border-top: 1px solid var(--line); vertical-align: top; }
.gchips.inline { display: inline-flex; margin: 0 0 0 4px; vertical-align: middle; }
.gtest-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
td .gchip { white-space: normal; line-height: 1.35; }
td .gchips { max-width: 520px; }
.reason-cell { min-width: 300px; }

/* v0.8: team & roles */
.banner-row.info { border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: color-mix(in srgb, var(--blue) 6%, var(--panel)); }
.role-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--dim) 14%, transparent); color: var(--text); }
.role-tag.owner { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.role-tag.admin { background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); }
.ws-switch { font: inherit; font-weight: 600; font-size: 15px; color: var(--text); background: transparent; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 28px 4px 10px; max-width: 280px; cursor: pointer; }
.ws-switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.team-table td { vertical-align: middle; }
.team-table .small-select { min-width: 110px; }
.role-matrix th.c, .role-matrix td.c { text-align: center; width: 110px; }
.role-matrix .yes { color: var(--mint); font-weight: 700; }
.role-matrix .no { color: var(--dim); }
.invite-head h2 { margin: 2px 0 6px; }
.invite-head .eyebrow-none { margin: 0; color: var(--dim); font-size: 14px; }
.invite-head .invite-for { margin: 10px 0 14px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--blue) 7%, transparent); }
.login-card h2.sub { font-size: 17px; margin-top: 4px; }
/* Viewers: actions that change the workspace are hidden (the API refuses them too). */
body.viewer .edit { display: none !important; }
body.viewer .gsel { pointer-events: none; opacity: .75; }
.modal-card label input, .modal-card label select { max-width: 100%; box-sizing: border-box; }
.role-hint { display: block; margin-top: 6px; font-weight: 400; }
.topbar:has(.ws-switch) { gap: 12px; }
.topbar:has(.ws-switch) .search { min-width: 96px; }
.ws-switch { max-width: 220px; text-overflow: ellipsis; }
.topbar .estop:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(1); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px;
  border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.danger-zone h2 { margin: 0 0 4px; font-size: 17px; }
.danger-zone p { margin: 0; }
.del-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }

/* v0.9: what-if simulator */
.modal-card.wide { max-width: 880px; }
.impact-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 14px; background: color-mix(in srgb, var(--blue) 3%, var(--panel)); }
.impact-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.impact-top h3 { margin: 0; font-size: 15px; }
.impact-head { margin: 6px 0 2px; font-size: 15px; }
.impact details { margin-top: 10px; }
.impact details summary { cursor: pointer; color: var(--blue); }
.impact .table-scroll, .impact table { margin-top: 8px; }
.seg.small button { padding: 4px 10px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chg { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--dim) 14%, transparent); }
.chg.hold { background: color-mix(in srgb, var(--amber) 18%, transparent); color: color-mix(in srgb, var(--amber) 70%, var(--text)); }
.chg.deny { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.chg.allow { background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint); }
.by-role { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0; }
.watch-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 12px;
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.watch-main { display: grid; gap: 6px; }
.watch-rules { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.watch-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.watch-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.watch-tag.small-tag { margin-left: 6px; font-weight: 600; font-size: 11px; }

/* v0.10: agent profiles */
.agent-link { color: inherit; text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--blue) 50%, transparent); }
.agent-link:hover { color: var(--blue); }
.lvl { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.lvl.big { font-size: 14px; padding: 5px 14px; }
.lvl.high { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.lvl.medium { background: color-mix(in srgb, var(--amber) 22%, transparent); color: color-mix(in srgb, var(--amber) 65%, var(--text)); }
.lvl.low { background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint); }
.lvl.none { background: color-mix(in srgb, var(--dim) 16%, transparent); color: var(--dim); }
.risk { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: color-mix(in srgb, var(--dim) 12%, transparent); }
.risk.high { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.risk.medium { color: color-mix(in srgb, var(--amber) 65%, var(--text)); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.prof-card { display: grid; gap: 8px; text-decoration: none; color: inherit; border-left: 4px solid var(--line); transition: border-color .15s, transform .15s; }
.prof-card:hover { border-color: var(--blue); }
.prof-card.lv-high { border-left-color: var(--red); } .prof-card.lv-medium { border-left-color: var(--amber); } .prof-card.lv-low { border-left-color: var(--mint); }
.prof-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prof-why { margin: 0; }
.prof-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tchip { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--dim) 12%, transparent); }
.tchip.high { background: color-mix(in srgb, var(--red) 12%, transparent); } .tchip.medium { background: color-mix(in srgb, var(--amber) 16%, transparent); }
.unused-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 20%, transparent); color: color-mix(in srgb, var(--amber) 60%, var(--text)); }
.crumbs { margin: 0 0 -8px; } .crumbs a { color: var(--blue); text-decoration: none; }
.radius { display: grid; gap: 12px; border-left: 5px solid var(--line); margin-bottom: 16px; }
.radius.lv-high { border-left-color: var(--red); } .radius.lv-medium { border-left-color: var(--amber); } .radius.lv-low { border-left-color: var(--mint); }
.radius-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.radius-why { margin: 0; font-size: 15px; }
.radius h3, .prof-cols h3, .card > h3 { margin: 6px 0 2px; font-size: 15px; }
.radius-stats, .pstats { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.pstat .v { font-size: 22px; font-weight: 700; }
.reach-table td { vertical-align: top; }
.reach-table .muted-row td { opacity: .6; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--mint); vertical-align: 1px; }
.dot.high { background: var(--red); } .dot.medium { background: var(--amber); }
.note { margin: 2px 0 0; }
.unused-card { margin-bottom: 16px; border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.unused-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.unused-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.prof-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .prof-cols { grid-template-columns: 1fr; } }
.daily-bars { width: 100%; height: 90px; margin-top: 10px; display: block; }
.bar-allow { fill: var(--mint); } .bar-hold { fill: var(--amber); } .bar-deny { fill: var(--red); }
.legend { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.legend .sw.bar-allow { background: var(--mint); } .legend .sw.bar-hold { background: var(--amber); } .legend .sw.bar-deny { background: var(--red); }
table.mini { width: 100%; border-collapse: collapse; } table.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); } table.mini td.r { text-align: right; }
.data-list { margin: 6px 0; padding-left: 18px; display: grid; gap: 4px; }
.hist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.head-actions { display: flex; gap: 8px; }

/* v0.11: Coverage and receipts */
.cov-sum { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; border-left: 5px solid var(--line); }
.cov-sum.ok { border-left-color: var(--mint); } .cov-sum.bad { border-left-color: var(--red); }
.cov-big { font-size: 34px; font-weight: 800; white-space: nowrap; }
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.cov-card { display: grid; gap: 8px; border-left: 4px solid var(--line); }
.cov-card.ok { border-left-color: var(--mint); } .cov-card.warn { border-left-color: var(--amber); } .cov-card.bad { border-left-color: var(--red); }
.cov-card p { margin: 0; }
.cov-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cov-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: color-mix(in srgb, var(--dim) 14%, transparent); }
.cov-badge.ok { background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint); }
.cov-badge.warn { background: color-mix(in srgb, var(--amber) 22%, transparent); color: color-mix(in srgb, var(--amber) 65%, var(--text)); }
.cov-badge.bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.cov-stats { display: grid; gap: 2px; }
.cov-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cov-actions > span:first-child { margin-right: auto; }
.howto summary { cursor: pointer; color: var(--blue); }
.howto ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
pre.code { background: color-mix(in srgb, var(--dim) 8%, var(--panel)); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
ul.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 3px; }
ul.checks li.ok { color: var(--mint); } ul.checks li.bad { color: var(--red); }
.receipt-in { width: 100%; box-sizing: border-box; }

/* v0.12: second-person approvals */
body.approver .edit { display: none !important; }
body.viewer .vote { display: none !important; }
.rules-line { margin: -6px 0 12px; color: var(--muted); }
.two-person { font-weight: 600; color: var(--blue); margin-top: 3px; }
.vote-note { font-style: italic; }
.cant-vote { display: inline-block; max-width: 220px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 3px; }
.warn-text { color: color-mix(in srgb, var(--amber) 65%, var(--text)); }
/* v0.12 approvals table */
.args.kv { white-space: normal; display: grid; gap: 1px; min-width: 140px; }
.args.kv .k { color: var(--dim); }
.vote-btns { display: inline-flex; gap: 6px; white-space: nowrap; }
.cant-vote { display: block; max-width: 200px; }
label.check { flex-direction: row; color: var(--text); }
label.check input { width: auto; flex: none; }
.args.kv { display: flex; flex-direction: column; }
.obo { word-break: break-word; max-width: 220px; }
.cant-vote { white-space: normal; max-width: 190px; text-align: right; margin-left: auto; }
/* v0.13 limits */
.lim-used { min-width: 170px; display: grid; gap: 5px; }
.lim-chart { margin: 10px 0 4px; }
.lim-chart svg { width: 100%; height: 90px; display: block; }
.lim-chart .bar-ok { fill: color-mix(in srgb, var(--mint) 55%, var(--panel)); }
.lim-chart .bar-hit { fill: var(--amber); }
.lim-chart .lim-line { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.lim-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lim-legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.lim-legend .key:first-child { margin-left: 0; }
.lim-legend .key.ok { background: color-mix(in srgb, var(--mint) 55%, var(--panel)); }
.lim-legend .key.hit { background: var(--amber); }
.lim-legend .key.line { height: 0; border-top: 2px dashed var(--red); border-radius: 0; }
/* v0.14 evidence */
.ev-create { display: grid; gap: 10px; }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ev-top h3 { margin: 0; }
.ev-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.ev-actions label.check { max-width: 560px; }
.ctl-tally { margin: 4px 0 6px; }
.ctl-list { display: grid; gap: 0; }
.ctl-row { border-top: 1px solid var(--line); }
.ctl-row summary { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 4px; cursor: pointer; list-style: none; }
.ctl-row summary::-webkit-details-marker { display: none; }
.ctl-row summary:hover { background: var(--panel2); }
.ctl-code { color: var(--dim); font-size: 12.5px; }
.ctl-title { display: grid; gap: 1px; }
.ctl-st { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.ctl-st.ok { background: color-mix(in srgb, var(--mint) 14%, transparent); color: color-mix(in srgb, var(--mint) 75%, var(--text)); }
.ctl-st.att { background: color-mix(in srgb, var(--amber) 16%, transparent); color: color-mix(in srgb, var(--amber) 70%, var(--text)); }
.ctl-st.na { background: var(--panel2); color: var(--dim); }
.ctl-body { padding: 0 4px 12px 78px; }
.ctl-body ul { margin: 6px 0; padding-left: 18px; }
.ctl-body .exc li { color: color-mix(in srgb, var(--amber) 70%, var(--text)); }
.fw-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fw-tags span { font-size: 11.5px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; color: var(--dim); }
.integ { display: grid; gap: 8px; margin: 10px 0; }
.integ-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.verify-out { margin-top: 10px; }
.checks { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; font-size: 13px; }
.checks li.ok b { color: color-mix(in srgb, var(--mint) 75%, var(--text)); }
.checks li.bad b { color: var(--red); }
.custom-dates.hidden { display: none; }
/* v0.15 integrations */
.int-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 8px; }
.int-tile { text-align: left; display: grid; gap: 4px; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--line); }
.int-tile:hover { border-color: var(--mint); }
.int-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.int-err { max-width: 260px; white-space: normal; }
fieldset.events { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px 14px; }
fieldset.events legend { padding: 0 6px; color: var(--dim); }
label.check.ev { align-items: flex-start; }
label.check.ev > span { display: grid; gap: 1px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.manifest { position: relative; margin-top: 6px; }
.manifest pre { max-height: 160px; overflow: auto; }
.manifest .btn { position: absolute; top: 6px; right: 6px; }
pre.code { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre; overflow: auto; margin: 6px 0; }
.secret-box { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; word-break: break-all; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* v0.16 reports */
.rep-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-filters select { width: auto; min-width: 150px; }
.rep-preview { display: grid; gap: 12px; }
.rep-chart { width: 100%; height: auto; max-height: 240px; display: block; }
.rep-chart .b-allow, .legend .key.b-allow { fill: var(--mint); background: var(--mint); }
.rep-chart .b-hold, .legend .key.b-hold { fill: var(--amber); background: var(--amber); }
.rep-chart .b-deny, .legend .key.b-deny { fill: var(--red); background: var(--red); }
.rep-chart .base { stroke: var(--line); } .rep-chart .grid { stroke: var(--line); stroke-dasharray: 3 3; }
.rep-chart .axis { font-size: 10px; fill: var(--dim); }
.legend { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: var(--dim); }
.legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 10px; }
.legend .key:first-child { margin-left: 0; }
.rep-minis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rep-mini h3 { margin: 0 0 8px; font-size: 14px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 4px 0; border-bottom: 1px solid var(--line); }
table.mini td.num { text-align: right; padding-left: 8px; white-space: nowrap; }
.section-head { margin-top: 26px; }
.section-head h2 { margin: 0; }

/* ---------- single sign-on (v0.18) ---------- */
.sso-btn { border-style: dashed; }
.pill.big { font-size: 13px; padding: 5px 12px; }
.notice-card { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.notice-card p { margin: 0; }
.sso-step { display: grid; gap: 14px; margin-bottom: 16px; }
.sso-step-head { display: flex; gap: 14px; align-items: flex-start; }
.sso-step-head h3 { margin: 0 0 2px; }
.sso-step-head p { margin: 0; }
.sso-step-head .sso-on { margin-left: auto; }
.sso-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  border: 1.5px solid var(--line2); color: var(--muted); }
.sso-num.done { background: var(--mint); border-color: var(--mint); color: #fff; }
.sso-domains { display: grid; gap: 10px; }
.sso-domain { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.sso-domain p { margin: 0; }
.sso-txt { display: grid; gap: 6px; }
.sso-val { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sso-val code { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12.5px; overflow-wrap: anywhere; }
.row-form { display: flex; gap: 8px; max-width: 460px; }
.row-form input { flex: 1; }
.seg.wrap { flex-wrap: wrap; }
.sso-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .sso-grid { grid-template-columns: 1fr; } }
.sso-grid h4, .sso-policy h4 { margin: 0 0 8px; font-size: 14px; }
.sso-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }
.sso-steps li.sso-val { list-style: none; margin-left: -20px; padding-left: 20px; }
.sso-steps li.sso-val > span { color: var(--muted); font-size: 13px; }
.sso-current { margin: 0; }
.sso-policy { max-width: 720px; }
.sso-policy h4 { margin-top: 6px; }
label.radio { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); }
label.radio input { width: auto; flex: none; margin-top: 4px; }
label.radio > span { display: grid; gap: 1px; }
label.inline { display: flex; flex-direction: row; gap: 10px; align-items: center; justify-content: flex-start; font-weight: 400; flex-wrap: wrap; color: var(--text); }
label.inline select { flex: none; min-width: 160px; }
.sso-edit-toggle { justify-self: start; }
label.inline select { width: auto; }
.sso-remove { border-top: 1px solid var(--line); padding-top: 12px; }
.pill.muted-pill { background: var(--panel2); color: var(--muted); }

/* v0.18.3: the menu scrolls on its own when the window is shorter than the menu (laptops, zoom). */
@media (min-width: 761px) {
  .side { overflow: hidden; }
  .side nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin-right: -8px; padding-right: 8px; }
  .side .side-foot { flex: none; margin-top: 0; }
}
@media (min-width: 761px) and (max-height: 760px) {
  .side { gap: 14px; padding-top: 14px; padding-bottom: 12px; }
  .side nav a { padding-top: 6px; padding-bottom: 6px; }
}
