/* ============================================================================
   CADENCE — Complaint Adjudication, Decision & Enforcement
   House Strategies Group · "Product" design system
   Indigo #5145E5 / #8B7DFF · Space Grotesk + Inter · rounded-2xl app-shell
   ========================================================================== */

:root {
  /* Brand */
  --accent: #5145E5;
  --accent-2: #8B7DFF;
  --accent-press: #3F35C7;
  --accent-tint: #EEECFE;
  --accent-tint-2: #F6F5FF;

  /* Ink + neutrals */
  --ink: #0F1124;
  --ink-soft: #3A3D55;
  --faint: #6B6F88;
  --faint-2: #9A9DB3;
  --line: #E7E7F0;
  --line-soft: #F0F0F6;
  --surface: #FFFFFF;
  --surface-2: #FAFAFD;
  --canvas: #F6F6FB;

  /* Sidebar (dark) */
  --side-1: #14152C;
  --side-2: #1C1E3E;
  --side-ink: #C9CBE6;
  --side-faint: #8487AD;
  --side-line: rgba(255,255,255,.08);
  --side-active: rgba(139,125,255,.16);

  /* Status */
  --teal: #0E9F8E;
  --teal-tint: #E0F5F1;
  --amber: #E08A1E;
  --amber-tint: #FBEFD9;
  --red: #E1495B;
  --red-tint: #FCE7EA;
  --green: #2BA24C;
  --green-tint: #E3F6E8;
  --blue: #3B73E8;
  --blue-tint: #E5EDFD;

  /* Geometry */
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(16,17,36,.05), 0 1px 3px rgba(16,17,36,.04);
  --shadow: 0 4px 14px rgba(16,17,36,.06), 0 1px 3px rgba(16,17,36,.05);
  --shadow-lg: 0 18px 48px rgba(16,17,36,.13), 0 4px 12px rgba(16,17,36,.06);
  --shadow-glow: 0 12px 36px rgba(81,69,229,.22);

  --sidebar-w: 270px;
  --ribbon-h: 30px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin: 0; line-height: 1.18; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-tint); color: var(--accent-press); }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #d7d7e4; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c2c2d6; background-clip: content-box; }

/* ============================ DEMO RIBBON ================================= */
.ribbon {
  position: fixed; top: 0; left: 0; right: 0; height: var(--ribbon-h); z-index: 200;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(90deg, #14152C, #2A235E 55%, #14152C);
  color: #D7D3FF; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.ribbon .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(139,125,255,.7); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(139,125,255,.55);} 70%{ box-shadow: 0 0 0 7px rgba(139,125,255,0);} 100%{ box-shadow:0 0 0 0 rgba(139,125,255,0);} }

/* ============================ APP SHELL ================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; padding-top: var(--ribbon-h); }

/* ---- Sidebar ---- */
.sidebar {
  position: sticky; top: var(--ribbon-h); align-self: start;
  height: calc(100vh - var(--ribbon-h));
  background: linear-gradient(176deg, var(--side-2), var(--side-1));
  border-right: 1px solid var(--side-line);
  display: flex; flex-direction: column; overflow: hidden; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; }
.brand .mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; box-shadow: var(--shadow-glow); flex: none; }
.brand .mark svg { width: 22px; height: 22px; }
.brand .word { font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; color: #fff; font-size: 18px; }
.brand .sub { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--side-faint); margin-top: 1px; }

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 14px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); background-clip: content-box; }
.nav-group { margin-top: 16px; }
.nav-label { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--side-faint); padding: 0 12px 7px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--side-ink); font-size: 13.5px; font-weight: 500; cursor: pointer; position: relative;
  transition: background .15s, color .15s; margin-bottom: 2px; text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item .tag { margin-left: auto; font-size: 9.5px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.08); color: var(--side-faint); letter-spacing: .04em; }
.nav-item.active { background: var(--side-active); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--accent-2), var(--accent)); }
.nav-item.active svg { opacity: 1; color: var(--accent-2); }

.side-foot { padding: 12px 16px 16px; border-top: 1px solid var(--side-line); }
.side-foot .chip { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--side-faint); }
.side-foot .chip b { color: var(--side-ink); font-weight: 600; }

/* ---- Topbar ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: var(--ribbon-h); z-index: 40;
  height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 30px;
  background: rgba(246,246,251,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.crumb { font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { color: var(--faint-2); }
.topbar .spacer { flex: 1; }
.topbar .case-pill { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.topbar .case-pill .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-press); }
.topbar .gov { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.topbar .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#2A235E,#5145E5); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }

/* ---- Content ---- */
.content { padding: 30px; max-width: 1240px; width: 100%; margin: 0 auto; }
.view { animation: viewin .34s cubic-bezier(.2,.7,.3,1); }
@keyframes viewin { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* ============================ PRIMITIVES ================================= */
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 28px; margin: 8px 0 6px; }
.page-head p { color: var(--faint); font-size: 15px; max-width: 720px; margin: 0; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
@media (max-width: 1080px){ .g3,.g4 { grid-template-columns: repeat(2,1fr);} .span2{grid-column:span 1;} }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #dcdcea; }
.card .card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card .card-h h3 { font-size: 16px; }
.card .card-h .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.card .card-h .ic svg { width: 17px; height: 17px; }
.card .card-h .right { margin-left: auto; }
.card-sub { color: var(--faint); font-size: 13px; margin: -6px 0 14px; }

/* Stat tile */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat .label { font-size: 12px; color: var(--faint); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.stat .num { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -.03em; margin-top: 7px; line-height: 1; }
.stat .delta { font-size: 12px; margin-top: 9px; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.stat .delta.up { color: var(--green); } .stat .delta.down { color: var(--red); } .stat .delta.flat { color: var(--faint); }
.stat .spark { position: absolute; right: 14px; bottom: 12px; opacity: .9; }
.stat .ic-corner { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }

/* Badges / pills */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .01em; white-space: nowrap; }
.badge .bd { width: 6px; height: 6px; border-radius: 50%; }
.b-accent { background: var(--accent-tint); color: var(--accent-press); } .b-accent .bd{background:var(--accent);}
.b-teal { background: var(--teal-tint); color: #0a7468; } .b-teal .bd{background:var(--teal);}
.b-amber { background: var(--amber-tint); color: #9a5a06; } .b-amber .bd{background:var(--amber);}
.b-red { background: var(--red-tint); color: #b32434; } .b-red .bd{background:var(--red);}
.b-green { background: var(--green-tint); color: #1d7a37; } .b-green .bd{background:var(--green);}
.b-blue { background: var(--blue-tint); color: #2456c0; } .b-blue .bd{background:var(--blue);}
.b-neutral { background: var(--line-soft); color: var(--faint); } .b-neutral .bd{background:var(--faint-2);}
.b-ghost { background: transparent; color: var(--faint); border: 1px solid var(--line); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; transition: all .16s; text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--accent-press); text-decoration: none; transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #23263f; text-decoration: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-press); text-decoration: none; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Lists, meta */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--faint); }
.hr { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 14px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.row:hover td { background: var(--surface-2); }
.tbl .row { cursor: pointer; }

/* SLA ring */
.ring-wrap { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .rt { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.ring .rt small { display:block; font-size: 8.5px; color: var(--faint); letter-spacing:.06em; text-transform:uppercase; font-weight:600;}

/* Progress bar */
.bar { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s cubic-bezier(.2,.7,.3,1); }
.bar.teal > i { background: linear-gradient(90deg,#0E9F8E,#3CC9B7);} .bar.amber > i{background:linear-gradient(90deg,#E08A1E,#F4B65A);} .bar.red > i{background:linear-gradient(90deg,#E1495B,#F0808D);}

/* Timeline / stepper */
.steps { position: relative; }
.steps .step { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.steps .step:not(:last-child)::before { content:""; position: absolute; left: 13px; top: 28px; bottom: -2px; width: 2px; background: var(--line); }
.steps .step .dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); color: var(--faint); font-size: 12px; font-weight: 700; z-index: 1; }
.steps .step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.steps .step.done::before { background: var(--green); }
.steps .step.active .dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-tint); }
.steps .step .st-body h4 { font-size: 14.5px; }
.steps .step .st-body p { font-size: 13px; color: var(--faint); margin: 3px 0 0; }
.steps .step .st-meta { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; }

/* IG firewall gate */
.gate { border: 1.5px dashed var(--accent-2); background: linear-gradient(180deg, var(--accent-tint-2), #fff); border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.gate .lock { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--shadow-glow); }
.gate h4 { font-size: 14.5px; color: var(--accent-press); display: flex; align-items: center; gap: 8px; }
.gate p { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; }
.gate .who { font-size: 11.5px; font-weight: 600; color: var(--accent-press); margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--accent-tint); padding: 4px 10px; border-radius: 999px; }

/* Checklist (legal sufficiency) */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.check:last-child { border-bottom: 0; }
.check .cbox { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 13px; }
.check .cbox.pass { background: var(--green-tint); color: var(--green); }
.check .cbox.warn { background: var(--amber-tint); color: var(--amber); }
.check .cbox.pend { background: var(--line-soft); color: var(--faint-2); }
.check .ck-body { flex: 1; }
.check .ck-body h5 { font-size: 13.5px; font-weight: 600; }
.check .ck-body p { font-size: 12.5px; color: var(--faint); margin: 2px 0 0; }
.check .auth { font-family: var(--font-mono); font-size: 11px; color: var(--accent-press); }

/* Callout */
.callout { border-left: 3px solid var(--accent); background: var(--accent-tint-2); border-radius: 0 var(--r) var(--r) 0; padding: 14px 18px; font-size: 13.5px; color: var(--ink-soft); }
.callout.teal { border-color: var(--teal); background: var(--teal-tint); }
.callout.amber { border-color: var(--amber); background: var(--amber-tint); }

/* Doc preview (letters/ROI/FAD) */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 26px 30px; font-size: 13px; line-height: 1.7; box-shadow: var(--shadow-sm); }
.doc .doc-h { text-align: center; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 18px; }
.doc .doc-h .seal { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; font-size: 13px; }
.doc .doc-h .sub { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.doc h6 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-press); margin: 16px 0 6px; font-family: var(--font-body); font-weight: 700; }
.doc .cite { background: var(--accent-tint-2); border-bottom: 1px dashed var(--accent-2); cursor: help; }
.doc .redact { background: #1115; color: transparent; border-radius: 3px; user-select: none; padding: 0 4px; }
.doc .draftmark { display:inline-block; transform: rotate(-4deg); border: 2px solid var(--red); color: var(--red); font-weight: 700; font-size: 11px; letter-spacing: .12em; padding: 2px 10px; border-radius: 6px; opacity: .75; }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; background: var(--line-soft); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tabs .tab { padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--faint); cursor: pointer; transition: all .15s; border: none; background: transparent; }
.tabs .tab.active { background: var(--surface); color: var(--accent-press); box-shadow: var(--shadow-sm); }

/* Sliders (simulator) */
.slider-row { margin-bottom: 18px; }
.slider-row .sl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.slider-row .sl-top label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.slider-row .sl-top .val { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--accent-press); }
input[type=range] { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: var(--shadow); cursor: pointer; transition: transform .1s; }
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.12); }

/* Activity stream */
.stream { max-height: 340px; overflow-y: auto; }
.ev { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; animation: viewin .4s; }
.ev:last-child { border-bottom: 0; }
.ev .ed { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; }
.ev .ev-b { flex: 1; min-width: 0; }
.ev .ev-b b { font-weight: 600; }
.ev .ev-t { font-size: 11.5px; color: var(--faint-2); white-space: nowrap; }

/* Pillar cards (landing/method) */
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; transition: all .2s; position: relative; overflow: hidden; }
.pillar:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.pillar .pn { font-family: var(--font-display); font-size: 13px; color: var(--accent); font-weight: 700; }
.pillar .pic { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, var(--accent-tint), #fff); border: 1px solid var(--accent-tint); display: grid; place-items: center; color: var(--accent); margin-bottom: 14px; }
.pillar .pic svg { width: 23px; height: 23px; }
.pillar h3 { font-size: 17px; margin-bottom: 7px; }
.pillar p { font-size: 13.5px; color: var(--faint); margin: 0; }
.pillar .hook { margin-top: 14px; font-size: 11.5px; font-family: var(--font-mono); color: var(--accent-press); background: var(--accent-tint-2); padding: 6px 10px; border-radius: 8px; display: inline-block; }

/* Hero (landing) */
.hero { position: relative; border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(150deg, #14152C 0%, #221C52 45%, #3A2E8C 100%); color: #fff; padding: 56px 52px; margin-bottom: 26px; }
.hero::after { content:""; position: absolute; right: -120px; top: -120px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(139,125,255,.45), transparent 65%); }
.hero .eyebrow { color: var(--accent-2); }
.hero h1 { color: #fff; font-size: 44px; line-height: 1.08; margin: 14px 0 16px; max-width: 760px; position: relative; z-index: 1; }
.hero p { color: #C7C9E8; font-size: 17px; max-width: 620px; position: relative; z-index: 1; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 28px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .hero-stats { display: flex; gap: 36px; margin-top: 36px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .hero-stats .hs .n { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.hero .hero-stats .hs .l { font-size: 12px; color: #A9ABcf; letter-spacing: .04em; }

/* Logo strip / crosswalk */
.crosswalk td .badge { font-size: 10.5px; }
.matrix td:first-child { font-weight: 600; }

/* Diagram (architecture/firewall zones) */
.zones { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.zone { padding: 20px; border-right: 1px solid var(--line); }
.zone:last-child { border-right: 0; }
.zone .zh { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 10px; }
.zone.adv { background: var(--accent-tint-2); } .zone.adv .zh { color: var(--accent-press); }
.zone.gate-z { background: var(--amber-tint); } .zone.gate-z .zh { color: #9a5a06; }
.zone.gov { background: var(--green-tint); } .zone.gov .zh { color: #1d7a37; }
.zone ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-soft); }
.zone li { margin-bottom: 6px; }

/* Donut legend */
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend .li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend .li .sw { width: 11px; height: 11px; border-radius: 3px; }
.legend .li .v { margin-left: auto; font-weight: 600; font-family: var(--font-display); }

/* mobile drawer */
.menu-btn { display: none; }
.backdrop { display: none; }

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: var(--ribbon-h); left: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; z-index: 120; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
  .backdrop.show { display: block; position: fixed; inset: 0; top: var(--ribbon-h); background: rgba(16,17,36,.4); z-index: 110; }
  .g2 { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .hero { padding: 36px 26px; } .hero h1 { font-size: 32px; }
  .zones { grid-template-columns: 1fr; }
}

/* utility */
.flex { display: flex; } .items-center { align-items: center; } .gap { gap: 12px; } .gap-s { gap: 8px; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; } .mb { margin-bottom: 16px; }
.right { text-align: right; } .center { text-align: center; }
.fs-sm { font-size: 13px; } .fs-xs { font-size: 12px; } .fw6 { font-weight: 600; }
.nowrap { white-space: nowrap; }
.pulse-red { animation: pulseRed 1.8s infinite; }
@keyframes pulseRed { 0%,100%{ opacity:1;} 50%{opacity:.55;} }

/* ============================ A11Y / PRODUCTION ========================== */
.skip { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--accent); color: #fff; padding: 11px 18px; border-radius: 0 0 12px 0; font-weight: 600; font-size: 14px; text-decoration: none; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 5px; }
.nav-item:focus-visible { outline-offset: -2px; }
#view:focus { outline: none; }
.cite { cursor: pointer; }
.cite:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .ribbon, .topbar, .menu-btn, .backdrop { display: none !important; }
  .shell { grid-template-columns: 1fr; padding-top: 0; }
  .content { padding: 0; max-width: none; }
  .card, .stat, .pillar { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ============================ LIVE AI (Phase 2) ========================= */
.aipill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.aipill.on { color: #1d7a37; background: var(--green-tint); border-color: transparent; }
.aipill.off { color: var(--faint); }
.aipill svg { width: 13px; height: 13px; }
.btn.ai-btn { background: var(--accent-tint-2); border-color: var(--accent-tint); color: var(--accent-press); box-shadow: none; }
.btn.ai-btn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.btn.ai-btn.off, .btn.ai-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent-press); background: var(--accent-tint-2); border: 1px solid var(--accent-tint); padding: 3px 10px; border-radius: 999px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--accent-tint); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ ROLES (demo personas) ===================== */
.role-wrap { display: flex; align-items: center; gap: 7px; }
.role-lbl { font-size: 11px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.role-switch { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--ink); background-color: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 30px 6px 13px; cursor: pointer; box-shadow: var(--shadow-sm); -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6F88' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; max-width: 240px; }
.role-switch:hover { border-color: var(--accent); }
.rolebar { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 11px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.rolebar .rb-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.rolebar .rb-body { flex: 1; min-width: 0; font-size: 13.5px; }
.rolebar .rb-duty { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.rolebar .rb-auth { flex: none; }
.rolecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.rolecard:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.rolecard.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.rolecard .rc-top { display: flex; gap: 12px; align-items: center; }
.rolecard .rc-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.rolecard h3 { font-size: 15px; }
.rolecard .rc-mods { font-size: 11.5px; color: var(--faint); display: flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.rolecard .rc-btn { margin-top: auto; justify-content: center; }
@media (max-width: 920px) { .role-lbl { display: none; } .role-switch { max-width: 150px; } }
