/* ==========================================================================
   Webforta design system - "the fortress for the web"
   Cool mist surfaces, deep indigo ink, ultramarine as the working colour and a
   single amber "beacon" used only for signals and the brand mark.
   Display: Fraunces (headlines). Text & UI: Inter. Both self-hosted (OFL).
   ========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/_wf/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/_wf/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/_wf/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/_wf/fonts/inter-700.woff") format("woff"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("/_wf/fonts/fraunces-600.woff2") format("woff2"); }

:root {
  color-scheme: light;

  /* Core palette */
  --ink: #14163A;          /* text, dark bands */
  --ink-2: #2A2D57;
  --mist: #F3F5FA;         /* page background */
  --paper: #FFFFFF;        /* surfaces */
  --ultra: #2F2BE0;        /* primary */
  --ultra-deep: #1E1A9E;
  --ultra-soft: #ECEBFF;
  --beacon: #FFB020;       /* signal accent, used sparingly */
  --beacon-soft: #FFF3D9;

  --text: var(--ink);
  --text-muted: #555B7A;
  --text-dim: #6E7493;
  --line: #DDE1EC;
  --line-strong: #C6CBDD;
  --surface: var(--paper);
  --surface-2: #F7F8FC;
  --surface-3: #EEF0F7;

  --success: #12805C;
  --warning: #A15C00;
  --danger: #C8253F;
  --info: #2557D6;

  --sev-critical: #C8253F;
  --sev-high: #D2580A;
  --sev-medium: #A86A00;
  --sev-low: #2557D6;
  --sev-info: #5E6585;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 80px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(20, 22, 58, .06);
  --shadow: 0 1px 2px rgba(20, 22, 58, .05), 0 8px 24px -12px rgba(20, 22, 58, .18);
  --shadow-lg: 0 24px 60px -24px rgba(20, 22, 58, .35);
  --focus: 0 0 0 3px rgba(47, 43, 224, .35);
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--mist); color: var(--text); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
img, svg { max-width: 100%; }
a { color: var(--ultra); text-decoration: none; }
a:hover { color: var(--ultra-deep); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--space-3); letter-spacing: -0.01em; font-weight: 650; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 var(--space-4); }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-3); color: var(--ink-2); padding: 1px 6px; border-radius: 5px; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ultra); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; font-weight: 600; }
.skip-link:focus { left: 8px; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }
.text-center { text-align: center; }
.justify-center { justify-content: center; }
.mt-4 { margin-top: var(--space-4); }
.lead-center { margin-left: auto; margin-right: auto; margin-bottom: var(--space-5); }

/* ---------- Brand ---------- */
.icon { width: 18px; height: 18px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-word { font-family: var(--display); font-weight: 600; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1; }
.brand-light, .brand-light:hover { color: #fff; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px; font: 600 .95rem/1 var(--font); border: 1px solid transparent; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: .875rem; border-radius: 9px; }
.btn-primary { background: var(--ultra); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -8px rgba(47,43,224,.7); }
.btn-primary:hover { background: var(--ultra-deep); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--ultra); color: var(--ultra); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--paper); color: var(--danger); border-color: rgba(200,37,63,.4); }
.btn-danger:hover { background: #FDEEF0; color: var(--danger); }
.btn-beacon { background: var(--beacon); color: var(--ink); }
.btn-beacon:hover { background: #FFC24D; color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ultra); font: inherit; cursor: pointer; text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.7; white-space: nowrap; border: 1px solid transparent; }
.tone-neutral { color: var(--text-muted); background: var(--surface-3); }
.tone-success { color: var(--success); background: #E3F5EE; }
.tone-warning { color: var(--warning); background: var(--beacon-soft); }
.tone-danger { color: var(--danger); background: #FCE8EB; }
.tone-info { color: var(--info); background: #E7EEFD; }
.tone-accent { color: var(--ultra); background: var(--ultra-soft); }
.sev-critical { --sev: var(--sev-critical); --sev-bg: #FCE8EB; }
.sev-high { --sev: var(--sev-high); --sev-bg: #FDEDE2; }
.sev-medium { --sev: var(--sev-medium); --sev-bg: #FFF3D9; }
.sev-low { --sev: var(--sev-low); --sev-bg: #E7EEFD; }
.sev-info { --sev: var(--sev-info); --sev-bg: #EEF0F7; }
.badge.sev-critical, .badge.sev-high, .badge.sev-medium, .badge.sev-low, .badge.sev-info { color: var(--sev); background: var(--sev-bg); }

/* ---------- Cards & stats ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-title { font-size: 1rem; margin: 0; }
.card-body { padding: var(--space-5); }
.card-body > :last-child { margin-bottom: 0; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .card + .pagination { margin-top: var(--space-5); }
.grid > .card, .grid > .stat { margin-top: 0; }
.stat { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.stat-label { color: var(--text-muted); font-size: .85rem; font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; color: var(--ink); }
.stat-sub { color: var(--text-dim); font-size: .85rem; }
.stat-danger::before { background: var(--danger); } .stat-danger .stat-value { color: var(--danger); }
.stat-success::before { background: var(--success); } .stat-success .stat-value { color: var(--success); }
.stat-warning::before { background: var(--beacon); } .stat-warning .stat-value { color: var(--warning); }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper); margin-bottom: var(--space-4); }
.notice .icon { margin-top: 3px; }
.notice > div > :last-child { margin-bottom: 0; }
.notice-success { background: #EEF9F4; border-color: #BFE5D5; } .notice-success .icon { color: var(--success); }
.notice-error { background: #FDF0F2; border-color: #F3C4CC; } .notice-error .icon { color: var(--danger); }
.notice-warning { background: #FFF8E8; border-color: #F6DDA4; } .notice-warning .icon { color: var(--warning); }
.notice-info { background: #F1F1FF; border-color: #D5D4FB; } .notice-info .icon { color: var(--ultra); }
.notice-wrap { padding-top: var(--space-4); }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px var(--space-5); font-size: .9rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.banner-warning { background: var(--beacon-soft); color: #6B4200; }
.banner-warning .icon { color: var(--warning); }
.banner-info { background: var(--ultra-soft); color: var(--ultra-deep); }

/* ---------- Forms ---------- */
form { margin: 0; }
.form { max-width: 560px; }
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.req { color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); font: 400 .98rem/1.4 var(--font); box-shadow: var(--shadow-sm);
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ultra); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #9AA0BA; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.hint { color: var(--text-dim); font-size: .85rem; margin: 6px 0 0; display: block; font-weight: 400; }
.field-error { color: var(--danger); font-size: .86rem; margin: 6px 0 0; }
.field-check { display: flex; gap: 10px; align-items: flex-start; }
.field-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ultra); flex: none; }
.field-check label { font-weight: 500; margin: 0; }
.form-actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; margin-top: var(--space-5); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); margin: 0 0 var(--space-5); background: var(--surface-2); }
legend { padding: 0 6px; font-weight: 650; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: .82rem; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFBFE; }
.table-empty { padding: var(--space-4) 0; margin: 0; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-4); }

/* ---------- Code ---------- */
.code { position: relative; background: var(--ink); border-radius: var(--radius-sm); color: #E7E8FF; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.code code { background: none; padding: 0; color: inherit; }
.code .copy-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
pre.evidence { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; word-break: break-word; margin: 0 0 var(--space-3); font-size: .85rem; color: var(--ink-2); }

/* ---------- Severity summary ---------- */
.sev-counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--space-2); }
.sev-counts li { background: var(--sev-bg); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "dot name" "num num"; column-gap: 8px; align-items: center; min-width: 0; }
.sev-counts .sev-dot { grid-area: dot; width: 8px; height: 8px; border-radius: 2px; background: var(--sev); margin-top: 1px; }
.sev-counts .sev-name { grid-area: name; color: var(--sev); font-size: .8rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.sev-counts strong { grid-area: num; font-size: 1.45rem; color: var(--ink); }
@media (max-width: 640px) { .sev-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-line { stroke: var(--ultra); stroke-width: 2.25; }
.chart-down { fill: rgba(200, 37, 63, .35); }
.chart-label { fill: var(--text-dim); font-size: 12px; font-family: var(--font); }
.uptime-bars { width: 100%; height: 40px; display: block; }
.bar-up { fill: #2BA77C; } .bar-partial { fill: var(--beacon); } .bar-down { fill: var(--danger); } .bar-none { fill: var(--surface-3); }
.chart-empty { margin: 0; padding: var(--space-4) 0; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: var(--space-7) var(--space-5); }
.empty-icon { width: 44px; height: 44px; color: var(--ultra); margin-bottom: var(--space-3); background: var(--ultra-soft); border-radius: 12px; padding: 10px; }
.empty p { color: var(--text-muted); max-width: 480px; margin: 0 auto var(--space-4); }

dl.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--text-muted); }
dl.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 640px) { dl.kv { grid-template-columns: 1fr; } dl.kv dd { margin-bottom: 8px; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ultra); border-bottom-color: var(--ultra); }
.admin-tabs { flex-wrap: wrap; row-gap: 6px; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: var(--space-4); overflow: visible; }
.admin-tabs a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; background: var(--paper); font-size: .9rem; }
.admin-tabs a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.admin-tabs a[aria-current="page"] { color: #fff; background: var(--ink); border-color: var(--ink); }

/* ---------- Findings ---------- */
.finding { border: 1px solid var(--line); border-left: 4px solid var(--sev); border-radius: var(--radius-sm); background: var(--paper); margin-bottom: var(--space-3); }
.finding > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.finding > summary::-webkit-details-marker { display: none; }
.finding > summary .finding-title { font-weight: 600; flex: 1 1 260px; }
.finding[open] > summary { border-bottom: 1px solid var(--line); }
.finding-body { padding: 4px 16px 16px; }
.finding-body h4 { font-size: .82rem; color: var(--text-muted); margin: var(--space-4) 0 6px; }
.finding.is-suppressed { opacity: .7; }

/* ==========================================================================
   Public site
   ========================================================================== */

.site-header { position: sticky; top: 0; z-index: 30; background: rgba(243, 245, 250, .9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; height: 72px; gap: var(--space-6); }
.nav-desktop { flex: 1; }
.nav-links { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; align-items: center; }
.nav-link, .nav-trigger { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; color: var(--ink); font: 550 .95rem/1 var(--font); background: none; border: 0; cursor: pointer; }
.nav-link:hover, .nav-trigger:hover, .nav-group:focus-within .nav-trigger, .nav-group:hover .nav-trigger { background: rgba(47, 43, 224, .07); color: var(--ultra); text-decoration: none; }
.chev { transition: transform .15s ease; }
.nav-group { position: relative; }
.nav-group:hover .chev, .nav-group:focus-within .chev { transform: rotate(180deg); }
.mega { position: absolute; top: calc(100% + 10px); left: -12px; width: 560px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 10px; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s; }
.mega::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-group:hover .mega, .nav-group:focus-within .mega, .nav-group.open .mega { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mega-with-aside { width: 760px; display: grid; grid-template-columns: 1fr 230px; gap: 10px; }
.mega-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.mega-list a { display: flex; gap: 12px; padding: 12px; border-radius: 10px; color: var(--ink); }
.mega-list a:hover { background: var(--surface-2); text-decoration: none; }
.mega-list strong { display: block; font-size: .95rem; margin-bottom: 2px; }
.mega-list a span span { display: block; color: var(--text-muted); font-size: .86rem; line-height: 1.45; }
.mega-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ultra-soft); color: var(--ultra); }
.mega-aside { background: var(--ink); color: #D9DBF7; border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.mega-aside::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: repeating-linear-gradient(90deg, rgba(255,176,32,.35) 0 22px, transparent 22px 34px); }
.mega-aside .btn { position: relative; z-index: 1; margin-bottom: 12px; }
.mega-aside p { margin: 0; font-size: .88rem; }
.mega-aside .mega-aside-title { color: #fff; font-weight: 650; font-size: 1rem; }
.mega-aside .btn { align-self: flex-start; margin-top: auto; }
.nav-cta { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.nav-mobile { display: none; }
@media (max-width: 1000px) {
  .nav-desktop, .nav-cta { display: none; }
  .nav-mobile { display: block; margin-left: auto; }
}
.nav-mobile > summary { list-style: none; cursor: pointer; padding: 9px; border: 1px solid var(--line-strong); border-radius: 10px; display: inline-flex; background: var(--paper); }
.nav-mobile > summary::-webkit-details-marker { display: none; }
.m-panel { position: absolute; left: 0; right: 0; top: 72px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: var(--space-4) var(--space-5) var(--space-5); max-height: calc(100vh - 72px); overflow-y: auto; }
.m-group { border-bottom: 1px solid var(--line); }
.m-group > summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 650; display: flex; justify-content: space-between; }
.m-group > summary::after { content: "+"; color: var(--ultra); }
.m-group[open] > summary::after { content: "-"; }
.m-group > summary::-webkit-details-marker { display: none; }
.m-group ul { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 2px; }
.m-group a { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 8px; color: var(--ink); }
.m-group a .icon { color: var(--ultra); }
.m-link { display: block; padding: 14px 0; font-weight: 650; color: var(--ink); border-bottom: 1px solid var(--line); }
.m-cta { display: flex; gap: 8px; margin-top: var(--space-4); align-items: center; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--ultra); font-weight: 650; font-size: .92rem; margin-bottom: var(--space-3); }
.eyebrow::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--beacon); }

/* Hero */
.hero { position: relative; padding: var(--space-8) 0 var(--space-7); overflow: hidden; }
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: var(--space-7); align-items: center; }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1, .display { font-family: var(--display); font-weight: 600; font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: var(--space-5); }
.lead { font-size: 1.17rem; color: var(--text-muted); max-width: 600px; }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); }
.hero-note { margin-top: var(--space-4); font-size: .9rem; color: var(--text-dim); }
.hero-sub { position: relative; padding: var(--space-8) 0 calc(var(--space-6) + 40px); background: linear-gradient(180deg, #E9EBF8, var(--mist)); }
.hero-sub::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: var(--ultra-soft); -webkit-mask: linear-gradient(#000 0 0) bottom / 100% 16px no-repeat, repeating-linear-gradient(90deg, #000 0 64px, transparent 64px 96px) top / 100% 14px no-repeat; mask: linear-gradient(#000 0 0) bottom / 100% 16px no-repeat, repeating-linear-gradient(90deg, #000 0 64px, transparent 64px 96px) top / 100% 14px no-repeat; }
.hero-sub h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.5rem); letter-spacing: -0.03em; line-height: 1.05; max-width: 860px; }

/* The rampart: signature hero illustration */
.rampart { position: relative; }
.rampart svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 40px rgba(20, 22, 58, .22)); }
.rampart-caption { margin-top: var(--space-3); font-size: .82rem; color: var(--text-dim); text-align: right; }
.rp-sky { fill: var(--ink); }
.rp-wall { fill: var(--ultra); }
.rp-wall-dark { fill: var(--ultra-deep); }
.rp-brick { stroke: rgba(255, 255, 255, .09); stroke-width: 1.5; }
.rp-merlon-label { fill: #fff; font: 600 13px var(--font); }
.rp-merlon-sub { fill: #C9CCF5; font: 500 10.5px var(--font); }
.rp-ok { fill: #3DDC97; }
.rp-warn { fill: var(--beacon); }
.rp-bad { fill: #FF5C7A; }
.rp-beacon { fill: var(--beacon); }
.rp-glow { fill: var(--beacon); opacity: .22; }
.rp-gate { fill: var(--ink); }
.rp-star { fill: #fff; opacity: .5; }
.rp-scan { stroke: var(--beacon); stroke-width: 2; stroke-dasharray: 4 6; opacity: .8; }
.rp-card { fill: #fff; }
.rp-card-title { fill: var(--ink); font: 650 13px var(--font); }
.rp-card-text { fill: #555B7A; font: 500 11px var(--font); }
@media (prefers-reduced-motion: no-preference) {
  .rp-glow { animation: beacon 2.8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
  .logo-beacon { animation: none; }
}
@keyframes beacon { 0%, 100% { opacity: .12; transform: scale(.85); } 50% { opacity: .35; transform: scale(1.15); } }

/* Product illustrations (class-styled SVG, CSP-safe) */
.product-art { margin: 0 0 var(--space-5); }
.product-art svg { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.pa-bg { fill: var(--surface-2); }
.pa-panel { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.pa-row { fill: var(--surface-2); }
.pa-title { fill: var(--ink); font: 650 18px var(--font); }
.pa-muted { fill: var(--text-dim); font: 500 12px var(--font); }
.pa-row-label { fill: var(--ink-2); font: 550 13px var(--font); }
.pa-row-note { font: 600 12px var(--font); }
.pa-dot { }
.pa-ok { fill: var(--success); } .pa-ok-t { fill: var(--success); }
.pa-warn { fill: var(--warning); } .pa-warn-t { fill: var(--warning); }
.pa-bad { fill: var(--danger); } .pa-bad-t { fill: var(--danger); }
.pa-ultra-dot { fill: var(--ultra); }
.pa-chip { }
.pa-chip-bad { fill: #FCE8EB; } .pa-chip-warn { fill: #FFF3D9; } .pa-chip-ok { fill: #E4F5EE; }
.pa-chip-t { fill: var(--ink-2); font: 600 11px var(--font); }
.pa-grid { stroke: var(--line); stroke-width: 1; }
.pa-area { fill: var(--ultra-soft); opacity: .8; }
.pa-plot { fill: none; stroke: var(--ultra); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pa-plot-dot { fill: var(--ultra); }
.pa-bar { fill: var(--ultra-soft); }
.pa-bar-bad { fill: #F6B8C3; }
.pa-bar2 { fill: var(--ultra); opacity: .85; }
.pa-flow { fill: none; stroke: var(--ultra); stroke-width: 2.5; opacity: .5; }
.pa-flow-ok { stroke: var(--success); opacity: .9; }
.pa-flow-bad { stroke: var(--danger); opacity: .8; stroke-dasharray: 3 5; }
.pa-flow-warn { stroke: var(--warning); opacity: .8; stroke-dasharray: 3 5; }
.pa-gate { fill: var(--ink); }
.pa-gate-mark { fill: none; stroke: #7CF0C0; stroke-width: 3; stroke-linejoin: round; }
.pa-gate-t { fill: #fff; font: 650 14px var(--font); }
.pa-origin { fill: #fff; stroke: var(--line-strong); stroke-width: 1.5; }
.pa-origin-bar { fill: var(--surface-3); }
.pa-brandbar { fill: var(--ultra); }
.pa-textline { fill: var(--surface-3); }

.grid-art { align-items: center; gap: var(--space-7); }
.grid-art .product-art { margin: 0; }

/* Sections */
.section { padding: var(--space-8) 0; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--ink); color: #C9CCF5; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 680px; margin-bottom: var(--space-6); }
.section-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); letter-spacing: -0.025em; line-height: 1.1; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.feature { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); color: var(--ink); }
a.feature:hover { text-decoration: none; border-color: var(--ultra); box-shadow: var(--shadow); }
.feature > .icon { width: 40px; height: 40px; padding: 9px; border-radius: 11px; background: var(--ultra-soft); color: var(--ultra); margin-bottom: var(--space-4); }
.feature h3 { margin-bottom: var(--space-2); }
.feature p { color: var(--text-muted); margin: 0; }
.feature ul { color: var(--text-muted); padding-left: 18px; margin: var(--space-3) 0 0; }

/* Product rows - alternating, each with its own small visual */
.product-rows { display: grid; gap: var(--space-5); }
.product-row { display: grid; grid-template-columns: 220px 1fr auto; gap: var(--space-6); align-items: center; padding: var(--space-5) var(--space-6); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.product-row h3 { font-family: var(--display); font-weight: 600; font-size: 1.45rem; letter-spacing: -0.02em; margin: 0; display: flex; gap: 10px; align-items: center; }
.product-row h3 .icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--ultra); color: #fff; }
.product-row p { margin: 0; color: var(--text-muted); max-width: 560px; }
.product-row ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.product-row li { font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--surface-3); border-radius: 999px; padding: 3px 10px; }
@media (max-width: 860px) { .product-row { grid-template-columns: 1fr; gap: var(--space-3); } }

/* Steps (a genuine sequence) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-5); grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.steps::before { content: ""; position: absolute; left: 22px; right: 22px; top: 21px; height: 2px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 8px, transparent 8px 14px); }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps::before { display: none; } }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; position: relative; padding-top: 62px; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 44px; height: 44px; display: grid; place-items: center; font: 600 1.2rem/1 var(--display); color: var(--ink); background: var(--beacon); border-radius: 12px; }
.steps h3 { margin-bottom: var(--space-2); }
.steps p { margin: 0; }
.section-dark .steps p { color: #B9BCE8; }

.check-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.check-grid li { display: flex; gap: 12px; align-items: flex-start; padding: var(--space-4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.check-grid li .icon { color: var(--ultra); margin-top: 2px; }
.check-grid strong { display: block; }
.check-grid span span { color: var(--text-muted); font-size: .92rem; }
@media (max-width: 640px) { .check-grid { grid-template-columns: 1fr; } }

.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.trust-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); }
.trust-list .icon { color: var(--ultra); margin-top: 3px; }
.section-dark .trust-list li { color: #C9CCF5; }
.section-dark .trust-list .icon { color: var(--beacon); }

.preview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; color: var(--text-dim); }
.preview-dots { display: flex; gap: 6px; } .preview-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.preview-body { padding: var(--space-4); display: grid; gap: var(--space-3); }
.preview-label { font-size: .75rem; color: var(--warning); background: var(--beacon-soft); border-radius: 999px; padding: 1px 8px; }
.preview-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .9rem; }

.cta-band { position: relative; overflow: hidden; background: var(--ultra); color: #E3E2FF; border-radius: var(--radius-lg); padding: var(--space-7) var(--space-6); text-align: center; }
.cta-band::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: var(--ultra-deep); -webkit-mask: linear-gradient(#000 0 0) bottom / 100% 26px no-repeat, repeating-linear-gradient(90deg, #000 0 56px, transparent 56px 84px) top / 100% 18px no-repeat; mask: linear-gradient(#000 0 0) bottom / 100% 26px no-repeat, repeating-linear-gradient(90deg, #000 0 56px, transparent 56px 84px) top / 100% 18px no-repeat; }
.cta-band h2 { color: #fff; font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.7rem); letter-spacing: -0.025em; }
.cta-band .lead { color: #D6D5FF; }
.cta-band .btn-primary { background: var(--beacon); color: var(--ink); box-shadow: none; }
.cta-band .btn-primary:hover { background: #FFC24D; color: var(--ink); }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.cta-band > * { position: relative; }

.faq details { border-bottom: 1px solid var(--line); padding: var(--space-4) 0; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; font-size: 1.05rem; }
.faq summary::after { content: "+"; color: var(--ultra); font-weight: 700; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "-"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { color: var(--text-muted); margin: var(--space-3) 0 0; max-width: 720px; }
.compare td:first-child { color: var(--text-muted); }

.billing-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: var(--space-5); background: var(--paper); }
.billing-toggle a { padding: 6px 14px; border-radius: 999px; color: var(--text-muted); font-weight: 600; font-size: .9rem; }
.billing-toggle a[aria-current="true"] { background: var(--ink); color: #fff; }
.billing-toggle a:hover { text-decoration: none; }
.plan { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); }
.plan.featured { border: 2px solid var(--ultra); box-shadow: var(--shadow); }
.plan h3 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; }
.plan .price { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.035em; margin: var(--space-3) 0 0; color: var(--ink); }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: var(--space-5) 0; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; color: var(--ink-2); }
.plan li .icon { color: var(--ultra); margin-top: 3px; }
.plan .btn { width: 100%; }

.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-7); padding: var(--space-7) var(--space-5); }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; position: sticky; top: 96px; }
.docs-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-muted); font-weight: 500; }
.docs-nav a[aria-current="page"] { background: var(--ultra-soft); color: var(--ultra); }
.prose { max-width: 740px; }
.prose h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 1.5rem + 1.6vw, 2.8rem); letter-spacing: -0.03em; }
.prose h2 { margin-top: var(--space-6); }
.prose h3 { margin-top: var(--space-5); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.draft-banner { border: 1px dashed #E0B04A; background: var(--beacon-soft); color: #6B4200; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: var(--space-5); font-size: .92rem; }
.error-page { padding: var(--space-8) var(--space-5); max-width: 720px; }
.error-page.error-page-app { padding: 0; }
.error-page h1 { font-family: var(--display); font-weight: 600; font-size: 2.6rem; }

.site-footer { position: relative; background: var(--ink); color: #A9ADD6; margin-top: var(--space-8); padding: var(--space-7) 0 var(--space-5); }
.footer-wall { position: absolute; left: 0; right: 0; top: -22px; height: 22px; background: repeating-linear-gradient(90deg, var(--ink) 0 64px, transparent 64px 96px); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: var(--space-6); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p { margin: var(--space-4) 0; max-width: 300px; }
.footer-grid h3 { font-size: .9rem; color: #fff; margin-bottom: var(--space-3); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a:not(.btn):not(.brand) { color: #A9ADD6; font-size: .93rem; }
.footer-grid a:not(.btn):not(.brand):hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: var(--space-6); padding-top: var(--space-4); font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* ---------- Auth ---------- */
body.auth { min-height: 100vh; background: linear-gradient(180deg, var(--ink) 0 280px, var(--mist) 280px); }
.auth-main { max-width: 470px; margin: 0 auto; padding: var(--space-7) var(--space-4); }
.auth-brand { margin-bottom: var(--space-6); color: #fff; }
.auth-brand:hover { color: #fff; }
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-lg); }
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 1.9rem; letter-spacing: -0.02em; }
.auth-card .btn-primary { width: 100%; }
.auth-foot { text-align: center; font-size: .85rem; margin-top: var(--space-5); }
.auth-alt { text-align: center; margin: var(--space-4) 0 0; color: var(--text-muted); font-size: .93rem; }
body.auth > main > .notice { margin-bottom: var(--space-4); }

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--ink) 252px, var(--mist) 252px); }
.sidebar { background: var(--ink); padding: var(--space-5) var(--space-3); display: flex; flex-direction: column; gap: var(--space-5); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 0 var(--space-3); color: #fff; }
.side-nav ul, .app-nav-mobile ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.side-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; color: #A9ADD6; font-weight: 500; font-size: .94rem; position: relative; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.side-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--beacon); }
.side-nav a.active .icon { color: var(--beacon); }
.side-foot { margin-top: auto; display: grid; gap: 2px; }
.side-foot a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; font-size: .9rem; color: #8F93C2; }
.side-foot a:hover { color: #fff; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: var(--space-4); padding: 10px var(--space-5); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.topbar-org { flex: 1; min-width: 0; }
.org-name { font-weight: 650; }
.org-switch select { min-height: 36px; padding: 4px 10px; width: auto; max-width: 260px; }
.topbar-user { display: flex; align-items: center; gap: var(--space-3); }
.app-content { padding: var(--space-6) var(--space-6) var(--space-7); max-width: 1320px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.7rem; letter-spacing: -0.02em; }
.page-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: flex; gap: 8px; font-size: .88rem; color: var(--text-dim); flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.breadcrumbs a { color: var(--text-muted); }
.app-nav-mobile { display: none; position: relative; }
.app-nav-mobile > summary { list-style: none; cursor: pointer; padding: 8px; border: 1px solid var(--line-strong); border-radius: 9px; display: inline-flex; }
.app-nav-mobile > summary::-webkit-details-marker { display: none; }
.app-nav-mobile > nav { position: absolute; left: 0; top: calc(100% + 8px); width: min(300px, 90vw); background: var(--ink); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow-lg); z-index: 40; }
.app-nav-mobile a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; color: #C9CCF5; }
.app-nav-mobile a.active { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; background: var(--mist); }
  .sidebar { display: none; }
  .app-nav-mobile { display: block; }
  .user-email { display: none; }
}
@media (max-width: 640px) { .app-content { padding: var(--space-4); } .topbar { padding: 8px var(--space-4); } }

.site-list { display: grid; gap: var(--space-3); }
.site-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) auto; gap: var(--space-4); align-items: center; padding: var(--space-4) var(--space-5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.site-row .host { font-weight: 650; word-break: break-all; }
@media (max-width: 860px) { .site-row { grid-template-columns: 1fr 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-5); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 3px; background: var(--paper); border: 2px solid var(--ultra); }
.timeline pre { margin: 6px 0 0; white-space: pre-wrap; font-size: .85rem; color: var(--text-muted); }

dialog.confirm-dialog { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); max-width: 440px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
dialog.confirm-dialog::backdrop { background: rgba(20, 22, 58, .5); }
dialog.confirm-dialog p { margin-bottom: var(--space-5); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .site-header, .site-footer, .no-print, .banner { display: none !important; }
  .app-shell { display: block; }
  .card, .stat, .finding, .table-wrap { box-shadow: none; }
}

/* ---------- Platform admin ---------- */
.admin-search { margin-bottom: var(--space-4); }
.admin-search input { max-width: 360px; }
.admin-message { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.admin-message:last-of-type { border-bottom: 0; }
.admin-message p { margin: var(--space-3) 0; white-space: pre-wrap; }

/* Operator announcements & admin operations */
.banner-critical { background: #FDE8E8; color: #7A1010; }
.banner-critical .icon { color: #B42318; }
.announcement { justify-content: center; text-align: center; }
.admin-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-5); }
.admin-inline { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.admin-inline .field { margin: 0; min-width: 140px; }
.admin-json { max-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: .8rem; }
.admin-danger-zone { border: 1px solid #F3B8B8; border-radius: var(--radius); padding: var(--space-5); }

/* Shield DNS setup: stacked record cards - long names/values wrap, never scroll sideways. */
.dns-setup { min-width: 0; }
.dns-records { display: grid; gap: var(--space-3); margin: var(--space-3) 0; min-width: 0; }
.dns-rec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: var(--space-3) var(--space-4); min-width: 0; }
.dns-rec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.dns-rec-purpose { flex: 1 1 12rem; min-width: 0; font-size: .9rem; color: var(--text-muted); }
.dns-rec-row { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px dashed var(--line); }
.dns-rec-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.dns-rec-val { min-width: 0; overflow-wrap: anywhere; word-break: break-all; font-size: .88rem; }
.dcv-check { margin-top: var(--space-4); display: grid; gap: 8px; }
.dcv-check-title { font-weight: 600; }
@media (max-width: 520px) {
  .dns-rec-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dns-rec-label { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------------
   Shield: setup stepper, live status, dashboard, protection toggles
   --------------------------------------------------------------------------- */
.stepper { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); counter-reset: step; }
.step { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); min-width: 0; transition: border-color .2s, background .2s; }
.step-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--paper); border: 2px solid var(--line-strong); color: var(--text-muted); }
.step-text { display: grid; min-width: 0; }
.step-label { font-weight: 600; color: var(--ink); }
.step-sub { font-size: .8rem; color: var(--text-muted); overflow-wrap: anywhere; }
.step-done { background: #EEF9F4; border-color: #BFE5D5; }
.step-done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step-current { background: var(--ultra-soft); border-color: var(--ultra); box-shadow: 0 0 0 3px rgba(47, 43, 224, .08); }
.step-current .step-dot { border-color: var(--ultra); color: var(--ultra); }
@media (max-width: 720px) { .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card-steps .card-body { padding-bottom: var(--space-3); }
.card-focus { border-color: var(--ultra); box-shadow: 0 0 0 3px rgba(47, 43, 224, .07), var(--shadow-sm); }
.card-compact .card-body { padding: var(--space-4) var(--space-5); }
.origin-row { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; }
.origin-row .field { flex: 1 1 260px; margin-bottom: 0; }
.origin-row .btn { margin-bottom: 2px; }
.advanced { margin-top: var(--space-3); }
.advanced summary { cursor: pointer; }
.origin-test { margin-top: var(--space-4); }
.notice-hint { margin-top: 6px; }
.notice-action { margin-top: 10px; }
.setup-footer { margin-top: var(--space-4); justify-content: space-between; }
.disconnect-line { margin-top: var(--space-5); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.disconnect-line form { display: inline; }

.live-check { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .88rem; flex: 1 1 300px; }
.pulse { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: 0; }
.live-check .pulse { background: var(--ultra); }
.live-check .pulse::after { border-color: var(--ultra); }
@media (prefers-reduced-motion: no-preference) { .pulse::after { animation: pulse-ring 1.8s ease-out infinite; } }
@keyframes pulse-ring { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.8); opacity: 0; } }

.shield-hero { display: flex; gap: var(--space-5); align-items: flex-start; margin-bottom: var(--space-5); }
.shield-hero h2 { margin: 0 0 6px; font-size: 1.25rem; }
.shield-hero-icon { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--ultra); background: linear-gradient(135deg, var(--ultra-soft), #fff); border: 1px solid #D9D7FF; }
@media (max-width: 560px) { .shield-hero { flex-direction: column; } }

.shield-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px; font-weight: 650; font-size: .9rem; }
.status-live { background: #EEF9F4; color: var(--success); border: 1px solid #BFE5D5; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg a { padding: 4px 10px; border-radius: 7px; color: var(--text-muted); font-size: .85rem; font-weight: 550; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a[aria-current="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.shield-stats { margin-bottom: var(--space-5); }

.traffic-chart { margin: 0; }
.traffic-chart svg { width: 100%; height: 220px; display: block; }
.traffic-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.traffic-chart .axis { fill: var(--text-dim); font-size: 12px; }
.traffic-chart .bar-req { fill: #C9C7FA; }
.traffic-chart g:hover .bar-req { fill: var(--ultra); }
.traffic-chart .bar-threat { fill: var(--danger); }
.chart-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); margin-top: 8px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; }
.lg-req { background: #C9C7FA; } .lg-threat { background: var(--danger); }
.chart-empty-state { display: grid; justify-items: center; gap: 6px; padding: var(--space-6) var(--space-4); color: var(--line-strong); text-align: center; }

.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toplist li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(40px, 1fr) auto; gap: 10px; align-items: center; font-size: .9rem; }
.toplist-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist-bar { display: block; width: 100%; height: 8px; }
.toplist-track { fill: var(--surface-3); }
.toplist-fill { fill: var(--ultra); }
.toplist-n { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 720px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-card { position: relative; display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:hover { border-color: var(--line-strong); }
.mode-card:has(input:checked) { border-color: var(--ultra); box-shadow: 0 0 0 3px rgba(47, 43, 224, .1); }
.mode-card:has(input:focus-visible) { outline: 2px solid var(--ultra); outline-offset: 2px; }
.mode-title { font-weight: 650; color: var(--ink); }

.toggle-row { display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle-row:first-child { border-top: 0; padding-top: 0; }
.toggle-row:last-child { padding-bottom: 0; }
.toggle-text { min-width: 0; }
.toggle-title { font-weight: 600; color: var(--ink); cursor: pointer; }
.toggle-row select { max-width: 11rem; }
.switch { position: relative; flex: none; width: 44px; height: 26px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 22, 58, .25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--ultra); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--ultra); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-track { opacity: .5; }
.toggle-danger .switch input:checked + .switch-track { background: var(--danger); }
.sticky-save { position: sticky; bottom: 0; padding: var(--space-3) 0; margin-top: var(--space-4); background: linear-gradient(to top, var(--mist) 70%, transparent); z-index: 2; }
.protection-form .card + .card { margin-top: var(--space-4); }

.event-list { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; padding-top: 0; }
.event-when { grid-row: span 2; color: var(--text-muted); font-size: .85rem; }
.event-main { min-width: 0; overflow-wrap: anywhere; }
.event-path { color: var(--text-muted); }
.event-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .event { grid-template-columns: 1fr; } .event-when { grid-row: auto; } }
.empty-mini { text-align: center; padding: var(--space-5) var(--space-4); }
.fieldset-plain { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.copy-btn.is-copied { color: var(--success); border-color: #BFE5D5; }

/* ---------------------------------------------------------------------------
   Scan in progress: radar sweep + stage checklist
   --------------------------------------------------------------------------- */
.scan-live { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--space-6); align-items: center; }
@media (max-width: 640px) { .scan-live { grid-template-columns: 1fr; justify-items: center; } }
.radar { position: relative; width: 168px; height: 168px; border-radius: 50%; background: radial-gradient(circle, #fff 0 22%, var(--ultra-soft) 23% 24%, #fff 25% 47%, var(--ultra-soft) 48% 49%, #fff 50% 72%, var(--ultra-soft) 73% 74%, #F7F7FF 75%); border: 1px solid #D9D7FF; overflow: hidden; }
.radar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(47, 43, 224, .32), rgba(47, 43, 224, 0) 70deg, transparent 360deg); }
.radar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ultra); box-shadow: 0 0 0 4px rgba(47, 43, 224, .15); }
.radar .blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ultra); opacity: 0; }
.radar .b1 { left: 30%; top: 26%; } .radar .b2 { left: 68%; top: 40%; } .radar .b3 { left: 44%; top: 72%; }
@media (prefers-reduced-motion: no-preference) {
  .radar::before { animation: radar-sweep 2.4s linear infinite; }
  .radar .blip { animation: blip 2.4s ease-out infinite; }
  .radar .b2 { animation-delay: .8s; } .radar .b3 { animation-delay: 1.6s; }
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 60% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(1); } }
.scan-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scan-stages li { display: flex; gap: 10px; align-items: center; color: var(--text-dim); transition: color .2s; }
.scan-stages li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); box-sizing: border-box; transition: all .2s; }
.scan-stages li.is-done { color: var(--text-muted); }
.scan-stages li.is-done::before { background: var(--success); border-color: var(--success); box-shadow: inset 0 0 0 3px #fff; }
.scan-stages li.is-active { color: var(--ink); font-weight: 600; }
.scan-stages li.is-active::before { border-color: var(--ultra); border-right-color: transparent; }
@media (prefers-reduced-motion: no-preference) { .scan-stages li.is-active::before { animation: spin .8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-progress { display: block; width: 100%; height: 6px; margin: var(--space-3) 0; }
.scan-progress-track { fill: var(--surface-3); }
.scan-progress-fill { fill: var(--ultra); transition: width .6s ease; }
.scan-live-title { margin: 0 0 4px; font-size: 1.15rem; }

.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.dns-setup { margin-top: var(--space-4); }
.dns-setup h3 { margin: 0 0 6px; font-size: 1rem; }
.protection-form { max-width: 880px; }
.event-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.event-actions form { display: inline; }
@media (max-width: 640px) { .event-actions { grid-column: 1; } }
.shield-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 720px) { .shield-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.text-danger { color: var(--danger); }
.shield-summary + .grid, .card + .grid { margin-top: var(--space-5); }
.shield-hint { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ultra-soft); border: 1px solid #D9D7FF; font-size: .9rem; }
.shield-hint-on { background: #EEF9F4; border-color: #BFE5D5; }
.status-stale { background: var(--beacon-soft); color: var(--warning); border: 1px solid #F3D9A4; }
.status-stale .pulse { background: var(--warning); }
.status-stale .pulse::after { border-color: var(--warning); }
.setup-list { margin: 0 0 var(--space-4); padding-left: 1.3em; display: grid; gap: 8px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist li .badge { flex: none; margin-top: 2px; }

/* ---- Public status page ------------------------------------------------ */
body.standalone { min-height: 100vh; background: var(--mist); color: var(--text); }
.standalone-main { padding: var(--space-7) var(--space-4); }
.status-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-5); }
.status-head h1 { font-family: var(--display); font-size: 2rem; margin: 0; overflow-wrap: anywhere; }
.status-head p { margin: 4px 0 0; overflow-wrap: anywhere; }
.status-now { display: flex; gap: var(--space-4); align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--text-dim); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.status-now p { margin: 4px 0 0; color: var(--text-muted); }
.status-now strong { font-size: 1.15rem; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--text-dim); margin-top: 6px; flex: none; }
.status-up { border-left-color: var(--success); } .status-up .status-dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent); }
.status-degraded { border-left-color: var(--warning); } .status-degraded .status-dot { background: var(--warning); }
.status-down { border-left-color: var(--danger); } .status-down .status-dot { background: var(--danger); }
.status-uptime { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.status-uptime > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.status-pct { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-bars, .status-incidents { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.status-bars h2, .status-incidents h2 { font-size: 1rem; margin: 0 0 var(--space-3); }
.status-incidents ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.status-incidents li { border-top: 1px solid var(--line); padding-top: var(--space-3); }
.status-incidents li:first-child { border-top: 0; padding-top: 0; }
.status-foot { text-align: center; }
.status-foot a { display: inline-flex; align-items: center; gap: 4px; }
.status-logo { width: 16px; height: 16px; }
@media (max-width: 560px) { .status-uptime { grid-template-columns: repeat(2, minmax(0, 1fr)); } .status-head h1 { font-size: 1.6rem; } }
.wrap-any { overflow-wrap: anywhere; word-break: break-word; }
.mfa-qr { margin: 12px 0; width: 200px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); } .mfa-qr svg { display: block; width: 100%; height: auto; }
.brand-logo-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.brand-logo-preview { max-height: 48px; max-width: 200px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; }
input[type=color] { min-height: 44px; padding: 4px; width: 100%; max-width: 120px; }
.status-wrap.branded .status-head { border-bottom: 3px solid var(--accent); padding-bottom: var(--space-3); }
.status-wrap.branded .status-head h1 { color: var(--accent); }
.status-brand img { max-height: 48px; max-width: 240px; object-fit: contain; display: block; }
/* Wraps a form's fields so read-only roles get them disabled (no editable inputs without a Save). */
.fieldset-wrap { border: 0; padding: 0; margin: 0; min-width: 0; background: none; }
