/* ============================================================
   GScan -- design system
   Dark charcoal base, gold primary accent, blue secondary accent.
   No external fonts/CDN: a strong, fast system font stack instead
   (this app may run fully offline on an internal server).
   ============================================================ */

:root {
  /* -- palette -- */
  --bg: #12141a;
  --bg-elev-1: #181b22;
  --bg-elev-2: #1e222b;
  --surface: #20242e;
  --surface-hover: #262b36;
  --line: #2b3040;
  --line-strong: #394057;

  --fg: #eef0f4;
  --fg-muted: #9aa3b6;
  --fg-faint: #6b7489;

  --gold: #d8ae45;
  --gold-strong: #eec869;
  --gold-ink: #241a04;

  --blue: #4f8cff;
  --blue-strong: #7fb0ff;
  --blue-ink: #06142e;

  --danger: #ef5a5f;
  --danger-strong: #ff7a7e;
  --ok: #3ecf8e;
  --warn: #e3b341;

  /* -- type scale -- */
  --font-sans: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: 2.25rem;

  /* -- spacing scale -- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* -- radii / shadows -- */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.45);
  --shadow-gold-glow: 0 0 0 1px rgba(216,174,69,0.4), 0 4px 18px rgba(216,174,69,0.12);

  --focus-ring: 0 0 0 3px rgba(79,140,255,0.45);
  --transition-fast: 120ms ease;
  --transition: 180ms ease;

  --sidebar-w: 248px;
  --topbar-h: 60px;
}

/* ============ reset / base ============ */
*, *::before, *::after { box-sizing: border-box; }
/* The `hidden` attribute must always win, even over a component that sets an explicit
   display (e.g. .exposure-alert { display:flex }). Without this, such elements ignore
   `hidden` and show as an empty box. JS toggles visibility with el.hidden = true/false. */
[hidden] { display: none !important; }
/* Brand mark: when the mark holds the inline vector logo, drop the gold chip behind it
   (the shield itself is the logo). An uploaded PNG logo keeps the chip, unchanged. */
.mark:has(.logo-mark) { background: none !important; border: none !important; box-shadow: none !important; }
.logo-mark { display: block; width: 100%; height: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-strong); text-decoration: none; }
a:hover { color: var(--gold-strong); }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============ app shell ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elev-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  font-weight: 700; font-size: var(--text-md); color: var(--gold-strong);
  letter-spacing: 0.2px;
}
.sidebar .brand .mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--gold-strong), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-ink); font-weight: 800; font-size: 14px;
}
.nav-group { padding: 0 var(--sp-3); display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: var(--sp-3) var(--sp-3) var(--sp-1); font-size: var(--text-xs); color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.6px; }
.nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 9px var(--sp-3); border-radius: var(--radius-sm);
  color: var(--fg-muted); font-size: var(--text-sm); font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-link .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-link:hover { background: var(--surface); color: var(--fg); }
.nav-link.active { background: var(--surface); color: var(--gold-strong); box-shadow: inset 2px 0 0 var(--gold); }
.sidebar .spacer { flex: 1; }
.sidebar .user-box {
  margin: var(--sp-3); padding: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.sidebar .user-box .name { font-size: var(--text-sm); font-weight: 600; color: var(--fg); }
.sidebar .user-box .role { font-size: var(--text-xs); color: var(--fg-muted); margin-top: 2px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-6); border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 10; gap: var(--sp-4);
}
.topbar h1 { font-size: var(--text-lg); font-weight: 650; }
.topbar .menu-btn { display: none; }

/* Notification bell (dashboard) */
.notif-bell { position: relative; }
.notif-bell > #notif-toggle { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger, #d64545); color: #fff; font-size: 10px;
  font-weight: 700; line-height: 16px; text-align: center;
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: 90vw;
  background: var(--bg, #fff); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow, 0 8px 28px rgba(0,0,0,0.18)); z-index: 40; overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-3); border-bottom: 1px solid var(--line); }
.notif-head-actions { display: flex; align-items: center; gap: var(--sp-2); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.notif-item { padding: var(--sp-3); border-bottom: 1px solid var(--line); }
.notif-item.unread { background: rgba(216,174,69,0.10); }
.notif-item .msg { font-size: var(--text-sm); }
.notif-item .meta { font-size: var(--text-xs); color: var(--fg-faint); margin-top: 2px; }
.notif-empty { padding: var(--sp-4); color: var(--fg-faint); font-size: var(--text-sm); text-align: center; }
.content { padding: var(--sp-6); max-width: 1280px; width: 100%; margin: 0 auto; }
.app-footer { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); color: var(--fg-faint); font-size: var(--text-xs); text-align: center; }

/* ============ typography helpers ============ */
.section-title { font-size: var(--text-md); font-weight: 650; color: var(--fg); margin: var(--sp-8) 0 var(--sp-4); }
.section-title:first-child { margin-top: 0; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.mono { font-family: var(--font-mono); }
.help-text { font-size: var(--text-xs); color: var(--fg-muted); margin-top: var(--sp-1); }

/* ============ cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); gap: var(--sp-3); flex-wrap: wrap; }
.card-header h2 { font-size: var(--text-md); font-weight: 650; }
.card-header .desc { font-size: var(--text-sm); color: var(--fg-muted); margin-top: 2px; }

/* ============ hero stat (prominent "indexed lines") ============ */
.stat-hero {
  background: linear-gradient(135deg, var(--surface), var(--bg-elev-2));
  border: 1px solid rgba(216,174,69,0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-gold-glow);
  padding: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-6);
}
.stat-hero-label {
  font-size: var(--text-sm); color: var(--fg-muted); text-transform: uppercase;
  letter-spacing: 1px; font-weight: 700;
}
.stat-hero-value {
  font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; color: var(--gold-strong);
  letter-spacing: -1px; line-height: 1.05; margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.stat-hero-value.calculating { color: var(--fg-muted); font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 650; }
.stat-hero-sub { font-size: var(--text-xs); color: var(--fg-faint); margin-top: var(--sp-2); }

/* ============ stat tiles ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.stat-tile {
  background: linear-gradient(165deg, var(--surface), var(--bg-elev-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--sp-5); position: relative; overflow: hidden;
}
.stat-tile.highlight { border-color: rgba(216,174,69,0.35); box-shadow: var(--shadow-gold-glow); }
/* The "Indexed lines" highlight tile holds a potentially huge number
   (e.g. ~10,379,442,641). Let it span two grid columns and shrink its
   number to fit so it never overflows or looks cramped. */
.stat-tile.highlight { grid-column: span 2; }
.stat-tile .label { font-size: var(--text-xs); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-tile .value { font-size: var(--text-2xl); font-weight: 750; color: var(--fg); margin-top: var(--sp-2); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-tile.highlight .value {
  font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.stat-tile .value.gold { color: var(--gold-strong); }
.stat-tile .value.blue { color: var(--blue-strong); }
.stat-tile .sub { font-size: var(--text-xs); color: var(--fg-faint); margin-top: var(--sp-2); line-height: 1.5; }
.stat-tile .sub .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 5px; }

/* inline sparkline/bars (no chart library) */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 36px; margin-top: var(--sp-3); }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--blue-strong), var(--blue)); border-radius: 3px 3px 0 0; min-height: 3px; opacity: 0.85; }
.bars .bar.gold { background: linear-gradient(180deg, var(--gold-strong), var(--gold)); }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: var(--text-sm); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: filter var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.3; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: linear-gradient(180deg, var(--gold-strong), var(--gold)); color: var(--gold-ink); border-color: var(--gold); }
/* Keep the dark ink text on hover: the generic `a:hover { color: gold }` rule
   would otherwise turn a link-button's label light gold on the gold fill,
   making it unreadable. */
.btn-primary:hover { filter: brightness(1.07); box-shadow: var(--shadow-gold-glow); color: var(--gold-ink); }

.btn-secondary { background: var(--bg-elev-2); color: var(--fg); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--blue); color: var(--fg); }

.btn-ghost { background: transparent; color: var(--fg-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--surface); color: var(--fg); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

.btn .spinner { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.6s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ forms ============ */
.field { margin-bottom: var(--sp-4); max-width: 440px; }
.field.full { max-width: none; }
.field label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--fg); margin-bottom: var(--sp-1); }
.field .help-text { margin-top: var(--sp-1); }
.field .error-text { font-size: var(--text-xs); color: var(--danger-strong); margin-top: var(--sp-1); }

input[type=text], input[type=password], input[type=email], input[type=search],
input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--bg-elev-2); color: var(--fg);
  font-size: var(--text-base); font-family: inherit; outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--focus-ring); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
select { cursor: pointer; }

.checkbox-row { display: flex; align-items: center; gap: var(--sp-2); }
.checkbox-row input[type=checkbox], .checkbox-row input[type=radio] { width: 17px; height: 17px; accent-color: var(--gold); }
.checkbox-row label { margin-bottom: 0; font-weight: 500; }

.form-row { display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: flex-end; }

/* ============ badges / pills ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: var(--text-xs); font-weight: 650;
  letter-spacing: 0.2px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: rgba(62,207,142,0.14); color: var(--ok); }
.badge-danger { background: rgba(239,90,95,0.14); color: var(--danger-strong); }
.badge-warn { background: rgba(227,179,65,0.14); color: var(--warn); }
.badge-muted { background: rgba(154,163,182,0.14); color: var(--fg-muted); }
.badge-blue { background: rgba(79,140,255,0.14); color: var(--blue-strong); }
.badge-gold { background: rgba(216,174,69,0.16); color: var(--gold-strong); }

/* ============ tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
thead th {
  position: sticky; top: 0; background: var(--bg-elev-2); z-index: 1;
  color: var(--fg-muted); font-weight: 650; text-transform: uppercase; font-size: var(--text-xs);
  letter-spacing: 0.4px; text-align: left; padding: 11px var(--sp-3); border-bottom: 1px solid var(--line-strong);
}
tbody td { padding: 10px var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.012); }
tbody tr:hover td { background: rgba(216,174,69,0.045); }
tbody tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: var(--sp-2); }

/* ============ empty state ============ */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-10) var(--sp-5); color: var(--fg-muted); }
.empty-state .ico { width: 44px; height: 44px; margin-bottom: var(--sp-3); opacity: 0.6; }
.empty-state .title { font-size: var(--text-base); font-weight: 600; color: var(--fg); }
.empty-state .desc { font-size: var(--text-sm); margin-top: var(--sp-1); max-width: 340px; }

/* ============ pagination ============ */
.pagination { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); font-size: var(--text-sm); }

/* ============ alerts ============ */
.alert { border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); font-size: var(--text-sm); margin-bottom: var(--sp-4); border: 1px solid transparent; }
.alert-danger { background: rgba(239,90,95,0.1); border-color: rgba(239,90,95,0.35); color: #ffc0c2; }
.alert-ok { background: rgba(62,207,142,0.1); border-color: rgba(62,207,142,0.35); color: #b6f3d8; }
.alert-warn { background: rgba(227,179,65,0.1); border-color: rgba(227,179,65,0.35); color: #f3dca3; }
.alert-info { background: rgba(79,140,255,0.1); border-color: rgba(79,140,255,0.35); color: #cfe0ff; }

.key-reveal {
  background: rgba(216,174,69,0.08); border: 1px solid var(--gold); border-radius: var(--radius);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.key-reveal strong { display: block; color: var(--gold-strong); margin-bottom: var(--sp-2); font-size: var(--text-sm); }
.key-reveal .value { font-family: var(--font-mono); font-size: var(--text-sm); word-break: break-all; }

/* ============ modals ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8,9,13,0.6); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: var(--sp-4);
}
.modal-overlay.is-open { display: flex; }
.modal {
  background: var(--bg-elev-1); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 480px; width: 100%; padding: var(--sp-6);
}
.modal h3 { font-size: var(--text-md); font-weight: 650; margin-bottom: var(--sp-3); }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ============ toasts ============ */
.toast-stack {
  position: fixed; bottom: var(--sp-5); right: var(--sp-5); display: flex; flex-direction: column;
  gap: var(--sp-2); z-index: 200; max-width: 340px;
}
.toast {
  background: var(--bg-elev-1); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-md); font-size: var(--text-sm);
  display: flex; align-items: flex-start; gap: var(--sp-2);
  animation: toast-in 180ms ease;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ login page ============ */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 10%, rgba(216,174,69,0.08), transparent 45%), radial-gradient(circle at 85% 90%, rgba(79,140,255,0.08), transparent 45%), var(--bg); padding: var(--sp-5); }
.login-card { width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-8) var(--sp-6); box-shadow: var(--shadow-lg); }
.login-card .mark { width: 44px; height: 44px; border-radius: var(--radius); background: linear-gradient(145deg, var(--gold-strong), var(--gold)); display: flex; align-items: center; justify-content: center; color: var(--gold-ink); font-weight: 800; margin: 0 auto var(--sp-4); }
.login-card h1 { text-align: center; font-size: var(--text-lg); margin-bottom: var(--sp-1); }
.login-card .sub { text-align: center; color: var(--fg-muted); font-size: var(--text-sm); margin-bottom: var(--sp-6); }

/* ============ verification panel ============ */
.verify-card { border-left: 3px solid var(--blue); }
.verify-card.is-verified { border-left-color: var(--ok); }
.token-box { font-family: var(--font-mono); font-size: var(--text-sm); background: var(--bg-elev-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: var(--sp-3); word-break: break-all; margin: var(--sp-2) 0; }
/* Simplified verify flow: numbered steps + copy buttons + clear CTA */
.verify-steps { list-style: none; margin: var(--sp-3) 0 0; padding: 0; counter-reset: vs; }
.verify-steps > li { margin: 0 0 var(--sp-4); }
.vs-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; color: var(--fg); }
.vs-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--gold-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.token-row { display: flex; align-items: stretch; gap: var(--sp-2); margin: var(--sp-2) 0; }
.token-row .token-box { flex: 1; min-width: 0; margin: 0; }
.copy-btn { flex: none; align-self: center; white-space: nowrap; }
.verify-cta-row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-top: var(--sp-2); }
/* Mass search summary tiles */
.mass-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0; }
@media (max-width: 620px) { .mass-tiles { grid-template-columns: repeat(2, 1fr); } }
.mass-tile { background: var(--bg-elev-1); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); }
.mass-tile .k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-muted); }
.mass-tile .v { font-size: var(--text-xl); font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--gold-strong); }

/* mass-search live progress */
.mass-progress-card { margin-top: var(--sp-3); }
.mass-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.mass-progress-head .mono { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.mass-progress-track { height: 8px; border-radius: 999px; background: var(--bg-elev-2, #1e222b); overflow: hidden; }
.mass-progress-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-strong, #eec869)); transition: width .25s ease; }
.mass-progress-now { margin-top: 8px; min-height: 1em; }

/* mass-search: at-a-glance stat band */
.mass-band { display: flex; flex-wrap: wrap; gap: 12px; margin: var(--sp-3, 12px) 0 16px; }
.mass-stat { flex: 1 1 150px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-elev-1, #181b22); padding: 14px 16px; }
.mass-stat.danger { border-color: rgba(239,90,95,.5); background: linear-gradient(180deg, rgba(239,90,95,.12), transparent); }
.mass-stat .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint, #6b7489); }
.mass-stat .v { font-weight: 800; font-size: 28px; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1; }
.mass-stat.danger .v { color: var(--danger-strong, #ff7a7e); }
.mass-stat.gold .v { color: var(--gold-strong, #eec869); }
.mass-stat.green .v { color: var(--ok, #3ecf8e); }

/* mass-search: results CARD with a sortable, RED-flagged table */
.mass-card { background: var(--bg-elev-1, #181b22); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px -34px rgba(0,0,0,.9); }
.mass-card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; background: linear-gradient(180deg, var(--bg-elev-2, #1e222b), transparent); }
.mass-card-h .t { font-weight: 700; font-size: 15px; }
.mass-card-h .hint { margin-left: auto; font-size: 11px; color: var(--fg-faint, #6b7489); }
.mass-rt-wrap { overflow-x: auto; }
table.mass-rt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.mass-rt thead th { text-align: left; padding: 11px 16px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted, #9aa3b6); background: var(--bg-elev-2, #1e222b); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.mass-rt tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.mass-rt tbody tr:last-child td { border-bottom: 0; }
.mass-rt .mass-tgt { font-family: var(--mono, ui-monospace, monospace); font-size: 13px; font-weight: 600; }
.mass-rt .mass-typ { font-size: 11px; color: var(--fg-muted, #9aa3b6); text-transform: uppercase; letter-spacing: .04em; }
th.mass-sortable { cursor: pointer; user-select: none; transition: color .15s; }
th.mass-sortable:hover { color: var(--fg); }
th.mass-sortable .arrows { display: inline-flex; flex-direction: column; line-height: .6; margin-left: 6px; vertical-align: middle; }
th.mass-sortable .arrows i { font-style: normal; font-size: 9px; color: var(--fg-faint, #6b7489); transition: color .15s; }
th.mass-sortable.sort-desc .arrows .dn, th.mass-sortable.sort-asc .arrows .up { color: var(--gold-strong, #eec869); }

/* mass-search: flag EXPOSED targets (at risk, data available) in red */
.mass-exposed { background: linear-gradient(90deg, rgba(239,90,95,.12), transparent 64%); }
.mass-exposed td:first-child { box-shadow: inset 3px 0 0 var(--danger, #ef5a5f); }
.mass-crit { background: linear-gradient(90deg, rgba(239,90,95,.2), transparent 72%); }
.badge.mass-b-exposed { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.badge.mass-b-exposed.crit { box-shadow: 0 0 14px -2px rgba(239,90,95,.55); }
.mass-b-exposed .mass-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger, #ef5a5f); box-shadow: 0 0 0 3px rgba(239,90,95,.18); flex: none; }
.mass-sev { display: inline-block; margin-left: 8px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; }
.mass-sev.c { color: var(--danger-strong, #ff7a7e); background: rgba(239,90,95,.14); }
.mass-sev.h { color: var(--warn, #e3b341); background: rgba(227,179,65,.14); }
.mass-sev.l { color: var(--fg-muted, #9aa3b6); background: var(--bg-elev-2, #1e222b); }

/* ============ search result rows ============ */
.result-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.result-row {
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); font-family: var(--font-mono); font-size: var(--text-sm);
  word-break: break-all; white-space: pre-wrap;
}
.result-row.is-redacted { color: var(--fg-faint); border-style: dashed; }
.result-row .file { color: var(--fg-muted); font-size: var(--text-xs); margin-bottom: var(--sp-1); }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); align-items: start; }
.detail-list { margin: 0; display: grid; gap: var(--sp-2); }
.detail-list > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--fg-muted); font-size: var(--text-sm); }
.detail-list dd { margin: 0; text-align: right; word-break: break-word; }
.usage-row { margin-bottom: var(--sp-3); }
.usage-head { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-bottom: 6px; }
.usage-bar { height: 8px; border-radius: 999px; background: var(--bg-elev-2); border: 1px solid var(--line); overflow: hidden; }
.usage-fill { height: 100%; background: var(--blue); border-radius: 999px; }
.usage-fill.is-full { background: var(--danger, #ef5a5f); }
.ticket-thread { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.ticket-msg { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-elev-2); }
.ticket-msg.from-staff { border-color: rgba(78,140,255,0.35); background: rgba(78,140,255,0.06); }
.ticket-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2);
  font-size: var(--text-sm); }
/* The message text is PLAIN TEXT: Jinja escapes it; CSS keeps the line breaks. Never render it as HTML. */
.ticket-body { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
textarea { width: 100%; font: inherit; }
.glance { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.glance .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-elev-2); font-size: var(--text-xs); color: var(--fg-muted); }
.glance .chip strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.user-manage { margin-top: var(--sp-3); }
.user-manage > summary { cursor: pointer; font-weight: 600; color: var(--fg-muted); list-style-position: inside; padding: var(--sp-1) 0; }
.user-manage[open] > summary { margin-bottom: var(--sp-3); color: var(--fg); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  flex-wrap: wrap; padding: var(--sp-3) var(--sp-1) 0; font-size: var(--text-sm); }
.pager-nav { display: inline-flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.pager-gap { color: var(--fg-faint); padding: 0 var(--sp-1); }
.pager-size a, .pager-size strong { margin-left: var(--sp-2); }
.search-row { display: flex; gap: var(--sp-3); align-items: stretch; flex-wrap: wrap; }
.search-row input { flex: 1 1 260px; min-width: 0; }
.search-row .btn { min-width: 110px; }
.field-error { margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
  background: rgba(239,90,95,0.1); border: 1px solid rgba(239,90,95,0.35); color: #ffc0c2; font-size: var(--text-sm); }
.field-error[hidden] { display: none; }
input[aria-invalid="true"] { border-color: rgba(239,90,95,0.7); }
.meta-line { color: var(--fg-muted); font-size: var(--text-sm); margin: var(--sp-3) 2px; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* ============ responsive ============ */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; z-index: 50; transform: translateX(-100%);
    transition: transform var(--transition); box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: var(--sp-4); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-tile.highlight { grid-column: span 2; }  /* full row on 2-col layout */
  .card { padding: var(--sp-4); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-tile.highlight { grid-column: span 1; }
  .login-card { padding: var(--sp-6) var(--sp-4); }
}

/* ============ monitor time picker (hour : minute : second  AM/PM) ============ */
.time-picker legend { font-size: var(--text-sm); font-weight: 600; color: var(--fg); padding: 0; margin-bottom: var(--sp-1); }
.time-row { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.time-row input[type=number] { width: 68px; text-align: center; font-variant-numeric: tabular-nums; padding-left: 8px; padding-right: 8px; }
.time-row select { width: 78px; }
.time-row > span { color: var(--fg-faint); font-weight: 700; }

/* "new reply on your ticket" popup (built with textContent by notifications.js) */
.reply-popup { position: fixed; right: 16px; bottom: 16px; z-index: 1000; max-width: 360px; padding: 14px 16px;
  background: var(--surface, #121826); color: inherit; border: 1px solid var(--border, #2a3447); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.reply-popup-msg { margin: 6px 0 10px; opacity: .85; overflow-wrap: anywhere; }
.reply-popup-bar { display: flex; gap: 8px; justify-content: flex-end; }
.ticket-stats a.chip { text-decoration: none; }

.mark .mark-img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
.exposure-alert { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border, #2a3447); font-weight: 600; overflow-wrap: anywhere; }
.exposure-alert svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.exposure-alert.danger { background: rgba(239,90,95,.12); border-color: var(--danger, #ef5a5f); color: var(--danger-strong, #ff7a7e); }
.exposure-alert.ok { background: rgba(62,207,142,.10); border-color: rgba(62,207,142,.5); color: var(--ok, #3ecf8e); }
/* Draws the eye to a card that just appeared above the fold (e.g. the unlock-request note after
   clicking Unlock/Mass Unlock from a row further down the page). */
@keyframes gs-flash-attention {
  0%   { box-shadow: 0 0 0 0 rgba(216,174,69,.0); }
  20%  { box-shadow: 0 0 0 3px rgba(216,174,69,.55); }
  100% { box-shadow: 0 0 0 0 rgba(216,174,69,.0); }
}
.flash-attention { animation: gs-flash-attention 1.4s ease-out 2; }
@media (prefers-reduced-motion: reduce) { .flash-attention { animation: none; } }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { position: relative; display: block; padding: 16px 16px 14px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--surface, #121826); border: 1px solid var(--border, #2a3447); border-top: 3px solid var(--card-accent, #7b879c);
  transition: transform .12s ease, border-color .12s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--card-accent, #7b879c); }
.stat-card.is-active { box-shadow: 0 0 0 2px var(--card-accent, #7b879c) inset; }
.stat-card .sc-n { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--card-accent, inherit); }
.stat-card .sc-l { opacity: .8; font-size: var(--text-sm, .875rem); margin-top: 2px; }
.stat-card .sc-icon { position: absolute; right: 14px; top: 14px; opacity: .8; color: var(--card-accent, inherit); }
.stat-card .sc-icon svg { width: 22px; height: 22px; display: block; }
.tone-neutral { --card-accent: #9aa6bb; } .tone-blue { --card-accent: #5aa2ff; }
.tone-gold { --card-accent: #d8ae45; } .tone-green { --card-accent: #3ecf8e; }
.data-note { color: var(--fg-muted, #8b95a8); font-size: var(--text-xs, .75rem); margin-top: 2px; }
/* search results "table" layout (admin setting; presentation only) */
.rt-wrap { margin-top: var(--sp-3); }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.rt-toolbar input[type=search] { min-width: 180px; }
.rt-spacer { flex: 1; }
.rt-scroll { overflow-x: auto; border: 1px solid var(--border, #2a3447); border-radius: 10px; }
table.rt { width: 100%; border-collapse: collapse; min-width: 640px; }
table.rt th, table.rt td { padding: 9px 12px; text-align: left; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
table.rt thead th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
table.rt tbody tr:nth-child(even) { background: rgba(255,255,255,.03); }
table.rt tbody tr:hover { background: rgba(255,255,255,.07); }
.rt-perpage-label { font-size: var(--text-xs, .75rem); opacity: .75; margin-left: 2px; }
#rt-perpage { min-width: 64px; }
.rt-pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
#rt-pager-bottom { margin-top: 10px; margin-bottom: 0; }
.rt-pager-info { opacity: .7; font-size: var(--text-xs, .75rem); margin-left: 6px; }
.rt-locked { opacity: .85; }
.rt-empty { text-align: center; padding: 22px 12px; opacity: .7; font-style: italic; }

/* exposure ENRICHMENT (admin-controlled; signals rendered from the JSON response) */
.enrich-sec-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; flex-wrap: wrap; }
.enrich-sec-h h2 { font-size: 1.02rem; font-weight: 700; margin: 0; }
.enrich-sec-h .hint { color: var(--fg-faint, #6b7489); font-size: 12px; }
.enrich-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .enrich-grid { grid-template-columns: 1fr; } }
.ecard { background: linear-gradient(160deg, var(--bg-elev-2, #181b22), var(--surface)); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; position: relative; overflow: hidden; }
.ecard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.ecard.sev-warn::before { background: var(--gold); }
.ecard.sev-danger::before { background: var(--danger); }
.ecard.sev-info::before { background: var(--blue); }
.ecard .etop { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ecard .esrc { font-size: 11px; color: var(--fg-faint, #6b7489); }
.ecard .ebig { font-size: 1.9rem; font-weight: 800; line-height: 1; font-family: var(--mono, monospace); }
.ecard.sev-warn .ebig { color: var(--gold-strong); }
.ecard.sev-danger .ebig { color: var(--danger-strong); }
.ecard.sev-info .ebig { color: var(--blue-strong); }
.ecard .ecap { font-size: 12.5px; color: var(--fg-muted); margin-top: 8px; }
.ecard .erow { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-top: 7px; }
.ecard .erow .ek { color: var(--fg-faint, #6b7489); }
.ecard .erow .ev { color: var(--fg); font-weight: 600; text-align: right; }
.enrich-note { margin-top: 18px; padding: 13px 15px; border-radius: 11px; background: var(--bg-elev-2, #181b22);
  border: 1px solid var(--line); color: var(--fg-muted); font-size: 12.5px; line-height: 1.6; }
.enrich-note b { color: var(--fg); }
.enrich-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; color: var(--fg-faint, #6b7489); font-size: 12px; }
.enrich-legend span { display: inline-flex; align-items: center; gap: 6px; }
.src-badge { margin-left: 6px; }

/* ===== Visitor "report" result style (landing teaser; admin-selectable in Appearance) =====
   COUNT-ONLY on the visitor side: the sample/affected rows are MASKED PLACEHOLDERS built in
   teaser.js (never real records). Uses the site's theme tokens so it matches the dark+gold look. */
.vr { text-align: left; }
.vr .vr-verdict { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap;
  padding: var(--sp-5); border-radius: var(--radius-lg); border: 1px solid rgba(239,90,95,.3);
  background: linear-gradient(180deg, rgba(239,90,95,.08), transparent); }
.vr.vr-ok .vr-verdict { border-color: rgba(62,207,142,.35); background: linear-gradient(180deg, rgba(62,207,142,.08), transparent); }
.vr .vr-num { font-size: clamp(2.2rem,8vw,3.2rem); font-weight: 800; line-height: .95; color: var(--danger-strong); font-variant-numeric: tabular-nums; }
.vr.vr-ok .vr-num { color: var(--ok); }
.vr .vr-vmeta { flex: 1; min-width: 200px; }
.vr .vr-vt { font-weight: 750; font-size: var(--text-md); color: var(--fg); }
.vr .vr-vt b { color: var(--gold-strong); font-family: var(--font-mono); font-weight: 700; }
.vr .vr-vs { color: var(--fg-muted); font-size: var(--text-sm); margin-top: 4px; }
.vr .vr-risk { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: var(--text-xs); font-weight: 700;
  padding: 4px 11px; border-radius: 999px; background: rgba(239,90,95,.14); color: var(--danger-strong); border: 1px solid rgba(239,90,95,.35); }
.vr.vr-ok .vr-risk { background: rgba(62,207,142,.14); color: var(--ok); border-color: rgba(62,207,142,.35); }

.vr .vr-bd { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-3); margin-top: var(--sp-4); }
@media (max-width: 560px) { .vr .vr-bd { grid-template-columns: 1fr; } }
.vr .vr-bd .c { background: var(--bg-elev-1); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); }
.vr .vr-bd .c .k { font-size: var(--text-xs); color: var(--fg-muted); text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.vr .vr-bd .c .k .dot { width: 8px; height: 8px; border-radius: 50%; }
.vr .vr-bd .c .n { font-weight: 800; font-size: var(--text-xl); margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--fg); }

.vr .vr-sec { margin-top: var(--sp-5); }
.vr .vr-sh { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.vr .vr-sh .ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none;
  background: rgba(216,174,69,.14); color: var(--gold-strong); border: 1px solid rgba(216,174,69,.3); }
.vr .vr-sh .ico svg { width: 16px; height: 16px; }
.vr .vr-sh h3 { font-size: var(--text-md); font-weight: 750; color: var(--fg); margin: 0; }
.vr .vr-sh .sub { font-size: var(--text-xs); color: var(--fg-faint); }
.vr .vr-sh .note { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--fg-faint); }
.vr .vr-sh .note svg { width: 14px; height: 14px; }

.vr .vr-tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev-1); }
.vr table { width: 100%; border-collapse: collapse; min-width: 560px; }
.vr thead th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg-faint); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.vr tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: var(--text-sm); white-space: nowrap; color: var(--fg); }
.vr tbody tr:last-child td { border-bottom: 0; }
.vr td.mono { font-family: var(--font-mono); color: var(--fg-muted); }
.vr td.url { font-family: var(--font-mono); color: var(--blue-strong); }
.vr .vr-lk { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--fg-faint); }
.vr .vr-lk svg { width: 13px; height: 13px; }

.vr .vr-aff { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev-1); overflow: hidden; }
.vr .vr-aff .row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.vr .vr-aff .row:last-child { border-bottom: 0; }
.vr .vr-aff .av { width: 26px; height: 26px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(79,140,255,.14); color: var(--blue-strong); font-weight: 800; font-size: 11px; }
.vr .vr-aff .em { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vr .vr-aff-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 11px 14px; }
.vr .vr-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); flex: 1; min-width: 120px; overflow: hidden; }
.vr .vr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--blue)); border-radius: 99px; }

.vr .vr-plan { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev-1); padding: 4px var(--sp-2); }
.vr .vr-step { display: flex; gap: 12px; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.vr .vr-step:last-child { border-bottom: 0; }
.vr .vr-step .n { width: 24px; height: 24px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(216,174,69,.14); color: var(--gold-strong); font-weight: 800; font-size: 12px; border: 1px solid rgba(216,174,69,.28); }
.vr .vr-step .t b { display: block; font-weight: 700; font-size: var(--text-sm); color: var(--fg); }
.vr .vr-step .t span { font-size: 13px; color: var(--fg-muted); }
.vr .vr-step .badge { margin-left: auto; align-self: flex-start; white-space: nowrap; }

.vr .vr-unlock { margin-top: var(--sp-5); text-align: center; padding: var(--sp-6) var(--sp-5); border-radius: var(--radius-lg);
  border: 1px solid rgba(216,174,69,.28); background: linear-gradient(180deg, rgba(216,174,69,.07), rgba(79,140,255,.04)); }
.vr .vr-unlock .ic { width: 50px; height: 50px; border-radius: 14px; margin: 0 auto var(--sp-3); display: flex; align-items: center; justify-content: center; background: rgba(216,174,69,.12); border: 1px solid var(--line); color: var(--gold-strong); }
.vr .vr-unlock .ic svg { width: 24px; height: 24px; }
.vr .vr-unlock h3 { font-size: var(--text-lg); font-weight: 750; color: var(--fg); margin: 0; }
.vr .vr-unlock p { color: var(--fg-muted); font-size: var(--text-sm); max-width: 46ch; margin: var(--sp-2) auto 0; }
.vr .vr-unlock .cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: var(--sp-4); }

/* ===== Landing "scanning the dark web" animation (teaser.js; admin-selectable) ===== */
.teaser-scan { margin-top: var(--sp-5); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-elev-1); overflow: hidden; }
.teaser-scan .ts-head { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(79,140,255,.06), transparent); }
.teaser-scan .ts-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue-strong); box-shadow: 0 0 10px var(--blue-strong); animation: ts-blink 1.1s infinite; }
.teaser-scan .ts-t { font-weight: 700; font-size: var(--text-sm); }
.teaser-scan .ts-pct { margin-left: auto; font-family: var(--font-mono); font-weight: 700; color: var(--blue-strong); font-variant-numeric: tabular-nums; }
@keyframes ts-blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.teaser-scan .ts-body { display: grid; grid-template-columns: 180px 1fr; }
@media (max-width: 560px) { .teaser-scan .ts-body { grid-template-columns: 1fr } }
.teaser-scan .ts-radar-wrap { display: flex; align-items: center; justify-content: center; padding: 18px; border-right: 1px solid var(--line); }
@media (max-width: 560px) { .teaser-scan .ts-radar-wrap { border-right: 0; border-bottom: 1px solid var(--line) } }
.teaser-scan .ts-radar { position: relative; width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,140,255,.07), transparent 70%); border: 1px solid rgba(79,140,255,.3); }
.teaser-scan .ts-radar::before, .teaser-scan .ts-radar::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(79,140,255,.17); }
.teaser-scan .ts-radar::before { inset: 25px } .teaser-scan .ts-radar::after { inset: 50px }
.teaser-scan .ts-sweep { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(79,140,255,.42), rgba(79,140,255,0) 60deg, transparent); animation: ts-spin 1.7s linear infinite; }
.teaser-scan .ts-core { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--blue-strong); box-shadow: 0 0 14px var(--blue-strong); }
.teaser-scan .ts-blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--danger-strong); box-shadow: 0 0 8px var(--danger-strong); opacity: 0; }
@keyframes ts-spin { to { transform: rotate(360deg) } }
@keyframes ts-pop { 0% { transform: scale(0); opacity: 0 } 30% { transform: scale(1.5); opacity: 1 } 100% { transform: scale(1); opacity: .9 } }
.teaser-scan .ts-console { padding: 14px 16px; min-height: 180px; font-family: var(--font-mono); font-size: 12.3px; line-height: 1.8; }
.teaser-scan .ts-console .ts-ln { display: flex; gap: 9px; opacity: 0; transform: translateY(4px); animation: ts-rise .26s ease forwards; }
@keyframes ts-rise { to { opacity: 1; transform: none } }
.teaser-scan .ts-console .ts-ts { color: var(--fg-faint); flex: none }
.teaser-scan .ts-console .ts-msg { color: var(--fg-muted); flex: 1; min-width: 0 }
.teaser-scan .ts-console .ts-tag { flex: none; font-weight: 700 }
.teaser-scan .ts-console .ts-ok { color: var(--ok) } .teaser-scan .ts-console .ts-hit { color: var(--danger-strong) } .teaser-scan .ts-console .ts-run { color: var(--blue-strong) }
.teaser-scan .ts-bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 99px; margin: 4px 16px 14px; overflow: hidden; }
.teaser-scan .ts-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--gold)); transition: width .33s ease; }

/* ===== Mobile responsive: stop long emails / lines from pushing tables past the card ===== */
/* On phones, let the result cells WRAP (break long unbroken emails) and drop the fixed table
   min-width, so everything stays inside its card instead of overflowing to the right. */
.vr .vr-aff .em { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 600px) {
  table.rt { min-width: 0; }
  table.rt th, table.rt td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; max-width: none; }
  .vr table { min-width: 0; }
  .vr thead th, .vr tbody td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .vr .vr-aff .row { flex-wrap: wrap; }
}
/* Belt-and-braces: the scroll wrappers and report cards must be allowed to shrink (min-width:0) so an
   overflow-x child clips/scrolls instead of stretching the whole card wider than the screen. */
.rt-scroll, .rt-wrap, .vr, .vr-tbl, #teaser-report, .teaser-result { min-width: 0; max-width: 100%; }

/* ===== Visitor scan animation v3: gold accents + live stat tiles ===== */
.teaser-scan .ts-dot { background: var(--gold-strong); box-shadow: 0 0 10px var(--gold-strong); }
.teaser-scan .ts-pct { color: var(--gold-strong); }
.teaser-scan .ts-radar { border-color: rgba(216,174,69,.35); background: radial-gradient(circle, rgba(216,174,69,.07), transparent 70%); }
.teaser-scan .ts-radar::before, .teaser-scan .ts-radar::after { border-color: rgba(216,174,69,.18); }
.teaser-scan .ts-sweep { background: conic-gradient(from 0deg, rgba(216,174,69,.5), rgba(216,174,69,0) 65deg, transparent); }
.teaser-scan .ts-core { background: var(--gold-strong); box-shadow: 0 0 14px var(--gold); }
.teaser-scan .ts-console .ts-run { color: var(--gold-strong); }
.teaser-scan .ts-bar i { background: linear-gradient(90deg, var(--gold), var(--gold-strong)); box-shadow: 0 0 12px rgba(216,174,69,.5); }
.teaser-scan .ts-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.teaser-scan .ts-stat { background: var(--bg-elev-1); padding: 12px 14px; }
.teaser-scan .ts-stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--fg-faint); font-weight: 700; }
.teaser-scan .ts-stat .v { font-family: var(--font-display, var(--font-mono)); font-weight: 800; font-size: 1.25rem; margin-top: 3px; color: var(--gold-strong); font-variant-numeric: tabular-nums; line-height: 1; }
@media (max-width: 600px) { .teaser-scan .ts-stats { grid-template-columns: repeat(3,1fr); } .teaser-scan .ts-stat .v { font-size: 1rem; } }
