@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* Dark-first design: surveillance / terminal aesthetic */
:root {
  --bg: #060c16;
  --bg-gradient: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(239, 68, 68, 0.05), transparent 50%),
    var(--bg);
  --surface: #0d1625;
  --surface-raised: #121e30;
  --surface-glass: rgba(13, 22, 37, 0.75);
  --text: #e2e8f5;
  --muted: #7a90aa;
  --border: #1e2d40;
  --border-subtle: rgba(30, 45, 64, 0.85);
  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  --scan: #22d3ee;
  --scan-glow: rgba(34, 211, 238, 0.3);
  --scan-line: #22d3ee;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.35);
  --danger-text: #fca5a5;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.35);
  --warning-text: #fcd34d;
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.1);
  --ok-text: #6ee7b7;
  --confidence-high-bg: rgba(16, 185, 129, 0.12);
  --confidence-high-text: #6ee7b7;
  --confidence-medium-bg: rgba(245, 158, 11, 0.12);
  --confidence-medium-text: #fcd34d;
  --confidence-low-bg: rgba(148, 163, 184, 0.1);
  --confidence-low-text: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.55), 0 16px 40px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-pill: 999px;
  --header-blur: rgba(6, 12, 22, 0.88);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Light mode override */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f4f8;
    --bg-gradient: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 211, 238, 0.1), transparent 55%),
      radial-gradient(ellipse 60% 40% at 100% 0%, rgba(239, 68, 68, 0.04), transparent 50%),
      var(--bg);
    --surface: #ffffff;
    --surface-raised: #f8fafc;
    --surface-glass: rgba(255, 255, 255, 0.8);
    --text: #0f172a;
    --muted: #64748b;
    --border: #dde3ed;
    --border-subtle: rgba(221, 227, 237, 0.8);
    --accent: #0891b2;
    --accent-hover: #0e7490;
    --accent-gradient: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
    --scan: #0891b2;
    --scan-glow: rgba(8, 145, 178, 0.25);
    --scan-line: #06b6d4;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: rgba(220, 38, 38, 0.3);
    --danger-text: #b91c1c;
    --danger-glow: rgba(220, 38, 38, 0.2);
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: rgba(217, 119, 6, 0.3);
    --warning-text: #92400e;
    --ok: #059669;
    --ok-bg: #ecfdf5;
    --ok-text: #047857;
    --confidence-high-bg: #ecfdf5;
    --confidence-high-text: #047857;
    --confidence-medium-bg: #fffbeb;
    --confidence-medium-text: #b45309;
    --confidence-low-bg: #f1f5f9;
    --confidence-low-text: #475569;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.09), 0 16px 40px rgba(15, 23, 42, 0.07);
    --header-blur: rgba(255, 255, 255, 0.88);
  }
}

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

body {
  margin: 0;
  background: var(--bg-gradient);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* ─── Header ─── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--header-blur);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.locale-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.locale-switcher-label {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

.locale-select {
  font: inherit;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface, #fff);
  color: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-header {
  flex-shrink: 0;
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .brand-logo-header {
    animation: logo-pulse 4s ease-in-out infinite;
  }
}

@keyframes logo-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    filter: drop-shadow(0 0 8px var(--scan-glow));
  }
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* ─── Hero ─── */

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0 3.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(34, 211, 238, 0.018) 3px,
    rgba(34, 211, 238, 0.018) 4px
  );
}

@media (prefers-color-scheme: light) {
  .hero-scanline {
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(8, 145, 178, 0.025) 3px,
      rgba(8, 145, 178, 0.025) 4px
    );
  }
}

@media (prefers-reduced-motion: no-preference) {
  .page-hero::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--scan-line) 50%, transparent 100%);
    animation: hero-sweep 3.5s ease-in-out infinite;
    opacity: 0.7;
  }
}

@keyframes hero-sweep {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { transform: translateY(500px); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(34, 211, 238, 0.07);
}

@media (prefers-color-scheme: light) {
  .hero-eyebrow {
    border-color: rgba(8, 145, 178, 0.25);
    background: rgba(8, 145, 178, 0.06);
  }
}

.hero-eyebrow::before {
  content: "●";
  font-size: 0.5rem;
  animation: blink 1.2s step-start infinite;
}

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

.hero-headline {
  margin: 0 0 1.25rem;
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
}

.hero-headline em {
  font-style: normal;
  color: var(--danger);
}

.hero-sub {
  margin: 0 auto;
  max-width: 42rem;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── Toolbar ─── */

main.container {
  padding-top: 1.5rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.toolbar-intro {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.toolbar .btn {
  flex-shrink: 0;
}

/* ─── Buttons ─── */

.btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.35rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--scan);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 0 0 0 var(--scan-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 18px var(--scan-glow);
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  border-color: var(--scan);
  background: var(--surface-raised);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Error banner ─── */

.error-banner {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ─── Loading / Scan ─── */

.analysis-shell {
  min-height: 52rem;
  margin-bottom: 1.25rem;
}

.analysis-shell #results[hidden] {
  display: none;
}

.analysis-shell #results:not([hidden]) {
  margin-bottom: 0;
}

#loading[hidden] {
  display: none !important;
}

.loading-row {
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.scan-headline {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scan-headline::before {
  content: "";
  display: inline-block;
  width: 2.5rem;
  height: 0.3rem;
  background: var(--border);
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* The animated sweep bar on the scan-headline pseudo-element is handled by CSS vars */
.scan-loader-bar {
  position: relative;
  width: 2.5rem;
  height: 0.3rem;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
  display: inline-block;
}

.scan-loader-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--scan-line), #fff, var(--scan-line), transparent);
  border-radius: var(--radius-pill);
  animation: scan-sweep 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .scan-loader-bar::after {
    animation: none;
    left: 30%;
    width: 40%;
  }
}

/* Legacy scan-loader for backward compat */
.scan-loader {
  position: relative;
  width: 2.5rem;
  height: 0.35rem;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}

.scan-loader::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--scan-line), #fff, var(--scan-line), transparent);
  border-radius: var(--radius-pill);
  animation: scan-sweep 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .scan-loader::after {
    animation: none;
    left: 30%;
    width: 40%;
  }
}

@keyframes scan-sweep {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* Signal scan list */
.signal-scan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signal-scan-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.signal-scan-list li::before {
  content: "○";
  font-size: 0.65rem;
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  color: var(--border);
  transition: color 0.2s ease, content 0.2s ease;
}

.signal-scan-list li.scan-active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.06);
}

.signal-scan-list li.scan-active::before {
  content: "◉";
  color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@media (prefers-color-scheme: light) {
  .signal-scan-list li.scan-active {
    background: rgba(8, 145, 178, 0.06);
  }
}

.signal-scan-list li.scan-done {
  color: var(--ok-text);
}

.signal-scan-list li.scan-done::before {
  content: "✓";
  color: var(--ok-text);
  animation: none;
}

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

/* ─── Results card ─── */

#results,
.manual-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.analysis-shell #results {
  margin-bottom: 0;
}

/* ─── Stat grid (UA tab) ─── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--scan);
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.15rem;
  letter-spacing: -0.01em;
}

.brand-logo {
  flex-shrink: 0;
  object-fit: contain;
  min-width: 24px;
  min-height: 24px;
}

/* ─── Tabs ─── */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 1.25rem;
}

.tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ─── Titles / descriptions ─── */

.section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
}

.section-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.25rem 0 1rem;
}

/* ─── UA details ─── */

.ua-details {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  background: var(--bg);
}

.ua-details summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
}

.ua-raw {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
  color: var(--text);
  background: var(--surface);
  border-radius: 8px;
}

/* ─── KV table ─── */

.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.kv-table th,
.kv-table td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.kv-table tbody tr {
  transition: background 0.12s ease;
}

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

.kv-table th {
  width: 38%;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}

.header-value-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── Inference cards ─── */

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

.inference-card {
  display: flex;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inference-card:hover {
  border-color: var(--scan);
  box-shadow: 0 0 0 1px var(--scan), var(--shadow-sm);
}

.inference-icon img {
  display: block;
}

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

.inference-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.meta-source {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--muted);
}

.meta-confidence {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.67rem;
  font-weight: 700;
  white-space: nowrap;
}

.confidence-high {
  background: var(--confidence-high-bg);
  color: var(--confidence-high-text);
}

.confidence-medium {
  background: var(--confidence-medium-bg);
  color: var(--confidence-medium-text);
}

.confidence-low {
  background: var(--confidence-low-bg);
  color: var(--confidence-low-text);
}

.inference-category {
  margin: 0;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.inference-card h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.inference-summary {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ─── Compare box ─── */

.compare-box {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--scan);
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.compare-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.compare-value {
  margin: 0;
  font-size: 0.8rem;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  word-break: break-word;
}

/* ─── Bullet / privacy lists ─── */

.bullet-list {
  padding-left: 1.2rem;
  margin: 0;
}

.bullet-list li {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── Manual UA section ─── */

.manual-section h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.manual-section label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--scan);
  box-shadow: 0 0 0 3px var(--scan-glow);
}

/* ─── Footer ─── */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 0 2rem;
  margin-top: 1rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-attribution {
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-attribution a,
.footer-link {
  color: var(--accent);
  text-decoration: none;
}

.footer-attribution a:hover,
.footer-link:hover {
  text-decoration: underline;
}

.footer-link {
  font-weight: 500;
}

/* ─── Inference guidance ─── */

.inference-guidance {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.inference-guidance strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── Fingerprint ID card (replaces demo-hash-box) ─── */

.fingerprint-id-card {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fingerprint-id-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  border: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.fp-high .fingerprint-id-card,
.fingerprint-id-card.fp-high {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 1px var(--danger-border), inset 0 0 40px rgba(239, 68, 68, 0.04);
}

.fp-moderate .fingerprint-id-card,
.fingerprint-id-card.fp-moderate {
  border-color: var(--warning-border);
  box-shadow: 0 0 0 1px var(--warning-border), inset 0 0 40px rgba(245, 158, 11, 0.04);
}

.fp-low .fingerprint-id-card,
.fingerprint-id-card.fp-low {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.fingerprint-id-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fingerprint-id-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.fingerprint-id-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

.fp-moderate .fingerprint-id-label-dot {
  background: var(--warning);
}

.fp-low .fingerprint-id-label-dot {
  background: var(--ok);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.fingerprint-id-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fingerprint-id-badge.badge-high {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.fingerprint-id-badge.badge-moderate {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.fingerprint-id-badge.badge-low {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.fingerprint-id-hash {
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  word-break: break-all;
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.fingerprint-id-hash .hash-accent {
  color: var(--danger);
}

.fp-moderate .fingerprint-id-hash .hash-accent {
  color: var(--warning);
}

.fp-low .fingerprint-id-hash .hash-accent {
  color: var(--ok);
}

.fingerprint-id-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fingerprint-id-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.fingerprint-stability-hint {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.45;
}

.fingerprint-stability-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.fingerprint-stability-body {
  margin: 0;
  color: var(--muted);
}

.fingerprint-stability-hint.stability-neutral {
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}

.fingerprint-stability-hint.stability-warning {
  background: color-mix(in srgb, var(--surface) 88%, #f59e0b 12%);
  border-color: color-mix(in srgb, var(--border) 70%, #f59e0b 30%);
}

.fingerprint-stability-hint.stability-positive {
  background: color-mix(in srgb, var(--surface) 88%, #22c55e 12%);
  border-color: color-mix(in srgb, var(--border) 70%, #22c55e 30%);
}

/* ─── Threat gauge (score display) ─── */

.threat-gauge-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.threat-gauge-wrap {
  position: relative;
  flex-shrink: 0;
}

.threat-gauge-svg {
  display: block;
  transform: rotate(-90deg);
  /* rotate so arc starts at top */
}

.threat-gauge-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.threat-gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.6s ease;
}

.threat-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.threat-gauge-score {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.threat-gauge-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.15rem;
}

.threat-gauge-info {
  flex: 1;
  min-width: 180px;
}

.threat-gauge-headline {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.threat-gauge-narrative {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Myth buster ─── */

.myth-buster {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.03);
}

.myth-buster-title {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--danger-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.myth-buster-title::before {
  content: "⚠";
  font-size: 0.9rem;
}

.myth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.myth-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  line-height: 1.4;
}

.myth-item-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.myth-item-text {
  font-weight: 600;
  color: var(--text);
}

.myth-item-text small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.myth-item.myth-no {
  border-color: var(--danger-border);
}

.myth-item.myth-no .myth-item-icon {
  color: var(--danger);
}

.myth-item.myth-partial {
  border-color: var(--warning-border);
}

.myth-item.myth-partial .myth-item-icon {
  color: var(--warning);
}

.myth-item.myth-yes {
  border-color: rgba(16, 185, 129, 0.3);
}

.myth-item.myth-yes .myth-item-icon {
  color: var(--ok-text);
}

/* ─── Exposure banner (redesigned) ─── */

.exposure-banner {
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.exposure-low {
  background: var(--ok-bg);
  border-color: rgba(16, 185, 129, 0.3);
}

.exposure-moderate {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.exposure-high {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.exposure-banner-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.6rem;
}

.exposure-badge {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

.exposure-high .exposure-badge {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.exposure-moderate .exposure-badge {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.exposure-low .exposure-badge {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.exposure-headline {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.exposure-narrative {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Legacy demo hash box — keep compatible */
.demo-hash-box {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--scan);
  border-radius: var(--radius);
}

.demo-hash-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.demo-hash-value,
.hash-value {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 0.95rem;
}

.hash-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hash-copy-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hash-copy-btn:hover {
  border-color: var(--scan);
  box-shadow: 0 0 8px var(--scan-glow);
}

.hash-copy-btn:focus-visible {
  outline: 2px solid var(--scan);
  outline-offset: 2px;
}

.demo-hash-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── Protections / concerns / recommendations ─── */

.protection-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.protection-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg);
}

.protection-active .protection-icon {
  color: var(--ok-text);
}

.protection-missing .protection-icon {
  color: var(--warning-text);
}

.concern-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 1.25rem;
}

.concern-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.concern-card:hover {
  border-color: var(--scan);
  box-shadow: 0 0 0 1px var(--scan), var(--shadow-sm);
}

.concern-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.concern-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.recommendation-list {
  margin: 0;
  padding-left: 1.25rem;
}

.recommendation-item {
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.recommendation-item strong {
  color: var(--text);
}

.recommendation-item p {
  margin: 0.25rem 0 0;
}

.rec-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0.4rem 0 0;
}

.rec-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.rec-link:hover {
  text-decoration: underline;
}

/* ─── Improvement checklist ─── */

.improvement-summary {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.improvement-summary-meta {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.improvement-summary-potential {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text);
}

.improvement-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
}

.improvement-summary-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.improvement-summary-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.improvement-checklist-cta {
  width: 100%;
  max-width: 280px;
}

.improvement-tab-intro {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.improvement-section {
  margin-bottom: 1.5rem;
}

.improvement-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.improvement-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.improvement-card.impact-border-high,
.improvement-card.impact-border-very_high,
.improvement-summary-card.impact-border-high,
.improvement-summary-card.impact-border-very_high {
  border-left: 3px solid #f59e0b;
}

.improvement-card.impact-border-medium,
.improvement-summary-card.impact-border-medium {
  border-left: 3px solid var(--accent);
}

.improvement-card.improvement-done {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.improvement-card.improvement-limited {
  opacity: 0.85;
  border-style: dashed;
}

.improvement-card.is-user-done .improvement-card-body h3,
.improvement-card.is-user-done .improvement-card-body p {
  opacity: 0.65;
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}

.improvement-card-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.improvement-checkbox {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.improvement-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.improvement-card-body h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.improvement-card-body p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.improvement-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.ease-badge,
.impact-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ease-easy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.ease-moderate {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.ease-advanced {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.impact-low {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
}

.impact-medium {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.impact-high,
.impact-very_high {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.gain-range {
  font-size: 0.78rem;
  font-weight: 700;
  color: #34d399;
}

.improvement-disclaimer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.improvement-disclaimer p {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ─── Geo ─── */

.geo-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

/* ─── Privacy score pill (legacy compat) ─── */

.privacy-score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
}

.privacy-score-max {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

/* ─── Benchmark ─── */

.benchmark-section {
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.benchmark-demo-note {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.benchmark-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
}

.benchmark-score-block {
  min-width: 7rem;
}

.benchmark-score-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.benchmark-score-max {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.benchmark-score-caption {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.benchmark-score-hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.benchmark-rank-block {
  flex: 1;
  min-width: 220px;
}

.benchmark-richness-note {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.benchmark-rank-text {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.benchmark-rank-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.benchmark-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.benchmark-histogram {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 132px;
  margin-bottom: 1.1rem;
  padding: 0 0.25rem;
}

.benchmark-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.benchmark-bar {
  width: 100%;
  max-width: 3rem;
  min-height: 4px;
  border-radius: 0.35rem 0.35rem 0 0;
  background: var(--border);
}

.benchmark-bar-wrap.benchmark-bar-active .benchmark-bar {
  background: linear-gradient(180deg, var(--scan), var(--accent));
}

.benchmark-bar-pct {
  margin-bottom: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}

.benchmark-bar-wrap.benchmark-bar-active .benchmark-bar-pct {
  color: var(--accent);
}

.benchmark-bar-label {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
}

.benchmark-band-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.benchmark-band-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.82rem;
}

.benchmark-band-count {
  font-weight: 700;
}

/* ─── Landing FAQ ─── */

.landing-faq {
  margin: 2rem 0 1.5rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0.65rem 0.85rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.faq-item p {
  margin: 0.65rem 0 0.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.faq-item a {
  color: var(--accent);
}

/* ─── Mobile ─── */

@media (max-width: 640px) {
  .page-hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-headline {
    font-size: 1.65rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .btn {
    align-self: flex-end;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    border-radius: var(--radius);
  }

  .tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
  }

  .myth-grid {
    grid-template-columns: 1fr 1fr;
  }

  .threat-gauge-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .fingerprint-id-hash {
    font-size: 0.8rem;
  }
}
