:root {
  --bg: #fdf8f5;
  --bg-soft: #faf1ec;
  --surface: #ffffff;
  --ink: #1d1915;
  --ink-2: #4a433c;
  --ink-3: #8a8178;
  --ink-4: #b8afa6;
  --line: #efe6de;
  --line-2: #e5dacf;
  --coral: #ff6a55;
  --coral-hover: #ff5339;
  --coral-soft: #ffe7e1;
  --coral-soft-2: #ffd6cc;
  --peach: #ffd8b5;
  --mint: #3ec29a;
  --mint-soft: #d8f3e9;
  --amber: #f5a623;
  --amber-soft: #ffeccd;
  --red: #e4453a;
  --red-soft: #fde1df;
  --violet: #6b5ce7;
  --violet-soft: #e7e3fb;
  --sky: #4a9ee8;
  --sky-soft: #e0eefa;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(29,25,21,.04), 0 2px 6px rgba(29,25,21,.04);
  --shadow-md: 0 4px 14px rgba(29,25,21,.06), 0 12px 32px rgba(29,25,21,.06);
  --shadow-lg: 0 10px 30px rgba(29,25,21,.08), 0 30px 60px rgba(29,25,21,.08);
  --shadow-coral: 0 10px 26px rgba(255,106,85,.28);
  /* Aliases — several templates reference these names; var() resolves on
     the same element (html) so they track the active theme automatically. */
  --bg-card: var(--surface);
  --text-muted: var(--ink-3);
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-soft: #181c24;
  --surface: #1e2230;
  --ink: #f0ece8;
  --ink-2: #c8c0b8;
  --ink-3: #8a8690;
  --ink-4: #575360;
  --line: #2a2f3e;
  --line-2: #343a4c;
  --coral: #ff7a65;
  --coral-hover: #ff6150;
  --coral-soft: #3a1e1a;
  --coral-soft-2: #4a2620;
  --peach: #5a3a20;
  --mint: #3ec29a;
  --mint-soft: #0e2e22;
  --amber: #f5a623;
  --amber-soft: #2e2010;
  --red: #ff5a52;
  --red-soft: #2e1210;
  --violet: #8b7cf0;
  --violet-soft: #1e1a3a;
  --sky: #5ab0f0;
  --sky-soft: #0e1e30;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.2);
  --shadow-md: 0 4px 14px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.4), 0 30px 60px rgba(0,0,0,.4);
  --shadow-coral: 0 10px 26px rgba(255,122,101,.3);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* App shell — left sidebar + topbar strip (replaces the old horizontal nav). */
.app-shell { display: flex; min-height: 100vh; }
.nav-logo { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }

/* Sidebar */
.sidebar {
  width: 256px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar-nav { flex: 1; padding: 16px 12px 24px; overflow-y: auto; }
.sidebar-group { margin-bottom: 20px; }
.sidebar-group:last-child { margin-bottom: 0; }
.sidebar-group-title {
  padding: 0 12px 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-4);
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-link:hover { color: var(--ink); background: rgba(29,25,21,.05); }
.sidebar-link.active { color: var(--coral); background: var(--coral-soft); font-weight: 700; }
.sidebar-link-disabled { color: var(--ink-4); cursor: default; }
.sidebar-link-disabled:hover { background: none; color: var(--ink-4); }
.sidebar-backdrop { display: none; }

/* Topbar strip — lang/theme/user pill, plus the mobile hamburger */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 14px 32px;
  background: rgba(253,248,245,.86);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.topbar.scrolled { border-color: var(--line-2); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
/* Auth pages (login/register/reset): brand left, toggles right, no sidebar/footer. */
.auth-topbar { justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.auth-brand .nav-env-chip { margin-left: 2px; }

.app-main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Hamburger — mobile-only sidebar toggle, hidden on desktop */
.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 4px; border-radius: 6px;
  transition: background .15s;
  margin-right: auto;
}
.nav-hamburger:hover { background: var(--bg-soft); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s; border: none; text-decoration: none; }
.btn-primary { background: var(--coral); color: white; box-shadow: var(--shadow-coral); }
.btn-primary:hover { background: var(--coral-hover); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { background: #2d2820; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 80px 48px 0; min-height: 580px; background: var(--bg); }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255,106,85,.12), transparent); pointer-events: none; }
.hero-inner { position: relative; max-width: 860px; margin: 0 auto; text-align: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--coral-soft); border: 1px solid var(--coral-soft-2); border-radius: var(--radius-pill); padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--coral); margin-bottom: 24px; }
.hero-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.85)} }
.hero h1 { font-size: 72px; font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 20px; color: var(--ink); }
.hero h1 .accent { color: var(--coral); }
.hero .lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 600px; margin: 0 auto 36px; }

/* Tabs */
.tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); width: fit-content; margin-left: auto; margin-right: auto; }
.tab { position: relative; display: flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-3); transition: all .15s; border: none; background: none; }
.tab.active { background: var(--bg-soft); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab.disabled { opacity: 0.5; cursor: not-allowed; }
.coming { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; background: var(--amber-soft); color: var(--amber); border-radius: 4px; padding: 2px 5px; }

/* Search shell */
.search-shell { display: flex; align-items: stretch; background: white; border: 1.5px solid var(--line-2); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); overflow: hidden; margin-bottom: 20px; gap: 0; }
.search-input-wrap { flex: 1; display: flex; align-items: center; gap: 12px; padding: 6px 16px; }
.search-input { border: none; outline: none; background: none; font-size: 15px; color: var(--ink); flex: 1; min-width: 0; }
.search-input::placeholder { color: var(--ink-4); }
.search-platform { display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--bg-soft); flex-shrink: 0; }
.search-platform.github { background: #f3f0ec; color: #1d1915; }
.search-platform.gitlab { background: #fde8dc; color: #e24329; }
.search-platform.bitbucket { background: #e3ecfd; color: #0052cc; }
.search-platform.npm { background: #fde3e3; color: #cb0000; }
.search-platform.generic { background: var(--bg-soft); color: var(--ink-3); }
.search-divider { width: 1px; background: var(--line); margin: 12px 0; }
.search-meta { padding: 0 20px; display: flex; align-items: center; min-width: 120px; }
.search-meta-label { font-size: 11px; color: var(--ink-4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.search-meta-value { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.search-submit { border-radius: 0 calc(var(--radius-xl) - 2px) calc(var(--radius-xl) - 2px) 0; padding: 0 28px; font-size: 15px; box-shadow: none; }
.search-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; margin-bottom: 0; font-size: 13px; }
.hint-chip { display: inline-flex; align-items: center; gap: 6px; background: white; border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 5px 12px; cursor: pointer; transition: all .15s; font-size: 12px; color: var(--ink-2); }
.hint-chip:hover { border-color: var(--coral-soft-2); background: var(--coral-soft); color: var(--coral); }

/* Stats strip */
.stats-strip { max-width: 860px; margin: 48px auto 0; padding: 0 0 64px; display: flex; gap: 0; justify-content: center; }
.stat { flex: 1; text-align: center; padding: 0 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat-num { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.stat-num .unit { font-size: 20px; color: var(--ink-3); }
.stat-label { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-top: 4px; }

/* Featured / grid */
.featured { max-width: 1200px; margin: 0 auto; padding: 64px 48px 80px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.section-head h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.section-head p { font-size: 14px; color: var(--ink-3); margin: 0; max-width: 440px; }
.section-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill { padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-3); border: 1.5px solid transparent; transition: all .15s; background: none; }
.filter-pill:hover { color: var(--ink); background: var(--bg-soft); }
.filter-pill.active { color: var(--coral); background: var(--coral-soft); border-color: var(--coral-soft-2); }

/* Scan cards grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.scan-card { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-sm); }
.scan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.scan-card-thumb { position: relative; height: 160px; overflow: hidden; }
.scan-card-thumb canvas { width: 100%; height: 100%; display: block; }
.thumb-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.thumb-badge { background: rgba(255,255,255,.92); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; display: flex; align-items: center; gap: 4px; }
.score-ring-big { position: absolute; bottom: 12px; right: 12px; }
.scan-card-body { padding: 16px 18px 20px; }
.scan-repo { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.scan-repo-owner { border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.scan-repo-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.scan-repo-name .owner { color: var(--ink-3); font-weight: 500; }
.scan-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.scan-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.findings-row { display: flex; gap: 6px; flex-wrap: wrap; }
.finding-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-pill); padding: 3px 10px; font-size: 11px; font-weight: 700; }
.finding-pill.crit { background: var(--red-soft); color: var(--red); }
.finding-pill.high { background: #fff0e0; color: #e06000; }
.finding-pill.med { background: var(--amber-soft); color: var(--amber); }
.finding-pill.low { background: var(--bg-soft); color: var(--ink-3); }
.finding-pill.clean { background: var(--mint-soft); color: var(--mint); }

/* Footer */
.footer-full { background: var(--ink); color: white; padding: 72px 48px 40px; margin-top: 80px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .nav-logo { cursor: default; }
.footer-tagline { margin: 10px 0 18px; color: rgba(255,255,255,.6); font-size: 14px; max-width: 280px; line-height: 1.55; }
.footer-social { display: flex; gap: 8px; }
.social-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); transition: all .15s; }
.social-btn:hover { background: rgba(255,255,255,.2); color: white; }
.footer-col h5 { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,.45); margin: 0 0 14px; }
.footer-col a { display: block; font-size: 14px; color: rgba(255,255,255,.8); margin-bottom: 10px; font-weight: 500; transition: color .15s; }
.footer-col a:hover { color: var(--coral); }
.footer-bottom { max-width: 1200px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255,255,255,.45); flex-wrap: wrap; gap: 12px; }

/* Scan progress page */
.scan-page { max-width: 1000px; margin: 0 auto; padding: 40px 48px; display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.scan-breadcrumb { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumb-link { cursor: pointer; color: var(--coral); font-weight: 600; text-decoration: none; }
.scan-card-main { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-xl); padding: 28px; }
.scan-target-row { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.scan-target-info { flex: 1; }
.scan-target-label { font-size: 12px; font-weight: 700; color: var(--coral); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.scan-target-url { font-size: 15px; font-weight: 700; color: var(--ink); font-family: 'JetBrains Mono', monospace; }
.scan-type-badge { background: var(--coral-soft); color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; border-radius: var(--radius-pill); padding: 4px 10px; }
.scan-stage { min-height: 240px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.scan-progress-bar { height: 6px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 10px; }
.scan-progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--coral), #ff9280); border-radius: var(--radius-pill); transition: width .5s ease; }
.scan-progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.scan-progress-label .percent { font-weight: 700; color: var(--coral); font-variant-numeric: tabular-nums; }
.scan-subtle { font-size: 13px; color: var(--ink-4); text-align: center; }
.scan-subtle kbd { background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: monospace; }
.scan-side { display: flex; flex-direction: column; gap: 12px; }
.mini-card { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.mini-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 8px; }
.mini-val { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.mini-sub { font-size: 12px; color: var(--ink-4); margin-top: 4px; }

/* Radar animation */
.radar { position: relative; width: 220px; height: 220px; }
.radar-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,106,85,.2); top: 50%; left: 50%; transform: translate(-50%, -50%); width: 180px; height: 180px; }
.radar-ring.r2 { width: 130px; height: 130px; }
.radar-ring.r3 { width: 80px; height: 80px; border-color: rgba(255,106,85,.35); }
.radar-ring.r4 { width: 220px; height: 220px; border-color: rgba(255,106,85,.1); }
.radar-sweep { position: absolute; top: 50%; left: 50%; width: 90px; height: 1.5px; transform-origin: 0 50%; background: linear-gradient(90deg, var(--coral), transparent); border-radius: 2px; animation: sweep 2.4s linear infinite; }
.radar-sweep-bg { position: absolute; top: 50%; left: 50%; width: 90px; height: 90px; transform-origin: 0 100%; border-radius: 0 90px 0 0; background: conic-gradient(from 0deg, transparent 0%, rgba(255,106,85,.08) 30%, transparent 30%); animation: sweep 2.4s linear infinite; }
.radar-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; background: var(--coral); border-radius: 50%; box-shadow: 0 0 10px rgba(255,106,85,.5); }
.radar-dot { position: absolute; width: 8px; height: 8px; background: var(--coral); border-radius: 50%; opacity: 0; animation: blip 2.4s ease-out infinite; }
@keyframes sweep { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes blip { 0%,80%,100%{opacity:0} 85%{opacity:1} }

/* Report page */
.report-page { background: var(--bg-soft); min-height: 100vh; }
.report-shell { max-width: 1200px; margin: 0 auto; padding: 40px 48px; }
.report-header { display: flex; align-items: flex-start; gap: 20px; margin: 24px 0; padding: 28px; background: white; border: 1.5px solid var(--line); border-radius: var(--radius-xl); }
.report-title { flex: 1; }
.report-title .mono-url { font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--coral); margin-bottom: 6px; font-weight: 600; }
.report-title h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.report-title .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.report-title .meta .sep { color: var(--line-2); }
.report-score-block { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.report-score-labels .big { font-size: 18px; font-weight: 800; }
.report-score-labels .small { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Paywall */
.paywall-banner { background: var(--ink); border-radius: var(--radius-xl); padding: 24px 28px; display: flex; align-items: center; gap: 20px; }
.paywall-banner .lock-ico { width: 48px; height: 48px; background: rgba(255,255,255,.1); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--coral); flex-shrink: 0; }
.paywall-text { flex: 1; }
.paywall-text h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: white; }
.paywall-text p { margin: 0; color: rgba(255,255,255,.65); font-size: 14px; }
.paywall-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.btn-unlock { display: inline-flex; align-items: center; gap: 8px; background: var(--coral); color: white; border-radius: var(--radius-pill); padding: 12px 24px; font-weight: 700; font-size: 15px; cursor: pointer; transition: background .15s; border: none; }
.btn-unlock:hover { background: var(--coral-hover); }

/* Report grid */
.report-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-top: 24px; }
.report-sidebar { display: flex; flex-direction: column; gap: 16px; }
.side-card { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.side-card h4 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 0 0 14px; }
.severity-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.sev-dot { display: flex; align-items: center; gap: 8px; }
.sev-dot .d { width: 10px; height: 10px; border-radius: 50%; }
.sev-dot .d.crit { background: var(--red); }
.sev-dot .d.high { background: #e06000; }
.sev-dot .d.med { background: var(--amber); }
.sev-dot .d.low { background: var(--ink-4); }
.sev-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.category-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.category-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; transition: background .15s; }
.category-row:hover { background: var(--bg-soft); }
.category-row .n { font-weight: 700; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.report-main { min-width: 0; }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.report-main.locked .finding-card { filter: blur(5px); user-select: none; pointer-events: none; }

/* Finding cards */
.finding-card { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 14px; }
.finding-head { display: flex; gap: 14px; margin-bottom: 14px; }
.sev-badge { border-radius: var(--radius-sm); padding: 4px 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.sev-badge.crit { background: var(--red-soft); color: var(--red); }
.sev-badge.high { background: #fff0e0; color: #e06000; }
.sev-badge.med { background: var(--amber-soft); color: var(--amber); }
.sev-badge.low { background: var(--bg-soft); color: var(--ink-3); }
.finding-title h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.finding-title .category { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.finding-title .category .dot { width: 3px; height: 3px; background: var(--ink-4); border-radius: 50%; }
.finding-title .category .mono { font-family: 'JetBrains Mono', monospace; }
.finding-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.code-block { background: var(--ink); color: #e8d9c0; padding: 16px 18px; border-radius: var(--radius-md); font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.6; overflow-x: auto; margin: 0; white-space: pre-wrap; }
.finding-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.finding-tag { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 11px; font-weight: 600; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; }

/* Auth modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(29,25,21,.5); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: var(--radius-xl); padding: 32px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal-header h2 { font-size: 22px; font-weight: 800; margin: 0; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-soft); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-3); border: none; }
.modal-close:hover { background: var(--line); color: var(--ink); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.form-input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-md); font-size: 14px; color: var(--ink); background: white; transition: border-color .15s; outline: none; }
.form-input:focus { border-color: var(--coral); }
/* Django-rendered widgets ({{ field }}) carry no class attribute — bare
   inputs/selects/textareas inside a .form-group inherit the same look. */
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([class]),
.form-group textarea:not([class]) {
  width: 100%; box-sizing: border-box; padding: 11px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: var(--surface); transition: border-color .15s; outline: none;
}
.form-group textarea:not([class]) { resize: vertical; min-height: 96px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
.form-group select:not([class]) {
  width: 100%; box-sizing: border-box; padding: 10px 34px 10px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; color: var(--ink);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8178' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  appearance: none; outline: none; transition: border-color .15s;
}
.form-group input:not([class]):focus,
.form-group textarea:not([class]):focus,
.form-group select:not([class]):focus { border-color: var(--coral); }
.form-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--coral); }
.form-group ul.errorlist { list-style: none; margin: 5px 0 0; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--red); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal-tabs { display: flex; gap: 4px; background: var(--bg-soft); border-radius: var(--radius-md); padding: 4px; margin-bottom: 24px; }
.modal-tab { flex: 1; padding: 8px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; text-align: center; border: none; background: none; color: var(--ink-3); }
.modal-tab.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }

/* Inner pages */
.page-shell { max-width: 1200px; margin: 0 auto; padding: 64px 48px 120px; }
.page-shell.tight { max-width: 980px; }
.page-head { max-width: 720px; margin-bottom: 40px; }
.page-head h1 { font-size: 54px; line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 14px; font-weight: 800; }
.page-head .lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 620px; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 72px; }
.how-card { position: relative; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 24px 32px; }
.how-card .how-number { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: var(--coral); margin-bottom: 16px; }
.how-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--coral-soft); color: var(--coral); display: grid; place-items: center; margin-bottom: 18px; }
.how-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.how-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.how-arrow { position: absolute; right: -14px; top: 42px; width: 28px; height: 28px; background: white; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--ink-3); z-index: 2; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.cat-chip { background: white; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.cat-chip .cat-num { font-size: 11px; font-weight: 800; color: var(--coral); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pricing-card { background: white; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 32px 28px 28px; display: flex; flex-direction: column; position: relative; }
.pricing-card.highlight { background: var(--ink); color: white; border-color: var(--ink); }
.pricing-card.highlight .pricing-sub, .pricing-card.highlight .pricing-features { color: rgba(255,255,255,.75); }
.pricing-tag { position: absolute; top: -14px; left: 28px; border-radius: var(--radius-pill); background: var(--coral); color: white; display: inline-flex; align-items: center; padding: 4px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.pricing-name { font-weight: 700; font-size: 16px; letter-spacing: 0.02em; text-transform: uppercase; }
.pricing-price { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; }
.pricing-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.pricing-features { list-style: none; padding: 0; margin: 22px 0 8px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.pricing-features li { display: flex; align-items: center; gap: 10px; }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.founders-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.about-card { background: white; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 36px 32px; }
.about-card h3 { font-size: 22px; margin: 0 0 10px; font-weight: 700; }
.about-card p { color: var(--ink-2); font-size: 15px; line-height: 1.65; margin: 0 0 12px; }
.about-visual { background: linear-gradient(135deg, var(--coral-soft), var(--peach)); border-radius: var(--radius-xl); min-height: 300px; }

/* Auth page centering */
.auth-page { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow-md); }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-sub { font-size: 14px; color: var(--ink-3); margin: 0 0 28px; }
.auth-sub a { color: var(--coral); font-weight: 600; }

/* Dashboard */
.dashboard-shell { max-width: 1100px; margin: 0 auto; padding: 40px 48px 80px; }
.dash-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dash-title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.dash-email { font-size: 14px; color: var(--ink-3); }
.dash-balance { text-align: right; }
.dash-balance-num { font-size: 28px; font-weight: 800; color: var(--coral); }
.dash-balance-label { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.dash-tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--line); margin-bottom: 28px; }
.dash-tab { padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1.5px; transition: all .15s; background: none; border-top: none; border-left: none; border-right: none; }
.dash-tab:hover { color: var(--ink); }
.dash-tab.active { color: var(--coral); border-bottom-color: var(--coral); }
.scan-row { background: white; border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px; transition: box-shadow .15s; }
.scan-row:hover { box-shadow: var(--shadow-sm); }
.scan-row-url { font-size: 14px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', monospace; }
.scan-row-date { font-size: 12px; color: var(--ink-4); }
.status-badge { border-radius: var(--radius-pill); padding: 3px 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; flex-shrink: 0; }
.status-badge.completed { background: var(--mint-soft); color: var(--mint); }
.status-badge.running { background: var(--sky-soft); color: var(--sky); }
.status-badge.failed { background: var(--red-soft); color: var(--red); }
.status-badge.pending { background: var(--bg-soft); color: var(--ink-3); }
.status-badge.skill-risk-critical { background: var(--red-soft); color: var(--red); }
.status-badge.skill-risk-high { background: #fff0e0; color: #e06000; }
.status-badge.skill-risk-medium { background: var(--amber-soft); color: var(--amber); }
.status-badge.skill-risk-low { background: var(--mint-soft); color: var(--mint); }
.status-badge.skill-risk-safe { background: var(--mint-soft); color: var(--mint); }
.status-badge.skill-risk-unknown { background: var(--bg-soft); color: var(--ink-3); }

/* Error state */
.error-banner { background: var(--red-soft); border: 1.5px solid rgba(228,69,58,.2); border-radius: var(--radius-lg); padding: 16px 20px; display: flex; align-items: flex-start; gap: 12px; }
.error-banner .err-icon { color: var(--red); flex-shrink: 0; margin-top: 1px; }
.error-banner .err-msg { font-size: 14px; color: var(--red); font-weight: 500; }

/* ============================================================
   RESPONSIVE — 3 breakpoints: 1024 / 768 / 480
   ============================================================ */

/* ── Tablet (≤1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Nav */
  .nav { padding: 14px 28px; gap: 12px; }

  /* Hero */
  .hero { padding: 60px 32px 0; }
  .hero h1 { font-size: 54px; }

  /* Featured / scan grid */
  .featured { padding: 48px 32px 64px; }
  .grid { grid-template-columns: repeat(2, 1fr); }

  /* How-it-works */
  .how-grid { grid-template-columns: repeat(2, 1fr); }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }

  /* About / founders */
  .about-grid { grid-template-columns: 1fr; }
  .founders-grid { grid-template-columns: 1fr 1fr; }

  /* Inner pages */
  .page-head h1 { font-size: 42px; }
  .page-shell { padding: 48px 32px 96px; }

  /* Footer */
  .footer-full { padding: 56px 32px 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }

  /* Scan progress page */
  .scan-page { padding: 32px 28px; }

  /* Report */
  .report-shell { padding: 32px 28px; }

  /* Dashboard */
  .dashboard-shell { padding: 32px 28px 64px; }

  /* Result page */
  .result-kpis { grid-template-columns: repeat(2, 1fr); }
  .result-caps-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile grande (≤768px) ────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav — scroll horizontal, sin hamburger JS */
  .nav { padding: 10px 16px; gap: 8px; flex-wrap: nowrap; }
  .nav-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { font-size: 13px; padding: 6px 10px; white-space: nowrap; }
  .nav-right { flex-shrink: 0; gap: 6px; }
  .lang-switch { margin-right: 0; }
  .lang-switch-opt { padding: 3px 8px; font-size: 11px; }

  /* Hero */
  .hero { padding: 40px 20px 0; min-height: auto; }
  .hero h1 { font-size: 38px; letter-spacing: -0.03em; }
  .hero .lead { font-size: 16px; margin-bottom: 28px; }

  /* Search shell — columna en mobile */
  .search-shell {
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 10px;
  }
  .search-input-wrap {
    background: white;
    border: 1.5px solid var(--line-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    width: 100%;
    padding: 10px 16px;
  }
  .search-divider { display: none; }
  .search-meta { display: none; }
  .search-submit {
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    justify-content: center;
    font-size: 15px;
  }

  /* Tabs */
  .tabs { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; justify-content: flex-start; }
  .tab { white-space: nowrap; }

  /* Hint chips */
  .search-hints { gap: 6px; }
  .hint-chip { font-size: 11px; padding: 4px 10px; }

  /* Stats strip */
  .stats-strip { flex-wrap: wrap; gap: 0; padding: 0 0 48px; }
  .stat { flex: 0 0 50%; border-right: none; border-bottom: 1px solid var(--line); padding: 16px 20px; }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
  .stat-num { font-size: 28px; }

  /* Featured / scan grid */
  .featured { padding: 32px 16px 48px; }
  .grid { grid-template-columns: 1fr; }

  /* Section head */
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* How-it-works */
  .how-grid { grid-template-columns: 1fr; }
  .how-arrow { display: none; }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; max-width: 100%; }

  /* Footer */
  .footer-full { padding: 48px 20px 28px; margin-top: 48px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Inner pages */
  .page-shell { padding: 36px 20px 72px; }
  .page-head h1 { font-size: 36px; }
  .page-head .lead { font-size: 16px; }

  /* About / founders */
  .founders-grid { grid-template-columns: 1fr; }
  .about-card { padding: 24px 20px; }

  /* Scan progress page */
  .scan-page { padding: 20px 16px; grid-template-columns: 1fr; }
  .scan-card-main { padding: 20px; }
  .scan-target-row { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Report */
  .report-shell { padding: 20px 16px; }
  .report-header { flex-direction: column; gap: 16px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-toolbar { flex-direction: column; align-items: flex-start; }

  /* Paywall banner */
  .paywall-banner { flex-direction: column; gap: 16px; }
  .paywall-cta { align-items: flex-start; }

  /* Finding cards */
  .finding-card { padding: 16px; }
  .finding-head { flex-direction: column; gap: 8px; }

  /* Modal */
  .modal { width: calc(100vw - 32px); padding: 24px 20px; }

  /* Auth */
  .auth-card { padding: 28px 20px; }
  .auth-page { padding: 24px 16px; }

  /* Dashboard */
  .dashboard-shell { padding: 20px 16px 48px; }
  .dash-header { flex-direction: column; gap: 12px; }
  .dash-balance { text-align: left; }
  .dash-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
  }
  .dash-tabs::-webkit-scrollbar { display: none; }
  .dash-tab { white-space: nowrap; padding: 10px 14px; }

  /* Scan row */
  .scan-row { flex-wrap: wrap; gap: 8px; }
  .scan-row-url { width: 100%; }

  /* Result page */
  .result-hero { flex-direction: column; gap: 16px; padding: 20px; }
  .result-score-wrap { align-self: flex-start; }
  .result-hero h1 { font-size: 22px; }
  .result-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .result-panel { grid-template-columns: 1fr; }
  .result-caps-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .result-owasp-grid { grid-template-columns: repeat(2, 1fr); }
  .result-locked { padding: 20px 16px; }
}

/* ── Móvil pequeño (≤480px) ────────────────────────────────── */
@media (max-width: 480px) {
  /* Nav */
  .nav { padding: 8px 12px; }
  .nav-logo { font-size: 15px; }
  .nav-logo svg { width: 28px; height: 28px; }
  .nav-right { gap: 4px; }
  /* Ocultar lang switch en pantallas muy pequeñas si no cabe */
  .lang-switch { display: none; }

  /* Hero */
  .hero { padding: 32px 16px 0; }
  .hero h1 { font-size: 30px; line-height: 1.08; }
  .hero .lead { font-size: 15px; }
  .hero-eyebrow { font-size: 11px; padding: 5px 11px; }

  /* Stats strip */
  .stats-strip { flex-direction: column; }
  .stat { flex: 1 0 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: none; }
  .stat:nth-child(odd) { border-right: none; }

  /* Featured */
  .featured { padding: 24px 12px 40px; }

  /* Section head */
  .section-head h2 { font-size: 24px; }

  /* How-it-works */
  .how-card { padding: 20px 16px 24px; }
  .how-card h3 { font-size: 16px; }

  /* Pricing */
  .pricing-card { padding: 24px 20px 20px; }
  .pricing-price { font-size: 36px; }

  /* Footer */
  .footer-full { padding: 36px 16px 24px; }

  /* Inner pages */
  .page-shell { padding: 24px 16px 56px; }
  .page-head h1 { font-size: 28px; }
  .page-head .lead { font-size: 15px; }

  /* About card */
  .about-card { padding: 20px 16px; }
  .about-card h3 { font-size: 18px; }

  /* Scan progress page */
  .scan-page { padding: 16px 12px; }
  .scan-card-main { padding: 16px; }
  .mini-card { padding: 14px; }
  .mini-val { font-size: 24px; }

  /* Report */
  .report-shell { padding: 16px 12px; }
  .report-header { padding: 20px 16px; }
  .report-title h1 { font-size: 24px; }

  /* Finding cards */
  .finding-card { padding: 12px 14px; }

  /* Modal */
  .modal { width: calc(100vw - 16px); padding: 20px 16px; border-radius: var(--radius-lg); }

  /* Auth */
  .auth-card { padding: 24px 16px; }
  .auth-title { font-size: 22px; }

  /* Dashboard */
  .dashboard-shell { padding: 16px 12px 40px; }
  .dash-title { font-size: 24px; }
  .dash-balance-num { font-size: 22px; }
  .dash-tab { font-size: 13px; padding: 8px 12px; }
  .scan-row { padding: 12px 14px; }
  .scan-row-url { font-size: 12px; }

  /* Result page */
  .result-hero { padding: 16px; }
  .result-hero h1 { font-size: 18px; }
  .result-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .result-kpi { padding: 12px 14px; }
  .result-kpi-num { font-size: 24px; }
  .result-caps-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .result-owasp-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .result-finding { padding: 14px 16px; }
  .result-finding-head { flex-direction: column; gap: 6px; }
  .result-hotspot { padding: 12px 14px; }
  .result-locked { padding: 16px 12px; }

  /* Buttons */
  .btn-lg { padding: 12px 20px; font-size: 14px; }

  /* Search hints — scroll horizontal en muy pequeño */
  .search-hints { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .hint-chip { flex-shrink: 0; }
}

/* ============================================================
   SCAN RESULT PAGE — result-* namespace
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, #fff5f3 0%, #fdf8f5 65%);
  border: 1.5px solid var(--coral-soft-2);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.result-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 90% at 0% 60%, rgba(255,106,85,.08), transparent);
  pointer-events: none;
}
.result-hero.safe {
  background: linear-gradient(135deg, #f0fdf8 0%, #fdf8f5 65%);
  border-color: rgba(62,194,154,.3);
}
.result-hero.safe::before {
  background: radial-gradient(ellipse 50% 90% at 0% 60%, rgba(62,194,154,.08), transparent);
}
.result-hero-body {
  flex: 1;
  min-width: 0;
}
.result-score-wrap {
  flex-shrink: 0;
  text-align: center;
}
.result-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--red-soft);
  border: 1px solid rgba(228,69,58,.2);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 10px;
}
.result-eyebrow.safe {
  background: var(--mint-soft);
  border-color: rgba(62,194,154,.25);
  color: var(--mint);
}
.result-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: result-pulse-dot 1.5s infinite;
}
.result-eyebrow.safe .result-pulse {
  background: var(--mint);
  animation: none;
}
@keyframes result-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}
.result-hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.2;
}
.result-repo-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--coral);
  word-break: break-all;
  margin-bottom: 6px;
}
.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.result-meta-sep { color: var(--line-2); }
.result-lang-pill {
  background: var(--violet-soft);
  color: var(--violet);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Score ring — 90×90 to match mock */
.result-score-ring {
  position: relative;
  width: 90px;
  height: 90px;
}
.result-score-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.result-score-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}
.result-score-max {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-4);
}
.result-score-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── KPI Strip ─────────────────────────────────────────────── */
.result-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
/* result-kpis breakpoint — handled in main responsive section below */
.result-kpi {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: box-shadow .15s;
}
.result-kpi:hover { box-shadow: var(--shadow-md); }
.result-kpi.d {
  border-color: rgba(228,69,58,.25);
  background: linear-gradient(135deg, #fff6f5, white);
}
.result-kpi.w {
  border-color: rgba(245,166,35,.25);
  background: linear-gradient(135deg, #fffbf0, white);
}
.result-kpi.g {
  border-color: rgba(62,194,154,.25);
  background: linear-gradient(135deg, #f2fdf8, white);
}
.result-kpi.v {
  border-color: rgba(107,92,231,.2);
  background: linear-gradient(135deg, #f5f3fe, white);
}
.result-kpi-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.result-kpi-num.r  { color: var(--red); }
.result-kpi-num.a  { color: var(--amber); }
.result-kpi-num.m  { color: var(--mint); }
.result-kpi-num.vi { color: var(--violet); }
.result-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.result-kpi-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
}

/* ── Severity + Checks Panel ───────────────────────────────── */
.result-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
/* result-panel breakpoint — handled in main responsive section below */
.result-panel > div {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}
.result-panel-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.result-sev-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.result-sev-bar-row:last-child { margin-bottom: 0; }
.result-sev-label {
  width: 64px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  flex-shrink: 0;
}
.result-sev-track {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.result-sev-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.result-sev-fill.crit { background: var(--red); }
.result-sev-fill.high { background: var(--amber); }
.result-sev-fill.med  { background: var(--coral); }
.result-sev-fill.low  { background: var(--mint); }
.result-sev-count {
  font-size: 13px;
  font-weight: 800;
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}
.result-checks-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}
.result-check-cell {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-check-cell.pass {
  background: var(--mint-soft);
  border: 1.5px solid rgba(62,194,154,.25);
}
.result-check-cell.fail {
  background: var(--red-soft);
  border: 1.5px solid rgba(228,69,58,.3);
}
.result-checks-legend {
  display: flex;
  gap: 14px;
}
.result-checks-legend span {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.result-checks-legend .leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.result-checks-legend .leg-fail { color: var(--red); }
.result-checks-legend .leg-fail .leg-dot { background: var(--red-soft); border: 1.5px solid var(--red); }
.result-checks-legend .leg-pass { color: var(--mint); }
.result-checks-legend .leg-pass .leg-dot { background: var(--mint-soft); border: 1.5px solid var(--mint); }

/* ── Report Actions Bar ────────────────────────────────────── */
.result-unlocked-bar {
  background: rgba(29,25,21,.06);
  border: 1.5px solid rgba(29,25,21,.12);
  border-radius: 16px 16px 0 0;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 14px;
}

/* ── Locked Section ────────────────────────────────────────── */
.result-locked {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-top: none;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  padding: 28px;
}

/* ── Capabilities Grid ─────────────────────────────────────── */
.result-caps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
/* result-caps-grid breakpoint — handled in main responsive section below */
.result-cap {
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1.5px solid transparent;
}
.result-cap.hit {
  background: rgba(240,140,50,.07);
  border-color: rgba(240,140,50,.25);
}
.result-cap.safe {
  background: rgba(150,140,130,.05);
  border-color: rgba(150,140,130,.15);
}
.result-cap-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-cap.hit .result-cap-icon { background: rgba(240,140,50,.15); color: #c87020; }
.result-cap.safe .result-cap-icon { background: rgba(150,140,130,.1); color: #998a7a; }
.result-cap-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.result-cap-status { font-size: 11px; font-weight: 600; }
.result-cap.hit .result-cap-status { color: #c87020; }
.result-cap.safe .result-cap-status { color: #998a7a; }
.result-risk-alert {
  background: rgba(228,69,58,.08);
  border: 1.5px solid rgba(228,69,58,.25);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #e4453a;
  margin-bottom: 20px;
}

/* ── OWASP Grid ────────────────────────────────────────────── */
.result-owasp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
/* result-owasp-grid breakpoint — handled in main responsive section below */
.result-owasp-item {
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  border: 1.5px solid transparent;
}
.result-owasp-item.hit {
  background: rgba(228,69,58,.07);
  border-color: rgba(228,69,58,.2);
}
.result-owasp-item.ok {
  background: rgba(0,196,140,.07);
  border-color: rgba(0,196,140,.2);
}
.result-owasp-id {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.result-owasp-item.hit .result-owasp-id { color: var(--red); }
.result-owasp-item.ok  .result-owasp-id { color: var(--mint); }
.result-owasp-name {
  font-size: 10px;
  color: var(--ink-3);
  line-height: 1.3;
}
.result-owasp-legend {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 24px;
}

/* ── Finding Cards ─────────────────────────────────────────── */
.result-finding {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.result-finding-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.result-sev-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  flex-shrink: 0;
  margin-top: 2px;
}
.result-sev-badge.crit { background: rgba(228,69,58,.12); color: var(--red); }
.result-sev-badge.high { background: rgba(245,166,35,.12); color: var(--amber); }
.result-sev-badge.med  { background: rgba(240,192,64,.12); color: #b38600; }
.result-sev-badge.low  { background: rgba(0,196,140,.12); color: var(--mint); }
.result-finding-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.result-finding-meta {
  font-size: 11px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  margin: 0;
}
.result-finding-body {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
}
.result-code-viewer {
  border: 1px solid #e5ddd6;
  border-radius: 8px;
  overflow: visible;
  margin-top: 10px;
}
.result-code-header {
  background: #ede6e0;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7a6a5c;
}
.result-code-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #5a4a3c;
  font-weight: 500;
}
.result-code-viewer .result-code-block {
  border-radius: 0;
  margin-top: 0;
}
.result-finding-loc {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}
.result-code-block {
  background: #f3ede8;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
}
.result-remediation {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(0,196,140,.06);
  border-left: 3px solid var(--mint);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #3a5a50;
  line-height: 1.5;
}

/* ── Hotspot Section ───────────────────────────────────────── */
.result-hotspot-section {
  border-top: 1.5px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.result-hotspot-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.result-hotspot {
  background: rgba(108,92,231,.06);
  border: 1.5px solid rgba(108,92,231,.2);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.result-hotspot-icon { color: var(--violet); flex-shrink: 0; margin-top: 2px; }
.result-hotspot-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.result-hotspot-body {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}

/* ── Section title ─────────────────────────────────────────── */
.result-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Skill result — "has critical" badge next to the risk pill */
.result-critical-badge { background: #fff0f0; color: #c00000; }

/* Skill result — annotated source code panel background */
.sk-src-panel { background: #fafaf9; }

/* Skill result — OWASP AST / OWASP LLM finding tags */
.result-tag-ast { background: #fff0eb; color: #c2410c; }
.result-tag-llm { background: #eef2ff; color: #4338ca; }

/* Skill result — remediation callout (duplicated inline instance
   outside the shared .result-remediation card, keeps its own
   font-size/padding to match the surrounding inline-styled block) */
.sk-remediation-box { background: #f6fbf8; }

/* ── Result pages — dark theme overrides ──────────────────────
   Accent colors below don't map 1:1 to an existing CSS variable
   (gradients, derived tints), so they get an explicit dark
   counterpart instead of a plain var() swap. Everything that DID
   map to a variable was edited in place above (no light-theme
   change, since the hex value equaled the light var already). */
[data-theme="dark"] .result-hero {
  background: linear-gradient(135deg, var(--coral-soft) 0%, var(--surface) 65%);
  border-color: var(--coral-soft-2);
}
[data-theme="dark"] .result-hero.safe {
  background: linear-gradient(135deg, var(--mint-soft) 0%, var(--surface) 65%);
  border-color: rgba(62,194,154,.3);
}
[data-theme="dark"] .result-score-track { fill: var(--surface); }
[data-theme="dark"] .result-kpi.d { background: linear-gradient(135deg, var(--red-soft), var(--surface)); }
[data-theme="dark"] .result-kpi.w { background: linear-gradient(135deg, var(--amber-soft), var(--surface)); }
[data-theme="dark"] .result-kpi.g { background: linear-gradient(135deg, var(--mint-soft), var(--surface)); }
[data-theme="dark"] .result-kpi.v { background: linear-gradient(135deg, var(--violet-soft), var(--surface)); }
[data-theme="dark"] .result-unlocked-bar {
  background: rgba(240,236,232,.06);
  border-color: rgba(240,236,232,.14);
}
[data-theme="dark"] .result-cap.hit {
  background: rgba(240,140,50,.14);
  border-color: rgba(240,140,50,.35);
}
[data-theme="dark"] .result-cap.safe {
  background: rgba(150,140,130,.10);
  border-color: rgba(150,140,130,.25);
}
[data-theme="dark"] .result-cap.hit .result-cap-icon { background: rgba(240,140,50,.2); color: var(--amber); }
[data-theme="dark"] .result-cap.safe .result-cap-icon { background: rgba(150,140,130,.16); color: var(--ink-3); }
[data-theme="dark"] .result-cap.hit .result-cap-status { color: var(--amber); }
[data-theme="dark"] .result-cap.safe .result-cap-status { color: var(--ink-3); }
[data-theme="dark"] .result-risk-alert {
  background: rgba(228,69,58,.14);
  border-color: rgba(228,69,58,.4);
  color: var(--red);
}
[data-theme="dark"] .result-owasp-item.hit {
  background: rgba(228,69,58,.14);
  border-color: rgba(228,69,58,.35);
}
[data-theme="dark"] .result-owasp-item.ok {
  background: rgba(0,196,140,.14);
  border-color: rgba(0,196,140,.3);
}
[data-theme="dark"] .result-sev-badge.med { color: var(--amber); }
[data-theme="dark"] .result-code-viewer { border-color: var(--line); }
[data-theme="dark"] .result-code-header { background: var(--bg-soft); color: var(--ink-3); }
[data-theme="dark"] .result-code-file { color: var(--ink-2); }
[data-theme="dark"] .result-code-block { background: var(--bg-soft); }
[data-theme="dark"] .result-remediation { background: rgba(62,194,154,.12); color: var(--mint); }
[data-theme="dark"] .result-critical-badge { background: var(--red-soft); color: var(--red); }
[data-theme="dark"] .result-tag-ast { background: #3a2410; color: #f08c32; }
[data-theme="dark"] .result-tag-llm { background: var(--violet-soft); color: var(--violet); }

/* Skill result page — annotated source viewer (sk-* namespace,
   base rules defined inline in templates/skill_scans/result.html) */
[data-theme="dark"] .sk-src-panel { background: var(--bg-soft); }
[data-theme="dark"] .sk-src-header { border-bottom-color: var(--line); }
[data-theme="dark"] .sk-src-linenum {
  border-right-color: var(--line);
  background: rgba(240,236,232,.03);
  color: var(--ink-4);
}
[data-theme="dark"] .sk-finding-panel { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .sk-finding-inner { border-bottom-color: var(--line); }
[data-theme="dark"] .sk-remediation-box { background: rgba(62,194,154,.10); }

/* Language switcher (navbar) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  margin-right: 4px;
}
.lang-switch-opt {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  border-radius: var(--radius-pill);
  transition: background .15s, color .15s;
}
.lang-switch-opt.active {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 1px 4px rgba(255,106,85,.35);
}
.lang-switch-opt:not(.active):hover { color: var(--ink); }

/* Dark mode overrides for hardcoded values */
[data-theme="dark"] .topbar {
  background: rgba(15,17,23,.92);
}
[data-theme="dark"] .sidebar {
  background: var(--surface);
}
[data-theme="dark"] .scan-card,
[data-theme="dark"] .scan-card-main,
[data-theme="dark"] .mini-card,
[data-theme="dark"] .search-shell {
  background: var(--surface);
}
[data-theme="dark"] .search-input { color: var(--ink); }
[data-theme="dark"] .tabs { background: var(--surface); }
[data-theme="dark"] .tab.active { background: var(--bg-soft); }
[data-theme="dark"] .btn-dark { background: var(--coral); }
[data-theme="dark"] .btn-dark:hover { background: var(--coral-hover); }
[data-theme="dark"] .sidebar-link:hover { background: rgba(240,236,232,.07); }
[data-theme="dark"] .hint-chip { background: var(--surface); border-color: var(--line-2); }
[data-theme="dark"] .hint-chip:hover { background: var(--coral-soft); border-color: var(--coral-soft-2); }

/* Dark mode toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover { background: var(--bg-soft); color: var(--ink); }

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--surface);
  border-top: 1.5px solid var(--line-2);
  box-shadow: 0 -4px 24px rgba(0,0,0,.08);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  font-size: 13px;
  color: var(--ink-2);
  flex: 1;
  min-width: 200px;
}
.cookie-banner-text a { color: var(--coral); font-weight: 600; text-decoration: underline; }
.cookie-banner-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ============================================================
   APP SHELL — on-prem client console (R6 UI)
   Extends the coral/peach/mint system: same variables, same
   radii/shadows. New pieces: product topbar cluster, page
   scaffolding, catalog dashboard cards, data tables, forms.
   ============================================================ */

/* ── Topbar extras ─────────────────────────────────────────── */
.nav-env-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  margin-left: 2px;
  white-space: nowrap;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
}
.role-chip .rd { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.role-chip.admin    { background: var(--coral-soft); color: var(--coral); border: 1px solid var(--coral-soft-2); }
.role-chip.operator { background: var(--sky-soft); color: var(--sky); border: 1px solid transparent; }
.role-chip.auditor  { background: var(--violet-soft); color: var(--violet); border: 1px solid transparent; }
.role-chip.none     { background: var(--bg-soft); color: var(--ink-3); border: 1px solid var(--line); }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.nav-user-email {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-email:hover { color: var(--coral); }

/* ── Page scaffolding ──────────────────────────────────────── */
.app-page { max-width: 1200px; margin: 0 auto; padding: 36px 48px 96px; }
.app-page.narrow { max-width: 880px; }
.app-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.app-page-head h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 0;
}
.app-page-head .sub { font-size: 14px; color: var(--text-muted); margin: 6px 0 0; max-width: 620px; }
.app-page-head .head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.container .sub { font-size: 14px; color: var(--text-muted); max-width: 720px; }
.app-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 8px;
}
.app-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; flex-wrap: wrap; }
.app-crumbs a { color: var(--coral); font-weight: 600; }
.app-crumbs .sep { color: var(--ink-4); }

/* Messages (django.contrib.messages) */
.flash { border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); }
.flash.success { background: var(--mint-soft); border-color: rgba(62,194,154,.3); color: #1d7d5f; }
.flash.warning { background: var(--amber-soft); border-color: rgba(245,166,35,.35); color: #8a5c00; }
.flash.error   { background: var(--red-soft); border-color: rgba(228,69,58,.3); color: var(--red); }
.flash.info    { background: var(--sky-soft); border-color: rgba(74,158,232,.3); color: #22679f; }
[data-theme="dark"] .flash.success { color: var(--mint); }
[data-theme="dark"] .flash.warning { color: var(--amber); }
[data-theme="dark"] .flash.info    { color: var(--sky); }

/* ── KPI tiles (dashboard) ─────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.kpi-tile {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-tile::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--line-2);
}
.kpi-tile.coral::after { background: var(--coral); }
.kpi-tile.mint::after  { background: var(--mint); }
.kpi-tile.amber::after { background: var(--amber); }
.kpi-tile.red::after   { background: var(--red); }
.kpi-tile.violet::after{ background: var(--violet); }
.kpi-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 3px; }

/* ── Catalog dashboard (home hero) ─────────────────────────── */
.mcp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.mcp-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.mcp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.mcp-card.quarantined { border-color: rgba(228,69,58,.35); background: linear-gradient(180deg, rgba(228,69,58,.045), var(--surface) 55%); }
.mcp-card-top { display: flex; align-items: flex-start; gap: 12px; }
.mcp-card-id { flex: 1; min-width: 0; }
.mcp-card-name { font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.mcp-card-name:hover { color: var(--coral); }
.mcp-card-endpoint { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcp-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meta-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.mcp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.mcp-card-foot .when { font-size: 11.5px; color: var(--ink-4); }

/* Verdict — latest black-box status on a card */
.verdict { display: flex; align-items: center; gap: 8px; }
.verdict-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.verdict-ring.ok    { background: var(--mint-soft); border: 2px solid var(--mint); color: var(--mint); }
.verdict-ring.warn  { background: var(--amber-soft); border: 2px solid var(--amber); color: #b88a00; }
.verdict-ring.bad   { background: var(--red-soft); border: 2px solid var(--red); color: var(--red); }
.verdict-ring.none  { background: var(--bg-soft); border: 2px dashed var(--line-2); color: var(--ink-4); font-size: 16px; }
.verdict-ring.running { background: var(--sky-soft); border: 2px solid var(--sky); color: var(--sky); }
[data-theme="dark"] .verdict-ring.warn { color: var(--amber); }
.verdict-label { font-size: 12px; font-weight: 700; line-height: 1.25; }
.verdict-label .vl-sub { font-size: 11px; font-weight: 500; color: var(--ink-4); display: block; }
.sev-strip { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.sev-strip .sv { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 2px 6px; }
.sev-strip .sv.c { background: var(--red-soft); color: var(--red); }
.sev-strip .sv.h { background: #fff0e0; color: #e06000; }
.sev-strip .sv.m { background: var(--amber-soft); color: #b88a00; }
.sev-strip .sv.l { background: var(--bg-soft); color: var(--ink-3); }
[data-theme="dark"] .sev-strip .sv.h { background: #3a2410; color: #f08c32; }
[data-theme="dark"] .sev-strip .sv.m { color: var(--amber); }

/* Spinner (running states) */
.spin {
  width: 14px; height: 14px;
  border: 2px solid var(--sky-soft);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: appspin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes appspin { to { transform: rotate(360deg); } }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-xl);
  padding: 56px 28px;
  text-align: center;
  background: var(--bg-soft);
}
.empty-state .es-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--coral-soft);
  color: var(--coral);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.empty-state h3 { font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin: 0 auto 20px; max-width: 420px; line-height: 1.55; }

/* ── Data tables ───────────────────────────────────────────── */
.table-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-md); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table .cell-main { font-weight: 700; color: var(--ink); }
.data-table .cell-main:hover { color: var(--coral); }
.data-table .cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.data-table .cell-mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.data-table .cell-dim { color: var(--text-muted); font-size: 13px; }
.data-table .cell-num { font-variant-numeric: tabular-nums; }

/* ── Toolbar (filters row) ─────────────────────────────────── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .form-input, .toolbar .form-select { width: auto; }
.toolbar .grow { flex: 1; min-width: 220px; }
.form-select {
  width: 100%;
  padding: 10px 34px 10px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--ink);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8178' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  outline: none;
  transition: border-color .15s;
}
.form-select:focus { border-color: var(--coral); }
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select { background-color: var(--surface); color: var(--ink); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.45; }
.form-error { font-size: 12.5px; font-weight: 600; color: var(--red); margin-top: 5px; }
textarea.form-input { resize: vertical; min-height: 120px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }

/* Panel — generic surface card */
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; }
.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 13.5px; }
.kv-list dt { color: var(--text-muted); font-weight: 600; }
.kv-list dd { margin: 0; color: var(--ink); word-break: break-word; }
.kv-list dd.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* Section within a page */
.app-section { margin-top: 40px; }
.app-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.app-section-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.app-section-head .more { font-size: 13px; font-weight: 700; color: var(--coral); }

/* Quick actions (home) */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-action {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--coral-soft-2); }
.qa-icon { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-icon.coral  { background: var(--coral-soft); color: var(--coral); }
.qa-icon.mint   { background: var(--mint-soft); color: var(--mint); }
.qa-icon.violet { background: var(--violet-soft); color: var(--violet); }
.qa-icon.sky    { background: var(--sky-soft); color: var(--sky); }
.quick-action h3 { font-size: 14.5px; font-weight: 800; margin: 0 0 2px; }
.quick-action p { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.4; }

/* Catalog overview — two summary panels (MCP servers / Skills) */
.catalog-overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.catalog-overview-grid .panel { display: flex; flex-direction: column; }
.catalog-overview-grid .panel .desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 18px; }
.catalog-overview-grid .panel .kpi-row { margin-bottom: 20px; }
/* The MCP card packs 4 KPI tiles into a half-width panel — 4-across cramps
   the longer labels ("Quarantined", "Black-box scans"). Lay them 2x2; the
   3-tile skill card (.cols-3) keeps its single row. */
.catalog-overview-grid .panel .kpi-row:not(.cols-3) { grid-template-columns: repeat(2, 1fr); }
.catalog-overview-grid .panel .btn { margin-top: auto; align-self: flex-start; }

/* Slim product footer */
.app-footer {
  border-top: 1.5px solid var(--line);
  padding: 22px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-4);
  margin-top: 64px;
}
.app-footer .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink-3); font-size: 13px; }

/* License banner */
.license-banner {
  background: var(--amber-soft);
  border: 1.5px solid rgba(245,166,35,.4);
  color: #8a5c00;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
[data-theme="dark"] .license-banner { color: var(--amber); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .app-page { padding: 28px 28px 72px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-row.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: 1fr; }
  .catalog-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-page { padding: 20px 16px 56px; }
  .app-page-head h1 { font-size: 24px; }
  .mcp-grid { grid-template-columns: 1fr; }
  .nav-user-email { display: none; }
  .nav-env-chip { display: none; }
  .app-footer { padding: 18px 16px; }
  .kv-list { grid-template-columns: 1fr; gap: 2px 0; }
  .kv-list dt { margin-top: 8px; }

  /* Sidebar becomes an off-canvas drawer; the hamburger in .topbar opens it. */
  .nav-hamburger { display: flex; align-items: center; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 55;
    background: rgba(15,15,15,.45);
  }
  .topbar { padding: 12px 16px; }
}
@media (min-width: 769px) {
  /* Desktop: sidebar is a static column, never a drawer/overlay. */
  .sidebar-backdrop { display: none !important; }
}
@media (max-width: 480px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-row.cols-3 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-num { font-size: 24px; }
}

/* Raw Django form fields inside a .panel (catalog add/edit forms have no
   widget class of their own) — give them the app input styling. */
.panel form input[type="text"],
.panel form input[type="url"],
.panel form input[type="email"],
.panel form input[type="number"],
.panel form input[type="password"],
.panel form select,
.panel form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.panel form select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8178' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
}
.panel form textarea { font-family: var(--font-mono); font-size: 13px; line-height: 1.55; resize: vertical; }
.panel form input:focus,
.panel form select:focus,
.panel form textarea:focus { border-color: var(--coral); }

/* --- Portal (partnership) pages: generic container + status badges --- */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 48px; }
.badge-offline, .badge-revoked, .badge-over-limit {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  border-radius: var(--radius-pill); padding: 3px 10px; white-space: nowrap;
}
.badge-offline    { background: #eceae7; color: #6b6560; }
.badge-revoked    { background: #fde8e8; color: #b42318; }
.badge-over-limit { background: #fef3c7; color: #92610a; }

/* ============================================================================
   BLACK-BOX ASSESSMENT — offensive pentest read of a live MCP scan.
   Used by templates/blackbox/scan_detail.html. The banner is an intentionally
   dark "ops console" slab in both themes; everything else follows the system
   (coral/mint tokens, JetBrains Mono for payload/proof). Severity + confidence
   are colour-coded; a confirmed critical reads as a breach, not a lint warning.
   ========================================================================== */

/* ── Executive engagement banner ─────────────────────────────────────────── */
.bbx-banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,106,85,.10), transparent 55%),
    linear-gradient(160deg, #211b16 0%, #17120e 60%, #120e0b 100%);
  border: 1px solid #34291f;
  padding: 26px 28px 0;
  margin-bottom: 22px;
  box-shadow: 0 18px 40px -24px rgba(0,0,0,.7);
}
/* faint scanline/grid texture — "instrument" feel, purely decorative */
.bbx-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 1px, transparent 1px 46px);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}
/* posture-toned top hairline + verdict accent */
.bbx-banner::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--bbx-accent, #ff6a55);
}
.bbx-banner.tone-compromised { --bbx-accent: #ff5a52; }
.bbx-banner.tone-atrisk      { --bbx-accent: #ff8a3d; }
.bbx-banner.tone-exposed     { --bbx-accent: #f5a623; }
.bbx-banner.tone-hardened    { --bbx-accent: #3ec29a; }
.bbx-banner.tone-failed      { --bbx-accent: #8a8178; }
.bbx-banner.tone-running     { --bbx-accent: #4a9ee8; }

.bbx-banner-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: flex-start;
}
.bbx-banner-main { min-width: 0; }
.bbx-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #d8b3a6;
}
.bbx-eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bbx-accent, #ff6a55);
  box-shadow: 0 0 0 0 var(--bbx-accent, #ff6a55);
  animation: bbxPulse 2.4s infinite;
}
@keyframes bbxPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,106,85,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(255,106,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,106,85,0); }
}
.bbx-target {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
  color: #f7f2ee; margin: 12px 0 8px; word-break: break-word;
}
.bbx-target-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: #b3a89c;
}
.bbx-target-meta .mono { font-family: var(--font-mono); }
.bbx-endpoint { color: #e9b7aa; }
.bbx-dot { width: 3px; height: 3px; border-radius: 50%; background: #6a5d50; }
.bbx-attest {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 16px; max-width: 560px;
  font-size: 12px; line-height: 1.5; color: #c9bdb0;
  background: rgba(255,106,85,.07); border: 1px solid rgba(255,106,85,.22);
  border-radius: 10px; padding: 10px 13px;
}
.bbx-attest svg { color: #3ec29a; flex-shrink: 0; margin-top: 1px; }
.bbx-attest b { color: #f2ede8; }
.bbx-attest .mono { font-family: var(--font-mono); color: #e9b7aa; }

.bbx-verdict {
  text-align: right; padding-left: 26px; border-left: 1px solid #33281e; flex-shrink: 0;
}
.bbx-verdict-label {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #8a7c6e; margin-bottom: 6px;
}
.bbx-verdict-word {
  font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1;
  color: var(--bbx-accent, #ff6a55);
  text-shadow: 0 0 26px color-mix(in srgb, var(--bbx-accent, #ff6a55) 45%, transparent);
}
.bbx-verdict-running { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; color: #7cc0f5; }
.bbx-verdict-running .spin { width: 20px; height: 20px; border-width: 3px; }
.bbx-verdict-sub { font-size: 12px; color: #9a8d7f; margin-top: 8px; max-width: 220px; margin-left: auto; }

.bbx-banner-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 22px -28px 0; padding: 13px 28px;
  border-top: 1px solid #2c2219; background: rgba(0,0,0,.22);
}
.bbx-tally { display: flex; gap: 8px; flex-wrap: wrap; }
.bbx-tally-cell {
  font-size: 11.5px; font-weight: 600; color: #8a7c6e;
  border: 1px solid #34291f; border-radius: var(--radius-pill); padding: 4px 11px;
  background: rgba(255,255,255,.02);
}
.bbx-tally-cell b { font-variant-numeric: tabular-nums; color: #b3a89c; margin-right: 4px; }
.bbx-tally-cell.on { color: #f2ede8; }
.bbx-tally-cell.on.crit { border-color: #6e2320; background: rgba(255,90,82,.14); }
.bbx-tally-cell.on.crit b { color: #ff8078; }
.bbx-tally-cell.on.high { border-color: #6e3f1c; background: rgba(255,138,61,.14); }
.bbx-tally-cell.on.high b { color: #ffab6b; }
.bbx-tally-cell.on.med  { border-color: #6a5216; background: rgba(245,166,35,.14); }
.bbx-tally-cell.on.med b { color: #f8c25f; }
.bbx-tally-cell.on.low  { border-color: #3a4a3f; background: rgba(62,194,154,.12); }
.bbx-tally-cell.on.low b { color: #6fd8b6; }
.bbx-runmeta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 11.5px; color: #8a7c6e; font-family: var(--font-mono); }
.bbx-partial { color: #f8c25f; font-weight: 700; }

/* ── Attack surface ──────────────────────────────────────────────────────── */
.bbx-surface {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 4px;
}
.bbx-surface-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.bbx-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.bbx-surface-note { font-size: 13px; color: var(--ink-2); }
.bbx-breach-n { color: var(--red); font-variant-numeric: tabular-nums; }
.bbx-tool-row { display: flex; gap: 9px; flex-wrap: wrap; }
.bbx-tool-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--radius-pill); padding: 6px 12px 6px 10px;
  font-size: 12.5px; border: 1.5px solid var(--line-2); background: var(--bg-soft);
}
.bbx-tool-chip .mono { font-family: var(--font-mono); color: var(--ink); font-weight: 600; }
.bbx-tool-mark { width: 8px; height: 8px; border-radius: 2px; background: var(--ink-4); }
.bbx-tool-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
}
.bbx-tool-chip.breached { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.bbx-tool-chip.breached .bbx-tool-mark { background: var(--red); }
.bbx-tool-chip.breached .bbx-tool-tag { background: var(--red); color: #fff; }
.bbx-tool-chip.breached.sev-high  { background: #fff0e0; border-color: rgba(224,96,0,.32); }
.bbx-tool-chip.breached.sev-high .bbx-tool-mark,
.bbx-tool-chip.breached.sev-high .bbx-tool-tag { background: #e06000; }
.bbx-tool-chip.breached.sev-medium { background: var(--amber-soft); border-color: rgba(245,166,35,.4); }
.bbx-tool-chip.breached.sev-medium .bbx-tool-mark,
.bbx-tool-chip.breached.sev-medium .bbx-tool-tag { background: var(--amber); color: #fff; }

.bbx-section-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ── Severity group dividers ─────────────────────────────────────────────── */
.bbx-sev-divider {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 12px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.bbx-sev-rule { flex: 1; height: 1px; background: var(--line); }
.bbx-sev-divider.sev-critical { color: var(--red); }
.bbx-sev-divider.sev-high     { color: #e06000; }
.bbx-sev-divider.sev-medium   { color: var(--amber); }
.bbx-sev-divider.sev-low      { color: var(--ink-3); }

/* ── Exploit record ──────────────────────────────────────────────────────── */
.bbx-exploit {
  position: relative; background: var(--surface);
  border: 1.5px solid var(--line); border-left-width: 4px;
  border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 14px;
}
.bbx-exploit.sev-critical { border-left-color: var(--red); }
.bbx-exploit.sev-high     { border-left-color: #e06000; }
.bbx-exploit.sev-medium   { border-left-color: var(--amber); }
.bbx-exploit.sev-low      { border-left-color: var(--ink-4); }
/* a proven exploit gets a subtle danger wash so it reads as a real breach */
.bbx-exploit.is-confirmed.sev-critical {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 30%, transparent),
              0 14px 34px -22px color-mix(in srgb, var(--red) 60%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--red-soft) 55%, var(--surface)) 0%, var(--surface) 46%);
}

.bbx-exploit-head { margin-bottom: 14px; }
.bbx-exploit-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.bbx-exploit-title { margin: 0 0 8px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); line-height: 1.28; }

.conf-tag {
  font-size: 10.5px; font-weight: 800; letter-spacing: .03em;
  border-radius: 5px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 4px;
}
.conf-tag.conf-confirmed { background: var(--ink); color: #ffd9b0; }
[data-theme="dark"] .conf-tag.conf-confirmed { background: #000; color: #ffcf9f; }
.conf-tag.conf-firm { background: #fff0e0; color: #b8560a; }
.conf-tag.conf-tentative { background: var(--violet-soft); color: var(--violet); }
.conf-tag.conf-hotspot { background: var(--violet-soft); color: var(--violet); text-transform: uppercase; letter-spacing: .06em; }

.bbx-attack-line {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-3);
}
.bbx-vuln-code {
  font-weight: 800; color: var(--red); letter-spacing: .04em;
  background: var(--red-soft); border-radius: 4px; padding: 2px 7px;
}
.bbx-exploit.sev-high     .bbx-vuln-code { color: #e06000; background: #fff0e0; }
.bbx-exploit.sev-medium   .bbx-vuln-code { color: var(--amber); background: var(--amber-soft); }
.bbx-exploit.sev-low      .bbx-vuln-code { color: var(--ink-3); background: var(--bg-soft); }
.bbx-arrow { color: var(--ink-4); }
.bbx-tool { color: var(--ink); font-weight: 700; }
.bbx-field { color: var(--ink-3); }
.bbx-cwe, .bbx-probe { color: var(--ink-4); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; font-size: 11px; }

.bbx-narrative { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* payload / proof monospace blocks */
.bbx-block { margin-bottom: 12px; }
.bbx-block-label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.bbx-code {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  border-radius: var(--radius-md); padding: 13px 15px; margin: 0;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.bbx-block.sent .bbx-code {
  background: var(--ink); color: #ff9c86;
  border: 1px solid #34291f;
  position: relative;
}
[data-theme="dark"] .bbx-block.sent .bbx-code { background: #0f0c0a; }
.bbx-block.sent .bbx-code::before {
  content: "$ "; color: #6fd8b6; user-select: none;
}
.bbx-block.proof .bbx-code {
  background: var(--bg-soft); color: var(--ink); border: 1.5px solid var(--line-2);
}
.bbx-block.proof .bbx-code.resp { color: var(--ink-2); }
.bbx-signal {
  font-family: var(--font-mono); text-transform: none; letter-spacing: 0;
  font-size: 10.5px; font-weight: 700; color: var(--mint);
  background: var(--mint-soft); border-radius: 4px; padding: 2px 7px;
}
.bbx-latency { text-transform: none; letter-spacing: 0; color: var(--ink-4); font-weight: 600; font-size: 11px; }

/* impact + remediation */
.bbx-impact, .bbx-fix {
  display: flex; gap: 12px; align-items: baseline;
  font-size: 13px; line-height: 1.55; border-radius: var(--radius-md);
  padding: 11px 14px; margin-top: 10px;
}
.bbx-impact { background: var(--red-soft); color: var(--ink-2); }
.bbx-exploit.sev-high   .bbx-impact { background: #fff0e0; }
.bbx-exploit.sev-medium .bbx-impact { background: var(--amber-soft); }
.bbx-exploit.sev-low    .bbx-impact { background: var(--bg-soft); }
.bbx-impact-label, .bbx-fix-label {
  flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  min-width: 84px; padding-top: 1px;
}
.bbx-impact-label { color: var(--red); }
.bbx-exploit.sev-high   .bbx-impact-label { color: #e06000; }
.bbx-exploit.sev-medium .bbx-impact-label { color: var(--amber); }
.bbx-exploit.sev-low    .bbx-impact-label { color: var(--ink-3); }
.bbx-fix { background: var(--mint-soft); color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--mint) 22%, transparent); }
.bbx-fix-label { color: var(--mint); }

/* ── Clean state ─────────────────────────────────────────────────────────── */
.bbx-clean {
  text-align: center; padding: 48px 28px; margin-top: 20px;
  background:
    radial-gradient(80% 120% at 50% 0%, var(--mint-soft), transparent 60%),
    var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--mint) 26%, var(--line));
  border-radius: var(--radius-lg);
}
.bbx-clean-shield {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint-soft); color: var(--mint);
  border: 2px solid color-mix(in srgb, var(--mint) 40%, transparent);
}
.bbx-clean h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; color: var(--ink); }
.bbx-clean p { margin: 0 auto; max-width: 540px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.bbx-clean p b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bbx-clean-caveat { margin-top: 12px !important; font-size: 12px !important; color: var(--ink-3) !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .bbx-banner { padding: 22px 20px 0; }
  .bbx-banner-grid { grid-template-columns: 1fr; gap: 20px; }
  .bbx-verdict { text-align: left; padding-left: 0; border-left: 0; border-top: 1px solid #33281e; padding-top: 16px; }
  .bbx-verdict-sub { margin-left: 0; }
  .bbx-target { font-size: 24px; }
  .bbx-verdict-word { font-size: 28px; }
  .bbx-banner-foot { margin: 18px -20px 0; padding: 12px 20px; }
  .bbx-impact, .bbx-fix { flex-direction: column; gap: 5px; }
  .bbx-impact-label, .bbx-fix-label { min-width: 0; }
}
[data-theme="dark"] .badge-offline { background: #2e2a26; color: #a89f96; }

/* Portal pages reuse the app typography but their content is plain HTML —
   headings, labels and bare form controls get the design-system look. */
.container h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.container h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin: 28px 0 12px; }
.container h3 { font-size: 14px; font-weight: 700; margin: 20px 0 10px; }
.container form label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.container form input,
.container form select,
.container form textarea {
  width: 100%; box-sizing: border-box; margin-top: 6px; padding: 10px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; font-weight: 500; color: var(--ink);
  background: var(--surface); outline: none; transition: border-color .15s;
}
.container form select {
  padding-right: 34px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8178' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.container form input:focus,
.container form select:focus,
.container form textarea:focus { border-color: var(--coral); }
.container code { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
/* Label-above-value meta cell used on portal detail grids */
.pmeta { font-size: 14px; color: var(--ink); }
.pmeta strong { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.container pre code { background: none; border: none; padding: 0; }
@media (max-width: 768px) { .container { padding: 24px 16px; } }

/* 0–100 posture score ring (repo scan compare + commit views) — the
   "higher is safer" counterpart of .verdict-ring, colored by band. */
.score-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  font-weight: 800; font-size: 14px; font-family: var(--font-mono);
}
.score-ring.score-safe   { background: var(--mint-soft); border: 2px solid var(--mint); color: var(--mint); }
.score-ring.score-warn   { background: var(--amber-soft); border: 2px solid var(--amber); color: #b88a00; }
.score-ring.score-danger { background: var(--red-soft); border: 2px solid var(--red); color: var(--red); }
[data-theme="dark"] .score-ring.score-warn { color: var(--amber); }
