/* ──────────────────────────────────────────────────────────────────────────── */
/* AutoAR Dashboard — Premium Dark Theme                                        */
/* ──────────────────────────────────────────────────────────────────────────── */

/* Fonts are loaded locally or fallback to system-ui */
:root {
  /* Backgrounds */
  --bg-base: #0a0a0a;
  --bg-surface: #111111;
  --bg-card: #171717;
  --bg-card-hover: #1f1f1f;
  --bg-input: #111111;
  --bg-glass: rgba(10, 10, 10, 0.8);

  /* Borders */
  --border: rgba(255, 255, 255, 0.09);
  --border-bright: rgba(255, 255, 255, 0.16);

  /* Accents */
  --accent-cyan: #3291ff;
  --accent-cyan-dim: rgba(50, 145, 255, 0.14);
  --accent-cyan-glow: rgba(50, 145, 255, 0.25);
  --accent-purple: #a78bfa;
  --accent-purple-dim: rgba(167, 139, 250, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);
  --accent-red: #f87171;
  --accent-red-dim: rgba(248, 113, 113, 0.15);

  /* Color system (better-colors pass): brand aliases the premium sheet
     references, a raised-surface step, a strong border step and a faint
     text step for decorative labels — every role now has a token. */
  --accent-primary: #3291ff;
  --accent-secondary: #a78bfa;
  --accent-primary-dim: rgba(50, 145, 255, 0.14);
  --accent-primary-hover: #5aa6ff;
  --on-accent: #0a0a0a; /* text on a filled accent button */
  /* Recessed panels (toolbars, filter bars, code boxes, sub-sections). Was
     ~20 hardcoded rgba(0,0,0,.2) fills that turned into grey slabs in light. */
  --bg-sunken: rgba(0, 0, 0, 0.2);
  --bg-raise: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.24);
  --text-faint: #858585;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a3a3a3;
  --text-muted: #8f8f8f; /* lightened for WCAG AA (~5.5:1 on the dark bg) */
  --text-accent: #3291ff;

  /* Sidebar */
  --sidebar-width: 240px;
  --header-height: 60px;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 20px rgba(50, 145, 255, 0.2);
  --shadow-glow-purple: 0 0 20px rgba(129, 140, 248, 0.2);

  /* Semantic: finding verdicts — colour says what to DO (green = report it,
     grey = ignore), deliberately NOT the severity ramp so the two never clash. */
  --verdict-tp: #34d399;
  --verdict-likely: #38bdf8;
  --verdict-review: #fbbf24;
  --verdict-fp: #a3a3a3;
  --verdict-error: #f87171;

  /* Semantic: severity ramp — how bad it is. All ≥ 4.5:1 on --bg-card. */
  --sev-critical: #c084fc;
  --sev-high: #f87171;
  --sev-medium: #fb923c;
  --sev-low: #facc15;
  --sev-info: #a3a3a3;

  /* Semantic: program scope state */
  --scope-in: #34d399;
  --scope-out: #f87171;
  --scope-paused: #fbbf24;
  --scope-unknown: #64748b;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
/* Native <select> rendering is replaced entirely: macOS Safari paints its
   dark-mode selects as light-gray pills, which read as bright boxes on our
   surfaces. Explicit tokens + custom chevron are deterministic everywhere. */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a3a3a3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding: 7px 30px 7px 12px;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
select option { background: var(--bg-card); color: var(--text-primary); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Layout Shell ──────────────────────────────────────────────────────────── */

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
  /* Smooth collapse */
  transition: width 250ms ease;
  overflow: hidden;
}

/* ── Collapsed sidebar ─────────────────────────────────────────────────────── */
.sidebar.collapsed {
  width: 60px;
}

/* Hide text labels when collapsed */
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item > span:not(.nav-icon):not(.nav-badge),
.sidebar.collapsed .sidebar-metrics,
.sidebar.collapsed .status-text,
.sidebar.collapsed .sign-out-btn {
  display: none !important;
}

/* Centre nav items when collapsed */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}

/* Rotate toggle arrow when collapsed */
.sidebar.collapsed #sidebar-collapse-btn {
  transform: rotate(180deg);
}

/* Keep logo icon centered when collapsed */
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 16px 0;
}

/* Persist scrollbar width so layout doesn't shift */
.sidebar.collapsed .sidebar-nav {
  overflow: hidden;
}

/* Footer: only show status dot when collapsed */
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 0;
}

/* Tooltip-on-hover for collapsed nav items */
.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-cyan);
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.logo-version {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition-interactive);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-cyan);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Expandable nav groups (Asset Management, Mobile, Security Lab) */
.nav-caret {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.18s ease, opacity var(--transition);
}
.nav-group-head:hover .nav-caret { opacity: 0.9; }
.nav-group-head.expanded .nav-caret { transform: rotate(90deg); opacity: 0.9; }
.nav-subitems {
  max-height: 0;
  overflow: hidden;
  visibility: hidden; /* collapsed sub-items leave the tab order / a11y tree */
  transition: max-height 0.22s ease, visibility 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-head.expanded + .nav-subitems { max-height: 340px; visibility: visible; padding: 2px 0; }
.nav-subitem {
  display: flex;
  align-items: center;
  padding: 7px 10px 7px 40px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: var(--transition-interactive);
}
.nav-subitem::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  transform: translateY(-50%);
}
.nav-subitem:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-subitem.active { color: var(--accent-cyan); background: var(--accent-cyan-dim); }
.nav-subitem.active::before { opacity: 1; }
/* Collapsed (icon-only) sidebar: hide the caret and submenus. Grouped views stay
   reachable because clicking a group icon while collapsed expands the sidebar first
   (handled in shell-wiring.js), rather than relying on a flyout that the sidebar's
   overflow:hidden would clip. */
.sidebar.collapsed .nav-caret,
.sidebar.collapsed .nav-subitems { display: none; }
/* When collapsed, the active sub-item is hidden, so highlight its group icon instead. */
.sidebar.collapsed .nav-group-head.has-active-child {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.pulse {
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: statusPulse 3s ease-in-out infinite;
  flex-shrink: 0;
}

.status-dot.warning { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.status-dot.error { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); animation: none; }

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px currentColor; }
  50% { opacity: 0.7; box-shadow: 0 0 12px currentColor; }
}

.status-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Main Content Area ─────────────────────────────────────────────────────── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

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

.topbar-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Notification bell + dropdown */
.notif-wrap { position: relative; }
.notif-bell { position: relative; font-size: 14px; padding: 5px 9px; color: var(--text-secondary); }
.notif-bell:hover { color: var(--text-primary); }
.notif-badge {
  position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--accent-red, #e5484d); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); z-index: 1000;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-primary); position: sticky; top: 0; background: var(--bg-card);
}
.notif-list { padding: 4px; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border: none; background: transparent; border-radius: 8px;
  color: var(--text-primary); font: inherit;
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: color-mix(in srgb, var(--accent-cyan, #3291ff) 9%, transparent); }
.notif-item.unread .notif-item-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-cyan, #3291ff); margin-right: 7px; vertical-align: middle;
}
.notif-item-title { font-size: 13px; font-weight: 600; }
.notif-item-body { font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition-interactive);
}

.refresh-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.refresh-btn.spinning span { animation: spin 1s linear infinite; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Views ─────────────────────────────────────────────────────────────────── */

.view { display: none; animation: fadeIn 300ms ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  margin-bottom: 24px;
}

.view-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Stats Grid ────────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-interactive);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color, var(--accent-cyan)), transparent);
  opacity: 0.8;
}

.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-icon {
  font-size: 18px;
  opacity: 0.7;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-footer {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-card[data-accent="cyan"] { --accent-color: var(--accent-cyan); }
.stat-card[data-accent="purple"] { --accent-color: var(--accent-purple); }
.stat-card[data-accent="emerald"] { --accent-color: var(--accent-emerald); }
.stat-card[data-accent="amber"] { --accent-color: var(--accent-amber); }
.stat-card[data-accent="red"] { --accent-color: var(--accent-red); }

/* ── Cards & Panels ────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon { font-size: 16px; }

.card-body { padding: 0; }

/* ── Collapsible sections ───────────────────────────────────────────────────
   Used by the Monitor page so its four panels (and each panel's "add" form)
   fold away instead of stacking into one very long scroll. Height animates via
   grid-template-rows 0fr→1fr rather than a max-height guess, because the
   target tables grow with the number of monitors. */

.acc-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.acc-caret {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity var(--transition);
}
.acc-toggle:hover .acc-caret { opacity: 0.95; }
.acc-toggle[aria-expanded="true"] .acc-caret { transform: rotate(90deg); opacity: 0.9; }
.acc-toggle:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.26s ease;
}
.acc-panel.open { grid-template-rows: 1fr; }
/* min-height:0 lets the grid row actually collapse below content height. */
.acc-panel > .acc-inner { overflow: hidden; min-height: 0; }

/* A collapsed panel has nothing under the header, so drop the divider. */
.card-header.collapsed { border-bottom-color: transparent; }

.acc-chip {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  white-space: nowrap;
}
.acc-chip.on {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan-dim);
}

/* Nested "add a monitor" disclosure inside a panel. */
.acc-sub {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-sunken);
  margin-bottom: 18px;
}
.acc-sub-head { padding: 11px 14px; }
.acc-sub-title { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.acc-sub-body { padding: 0 14px 14px; }

@media (prefers-reduced-motion: reduce) {
  .acc-panel, .acc-caret { transition: none; }
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
/* .table/.table-wrap (Findings, Port Surface, two Bug Bounty views) were never
   defined, so those tables rendered as bare unstyled HTML. They share the
   .data-table look; the wrap is their card and horizontal scroller. */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}


.data-table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead tr,
.table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table th,
.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.data-table td,
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-raise);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:last-child td,
.table tr:last-child td { border-bottom: none; }

.data-table tbody tr,
.table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
  background: var(--bg-raise);
}

/* ── Badges ──────────────────────────────────────────────────────────────────  */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-running {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-done {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-failed {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-starting {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Muted purpose webhook (Settings ▸ Notifications): neutral grey — silenced. */
.badge-muted {
  background: var(--bg-raise);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* The Mute toggle beside a purpose webhook's URL field. */
.mute-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.mute-toggle input { cursor: pointer; }

.badge-live {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-dead {
  background: var(--bg-raise);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-monitor-on {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.badge-monitor-off {
  background: var(--bg-raise);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Progress Bar ────────────────────────────────────────────────────────────  */

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-raise);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transition: width var(--transition-slow);
}

/* ── Scan Phase Progress ────────────────────────────────────────────────────── */

.scan-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-raise);
}

.scan-item:last-child { border-bottom: none; }

.scan-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.scan-target {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent-cyan);
  font-weight: 500;
}

.scan-type {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-raise);
  padding: 2px 6px;
  border-radius: 4px;
}

.scan-elapsed {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.phase-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Domain Browser ─────────────────────────────────────────────────────────── */

.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-interactive);
  position: relative;
  overflow: hidden;
}

.domain-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.domain-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-cyan);
}

.domain-card:hover::after { opacity: 1; }

.domain-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-stats {
  display: flex;
  gap: 16px;
}

.domain-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.domain-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.domain-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Subdomain Table ─────────────────────────────────────────────────────────── */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
  transition: opacity var(--transition);
}

.back-btn:hover { opacity: 0.8; }

/* ── Monitor Change Feed ──────────────────────────────────────────────────────── */

.change-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.change-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bg-raise);
  transition: background var(--transition);
}

.change-item:last-child { border-bottom: none; }
.change-item:hover { background: var(--bg-raise); }

.change-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 6px currentColor;
}

.change-dot.new_subdomain { color: var(--accent-cyan); background: var(--accent-cyan); }
.change-dot.became_live { color: var(--accent-emerald); background: var(--accent-emerald); }
.change-dot.became_dead { color: var(--text-muted); background: var(--text-muted); box-shadow: none; }
.change-dot.content_changed { color: var(--accent-amber); background: var(--accent-amber); }
.change-dot.status_changed { color: var(--accent-purple); background: var(--accent-purple); }
.change-dot.new_js_endpoint { color: var(--accent-pink, #ec4899); background: var(--accent-pink, #ec4899); }
.change-dot.new_program_asset { color: var(--accent-emerald); background: var(--accent-emerald); }

.change-body { flex: 1; min-width: 0; }

.change-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.change-detail {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── R2 File Browser ─────────────────────────────────────────────────────────── */

.r2-browser {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.r2-tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.r2-tree-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.r2-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-raise);
  transition: var(--transition-interactive);
  overflow: hidden;
}

.r2-tree-item:last-child { border-bottom: none; }

.r2-tree-item:hover { background: var(--bg-raise); color: var(--text-primary); }

.r2-tree-item.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.r2-files-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.r2-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-raise);
  font-size: 13px;
  transition: background var(--transition);
}

.r2-file-row:last-child { border-bottom: none; }
.r2-file-row:hover { background: var(--bg-raise); }

.r2-file-icon { font-size: 16px; flex-shrink: 0; }

.r2-file-name {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r2-file-size {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.r2-file-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.r2-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(50, 145, 255, 0.2);
  border-radius: 6px;
  color: var(--accent-cyan);
  font-size: 13px;
  transition: var(--transition-interactive);
  flex-shrink: 0;
}

.r2-download-btn:hover {
  background: var(--accent-cyan);
  color: var(--bg-base);
  box-shadow: var(--shadow-glow-cyan);
}

.r2-tree-nav { cursor: pointer; }

.r2-tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r2-file-row-nav { cursor: pointer; }

.r2-file-row-dir .r2-file-name {
  flex: 1;
  min-width: 0;
}

.r2-row-action {
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.r2-row-action:hover {
  opacity: 1;
  background: rgba(248, 113, 113, 0.12);
}

.r2-row-cb {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-cyan);
}

.r2-ctx-menu {
  position: fixed;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 140px;
}

.r2-ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}

.r2-ctx-item:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.scan-no-results-banner {
  font-size: 14px;
  line-height: 1.55;
  padding: 12px 14px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

/* ── Scan detail (ASM-style) ─────────────────────────────────────────────────── */

#view-scan-detail .scan-asm-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.scan-asm-zip {
  margin-bottom: 16px;
  border: 1px solid var(--accent-emerald-dim);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 182, 212, 0.04));
  border-radius: 12px;
}

.scan-asm-zip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px !important;
}

.scan-asm-zip-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.scan-asm-zip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  border: none;
  border-radius: 8px;
  color: var(--bg-base);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-interactive);
}

.scan-asm-zip-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

/* Module and Category Badges */
.module-badge,
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* File grid module display */
.file-grid-module {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}

/* Enhanced file grid with module info */
.file-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-interactive);
  position: relative;
  overflow: hidden;
}

.file-grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--module-color, var(--accent-cyan)), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.file-grid-item:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.file-grid-item:hover::before {
  opacity: 1;
}

.file-grid-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.file-grid-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.file-grid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.file-grid-stat {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Filter controls */
.scan-filter-bar {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.scan-filter-bar input,
.scan-filter-bar select {
  transition: var(--transition-interactive);
}

.scan-filter-bar input:focus,
.scan-filter-bar select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-dim);
}

/* Copy all button hover */
#copy-all-results-btn:hover {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

/* Result Tables */
.result-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.result-table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  /* Styled scrollbar so users know the table can scroll horizontally */
  scrollbar-width: thin;
  scrollbar-color: rgba(6,182,212,0.3) transparent;
}

.result-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.result-table-wrap::-webkit-scrollbar-track { background: transparent; }
.result-table-wrap::-webkit-scrollbar-thumb { background: rgba(6,182,212,0.3); border-radius: 3px; }
.result-table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(6,182,212,0.6); }
.result-table-wrap::-webkit-scrollbar-corner { background: transparent; }

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.result-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.result-table thead tr {
  border-bottom: 2px solid var(--border-bright);
}

.result-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: var(--bg-card);
}

.result-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-raise);
  color: var(--text-secondary);
  vertical-align: middle;
}

.result-table tbody tr {
  transition: background var(--transition);
}

.result-table tbody tr:hover {
  background: var(--bg-raise);
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

/* Severity badges */
.severity-critical {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.severity-high {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.severity-medium {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.severity-low {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.severity-info {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(50, 145, 255, 0.25);
}

.scan-asm-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.scan-asm-section--vuln {
  border-color: rgba(248, 113, 113, 0.12);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.04), var(--bg-card) 48px);
}

.scan-asm-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.scan-asm-sec-icon {
  font-size: 22px;
  line-height: 1;
  opacity: 0.95;
}

.scan-asm-sec-titles {
  flex: 1;
  min-width: 0;
}

.scan-asm-sec-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.scan-asm-sec-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.scan-asm-badge {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border-radius: 8px;
  border: 1px solid rgba(50, 145, 255, 0.2);
}

.scan-asm-table-wrap {
  padding: 0 0 16px;
}

.scan-asm-file-table {
  margin: 0 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.scan-asm-file-table td.mono,
.scan-asm-fname {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
}

.scan-asm-src {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.scan-asm-empty {
  padding: 20px 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.scan-asm-empty-card {
  margin-bottom: 16px;
}

.scan-asm-muted {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.scan-asm-vuln-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 20px 0;
}

@media (max-width: 900px) {
  .scan-asm-vuln-panels {
    grid-template-columns: 1fr;
  }
}

.scan-asm-panel {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.scan-asm-panel-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-raise);
}

.scan-asm-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 6px;
}

.scan-asm-panel-body {
  padding: 12px 14px;
  max-height: 320px;
  overflow: auto;
}

.scan-asm-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.scan-asm-data-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scan-asm-data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid --border;
  vertical-align: top;
}

.scan-asm-data-table tr:last-child td {
  border-bottom: none;
}

.scan-asm-url-cell {
  max-width: 280px;
}

.scan-asm-sev {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
}

.scan-asm-json-pre {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

.scan-asm-preview-card {
  margin-top: 8px;
}

/* ── Search / Filter bar ──────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  max-width: 320px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition-interactive);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

/* ── Settings ─────────────────────────────────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.setting-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--bg-raise);
}

.setting-row:last-child { border-bottom: none; }

.setting-key {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.setting-val {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-val.ok { color: var(--accent-emerald); }
.setting-val.warn { color: var(--accent-amber); }
.setting-val.err { color: var(--accent-red); }

/* ── Empty State ─────────────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}

.empty-icon { font-size: 40px; opacity: 0.3; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-desc { font-size: 13px; color: var(--text-muted); text-align: center; max-width: 280px; }

/* ── Loading Skeleton ──────────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg,
    var(--bg-raise) 25%,
    var(--border) 50%,
    var(--bg-raise) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Trigger Scan Form (in overview) ──────────────────────────────────────────── */

/* ── Quick Scan Launcher ─────────────────────────────────────────── */
.scan-launcher {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(6, 182, 212, 0.06), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.scan-launcher-head { margin-bottom: 16px; }

.scan-launcher-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.scan-launcher-icon {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 6px var(--accent-cyan-glow));
}

.scan-launcher-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.launcher-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.launcher-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.launcher-field > label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.launcher-field-type { flex: 0 1 220px; }
.launcher-field-mode { flex: 0 1 160px; }
.launcher-field-target { flex: 1 1 260px; }
.launcher-field-action { flex: 0 0 auto; }
/* Bulk (list) mode: textarea takes its own full-width row. */
.launcher-field-target--list { flex-basis: 100%; }

.launcher-field select,
.launcher-field > input[type='text'] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.launcher-field select:focus,
.launcher-field > input[type='text']:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

.launcher-field .launch-target-list {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.launcher-field .launch-target-list:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

.launcher-field-action .btn-primary {
  height: 40px;
  padding: 0 22px;
}

.launch-btn-icon { font-size: 11px; }

.launch-help {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.launcher-flags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 760px) {
  .launcher-flags { grid-template-columns: 1fr; }
}

.launcher-accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raise);
  overflow: hidden;
  align-self: start;
}

.launcher-accordion summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.launcher-accordion summary::-webkit-details-marker { display: none; }

.launcher-accordion summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.launcher-accordion[open] summary::before { transform: rotate(90deg); }
.launcher-accordion[open] summary { border-bottom: 1px solid var(--border); }

.launch-flags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 14px;
}

.launch-flag-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launch-flag-item label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.launch-flag-item input,
.launch-flag-item select,
.launch-flag-item textarea {
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition);
}

.launch-flag-item input:focus,
.launch-flag-item select:focus,
.launch-flag-item textarea:focus { border-color: var(--accent-cyan); }

.launch-flag-item input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
  align-self: flex-start;
}

.launch-status {
  margin-top: 12px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
}

/* ── Scans toolbar (search + filters) ────────────────────────────── */
.scans-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.scans-toolbar-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.scans-toolbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.scans-toolbar-search .search-input {
  width: 100%;
  max-width: none;
  padding-left: 34px;
  background: var(--bg-input);
}

.scans-toolbar-select {
  flex: 0 1 190px;
  background: var(--bg-input);
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent-primary);
  border-radius: 8px;
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-interactive);
  box-shadow: 0 2px 12px rgba(50, 145, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 16px var(--accent-primary-dim);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Base button + ghost (scan controls rely on these — previously missing, so Pause/Stop were invisible) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-interactive);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* .btn-primary is declared above .btn, so on `class="btn btn-primary"` the
   base .btn background and colour won the cascade and every primary button
   rendered as a plain card (white in the light theme). Two-class selectors
   restore the hierarchy: primary = filled accent, .btn = card, ghost = bare. */
.btn.btn-primary {
  background: var(--accent-primary);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.btn.btn-primary:hover { background: var(--accent-primary-hover); border-color: transparent; }

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(6, 182, 212, 0.35);
  background: var(--accent-cyan-dim);
}

/* Small button variant (report-template actions + table pagination) */
.btn-sm { padding: 6px 12px; font-size: 12px; gap: 4px; }
.btn:disabled,
.btn-sm:disabled,
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Visible keyboard focus ring for the sidebar nav (items are divs, not buttons) */
.nav-item:focus-visible,
.nav-subitem:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
}

.scan-actions {
  margin-top: 10px;
}

.scan-actions .btn,
.scan-actions .btn-ghost {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.scan-btn-stop {
  color: var(--accent-red) !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
}

.scan-btn-stop:hover {
  background: var(--accent-red-dim) !important;
  border-color: var(--accent-red) !important;
}

/* Indeterminate progress when phase metadata is not yet reported */
.progress-bar.indeterminate {
  position: relative;
  overflow: hidden;
}

.progress-bar.indeterminate .progress-fill {
  width: 40% !important;
  animation: scan-progress-indeterminate 1.4s ease-in-out infinite;
}

@keyframes scan-progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.scan-result-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scan-result-link:hover {
  color: #34d399;
}

.scan-control-btn-r2 {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
}

.scan-control-btn-r2:hover {
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan);
}

/* ── Toast notification ──────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 300ms ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--accent-emerald); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.warning { border-left: 3px solid var(--accent-amber); }
.toast.info { border-left: 3px solid var(--accent-cyan); }

.toast-icon { flex-shrink: 0; margin-top: 1px; line-height: 0; color: var(--accent-primary); }
.toast.success .toast-icon { color: var(--accent-emerald); }
.toast.error .toast-icon { color: var(--accent-red); }
.toast.warning .toast-icon { color: var(--accent-amber); }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .logo-text, .logo-version, .nav-item span:not(.nav-icon), .nav-badge,
  .nav-section-label, .sidebar-footer .status-text { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item.active::before { display: none; }
  .r2-browser { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Supabase login gate ─────────────────────────────────────────────────────── */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 20%, rgba(6, 182, 212, 0.12), transparent 50%),
    rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(8px);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.auth-logo {
  font-size: 36px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-title {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-sub {
  margin: 8px 0 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}

.auth-input {
  margin-bottom: 4px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.auth-remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.auth-error {
  min-height: 20px;
  font-size: 12px;
  color: var(--accent-red);
  margin: 4px 0 0;
}

.auth-submit {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
}

.auth-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--accent-amber);
  line-height: 1.45;
}

.sign-out-btn {
  opacity: 0.85;
}

/* ── Modern Dashboard Enhancements ─────────────────────────────────────────── */

/* Glassmorphism cards */
.modern-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: var(--transition-interactive);
  backdrop-filter: blur(10px);
}

.modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
}

.modern-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Scan detail modern layout */
.scan-detail-modern {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeInUp 400ms ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Summary stats for scan results */
.scan-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.scan-summary-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(6, 182, 212, 0.05));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-interactive);
}

.scan-summary-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--accent-cyan-dim), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.scan-summary-card:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(50, 145, 255, 0.2);
}

.scan-summary-card[data-type="vulnerabilities"] {
  background: linear-gradient(135deg, var(--bg-card), rgba(248, 113, 113, 0.05));
}

.scan-summary-card[data-type="vulnerabilities"]::after {
  background: radial-gradient(circle, var(--accent-red-dim), transparent 70%);
}

.scan-summary-card[data-type="vulnerabilities"]:hover {
  border-color: var(--accent-red);
  box-shadow: 0 8px 32px rgba(248, 113, 113, 0.2);
}

.scan-summary-card[data-type="domains"] {
  background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.05));
}

.scan-summary-card[data-type="domains"]::after {
  background: radial-gradient(circle, var(--accent-emerald-dim), transparent 70%);
}

.scan-summary-card[data-type="domains"]:hover {
  border-color: var(--accent-emerald);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
}

.scan-summary-card[data-type="files"] {
  background: linear-gradient(135deg, var(--bg-card), rgba(129, 140, 248, 0.05));
}

.scan-summary-card[data-type="files"]::after {
  background: radial-gradient(circle, var(--accent-purple-dim), transparent 70%);
}

.scan-summary-card[data-type="files"]:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 8px 32px rgba(129, 140, 248, 0.2);
}

.scan-summary-icon {
  font-size: 28px;
  opacity: 0.8;
}

.scan-summary-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.scan-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* File type indicators */
.file-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.file-type-json {
  background: var(--accent-purple-dim);
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.file-type-text {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(50, 145, 255, 0.25);
}

.file-type-log {
  background: var(--accent-amber-dim);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.file-type-csv {
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* File grid view */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px;
}

.file-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-interactive);
  position: relative;
  overflow: hidden;
}

.file-grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0;
  transition: opacity var(--transition);
}

.file-grid-item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.file-grid-item:hover::before {
  opacity: 1;
}

.file-grid-item.active {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}

.file-grid-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.file-grid-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-grid-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.file-grid-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Enhanced vulnerability severity badges */
.severity-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity-high {
  background: rgba(248, 113, 113, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity-info {
  background: rgba(50, 145, 255, 0.14);
  color: var(--accent-cyan);
  border: 1px solid rgba(50, 145, 255, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* JSON viewer with syntax highlighting */
.json-viewer {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: 600px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.json-key {
  color: var(--accent-cyan);
}

.json-string {
  color: var(--accent-emerald);
}

.json-number {
  color: var(--accent-amber);
}

.json-boolean {
  color: var(--accent-purple);
}

.json-null {
  color: var(--text-muted);
}

.json-bracket {
  color: var(--text-secondary);
}

/* Collapsible sections */
.collapsible-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}

.collapsible-header:hover {
  background: var(--bg-card-hover);
}

.collapsible-header.active {
  border-bottom: 1px solid var(--border);
}

.collapsible-icon {
  font-size: 14px;
  transition: transform var(--transition);
  color: var(--text-muted);
}

.collapsible-header.active .collapsible-icon {
  transform: rotate(90deg);
}

.collapsible-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.collapsible-badge {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.collapsible-content.expanded {
  max-height: 2000px;
}

/* Tab navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-sunken);
  border-radius: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-interactive);
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-raise);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 300ms ease;
}

/* Loading skeleton enhancements */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 12px;
  border-radius: 6px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-title {
  height: 24px;
  width: 60%;
}

.skeleton-text {
  width: 100%;
}

.skeleton-text-short {
  width: 40%;
}

/* Animated counters */
.counter-animate {
  animation: counterPulse 600ms ease;
}

@keyframes counterPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Scan progress bar enhanced */
.scan-progress-enhanced {
  height: 8px;
  background: var(--bg-raise);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.scan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-emerald));
  border-radius: 4px;
  transition: width var(--transition-slow);
  position: relative;
}

.scan-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, var(--text-faint), transparent);
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* File preview enhancements */
.file-preview-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}

.file-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-preview-actions {
  display: flex;
  gap: 8px;
}

.file-preview-body {
  padding: 20px;
  max-height: 600px;
  overflow: auto;
}

.file-preview-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive enhancements */
@media (max-width: 1200px) {
  .scan-summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .scan-summary-stats {
    grid-template-columns: 1fr;
  }
  
  .file-grid {
    grid-template-columns: 1fr;
  }
  
  .tab-nav {
    flex-direction: column;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for better keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Print styles for scan results */
@media print {
  .sidebar, .topbar, .btn, button {
    display: none !important;
  }
  
  .main {
    margin: 0;
  }
  
  .content {
    padding: 0;
  }
  
  .modern-card, .card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ── Dashboard Scan Detail Redesign ───────────────────────────────────────── */

/* Summary Bar - 4 stat cards */
.dashboard-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: var(--transition-fast-props);
}

.dashboard-stat-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

.stat-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.stat-card-content {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Tab Bar - Pill-style horizontal */
.dashboard-tab-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--bg-sunken);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-pill {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast-props);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-pill:hover {
  background: var(--bg-raise);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.tab-pill.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(50, 145, 255, 0.2);
}

.tab-count {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.7;
  background: var(--bg-sunken);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Dashboard Tables */
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dashboard-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.dashboard-table tbody tr {
  border-bottom: 1px solid --border;
  transition: background 150ms ease;
}

.dashboard-table tbody tr:last-child {
  border-bottom: none;
}

.dashboard-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.05);
}

.table-cell-icon {
  width: 32px;
  text-align: center;
  font-size: 16px;
}

.table-cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Modern Card Header */
.modern-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.modern-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--bg-surface), rgba(6, 182, 212, 0.05));
}

.modern-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Card Body */
.modern-card .card-body {
  padding: 16px;
}

/* Result Table Wrap */
.result-table-wrap {
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.result-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.result-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.result-table tbody tr {
  border-bottom: 1px solid --border;
}

.result-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.05);
}

.result-table td {
  padding: 10px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

.result-table tbody tr.critical {
  background: rgba(248, 113, 113, 0.08);
  border-left: 3px solid var(--accent-red);
}

.result-table tbody tr.critical:hover {
  background: rgba(248, 113, 113, 0.12);
}

/* R2 Filter Rail */
.recon-filter-rail {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 12px 0;
  border: 1px solid var(--border);
}

.recon-filter-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast-props);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.recon-filter-btn:hover {
  background: var(--bg-raise);
  color: var(--text-primary);
}

.recon-filter-btn.active {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  font-weight: 600;
  border-left: 3px solid var(--accent-cyan);
  padding-left: 9px;
}

/* Color dots for rail items */
.recon-filter-btn::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
  background: var(--text-muted);
}

.recon-filter-btn[data-kind="subdomains"]::before { background: #3b82f6; }
.recon-filter-btn[data-kind="urls"]::before { background: #10b981; }
.recon-filter-btn[data-kind="js_urls"]::before { background: #8b5cf6; }
.recon-filter-btn[data-kind="tech"]::before { background: #f59e0b; }
.recon-filter-btn[data-kind="ffuf"]::before { background: #ef4444; }
.recon-filter-btn[data-kind="buckets"]::before { background: #eab308; }
.recon-filter-btn[data-kind="other"]::before { background: #64748b; }

/* Search Input */
.recon-unified-search {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: var(--transition-fast-props);
}

.recon-unified-search:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Empty State for Dashboard */
.dashboard-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.dashboard-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.dashboard-empty .empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dashboard-empty .empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  min-height: 200px;
}

/* Better input styling for search */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Enhance table row highlighting */
.dashboard-table tbody tr:nth-child(odd) {
  background: var(--bg-sunken);
}

/* Findings table rows — left-border accent on hover */
.dashboard-table tbody tr.findings-row {
  border-bottom: 1px solid --border;
  transition: background 120ms ease, border-left-color 120ms ease;
  border-left: 2px solid transparent;
}

.dashboard-table tbody tr.findings-row:hover {
  background: rgba(6, 182, 212, 0.06) !important;
  border-left-color: var(--accent-cyan);
}

/* Tighten th padding to match 7px cell padding */
.dashboard-table thead th {
  padding: 9px 10px;
}

/* Subtle border for active tab */
.tab-pill.active {
  box-shadow: 0 0 0 2px var(--accent-cyan-dim), 0 2px 12px rgba(50, 145, 255, 0.2);
}

/* File preview container */
.file-preview-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.file-preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-preview-actions {
  display: flex;
  gap: 8px;
}

.file-preview-body {
  padding: 20px;
  max-height: 600px;
  overflow: auto;
}

.file-preview-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Empty state styling improvements */
.dashboard-empty {
  padding: 40px 20px;
}

.dashboard-empty .empty-title {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dashboard-empty .empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.cname-cell:hover .cname-tooltip {
  display: block !important;
}

/* ── Keyhacks Tab ─────────────────────────────────────────────────────────── */

.keyhacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  padding-top: 10px;
}

.keyhack-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition-interactive-slow);
  display: flex;
  flex-direction: column;
  position: relative;
}

.keyhack-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.1);
}

.keyhack-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0.5;
}

.keyhack-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid --border;
}

.keyhack-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 15px;
}

.keyhack-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 800;
}

.keyhack-badge.method-get {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(50, 145, 255, 0.25);
}

.keyhack-badge.method-post {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.keyhack-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.keyhack-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.keyhack-cmd-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 6px;
}

.keyhack-cmd-box {
  position: relative;
  background: var(--bg-sunken);
  border: 1px solid --border;
  border-radius: 10px;
  padding: 12px;
  transition: border-color var(--transition);
}

.keyhack-cmd-box:hover {
  border-color: --border-bright;
}

.keyhack-pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
  white-space: pre-wrap;
  word-break: break-all;
  padding-right: 32px;
}

.keyhack-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-raise);
  color: var(--text-muted);
  transition: var(--transition-interactive);
}

.keyhack-copy-btn:hover {
  background: var(--border-bright);
  color: var(--text-primary);
  transform: scale(1.1);
}

.keyhack-notes {
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.05), transparent);
  border-left: 3px solid var(--accent-purple);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

.keyhack-notes-label {
  font-size: 11px;
  color: var(--accent-purple);
  font-weight: 700;
  margin-bottom: 4px;
}

.keyhack-notes-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Sidebar Metrics ──────────────────────────────────────────────────────── */
.sidebar-metrics {
  margin-top: auto;
  padding: 16px;
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.metrics-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 12px;
}

.metric-item {
  margin-bottom: 10px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.metric-bar {
  height: 4px;
  background: var(--bg-raise);
  border-radius: 2px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Live Terminal ───────────────────────────────────────────────────────── */
.terminal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.terminal-header {
  padding: 10px 16px;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.terminal-log {
  padding: 16px;
  height: 300px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #e6edf3;
  background: var(--bg-surface);
}

.terminal-log::-webkit-scrollbar {
  width: 8px;
}

.terminal-log::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 4px;
}

.terminal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.terminal-close:hover {
  color: var(--accent-red);
}

/* ── Nuclei Manager ──────────────────────────────────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: var(--transition-fast-props);
}

.template-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.template-path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  word-break: break-all;
}

/* ── Premium Select & Inputs ────────────────────────────────────────────────── */

select.input, .search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  transition: var(--transition-interactive);
  outline: none;
}

select.input:hover, .search-input:hover {
  border-color: var(--border-bright);
}

select.input:focus, .search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-dim);
}

/* Custom Select Arrow */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

/* Markdown Preview Styling */
#report-template-preview {
  color: var(--text-primary);
  line-height: 1.6;
}
#report-template-preview h1, #report-template-preview h2, #report-template-preview h3 {
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  color: var(--accent-cyan);
}
#report-template-preview p { margin-bottom: 1em; }
#report-template-preview code {
  background: var(--bg-raise);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}
#report-template-preview pre {
  background: var(--bg-input);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1em;
}
#report-template-preview ul, #report-template-preview ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}
#report-template-preview hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ── Settings View Premium ────────────────────────────────────────────────── */

.settings-container-premium {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 60px;
}

.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.settings-section-header {
  padding: 16px 24px;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-section-description {
  padding: 16px 24px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.settings-section-body {
  padding: 8px 0;
}

.settings-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  gap: 40px;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-label {
  flex: 1;
}

.settings-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-value {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  word-break: break-all;
}

.settings-value.ok { color: var(--accent-emerald); }
.settings-value.warn { color: var(--accent-amber); }

.settings-control {
  display: flex;
  gap: 12px;
  width: 450px;
  flex-shrink: 0;
}

.premium-input {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
  transition: var(--transition-interactive) !important;
}

.premium-input:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 2px var(--accent-cyan-dim) !important;
  outline: none;
}

.settings-timeout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px 24px;
}

.timeout-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeout-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.timeout-field input {
  width: 100%;
}

.timeout-field span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Settings category tabs ─────────────────────────────────────── */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 4px 0 14px;
  margin-bottom: 4px;
  background: var(--bg-base, var(--bg-surface));
  border-bottom: 1px solid var(--border);
}

.settings-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-interactive);
}

.settings-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan-dim, var(--accent-cyan));
}

.settings-tab.active {
  color: #05121a;
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 14px var(--accent-cyan-dim, rgba(34, 211, 238, 0.25));
}

@media (max-width: 720px) {
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-control { width: 100%; }
  .settings-item { flex-direction: column; gap: 12px; }
}

/* ── Multi-account manager (Settings → Platforms & Keys) ─────────────── */
.acct-platform {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.acct-platform:last-child { border-bottom: none; }

.acct-platform-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acct-help { font-size: 12px; color: var(--text-muted); margin: -4px 0 10px; line-height: 1.45; }
.acct-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim, rgba(34, 211, 238, 0.15));
  border-radius: 999px;
  padding: 1px 8px;
}

.acct-row {
  display: flex;
  flex-wrap: wrap; /* narrow panes: the buttons drop below the name */
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 8px;
  background: var(--bg-sunken);
}
.acct-meta { flex: 1 1 200px; min-width: 0; }
.acct-label { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-disabled { color: var(--accent-amber); font-size: 11px; font-weight: 500; }
.acct-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-toggle {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.acct-toggle.on { color: var(--accent-emerald); border-color: rgba(16, 185, 129, 0.4); }
.acct-toggle.off { color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.4); }
.acct-del {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: transparent;
  color: #ef4444;
  font-size: 11px;
  cursor: pointer;
}
.acct-empty { font-size: 12px; color: var(--text-muted); padding: 2px 0 8px; }

.acct-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.acct-input { flex: 1; min-width: 130px; }
.acct-add-btn { flex-shrink: 0; }

/* credential validity tag + test controls */
.acct-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.acct-status.valid   { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.13); border-color: rgba(16, 185, 129, 0.35); }
.acct-status.invalid { color: #ef4444; background: rgba(239, 68, 68, 0.13); border-color: rgba(239, 68, 68, 0.35); }
.acct-status.blocked { color: var(--accent-amber); background: rgba(245, 158, 11, 0.13); border-color: rgba(245, 158, 11, 0.35); }
.acct-status.error   { color: var(--accent-amber); background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.3); }
.acct-status.checking{ color: var(--accent-cyan); background: var(--accent-cyan-dim, rgba(34, 211, 238, 0.13)); border-color: rgba(34, 211, 238, 0.3); }
.acct-status.muted   { color: var(--text-muted); background: var(--bg-raise); border-color: var(--border); }

.acct-test {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.acct-test:hover { color: var(--text-primary); border-color: var(--accent-cyan-dim, var(--accent-cyan)); }

.acct-edit {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.acct-edit:hover { color: var(--text-primary); border-color: var(--accent-cyan-dim, var(--accent-cyan)); }

/* inline edit form shown when a stored account row is being edited */
.acct-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--accent-cyan-dim, rgba(34, 211, 238, 0.3));
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.04);
}
.acct-input-readonly { opacity: 0.65; cursor: not-allowed; }

.acct-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.acct-testall {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.acct-testall:hover { color: var(--accent-cyan); border-color: var(--accent-cyan-dim, var(--accent-cyan)); }


/* ═══════════════════════════════════════════════════════════════════════
   AI Triage page  (all selectors prefixed .tri- — no effect on other views)
   Colour contract: verdict pills use --verdict-* (what to do), severity uses
   --sev-* (how bad), scope dots use --scope-*. Data comes from the target /
   model, so JS only ever sets whitelisted data-* values, never raw strings.
   ═══════════════════════════════════════════════════════════════════════ */
.stat-card[data-accent="slate"] { --accent-color: #a3a3a3; }

.tri-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 14px;
}
@media (max-width: 1100px) { .tri-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .tri-kpis { grid-template-columns: 1fr; } }
.tri-kpi-sub { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.tri-kpi-sub b { color: var(--text-secondary); font-weight: 600; }
.tri-kpi-unit { font-size: 15px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.tri-meter { height: 6px; margin-top: 12px; border-radius: 99px; background: var(--border); overflow: hidden; }
.tri-meter[data-level="warn"] { --m: var(--accent-amber); }
.tri-meter[data-level="bad"]  { --m: var(--accent-red); }
.tri-meter > i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--m, var(--accent-cyan)); transition: width var(--transition-slow); }

/* Engine status chips */
.tri-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.tri-chip {
  --c: var(--text-muted);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
}
.tri-chip b { color: var(--text-primary); font-weight: 600; }
.tri-chip .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent);
}
.tri-chip[data-state="ok"]   { --c: var(--accent-emerald); }
.tri-chip[data-state="warn"] { --c: var(--accent-amber); }
.tri-chip[data-state="bad"]  { --c: var(--accent-red); border-color: color-mix(in srgb, var(--accent-red) 45%, transparent); }
.tri-chip[data-state="busy"] { --c: var(--accent-cyan); }
.tri-chip[data-state="busy"] .dot { animation: tri-pulse 1.4s ease-in-out infinite; }
@keyframes tri-pulse { 50% { opacity: 0.3; } }
.tri-ref { color: var(--accent-cyan); text-decoration: none; font-weight: 600; white-space: nowrap; }
.tri-ref:hover { text-decoration: underline; text-underline-offset: 2px; }
.tri-link { all: unset; cursor: pointer; color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 2px; }
.tri-link:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-radius: 3px; }
.tri-lastrun { margin: 0 0 16px; font-size: 12px; color: var(--text-muted); min-height: 16px; }

/* Toolbar + segmented filter */
.tri-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.tri-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.tri-seg button {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.tri-seg button:hover { color: var(--text-primary); background: var(--bg-raise); }
.tri-seg button.active { color: var(--text-primary); background: var(--bg-card-hover); box-shadow: inset 0 0 0 1px var(--border-bright); }
.tri-seg button:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.tri-seg .n { min-width: 18px; padding: 1px 6px; text-align: center; border-radius: 99px; font-size: 11px; color: var(--text-muted); background: var(--border); font-variant-numeric: tabular-nums; }
.tri-seg button.active .n { color: var(--accent-cyan); background: var(--accent-cyan-dim); }
.tri-scanbox { display: flex; flex: 1 1 340px; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.tri-scanbox .search-input { flex: 1 1 200px; min-width: 180px; }
.tri-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; }

/* Verdict / severity pills */
.tri-pill {
  --c: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
/* The row stage pill is a button that opens the stage select on click. */
.tri-pill-btn { font-family: inherit; cursor: pointer; }
.tri-pill-btn:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.tri-pill-btn:focus-visible { outline: 2px solid var(--c); outline-offset: 1px; }
/* Comment-thread count badge on a finding row. */
.fx-cmt { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.tri-pill[data-v="true_positive"]        { --c: var(--verdict-tp); }
.tri-pill[data-v="likely"]               { --c: var(--verdict-likely); }
.tri-pill[data-v="needs_manual_review"]  { --c: var(--verdict-review); }
.tri-pill[data-v="false_positive"]       { --c: var(--verdict-fp); }
.tri-pill[data-v="error"]                { --c: var(--verdict-error); }
.tri-pill[data-sev="critical"] { --c: var(--sev-critical); }
.tri-pill[data-sev="high"]     { --c: var(--sev-high); }
.tri-pill[data-sev="medium"]   { --c: var(--sev-medium); }
.tri-pill[data-sev="low"]      { --c: var(--sev-low); }
.tri-pill[data-sev="info"]     { --c: var(--sev-info); }
.tri-conf { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tri-conf i { display: block; width: 56px; height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; }
.tri-conf i b { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--c, var(--text-muted)); }
.tri-vcell { --c: var(--text-muted); }
.tri-vcell[data-v="true_positive"]       { --c: var(--verdict-tp); }
.tri-vcell[data-v="likely"]              { --c: var(--verdict-likely); }
.tri-vcell[data-v="needs_manual_review"] { --c: var(--verdict-review); }
.tri-vcell[data-v="false_positive"]      { --c: var(--verdict-fp); }

/* Unified Findings stage: one color per lifecycle bucket, shared by the top
   filter bar (.fx-stage-chip) and the row pill (.tri-pill[data-stage]). */
[data-stage="not_reviewed"]   { --sc: #94a3b8; }
[data-stage="needs_review"]   { --sc: #f59e0b; }
[data-stage="true_positive"]  { --sc: #10b981; }
[data-stage="reportable"]     { --sc: #3b82f6; }
[data-stage="reported"]       { --sc: #8b5cf6; }
[data-stage="due"]            { --sc: #ef4444; }
[data-stage="later"]          { --sc: #14b8a6; }
[data-stage="needs_impact"]   { --sc: #d97706; }
[data-stage="false_positive"] { --sc: #a3a3a3; }
.tri-pill[data-stage]  { --c: var(--sc, var(--text-muted)); }
.tri-vcell[data-stage] { --c: var(--sc, var(--text-muted)); }

.fx-stagebar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fx-stage-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 99px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.fx-stage-chip:hover { color: var(--text-primary); background: var(--bg-raise); border-color: var(--border-bright); }
.fx-stage-chip .n { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.fx-stage-chip:not([data-stage=""])::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); flex: none; }
.fx-stage-chip.active {
  color: var(--sc);
  background: color-mix(in srgb, var(--sc) 14%, transparent);
  border-color: color-mix(in srgb, var(--sc) 42%, transparent);
}
.fx-stage-chip.active .n { color: var(--sc); }
.fx-stage-chip[data-stage=""].active { color: var(--text-primary); background: var(--bg-card-hover); border-color: var(--border-bright); }
.fx-stage-chip:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }

/* Findings table */
.tri-table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; }
.tri-checkcell { width: 34px; padding-right: 0 !important; }
.tri-checkcell input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent-cyan); cursor: pointer; }
.tri-bulkbar {
 display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
 padding: 10px 14px; margin-bottom: 10px;
 background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
 font-size: 12.5px; color: var(--text-secondary);
}
.tri-bulkbar .grow { flex: 1; }
.tri-table { width: 100%; min-width: 880px; border-collapse: collapse; }
.tri-table th { padding: 11px 12px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tri-table td { padding: 14px 12px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.tri-table tbody tr:last-child td { border-bottom: 0; }
.tri-row { --sev: transparent; cursor: pointer; transition: background var(--transition); }
.tri-row:hover { background: var(--bg-card-hover); }
.tri-row td:first-child { box-shadow: inset 3px 0 0 var(--sev); }
.tri-row[data-sev="critical"] { --sev: var(--sev-critical); }
.tri-row[data-sev="high"]     { --sev: var(--sev-high); }
.tri-row[data-sev="medium"]   { --sev: var(--sev-medium); }
.tri-row[data-sev="low"]      { --sev: var(--sev-low); }
.tri-row[data-sev="info"]     { --sev: var(--sev-info); }
.tri-row:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: -2px; }
.tri-when { white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.tri-title { max-width: 380px; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tri-url { max-width: 380px; margin-top: 3px; font: 11.5px/1.4 'JetBrains Mono', ui-monospace, monospace; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tri-err { margin-top: 4px; font-size: 11.5px; color: var(--verdict-error); }
.tri-scope { --c: var(--scope-unknown); display: inline-flex; align-items: center; gap: 7px; max-width: 190px; font-size: 12px; color: var(--text-secondary); }
.tri-scope > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-submit { background: var(--scope-in, #22c55e); color: #04140a; border-color: transparent; font-weight: 600; }
.btn-submit:hover { filter: brightness(1.08); }
.fx-remind { display:inline-block; font-size:10.5px; font-weight:600; padding:1px 7px; border-radius:4px; white-space:nowrap; vertical-align:middle; background:rgba(99,102,241,.14); color:#a5b4fc; }
.fx-remind.due { background:rgba(245,158,11,.18); color:var(--accent-amber); }
.fx-remind-toggle[data-on="1"] { background:var(--accent-amber); color:#1a1205; border-color:transparent; }
.scan-launch-cta { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:16px; padding:14px 16px; border:1px solid var(--border); border-radius:12px; background:rgba(6,182,212,.04); }
.scan-launch-cta-btn { font-weight:700; font-size:13px; padding:9px 18px; }
.scan-launch-hint { font-size:12.5px; color:var(--text-secondary); }
.scan-copy-id { font-size:10.5px; padding:1px 6px; border-radius:5px; border:1px solid var(--border); background:transparent; color:var(--text-muted); cursor:pointer; vertical-align:middle; }
.scan-copy-id:hover { color:var(--text-primary); border-color:var(--accent-cyan); }
.fx-did { font-size:11px; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.tri-copy { font-size:11px; padding:0 5px; border:none; background:transparent; color:var(--text-muted); cursor:pointer; vertical-align:middle; }
.tri-copy:hover { color:var(--accent-cyan); }
.fx-acct { display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
/* As a button it is still the same quiet line, not a control: no chrome until hover. */
button.fx-acct { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
button.fx-acct:hover, button.fx-acct:focus-visible { color: var(--text-primary); text-decoration: underline; }
.fx-acct-hint { opacity: 0.5; }
button.fx-acct.fx-acct-hint:hover, button.fx-acct.fx-acct-hint:focus-visible { opacity: 1; }

/* ── Who-can-submit card (findings.js openAccountsCard) ──────────────────── */
/* Above the findings drawer (.tri-overlay, 10000) and the dialogs (.ff-overlay,
   10050) — the chip is inside both, so a lower card would open behind them. */
.fx-acctcard { position: fixed; z-index: 10100; background: var(--bg-elevated, var(--bg-secondary)); border: 1px solid var(--border-color); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.38); padding: 12px 14px; font-size: 12px; max-height: 70vh; overflow: auto; }
.fx-acctcard-load { color: var(--text-muted); }
.fx-acctcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.fx-acctcard-prog { color: var(--text-muted); font-size: 11px; margin-bottom: 8px; word-break: break-all; }
.fx-acctlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.fx-acctlist li { border-left: 2px solid var(--accent-primary, var(--border-color)); padding-left: 8px; }
.fx-acctname { font-weight: 600; }
.fx-acctsub, .fx-acctsrc { color: var(--text-muted); font-size: 10.5px; }
.fx-acctsrc { margin-top: 8px; }
.fx-acctprobe { color: var(--verdict-warn, var(--text-muted)); font-size: 10.5px; }
.fx-acctcred { font-weight: 400; font-size: 10.5px; color: var(--text-muted); }
.fx-acctnone { color: var(--text-muted); line-height: 1.5; }
.fx-acctothers { margin-top: 10px; }
.fx-acctothers summary { cursor: pointer; color: var(--text-muted); font-size: 11px; }
.fx-acctothers .fx-acctlist { margin-top: 7px; }
.fx-acctothers .fx-acctlist li { border-left-color: var(--border-color); }
.fx-acctcard-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.fx-acctcard-foot .fx-acctsrc { margin: 0; flex: 1; }

/* ── Bulk add (findings.js bulkAddFindings) ──────────────────────────────── */
.fx-bulk { max-width: 860px; width: 94vw; }
.fx-bulkhelp { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.fx-bulkhelp code { font-size: 11px; }
#fb-text { width: 100%; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; line-height: 1.5; resize: vertical; }
.fx-bulkdefaults { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.fx-bulkpreview { margin-top: 12px; border-top: 1px solid var(--border-color); padding-top: 10px; }
.fx-bulksum { font-size: 12px; margin-bottom: 8px; }
.fx-bulktable { width: 100%; border-collapse: collapse; font-size: 12px; }
.fx-bulktable td { padding: 5px 6px; vertical-align: top; border-bottom: 1px solid var(--border-color); }
.fx-bulktable td:first-child { width: 64px; }
.fx-bulktag { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; background: var(--bg-tertiary, var(--bg-secondary)); color: var(--text-muted); }
.fx-bulktag[data-t="ok"] { background: color-mix(in srgb, var(--verdict-ok, #2ea043) 22%, transparent); color: var(--verdict-ok, #2ea043); }
.fx-bulktag[data-t="dup"] { background: color-mix(in srgb, var(--verdict-warn, #d29922) 22%, transparent); color: var(--verdict-warn, #d29922); }
.fx-bulktag[data-t="err"] { background: color-mix(in srgb, var(--verdict-error, #f85149) 22%, transparent); color: var(--verdict-error, #f85149); }
.fx-bulkmeta { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }
.fx-bulkerr { color: var(--verdict-error, #f85149); font-size: 10.5px; margin-top: 2px; }
.tri-scope > a.fx-proglink { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.tri-scope > a.fx-proglink:hover, .tri-scope > a.fx-proglink:focus-visible { color: var(--text-primary); text-decoration-style: solid; }
.tri-table td.tri-c-scope { min-width: 150px; }
.tri-scope::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c); }
.tri-scope[data-s="in"]     { --c: var(--scope-in); }
.tri-scope[data-s="out"]    { --c: var(--scope-out); }
.tri-scope[data-s="paused"] { --c: var(--scope-paused); }
.tri-scope[data-s="related"]::before,
.tri-scope[data-s="guess"]::before { background: none; border: 1.5px dashed var(--scope-paused); width: 7px; height: 7px; }
.tri-sent { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tri-sent[data-sent="1"] { color: var(--accent-emerald); }
.tri-sent[data-sent="0"] { color: var(--accent-amber); }
.tri-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.tri-actions .btn { padding: 5px 11px; font-size: 12px; }
/* Per-row / drawer delete: subdued until hover so it can't be fat-fingered. */
.btn.fx-del { color: var(--text-muted); }
.btn.fx-del:hover, .btn.fx-del:focus-visible { color: var(--accent-red); background: var(--accent-red-dim); }
.tri-actions .btn.fx-del { padding: 5px 8px; }
.tri-empty-hint { max-width: 420px; margin: 8px auto 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* Detail drawer */
.tri-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; justify-content: flex-end; background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(3px); }
.tri-drawer {
  display: flex; flex-direction: column;
  width: min(780px, 100%); height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-bright);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  animation: tri-slide 0.22s ease-out;
}
@keyframes tri-slide { from { transform: translateX(28px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tri-drawer, .tri-chip[data-state="busy"] .dot { animation: none !important; }
  .tri-meter > i { transition: none; }
}
.tri-dhead { padding: 18px 22px 16px; border-bottom: 1px solid var(--border); }
.tri-dtop { display: flex; align-items: flex-start; gap: 12px; }
.tri-dtop .btn { flex: none; padding: 5px 12px; font-size: 12px; }
.tri-dtitle { flex: 1; margin: 0; font-size: 16px; font-weight: 650; line-height: 1.35; color: var(--text-primary); word-break: break-word; }
.tri-x { all: unset; cursor: pointer; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--text-muted); font-size: 18px; }
.tri-x:hover { color: var(--text-primary); background: var(--border); }
.tri-x:focus-visible { outline: 2px solid var(--accent-cyan); }
.tri-dbadges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tri-dbody { flex: 1; overflow: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 20px; }
.tri-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0; }
.tri-meta > div { min-width: 0; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.tri-meta dt { margin: 0 0 3px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.tri-meta dd { margin: 0; font-size: 12.5px; color: var(--text-primary); word-break: break-all; }
.tri-sec h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.tri-why { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
/* Finding comment thread (drawer) */
.fx-comments { display: flex; flex-direction: column; gap: 10px; }
.fx-comment { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.fx-comment-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.fx-comment-meta b { color: var(--text-secondary); font-weight: 600; }
.fx-comment-meta span { color: var(--text-faint); }
.fx-comment-del { margin-left: auto; appearance: none; background: transparent; border: 0; color: var(--text-faint); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 4px; }
.fx-comment-del:hover, .fx-comment-del:focus-visible { color: var(--accent-red); background: var(--accent-red-dim); }
.fx-comment-body { font-size: 13.5px; line-height: 1.55; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.fx-comment-add { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.fx-comment-add textarea { flex: 1; resize: vertical; min-height: 38px; padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font: inherit; font-size: 13px; }
.fx-comment-add textarea:focus { outline: none; border-color: var(--accent-primary); }
.tri-code { position: relative; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; }
.tri-code-bar { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }
.tri-code pre { margin: 0; padding: 14px; max-height: 340px; overflow: auto; font: 12.5px/1.6 'JetBrains Mono', ui-monospace, monospace; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.tri-code .btn { padding: 3px 10px; font-size: 11.5px; }
.tri-details { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.tri-details summary { cursor: pointer; padding: 10px 14px; font-size: 12.5px; color: var(--text-secondary); }
.tri-details summary:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: -2px; border-radius: 10px; }
.tri-details pre { margin: 0; padding: 0 14px 14px; max-height: 280px; overflow: auto; font: 11.5px/1.55 'JetBrains Mono', ui-monospace, monospace; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.tri-dfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.tri-dfoot .grow { flex: 1; }

/* ── UI polish pass (better-ui skill) ────────────────────────────────────────
   Press feedback, pointer-gated hovers, scroll containment and reduced-motion,
   with exact values: 0.96 / 150ms / ease-out; overlays contain their scroll. */

/* Buttons press to 0.96 over 150ms ease-out; a disabled one never scales. */
.btn:not(:disabled):active,
.btn-primary:not(:disabled):active {
  scale: 0.96;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
button { -webkit-tap-highlight-color: transparent; }

/* Hover affordances only where a pointer can actually hover; touch taps must
   not latch a stuck hover state. */
@media (hover: hover) {
  .btn:hover, .btn-primary:hover, .nav-item:hover, .nav-subitem:hover,
  .stat-card:hover, .tab-btn:hover, .tab-pill:hover, .recon-filter-btn:hover {
    /* states themselves come from the rules above; this block only exists to
       keep the timing of high-frequency hover at or under 150ms */
    transition-duration: 150ms;
  }
}

/* Scrollable overlays keep their scroll: the page behind never moves. */
.modal, .auth-card, .tri-drawer, .tri-overlay,
#wiz-body, #agent-messages, .acc-body, .launch-flag-list {
  overscroll-behavior: contain;
}

/* Entrance for the launch wizard's infrequent view: opacity + 4px blur +
   12px rise over 300ms ease-out, staggered 100ms per card. Gated below. */
@keyframes wiz-card-in {
  from { opacity: 0; filter: blur(4px); transform: translateY(12px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
.wiz-type-card {
  animation: wiz-card-in 300ms cubic-bezier(0.2, 0, 0, 1) both;
  animation-delay: calc(var(--wiz-i, 0) * 100ms);
}

/* Movement, scale and blur run only for users who asked for motion; everyone
   else gets an opacity cross-fade instead of an instant swap. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-timing-function: ease-out !important;
    transition-duration: 150ms !important;
    scroll-behavior: auto !important;
  }
  .wiz-type-card { animation: wiz-card-fade 150ms ease-out both; animation-delay: 0ms; }
  @keyframes wiz-card-fade { from { opacity: 0; } to { opacity: 1; } }
  .btn:not(:disabled):active, .btn-primary:not(:disabled):active { scale: none; }
}

/* ── AI Triage layout (v4.15 rebuild: one head, one status line, split main) */
.tri-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.tri-headinfo { min-width: 0; }
.tri-head .view-title { margin: 0 0 4px; }
.tri-statusline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted); min-height: 20px;
}
.tri-status .tri-chip { margin-right: 4px; }
.tri-lastrun { font-size: 11.5px; color: var(--text-faint); }
.tri-headactions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tri-headactions .search-input { width: 170px; padding: 7px 10px; font-size: 12px; }

.tri-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }

.tri-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── AI Agent page: chat history rail + full-height conversation ──────────
   Was a 360px card wedged beside the triage table; now its own view. The
   shell fills the content area (60px topbar + 2x24px padding) so only the
   message list scrolls and the composer stays pinned. */
.agent-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - var(--header-height) - 48px);
  min-height: 460px;
}
.agent-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px;
}
.agent-new { width: 100%; justify-content: center; }
.agent-side-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin: 16px 6px 6px;
}
.agent-side-label-row {
  display: flex; align-items: center; justify-content: space-between; margin: 16px 6px 6px;
}
.agent-side-label-row .agent-side-label { margin: 0; }
.agent-clear-all {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: transparent; padding: 2px 7px; border-radius: 6px; line-height: 1.4;
}
.agent-clear-all:hover { color: var(--accent-red); background: var(--accent-red-dim); }
.agent-clear-all:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.agent-clear-all:disabled { opacity: 0.4; cursor: default; }
.agent-session-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px;
}
.agent-sess { position: relative; border-radius: 8px; }
.agent-sess:hover { background: var(--bg-raise); }
.agent-sess.active { background: var(--accent-primary-dim); }
.agent-sess-open {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 8px 32px 8px 10px; border-radius: 8px;
  background: transparent; color: var(--text-secondary); text-align: left;
}
.agent-sess.active .agent-sess-open { color: var(--text-primary); }
.agent-sess-open:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.agent-sess-title { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-sess-meta { font-size: 11px; color: var(--text-muted); }
.agent-sess-del {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 6px;
  background: transparent; color: var(--text-muted); font-size: 15px; line-height: 1;
  opacity: 0;
}
.agent-sess:hover .agent-sess-del, .agent-sess-del:focus-visible { opacity: 1; }
.agent-sess-del:hover { color: var(--accent-red); background: var(--accent-red-dim); }
@media (hover: none) { .agent-sess-del { opacity: 1; } }

.agent-chat {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
}
.agent-chat-head { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.agent-chat-title { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-chat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.agent-messages {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 18px; padding: 20px;
}
.agent-msg { max-width: min(760px, 88%); min-width: 0; }
.agent-msg[data-role="owner"] { align-self: flex-end; }
.agent-msg-who { font-size: 11px; font-weight: 600; color: var(--text-muted); margin: 0 2px 4px; }
.agent-msg[data-role="owner"] .agent-msg-who { text-align: right; }
.agent-msg-body {
  padding: 10px 14px; border-radius: 12px;
  background: var(--bg-raise); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.agent-msg[data-role="agent"] .agent-msg-body { border-bottom-left-radius: 4px; }
.agent-msg[data-role="owner"] .agent-msg-body { background: var(--accent-primary-dim); border-color: transparent; border-bottom-right-radius: 4px; }
.agent-msg[data-role="error"] .agent-msg-body { background: var(--accent-red-dim); border-color: transparent; color: var(--accent-red); }
.agent-msg-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  padding: 1px 5px; border-radius: 4px; background: var(--bg-input); border: 1px solid var(--border);
}
.agent-code {
  margin: 8px 0; padding: 10px 12px; border-radius: 8px; overflow-x: auto;
  background: var(--bg-input); border: 1px solid var(--border);
  white-space: pre; font-size: 12px; line-height: 1.5;
}
.agent-code code { padding: 0; border: 0; background: none; }
.agent-tools { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.agent-tools summary { cursor: pointer; user-select: none; padding: 2px; }
.agent-tool { margin-top: 6px; padding: 8px 10px; border-left: 2px solid var(--accent-primary); border-radius: 0 6px 6px 0; background: var(--bg-raise); }
.agent-tool-head { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-tool-head b { color: var(--text-primary); font-weight: 600; }
.agent-tool pre { margin-top: 6px; max-height: 240px; overflow: auto; white-space: pre-wrap; font-size: 11px; color: var(--text-secondary); }

.agent-thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.agent-elapsed { font-variant-numeric: tabular-nums; }
.agent-dots { display: inline-flex; gap: 3px; }
.agent-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: agent-dot 1.2s ease-in-out infinite; }
.agent-dots i:nth-child(2) { animation-delay: 0.15s; }
.agent-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes agent-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .agent-dots i { animation: none !important; opacity: 0.6; } }

.agent-empty { margin: auto; max-width: 560px; padding: 24px 8px; text-align: center; }
.agent-empty-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.agent-empty-sub { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.agent-suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.agent-chip {
  padding: 10px 14px; border-radius: 10px; text-align: left;
  border: 1px solid var(--border); background: var(--bg-surface);
  color: var(--text-secondary); font-size: 13px; line-height: 1.45;
  transition: var(--transition-interactive);
}
.agent-chip:hover { border-color: var(--accent-primary); color: var(--text-primary); }

.agent-composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-card);
}
.agent-composer textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 220px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-bright); background: var(--bg-input);
  color: var(--text-primary); font-size: 13.5px; line-height: 1.5;
}
.agent-composer textarea:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-dim); }
.agent-composer .btn { height: 42px; padding: 0 18px; }

@media (max-width: 900px) {
  .agent-shell { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .agent-side { max-height: 220px; }
  .agent-chat { height: 72vh; }
}

/* ── Add-finding dialog (findings.js addFinding) ─────────────────────────── */
.ff-overlay {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(3px);
}
.ff-dialog {
  width: min(640px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border-bright); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.ff-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ff-head h2 { margin: 0; font-size: 16px; font-weight: 650; color: var(--text-primary); }
.ff-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px;
  padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain;
}
.ff-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ff-field.ff-wide, .ff-err { grid-column: 1 / -1; }
.ff-field > span { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.ff-field > span b { color: var(--accent-red); font-weight: 700; }
.ff-field input, .ff-field select, .ff-field textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border-bright); background-color: var(--bg-input);
  color: var(--text-primary); font-size: 13px; font-family: inherit;
}
.ff-field select { padding-right: 30px; }
.ff-field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.ff-field input:focus, .ff-field select:focus, .ff-field textarea:focus {
  outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-dim);
}
.ff-err { padding: 8px 12px; border-radius: 8px; background: var(--accent-red-dim); color: var(--accent-red); font-size: 12.5px; }
.ff-err[hidden] { display: none; }
.ff-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
@media (max-width: 560px) { .ff-body { grid-template-columns: 1fr; } }

/* ── Overview ▸ AI usage (pages/ai-usage.js) ─────────────────────────────── */
.au-card { margin-bottom: 20px; }
.au-card[hidden] { display: none; }
.au-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.au-meta { font-size: 12px; color: var(--text-muted); }
.au-body { padding: 16px 20px 18px; }
.au-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .au-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .au-tiles { grid-template-columns: 1fr; } }
.au-tile { padding: 14px 16px; border-radius: 10px; background: var(--bg-sunken); border: 1px solid var(--border); min-width: 0; }
.au-tile-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.au-tile-value { margin-top: 4px; font-size: 24px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.au-tile-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.au-tile-warn { border-color: var(--accent-amber); }
.au-warn { color: var(--accent-amber); font-weight: 600; }
.au-err { color: var(--accent-red); }
.au-dim { color: var(--text-muted); font-size: 11.5px; }
.au-section-title { margin: 20px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.au-chart { position: relative; }
.au-chart svg { display: block; max-width: 100%; overflow: visible; }
.au-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.au-baseline { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.au-axis { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.au-bar { fill: var(--accent-primary); }
.au-hit { fill: transparent; }
.au-col { cursor: default; outline: none; }
.au-col.on .au-hit, .au-col:focus-visible .au-hit { fill: var(--bg-raise); }
.au-col.on .au-bar { fill: var(--accent-primary-hover); }
.au-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%);
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  background: var(--bg-card); border: 1px solid var(--border-bright); box-shadow: var(--shadow-card);
  color: var(--text-primary); font-size: 12px; font-variant-numeric: tabular-nums;
}
.au-details { margin-top: 8px; font-size: 12px; }
.au-details summary { cursor: pointer; color: var(--text-muted); user-select: none; padding: 2px 0; }
.au-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.au-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.au-table td { padding: 8px 10px; border-bottom: 1px solid var(--bg-raise); color: var(--text-secondary); }
.au-table .au-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.au-features { margin-top: 18px; }
.au-share { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.au-sharebar { flex: 1; height: 6px; border-radius: 99px; background: var(--bg-raise); overflow: hidden; }
.au-sharebar > i { display: block; height: 100%; width: var(--w, 0%); background: var(--accent-primary); border-radius: inherit; }
.au-note { margin-top: 14px; font-size: 11.5px; line-height: 1.55; color: var(--text-muted); }
.au-note a { color: var(--text-accent); }
.au-empty-line { padding: 10px 0; font-size: 12.5px; color: var(--text-muted); }

/* ── Scan titles & descriptions (pages/scan-meta.js) ─────────────────────── */
.scan-title { font-size: 14px; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.scan-type-chip {
  font-size: 11px; padding: 1px 7px; border-radius: 4px;
  background: var(--bg-raise); border: 1px solid var(--border); color: var(--text-secondary);
}
.scan-target-mono { font-family: 'JetBrains Mono', monospace; color: var(--text-secondary); }
.scan-desc {
  margin-top: 4px; max-width: 72ch; font-size: 12px; line-height: 1.45; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.scan-row-name { min-width: 0; max-width: 380px; }
.scan-row-title { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-row-target { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-row-desc { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-detail-desc { margin-top: 6px; max-width: 80ch; font-size: 13px; line-height: 1.5; color: var(--text-secondary); white-space: pre-wrap; }
.scan-detail-desc[hidden] { display: none; }
.launcher-meta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.launcher-field-title { flex: 1 1 240px; }
.launcher-field-desc { flex: 2 1 340px; }
.sm-launch-meta { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.sm-hint { font-size: 12px; color: var(--text-muted); }
.sm-hint b { color: var(--text-secondary); font-weight: 600; }
.sm-body { grid-template-columns: 1fr; }

/* ── Findings (merged with AI Triage; pages/findings.js) ─────────────────── */
button.stat-card.fx-kpi { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
button.stat-card.fx-kpi:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.fx-toolbar { flex-wrap: wrap; gap: 10px 14px; }
.fx-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.fx-filters .search-input { width: 220px; max-width: 100%; padding: 7px 10px; font-size: 12.5px; }
.fx-filters select { font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
.fx-filters .fx-program-search { width: 180px; max-width: 100%; padding: 6px 10px; font-size: 12.5px; color: var(--text-primary); background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 8px; }
.fx-filters .fx-program-search:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.fx-filters .fx-program-search.fx-invalid { border-color: var(--accent-amber); }
.fx-scanchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 99px; background: var(--accent-primary-dim); color: var(--text-primary); font-size: 12px; }
.fx-scanchip[hidden] { display: none; }
.fx-scanchip b { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 11.5px; }
.fx-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fx-mod, .fx-cve { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-raise); color: var(--text-secondary); }
.fx-mod[data-mod="zerodays"], .fx-mod[data-mod="dns-takeover"], .fx-mod[data-mod="exposure"] { color: var(--sev-high); border-color: currentColor; background: transparent; }
.fx-cve { font-family: 'JetBrains Mono', monospace; color: var(--text-accent); }
.fx-status, .fx-bulkstatus { font-size: 12px; padding: 4px 26px 4px 8px; border-radius: 6px; background-position: right 8px center; }
.fx-status[data-st="validated"], .fx-status[data-st="approved"] { color: var(--verdict-likely); border-color: var(--verdict-likely); }
.fx-status[data-st="drafted"] { color: var(--verdict-review); border-color: var(--verdict-review); }
.fx-status[data-st="submitted"], .fx-status[data-st="resolved"] { color: var(--verdict-tp); border-color: var(--verdict-tp); }
.fx-status[data-st="dup"], .fx-status[data-st="rejected"], .fx-status[data-st="wontfix"] { color: var(--verdict-fp); }
.fx-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.fx-pager:empty { display: none; }
button.fx-closed-toggle { cursor: pointer; font: inherit; font-size: 12px; }
button.fx-closed-toggle[data-on="1"] { border-color: var(--accent-cyan); }
button.fx-closed-toggle:disabled { cursor: default; opacity: 0.7; }
button.fx-closed-toggle:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.fx-pager-top { margin: 0 0 8px; }
.fx-pagecount { margin-right: auto; }
.fx-pages { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.fx-pg { min-width: 32px; padding: 4px 8px; font-size: 12px; }
.fx-pg[aria-current="page"] { opacity: 1; color: var(--text-primary); border-color: var(--accent-cyan); background: color-mix(in srgb, var(--accent-cyan) 12%, transparent); }
.fx-pg-gap { padding: 0 4px; color: var(--text-muted); }
.fx-pagesize { display: inline-flex; align-items: center; gap: 6px; }
.fx-pagesize select { padding: 3px 6px; font-size: 12px; }
.fx-reflink { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
  color: var(--verdict-tp); border: 1px solid color-mix(in srgb, var(--verdict-tp) 50%, transparent); background: color-mix(in srgb, var(--verdict-tp) 9%, transparent); text-decoration: none; }
a.fx-reflink:hover { text-decoration: underline; }
@media (max-width: 640px) { .fx-pagecount { width: 100%; } .fx-pager { justify-content: flex-start; } }
.fx-noreport { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--border-bright); border-radius: 10px; font-size: 13px; color: var(--text-muted); }
.fx-muted { color: var(--text-muted); }
.fx-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.ff-foot .grow, .tri-dfoot .grow { flex: 1; }
.fx-report { width: min(920px, 100%); }
.fx-report-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px; min-height: 0; flex: 1; }
.fx-report-src { font-size: 12px; color: var(--text-muted); }
.fx-report-body textarea {
  flex: 1; min-height: 52vh; resize: vertical; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border-bright); background: var(--bg-input); color: var(--text-primary);
  font: 12.5px/1.6 'JetBrains Mono', ui-monospace, monospace;
}
.fx-report-body textarea:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-dim); }
#report-editor-modal[hidden] { display: none; }
#fx-root .tri-headactions { margin-left: auto; }
#fx-root .tri-actions { justify-content: flex-end; flex-wrap: nowrap; }

/* ── CVE Radar: PoC-day pipeline (pages/cve-radar.js) ────────────────────── */
.cvr-note { margin: -6px 0 16px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.cvr-note b { color: var(--text-secondary); font-weight: 600; }
.pd-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pd-chip {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap;
  --c: var(--text-muted); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
}
.pd-chip:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.pd-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pd-chip[data-pd="done"]                  { --c: var(--verdict-tp); }
.pd-chip[data-pd="running"],
.pd-chip[data-pd="targeting"],
.pd-chip[data-pd="resolving"],
.pd-chip[data-pd="queued"]                { --c: var(--accent-cyan); }
.pd-chip[data-pd="running"]::before,
.pd-chip[data-pd="resolving"]::before     { animation: pd-pulse 1.2s ease-in-out infinite; }
.pd-chip[data-pd="no_template"],
.pd-chip[data-pd="no_hosts"]              { --c: var(--verdict-review); }
.pd-chip[data-pd="suspicious"],
.pd-chip[data-pd="error"]                 { --c: var(--verdict-error); }
.pd-chip[data-pd="skipped"]               { --c: var(--text-muted); }
@keyframes pd-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pd-chip::before { animation: none !important; } }
.pd-sub { margin-top: 3px; font-size: 11px; color: var(--text-muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-race { padding: 2px 9px; font-size: 11px; }
.pd-src { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.pd-src[data-src="official"] { color: var(--verdict-tp); }
.pd-src[data-src="pr"]       { color: var(--accent-amber); }
.pd-src[data-src="ai"]       { color: var(--accent-purple); }
.cvr-auto { margin: -4px 0 10px; }
.cvr-auto .tri-chip { font: inherit; font-size: 12px; }
.cvr-run {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px;
  --c: var(--text-muted); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
}
.cvr-run::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cvr-run[data-run="ran"]    { --c: var(--verdict-tp); }
.cvr-run[data-run="active"] { --c: var(--accent-cyan); }
.cvr-run[data-run="active"]::before { animation: pd-pulse 1.2s ease-in-out infinite; }
.cvr-run[data-run="tried"]  { --c: var(--verdict-review); }
.cvr-run[data-run="never"]  { --c: var(--accent-amber); border-style: dashed; }
.cvr-run[data-poc="0"]      { --c: var(--text-muted); border-style: solid; background: none; }
@media (prefers-reduced-motion: reduce) { .cvr-run::before { animation: none !important; } }
.cvr-desc { font-size: 12px; color: var(--text-secondary); max-width: 360px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }

/* Findings: auto-review toggle + agent validation chips */
button.tri-chip.fx-toggle { cursor: pointer; font: inherit; }
button.tri-chip.fx-toggle:hover { border-color: var(--border-bright); }
button.tri-chip.fx-toggle:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
button.tri-chip.fx-toggle:disabled { opacity: 0.6; cursor: progress; }
.fx-agent { display: inline-block; margin-top: 4px; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; white-space: nowrap;
  --c: var(--text-muted); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 9%, transparent); }
.fx-agent[data-av="true_positive"]       { --c: var(--verdict-tp); }
.fx-agent[data-av="likely"]              { --c: var(--verdict-likely); }
.fx-agent[data-av="needs_manual_review"] { --c: var(--verdict-review); }
.fx-agent[data-av="false_positive"]      { --c: var(--verdict-fp); }
.fx-agent[data-av="error"]               { --c: var(--verdict-error); }
.fx-agent[data-av="busy"]                { --c: var(--accent-cyan); }
.tri-dbadges code { font-size: 11px; }

/* Programs: scope autopilot panel (pages/scope-autopilot.js) */
.ap-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
summary.ap-head { cursor: pointer; list-style: none; }
summary.ap-head::-webkit-details-marker { display: none; }
.ap-chevron { color: var(--text-muted); font-size: 10px; transition: transform .15s ease; }
details.ap-card[open] .ap-chevron { transform: rotate(90deg); }
.ap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; color: var(--text-secondary); }
.ap-title { font-weight: 600; color: var(--text-primary); }
.ap-sub { color: var(--text-muted); }
.ap-empty { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.ap-table { margin-top: 8px; table-layout: fixed; }
.ap-table th, .ap-table td { padding: 8px 10px; }
.ap-table td { vertical-align: top; font-size: 12.5px; }
.ap-table col.apc-when { width: 44px; }
.ap-table col.apc-asset { width: 24%; }
.ap-table col.apc-find { width: 66px; }
.ap-table col.apc-ins { width: 74px; }
/* The asset is a URL/host with no spaces: truncate on one line (full value in
   the cell's title tooltip) instead of letting it shatter character-by-character. */
.ap-asset { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.ap-scans { display: flex; flex-wrap: wrap; gap: 4px; }
.ap-scan { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px;
  max-width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  --c: var(--text-muted); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 9%, transparent); }
.ap-scan[data-ap="reviewed"] { --c: var(--verdict-tp); }
.ap-scan[data-ap="launched"], .ap-scan[data-ap="finished"] { --c: var(--accent-cyan); }
.ap-scan[data-ap="planned"]  { --c: var(--accent-purple); }
.ap-scan[data-ap="failed"]   { --c: var(--verdict-error); }
.ap-more { padding: 2px 9px; font-size: 11px; }
.ap-insight pre { margin: 0; padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  font: 12px/1.55 'JetBrains Mono', ui-monospace, monospace; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }

/* In-page confirm dialog (ui-helpers.js uiConfirm) — native confirm() is
   suppressed in embedded browsers. */
.ui-confirm-overlay { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 16px;
  background: rgba(2, 6, 23, 0.6); backdrop-filter: blur(2px); }
.ui-confirm { width: min(440px, 100%); background: var(--bg-surface); border: 1px solid var(--border-bright); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); padding: 18px 20px 16px; }
.ui-confirm h2 { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.4; color: var(--text-primary); word-break: break-word; }
.ui-confirm p { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.ui-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ui-prompt-field { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--text-secondary); }
.ui-prompt-field input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-bright);
  background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 13px; }
.ui-prompt-field input:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.ui-prompt-help { font-size: 12px !important; color: var(--text-muted) !important; }
.btn.btn-danger { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn.btn-danger:hover { filter: brightness(1.08); }

/* ── Credentials manager ─────────────────────────────────────────────────── */
.btn-xs { padding: 3px 8px !important; font-size: 11px !important; line-height: 1.4; }
.empty-sub { margin: 8px auto 0; font-size: 13px; color: var(--text-muted); max-width: 620px; line-height: 1.5; }
.cred-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cred-hint { font-size: 12px; color: var(--text-muted); max-width: 640px; line-height: 1.5; }
.cred-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.cred-program { border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: rgba(255,255,255,0.015); }
.cred-program-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: rgba(255,255,255,0.03); flex-wrap: wrap; }
.cred-prog-title { font-weight: 650; font-size: 14px; color: var(--text-primary); }
.cred-prog-sub { font-size: 11.5px; color: var(--text-muted); margin-left: 8px; font-family: var(--mono, monospace); }
.cred-auto { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); cursor: pointer; user-select: none; }
.cred-auto input { accent-color: var(--accent-green, #2ecc71); width: 15px; height: 15px; cursor: pointer; }
.cred-table { width: 100%; border-collapse: collapse; }
.cred-table th { text-align: left; font-size: 10.5px; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; padding: 8px 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.cred-table td { padding: 9px 14px; font-size: 13px; border-top: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.cred-acct { font-weight: 600; color: var(--text-primary); }
.cred-mono { font-family: var(--mono, monospace); font-size: 12px; color: var(--text-muted); }
.cred-updated { font-size: 11.5px; color: var(--text-muted); }
.cred-actions { text-align: right; white-space: nowrap; }
.cred-actions .btn { margin-left: 4px; }
.cred-del { color: var(--accent-red, #e74c3c) !important; }
.cred-err { color: var(--accent-red, #e74c3c); cursor: help; }
.cred-reveal { padding: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.cred-reveal code { background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 5px; font-size: 12.5px; user-select: all; }
.cred-reveal-k { display: inline-block; width: 52px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cred-raw { margin-top: 4px; }
.cred-raw summary { font-size: 11.5px; color: var(--text-muted); cursor: pointer; }
.cred-raw pre { max-height: 240px; overflow: auto; background: rgba(0,0,0,0.25); padding: 10px; border-radius: 8px; font-size: 11.5px; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.cred-h1panel { border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; margin-bottom: 16px; padding: 12px 14px; background: rgba(255,255,255,0.02); }
.cred-h1title { font-weight: 650; font-size: 13px; color: var(--text-primary); margin-bottom: 10px; }
.cred-h1title .cred-hint { display: block; font-weight: 400; margin-top: 4px; }
.cred-h1row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.05); }
.cred-h1row:first-of-type { border-top: none; }
.cred-h1meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cred-h1actions { white-space: nowrap; }
.cred-h1actions .btn { margin-left: 4px; }
.cred-h1form { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.cred-h1form textarea.search-input { width: 100%; resize: vertical; font-family: var(--mono, monospace); font-size: 11.5px; }
.cred-h1form input.search-input { width: 100%; }
.cred-h1form .btn { align-self: flex-start; }
