*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #090b0e;
  --panel: #0e1217;
  --panel2: #0b0e13;
  --raise: #141a21;
  --raise-hover: #1c2430;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.16);
  --txt: #cdd3de;
  --txt-bright: #f0f4fc;
  --mut: #7d8697;
  --lav: #b4bad6;
  --g1: #a9c97f;
  --g2: #8db35f;
  --g3: #5f8338;
  --g4: #364f20;
  --ink: #0f1c09;
  --crit: #e05362;
  --crit-bg: rgba(224, 83, 98, 0.12);
  --high: #e58846;
  --high-bg: rgba(229, 136, 70, 0.12);
  --med: #d4b445;
  --med-bg: rgba(212, 180, 69, 0.12);
  --low: #5fa8d3;
  --low-bg: rgba(95, 168, 211, 0.12);
  --inf: #8f98aa;
  --mono: "JetBrains Mono", "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  --bg: #f4f6f0;
  --panel: #ffffff;
  --panel2: #f8faf5;
  --raise: #eaefe4;
  --raise-hover: #dfe7d7;
  --line: rgba(0, 0, 0, 0.09);
  --line2: rgba(0, 0, 0, 0.16);
  --txt: #1c2419;
  --txt-bright: #0c120a;
  --mut: #5e6b5a;
  --lav: #30402b;
  --g1: #4a7527;
  --g2: #5f8e36;
  --g3: #3f6620;
  --g4: #284414;
  --ink: #ffffff;
  --crit: #c03947;
  --crit-bg: rgba(192, 57, 71, 0.12);
  --high: #c26e25;
  --high-bg: rgba(194, 110, 37, 0.12);
  --med: #a38c20;
  --med-bg: rgba(163, 140, 32, 0.12);
  --low: #2b7a9e;
  --low-bg: rgba(43, 122, 158, 0.12);
  --inf: #647082;
}

html, body {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}
body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

:focus-visible { outline: 2px solid var(--g2); outline-offset: 2px; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* Canvas Backgrounds */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(900px 480px at 50% 18%, #0c130d 0%, var(--bg) 70%);
}
:root[data-theme="light"] .bg {
  background: radial-gradient(900px 480px at 50% 18%, #e0ead2 0%, var(--bg) 70%);
}
.dotgrid-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  mask-image: radial-gradient(85% 80% at 50% 42%, black 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(85% 80% at 50% 42%, black 35%, transparent 100%);
}
#rubble { position: fixed; left: 0; bottom: 0; width: 100%; height: 90px; z-index: 0; pointer-events: none; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }

/* Sticky Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  gap: 16px;
}
:root[data-theme="light"] .topbar { background: rgba(244, 246, 240, 0.92); }

.topbar-left { display: flex; align-items: center; gap: 24px; }

.logo {
  font-size: 17px;
  font-weight: 800;
  color: var(--g2);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s ease;
  user-select: none;
}
.logo:hover { transform: translateY(-1px); filter: brightness(1.2); }
.logo-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 13px;
  background: var(--g2);
  box-shadow: 0 4px 0 var(--g4);
}
.logo-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 16px;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--g2) 0 4px, transparent 4px 6px);
}
.logo-badge {
  font-size: 9.5px;
  color: var(--mut);
  border: 1px solid var(--line2);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 1px;
  font-weight: 700;
}

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  position: relative;
  color: var(--mut);
  font-size: 13.5px;
  padding: 17px 12px 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 0.15s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--txt-bright); }
.nav-links a.on {
  color: var(--txt-bright);
  border-bottom-color: var(--g2);
}
.nav-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--raise);
  border: 1px solid var(--line2);
  color: var(--mut);
  font-weight: 700;
}
.nav-links a.on .nav-badge {
  background: rgba(141, 179, 95, 0.2);
  border-color: rgba(141, 179, 95, 0.45);
  color: var(--g1);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Command Palette trigger */
.cmd-btn {
  background: var(--raise);
  border: 1px solid var(--line2);
  color: var(--mut);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cmd-btn:hover { border-color: var(--g2); color: #fff; }
.cmd-kbd {
  font-size: 10.5px;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: var(--txt);
}

/* Audio FX Toggle */
.sfx-btn {
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--mut);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.sfx-btn.on { border-color: rgba(141, 179, 95, 0.4); color: var(--g1); }
.sfx-btn:hover { color: #fff; border-color: var(--g2); }

.lang-btn {
  background: transparent;
  color: var(--mut);
  border: 1px solid var(--line2);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  min-width: 40px;
  transition: all 0.15s ease;
}
.lang-btn:hover { color: #fff; border-color: var(--g2); background: rgba(255, 255, 255, 0.05); }

.btn-plans {
  background: transparent;
  color: var(--g1);
  border: 1px solid rgba(141, 179, 95, 0.45);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s var(--ease);
}
.btn-plans:hover {
  background: rgba(141, 179, 95, 0.14);
  border-color: var(--g2);
  color: #fff;
  box-shadow: 0 0 14px rgba(141, 179, 95, 0.25);
  transform: translateY(-1px);
}
.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--raise);
  color: var(--g2);
  border: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.avatar-btn:hover { border-color: var(--g2); color: #fff; transform: translateY(-1px); }

/* Main Page Container */
.main-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.view {
  display: block;
  animation: fadeInView 0.28s var(--ease);
}
.view.hidden { display: none; }
@keyframes fadeInView {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* =====================================================================
   HERO SCANNER (Iconic Citadel Centerpiece as in original index 2.0)
   ===================================================================== */
.hero-center {
  text-align: center;
  padding: 24px 0 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#wordmark {
  display: block;
  max-width: 100%;
  margin: 0 auto 28px;
  image-rendering: pixelated;
  cursor: pointer;
}
.hero-center h1 {
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.25;
  font-weight: 800;
  color: var(--lav);
  letter-spacing: -0.3px;
}
.hero-center .sub {
  margin: 12px 0 28px;
  color: var(--mut);
  font-size: 14px;
  line-height: 1.6;
  max-width: 580px;
}
.hero-center .sub::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--g2);
  margin-left: 7px;
  vertical-align: -2px;
  opacity: 0.7;
  animation: caretBlink 1.1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.scan-form {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 6px 6px 6px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
  text-align: left;
}
.scan-form:focus-within {
  border-color: rgba(141, 179, 95, 0.55);
  box-shadow: 0 0 0 3px rgba(141, 179, 95, 0.12);
}
.scan-form.scanning {
  border-color: rgba(163, 212, 107, 0.7);
  box-shadow: 0 0 0 3px rgba(163, 212, 107, 0.16);
}
.scan-form .pfx { color: var(--g3); font-size: 17px; font-weight: 800; position: relative; z-index: 2; }
.url-wrap { flex: 1; min-width: 0; position: relative; z-index: 2; display: flex; align-items: center; }
.url-wrap input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--txt-bright);
  font-size: 16px;
  padding: 9px 0;
  caret-color: var(--g2);
}
.url-example {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #5f6877;
  font-size: 16px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.url-wrap.has-text .url-example { opacity: 0; transform: translateY(-50%) translateX(12px); }

.scan-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(111, 154, 58, 0.35), rgba(163, 212, 107, 0.25));
  border-right: 2px solid var(--g2);
  transition: width 0.25s linear;
}
.scan-form:not(.scanning) .scan-fill { display: none; }
.scan-pct { font-size: 13px; color: var(--g1); min-width: 44px; text-align: right; display: none; font-variant-numeric: tabular-nums; position: relative; z-index: 2; }
.scan-form.scanning .scan-pct { display: block; }

.kbd-badge {
  position: relative;
  z-index: 2;
  font-size: 11.5px;
  color: #5f6877;
  border: 1px solid var(--line2);
  border-radius: 3px;
  padding: 1px 6px;
  line-height: 18px;
}
.url-wrap:focus-within ~ .kbd-badge, .url-wrap.has-text ~ .kbd-badge, .scan-form.scanning .kbd-badge { display: none; }

.paste-btn {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #8a93a3;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.paste-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.paste-btn.ok { color: var(--g2); border-color: rgba(163, 212, 107, 0.4); }

.hero-links { margin-top: 16px; display: flex; gap: 24px; justify-content: center; align-items: center; }
.link-btn {
  background: none;
  border: 0;
  color: var(--mut);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
  transition: all 0.15s ease;
}
.link-btn:hover { color: #fff; border-color: var(--g2); }
.link-btn.opt::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  margin-left: 8px;
  transition: transform 0.2s;
}
.link-btn.opt[aria-expanded="true"]::after { transform: rotate(225deg) translate(-2px, -2px); }

.sev-pick { display: none; flex-direction: column; gap: 10px; margin-top: 14px; align-items: center; }
.sev-pick.open { display: flex; }
.opt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 680px; align-items: center; }
.opt-row .lbl { font-size: 12px; color: var(--mut); min-width: 80px; text-align: right; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--mut);
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip::before { content: ""; width: 7px; height: 7px; background: var(--c, var(--g2)); opacity: 0.4; }
.chip[aria-pressed="true"] { color: var(--txt-bright); border-color: var(--c, var(--g2)); background: rgba(255, 255, 255, 0.05); }
.chip[aria-pressed="true"]::before { opacity: 1; }
.chip:hover { color: #fff; }

/* Recent scan target chips */
.recent-chips {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  max-width: 720px;
}
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--txt);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.recent-chip:hover { border-color: var(--line2); color: #fff; transform: translateY(-1px); }
.recent-chip i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.recent-chip b { font-size: 12px; color: var(--c); margin-left: 2px; }

/* =====================================================================
   ATTACK SURFACE COMMAND CENTER (Below Hero on Home)
   ===================================================================== */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 { font-size: 16px; font-weight: 700; color: var(--txt-bright); }
.card-head a { font-size: 12.5px; color: var(--g1); font-weight: 600; }
.card-head a:hover { text-decoration: underline; }

.sev-bar {
  display: flex;
  height: 8px;
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 16px;
  background: #07090c;
  border: 1px solid var(--line);
}
.sev-bar i { display: block; height: 100%; transition: width 0.4s var(--ease); }

.sev-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.rc-card {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.rc-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--c);
}
.rc-card:hover {
  border-color: var(--c);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.rc-label { font-size: 13.5px; font-weight: 700; color: var(--c); display: flex; align-items: center; justify-content: space-between; }
.rc-num { font-size: 42px; font-weight: 800; color: var(--txt-bright); line-height: 1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.rc-sub { font-size: 12px; color: var(--mut); }
.rc-k { --c: var(--crit); } .rc-h { --c: var(--high); } .rc-m { --c: var(--med); } .rc-l { --c: var(--low); }

.home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.prow {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-align: left;
  padding: 12px 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease;
}
.prow:first-child { border-top: 0; }
.prow:hover { background: rgba(255, 255, 255, 0.035); }
.prow .pt { font-weight: 700; color: var(--txt-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pm { color: var(--mut); font-size: 12px; margin-top: 2px; }

.tl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.tl-row:first-child { border-top: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--g2); flex-shrink: 0; }
.tl-dot.running { background: var(--g1); box-shadow: 0 0 8px var(--g1); animation: pulseDot 1.6s infinite; }
.tl-dot.sched { background: var(--med); }

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

/* =====================================================================
   DATA TABLES (Runs & Findings)
   ===================================================================== */
.page-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-title { font-size: 26px; font-weight: 800; color: var(--txt-bright); letter-spacing: -0.3px; }
.page-sub { color: var(--mut); font-size: 13.5px; margin-top: 4px; }

.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-input {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--txt-bright);
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 5px;
  outline: 0;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus { border-color: rgba(141, 179, 95, 0.55); box-shadow: 0 0 0 2px rgba(141, 179, 95, 0.12); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fchip {
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--mut);
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fchip:hover { color: #fff; border-color: var(--line); }
.fchip[aria-pressed="true"] { background: var(--g2); color: var(--ink); border-color: var(--g2); font-weight: 700; }

.table-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.tbl-row {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  width: 100%;
  background: transparent;
  border-left: 0; border-right: 0; border-bottom: 0;
  color: inherit;
}
.tbl-row:first-child { border-top: 0; }
.tbl-head {
  color: var(--mut);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02);
  padding: 11px 18px;
}
button.tbl-row { cursor: pointer; transition: background 0.15s ease; }
button.tbl-row:hover { background: rgba(255, 255, 255, 0.04); }

.runs-cols { grid-template-columns: 1.5fr 1.2fr 120px 1.2fr 90px; }
.findings-cols { grid-template-columns: 110px 2.2fr 1.2fr 100px; }

.tag-sev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--c);
  color: var(--c);
  background: rgba(255, 255, 255, 0.03);
}
.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line2);
  color: var(--mut);
  white-space: nowrap;
}
.st-badge.running { color: var(--g1); border-color: rgba(141, 179, 95, 0.45); background: rgba(141, 179, 95, 0.08); }
.st-badge.completed, .st-badge.done { color: var(--txt-bright); border-color: var(--line2); }
.st-badge.scheduled { color: var(--med); border-color: rgba(212, 180, 69, 0.45); }
.st-badge.open { color: var(--crit); border-color: rgba(224, 83, 98, 0.45); }
.st-badge.accepted { color: var(--med); border-color: rgba(212, 180, 69, 0.45); }
.st-badge.closed { color: var(--g2); border-color: rgba(141, 179, 95, 0.45); }

.scanner-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sc-badge {
  width: 32px; height: 32px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  flex-shrink: 0;
}
.sc-badge.w { background: #1f2833; color: #85c1e9; border: 1px solid #2e4053; }
.sc-badge.t { background: #232b2b; color: #f8c471; border: 1px solid #3d4a41; }
.sc-badge.p { background: #2c2738; color: #d7bde2; border: 1px solid #4a3e5c; }
.sc-badge.slack { background: #2e2430; color: #e8a7ea; border: 1px solid #4d3852; }
.sc-badge.github { background: #24292e; color: #fff; border: 1px solid #444d56; }
.sc-badge.jira { background: #172b4d; color: #4c9aff; border: 1px solid #264b82; }
.sc-badge.webhooks { background: #2c1d24; color: #f1948a; border: 1px solid #563342; }

.pbar { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; flex: 1; min-width: 80px; }
.pbar i { display: block; height: 100%; background: var(--g2); transition: width 0.3s ease; }

.btn {
  border: 0;
  cursor: pointer;
  background: var(--g2);
  color: var(--ink);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--g1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(141, 179, 95, 0.28);
}
.btn:active { transform: translateY(1px); }

.btn-alt {
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line2);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-alt:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: var(--txt);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--crit);
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* =====================================================================
   ASSETS, CONNECTIONS & PREFERENCES
   ===================================================================== */
.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.asset-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.18s var(--ease);
}
.asset-card:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.asset-head { display: flex; align-items: center; gap: 12px; }
.asset-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--g2);
  color: var(--ink);
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.asset-title { font-size: 15px; font-weight: 700; color: var(--txt-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-sub { font-size: 12px; color: var(--mut); }

.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.conn-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.18s ease;
}
.conn-card:hover { border-color: var(--line2); }
.conn-top { display: flex; justify-content: space-between; align-items: center; }
.conn-desc { font-size: 13px; color: var(--mut); line-height: 1.5; min-height: 38px; }

.pref-shell { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.pref-nav { display: flex; flex-direction: column; gap: 3px; }
.pref-nav button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--mut);
}
.pref-nav button:hover { color: #fff; background: rgba(255, 255, 255, 0.03); }
.pref-nav button.on {
  border-left-color: var(--g2);
  color: var(--txt-bright);
  background: var(--panel);
}
.pref-nav button b { font-size: 13.5px; }
.pref-nav button span { font-size: 11.5px; color: var(--mut); }

.pref-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.pref-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--mut); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--txt-bright);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 5px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: rgba(141, 179, 95, 0.55);
  box-shadow: 0 0 0 2px rgba(141, 179, 95, 0.12);
}

.notif-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.notif-item:first-child { border-top: 0; }
.sw {
  position: relative;
  width: 42px; height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line2);
  border-radius: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.sw::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #8a93a3;
  border-radius: 50%;
  transition: left 0.2s var(--ease), background 0.2s;
}
.sw[aria-pressed="true"] { background: rgba(141, 179, 95, 0.35); border-color: var(--g2); }
.sw[aria-pressed="true"]::after { left: 20px; background: var(--g1); }

.themes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
.thm-card {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.thm-card.on { border-color: var(--g2); box-shadow: 0 0 0 1px var(--g2); }
.thm-preview { height: 60px; border-radius: 4px; border: 1px solid var(--line); }

/* =====================================================================
   MODALS, DRAWERS & KILLER HUD ELEMENTS
   ===================================================================== */
.ov {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.2s ease-out;
}
.ov[hidden] { display: none; }
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 26px;
  width: 100%;
  max-width: 700px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
  animation: scaleModal 0.24s var(--ease);
}
@keyframes scaleModal {
  from { transform: scale(0.96) translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close {
  background: transparent;
  border: 0;
  color: var(--mut);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: #fff; }

.plan-toggle {
  display: inline-flex;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 20px;
}
.plan-toggle button {
  background: transparent;
  border: 0;
  color: var(--mut);
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
}
.plan-toggle button.on { background: var(--g2); color: var(--ink); }

.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
  transition: all 0.15s ease;
}
.plan-card.hot { border-color: var(--g2); box-shadow: 0 0 0 1px var(--g2); }
.plan-card h3 { font-size: 15px; color: var(--txt-bright); margin-bottom: 6px; }
.plan-price { font-size: 26px; font-weight: 800; color: var(--txt-bright); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 12px; color: var(--mut); font-weight: 500; }
.plan-feat { font-size: 12px; color: var(--mut); margin-bottom: 16px; line-height: 1.45; }

/* Slide-over Drawer */
.dr {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 92;
  width: min(520px, 96vw);
  background: var(--panel);
  border-left: 1px solid var(--line2);
  padding: 24px;
  overflow-y: auto;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.65);
  animation: slideDrawer 0.25s var(--ease);
}
.dr[hidden] { display: none; }
@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: none; }
}

.dr-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.dr-close { background: transparent; border: 0; color: var(--mut); font-size: 22px; cursor: pointer; padding: 0 4px; }
.dr-close:hover { color: #fff; }

.dr-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line2);
  margin: 14px 0 16px;
}
.dr-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--mut);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dr-tabs button.on { color: var(--txt-bright); border-bottom-color: var(--g2); }

.code-block {
  background: #06080b;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #c9d1dc;
  overflow-x: auto;
  font-family: var(--mono);
  white-space: pre;
}

.kv-list { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13px; margin: 16px 0; }
.kv-list dt { color: var(--mut); }
.kv-list dd { color: var(--txt-bright); overflow-wrap: anywhere; }

.fix-box {
  background: rgba(141, 179, 95, 0.08);
  border: 1px solid rgba(141, 179, 95, 0.35);
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #cfe0b8;
  margin: 16px 0;
}
.dr-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* =====================================================================
   COMMAND PALETTE (Spotlight HUD)
   ===================================================================== */
.cmd-palette {
  width: 100%;
  max-width: 580px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: scaleModal 0.2s var(--ease);
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.cmd-input-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--txt-bright);
  font-size: 15px;
}
.cmd-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}
.cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--txt);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}
.cmd-item:hover, .cmd-item.active {
  background: rgba(141, 179, 95, 0.14);
  color: #fff;
}
.cmd-item b { color: var(--g1); font-weight: 700; margin-right: 8px; }
.cmd-item-kbd {
  font-size: 11px;
  color: var(--mut);
  background: var(--raise);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* =====================================================================
   LIVE NUCLEI-STYLE TERMINAL HUD (Floating Bottom-Right)
   ===================================================================== */
.cli-hud-toggle {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 60;
  background: rgba(14, 18, 23, 0.95);
  border: 1px solid rgba(141, 179, 95, 0.5);
  color: var(--g1);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.2s var(--ease);
}
.cli-hud-toggle:hover {
  background: var(--g2);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(141, 179, 95, 0.35);
}

.cli-panel {
  position: fixed;
  right: 24px;
  bottom: 64px;
  z-index: 61;
  width: min(620px, calc(100vw - 32px));
  height: 340px;
  background: rgba(6, 8, 11, 0.96);
  border: 1px solid var(--line2);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleModal 0.2s var(--ease);
  backdrop-filter: blur(10px);
}
.cli-panel[hidden] { display: none; }
.cli-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #0b0e13;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--txt);
}
.cli-logs {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  font-size: 11.5px;
  line-height: 1.65;
  font-family: var(--mono);
}
.cli-line { margin-bottom: 4px; word-break: break-all; }
.log-inf { color: #85c1e9; }
.log-crit { color: var(--crit); font-weight: 700; }
.log-high { color: var(--high); font-weight: 700; }
.log-med { color: var(--med); }

/* Citadel Results View & Map */
.result-header-bar {
  display: grid;
  grid-template-columns: 1.2fr auto 1.4fr auto 0.8fr 140px;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 16px;
}
.result-subnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.seg-tabs {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 3px;
  gap: 3px;
}
.seg-tabs button {
  background: transparent;
  border: 0;
  color: var(--mut);
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.seg-tabs button:hover { color: #fff; }
.seg-tabs button.on { background: var(--g2); color: var(--ink); font-weight: 700; }

.score-panel { display: flex; flex-direction: column; justify-content: space-between; }
.score-num { font-size: 52px; font-weight: 800; line-height: 1; color: var(--txt-bright); font-variant-numeric: tabular-nums; }
.score-grade { font-size: 24px; font-weight: 800; margin-left: 12px; }
.score-pixels { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; height: 12px; margin: 12px 0; }
.score-pixels i { display: block; background: rgba(255, 255, 255, 0.07); }
.score-pixels i.on { background: var(--g2); }

.vmap-container {
  position: relative;
  height: min(70vh, 640px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #05070a;
}
#vulnMap { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#vulnMap.dragging { cursor: grabbing; }

.vmap-tip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  background: rgba(14, 18, 23, 0.96);
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 280px;
  transform: translate(-50%, calc(-100% - 14px));
  z-index: 3;
}
.vmap-tip.show { opacity: 1; }

.vmap-ctrl {
  position: absolute;
  right: 14px; bottom: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vmap-ctrl button {
  width: 36px; height: 36px;
  background: rgba(14, 18, 23, 0.95);
  border: 1px solid var(--line2);
  color: #c2c9d6;
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.vmap-ctrl button:hover { border-color: var(--g2); color: #fff; }

/* Toasts */
#toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(14, 18, 23, 0.98);
  border: 1px solid var(--g2);
  color: var(--txt-bright);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  animation: dropToast 0.24s var(--ease);
}
@keyframes dropToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Footer */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 28px 16px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
  color: #5e6675;
  font-size: 12.5px;
}
.footer a { color: #8b93a5; }
.footer a:hover { color: #fff; }
.socials { display: flex; background: rgba(0, 0, 0, 0.4); border-radius: 5px; padding: 3px; }
.socials a { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: #b9c0ce; }

/* =====================================================================
   MOBILE-FIRST ADAPTATIONS & TOUCH UX (Desktop remains 100% intact)
   ===================================================================== */
.mobile-bottom-nav {
  display: none;
}

button, a, input, select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 960px) {
  .topbar { padding: 0 16px; }
  .main-shell { padding: 16px 16px 60px; }
  .sev-grid { grid-template-columns: repeat(2, 1fr); }
  .home-grid, .pref-shell { grid-template-columns: 1fr; }
  .pref-nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .pref-nav::-webkit-scrollbar { display: none; }
  .pref-nav button { border-left: 0; border-bottom: 2px solid var(--line); flex-shrink: 0; }
  .pref-nav button.on { border-bottom-color: var(--g2); }
  .pref-form-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* 1. Mobile Bottom Navigation Bar (iOS/Android Native Style) */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(14, 18, 23, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line2);
    justify-content: space-around;
    align-items: center;
    z-index: 95;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--mut);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    gap: 3px;
    position: relative;
    transition: color 0.15s ease;
  }
  .mobile-bottom-nav a.on {
    color: var(--g1);
  }
  .mobile-bottom-nav a svg {
    transition: transform 0.15s ease, stroke 0.15s ease;
    stroke: var(--mut);
  }
  .mobile-bottom-nav a.on svg {
    transform: translateY(-1px);
    stroke: var(--g1);
  }
  .mb-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mb-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--raise);
    border: 1px solid var(--line2);
    color: var(--txt-bright);
    font-size: 9px;
    font-weight: 700;
    padding: 0 4px;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* 2. Topbar on Mobile - Perfectly scaled for 360-420px screens */
  .topbar {
    padding: 0 12px;
    height: 50px;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .nav-links {
    display: none !important;
  }
  .logo {
    gap: 7px;
  }
  .logo-text {
    font-size: 14px;
    letter-spacing: 0.5px;
  }
  .logo-badge {
    display: none !important;
  }
  .topbar-right {
    gap: 6px;
  }
  .cmd-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
  .cmd-btn span:first-child {
    display: none;
  }
  .cmd-btn .cmd-kbd {
    display: inline-block;
    padding: 2px 5px;
    font-size: 10px;
  }
  .sfx-btn span:last-child {
    display: none;
  }
  .sfx-btn {
    padding: 6px 8px;
    font-size: 12px;
  }
  .btn-plans {
    display: none !important;
  }
  .lang-btn {
    padding: 5px 8px;
    font-size: 11px;
    min-width: 34px;
  }
  .avatar-btn {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  /* 3. Main Container & Spacing */
  .main-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px calc(76px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .footer {
    margin: 0 14px calc(74px + env(safe-area-inset-bottom));
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 11.5px;
  }

  /* 4. Hero Section & Scan Form - No overflowing flex items! */
  .hero-center {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 0 20px;
    overflow-x: hidden;
  }
  #wordmark {
    max-width: 100% !important;
    height: auto !important;
    margin-bottom: 16px;
  }
  .hero-center h1 {
    font-size: 20px;
    line-height: 1.25;
    padding: 0 4px;
  }
  .hero-center .sub {
    font-size: 12px;
    margin: 8px 0 16px;
    padding: 0 6px;
    max-width: 100%;
  }
  .scan-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-wrap: wrap;
    padding: 6px;
    gap: 6px;
  }
  .scan-form .pfx {
    padding-left: 6px;
    font-size: 15px;
  }
  .scan-form .url-wrap {
    min-width: 120px;
    flex: 1;
  }
  .scan-form .url-wrap input {
    font-size: 14px;
    padding: 6px 0;
  }
  .url-example {
    font-size: 14px;
  }
  .scan-form .kbd-badge {
    display: none !important;
  }
  .scan-form .btn {
    width: 100%;
    justify-content: center;
    height: 40px;
    font-size: 13.5px;
  }
  .scan-pct {
    display: none;
  }
  .hero-links {
    margin-top: 12px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }
  .hero-links .link-btn {
    font-size: 12px;
  }

  /* Preset Chips - Fluid Touch Carousel with no parent overflow */
  .recent-chips {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 10px;
    margin-top: 16px;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .recent-chips::-webkit-scrollbar { display: none; }
  .recent-chip {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  /* 5. Cards & Grids on Mobile */
  .card {
    padding: 14px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .card-head h2 {
    font-size: 14.5px;
  }
  .sev-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .rc-card {
    padding: 12px 14px;
    gap: 4px;
  }
  .rc-label {
    font-size: 12px;
  }
  .rc-num {
    font-size: 20px;
  }
  .rc-sub {
    font-size: 11px;
  }
  .home-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .assets-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .conn-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pref-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pref-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .pref-nav::-webkit-scrollbar { display: none; }
  .pref-nav button {
    flex-shrink: 0;
    border-left: 0;
    border-bottom: 2px solid var(--line);
    padding: 8px 12px;
    font-size: 12.5px;
  }
  .pref-nav button.on {
    border-bottom-color: var(--g2);
  }
  .pref-form-grid {
    grid-template-columns: 1fr;
  }

  /* 6. Table-to-Cards Transformation (Runs & Findings) */
  .table-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: transparent;
    border: 0;
  }
  .tbl-head {
    display: none !important;
  }
  .runs-cols, .findings-cols {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-sizing: border-box;
    width: 100%;
  }
  .runs-cols > div:first-child,
  .findings-cols > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .search-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .filter-chips {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chips .fchip {
    flex-shrink: 0;
  }

  /* 7. Bottom Sheet Transformation for Finding Detail Drawer */
  .dr {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-top: 1px solid var(--line2);
    padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.85);
    animation: slideUpSheet 0.28s var(--ease);
    box-sizing: border-box;
  }
  .dr::before {
    content: '';
    display: block;
    width: 44px;
    height: 4px;
    background: var(--line2);
    border-radius: 2px;
    margin: 0 auto 12px auto;
  }

  /* 8. Floating CLI HUD and Modals */
  .cli-hud-toggle {
    bottom: calc(66px + env(safe-area-inset-bottom));
    right: 12px;
    padding: 6px 12px;
    font-size: 11px;
  }
  .cli-panel {
    left: 8px;
    right: 8px;
    bottom: calc(112px + env(safe-area-inset-bottom));
    width: auto;
    height: 310px;
    box-sizing: border-box;
  }
  .modal-box {
    width: calc(100vw - 24px);
    max-height: 88vh;
    padding: 16px;
    box-sizing: border-box;
  }
  .result-header-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }
  .result-subnav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .vmap-container {
    height: 340px;
    width: 100%;
  }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@media (max-width: 440px) {
  .sev-grid { grid-template-columns: 1fr; }
  .page-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-top button { width: 100%; justify-content: center; }
  .topbar-right { gap: 4px; }
}

/* =====================================================================
   SCAN STATISTICS CARDS & GRID (Responsive with Low severity)
   ===================================================================== */
.res-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .res-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
.stat-card {
  background: var(--panel2);
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--card-accent, var(--g2));
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.18s var(--ease), border-color 0.18s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line2);
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.stat-card .stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--txt-bright);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-card.crit { --card-accent: var(--crit); }
.stat-card.high { --card-accent: var(--high); }
.stat-card.med  { --card-accent: var(--med); }
.stat-card.low  { --card-accent: var(--low); }


/* ---- Auth modal ---- */
.auth-list { display: flex; flex-direction: column; gap: 10px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border-radius: 8px;
  background: var(--raise); color: var(--txt-bright);
  border: 1px solid var(--line2); font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: all .15s ease;
}
.auth-btn:hover { background: var(--raise-hover); border-color: var(--g2); transform: translateY(-1px); }
.auth-empty { color: var(--mut); font-size: 13px; padding: 10px 0; }
.auth-me { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-me img, .auth-ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.auth-ph { display: flex; align-items: center; justify-content: center; background: var(--raise); color: var(--g2); font-weight: 700; }
#avatarBtn { overflow: hidden; }
#modalBox:has(.auth-list), #modalBox:has(.auth-me) { max-width: 420px; }
