:root {
  color-scheme: dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --mono: var(--font-mono);
  --bg-0: #05070d;
  --bg-1: #080d18;
  --fg: #f4f7ff;
  --fg-soft: #c9d2e6;
  --dim: #a7b2ca;
  --dim-2: #8592ad;
  --muted: var(--dim);
  --acc: #8b7cff;
  --acc-blue: #3b82f6;
  --acc-purple: #8b5cf6;
  --ok: #4ade80;
  --bad: #ff6b7a;
  --warn: #fbbf24;
  --line: rgba(255, 255, 255, 0.075);
  --glass-bg: rgba(255, 255, 255, 0.085);
  --glass-bg-soft: rgba(255, 255, 255, 0.055);
  --glass-bg-strong: rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-edge: rgba(255, 255, 255, 0.25);
  --blur: 22px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
  --glow-blue: rgba(59, 130, 246, 0.34);
  --glow-purple: rgba(139, 92, 246, 0.32);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-0); scroll-behavior: smooth; touch-action: manipulation; }
body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(14px, 2.4vw, 30px);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  touch-action: manipulation;
}
a, button, [role="button"], input, select, textarea, label, summary,
#tabs-nav, #tabs-nav a, .qd-plus, .qd-send {
  touch-action: manipulation;
}
body::before {
  content: "";
  position: fixed;
  inset: -30vmax;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 8%, var(--glow-blue), transparent 68%),
    radial-gradient(44vmax 44vmax at 88% 18%, var(--glow-purple), transparent 70%),
    radial-gradient(42vmax 42vmax at 58% 92%, rgba(37, 99, 235, 0.18), transparent 72%);
  filter: blur(18px);
  animation: ambientDrift 34s var(--ease) infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
    linear-gradient(180deg, rgba(5, 7, 13, 0) 0%, rgba(5, 7, 13, 0.52) 100%);
}
@keyframes ambientDrift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(10px) scale(0.992); }
  to { opacity: 1; transform: none; }
}
@keyframes pageSettle {
  from { opacity: 0; transform: translateY(14px) scale(0.988); }
  to { opacity: 1; transform: none; }
}
@keyframes pageForward {
  from { opacity: 0; transform: translate3d(18px, 8px, 0) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@keyframes pageBack {
  from { opacity: 0; transform: translate3d(-18px, 8px, 0) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@keyframes navTap {
  0% { transform: scale(1); }
  38% { transform: scale(1.11); }
  100% { transform: scale(1); }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: padding-box; }

a { color: #b8c6ff; text-decoration-color: rgba(184, 198, 255, 0.35); text-underline-offset: 3px; }
a:hover { color: #dbe2ff; }

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
h1 .tag {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(3, 7, 15, 0.48);
}
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
img { max-width: 100%; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
}
.hidden { display: none !important; }
.muted { color: var(--dim); font-size: 13px; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.err {
  margin-top: 8px;
  color: #ffadb7;
  font-size: 13px;
  line-height: 1.45;
}
.error-plain .error-plain-text { color: #ffc4ca; }
.error-detail {
  margin-top: 6px;
  color: var(--dim);
  font-size: 12px;
}
.error-detail > summary {
  cursor: pointer;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}
.error-detail .code-block { margin-top: 6px; }
.scan-coverage {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.06);
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.scan-coverage > b { display: block; margin-bottom: 4px; color: #ffe0a0; }
.coverage-map { list-style: none; margin: 4px 0 0; padding: 0; }
.coverage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 3px 0;
  border-top: 1px solid rgba(251, 191, 36, 0.12);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.coverage-row:first-child { border-top: 0; }
.coverage-host { color: var(--fg); }
.coverage-state { color: #ffe0a0; }
.coverage-row[data-coverage="never_reached"] .coverage-state { color: var(--dim); }
.coverage-stats { color: var(--dim); }
.c-ok { color: var(--ok); }
.c-bad { color: var(--bad); }
.c-dim { color: var(--dim); }
.c-acc { color: #a99cff; }
.c-warn { color: var(--warn); }

#boot-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 70vh;
  color: var(--dim);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}
.boot-spiral {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  color: #eef2ff;
}
.boot-spiral-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: bootSpiralSpin 2.4s linear infinite;
}
.boot-spiral-path {
  fill: none;
  stroke: #a99cff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 42 130;
  filter: drop-shadow(0 0 8px rgba(169, 156, 255, 0.45));
  animation: bootSpiralDraw 1.8s var(--ease) infinite;
}
.boot-logo {
  position: relative;
  width: 23px;
  height: 23px;
  color: #f4f7ff;
  filter: drop-shadow(0 0 10px rgba(139, 124, 255, 0.35));
  animation: bootLogoBreath 2.4s var(--ease) infinite;
}
.boot-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.boot-wordmark b { color: var(--fg); font-weight: 700; }
.boot-wordmark span { color: var(--dim-2); font-weight: 600; font-size: 11px; }
@keyframes bootSpiralSpin {
  to { transform: rotate(360deg); }
}
@keyframes bootSpiralDraw {
  0% { stroke-dashoffset: 168; opacity: 0.35; }
  45% { opacity: 1; }
  100% { stroke-dashoffset: -168; opacity: 0.35; }
}
@keyframes bootLogoBreath {
  0%, 100% { opacity: 0.72; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

.card, .hero, .app-bar, #tabs-nav, .term, .pack, .feat, .step3,
.stat, .finding-card, .host-card, .change-block, .trace-item,
.scan-live, .host-scan-item, .advanced, .finding-detail,
.scan-status-line, .agent-trace, .ob-step, .add-scope {
  background: linear-gradient(150deg, var(--glass-bg-strong), var(--glass-bg-soft));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-md);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
}
.card {
  position: relative;
  margin: 18px 0;
  padding: clamp(18px, 2.2vw, 28px);
  border-radius: var(--radius-lg);
}
.card h2 {
  margin: 0 0 16px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.card h3 {
  margin: 20px 0 10px;
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.card h3:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.big {
  margin: 6px 0 4px;
  font-size: clamp(38px, 7vw, 56px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.055em;
}
.big small {
  color: var(--dim);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--fg);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.brand b { font-weight: inherit; }
.brand .brand-pro {
  background: linear-gradient(105deg, #7db2ff, #a78bfa 58%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.beta-tag {
  display: inline-flex;
  align-self: center;
  flex: 0 0 auto;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(139, 124, 255, 0.38);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.20));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #c7c0ff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.landing-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 6px 22px;
}
.landing-bar .brand-tag { margin-left: auto; }

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 18px;
  padding: clamp(44px, 7vw, 92px) clamp(20px, 5vw, 76px);
  border-radius: var(--radius-xl);
  text-align: center;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045) 58%, rgba(139, 92, 246, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 40px 100px rgba(0, 0, 0, 0.55);
  animation: enter 0.6s var(--spring) both;
}
.hero::before {
  content: "";
  position: absolute;
  top: -52%;
  left: 50%;
  width: min(760px, 92%);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.36), rgba(59, 130, 246, 0.16) 44%, transparent 68%);
  filter: blur(14px);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 8% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-title {
  max-width: 880px;
  margin: 0 auto 20px;
  font-size: clamp(40px, 7.4vw, 78px);
  font-weight: 760;
  line-height: 0.98;
  letter-spacing: -0.06em;
}
.hero-title .grad {
  background: linear-gradient(100deg, #8ec5ff 0%, #a78bfa 56%, #d8b4fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub {
  max-width: 650px;
  margin: 0 auto 28px;
  color: var(--fg-soft);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.65;
}
.hero .muted { margin-top: 14px; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.landing-grid, .steps3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.feat, .step3 {
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  transition: transform 0.3s var(--spring), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.feat:hover, .step3:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
}
.feat h3, .step3 h3 {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-transform: none;
}
.feat p, .step3 p {
  margin: 0;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.65;
}
.step3 .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border: 1px solid rgba(139, 124, 255, 0.45);
  border-radius: var(--radius-pill);
  background: linear-gradient(150deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #c9c0ff;
  font-size: 14px;
  font-weight: 700;
}
.step3 code { background: rgba(3, 7, 15, 0.5); }

.term-label {
  margin-bottom: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.term {
  min-height: 218px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(3, 7, 15, 0.78), rgba(10, 15, 28, 0.62));
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 24px 60px rgba(0, 0, 0, 0.45);
}
.term .out { color: var(--dim); }
.term .warn { color: var(--warn); }
.term .cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: linear-gradient(180deg, #7db2ff, #a78bfa);
  vertical-align: -2px;
  animation: blink 1s infinite;
}

.packs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.pack {
  position: relative;
  padding: 22px 16px 18px;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.028));
  text-align: center;
  transition: transform 0.3s var(--spring), border-color 0.3s var(--ease);
}
.pack:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.24); }
.pack.rec {
  border-color: rgba(153, 140, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 48px rgba(139, 92, 246, 0.2), var(--shadow-md);
}
.pack .badge {
  position: absolute;
  top: -11px;
  left: 50%;
  padding: 3px 11px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-pill);
  background: linear-gradient(105deg, #3b82f6, #8b5cf6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px rgba(59, 130, 246, 0.25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pack .price {
  margin: 8px 0 3px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.05em;
}
.pack .cr { margin-bottom: 14px; color: var(--dim); font-size: 13px; }
.pack button { width: 100%; }

.custom-buy { max-width: 340px; }
.custom-buy label { display: block; margin-bottom: 8px; color: var(--dim); font-size: 13px; }
.custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--dim);
  font-size: 20px;
}
.custom-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
}
.custom-buy .cr { margin-bottom: 12px; color: var(--dim); font-size: 13px; }
.custom-buy button { width: 100%; }

.checkout-promo { max-width: 340px; margin-top: 14px; }
.checkout-promo label {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 13px;
}
.checkout-promo input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  text-transform: uppercase;
}

.promo-offer {
  max-width: 420px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}
.promo-offer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.promo-offer-code { font-weight: 750; letter-spacing: 0.03em; }
.promo-offer-note { color: var(--dim); font-size: 11px; }
.promo-receipt { display: grid; gap: 6px; font-size: 13px; }
.promo-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.promo-line span:first-child { color: var(--dim); }
.promo-line .strike { text-decoration: line-through; opacity: 0.7; }
.promo-line .discount { color: var(--ok); }
.promo-line.total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.promo-redeem {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
}
.promo-redeem input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  text-transform: uppercase;
}
.promo-redeem button { white-space: nowrap; }
.promo-msg { margin-top: 10px; color: var(--ok); font-size: 13px; }
.promo-msg:empty { display: none; }
.promo-grant-status { margin: 4px 0 16px; }
.promo-grant-status:empty { display: none; }

button, .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.135), rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px rgba(0, 0, 0, 0.22);
  color: var(--fg);
  font: 600 14px/1.1 var(--font-sans);
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: transform 0.24s var(--spring), background 0.24s var(--ease),
    border-color 0.24s var(--ease), filter 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
button:hover, .btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.075));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 28px rgba(0, 0, 0, 0.28);
}
button:active, .btn:active { transform: scale(0.975); }
button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, summary:focus-visible,
.scope-chip:focus-visible, .host-scan-item:focus-visible,
[role="button"]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(196, 181, 253, 0.95);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.45), 0 0 18px rgba(139, 92, 246, 0.45);
}
button:disabled, .btn:disabled {
  opacity: 0.58;
  cursor: default;
  transform: none;
  filter: saturate(0.5);
}
button.ghost, .btn.ghost {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
button.ghost:hover, .btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }
button.danger {
  border-color: rgba(255, 107, 122, 0.38);
  background: rgba(255, 107, 122, 0.08);
  color: #ffb3bb;
}
button.danger:hover { border-color: rgba(255, 107, 122, 0.58); background: rgba(255, 107, 122, 0.14); }
button.small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: var(--radius-pill);
}
button.small.ghost { background: rgba(255, 255, 255, 0.035); }

.google-login-btn,
#scope-add, #set-save, #cred-add, #key-generate, #ai-prompt-save,
#ob-add, #ob-scan, #ob-schedule, #sd-run-ai, #new-key-copy,
button[data-pack] {
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 46%, #8b5cf6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 12px 30px rgba(59, 130, 246, 0.28), 0 0 30px rgba(139, 92, 246, 0.16);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
}
.google-login-btn:hover,
#scope-add:hover, #set-save:hover, #cred-add:hover, #key-generate:hover,
#ai-prompt-save:hover, #ob-add:hover, #ob-scan:hover, #ob-schedule:hover,
#sd-run-ai:hover, #new-key-copy:hover, button[data-pack]:hover {
  filter: brightness(1.09) saturate(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 38px rgba(59, 130, 246, 0.32), 0 0 38px rgba(139, 92, 246, 0.2);
}
.google-login-btn.ghost {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(139, 92, 246, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

input, select, textarea {
  max-width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font: 500 14px/1.4 var(--font-sans);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--dim-2); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.22); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(147, 197, 253, 0.62);
  background: rgba(4, 9, 19, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(59, 130, 246, 0.13);
  outline: none;
}
input[readonly] { color: var(--fg-soft); }
select {
  padding-right: 38px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select option { background: #0c1220; color: var(--fg); }
textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
}
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  flex: none;
  accent-color: var(--acc);
  cursor: pointer;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline-offset: 2px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; }
.row > span.muted { flex: none; }
.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  margin: 10px 0;
  color: var(--fg-soft);
  font-size: 13.5px;
}
.field { margin: 12px 0; }
.field label.lbl, .field > .lbl, .add-scope > .lbl {
  display: block;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field input[type="text"], .field input:not([type]), .field input[type="password"],
.field input[type="email"], .field input[type="url"], .field textarea { width: 100%; }
.ai-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
#ai-scan-prompt { min-height: 180px; }
.ai-prompt-actions .muted { flex: 1 1 160px; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  background: rgba(3, 7, 15, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  text-align: left;
  white-space: nowrap;
}
table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(10, 15, 27, 0.78);
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data.nmap-ports {
  min-width: 360px;
  width: 100%;
  table-layout: auto;
}
table.data.nmap-ports th, table.data.nmap-ports td {
  padding: 0 5px;
  border-bottom: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
table.data.nmap-ports th {
  position: static;
  padding: 0 5px;
  background: transparent;
  font-size: 8px;
  letter-spacing: 0.08em;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
table.data.nmap-ports th:first-child,
table.data.nmap-ports td:first-child { min-width: 66px; }
table.data.nmap-ports th:nth-child(2),
table.data.nmap-ports td:nth-child(2) { min-width: 46px; }
table.data.nmap-ports th:nth-child(3),
table.data.nmap-ports td:nth-child(3) { min-width: 60px; }
table.data.nmap-ports tbody tr:last-child td { border-bottom: 0; }
.ports-table .table-wrap { border: 0; }
.ports-table {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.phase-port-row .ports-table { margin-top: 2px; }
.mech-row .ports-table { margin-top: 2px; }

table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: rgba(255, 255, 255, 0.055); }
table.data tr.sel td { background: rgba(59, 130, 246, 0.14); }
table.data td.wrap-cell { min-width: 220px; white-space: normal; }
table.data tr.group-header td {
  padding: 12px 13px;
  border-top: 1px solid rgba(167, 139, 250, 0.22);
  border-bottom: 1px solid rgba(167, 139, 250, 0.28);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(59, 130, 246, 0.12));
  color: var(--fg);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: normal;
}
table.data tr.group-header .muted { color: var(--fg-soft); }
table.data tr.group-header .score-bar { margin-left: 6px; }
table.data tr.is-closed td { opacity: 0.55; }
table.data tr.is-informative td { opacity: 0.5; }
.row-actions { white-space: normal; }
.row-actions button { margin: 2px 4px 2px 0; }

/* Findings tables: fit the card instead of scrolling columns out of view. */
table.data.findings-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
table.data.findings-table th,
table.data.findings-table td {
  padding: 10px 9px;
  white-space: normal;
  overflow-wrap: anywhere;
}
table.data.findings-table td.wrap-cell { min-width: 0; }
table.data.findings-table .row-actions { white-space: normal; }
table.data.findings-table .row-actions button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 11.5px;
  white-space: normal;
}
.findings-view table.data.findings-table th:nth-child(1) { width: 8%; }
.findings-view table.data.findings-table th:nth-child(2) { width: 8%; }
.findings-view table.data.findings-table th:nth-child(3) { width: 17%; }
.findings-view table.data.findings-table th:nth-child(4) { width: 11%; }
.findings-view table.data.findings-table th:nth-child(5) { width: 13%; }
.findings-view table.data.findings-table th:nth-child(6) { width: 8%; }
.findings-view table.data.findings-table th:nth-child(7) { width: 6%; }
.findings-view table.data.findings-table th:nth-child(8) { width: 21%; }
.findings-view table.data.findings-table th:nth-child(9) { width: 8%; }
#scope-detail table.data.findings-table th:nth-child(1) { width: 13%; }
#scope-detail table.data.findings-table th:nth-child(2) { width: 27%; }
#scope-detail table.data.findings-table th:nth-child(3) { width: 16%; }
#scope-detail table.data.findings-table th:nth-child(4) { width: 11%; }
#scope-detail table.data.findings-table th:nth-child(5) { width: 23%; }
#scope-detail table.data.findings-table th:nth-child(6) { width: 10%; }

/* Scope-detail hosts table: fixed columns so mobile never cuts off the row. */
table.data.scope-hosts-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
table.data.scope-hosts-table th,
table.data.scope-hosts-table td {
  padding: 9px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
table.data.scope-hosts-table th:nth-child(1) { width: 24%; }
table.data.scope-hosts-table th:nth-child(2) { width: 12%; }
table.data.scope-hosts-table th:nth-child(3) { width: 16%; }
table.data.scope-hosts-table th:nth-child(4) { width: 22%; }
table.data.scope-hosts-table th:nth-child(5) { width: 16%; }
table.data.scope-hosts-table th:nth-child(6) { width: 10%; }
table.data.scope-hosts-table .pill { white-space: normal; text-align: center; }

/* Ledger: keep BALANCE visible by letting long actions wrap. */
#ledger-table {
  min-width: 0;
  table-layout: fixed;
}
#ledger-table th:nth-child(1), #ledger-table td:nth-child(1) { width: 18%; }
#ledger-table th:nth-child(2), #ledger-table td:nth-child(2) { width: 41%; }
#ledger-table th:nth-child(3), #ledger-table td:nth-child(3) { width: 20%; }
#ledger-table th:nth-child(4), #ledger-table td:nth-child(4) { width: 21%; }
#ledger-table th { white-space: nowrap; letter-spacing: 0.03em; font-size: 9.5px; }
#ledger-table td { white-space: normal; overflow-wrap: anywhere; }
#ledger-table td:nth-child(1), #ledger-table td:nth-child(3), #ledger-table td:nth-child(4) { white-space: nowrap; }

/* Expanded finding detail is a full-width row, never a narrow tall cell. */
table.data tr.finding-detail-row > td {
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(3, 7, 15, 0.3);
  white-space: normal;
}
table.data tr.finding-detail-row .finding-detail {
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-wrap: anywhere;
}
table.data tr.finding-detail-row .finding-detail p { max-width: 92ch; }


.pill, .sev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.ok { border-color: rgba(74, 222, 128, 0.25); background: rgba(74, 222, 128, 0.12); color: #8cf0ad; }
.pill.dim { background: rgba(255, 255, 255, 0.055); color: var(--dim); }
.pill.run { border-color: rgba(167, 139, 250, 0.3); background: rgba(139, 92, 246, 0.16); color: #c6baff; }
.pill.bad { border-color: rgba(255, 107, 122, 0.28); background: rgba(255, 107, 122, 0.12); color: #ffadb7; }
.pill.warn { border-color: rgba(251, 191, 36, 0.26); background: rgba(251, 191, 36, 0.12); color: #fcd77f; }
.pill.partial { border-color: rgba(251, 191, 36, 0.34); background: rgba(251, 191, 36, 0.16); color: #ffe0a0; }
.pill.st-open { border-color: rgba(167, 139, 250, 0.3); background: rgba(139, 92, 246, 0.16); color: #c6baff; }
.pill.st-pending { border-color: rgba(251, 191, 36, 0.26); background: rgba(251, 191, 36, 0.12); color: #fcd77f; }
.pill.st-closed { border-color: rgba(74, 222, 128, 0.24); background: rgba(74, 222, 128, 0.1); color: #8cf0ad; }
.pill.st-informative { background: rgba(255, 255, 255, 0.065); color: var(--dim); }
.pill.st-fp { border-color: rgba(255, 107, 122, 0.22); background: rgba(255, 107, 122, 0.09); color: #e8a0a8; }
.sev-critical { border-color: rgba(255, 107, 122, 0.32); background: rgba(255, 107, 122, 0.14); color: #ffb3bb; }
.sev-high { border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.13); color: #ffc38a; }
.sev-medium { border-color: rgba(251, 191, 36, 0.28); background: rgba(251, 191, 36, 0.12); color: #fcd77f; }
.sev-low { border-color: rgba(96, 165, 250, 0.28); background: rgba(59, 130, 246, 0.12); color: #9ecbff; }
.sev-info { background: rgba(255, 255, 255, 0.055); color: var(--dim); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat {
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--glass-bg), var(--glass-bg-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-sm);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--spring);
}
.stat:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(150deg, var(--glass-bg-strong), var(--glass-bg-soft));
}
.stat .v {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.045em;
}
.stat .l { margin-top: 5px; color: var(--dim); font-size: 11.5px; }

.scan-live { border-radius: var(--radius-lg); }
.scan-live .pbar {
  height: 10px;
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  background: rgba(3, 7, 15, 0.45);
}
.scan-live .pfill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #3b82f6, #8b5cf6 70%, #c084fc);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.55);
  transition: width 0.5s var(--spring);
}
.scan-live .counts { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; color: var(--dim); font-size: 13px; }
.scan-live .stage { margin: 4px 0; font-size: 15px; }
.scan-live .done-line { margin-top: 7px; color: #8cf0ad; }
.scan-hist { margin: 4px 0; color: var(--dim); font-size: 12.5px; overflow-wrap: anywhere; }
.scan-status-line {
  display: none;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 13px;
}
.scan-status-line.show { display: block; }
.scan-status-line.ok { border-color: rgba(74, 222, 128, 0.26); color: #9feab9; }
.scan-status-line.warn { border-color: rgba(251, 191, 36, 0.26); color: #fcd77f; }
.scan-status-line.bad { border-color: rgba(255, 107, 122, 0.3); color: #ffadb7; }

.phase-strip-wrap { margin: 6px 0 6px; min-width: 0; }
.stage-rail {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.stage-rail li {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--spring);
}
.stage-rail .sr-label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.stage-rail .sr-time { margin-top: 3px; color: var(--dim-2); font-family: var(--font-mono); font-size: 9.5px; overflow-wrap: anywhere; }
.sr-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #3a4160; }
.stage-rail li.done { border-color: rgba(74, 222, 128, 0.2); }
.stage-rail li.done .sr-dot { background: var(--ok); box-shadow: 0 0 8px rgba(74, 222, 128, 0.65); }
.stage-rail li.active {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.48);
  background: rgba(139, 92, 246, 0.12);
}
.stage-rail li.active .sr-label { color: var(--fg); }
.stage-rail li.active .sr-dot { background: #a78bfa; box-shadow: 0 0 12px rgba(139, 92, 246, 0.9); animation: pulse 1.4s infinite; }
.stage-rail li.failed { border-color: rgba(255, 107, 122, 0.3); background: rgba(255, 107, 122, 0.08); }
.stage-rail li.failed .sr-dot { background: var(--bad); }
.stage-rail li.partial { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.stage-rail li.partial .sr-dot { background: var(--warn); }
.stage-rail li.pending { opacity: 0.6; }
.stage-rail li.skipped { opacity: 0.45; }
.stage-rail li.starting-queued {
  opacity: 1;
  border-color: rgba(251, 146, 60, 0.46);
  background: rgba(251, 146, 60, 0.13);
}
.stage-rail li.starting-queued .sr-label { color: #fcd77f; }
.stage-rail li.starting-queued .sr-dot {
  background: #fb923c;
  box-shadow: 0 0 9px rgba(251, 146, 60, 0.7);
}
.stage-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 5px 0 0; color: var(--dim); font-size: 12px; }
.stage-sources { color: var(--dim); font-size: 11.5px; overflow-wrap: anywhere; }
.agent-trace {
  margin-top: 12px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.36);
}
.agent-trace summary { padding: 10px 0; color: var(--dim); font-size: 12px; cursor: pointer; }
.agent-trace pre {
  max-height: 280px;
  margin: 0 0 12px;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(2, 5, 12, 0.72);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.score-bar {
  display: inline-block;
  width: 74px;
  height: 7px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  vertical-align: middle;
}
.score-fill { display: block; height: 100%; border-radius: inherit; }
.trend-up { color: var(--bad); }
.trend-down { color: var(--ok); }
.trend-new { color: #a99cff; }
.finding-detail {
  margin: 10px 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.48);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.finding-detail p,
.finding-detail li,
.finding-detail .detail-section,
.finding-detail .detail-evidence {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.artifact-links {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 18px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.artifact-link { overflow-wrap: anywhere; word-break: break-word; }
.finding-detail h4 {
  margin: 12px 0 4px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.finding-detail h4:first-child { margin-top: 0; }
.finding-detail ol { margin: 4px 0; padding-left: 20px; }
.rem-box { line-height: 1.6; }

.change-block {
  margin-bottom: 12px;
  padding: 15px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.change-block:last-child { margin-bottom: 0; }
.change-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: baseline; margin-bottom: 8px; }
.change-sum { margin-left: auto; color: #b8c6ff; font-size: 12.5px; }
.chg { padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 13.5px; }
.chg:first-of-type { border-top: 0; }

.finding-card {
  position: relative;
  margin: 10px 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(6, 10, 18, 0.92);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  touch-action: pan-y;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.finding-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(10, 15, 25, 0.96);
}
.finding-card.is-closed { opacity: 0.6; }
.finding-card.is-informative { opacity: 0.55; }
.fc-swipe-body {
  position: relative;
  z-index: 1;
  padding: 14px;
  background: rgba(6, 10, 18, 0.97);
  will-change: transform;
}
.finding-card.is-swiping .fc-swipe-body { will-change: transform; }
.fc-swipe-hint {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  padding: 0 18px;
  opacity: 0;
  transition: opacity 0.12s linear, transform 0.12s var(--ease);
  pointer-events: none;
}
.fc-swipe-fixed {
  justify-content: flex-start;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.26), rgba(74, 222, 128, 0.02) 72%);
  color: #b6f7cb;
}
.fc-swipe-informative {
  justify-content: flex-end;
  background: linear-gradient(270deg, rgba(139, 124, 255, 0.28), rgba(139, 124, 255, 0.02) 72%);
  color: #d8d1ff;
}
.fc-swipe-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.finding-card.swipe-ready .fc-swipe-label { text-decoration: underline; }
.finding-card.swipe-ready .fc-swipe-hint { filter: brightness(1.18); }
.finding-card .fc-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; }
.finding-card .fc-title { flex: 1 1 170px; font-weight: 700; overflow-wrap: anywhere; }
.finding-card .fc-badges { display: flex; flex: none; flex-wrap: wrap; gap: 7px; align-items: center; }
.finding-card .fc-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 7px; font-size: 12.5px; }
.finding-card .fc-host { overflow-wrap: anywhere; }
.finding-card .fc-scope { color: var(--dim); font-size: 11.5px; }
.finding-card .fc-detail { margin-top: 7px; color: var(--dim); font-size: 12.5px; overflow-wrap: anywhere; }
.finding-card .fc-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.finding-card .fc-actions button { margin: 0; }
.finding-card .fc-actions .qd-sparkle,
.detail-actions .qd-sparkle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--acc);
}
.finding-card .fc-actions .qd-sparkle .nav-icon,
.detail-actions .qd-sparkle .nav-icon { width: 18px; height: 18px; }
.finding-card .fc-actions .qd-sparkle:hover,
.detail-actions .qd-sparkle:hover {
  color: var(--fg);
  border-color: rgba(139, 124, 255, 0.55);
  background: rgba(139, 92, 246, 0.16);
}
.finding-group { margin: 12px 0 18px; }
.finding-group:first-child { margin-top: 0; }
.finding-group-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(59, 130, 246, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--fg);
  font-size: 12px;
}
.finding-group-head .muted { color: var(--fg-soft); }
.finding-group-score { margin-left: auto; }
.findings-cards { display: none; }

/* Findings tab: grouped compact tables, same density as the Hosts view. */
.findings-view { width: 100%; max-width: none; }
.findings-groups { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.findings-groups .finding-group {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(6, 10, 18, 0.82);
  overflow: hidden;
}
.findings-groups .finding-group-head {
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  background: rgba(9, 14, 24, 0.9);
  box-shadow: none;
  font-size: 12.5px;
}
.findings-groups .finding-group.is-collapsed .finding-group-head {
  padding: 3px 10px;
  border-bottom: 0;
  border-radius: 12px;
}
.findings-groups .finding-group.is-collapsed .finding-group-toggle {
  width: 24px;
  height: 24px;
  margin: -3px 0;
}
@media (min-width: 980px) {
  #app > .card.findings-view[data-tab] { grid-column: 1 / -1; }
  .findings-view .findings-groups,
  .findings-view .findings-toolbar,
  .findings-view #finding-detail-panel,
  .findings-view .findings-state { width: 100%; max-width: none; }
  .findings-groups { gap: 6px; }
}
@media (min-width: 1500px) {
  #app:has(> .card.findings-view.tab-active) { max-width: 1726px; }
  #app:has(> .card.findings-view.tab-active) #tabs-nav {
    left: max(20px, calc((100vw - min(1726px, 100vw - 60px)) / 2 + 24px));
  }
}
.finding-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.finding-group-toggle .nav-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--spring);
}
.finding-group.is-collapsed .finding-group-toggle .nav-icon { transform: rotate(-90deg); }
.finding-group.is-collapsed .finding-group-body { display: none; }
.finding-group-toggle:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.group-collapse-controls { display: inline-flex; gap: 4px; }
.group-collapse-controls .small { margin: 0; }
.findings-toolbar-bar .group-collapse-controls { flex: none; }
.findings-groups .finding-group-head .muted { font-size: 11px; }
.finding-group-scopes {
  margin-left: auto;
  color: var(--dim);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.finding-host-block + .finding-host-block { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.finding-host-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px 0;
  font-size: 12px;
}
.finding-host-head .fh-host { font-weight: 700; overflow-wrap: anywhere; }
.finding-host-head .muted { font-size: 10.5px; white-space: nowrap; }
.findings-scroll {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
table.data.findings-table.findings-compact {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}
table.data.findings-table.findings-compact th,
table.data.findings-table.findings-compact td {
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data.findings-table.findings-compact th {
  font-size: 9px;
  letter-spacing: 0.08em;
}
table.data.findings-table.findings-compact td.f-sev .pill {
  padding: 1px 6px;
  font-size: 9.5px;
}
table.data.findings-table.findings-compact td.f-title {
  white-space: normal;
  overflow: visible;
  line-height: 1.3;
}
table.data.findings-table.findings-compact td.f-title .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
table.data.findings-table.findings-compact td.f-scope,
table.data.findings-table.findings-compact td.f-seen {
  color: var(--dim);
  font-size: 11px;
}
table.data.findings-table.findings-compact .row-actions { white-space: normal; }
table.data.findings-table.findings-compact .row-actions button {
  min-height: 26px;
  margin: 1px 3px 1px 0;
  padding: 3px 7px;
  font-size: 10.5px;
}
table.data.findings-table.findings-compact .finding-detail-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.group-switch {
  gap: 0;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
}
.group-switch .group-switch-btn {
  min-height: 30px;
  margin: 0;
  padding: 4px 13px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--dim);
  font-size: 11.5px;
}
.group-switch .group-switch-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.32), rgba(139, 92, 246, 0.26));
  color: #fff;
}
.scope-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--dim);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
}
.scope-group-toggle input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
}
@media (max-width: 640px) {
  .findings-groups .finding-group-head { padding: 6px 9px; }
  .finding-host-head { padding: 5px 9px 0; }
  table.data.findings-table.findings-compact th,
  table.data.findings-table.findings-compact td { padding: 4px 4px; }
  table.data.findings-table.findings-compact .row-actions button {
    min-height: 30px;
    padding: 4px 6px;
  }
}

.findings-state { margin: 4px 0 0; }
.findings-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.1);
}
.findings-bulk-count { font-size: 12px; font-weight: 700; margin-right: 4px; }
.findings-bulk-bar .small { min-height: 32px; padding: 5px 9px; }
.f-check { width: 34px; text-align: center; }
.f-check input { width: 16px; height: 16px; accent-color: var(--acc); }
.findings-skeleton { display: grid; gap: 9px; padding: 2px 0; }
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.skeleton-dot,
.skeleton-bar {
  background: rgba(255, 255, 255, 0.085);
  animation: skeleton-pulse 1.25s var(--ease) infinite;
}
.skeleton-dot { width: 28px; height: 28px; flex: none; border-radius: 9px; }
.skeleton-bar { height: 11px; flex: 1 1 auto; border-radius: 6px; }
.skeleton-bar.short { flex: 0 0 26%; }
.findings-state-error {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 107, 122, 0.28);
  border-radius: 16px;
  background: rgba(255, 107, 122, 0.06);
}
.findings-state-error .err { margin: 0; }
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.host-scope-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.host-scope-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.scope-chip {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--dim);
  font: 600 12.5px/1.2 var(--font-sans);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--spring);
}
.scope-chip:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.24); transform: translateY(-1px); }
.scope-chip.active {
  border-color: rgba(167, 139, 250, 0.55);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(139, 92, 246, 0.22));
  color: #fff;
}
.host-scope-select { display: none; min-width: 0; max-width: 100%; }
.host-scope-chips.is-empty { display: flex; }
.host-scope-bar.no-scopes .host-scope-select { display: none; }
.hosts-cards, .scope-hosts-cards { display: none; }
table.data.hosts-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}
table.data.hosts-table th,
table.data.hosts-table td {
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data.hosts-table th {
  font-size: 9px;
  letter-spacing: 0.08em;
}
table.data.hosts-table th:nth-child(1) { width: 37%; }
table.data.hosts-table th:nth-child(2) { width: 23%; }
table.data.hosts-table th:nth-child(3) { width: 18%; }
table.data.hosts-table th:nth-child(4) { width: 22%; }
table.data.hosts-table td.ht-host .ht-name {
  display: inline-block;
  max-width: calc(100% - 52px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
table.data.hosts-table td.ht-host .pill {
  display: inline-flex;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 9px;
  vertical-align: bottom;
  white-space: nowrap;
}
table.data.hosts-table td.ht-ip,
table.data.hosts-table td.ht-title,
table.data.hosts-table td.ht-summary {
  color: var(--dim);
  font-size: 11.5px;
}
table.data.hosts-table td.ht-ip > span,
table.data.hosts-table td.ht-title > span,
table.data.hosts-table td.ht-summary > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-thumb {
  display: block;
  width: 72px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(3, 7, 15, 0.5);
  object-fit: cover;
}
.host-card {
  margin: 10px 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--spring);
}
.host-card:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.24); background: var(--glass-bg); }
.host-card .hc-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.host-card .hc-host { font-weight: 700; overflow-wrap: anywhere; }
.host-card .hc-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--dim); font-size: 12.5px; }
.host-card .hc-shot { margin-top: 10px; }
.host-card .hc-shot img { width: 100%; max-height: 180px; border-radius: 10px; object-fit: cover; }
.host-scan-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.host-scan-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.host-scan-item:hover { border-color: rgba(255, 255, 255, 0.24); }
.host-scan-item.active { border-color: rgba(167, 139, 250, 0.52); background: rgba(139, 92, 246, 0.13); }
.host-scan-item .hs-id { font-weight: 700; }
.host-scan-item .hs-meta { color: var(--dim); font-size: 11.5px; }
.host-scan-item .hs-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }

/* Scans tab: full-width list rows, one or two compact lines. */
.scans-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  overflow: hidden;
}
.scan-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.018);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.scan-row:last-child { border-bottom: 0; }
.scan-row:hover {
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  transform: none;
}
.scan-row:active { transform: none; }
.scan-row.active {
  background: rgba(139, 92, 246, 0.12);
  box-shadow: inset 3px 0 0 rgba(167, 139, 250, 0.75);
}
.scan-row-main, .scan-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.scan-row-main { font-size: 13px; }
.scan-sep { flex: none; color: rgba(255, 255, 255, 0.24); font-size: 12px; }
.scan-kind {
  flex: none;
  padding: 1px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
}
.scan-kind.full {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(59, 130, 246, 0.12);
  color: #9ecbff;
}
.scan-kind.ai {
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(139, 92, 246, 0.16);
  color: #c6baff;
}
.scan-kind.recheck {
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.12);
  color: #fcd77f;
}
.scan-kind.other { background: rgba(255, 255, 255, 0.055); color: var(--dim); }
.scan-scope {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
}
.scan-row-main .pill {
  flex: none;
  padding: 2px 8px;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}
.scan-row-meta { color: var(--dim); font-size: 12px; }
.srm-counts {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}
.ai-skip-reason {
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.ai-skip-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.srm-note {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--fg-soft);
  font-size: 12px;
  text-overflow: ellipsis;
}
.srm-time {
  flex: none;
  margin-left: auto;
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.scan-detail-panel { margin: 0 0 10px; }
.scan-detail-panel.hidden { display: none; }
.scan-detail-panel .scan-live { margin: 0; }
.scan-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 18px;
  margin: 12px 0 2px;
}
.scan-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-field .sf-label {
  color: var(--dim-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scan-field .sf-value { color: var(--fg); font-size: 13px; overflow-wrap: anywhere; }
.scan-detail-inline .err { margin-top: 10px; }
.scans-empty { margin: 4px 0; }

/* Unified scan flow: phase rail, per-host list, live trace. */
.scan-flow-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  justify-content: space-between;
}
.scan-flow-head h3 {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.15;
  letter-spacing: 0.06em;
}
.scan-flow-head > div:first-child { min-width: 0; }
.scan-flow-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  margin-top: 2px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.2;
}
.scan-flow-sub span + span::before { content: "·"; margin-right: 6px; color: var(--dim-2); }
.scan-flow-head-side {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px 12px;
  margin-left: auto;
}
.scan-flow-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}
.scan-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.46fr) minmax(0, 4.7fr) minmax(0, 0.7fr);
  grid-template-areas: "mechanical trace review";
  gap: 14px;
  align-items: start;
  margin-top: 8px;
  min-width: 0;
}
.scan-flow-panel {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.26);
}
.scan-mechanical-panel { grid-area: mechanical; }
.scan-ai-viewer { grid-area: review; }
.scan-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.scan-panel-head .muted {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scan-panel-state {
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mechanical-stream {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 560px;
  overflow: auto;
  scrollbar-width: thin;
}
.mech-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.mech-row:hover { background: rgba(255, 255, 255, 0.05); }
.mech-phase {
  flex: none;
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mech-row.mech-discovery .mech-phase { color: #7db5ff; }
.mech-row.mech-portscan .mech-phase { color: #c6baff; }
.mech-row.mech-probe .mech-phase { color: #8cf0ad; }
.mech-row .phase-row-detail { flex: 1 1 160px; }
.mech-row .ports-table { flex: 1 1 100%; margin-top: 2px; }
.mech-row.mech-probe { cursor: pointer; }
.scan-ai-viewer .ai-host-windows {
  max-height: 560px;
  overflow: auto;
  margin-top: 0;
  scrollbar-width: thin;
}
.scan-export-actions .view-actions-btn {
  min-width: 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: 12px;
  line-height: 1;
}
.scan-export-status {
  max-width: 150px;
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.2;
  text-align: right;
}
.scan-export-status[data-state="ready"] { color: #8cf0ad; }
.scan-export-status[data-state="error"] { color: #ff8a8a; }
.scan-abort {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex: none;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d93838;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.scan-abort:hover, .scan-abort:focus-visible {
  background: #f04b4b;
  color: #fff;
}
.scan-hosts-layout {
  display: grid;
  grid-template-columns: minmax(190px, 270px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.scan-host-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow: auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.25);
}
.scan-host-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-soft);
  text-align: left;
  cursor: pointer;
}
.scan-host-item:hover { background: rgba(255, 255, 255, 0.045); }
.scan-host-item.active {
  border-color: rgba(167, 139, 250, 0.36);
  background: rgba(139, 92, 246, 0.12);
}
.shi-main { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.shi-host {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shi-state {
  flex: none;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.scan-host-item.state-probing .shi-state,
.scan-host-item.state-ai_reviewing .shi-state,
.scan-host-item.state-reviewing .shi-state { color: #c6baff; }
.scan-host-item.state-probed .shi-state,
.scan-host-item.state-scanned .shi-state,
.scan-host-item.state-done .shi-state { color: #8cf0ad; }
.scan-host-item.state-failed .shi-state,
.scan-host-item.state-unresolved .shi-state { color: #ffadb7; }
.scan-host-item.state-probe_pending .shi-state,
.scan-host-item.state-ai_pending .shi-state,
.scan-host-item.state-portscan_pending .shi-state { color: var(--dim); }
.shi-meta { color: var(--dim-2); font-size: 10.5px; }
.scan-host-trace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sht-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.sht-live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.scan-terminal-pane {
  margin-top: 14px;
  min-width: 0;
}
.scan-trace-panel {
  grid-area: trace;
  margin-top: 0;
}
.scan-trace-panel .scan-terminal-body {
  max-height: 820px;
  min-height: 460px;
}
.scan-terminal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.scan-terminal-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.scan-terminal {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #060a13, #05080f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  color: #d7e0f2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.34;
}
.scan-terminal-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}
.terminal-dots { display: inline-flex; gap: 4px; }
.terminal-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.terminal-dots i:first-child { background: rgba(255, 107, 122, 0.72); }
.terminal-dots i:nth-child(2) { background: rgba(255, 209, 102, 0.66); }
.terminal-dots i:nth-child(3) { background: rgba(74, 222, 128, 0.66); }
.terminal-title {
  overflow: hidden;
  color: #6f7a92;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.scan-terminal-body {
  max-height: 360px;
  overflow: auto;
  padding: 9px 18px 12px;
  scrollbar-width: thin;
}
.scan-terminal-compact .scan-terminal-body { max-height: 280px; }
.scan-terminal-compact .scan-terminal-top { padding: 4px 8px; }
.terminal-line {
  display: block;
  min-width: 0;
  padding: 0;
  border-bottom: 1px dashed rgba(124, 139, 171, 0.08);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.terminal-line:last-child { border-bottom: none; }
.trace-time {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 0 0 auto;
  color: #54627f;
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
}
.trace-time.trace-time-dupe { display: none; }
.trace-content { min-width: 0; }
.trace-command {
  display: block;
  min-width: 0;
  padding-right: 12px;
  color: #f2f5fc;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.trace-prompt {
  color: #a678ff;
  font-weight: 700;
}
.trace-command-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.trace-cmd-seg { white-space: pre-wrap; }
.trace-accent { color: #7dd3fc; }
.trace-dim { color: #6f7a92; }
.trace-tool { color: #c4b5fd; }
.trace-text {
  display: block;
  min-width: 0;
  margin: 0;
  color: #a9b7d4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.trace-thinking { color: #8fa3c8; }
.trace-thinking-lines { display: block; }
.trace-think-line {
  display: block;
  min-width: 0;
  color: #8fa3c8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.trace-think-hash { color: #54627f; }
.trace-think-text { color: #8fa3c8; }
.trace-result-slot { min-width: 0; }
.trace-output {
  display: block;
  margin: 0;
  padding: 0 12px 0 0;
  border: 0;
  background: none;
  color: #a9b7d4;
  font-size: 10.5px;
  line-height: 1.32;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.trace-output-empty {
  padding: 0 12px 0 0;
  border: 0;
  color: #54627f;
  font-style: italic;
}
.trace-running {
  margin: 0;
  padding: 0 12px 0 0;
  border: 0;
  color: #54627f;
  font-size: 10px;
  animation: trace-running-pulse 1.1s ease-in-out infinite;
}
@keyframes trace-running-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.trace-more {
  display: block;
  width: auto;
  min-height: 0;
  height: auto;
  margin: 1px 0 0;
  padding: 0 12px 0 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #54627f;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none;
  cursor: pointer;
}
.trace-more:hover {
  color: #7d8bab;
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  transform: none;
}
.trace-queued, .trace-result-hidden { display: none; }
.terminal-line.trace-host_failed .trace-text { color: #ffadb7; }
.terminal-line.terminal-active .trace-text::after,
.terminal-line.terminal-active .terminal-code::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: #8cf0ad;
  animation: terminal-cursor 1s steps(1) infinite;
}
@keyframes terminal-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .terminal-line.terminal-active .trace-text::after,
  .terminal-line.terminal-active .terminal-code::after {
    animation: none;
  }
  .trace-running { animation: none; }
}
.terminal-code {
  margin: 1px 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 10px;
  line-height: 1.32;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: auto;
}
.terminal-empty {
  padding: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #6f7a92;
  font-family: inherit;
  font-size: 10.5px;
}
.trace-turn-rings {
  display: flex;
  align-items: center;
  gap: 6px;
}
.trace-turn-rings.hidden { display: none; }
.turn-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
}
.turn-ring svg {
  position: absolute;
  inset: 0;
  width: 38px;
  height: 38px;
}
.turn-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 2.5;
}
.turn-ring-fill {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
}
.turn-ring.is-done .turn-ring-fill { stroke: #8cf0ad; }
.turn-ring-label {
  position: relative;
  color: #c7cedd;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.turn-ring.is-done .turn-ring-label { color: #8cf0ad; }

.phase-empty {
  padding: 10px 0 2px;
  color: var(--dim);
  font-size: 12.5px;
}
.phase-host-list { display: flex; flex-direction: column; gap: 2px; margin: 9px 0 0; padding: 0; list-style: none; }
.phase-host-row,
.phase-port-row,
.phase-probe-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}
.phase-host-row.unresolved { background: rgba(255, 107, 122, 0.055); }
.phase-host-list .phase-host-row {
  gap: 2px 8px;
  padding: 4px 7px;
  line-height: 1.3;
}
.phase-host-list .phase-row-host { font-size: 11px; }
.phase-host-list .phase-row-state { font-size: 9.5px; }
.phase-host-list .phase-row-meta { font-size: 10px; line-height: 1.25; }
.phase-host-row.unresolved-thin {
  gap: 0;
  min-height: 0;
  padding: 1px 7px;
  background: transparent;
  line-height: 1.15;
}
.phase-host-row.unresolved-thin .phase-row-host {
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 400;
}
.phase-row-host {
  min-width: 0;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.phase-row-state {
  flex: none;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.phase-row-meta { flex: 1 1 100%; color: var(--dim-2); font-size: 10.5px; overflow-wrap: anywhere; }
.phase-port-list,
.phase-probe-list { display: flex; flex-direction: column; gap: 4px; margin-top: 9px; }
.phase-port-row,
.phase-probe-row { align-items: flex-start; }
.phase-row-detail { flex: 1 1 220px; min-width: 0; color: var(--dim); font-size: 11.5px; overflow-wrap: anywhere; }
.phase-port-row.state-failed .phase-row-detail { color: #ffadb7; }
.phase-port-row.state-running .phase-row-detail { color: #c6baff; }
.phase-probe-status { flex: none; color: #8cf0ad; font-family: var(--font-mono); font-size: 10px; }
.phase-probe-link { color: inherit; text-decoration: none; cursor: pointer; }
.phase-probe-link:hover { background: rgba(255, 255, 255, 0.055); }
.ai-host-windows { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.ai-host-window {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(3, 7, 15, 0.35);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
}
.ai-host-window:hover { background: rgba(255, 255, 255, 0.055); }
.ai-host-light {
  width: 8px;
  height: 8px;
  flex: none;
  align-self: center;
  border-radius: 50%;
  background: #3a4160;
}
.ai-host-light.pending { background: #fb923c; box-shadow: 0 0 7px rgba(251, 146, 60, 0.55); }
.ai-host-light.active { background: var(--ok); box-shadow: 0 0 10px rgba(74, 222, 128, 0.8); animation: pulse 1.2s infinite; }
.ai-host-light.done { background: #3a4160; box-shadow: none; }
.ai-host-name { min-width: 0; color: var(--fg-soft); font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; overflow-wrap: anywhere; }
.ai-host-state { color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.ai-host-findings { margin-left: auto; color: var(--dim-2); font-family: var(--font-mono); font-size: 10px; }
.ai-host-open { margin-left: auto; color: var(--dim-2); font-size: 14px; line-height: 1; }

@media (max-width: 1100px) {
  .scan-flow-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "trace trace" "mechanical review";
  }
}

@media (max-width: 760px) {
  .scan-hosts-layout { grid-template-columns: 1fr; }
  .scan-flow-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "trace" "mechanical" "review";
    gap: 10px;
  }
  .scan-flow-panel { padding: 8px; }
  .scan-terminal-body { max-height: 300px; }
  .scan-trace-panel .scan-terminal-body {
    max-height: 480px;
    min-height: 320px;
  }
  .scan-terminal-compact .scan-terminal-body { max-height: 240px; }
  .mechanical-stream,
  .scan-ai-viewer .ai-host-windows { max-height: 320px; }
  .ai-host-findings { margin-left: 0; }
}

.host-detail-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.host-shot-full {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.5);
}
.trace-stream { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.trace-item {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.38);
  overflow-wrap: anywhere;
}
.trace-item.tool_call { border-color: rgba(167, 139, 250, 0.3); }
.trace-item .ti-head { margin-bottom: 2px; color: var(--dim); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.trace-item pre { margin: 0; font: inherit; font-size: 12px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.trace-item .code-block { margin: 0; padding: 3px 5px; line-height: 1.35; }
.trace-empty {
  padding: 13px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 12.5px;
}

.add-scope {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.add-scope h3 { margin-top: 0; }
.add-scope-row input { flex: 1 1 220px; }
.advanced {
  margin-top: 14px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.3);
}
.advanced summary {
  padding: 12px 0;
  color: var(--dim);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "\25B8  "; color: #a99cff; }
.advanced[open] summary::before { content: "\25BE  "; }
.advanced-body { padding: 0 0 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.advanced-body .field { margin-top: 12px; }
.advanced-body select { min-width: 190px; }

#tabs-nav {
  z-index: 60;
  gap: 6px;
  padding: 12px;
  border-radius: 26px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), var(--shadow-lg);
}
#tabs-nav::before {
  content: "Workspace";
  display: block;
  padding: 4px 12px 7px;
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
#tabs-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--spring);
}
#tabs-nav a .nav-icon { width: 19px; height: 19px; flex: none; opacity: 0.85; }
#tabs-nav a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.055); transform: translateX(2px); }
#tabs-nav a.active {
  border-color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.32), rgba(139, 92, 246, 0.24));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 20px rgba(59, 130, 246, 0.16);
  color: #fff;
}
#tabs-nav a.active .nav-icon { opacity: 1; }
#tabs-nav a.nav-tap {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.42), rgba(139, 92, 246, 0.34));
  animation: navTap 0.36s var(--spring);
}
#scan-indicator {
  align-self: stretch;
  justify-content: center;
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: var(--radius-pill);
  background: rgba(251, 191, 36, 0.09);
  color: #fcd77f;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  animation: pulse 1.8s infinite;
}
#scan-indicator.hidden { display: none !important; }

.card.agents-room { padding: 0; overflow: hidden; }
.dashboard-qd-cell { display: none !important; padding: 0; overflow: hidden; }
.qd-embed-slot { display: flex; flex: 1; flex-direction: column; min-width: 0; }
#qd-panel.qd-embedded {
  position: static;
  inset: auto;
  width: auto;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex: 1;
}
#qd-panel.qd-embedded .qd-close { display: none; }
#qd-panel.qd-embedded .qd-thread { max-height: none; }
.qd-offline-state {
  max-width: 360px;
  margin: auto;
  padding: 24px 8px;
  color: var(--dim);
  text-align: center;
}
.qd-offline-title {
  margin: 0 0 6px;
  color: var(--fg-soft);
  font-size: 15px;
  font-weight: 700;
}
.card.qd-native {
  display: flex;
  flex-direction: column;
  min-height: clamp(460px, 68vh, 760px);
}
.qd-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
}
.qd-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.55), rgba(139, 92, 246, 0.5));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 22px rgba(59, 130, 246, 0.2);
  color: #fff;
}
.qd-avatar svg { width: 22px; height: 22px; }
.qd-identity { flex: 1; min-width: 0; }
.qd-kicker {
  display: block;
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.qd-name {
  margin: 2px 0 1px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.qd-role {
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.35;
}
.qd-side { display: flex; align-items: center; gap: 10px; flex: none; }
.qd-usage {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.035);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.qd-usage-item b { color: var(--fg-soft); font-weight: 650; }
.qd-usage-sep { opacity: 0.4; }
.qd-plus {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  color: var(--dim);
  font-size: 19px;
  line-height: 1;
}
.qd-plus:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  transform: none;
}
.qd-error { padding: 0 20px; }
.qd-error:empty { display: none; }
.qd-thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
  max-height: min(58vh, 620px);
  overflow-y: auto;
  padding: 18px 20px;
}
.qd-empty { max-width: 460px; margin: auto; padding: 24px 8px; text-align: center; }
.qd-empty-title { margin-bottom: 6px; color: var(--fg); font-size: 16px; font-weight: 700; }
.qd-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.qd-suggest-btn {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  color: var(--dim);
  font-size: 12px;
}
.qd-suggest-btn:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  transform: none;
}
.qd-msg { display: flex; flex-direction: column; width: 100%; max-width: none; }
.qd-msg.qd-user {
  align-self: flex-end;
  align-items: flex-end;
  width: auto;
  max-width: 82%;
}
.qd-msg.qd-assistant {
  align-self: stretch;
  align-items: stretch;
  max-width: 100%;
}
.qd-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.qd-user .qd-bubble {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px 18px 4px 18px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--fg-soft);
}
.qd-assistant .qd-bubble {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: var(--fg-soft);
}
.qd-assistant .qd-bubble .chat-text { color: var(--fg-soft); }
.qd-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.qd-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dim);
  font-size: 11px;
  line-height: 1.35;
}
.qd-tool-check { color: #86efac; font-weight: 700; }
.qd-tool-error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.09);
}
.qd-tool-error .qd-tool-check { color: #f87171; }
.qd-tool-error .qd-tool-name { color: #fecaca; }
.qd-tool-error .qd-tool-result { color: #fca5a5; }
.qd-tool-name {
  color: var(--fg-soft);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.qd-tool-result {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qd-tool-sep { opacity: 0.55; }
.qd-thinking .qd-bubble { color: var(--dim); font-style: italic; animation: pulse 1.4s infinite; }
.qd-bubble .chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.qd-bubble .chat-md { white-space: normal; }
.qd-bubble .md-p { margin: 2px 0; }
.qd-bubble .md-h { margin: 8px 0 4px; font-size: 14px; font-weight: 700; }
.qd-bubble .md-hr { margin: 10px 0; border: 0; border-top: 1px solid var(--glass-border); }
.qd-bubble .md-list { margin: 4px 0 4px 20px; padding: 0; }
.qd-bubble .md-list li { margin: 2px 0; overflow-wrap: anywhere; }
.qd-bubble .md-quote {
  margin: 6px 0;
  padding: 2px 0 2px 10px;
  border-left: 2px solid rgba(167, 139, 250, 0.45);
  color: var(--dim);
}
.qd-bubble .md-code {
  max-width: 100%;
  margin: 8px 0;
  padding: 9px 11px;
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(2, 5, 12, 0.72);
  white-space: pre;
}
.qd-bubble .chat-text + .chat-text,
.qd-bubble .chat-text + .chat-md,
.qd-bubble .chat-md + .chat-text,
.qd-bubble .code-block + .chat-text,
.qd-bubble .chat-text + .code-block { margin-top: 8px; }
.qd-bubble .code-block {
  max-width: 100%;
  margin: 8px 0 0;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
}
.qd-bubble code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(2, 5, 12, 0.5);
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.qd-bubble .md-table-wrap { white-space: normal; }
.md-table-wrap {
  max-width: 100%; margin: 8px 0; overflow-x: auto;
  border: 1px solid var(--glass-border); border-radius: 12px;
  background: rgba(3, 7, 15, 0.28);
  -webkit-overflow-scrolling: touch;
}
.md-table {
  width: 100%; min-width: 420px; border-collapse: collapse;
  font-size: 12.5px; line-height: 1.45;
}
.md-table th {
  padding: 8px 10px; text-align: left; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--fg-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
  border-bottom: 1px solid var(--glass-border);
}
.md-table td {
  padding: 7px 10px; vertical-align: top;
  border-top: 1px solid var(--line); color: var(--text);
}
.md-table tbody tr:first-child td { border-top: 0; }
.md-table th.num, .md-table td.num {
  text-align: right; font-family: var(--font-mono); white-space: nowrap;
}
.md-table th.center, .md-table td.center { text-align: center; }
.md-table td .md-cell-clip {
  display: inline-block; max-width: 32ch; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
.qd-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  text-transform: lowercase; white-space: nowrap;
}
.qd-pill-open {
  color: #9ecbff; border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.14);
}
.qd-pill-closed {
  color: #86efac; border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.12);
}
.qd-pill-informative {
  color: #c4b5fd; border-color: rgba(139, 92, 246, 0.42);
  background: rgba(139, 92, 246, 0.14);
}
.qd-pill-pending {
  color: #fcd34d; border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.13);
}
.qd-pill-sev-info {
  color: #93c5fd; border-color: rgba(59, 130, 246, 0.38);
  background: rgba(59, 130, 246, 0.12);
}
.qd-pill-sev-low {
  color: #86efac; border-color: rgba(74, 222, 128, 0.38);
  background: rgba(74, 222, 128, 0.11);
}
.qd-pill-sev-medium {
  color: #fcd34d; border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.13);
}
.qd-pill-sev-high {
  color: #fdba74; border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.14);
}
.qd-pill-sev-critical {
  color: #fda4af; border-color: rgba(255, 107, 122, 0.5);
  background: rgba(255, 107, 122, 0.15);
}
@media (max-width: 900px) {
  .md-table { min-width: 520px; }
  .md-table-wrap { margin-left: -2px; margin-right: -2px; }
}
.qd-msg-meta {
  display: flex;
  gap: 6px;
  margin: 4px 4px 0;
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.qd-composer[hidden] { display: none !important; }
.qd-composer {
  flex: none;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(5, 9, 17, 0.34);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.qd-composer-in {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 5px 5px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: rgba(3, 7, 15, 0.42);
}
.qd-composer-in:focus-within {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}
.qd-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 150px;
  padding: 11px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
}
.qd-composer textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}
.qd-send { min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 22px; flex: none; }
#burn { width: 100%; height: 148px; display: block; }

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 11px 16px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), var(--shadow-md);
  z-index: 50;
}
.app-brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.app-bar .brand { font-size: 18px; }
.app-bar-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }

#app { position: relative; max-width: 1440px; margin: 0 auto; }
#app .card[data-tab] { display: none; }
#app .card[data-tab].tab-active { display: block; animation: pageSettle 0.38s var(--spring) both; }
#app[data-page-dir="forward"] .card[data-tab].tab-active { animation-name: pageForward; }
#app[data-page-dir="back"] .card[data-tab].tab-active { animation-name: pageBack; }
#app .card[data-tab][hidden] { display: none; }
#app.onboarding > .card:not(#onboarding-card),
#app.onboarding > #tabs-nav,
#app.onboarding > #settings-subnav,
#app.onboarding > .app-bar { display: none; }

.top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  color: var(--fg-soft);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.top-action:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}
.top-action .nav-icon { width: 18px; height: 18px; opacity: 0.9; }
#settings-open .nav-icon { width: 17px; height: 17px; }

#settings-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--shadow-md);
}
#settings-subnav.hidden { display: none !important; }
#settings-subnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
#settings-subnav a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.055); }
#settings-subnav a.active {
  border-color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.22));
  color: #fff;
}
.account-email {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.28);
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}

/* Quarterdeck chat opens from the top bar as an overlay, not a surface. */
.qd-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 12, 0.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
#qd-panel {
  position: fixed;
  z-index: 100;
  top: 78px;
  right: max(12px, calc((100vw - 1440px) / 2 + 24px));
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 96px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}
#qd-panel[hidden] { display: none !important; }
.qd-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
}
.qd-close:hover { color: var(--fg); background: rgba(255, 255, 255, 0.09); }
@media (max-width: 980px) {
  #qd-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  #qd-panel.qd-embedded { height: auto; max-height: none; }
  .top-action-label { display: none; }
  .top-action { padding: 8px 10px; }
}
@media (max-width: 560px) {
  #settings-subnav { gap: 4px; padding: 6px; }
  #settings-subnav a { flex: 1 1 auto; padding: 8px 10px; font-size: 12px; }
  .app-bar-meta { gap: 6px; }
}

.ob-steps { display: flex; gap: 8px; margin: 14px 0 20px; }
.ob-step {
  flex: 1;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.ob-step.done { border-color: rgba(74, 222, 128, 0.25); color: #8cf0ad; }
.ob-step.cur {
  border-color: rgba(167, 139, 250, 0.52);
  background: rgba(139, 92, 246, 0.12);
  color: var(--fg);
}
#ob-body .row { margin: 12px 0; }
#ob-body .row input { flex: 1 1 220px; }

#new-key-box {
  padding: 14px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.08);
}
#new-key-val { font-family: var(--font-mono); font-size: 12px; }

@media (min-width: 980px) {
  #app {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
    padding: 0 0 48px 286px;
  }
  #app > .app-bar,
  #app > #onboarding-card,
  #app > #settings-subnav,
  #app > .card[data-tab] { grid-column: span 12; }
  #app > #settings-subnav { margin: 0; }
  #app > .card[data-tab] { margin: 0; }
  #tabs-nav {
    position: fixed;
    top: 106px;
    left: max(20px, calc((100vw - 1440px) / 2 + 24px));
    display: flex;
    flex-direction: column;
    width: 230px;
    max-height: calc(100vh - 132px);
    overflow-y: auto;
  }
  #scan-indicator { margin-top: auto; }
  .app-bar { position: sticky; top: 14px; }
  #app > .card.billing-balance { grid-column: span 5; }
  #app > .card.billing-spend { grid-column: span 7; }
  #app > .card.billing-purchases { grid-column: span 12; }
  #app > .card.billing-buy { grid-column: span 12; }
}

@media (min-width: 1180px) {
  #app > .card.overview-activity { grid-column: span 12; }
}

/* Tables switch to cards before columns get cramped. */
@media (max-width: 1180px) {
  .findings-wrap { display: none; }
  .findings-cards { display: block; }
  .scope-hosts-wrap { display: none; }
  .scope-hosts-cards { display: block; }
}

@media (min-width: 980px) {
  #app > .card[data-settings-view] { grid-column: span 12; min-width: 0; }
}

@media (max-width: 979px) {
  body {
    padding: 12px;
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  #app {
    display: block;
    max-width: 820px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  #app > .card[data-tab] { margin: 14px 0; }
  .app-bar {
    position: sticky;
    top: 6px;
    min-height: 52px;
    padding: 4px 10px;
    border-radius: 16px;
  }
  .app-bar .brand { font-size: 16px; }
  .app-bar .brand-tag { display: none; }
  .app-brand { gap: 8px; }
  #app-bar { margin-bottom: 12px; }
  #tabs-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    gap: 1px;
    width: 100%;
    max-height: none;
    padding: 6px 6px 6px;
    /* The safe-area inset is padding inside the bar, so the bar background
       reaches the physical bottom edge in an installed (standalone) view. */
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    transform: none;
    border-radius: 0;
    background: rgba(14, 20, 34, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 -14px 34px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    overflow: visible;
  }
  #tabs-nav::before { display: none; }
  #tabs-nav a {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    min-height: 52px;
    padding: 5px 1px;
    border-radius: var(--radius-pill);
    font-size: clamp(8px, 2.3vw, 9.5px);
    letter-spacing: -0.02em;
  }
  #tabs-nav a:hover { transform: none; }
  #tabs-nav a .nav-icon { width: 18px; height: 18px; }
  #tabs-nav .nav-label {
    max-width: 100%;
    overflow: visible;
    line-height: 1.1;
    text-overflow: clip;
  }
  #tabs-nav a[data-navtab="agents"] .nav-label {
    font-size: clamp(7px, 1.85vw, 9px);
    letter-spacing: -0.05em;
  }
  #scan-indicator {
    position: fixed;
    left: 50%;
    bottom: calc(74px + env(safe-area-inset-bottom));
    margin: 0;
    padding: 9px 14px;
    transform: translateX(-50%);
    background: rgba(40, 30, 10, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 30px rgba(0, 0, 0, 0.4);
  }
  button, .btn { min-height: 44px; }
  button.small { min-height: 44px; padding: 9px 13px; font-size: 12.5px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; font-size: 16px; }
  textarea { font-size: 16px; }
  .check-row { min-height: 44px; }
  .table-wrap { width: 100%; max-width: 100%; min-width: 0; }
  table.data { min-width: 0; }
  table.data th,
  table.data td { white-space: normal; overflow-wrap: anywhere; }
  #ledger-table th { padding: 9px 8px; font-size: 9.5px; letter-spacing: 0.03em; }
  #ledger-table td { padding: 9px 8px; font-size: 12px; }
  .findings-wrap .findings-table { display: none; }
  .findings-wrap { display: none; }
  .findings-cards { display: block; }
  .host-scope-chips { display: none; }
  .host-scope-select { display: block; width: 100%; }
  .host-scan-item { min-height: 44px; }
  .host-scan-item .hs-flags { width: 100%; margin-left: 0; }
  .host-detail-head { align-items: flex-start; }
  .finding-card { overflow-wrap: anywhere; }
  .finding-card .fc-actions button { flex: 1 1 auto; }
  .stage-rail { flex-wrap: wrap; gap: 4px; }
  .stage-rail li { flex: 1 1 calc(33.333% - 4px); padding: 6px 4px; }
  .stage-rail .sr-label {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }
  .stage-rail .sr-time { display: none; }
  .stage-rail .sr-dot { width: 6px; height: 6px; }
  .add-scope-row { flex-wrap: nowrap; }
  .add-scope-row input { min-width: 0; flex: 1 1 auto; }
  .add-scope-row button { flex: none; }
  .advanced-body select { width: 100%; min-width: 0; }
  .feed-item { flex-wrap: wrap; }
  .feed-item time { margin-left: 0; white-space: normal; }
  .findings-cards, .finding-detail, .term, .muted { overflow-wrap: anywhere; }
  #qd-room { height: calc(100vh - 210px) !important; min-height: 480px !important; border-radius: 0 0 var(--radius-md) var(--radius-md); }
  .ob-steps { gap: 5px; }
  .ob-step { font-size: 10px; }
}

/* Installed/home-screen view: the bar background stays flush with the
   physical bottom edge and the home-indicator inset becomes inner padding.
   In a normal browser tab the same rule applies; env() simply resolves to 0
   when there is no safe-area inset. */
@media (max-width: 979px) and (display-mode: standalone),
       (max-width: 979px) and (display-mode: fullscreen) {
  #tabs-nav {
    bottom: 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 860px) {
  .landing-grid, .steps3, .packs { grid-template-columns: 1fr; }
  .hero { padding: 38px 18px 34px; }
  .hero-title { font-size: clamp(36px, 10.5vw, 54px); }
  .hero .sub { font-size: 15px; }
  .landing-bar { padding: 4px 4px 16px; }
  .landing-bar .brand-tag { font-size: 10px; }
  .term { min-height: 200px; padding: 15px; font-size: 12px; }
}

@media (max-width: 560px) {
  body {
    padding: 10px;
    padding-left: calc(10px + env(safe-area-inset-left));
    padding-right: calc(10px + env(safe-area-inset-right));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .card { padding: 16px; border-radius: 22px; }
  .hero { border-radius: 26px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 12px; }
  .stat .v { font-size: 24px; }
  .stat .l { font-size: 10.5px; }
  .app-bar { gap: 8px; }
  .app-bar .brand-tag { display: none; }
  .change-sum { margin-left: 0; }
  .finding-card .fc-top { flex-direction: column; gap: 6px; }
  .finding-card .fc-title { flex: 1 1 auto; }
  .ob-step { padding: 9px 3px; }
}

@media (max-width: 979px) {
  .card.qd-native { min-height: calc(100dvh - 190px); }
  .qd-head { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .qd-side { order: 3; width: 100%; justify-content: space-between; }
  .qd-thread { max-height: none; padding: 14px; }
  .qd-msg.qd-user { max-width: 82%; }
  .qd-msg.qd-assistant { max-width: 100%; }
  .qd-bubble .md-table-wrap {
    margin: 10px 0;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .qd-bubble .md-table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }
  .qd-bubble .md-table thead { display: none; }
  .qd-bubble .md-table tbody { display: grid; gap: 8px; }
  .qd-bubble .md-table tr {
    display: block;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(3, 7, 15, 0.28);
  }
  .qd-bubble .md-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .qd-bubble .md-table td:first-child { border-top: 0; }
  .qd-bubble .md-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--dim);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
  }
  .qd-bubble .md-table td .md-cell-clip {
    max-width: none;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .qd-role { font-size: 12px; }
  .qd-empty { padding: 16px 4px; }
  .qd-composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
  .qd-send { padding: 0 14px; }
}

@media (max-width: 380px) {
  .stat-row { grid-template-columns: 1fr; }
  #tabs-nav a { font-size: 8.5px; }
  #tabs-nav a .nav-icon { width: 18px; height: 18px; }
  .app-bar { gap: 6px; padding: 4px 8px; }
  .app-bar-meta { gap: 3px; }
  .top-action { padding: 8px 8px; }
  .beta-tag { padding: 1px 5px; font-size: 8px; letter-spacing: 0.05em; }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-bg: rgba(13, 18, 30, 0.95);
    --glass-bg-soft: rgba(13, 18, 30, 0.94);
    --glass-bg-strong: rgba(18, 24, 38, 0.96);
    --glass-border: rgba(255, 255, 255, 0.16);
    --blur: 0px;
  }
  body::before { opacity: 0.32; filter: none; animation: none; }
  .card, .hero, .app-bar, #tabs-nav, .term, .pack, .feat, .step3,
  .stat, .finding-card, .host-card, .change-block, .trace-item,
  .scan-live, .host-scan-item, .advanced, .finding-detail,
  .scan-status-line, .agent-trace, .ob-step, .add-scope {
    background: rgba(13, 18, 30, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #tabs-nav { background: rgba(17, 23, 37, 0.98); }
  table.data th { background: rgba(13, 18, 30, 0.98); -webkit-backdrop-filter: none; backdrop-filter: none; }
  button, .btn, input, select, textarea {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  input, select, textarea { background: rgba(13, 18, 30, 0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-dot, .skeleton-bar { animation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- F1 fixes: target sizes, mobile filters and table cards ---- */
.app-bar .brand,
.landing-bar .brand {
  min-height: 44px;
  align-items: center;
}
.landing-bar .brand {
  padding: 12px 6px;
  margin: -12px -6px;
}
.api-docs-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  margin: 0 -6px;
}
.check-row { min-height: 44px; }
.group-check { margin: 0; }
.auto-reload-enabled-row { margin: 0; }

.promo-hint { margin: 6px 0 0; font-size: 12px; }
.changes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.changes-toolbar .lbl { margin: 0; }
.changes-toolbar select { min-width: 0; max-width: 280px; }

.findings-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 12px;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.filter-field .lbl { margin: 0; }
.filter-field select { min-width: 150px; }
.filter-count {
  display: flex;
  align-items: center;
  flex: 1 1 120px;
  min-height: 44px;
}
.filter-toggle { display: flex; align-items: center; }
.filter-toggle .check-row { margin: 0; }
.filter-exports { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.auto-reload-step {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.auto-reload-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auto-reload-step-head h3 { margin: 0; font-size: 14px; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.16);
  color: #d8d0ff;
  font: 700 12px/1 var(--font-sans);
}

.term-label { font-size: 11.5px; }
.pack .badge { font-size: 11px; }

.mobile-cards { display: none; }
.mobile-card {
  margin: 10px 0;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.mobile-card.clickable { cursor: pointer; }
.mobile-card.clickable:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: var(--glass-bg);
}
.mobile-card.sel { border-color: rgba(167, 139, 250, 0.52); background: rgba(139, 92, 246, 0.13); }
.mobile-card .mc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mobile-card .mc-head > b { overflow-wrap: anywhere; }
.mobile-card .mc-meta {
  margin-top: 7px;
  color: var(--dim);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.mobile-card .mc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}
.mobile-card .mc-field .lbl { margin: 0; }
.mobile-card .mc-field select { width: 100%; min-width: 0; }
.mobile-card .mc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}
.mobile-card .mc-actions button,
.mobile-card .mc-actions .btn { flex: 1 1 auto; }
.mobile-card .mc-actions a { align-self: center; }

@media (max-width: 979px) {
  #tabs-nav a {
    font-size: clamp(10.5px, 2.7vw, 11.5px);
    letter-spacing: -0.035em;
    min-height: 52px;
  }
}

@media (max-width: 860px) {
  .landing-bar .brand-tag { font-size: 11.5px; }
}

@media (max-width: 760px) {
  .scopes-list > .table-wrap,
  .settings-creds > .table-wrap,
  .settings-keys > .table-wrap,
  .billing-purchases > .table-wrap { display: none; }
  .mobile-cards { display: block; }
}

@media (max-width: 560px) {
  .findings-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
  }
  .filter-field select { width: 100%; min-width: 0; }
  .filter-count,
  .filter-toggle,
  .filter-exports { grid-column: 1 / -1; }
  .filter-exports {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .filter-exports .small { width: 100%; }
}

@media (max-width: 380px) {
  #tabs-nav a { font-size: 10.5px; }
}

/* ------------------------------------------------------------------
   Shared list + detail language (Scopes / Scans / Findings / Hosts)
   One row family, one empty state, one group header, one detail grammar.
------------------------------------------------------------------ */
.shared-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.list-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--spring);
}
.list-row:hover,
.list-row:focus-visible {
  border-color: rgba(167, 139, 250, 0.42);
  background: rgba(139, 92, 246, 0.1);
  outline: none;
  transform: translateY(-1px);
}
.list-row.sel,
.list-row.active {
  border-color: rgba(167, 139, 250, 0.58);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(139, 92, 246, 0.14));
}
.list-row-media { flex: none; width: 64px; }
.list-row-media img { width: 100%; height: auto; border-radius: 8px; display: block; }
.list-row-main { flex: 1 1 auto; min-width: 0; }
.list-row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.list-row-sub {
  margin-top: 3px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.list-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
}
.list-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.list-row-meta span { overflow-wrap: anywhere; }
.list-row-actions {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  justify-content: flex-end;
  max-width: 48%;
}
.list-row-actions button,
.list-row-actions select { min-height: 34px; margin: 0; }
.list-row-field { display: flex; flex-direction: column; gap: 3px; }
.list-row-field .lbl { margin: 0; font-size: 10px; }
.list-row .scan-kind { font-weight: 700; }
.list-row .scan-scope { color: var(--fg-soft); font-weight: 600; }
.list-link { color: #b9c7ff; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(185, 199, 255, 0.35); text-underline-offset: 2px; }
.list-row-actions a { align-self: center; }
.feed-link {
  min-width: 0;
  color: var(--fg-soft);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.feed-link:hover, .feed-link:focus-visible { color: var(--fg); text-decoration: underline; }
.chg-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.chg-link:hover, .chg-link:focus-visible {
  color: var(--fg);
  background: rgba(185, 199, 255, 0.06);
}
.finding-detail-panel { margin: 10px 0 16px; }

.list-empty {
  margin: 8px 0 0;
  padding: 22px 16px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}
.list-empty-title { font-size: 14px; font-weight: 700; color: var(--fg); }
.list-empty-body { margin: 6px auto 0; max-width: 46ch; color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.list-empty .btn, .list-empty button { margin-top: 12px; }
.list-skeleton { margin-top: 8px; }

.detail-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

/* Compact headers for the scan view and scope hub. The title, scope, and
   status stay on one line; the phase strip and content follow close behind. */
.detail-head.scan-flow-head {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 14px;
  padding: 2px 0 7px;
  margin-bottom: 4px;
}
.detail-head.scope-hub-head {
  gap: 5px;
  padding: 2px 0 8px;
  margin-bottom: 4px;
}
.detail-head.scope-hub-head .detail-title {
  margin-top: 2px;
  line-height: 1.2;
}
.scope-detail .scan-status-line {
  margin: 0 0 8px;
  padding: 7px 10px;
}
.scan-live.scan-flow,
.scope-detail { padding-top: clamp(12px, 1.6vw, 18px); }

@media (max-width: 760px) {
  .detail-head.scan-flow-head { flex-wrap: wrap; padding-bottom: 6px; }
  .detail-head.scan-flow-head .scan-flow-head-side {
    flex: 1 1 100%;
    gap: 6px;
    justify-content: flex-end;
  }
  .detail-head.scan-flow-head .scan-flow-counts { gap: 6px; }
}
.detail-head-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.detail-kicker {
  color: var(--dim);
  font: 700 10px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.detail-title {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-section { margin: 16px 0; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.detail-section-head h3 { margin: 0; }
.detail-evidence {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 15, 0.22);
}
.detail-evidence-label {
  margin-bottom: 6px;
  color: var(--dim);
  font: 700 10px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.detail-evidence-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.detail-evidence-head .detail-evidence-label { margin-bottom: 0; }
.evidence-kind {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(139, 92, 246, 0.14);
  color: var(--dim);
  font: 600 10px/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.detail-evidence .code-block { margin-top: 8px; }
.repro-steps {
  margin: 0;
  padding-left: 22px;
  overflow-wrap: anywhere;
}
.repro-steps li { margin: 4px 0; }
.detail-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.detail-evidence pre { margin: 0; white-space: pre; overflow-x: auto; }
.detail-report-slot:empty { display: none; }
.hub-list { margin-top: 0; }
.hub-sort { margin: 0 0 8px; }
.hub-counts { margin-bottom: 6px; }
.finding-detail .detail-head { margin-top: 2px; }
tr.finding-row td.f-host { color: var(--fg-soft); font-size: 11.5px; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .list-row { flex-wrap: wrap; padding: 11px 12px; }
  .list-row-actions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
  }
  .list-row-actions button,
  .list-row-actions select { min-height: 44px; }
  .list-row-media { width: 52px; }
  .detail-title { font-size: 16px; }
}

.list-group-head {
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(59, 130, 246, 0.1));
}

/* ------------------------------------------------------------------
   Campaign V4: mobile findings cards, compact filter chrome, code blocks.
------------------------------------------------------------------ */
.findings-toolbar { margin-bottom: 12px; }
.findings-toolbar-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.findings-toolbar-bar .filter-count {
  flex: 1 1 100px;
  min-height: 34px;
}
.filter-disclosure-btn { display: none; align-items: center; gap: 6px; }
.filter-disclosure-btn .nav-icon { width: 16px; height: 16px; }
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgba(139, 92, 246, 0.34);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin: 0;
  padding: 3px 9px;
  border: 1px solid rgba(167, 139, 250, 0.34);
  border-radius: var(--radius-pill);
  background: rgba(139, 92, 246, 0.14);
  box-shadow: none;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
  text-align: left;
}
.filter-chip:hover { color: var(--fg); background: rgba(139, 92, 246, 0.24); }
.filter-chip span { opacity: 0.75; font-size: 13px; line-height: 1; }
.filter-chip-clear { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05); }
.view-actions { position: relative; display: inline-flex; flex: none; }
.view-actions-btn { min-width: 44px; padding-left: 11px; padding-right: 11px; font-size: 18px; line-height: 1; }
.view-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(14, 20, 34, 0.98);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}
.view-actions-menu.hidden { display: none !important; }
.view-actions-menu button { width: 100%; margin: 0; text-align: left; }
.detail-head-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.findings-table-wrap { max-width: 100%; }
.findings-cards { display: none; }
.findings-cards .finding-card { margin: 8px 0; }
.finding-card .fc-title a { color: inherit; text-decoration: none; }
.finding-card .fc-title a:hover { color: #dbe2ff; text-decoration: underline; }
.finding-card .fc-meta .fc-host,
.finding-card .fc-meta .fc-scope { overflow-wrap: anywhere; }

.code-block {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(2, 5, 12, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
/* Trace payloads wrap like LOG lines instead of scrolling off the edge. The
   higher-specificity selector wins over the generic .code-block rule above. */
.scan-terminal .terminal-code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
}
.terminal-line.trace-collapsible { cursor: pointer; }
.terminal-line.trace-collapsible:hover {
  background: rgba(255, 255, 255, 0.025);
}
.terminal-line.trace-collapsible:not(.trace-open) .terminal-code,
.terminal-line.trace-collapsible:not(.trace-open) .terminal-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  max-height: 7.2em;
  overflow: hidden;
}
.code-block[data-lang]::before {
  content: attr(data-lang);
  display: block;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--dim);
  font: 700 9.5px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.code-block .hljs-comment,
.code-block .hljs-quote { color: #6f7f9f; font-style: italic; }
.code-block .hljs-keyword,
.code-block .hljs-selector-tag,
.code-block .hljs-literal,
.code-block .hljs-doctag,
.code-block .hljs-meta .hljs-keyword { color: #c792ea; }
.code-block .hljs-string,
.code-block .hljs-regexp,
.code-block .hljs-symbol,
.code-block .hljs-bullet,
.code-block .hljs-meta-string { color: #9ae6b4; }
.code-block .hljs-number,
.code-block .hljs-variable,
.code-block .hljs-template-variable,
.code-block .hljs-attr,
.code-block .hljs-attribute { color: #f6c177; }
.code-block .hljs-title,
.code-block .hljs-section,
.code-block .hljs-selector-id,
.code-block .hljs-selector-class,
.code-block .hljs-function .hljs-title { color: #82aaff; }
.code-block .hljs-built_in,
.code-block .hljs-builtin-name,
.code-block .hljs-type,
.code-block .hljs-class .hljs-title,
.code-block .hljs-params { color: #7dd3fc; }
.code-block .hljs-tag,
.code-block .hljs-name,
.code-block .hljs-selector-attr,
.code-block .hljs-selector-pseudo,
.code-block .hljs-template-tag { color: #f07178; }
.code-block .hljs-meta,
.code-block .hljs-link { color: #89ddff; }
.code-block .hljs-addition { color: #b7f7c1; }
.code-block .hljs-deletion { color: #ff9cac; }
.code-block .hljs-emphasis { font-style: italic; }
.code-block .hljs-strong { font-weight: 700; }
.detail-evidence pre.code-block { white-space: pre; overflow-x: auto; }
.finding-detail .detail-section .code-block { margin-top: 2px; }

@media (min-width: 761px) {
  .findings-cards { display: none; }
}

@media (max-width: 979px) {
  .filter-disclosure-btn { display: inline-flex; min-height: 44px; }
  .findings-toolbar-bar { gap: 8px; }
  .findings-toolbar-bar .filter-count { flex: 1 1 auto; min-height: 44px; }
  .findings-filters.filter-panel { display: none; }
  .findings-filters.filter-panel.filter-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
  }
  .findings-filters.filter-panel .filter-field select { width: 100%; min-width: 0; }
  .filter-chip { min-height: 44px; padding: 7px 11px; font-size: 12px; }
  .group-switch .group-switch-btn { min-height: 44px; }
  .view-actions-menu button { min-height: 44px; }
  .top-action { min-width: 44px; }
  .feed-link { display: inline-flex; align-items: center; min-height: 44px; }
  .finding-card .fc-title a,
  .finding-card .fc-meta a,
  .detail-meta .list-link,
  .detail-section .list-link { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
  .detail-download-actions button { min-height: 44px; }
  .table-wrap { max-width: 100%; min-width: 0; }
  table.data { min-width: 0; }
  table.data th,
  table.data td { white-space: normal; overflow-wrap: anywhere; }
  .code-block { font-size: 11.5px; }
}

@media (max-width: 760px) {
  .findings-table-wrap { display: none; }
  .findings-cards { display: block; }
  .findings-groups .finding-group { overflow: visible; }
}

/* Riders: keep the fixed viewport legible at a 390px phone width. */
@media (max-width: 420px) {
  #tabs-nav a { font-size: 10.5px; }
  .finding-card .fc-title { font-size: 14px; }
  .finding-card .fc-meta,
  .finding-card .fc-detail { font-size: 12px; }
  .finding-group-scopes { font-size: 10.5px; }
  .fc-swipe-label { font-size: 10px; }
}

/* About + customer-facing release notes */
.settings-about { min-width: 0; }
.about-version-line { font-family: var(--font-mono); font-size: 12px; }
.about-releases {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
.about-release {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
}
.about-release-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.about-release-head h3 {
  margin: 0;
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-transform: none;
}
.about-release-group { margin-top: 12px; }
.about-release-group h4 {
  margin: 0 0 6px;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.about-release-group ul { margin: 0; padding-left: 18px; color: var(--fg-soft); }
.about-release-group li { margin: 4px 0; font-size: 13px; line-height: 1.5; }
.app-footer {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 18px 8px calc(96px + env(safe-area-inset-bottom));
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}
.footer-version {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}
.footer-version:hover,
.footer-version:focus-visible { text-decoration: underline; }
.footer-version:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
@media (min-width: 980px) {
  .app-footer { padding: 18px 8px; }
}

/* Settings discoverability, full-width cards and honest credential/key state */
.settings-quick-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.settings-quick-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid rgba(167, 139, 250, 0.32);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.13), rgba(59, 130, 246, 0.06));
  color: var(--fg);
  text-decoration: none;
}
.settings-quick-link b { font-size: 13.5px; }
.settings-quick-link span { color: var(--dim); font-size: 12.5px; }
.settings-quick-link:hover {
  border-color: rgba(167, 139, 250, 0.58);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.1));
}
.settings-creds,
.settings-sources,
.settings-notify,
.settings-ai { min-width: 0; }
.settings-creds > .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}
table.data.creds-table,
#creds-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
#creds-table th,
#creds-table td {
  min-width: 0;
  padding: 10px 9px;
}
#creds-table th.cred-col-label { width: 15%; }
#creds-table th.cred-col-target { width: 25%; }
#creds-table th.cred-col-username { width: 19%; }
#creds-table th.cred-col-verified { width: 15%; }
#creds-table th.cred-col-actions { width: 26%; }
#creds-table td.cred-label,
#creds-table td.cred-target,
#creds-table td.cred-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#creds-table td.cred-verified { white-space: nowrap; }
#creds-table .cred-actions,
#creds-table .cred-actions-head { white-space: normal; }
#creds-table .cred-actions button {
  margin: 2px 0 2px 4px;
  white-space: nowrap;
}
#creds-table .cred-actions button:first-child { margin-left: 0; }
@media (min-width: 980px) {
  #creds-table .cred-actions button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11.5px;
  }
}
.sf-state { flex: none; }
.auto-reload-source {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.auto-reload-card-hint { margin: 4px 0 0; font-size: 12px; }

/* Settings danger zone + typed wipe confirmation */
.settings-danger {
  border-color: rgba(255, 107, 122, 0.28);
}
.settings-danger h2 { color: #ffb3bb; }
.settings-danger .row { margin-top: 12px; align-items: center; }
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: fixed;
  z-index: 81;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-card, 18px);
  background: #10151d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.modal-card h2 { margin-top: 0; }
.modal-card .row { justify-content: flex-end; margin-top: 14px; }
.app-toast {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid rgba(120, 255, 180, 0.32);
  border-radius: 12px;
  background: #0e1a14;
  color: #c9f7d8;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  font-size: 13px;
}

/* ------------------------------------------------------------------
   Campaign UI-Polish Phase 4: segmented strips, charts, dense timeline,
   compact scope rows, and the repeat-scans sheet.
------------------------------------------------------------------ */
.seg-strip-card { padding: 10px 14px; }
.seg-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  margin: 0;
}
.seg-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 2px 14px;
  border-left: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
}
.seg-cell:first-child { border-left: 0; padding-left: 2px; }
.seg-cell:hover { background: rgba(255, 255, 255, 0.035); color: var(--fg); }
.seg-v {
  font-size: 22px;
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.seg-v.bad { color: #ffadb7; }
.seg-l {
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.seg-muted-line {
  display: none;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.seg-strip-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hub-counts { margin: 0 0 10px; }
.hub-counts .seg-cell { padding-top: 2px; padding-bottom: 2px; }

.chart-sub { margin: -8px 0 10px; font-size: 11.5px; }
.chart-body { min-width: 0; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .chart-label,
.chart-svg .chart-value,
.chart-svg .chart-axis,
.chart-svg .chart-caption { font-family: var(--font-mono); }
.chart-svg .chart-label { fill: var(--dim); font-size: 9.5px; }
.chart-svg .chart-value { fill: var(--fg-soft); font-size: 9.5px; }
.chart-svg .chart-axis { fill: var(--dim); font-size: 7.5px; text-anchor: middle; }
.chart-svg .chart-axis-title { fill: var(--dim); font-size: 8px; font-weight: 600; text-anchor: middle; }
.chart-svg .chart-caption { fill: var(--dim-2); font-size: 6.5px; text-anchor: middle; }
.chart-sev-critical { fill: #ff6b7a; }
.chart-sev-high { fill: #fb923c; }
.chart-sev-medium { fill: #fbbf24; }
.chart-sev-low { fill: #60a5fa; }
.chart-sev-info { fill: #8592ad; }
.chart-st-done { fill: #4ade80; }
.chart-st-partial { fill: #fbbf24; }
.chart-st-failed { fill: #ff6b7a; }
.chart-st-running { fill: #60a5fa; }
.chart-st-other { fill: #8592ad; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}
.chart-legend span { display: inline-flex; align-items: center; }
.chart-swatch {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
}
.chart-swatch.chart-sev-critical { background: #ff6b7a; }
.chart-swatch.chart-sev-high { background: #fb923c; }
.chart-swatch.chart-sev-medium { background: #fbbf24; }
.chart-swatch.chart-sev-low { background: #60a5fa; }
.chart-swatch.chart-sev-info { background: #8592ad; }
.chart-swatch.chart-st-done { background: #4ade80; }
.chart-swatch.chart-st-partial { background: #fbbf24; }
.chart-swatch.chart-st-failed { background: #ff6b7a; }
.chart-swatch.chart-st-running { background: #60a5fa; }
.chart-swatch.chart-st-other { background: #8592ad; }
.chart-empty { padding: 18px 0; text-align: center; font-size: 12.5px; }

#activity-card { padding-bottom: 18px; }
#activity-more { margin-top: 10px; }
#activity-card,
#activity-view-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(4, 8, 15, 0.32);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.feed-timeline {
  margin-top: 10px;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.feed-row {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  grid-gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 3px 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  color: var(--fg-soft);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.feed-row::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.feed-row:hover,
.feed-row:focus-visible {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.035);
  transform: none;
  box-shadow: none;
}
.feed-dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px rgba(5, 7, 13, 0.72);
}
.feed-dot.dot-scan { background: var(--acc); }
.feed-dot.dot-critical { background: #ff6b7a; }
.feed-dot.dot-high { background: #fb923c; }
.feed-dot.dot-medium { background: #fbbf24; }
.feed-dot.dot-low { background: #60a5fa; }
.feed-dot.dot-info { background: #8592ad; }
.feed-dot.dot-muted { background: var(--dim-2); }
.feed-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
  font-size: 13px;
}
.feed-row time {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.feed-row-group { grid-template-columns: 16px minmax(0, 1fr) auto 16px; }
.feed-chevron {
  width: 14px;
  height: 14px;
  color: var(--dim);
  transition: transform 0.2s var(--ease);
}
.feed-group.open .feed-chevron { transform: rotate(180deg); }
.feed-row-child {
  grid-template-columns: 16px minmax(0, 1fr) auto;
  padding-left: 26px;
}
.feed-row-child::before { left: 33px; }
.feed-row-child .feed-text { color: var(--dim); font-size: 12px; }
.feed-children[hidden] { display: none; }
.feed-unseen {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translateX(-50%);
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid rgba(139, 124, 255, 0.4);
  border-radius: 999px;
  background: rgba(18, 24, 40, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
}
.feed-unseen:hover,
.feed-unseen:focus-visible {
  border-color: rgba(139, 124, 255, 0.65);
  background: rgba(28, 36, 58, 0.98);
}
.feed-unseen.hidden { display: none; }
@media (max-width: 979px) {
  .feed-unseen { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

.scope-list {
  gap: 0;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--glass-bg), var(--glass-bg-soft));
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-md);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  overflow: hidden;
}
.scope-list .scope-row {
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.scope-list .scope-row:last-child { border-bottom: 0; }
.scope-list .scope-row:hover,
.scope-list .scope-row:focus-visible {
  transform: none;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.04);
}
.scope-list .scope-row.sel {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.08));
}
.scope-health {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
}
.scope-health.green { background: var(--ok); }
.scope-health.amber { background: var(--warn); }
.scope-health.red { background: var(--bad); }
.scope-health.never { background: var(--dim-2); }
.scope-main { min-width: 0; }
.scope-pattern {
  overflow: hidden;
  color: var(--fg);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-meta {
  margin-top: 2px;
  overflow: hidden;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.scope-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}
.scope-scan-pill {
  min-height: 44px;
  padding: 7px 14px;
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 46%, #8b5cf6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 10px 24px rgba(59, 130, 246, 0.24);
  color: #fff;
}
.scope-scan-pill:hover {
  filter: brightness(1.09) saturate(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 14px 30px rgba(59, 130, 246, 0.3);
}
.scope-del {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--dim);
}
.scope-del:hover {
  border-color: transparent;
  background: rgba(255, 107, 122, 0.08);
  box-shadow: none;
  color: #ffadb7;
}
.scope-del svg { width: 18px; height: 18px; }
.scope-list .list-empty,
.scope-list .list-skeleton { margin: 12px 0; }

.cadence-btn {
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
}
.cadence-btn svg { width: 16px; height: 16px; flex: none; }
.cadence-btn .cadence-label { font-size: 12px; white-space: nowrap; }
.cadence-btn.is-off { color: var(--fg-soft); }
.cadence-btn.is-on {
  color: #d8d0ff;
  border-color: rgba(167, 139, 250, 0.42);
  background: rgba(139, 92, 246, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.cadence-btn.is-on:hover { background: rgba(139, 92, 246, 0.24); }
.cadence-btn.is-on::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
}

.cadence-sheet {
  position: fixed;
  z-index: 82;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 24px));
  padding: 18px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: #10151d;
  box-shadow: var(--shadow-lg);
}
.cadence-sheet.hidden { display: none; }
.cadence-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.cadence-sheet-head h2 {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cadence-close {
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}
.cadence-rows { display: flex; flex-direction: column; }
.cadence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--fg-soft);
  font: 600 14px/1.3 var(--font-sans);
  text-align: left;
}
.cadence-row:last-child { border-bottom: 0; }
.cadence-row:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}
.cadence-row.selected { color: var(--fg); }
.cadence-radio {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}
.cadence-row.selected .cadence-radio { border-color: var(--acc); }
.cadence-row.selected .cadence-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc-blue), var(--acc-purple));
}
.cadence-ai-row {
  min-height: 48px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.cadence-next { min-height: 1.4em; margin: 4px 0 0; font-size: 12px; }
#cadence-err:empty { display: none; }
.cadence-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.cadence-sheet-actions button { min-height: 38px; padding: 7px 14px; }

@media (max-width: 979px) {
  .seg-strip-card { padding: 4px 12px; }
  .seg-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg-cell { padding: 2px 10px; }
  .seg-cell-secondary { display: none; }
  .seg-muted-line { display: block; margin-top: 0; padding-top: 3px; line-height: 1.35; }
  .cadence-sheet {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    transform: none;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 980px) {
  #app > .card.dashboard-strip-card[data-tab] {
    grid-column: 1 / span 12;
    grid-row: 1;
  }
  #app > .card.dashboard-qd-cell[data-tab].tab-active {
    display: flex !important;
    flex-direction: column;
    grid-column: 7 / span 6;
    grid-row: 2 / span 3;
    padding: 0;
    overflow: hidden;
  }
  #app > .card.chart-card[data-tab] { grid-column: 1 / span 6; }
  #app > .card.chart-card-a[data-tab] { grid-row: 2; }
  #app > .card.chart-card-b[data-tab] { grid-row: 3; }
  #app > .card.chart-card-c[data-tab] { grid-row: 4; }
  #app > .card.overview-activity[data-tab] {
    grid-column: 1 / span 12;
    grid-row: 5;
    align-self: start;
  }
  .seg-muted-line { display: none; }
}

/* Notification bell: non-modal panel in the top bar. */
.notif-open { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff6b7a;
  box-shadow: 0 0 0 2px rgba(5, 7, 13, 0.78);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}
.notif-badge.hidden { display: none !important; }
.notif-panel {
  position: fixed;
  z-index: 95;
  top: 78px;
  right: max(12px, calc((100vw - 1440px) / 2 + 24px));
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 24px));
  max-height: min(70dvh, 560px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.notif-panel.hidden { display: none !important; }
.notif-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.notif-head h2 { margin: 0; font-size: 15px; }
.notif-sub { margin: 2px 0 0; font-size: 11.5px; }
.notif-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
}
.notif-close:hover { color: var(--fg); background: rgba(255, 255, 255, 0.09); }
.notif-list { overflow-y: auto; padding: 6px 8px 10px; }
.notif-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-gap: 8px;
  align-items: start;
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 12px;
  color: var(--fg-soft);
  text-decoration: none;
}
.notif-item:hover,
.notif-item:focus-visible {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.045);
  transform: none;
  box-shadow: none;
}
.notif-item.unread { background: rgba(139, 124, 255, 0.08); }
.notif-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.4;
}
.notif-item time {
  padding-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.notif-unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--acc);
  vertical-align: middle;
}
.notif-empty { padding: 14px 8px; }
.feed-badge {
  display: inline-block;
  margin-right: 2px;
  padding: 1px 6px;
  border: 1px solid rgba(139, 124, 255, 0.35);
  border-radius: 999px;
  background: rgba(139, 124, 255, 0.14);
  color: var(--fg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}
.feed-dot.dot-announcement { background: #8b7cff; }

@media (max-width: 980px) {
  .notif-panel {
    top: auto;
    right: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 180px);
    border-radius: 20px;
  }
}

/* ---------------- AI scan estimate / host selection ---------------- */
.host-selection {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-soft);
}
.host-selection-summary {
  color: var(--fg-soft);
  font-size: 12.5px;
  line-height: 1.45;
}
.host-selection-summary b { color: var(--fg); }
.host-selection-short { color: var(--warn); font-weight: 700; }
.host-selection-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.host-selection-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 12px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}
.host-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}
.host-select-row:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.host-select-row span { min-width: 0; overflow-wrap: anywhere; }
.host-select-row input { flex: none; accent-color: var(--acc); }
.host-exclude-btn { margin-left: 8px; }
.scan-flow-panel.awaiting-decision {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.07), rgba(255, 255, 255, 0.035));
}
.awaiting-decision-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.awaiting-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 640px) {
  .host-selection-list { grid-template-columns: 1fr; max-height: 220px; }
  .awaiting-decision-actions > * { flex: 1 1 auto; }
}

/* ---------------- per-scan timeouts ---------------- */
.timeout-panel {
  margin: 4px 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-soft);
}
.timeout-panel summary {
  cursor: pointer;
  color: var(--fg-soft);
  font-size: 12.5px;
  font-weight: 700;
}
.timeout-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.timeout-grid-compact {
  gap: 1px;
  margin-top: 8px;
}
.timeout-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 84px;
  align-items: center;
  gap: 8px;
  padding: 1px 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}
.timeout-row label {
  min-width: 0;
  color: var(--dim);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeout-row input[type="range"] {
  width: 100%;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--acc);
}
.timeout-row output {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: right;
  white-space: nowrap;
}
.timeout-divider {
  height: 1px;
  margin: 3px 0;
  background: var(--line);
}
.host-timeout-overrides {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.host-timeout-overrides .check-row { margin: 0; }
@media (max-width: 640px) {
  .timeout-row {
    grid-template-columns: 88px minmax(0, 1fr) 72px;
    gap: 6px;
  }
  .timeout-row label,
  .timeout-row output { font-size: 11px; }
}

/* ---------------- AI review profiles ---------------- */
.review-settings-panel {
  margin: 6px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-soft);
}
.review-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: var(--fg);
  font-size: 13.5px;
}
.review-settings-head .muted { font-size: 11px; }
.review-settings-sub {
  margin: 4px 0 10px;
  font-size: 11px;
  line-height: 1.45;
}
.profile-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
}
.profile-pill {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-soft);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.profile-pill.selected {
  border-color: var(--acc);
  background: var(--glass-bg-strong, rgba(110, 168, 254, 0.10));
  color: var(--fg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(110, 168, 254, 0.28);
}
.review-summary {
  margin: 6px 0 2px;
  color: var(--fg-soft);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.model-selector { margin: 10px 0 2px; }
.model-selector-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 11px;
}
.model-selector-head b { color: var(--fg-soft); font-weight: 600; }
.model-options {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}
.model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-top: 1px solid var(--glass-border);
  border-radius: 0;
  background: transparent;
  color: var(--fg-soft);
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.model-option:first-child { border-top: 0; }
.model-option-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-option-rate {
  flex: 0 0 auto;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.model-option-soon {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.model-option:hover:not(:disabled) {
  background: var(--glass-bg-soft);
  color: var(--fg);
}
.model-option.selected {
  color: var(--fg);
  font-weight: 600;
  background: var(--glass-bg-strong, rgba(110, 168, 254, 0.10));
  box-shadow: inset 3px 0 0 var(--acc);
}
.model-option.selected .model-option-rate { color: var(--fg-soft); }
.model-option:disabled,
.model-option.unavailable {
  color: var(--dim);
  cursor: not-allowed;
  opacity: 0.55;
}
.model-option.unavailable .model-option-rate { color: var(--dim); }
.scan-model-tag { color: var(--fg-soft); }
.stage-settings {
  margin: 10px 0 4px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--glass-bg-soft);
}
.stage-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--fg-soft);
  font-size: 12px;
  text-align: left;
}
.stage-settings-toggle:hover { color: var(--fg); }
.stage-settings-label { min-width: 0; }
.stage-settings-hint {
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
}
.stage-settings-value {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--dim);
  font-size: 11px;
  text-align: right;
}
#sd-stage-settings-summary, #ss-stage-settings-summary {
  overflow-wrap: anywhere;
}
.stage-settings-caret { color: var(--dim); }
.stage-settings-body {
  padding: 0 11px 10px;
  border-top: 1px solid var(--line);
}
.stage-setting {
  padding: 9px 0 2px;
}
.stage-setting + .stage-setting {
  border-top: 1px solid var(--line);
}
.stage-setting-label {
  margin-bottom: 6px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
}
.stage-setting-label span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 400;
}
.stage-pills {
  display: flex;
  gap: 6px;
}
.stage-pill {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-soft);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.stage-pill.selected {
  border-color: var(--acc);
  background: var(--glass-bg-strong, rgba(110, 168, 254, 0.10));
  color: var(--fg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(110, 168, 254, 0.28);
}
.review-overrides-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: transparent;
  color: var(--fg-soft);
  font-size: 12px;
  text-align: left;
}
.review-overrides-toggle:hover {
  border-color: var(--acc);
}
.review-overrides-action {
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
}
.review-overrides-body {
  margin-top: 6px;
}
.review-overrides-body .review-settings-sub {
  margin: 6px 0 0;
}
.review-section-title {
  margin: 14px 0 2px;
  color: var(--fg);
  font-size: 12.5px;
}
.review-uncapped-note {
  margin: 8px 0 2px;
  font-size: 11px;
  line-height: 1.45;
}
.host-review-overrides {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.review-override-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(92px, 0.8fr) minmax(100px, 0.9fr) minmax(90px, 0.8fr);
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.review-override-row:last-child { border-bottom: 0; }
.review-override-host {
  min-width: 0;
  color: var(--fg-soft);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-override-row .check-row {
  min-height: 32px;
  margin: 0;
  font-size: 11.5px;
}
.review-override-row select {
  min-width: 0;
  font-size: 11.5px;
}
.review-save-default {
  margin: 10px 0 0;
}
.scope-picker {
  position: relative;
  margin-bottom: 14px;
}
.scope-picker-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-bg-soft);
  color: var(--fg);
  text-align: left;
}
.scope-picker-toggle:hover,
.scope-picker-toggle[aria-expanded="true"] {
  border-color: var(--acc);
}
.scope-picker-selected {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.scope-picker-pattern {
  font-family: var(--font-mono);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-picker-meta {
  font-size: 11px;
  line-height: 1.35;
}
.scope-picker-caret {
  flex: none;
  color: var(--dim);
  font-size: 12px;
}
.scope-picker-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-bg-strong, var(--panel, #151922));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.scope-picker-search {
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: 12px;
}
.scope-picker-list {
  max-height: 240px;
  overflow-y: auto;
}
.scope-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg-soft);
  text-align: left;
}
.scope-picker-row:last-child { border-bottom: 0; }
.scope-picker-row:hover,
.scope-picker-row.selected {
  background: var(--glass-bg-soft);
  color: var(--fg);
}
.scope-picker-row-pattern {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-picker-row-hosts {
  flex: none;
  color: var(--dim);
  font-size: 11px;
}
.scope-picker-empty {
  padding: 10px 12px;
  color: var(--dim);
  font-size: 12px;
}
.scan-config-sheet {
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .profile-pills { flex-wrap: wrap; }
  .profile-pill { flex: 1 1 auto; }
  .stage-pills { flex-wrap: wrap; }
  .stage-pill { flex: 1 1 auto; }
  .stage-settings-hint { display: none; }
  .review-override-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 4px;
  }
  .review-override-row select {
    grid-column: span 1;
    width: 100%;
  }
  .review-override-host { white-space: normal; overflow-wrap: anywhere; }
}
