/* ============================================================
   AccessiScan — Design System
   Concept: "Make the invisible visible."
   The accessibility focus-ring is the brand. The product must
   itself be the most accessible thing in the room.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Hanken+Grotesk:wght@400..800&family=JetBrains+Mono:wght@400..600&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* Neutrals — cool, near-white paper + graphite ink */
  --paper:      oklch(0.985 0.003 255);
  --paper-2:    oklch(0.972 0.004 255);
  --surface:    #ffffff;
  --surface-2:  oklch(0.978 0.004 255);
  --ink:        oklch(0.235 0.018 264);
  --ink-2:      oklch(0.445 0.020 264);
  --ink-3:      oklch(0.595 0.016 264);
  --ink-4:      oklch(0.72 0.012 264);
  --line:       oklch(0.925 0.006 264);
  --line-2:     oklch(0.885 0.008 264);
  --line-strong:oklch(0.82 0.010 264);

  /* Brand "Signal" — cobalt */
  --signal:     oklch(0.555 0.196 256);
  --signal-700: oklch(0.475 0.190 256);
  --signal-600: oklch(0.515 0.196 256);
  --signal-400: oklch(0.66 0.16 256);
  --signal-tint:oklch(0.955 0.028 256);
  --signal-tint-2:oklch(0.92 0.045 256);

  /* Theme-aware composites (overridden in dark) */
  --inverse:    oklch(0.235 0.018 264);
  --on-inverse: oklch(0.985 0.003 255);
  --glass:      oklch(0.985 0.003 255 / 0.82);

  /* Severity scale — shared chroma family, varied hue */
  --critical:   oklch(0.555 0.205 24);
  --critical-bg:oklch(0.955 0.030 24);
  --serious:    oklch(0.640 0.165 52);
  --serious-bg: oklch(0.957 0.040 64);
  --moderate:   oklch(0.760 0.140 85);
  --moderate-bg:oklch(0.962 0.045 90);
  --minor:      oklch(0.605 0.095 250);
  --minor-bg:   oklch(0.955 0.022 250);
  --pass:       oklch(0.605 0.140 156);
  --pass-bg:    oklch(0.955 0.035 156);

  /* Elevation */
  --shadow-xs: 0 1px 2px oklch(0.30 0.03 264 / 0.05);
  --shadow-sm: 0 1px 2px oklch(0.30 0.03 264 / 0.06), 0 2px 6px oklch(0.30 0.03 264 / 0.05);
  --shadow-md: 0 2px 4px oklch(0.30 0.03 264 / 0.05), 0 8px 24px oklch(0.30 0.03 264 / 0.08);
  --shadow-lg: 0 4px 8px oklch(0.30 0.03 264 / 0.06), 0 20px 48px oklch(0.30 0.03 264 / 0.12);
  --shadow-xl: 0 8px 16px oklch(0.30 0.03 264 / 0.08), 0 40px 80px oklch(0.30 0.03 264 / 0.16);

  /* Radius */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Type */
  --display: 'Bricolage Grotesque', -apple-system, sans-serif;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --maxw: 1200px;
  --nav-h: 70px;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --paper:      oklch(0.178 0.012 264);
  --paper-2:    oklch(0.205 0.013 264);
  --surface:    oklch(0.224 0.014 264);
  --surface-2:  oklch(0.255 0.015 264);
  --ink:        oklch(0.965 0.004 264);
  --ink-2:      oklch(0.78 0.012 264);
  --ink-3:      oklch(0.64 0.013 264);
  --ink-4:      oklch(0.52 0.013 264);
  --line:       oklch(0.305 0.012 264);
  --line-2:     oklch(0.365 0.014 264);
  --line-strong:oklch(0.44 0.015 264);

  --signal:     oklch(0.64 0.17 256);
  --signal-700: oklch(0.78 0.13 256);
  --signal-600: oklch(0.60 0.18 256);
  --signal-400: oklch(0.72 0.15 256);
  --signal-tint:oklch(0.30 0.055 256);
  --signal-tint-2:oklch(0.37 0.075 256);

  --critical:   oklch(0.70 0.18 24);
  --critical-bg:oklch(0.32 0.075 24);
  --serious:    oklch(0.76 0.15 62);
  --serious-bg: oklch(0.33 0.07 62);
  --moderate:   oklch(0.82 0.13 88);
  --moderate-bg:oklch(0.33 0.06 88);
  --minor:      oklch(0.72 0.10 250);
  --minor-bg:   oklch(0.31 0.045 250);
  --pass:       oklch(0.72 0.14 156);
  --pass-bg:    oklch(0.30 0.06 156);

  --inverse:    oklch(0.262 0.016 264);
  --on-inverse: oklch(0.965 0.004 264);
  --glass:      oklch(0.178 0.012 264 / 0.82);

  --shadow-xs: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35), 0 2px 6px oklch(0 0 0 / 0.3);
  --shadow-md: 0 2px 4px oklch(0 0 0 / 0.35), 0 8px 24px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 4px 8px oklch(0 0 0 / 0.4), 0 20px 48px oklch(0 0 0 / 0.5);
  --shadow-xl: 0 8px 16px oklch(0 0 0 / 0.45), 0 40px 80px oklch(0 0 0 / 0.6);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.006em;
}
h1,h2,h3,h4,h5 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; }

/* Accessibility-first focus ring — the brand made literal */
:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--signal-tint-2); color: var(--signal-700); }

/* ---------- Type scale ---------- */
.t-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.t-display { font-size: clamp(40px, 6vw, 78px); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; }
.t-h1 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -0.03em; }
.t-h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.025em; }
.t-h3 { font-size: 23px; }
.t-h4 { font-size: 18px; font-weight: 600; }
.t-lead { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--ink-2); font-weight: 400; }
.t-body { font-size: 16px; color: var(--ink-2); }
.t-small { font-size: 14px; color: var(--ink-3); }
.t-mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.measure { max-width: 60ch; }
.nowrap { white-space: nowrap; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; width: 100%; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 28px; width: 100%; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.grow { flex: 1; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.wrapf { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 11px 18px; height: 44px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: oklch(0.32 0.03 264); box-shadow: var(--shadow-md); color: var(--paper); }
.btn-signal { background: var(--signal); color: #fff; box-shadow: 0 1px 2px oklch(0.4 0.2 256/.3), inset 0 1px 0 oklch(1 0 0/.18); }
.btn-signal:hover { background: var(--signal-600); box-shadow: var(--shadow-md); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.btn-soft { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: var(--paper-2); border-color: var(--line-2); color: var(--ink); }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16.5px; border-radius: var(--r-md); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  padding: 5px 11px 5px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; padding: 4px 10px; border-radius: var(--r-pill); }
.sev .dot { width: 7px; height: 7px; border-radius: 2px; }
.sev-critical { color: var(--critical); background: var(--critical-bg); }
.sev-serious  { color: oklch(0.5 0.15 52); background: var(--serious-bg); }
.sev-moderate { color: oklch(0.52 0.12 85); background: var(--moderate-bg); }
.sev-minor    { color: var(--minor); background: var(--minor-bg); }
.sev-pass     { color: var(--pass); background: var(--pass-bg); }
.sev-critical .dot{background:var(--critical);} .sev-serious .dot{background:var(--serious);}
.sev-moderate .dot{background:var(--moderate);} .sev-minor .dot{background:var(--minor);} .sev-pass .dot{background:var(--pass);}

/* ---------- Inputs ---------- */
.field {
  width: 100%; height: 48px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--ink-4); }
.field:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-tint); }
textarea.field { height: auto; padding: 12px 15px; resize: vertical; }
.label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; display: block; }

/* ---------- Brand mark ---------- */
.mark { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; }
.mark-glyph { position: relative; display: grid; place-items: center; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; color: var(--ink); }
.wordmark b { color: var(--signal); font-weight: 700; }

/* ---------- Utility ---------- */
.divider { height: 1px; background: var(--line); border: 0; }
.kbd { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; color: var(--ink-2); }
.tag-mono { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.noise-grid { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }

/* code block */
.code {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  background: oklch(0.20 0.018 264); color: oklch(0.92 0.01 264);
  border-radius: var(--r-sm); padding: 13px 15px; overflow-x: auto; white-space: pre;
}
.code .del { color: oklch(0.72 0.13 24); }
.code .add { color: oklch(0.75 0.12 156); }
.code .tok { color: oklch(0.74 0.12 256); }
.code .str { color: oklch(0.80 0.10 85); }

/* scrollbar */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--paper); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* fade/rise entrance */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise .6s both; }
@keyframes ping { 0% { transform: scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
.r1{animation-delay:.05s} .r2{animation-delay:.12s} .r3{animation-delay:.19s} .r4{animation-delay:.26s} .r5{animation-delay:.33s}

/* ============================================================
   Components ported from the prototype's inline styles
   (header, footer, hero, browser frame, score dial, toggles)
   ============================================================ */

/* skip link */
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { left: 16px; top: 16px; }

/* Top navigation */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  border-bottom: 1px solid transparent; background: transparent; transition: all .25s; }
.site-header.scrolled { border-bottom-color: var(--line); background: var(--glass);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.site-header .wrap { height: 100%; }
.nav-center { position: absolute; left: 50%; transform: translateX(-50%); }
.nav-link { background: none; border: 0; padding: 8px 13px; font-family: var(--sans); font-weight: 500;
  font-size: 14.5px; color: var(--ink-3); border-radius: 8px; cursor: pointer; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }
.nav-signin { background: none; border: 0; font-family: var(--sans); font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.nav-burger { display: none; }
.theme-toggle { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: transparent; border: 0; cursor: pointer; color: var(--ink-2); }
.theme-toggle:hover { background: var(--surface-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-col-title { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 14px; letter-spacing: -0.01em; }
.footer-link { display: block; background: none; border: 0; padding: 0; text-align: left; font-size: 14px; color: var(--ink-3); cursor: pointer; font-family: var(--sans); }
.footer-link:hover { color: var(--ink); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Hero noise mask */
.hero { position: relative; overflow: hidden; }
.hero-noise { position: absolute; inset: 0; opacity: .5;
  -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000, transparent);
  mask-image: radial-gradient(120% 70% at 50% 0%, #000, transparent); }

/* Browser frame (report preview) */
.browser-frame { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); }
.browser-bar { height: 42px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.browser-dots { display: flex; gap: 6px; }
.browser-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.browser-url { flex: 1; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

/* Inverted band (CTA) */
.band-inverse { border-radius: var(--r-xl); background: var(--inverse); color: var(--on-inverse); position: relative; overflow: hidden; }
.band-inverse h2, .band-inverse h3 { color: #fff; }

/* Score dial */
.dial { position: relative; }
.dial-num { font-family: var(--display); font-weight: 700; line-height: 1; color: var(--ink); letter-spacing: -0.03em; }
.dial-grade { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; font-weight: 500; }

/* Toggle switch */
.switch { width: 44px; height: 24px; border-radius: 99px; border: 0; cursor: pointer; padding: 3px; transition: background .18s; background: var(--line-strong); position: relative; }
.switch[aria-checked="true"] { background: var(--signal); }
.switch .knob { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .18s; }
.switch[aria-checked="true"] .knob { transform: translateX(20px); }

/* segmented tabs */
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 2px; }
.tabs button { border: 0; border-radius: 7px; padding: 8px 15px; cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: 14px; background: transparent; color: var(--ink-3); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* avatar */
.avatar { border-radius: 50%; flex-shrink: 0; background: var(--signal); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--sans); width: 36px; height: 36px; font-size: 14px; }

/* status pill */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* simple data table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 14px 18px; font-size: 13px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 18px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }

/* loading overlay (scan progress) */
.loading-overlay { position: fixed; inset: 0; z-index: 80; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.spinner-lg { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--signal); animation: spin 0.9s linear infinite; }
.spinner-sm { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--signal); border-radius: 4px; transition: width 0.5s ease; }

/* dropdown menu */
.menu { position: absolute; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.menu-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--ink); }
.menu-item:hover { background: var(--surface-2); }

/* ============================================================
   Authenticated app shell (Dashboard + Admin)
   ============================================================ */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: var(--paper); }
.app-aside { border-right: 1px solid var(--line); background: var(--surface); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.app-main { overflow: auto; overflow-x: hidden; max-height: 100vh; }
.app-topbar { position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-content { padding: 28px 32px 56px; max-width: 1160px; margin: 0 auto; }
.app-nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 0; cursor: pointer; font-family: var(--sans); font-size: 14.5px; font-weight: 500; background: transparent; color: var(--ink-2); text-decoration: none; }
.app-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.app-nav-item.active { background: var(--signal-tint); color: var(--signal-700); }
.app-nav-item .badge { background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; font-family: var(--mono); margin-left: auto; }
.app-nav-section { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); padding: 14px 11px 6px; }
.plan-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.mobile-menu-btn { display: none; }
/* admin dark sidebar */
.admin-aside { background: oklch(0.21 0.018 264); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-aside .wordmark { color: #fff; }
.admin-nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 0; cursor: pointer; font-family: var(--sans); font-size: 14.5px; font-weight: 500; background: transparent; color: oklch(0.74 0.02 264); text-decoration: none; }
.admin-nav-item:hover { background: oklch(1 0 0 / 0.08); color: #fff; }
.admin-nav-item.active { background: oklch(1 0 0 / 0.12); color: #fff; }
.admin-nav-section { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: oklch(0.55 0.02 264); padding: 14px 11px 6px; }
.admin-badge { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; color: #1a1a1a; background: var(--moderate); padding: 2px 7px; border-radius: 5px; }
.admin-exit { display: flex; align-items: center; gap: 10px; background: oklch(1 0 0 / 0.06); border: 1px solid oklch(1 0 0 / 0.1); border-radius: 9px; padding: 10px 12px; color: oklch(0.8 0.02 264); cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.admin-exit:hover { background: oklch(1 0 0 / 0.1); color: #fff; }
/* admin bar chart */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bars > div { flex: 1; background: var(--signal); border-radius: 5px 5px 0 0; min-height: 4px; }
.list-group-item { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list-group-item:last-child { border-bottom: 0; }
.list-group-item.bg-light { background: var(--signal-tint); }
/* lightweight modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: oklch(0.2 0.02 264 / 0.45); display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); width: 100%; max-width: 460px; padding: 24px; }
/* JS-generated card shims (api keys / devices) */
.api-key-card, .device-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; }
.font-monospace { font-family: var(--mono); }

/* stat tiles */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.stat-num { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; }

/* notifications dropdown */
.notification-menu { width: 340px; max-height: 420px; overflow-y: auto; padding: 0; }
.notification-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: var(--signal-tint); }
.notification-icon { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; }
.notification-icon.success { background: var(--pass-bg); color: var(--pass); }
.notification-icon.warning { background: var(--moderate-bg); color: oklch(0.5 0.12 85); }
.notification-icon.danger { background: var(--critical-bg); color: var(--critical); }
.notification-icon.info { background: var(--signal-tint); color: var(--signal-700); }
.notification-title { font-weight: 600; font-size: 13.5px; }
.notification-text { font-size: 12.5px; color: var(--ink-3); }
.notification-time { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.notification-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--critical); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.notification-badge.d-none, .d-none { display: none !important; }

/* toast */
.toast-container { position: fixed; top: 0; right: 0; padding: 16px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); min-width: 300px; opacity: 0; transition: opacity .3s; overflow: hidden; }
.toast.show { opacity: 1; }
.toast-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.toast-header .me-auto { margin-right: auto; }
.toast-header small { color: var(--ink-4); }
.toast-body { padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }
.btn-close { background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: 16px; line-height: 1; }
.btn-close::before { content: "\00d7"; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-aside, .admin-aside { position: fixed; left: 0; top: 0; z-index: 60; width: 260px; max-width: 84vw; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-xl); }
  body.nav-open .app-aside, body.nav-open .admin-aside { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 50; background: oklch(0.2 0.02 264 / 0.4); }
  .mobile-menu-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--ink-2); }
}

/* form validation + auth */
.text-danger, .field-validation-error { color: var(--critical); font-size: 13px; display: block; margin-top: 6px; }
.validation-summary-errors { color: var(--critical); font-size: 13.5px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.input-error { border-color: var(--critical) !important; }
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.alert-soft { border-radius: var(--r-md); padding: 12px 15px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.alert-soft.error { background: var(--critical-bg); color: var(--critical); }
.alert-soft.success { background: var(--pass-bg); color: var(--pass); }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 4px; }

/* ------------------------------------------------------------
   Compatibility shims — used ONLY by preserved long-form content
   (legal / accessibility statement). These class names are not
   used by the new design system, so they never conflict with it.
   ------------------------------------------------------------ */
.card-body { padding: 20px; }
.col-12 { flex: 1 1 100%; }
.col-md-4 { flex: 1 1 calc(33.333% - 11px); min-width: 220px; }
.col-md-6 { flex: 1 1 calc(50% - 8px); min-width: 240px; }
.col-md-8 { flex: 1 1 66%; }
.row.g-2 { gap: 8px; flex-wrap: wrap; } .row.g-3 { gap: 12px; flex-wrap: wrap; } .row.g-4 { gap: 16px; flex-wrap: wrap; }
.h-100 { height: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-3); }
.text-success { color: var(--pass); }
.text-danger { color: var(--critical); }
.lead { font-size: 18px; color: var(--ink-2); }
.list-unstyled { list-style: none; padding-left: 0; }
.list-inline { list-style: none; padding-left: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.list-inline-item { display: inline; }
.alert { border-radius: var(--r-md); padding: 14px 16px; border: 1px solid var(--line); }
.alert-success { background: var(--pass-bg); color: var(--pass); border-color: var(--pass-bg); }
.alert-danger { background: var(--critical-bg); color: var(--critical); border-color: var(--critical-bg); }
.alert-warning { background: var(--moderate-bg); color: oklch(0.45 0.10 85); border-color: var(--moderate-bg); }
.border-success { border-color: var(--pass) !important; }
.card-title { font-family: var(--display); font-weight: 600; font-size: 18px; }
/* spacing utilities for preserved article content */
.mb-0{margin-bottom:0} .mb-1{margin-bottom:.25rem} .mb-2{margin-bottom:.5rem} .mb-3{margin-bottom:1rem} .mb-4{margin-bottom:1.5rem} .mb-5{margin-bottom:2rem}
.mt-1{margin-top:.25rem} .mt-2{margin-top:.5rem} .mt-3{margin-top:1rem} .mt-4{margin-top:1.5rem} .mt-5{margin-top:2rem}
.my-4{margin-top:1.5rem;margin-bottom:1.5rem} .py-5{padding-top:2rem;padding-bottom:2rem}
.me-2{margin-right:.5rem} .ms-1{margin-left:.25rem}

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap, .wrap-narrow { padding: 0 18px; }
  .hide-sm { display: none !important; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-center { display: none; }
  .nav-burger { display: grid; }
}

/* ============================================================
   Mobile responsiveness
   The prototype is desktop-first with fixed multi-column grids
   (many via inline styles). On small screens we collapse them to
   a single column and prevent horizontal overflow.
   overflow-x: clip is used (not hidden) so position: sticky keeps working.
   ============================================================ */
html, body { overflow-x: clip; }
img, svg, video { max-width: 100%; height: auto; }

@media (max-width: 860px) {
  /* collapse ANY inline multi-column grid to one column */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  /* tame oversized horizontal padding */
  .band-inverse { padding: 32px 22px !important; }
  section[style*="padding"] { padding-left: 0; padding-right: 0; }
  /* wide tables scroll inside their card instead of pushing the whole page sideways */
  .card { overflow-x: auto !important; }
  .table { min-width: 540px; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .app-content { padding: 20px 16px 48px; }
  .app-topbar .row.between { padding: 12px 16px; }
  /* long pill labels (e.g. hero announcement) must wrap, not overflow */
  .hero .chip { white-space: normal; height: auto; text-align: left; }
  /* big display headings shrink a touch more */
  .t-display { font-size: clamp(34px, 9vw, 52px); }
}
