/* ═══════════════════════════════════════════════════════════════════════════
   MetaRay Curated — Premium Design System
   Dark-first · glass · cinematic · full responsive
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ───────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:            #030408;
  --panel:         rgba(11, 13, 22, 0.82);
  --panel-strong:  rgba(14, 16, 27, 0.96);
  --panel-soft:    rgba(255, 255, 255, 0.028);
  --line:          rgba(255, 255, 255, 0.075);
  --line-strong:   rgba(255, 255, 255, 0.14);

  /* Text */
  --text:          #f2f4fb;
  --muted:         #8e97b0;
  --muted-2:       #636b80;

  /* Brand accents */
  --accent:        #c8f135;
  --accent-2:      #7ba5ff;
  --accent-soft:   rgba(200, 241, 53, 0.10);

  /* Severity */
  --danger:        #ff7e82;
  --danger-soft:   rgba(255, 126, 130, 0.12);
  --warning:       #ffcb6b;
  --ok:            #5ef5b2;

  /* Shadows */
  --shadow-lg:     0 24px 72px rgba(0, 0, 0, 0.60), 0 4px 20px rgba(0, 0, 0, 0.30);
  --shadow-sm:     0 6px 24px rgba(0, 0, 0, 0.30), 0 1px 6px rgba(0, 0, 0, 0.20);

  /* Radius */
  --radius-xl:  26px;
  --radius-lg:  20px;
  --radius-md:  16px;
  --radius-sm:  12px;

  /* Typography */
  --sans:    "Inter", system-ui, sans-serif;
  --display: "Manrope", var(--sans);
  --mono:    "JetBrains Mono", monospace;

  /* Easing */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 0.80, 0.36, 1);
  --ease-out:    cubic-bezier(0.16, 1.00, 0.30, 1);
}

/* ── 2. RESET & BASE ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 680px 500px at  4%  12%, rgba(107, 143, 255, 0.09) 0%, transparent 65%),
    radial-gradient(ellipse 420px 360px at 94%   6%, rgba(107, 143, 255, 0.08) 0%, transparent 58%),
    radial-gradient(ellipse 500px 400px at 88%  72%, rgba(94,  245, 178, 0.05) 0%, transparent 62%),
    radial-gradient(ellipse 300px 260px at 18%  88%, rgba(80,  60,  220, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 240px 200px at 58%   4%, rgba(107, 143, 255, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 1100px 600px at 50% 115%, rgba(70,  40, 180, 0.06) 0%, transparent 65%),
    linear-gradient(180deg, #030408 0%, #020307 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Film-grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.036;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.80' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--sans); cursor: pointer; }

/* Skip to content — accessible keyboard shortcut */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent);
  color: #07100a;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 8px;
  text-decoration: none;
}
.skip-to-content:focus { left: 16px; }
img, svg { display: block; }

/* Text selection */
::selection { background: rgba(200, 241, 53, 0.22); color: var(--text); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.11); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ── 3. AMBIENT ORBS ────────────────────────────────────────────────────── */
@keyframes ambientDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(24px, 32px) scale(1.08); }
  100% { transform: translate(0, 0) scale(1); }
}

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
}

.ambient-a {
  width: 520px; height: 520px;
  top: -120px; left: -160px;
  background: radial-gradient(circle, rgba(100, 140, 255, 0.11) 0%, transparent 70%);
  filter: blur(80px);
  animation: ambientDrift 24s ease-in-out infinite;
}

.ambient-b {
  width: 420px; height: 420px;
  top: 80px; right: -110px;
  background: radial-gradient(circle, rgba(110, 106, 232, 0.09) 0%, transparent 70%);
  filter: blur(80px);
  animation: ambientDrift 30s ease-in-out 10s infinite reverse;
}

/* ── 4. PAGE SHELL ──────────────────────────────────────────────────────── */
.page-shell {
  position: relative;
  z-index: 2;
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 80px;
}

/* ── 5. TOPBAR ──────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.topbar--visible {
  background: rgba(10, 12, 22, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  padding: 14px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, box-shadow 0.35s ease;
  width: 100%;
}

/* Scrolled state: more transparent */
.topbar--scrolled.topbar--visible {
  background: rgba(10, 12, 22, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

/* Logo switching */
.brand-logo--light { display: none; }

[data-theme="light"] .brand-logo--dark  { display: none; }
[data-theme="light"] .brand-logo--light { display: block; }

.brand-mark-img {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  flex-shrink: 0;
  box-shadow: 0 8px 28px rgba(30, 93, 181, 0.30);
}

.brand-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.brand-curated {
  background: linear-gradient(90deg, #52C527 0%, #1B5DB5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  margin-top: 2px;
}

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

/* Theme toggle button */
.btn-theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color 0.22s, background 0.22s;
}

/* SVG icon inside */
.btn-theme-toggle .theme-svg {
  width: 17px;
  height: 17px;
  display: block;
  color: var(--muted);
  transition:
    transform  0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    color      0.20s ease,
    filter     0.20s ease;
  will-change: transform;
}

/* Hover: zoom + glow lime interno */
.btn-theme-toggle:hover {
  border-color: rgba(200, 241, 53, 0.35);
  background: rgba(200, 241, 53, 0.03);
}

.btn-theme-toggle:hover .theme-svg {
  transform: scale(1.28);
  color: var(--accent);
  filter:
    drop-shadow(0 0 5px rgba(200, 241, 53, 0.80))
    drop-shadow(0 0 10px rgba(200, 241, 53, 0.40));
}

/* Pill tags */
.pill,
.chip {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.pill.subtle {
  background: rgba(200, 241, 53, 0.07);
  border: 1px solid rgba(200, 241, 53, 0.16);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── 6. MAIN LAYOUT ─────────────────────────────────────────────────────── */
.main-layout {
  display: grid;
  gap: 22px;
  padding-top: 18px;
}

/* ── 7. PANELS ──────────────────────────────────────────────────────────── */
.panel {
  background: linear-gradient(148deg,
    rgba(16, 19, 31, 0.94) 0%,
    rgba(10, 12, 22, 0.88) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.28s var(--ease-smooth),
              border-color 0.28s var(--ease-smooth);
}

/* Top edge shimmer */
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.13) 35%,
    rgba(255, 255, 255, 0.13) 65%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* ── 8. SECTION HEADINGS ────────────────────────────────────────────────── */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.section-heading.compact { margin-bottom: 16px; }

.section-heading h2 {
  margin: 8px 0 6px;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.2;
}
.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.96rem;
}

.section-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(200, 241, 53, 0.07);
  border: 1px solid rgba(200, 241, 53, 0.17);
  color: var(--accent);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ── 9. HERO SPLASH ─────────────────────────────────────────────────────── */
@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes kwGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 241, 53, 0); }
  50%       { box-shadow: 0 0 28px 4px rgba(200, 241, 53, 0.16); }
}

@keyframes glowPulseA {
  from { opacity: 0.7; transform: translateX(-50%) scale(0.95); }
  to   { opacity: 1.0; transform: translateX(-50%) scale(1.08); }
}

.anim-fade {
  opacity: 0;
  animation: splashFadeUp 0.72s cubic-bezier(.22, .8, .36, 1) forwards;
  animation-delay: var(--d, 0s);
}

.hero-splash {
  text-align: center;
  padding: 72px 24px 56px;
  position: relative;
  overflow: visible;
}

.splash-glow-a,
.splash-glow-b {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.splash-glow-a {
  width: 500px; height: 300px;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(200, 241, 53, 0.12) 0%, transparent 70%);
  animation: glowPulseA 6s ease-in-out infinite alternate;
}

.splash-glow-b {
  width: 380px; height: 260px;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(107, 143, 255, 0.10) 0%, transparent 70%);
  animation: glowPulseA 8s ease-in-out 3s infinite alternate-reverse;
}

.splash-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.splash-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 32px;
}

.splash-title {
  font-family: var(--display);
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 30px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.splash-line { display: block; }

/* Ultima riga hero — "dimenticato." allineato a sinistra con "Anche" */
.splash-last-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.splash-dimenticato {
  display: block;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1.1;
}

.splash-keyword {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  border: 1.5px solid rgba(200, 241, 53, 0.40);
  background: rgba(200, 241, 53, 0.06);
  border-radius: 12px;
  padding: 6px 28px;
  box-shadow: 0 0 28px rgba(110, 106, 232, 0.09);
  animation: splashFadeUp 0.72s cubic-bezier(.22, .8, .36, 1) 0.4s both,
             kwGlow 3.5s ease-in-out 1.8s infinite;
}

.splash-desc {
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 32px;
}

.splash-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  border-radius: 999px;
  padding: 7px 16px;
  transition: color .18s, border-color .18s;
}
.stag:hover { color: var(--text); border-color: var(--accent); }

.stag-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stag-dot--loc { background: #ff6b6b; box-shadow: 0 0 8px rgba(255, 107, 107, 0.6); }
.stag-dot--sw  { background: #c8f135; box-shadow: 0 0 8px rgba(200, 241, 53, 0.5); }
.stag-dot--ai  { background: #7ba5ff; box-shadow: 0 0 8px rgba(123, 165, 255, 0.5); }

/* ── 10. ANALYZER GRID ──────────────────────────────────────────────────── */
.analyzer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

/* ── 11. MODE SWITCH ────────────────────────────────────────────────────── */
.mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.mode-button {
  border: 0;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  transition: all 0.20s var(--ease-smooth);
}
.mode-button.active {
  background: var(--accent);
  color: #07100a;
  box-shadow: 0 2px 14px rgba(200, 241, 53, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.mode-button:not(.active):hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* ── 12. DROPZONE ───────────────────────────────────────────────────────── */
.dropzone {
  position: relative;
  display: block;
  min-height: 260px;
  padding: 22px;
  border: 1.5px dashed rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 60% 50% at 75% 25%, rgba(200, 241, 53, 0.05), transparent 70%),
    radial-gradient(ellipse 50% 60% at 25% 75%, rgba(107, 143, 255, 0.05), transparent 70%),
    rgba(255, 255, 255, 0.018);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color  0.22s var(--ease-smooth),
              background    0.22s var(--ease-smooth),
              transform     0.22s var(--ease-smooth),
              box-shadow    0.22s var(--ease-smooth);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: rgba(200, 241, 53, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32),
              0 0 0 1px rgba(200, 241, 53, 0.14),
              inset 0 0 60px rgba(200, 241, 53, 0.04);
}

.dropzone.filled {
  border-style: solid;
  border-color: rgba(200, 241, 53, 0.28);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.dropzone-shell {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 20px 12px 12px;
}

.dropzone-icon {
  width: 68px; height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  font-weight: 200;
  line-height: 1;
  color: #091208;
  background: linear-gradient(140deg, #ccf23a 0%, #a8cc20 100%);
  box-shadow: 0 10px 32px rgba(200, 241, 53, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.24s var(--ease-spring),
              box-shadow 0.24s var(--ease-smooth);
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 18px 44px rgba(200, 241, 53, 0.36),
              inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.dropzone-title {
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.dropzone-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 44ch;
  line-height: 1.6;
}

/* File chip */
.file-chip {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.file-chip-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.file-chip-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.file-chip-state {
  color: var(--ok);
  font-weight: 700;
  font-size: 0.88rem;
}

.file-chip-name {
  font-weight: 700;
  line-height: 1.5;
  word-break: break-word;
}

.file-chip-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.90rem;
}

/* ── 13. ACTIONS ROW ────────────────────────────────────────────────────── */
.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Primary button */
.cta-primary,
.primary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, #d6ff40 0%, #c6ef28 55%, #b2d810 100%);
  color: #06100a;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: -0.025em;
  box-shadow: 0 8px 28px rgba(200, 241, 53, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.38);
  position: relative;
  overflow: hidden;
  transition: transform  0.18s var(--ease-spring),
              box-shadow 0.18s var(--ease-smooth),
              filter     0.18s;
  cursor: pointer;
}

/* Glass sheen */
.cta-primary::after,
.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 52%);
  pointer-events: none;
}

.cta-primary:hover,
.primary-button:hover,
.link-button:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 16px 44px rgba(200, 241, 53, 0.42),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(1.06);
}

.cta-primary:active,
.primary-button:active {
  transform: translateY(1px) scale(0.975);
  box-shadow: 0 4px 16px rgba(200, 241, 53, 0.22);
  transition-duration: 0.08s;
  filter: brightness(0.95);
}

.cta-primary:disabled,
.primary-button:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.link-button { white-space: nowrap; }

/* Secondary button */
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.042);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
  backdrop-filter: blur(10px);
  transition: all 0.18s var(--ease-smooth);
  cursor: pointer;
}
.secondary-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.secondary-button:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

/* ── 14. STATUS BANNER ──────────────────────────────────────────────────── */
.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(148deg, rgba(14, 17, 28, 0.88), rgba(10, 12, 22, 0.84));
  backdrop-filter: blur(14px);
}

@keyframes statusPing {
  0%   { box-shadow: 0 0 0 0   rgba(200, 241, 53, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(200, 241, 53, 0); }
  100% { box-shadow: 0 0 0 0   rgba(200, 241, 53, 0); }
}

.status-dot {
  width: 10px; height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--accent);
  animation: statusPing 1.8s ease-out infinite;
}

.status-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 0.96rem;
}

.status-text {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.55;
  font-size: 0.92rem;
}

/* ── 15. RESULTS NAV ────────────────────────────────────────────────────── */
.results-nav {
  position: sticky;
  top: 76px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(7, 9, 16, 0.90);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.results-nav::-webkit-scrollbar { display: none; }

.rnav-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s var(--ease-smooth);
  text-decoration: none;
}
.rnav-item:hover { color: var(--text); background: var(--panel-soft); }
.rnav-item.active {
  color: var(--accent);
  background: rgba(200, 241, 53, 0.11);
  box-shadow: inset 0 0 0 1px rgba(200, 241, 53, 0.18);
}

.rnav-export {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s;
}
.rnav-export:hover { color: var(--text); border-color: var(--line-strong); }

/* ── 16. RESULTS SHELL ──────────────────────────────────────────────────── */
.results-shell {
  display: grid;
  gap: 22px;
}

/* ── 17. INTEL CARDS ────────────────────────────────────────────────────── */
.intel-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.intel-card {
  background: linear-gradient(148deg, rgba(16, 19, 31, 0.95), rgba(10, 12, 22, 0.90));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: transform    0.22s var(--ease-spring),
              box-shadow   0.22s var(--ease-smooth),
              border-color 0.22s;
}

.intel-card::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  pointer-events: none;
}

.intel-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42),
              0 0 40px rgba(107, 143, 255, 0.07);
}

/* Card severity states */
.intel-card--critical {
  border-color: rgba(255, 126, 130, 0.40);
  background: linear-gradient(148deg, rgba(255, 90, 100, 0.08), rgba(10, 12, 22, 0.90));
}
.intel-card--high {
  border-color: rgba(255, 186, 100, 0.35);
  background: linear-gradient(148deg, rgba(255, 186, 100, 0.07), rgba(10, 12, 22, 0.90));
}
.intel-card--medium {
  border-color: rgba(107, 143, 255, 0.30);
  background: linear-gradient(148deg, rgba(107, 143, 255, 0.06), rgba(10, 12, 22, 0.90));
}
.intel-card--low {
  border-color: var(--line);
}
.intel-card--ok {
  border-color: rgba(94, 245, 178, 0.35);
  background: linear-gradient(148deg, rgba(94, 245, 178, 0.06), rgba(10, 12, 22, 0.90));
}

/* Card icon area — using CSS pseudo-elements instead of emoji */
.intel-card-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
}

/* CSS-drawn icons for each card type */
.card-icon-privacy,
.card-icon-location,
.card-icon-device,
.card-icon-provenance {
  display: block;
  width: 18px; height: 18px;
}

.card-icon-privacy {
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.card-icon-privacy::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.card-icon-location {
  border: 2px solid currentColor;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.card-icon-device {
  border: 2px solid currentColor;
  border-radius: 3px;
  width: 14px; height: 20px;
}

.card-icon-provenance {
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
}
.card-icon-provenance::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px; right: 3px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

/* AI provenance icon — small robot face */
.card-icon-ai {
  display: block;
  width: 18px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
  position: relative;
  margin-top: 2px;
}
.card-icon-ai::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 5px;
  border: 2px solid currentColor;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
}
.card-icon-ai::after {
  content: "";
  position: absolute;
  top: 3px; left: 2px;
  width: 3px; height: 3px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 7px 0 0 currentColor;
}

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

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

.intel-card-value {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.intel-card--critical .intel-card-value { color: var(--danger); }
.intel-card--high     .intel-card-value { color: var(--warning); }
.intel-card--medium   .intel-card-value { color: var(--accent-2); }
.intel-card--ok       .intel-card-value { color: var(--ok); }

.intel-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── 18. STRIP PANEL ────────────────────────────────────────────────────── */
.strip-panel {
  border-color: rgba(94, 245, 178, 0.30);
  background: linear-gradient(148deg,
    rgba(94, 245, 178, 0.05) 0%,
    rgba(10, 12, 22, 0.90) 100%
  );
}
.strip-panel .section-heading { align-items: center; }
.strip-panel h2 { color: var(--ok); }
.remaining-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  font-family: var(--sans);
}

/* ── 19. SUMMARY PANEL ──────────────────────────────────────────────────── */
.summary-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.summary-top h2 {
  margin: 8px 0 8px;
  max-width: 18ch;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-family: var(--display);
}

.chip-privacy {
  border: 1px solid rgba(200, 241, 53, 0.20);
  background: linear-gradient(135deg,
    rgba(200, 241, 53, 0.10),
    rgba(107, 143, 255, 0.08)
  );
  color: var(--accent);
  font-weight: 700;
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(140deg,
    rgba(200, 241, 53, 0.045) 0%,
    rgba(107, 143, 255, 0.035) 100%
  );
  backdrop-filter: blur(12px);
  transition: transform 0.20s var(--ease-spring);
}
.metric-card:hover { transform: translateY(-2px); }
.metric-card span {
  color: var(--muted);
  font-size: 0.86rem;
}
.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  font-family: var(--display);
  color: var(--text);
  line-height: 1;
}

.metric-card .metric-sub {
  display: block;
  margin-top: 5px;
  font-size: 0.73rem;
  font-family: var(--mono);
  color: var(--muted-2);
  letter-spacing: 0.01em;
}

.summary-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-list-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: linear-gradient(148deg, rgba(14, 17, 28, 0.90), rgba(10, 12, 22, 0.86));
}

.subheading {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.bullet-list {
  list-style: none;
  display: grid;
  gap: 10px;
}
.bullet-list li {
  position: relative;
  padding-left: 20px;
  line-height: 1.58;
  color: var(--text);
  font-size: 0.94rem;
}
.bullet-list li::before {
  content: "";
  position: absolute;
  top: 0.60em;
  left: 0;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ── 20. SKELETON LOADER ────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: .35; }
  50%       { opacity: .70; }
}
.pulse { animation: pulse 1.4s ease-in-out infinite; }

.skeleton-wrap { display: flex; flex-direction: column; gap: 16px; padding: 8px 0; }
.skeleton-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skeleton-card  { height: 100px; background: var(--panel); border-radius: var(--radius-md); border: 1px solid var(--line); }
.skeleton-panel { height: 220px; background: var(--panel); border-radius: var(--radius-lg); border: 1px solid var(--line); }

/* ── 21. STORY PANEL ────────────────────────────────────────────────────── */
.story-panel {
  background: linear-gradient(148deg,
    rgba(18, 22, 38, 0.96) 0%,
    rgba(11, 14, 26, 0.94) 100%
  );
}
.story-panel::after {
  content: "";
  position: absolute;
  bottom: -40px; right: -40px;
  width: 320px; height: 220px;
  background: radial-gradient(circle, rgba(200, 241, 53, 0.06), transparent 70%);
  pointer-events: none;
}

.story-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.story-badges {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.story-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 100px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: border-color 0.20s;
}
.story-badge:hover { border-color: rgba(255, 255, 255, 0.14); }

.story-badge--critical { border-color: rgba(255, 126, 130, 0.40); background: rgba(255, 126, 130, 0.08); }
.story-badge--high     { border-color: rgba(255, 186, 100, 0.40); background: rgba(255, 186, 100, 0.07); }
.story-badge--medium   { border-color: rgba(107, 143, 255, 0.30); background: rgba(107, 143, 255, 0.06); }

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

.story-badge-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--display);
  color: var(--text);
  letter-spacing: -0.02em;
}
.story-badge--critical .story-badge-value { color: var(--danger); }
.story-badge--high     .story-badge-value { color: var(--warning); }

.story-narrative {
  font-size: 1.04rem;
  line-height: 1.72;
  color: var(--text);
  margin: 0 0 24px;
  padding: 18px 22px;
  background: rgba(107, 143, 255, 0.04);
  border-left: 3px solid rgba(107, 143, 255, 0.40);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.story-questions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.story-conflict-banner {
  background: rgba(239, 68, 68, .06);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.scb-icon { color: var(--danger, #ef4444); font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.scb-text { font-size: 13px; color: var(--text); line-height: 1.5; }
/* Variante informativa (Instagram → percorso atteso, non anomalia) */
.story-conflict-banner--info {
  background: rgba(59, 130, 246, .06);
  border-color: rgba(59, 130, 246, .25);
}
.story-conflict-banner--info .scb-icon { color: var(--accent, #3b82f6); }

.story-q-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.story-q-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(110, 106, 232, 0.09);
  border: 1px solid rgba(200, 241, 53, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.story-q-icon svg {
  display: block;
}

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

.story-q-answer {
  font-size: 0.90rem;
  color: var(--text);
  line-height: 1.5;
}

/* Journey */
.journey-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.story-journey {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.journey-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 480px;
}

.journey-step-icon   { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(107,143,255,0.10); color: var(--accent-2); }
.journey-step-icon svg { width: 16px; height: 16px; }
[data-theme="light"] .journey-step-icon { background: rgba(34,68,168,0.08); color: var(--accent-2); }
.journey-step-label  { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.journey-step-ts     { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.journey-step-conf   { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 3px; }
.conf-high   { color: var(--ok); }
.conf-medium { color: var(--warning); }
.conf-low    { color: var(--muted); }

.journey-arrow {
  font-size: 1.1rem;
  color: var(--muted);
  padding: 4px 0 4px 28px;
}

/* ── 22. KEY FACTS ──────────────────────────────────────────────────────── */
.keyfacts-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.keyfacts-grid .kv-item,
.info-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: var(--radius-md);
  background: linear-gradient(148deg, rgba(14, 17, 28, 0.92), rgba(10, 12, 22, 0.88));
  transition: border-color 0.18s, transform 0.18s var(--ease-smooth);
}
.info-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.info-card.highlight {
  background: linear-gradient(148deg,
    rgba(200, 241, 53, 0.07) 0%,
    rgba(107, 143, 255, 0.05) 100%
  );
  border-color: rgba(200, 241, 53, 0.14);
}

.mini-metric span,
.metric-card span,
.info-card span,
.kv-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.info-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.10rem;
  font-weight: 700;
  word-break: break-word;
  overflow-wrap: break-word;
}

.kv-item small,
.info-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

/* AI signals — prevent overflow */
#aiSignals {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.info-grid.dual { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── 23. LOCATION SECTION ───────────────────────────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

#locationGrid.location-grid,
.location-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.location-hero-card {
  grid-column: 1 / -1;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at top right, rgba(107, 143, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-sm);
}

.location-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.location-hero-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.location-hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.location-hero-badge.high   { border-color: rgba(94, 245, 178, 0.28); color: var(--ok); }
.location-hero-badge.medium { border-color: rgba(255, 203, 107, 0.26); color: var(--warning); }
.location-hero-badge.low    { border-color: rgba(142, 151, 176, 0.20); color: var(--muted); }

.location-hero-title {
  display: block;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-family: var(--display);
}

.location-hero-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.location-hero-address {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.location-hero-address span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.location-hero-address strong {
  font-size: 0.98rem;
  line-height: 1.55;
  word-break: break-word;
}

.location-card { min-height: 120px; }
.location-card small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }

/* ── 24. MAP ────────────────────────────────────────────────────────────── */
.map-container {
  height: 260px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.map-container .leaflet-container { height: 100%; }

/* ── 25. PRIVACY CHECKLIST ──────────────────────────────────────────────── */
.checklist-items { display: flex; flex-direction: column; gap: 8px; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: opacity .20s, border-color .20s;
}
.checklist-item--critical { border-color: rgba(255, 126, 130, 0.30); }
.checklist-item--high     { border-color: rgba(255, 186, 100, 0.25); }
.checklist-item--ok       { border-color: rgba(94, 245, 178, 0.20); }
.checklist-item--done     { opacity: .45; text-decoration: line-through; }

.checklist-check {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  color: var(--accent);
  user-select: none;
  transition: color .15s;
}
.checklist-item--done .checklist-check { color: var(--ok); }
.checklist-text { font-size: 0.90rem; line-height: 1.55; color: var(--text); }

/* ── 26. FINDINGS PANEL ─────────────────────────────────────────────────── */
.finding-list { display: grid; gap: 12px; }

.finding-item {
  padding: 18px 18px 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: linear-gradient(148deg, rgba(15, 18, 30, 0.92), rgba(10, 12, 22, 0.88));
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform    0.20s var(--ease-smooth),
              box-shadow   0.20s,
              border-color 0.20s;
}
.finding-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

/* Severity left bar via ::after */
.finding-item::after {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.finding-item[data-severity="critical"]::after {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255, 126, 130, 0.50);
}
.finding-item[data-severity="high"]::after {
  background: var(--warning);
  box-shadow: 0 0 12px rgba(255, 203, 107, 0.38);
}
.finding-item[data-severity="medium"]::after {
  background: rgba(200, 241, 53, 0.55);
  box-shadow: 0 0 10px rgba(200, 241, 53, 0.22);
}
.finding-item[data-severity="low"]::after {
  background: rgba(255, 255, 255, 0.18);
}

/* Also keep data-severity border-left for backward compat */
.finding-item { border-left: 3px solid var(--line); }
.finding-item[data-severity="critical"] { border-left-color: var(--danger); }
.finding-item[data-severity="high"]     { border-left-color: var(--warning); }
.finding-item[data-severity="medium"]   { border-left-color: rgba(200, 241, 53, 0.55); }
.finding-item[data-severity="low"]      { border-left-color: var(--ok); }

.finding-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.finding-title {
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.finding-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.94rem;
}

.finding-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Findings section header */
.findings-heading h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.findings-badge-row { display: flex; gap: 6px; }

.sev-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px;
}
.sev-badge--critical { background: rgba(255, 126, 130, .15); color: var(--danger); }
.sev-badge--high     { background: rgba(255, 186, 100, .15); color: var(--warning); }
.sev-badge--medium   { background: rgba(107, 143, 255, .15); color: var(--accent-2); }
.sev-badge--low      { background: rgba(94, 245, 178, .12);  color: var(--ok); }

/* Evidence */
.evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.evidence-item {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.84rem;
  font-family: var(--mono);
  gap: 6px;
}

/* ── 27. BADGES ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--muted);
  backdrop-filter: blur(8px);
}
.badge.critical {
  background: rgba(255, 90, 100, 0.13);
  border-color: rgba(255, 126, 130, 0.28);
  color: #ffc4c7;
  box-shadow: inset 0 0 14px rgba(255, 90, 100, 0.08);
}
.badge.high {
  background: rgba(255, 195, 70, 0.11);
  border-color: rgba(255, 203, 107, 0.24);
  color: #ffe09a;
}
.badge.medium { background: rgba(107, 143, 255, 0.10); border-color: rgba(107, 143, 255, 0.20); color: var(--accent-2); }
.badge.low    { background: rgba(255, 255, 255, 0.05); }

/* ── 28. FILTER CHIPS ───────────────────────────────────────────────────── */
.findings-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.filter-chip {
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s var(--ease-smooth);
}
.filter-chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.20); }
.filter-chip.active {
  background: rgba(200, 241, 53, 0.10);
  border-color: rgba(200, 241, 53, 0.28);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(110, 106, 232, 0.09);
}

/* ── 29. FORENSICS PANEL ────────────────────────────────────────────────── */
.forensics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.forensics-block { display: flex; flex-direction: column; gap: 6px; }
.forensics-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.forensics-bar-wrap {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0;
}
.forensics-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }
.forensics-bar-legend { font-size: 13px; }
.forensics-assessment { font-size: 12px; color: var(--muted-2); }
.forensics-score { font-size: 1.1rem; font-weight: 700; font-family: var(--display); }
.forensics-score-pct { font-size: 12px; color: var(--muted); }
.forensics-deduction {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  padding-left: 10px; border-left: 2px solid var(--line);
}
.forensics-alert {
  font-size: 13px; color: var(--warning);
  padding: 8px 12px; background: rgba(255, 186, 100, .08);
  border-radius: 8px; border: 1px solid rgba(255, 186, 100, .20);
}
.forensics-ok {
  font-size: 13px; color: var(--ok);
  padding: 8px 12px; background: rgba(94, 245, 178, .06);
  border-radius: 8px; border: 1px solid rgba(94, 245, 178, .15);
}
.conf-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  background: rgba(255, 186, 100, .15); padding: 2px 6px; border-radius: 4px; margin-left: 6px;
}
.forensics-issues { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.forensics-issue {
  font-size: 12px; padding: 8px 12px; border-radius: 8px;
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--panel-soft); border: 1px solid var(--line);
}
.forensics-issue--high,
.forensics-issue--critical { border-color: rgba(255, 126, 130, .25); }
.forensics-issue--medium   { border-color: rgba(255, 186, 100, .20); }
.issue-sev {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
  background: var(--danger-soft); color: var(--danger);
}
.forensics-issue--medium .issue-sev { background: rgba(255, 186, 100, .12); color: var(--warning); }

/* ── 29b. BINARY JPEG FORENSICS PANEL (ENGINE 7) ───────────────────────── */
.bf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .bf-grid { grid-template-columns: repeat(2, 1fr); }
}
.bf-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
}
.bf-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.bf-value {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--display);
  color: var(--text);
}
.bf-value--ok      { color: var(--ok); }
.bf-value--warn    { color: var(--warning); }
.bf-value--danger  { color: var(--danger); }
.bf-value--neutral { color: var(--muted); }
.bf-signals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.bf-signal {
  font-size: 12px;
  color: var(--muted-2);
  padding: 3px 0;
}
.bf-hash {
  margin-top: 10px;
  font-size: 11px;
  font-family: var(--mono, monospace);
  color: var(--muted);
  opacity: .55;
  letter-spacing: .03em;
}
[data-theme="light"] .bf-metric {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.07);
}

/* ── 29c. ORIGIN INTELLIGENCE PANEL (ENGINE 8) ──────────────────────────── */
.oi-body { padding: 4px 0; }
.oi-unavailable { color: var(--muted); font-size: 13px; padding: 8px 0; }

.oi-final {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--accent, #6c8bdb);
  border-radius: 0 10px 10px 0;
}

.oi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 700px) { .oi-grid { grid-template-columns: 1fr; } }

.oi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 14px 16px;
}
.oi-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.oi-val {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--display);
  color: var(--text);
}
.oi-val--ok      { color: var(--ok); }
.oi-val--warn    { color: var(--warning); }
.oi-val--danger  { color: var(--danger); }
.oi-val--muted   { color: var(--muted); }
.oi-card-conf    { font-size: 11px; color: var(--muted); }
.oi-timeline-note { font-size: 11px; color: var(--muted-2, var(--muted)); line-height: 1.4; margin-top: 4px; }

.oi-sigs {
  margin: 4px 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.oi-sigs li {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono, monospace);
  opacity: 0.7;
}

.oi-conflict {
  background: rgba(255, 100, 100, .06);
  border: 1px solid rgba(255, 100, 100, .18);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.oi-conflict-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 6px;
  letter-spacing: .03em;
}
/* Variante informativa (percorso atteso, non anomalia) */
.oi-conflict--info {
  background: rgba(59, 130, 246, .06);
  border-color: rgba(59, 130, 246, .18);
}
.oi-conflict--info .oi-conflict-label { color: var(--accent, #3b82f6); }
.oi-conflict-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.oi-evidence {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.oi-evidence-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 5px;
}
.oi-evidence-list {
  font-size: 12px;
  color: var(--muted-2, var(--muted));
  line-height: 1.6;
}

[data-theme="light"] .oi-card,
[data-theme="light"] .oi-final,
[data-theme="light"] .oi-evidence {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .oi-conflict {
  background: rgba(200, 50, 50, .05);
  border-color: rgba(200, 50, 50, .15);
}

/* ── 30. INFERENCE PANEL ────────────────────────────────────────────────── */
.inference-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.inference-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(148deg, rgba(14, 17, 28, 0.90), rgba(10, 12, 22, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.065);
  transition: border-color 0.18s, transform 0.18s var(--ease-smooth);
}
.inference-card:hover {
  border-color: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}
.inference-card--active {
  border-color: rgba(107, 143, 255, 0.28);
  background: linear-gradient(148deg, rgba(107, 143, 255, 0.06), rgba(10, 12, 22, 0.88));
}

.inference-icon  { width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,0.06); color: var(--muted); }
.inference-icon svg { width: 16px; height: 16px; }
.inference-card--active .inference-icon { background: rgba(107,143,255,0.10); color: var(--accent-2); }
[data-theme="light"] .inference-icon { background: rgba(0,0,0,0.05); color: var(--muted); }
[data-theme="light"] .inference-card--active .inference-icon { background: rgba(34,68,168,0.08); color: var(--accent-2); }
.inference-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.inference-value { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.inference-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── 31. KEY FACTS / FACT CARDS ─────────────────────────────────────────── */
.fact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(148deg, rgba(14, 17, 28, 0.90), rgba(10, 12, 22, 0.86));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.fact-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fact-card__label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.fact-badge--certain       { background: rgba(16, 185, 129, 0.12); color: #5ef5b2; }
.fact-badge--probable      { background: rgba(245, 158, 11, 0.14); color: #ffcb6b; }
.fact-badge--compatibility { background: rgba(99, 102, 241, 0.12); color: var(--accent-2); }

.fact-card--certain       { border-left: 4px solid var(--ok); }
.fact-card--probable      { border-left: 4px solid var(--warning); }
.fact-card--compatibility { border-left: 4px solid var(--accent-2); }

.fact-card[data-severity="critical"] { border-left: 4px solid var(--danger); }
.fact-card[data-severity="high"]     { border-left: 4px solid var(--warning); }
.fact-card[data-severity="medium"]   { border-left: 4px solid var(--accent-2); }
.fact-card[data-severity="low"]      { border-left: 4px solid var(--ok); }

.fact-helper {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── 32. RAW METADATA ───────────────────────────────────────────────────── */
.raw-details { width: 100%; }

.raw-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.raw-summary::-webkit-details-marker { display: none; }
.raw-summary::marker { display: none; }
.raw-summary .section-heading { margin-bottom: 0; }

.raw-toggle-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  font-family: var(--sans);
}

/* Chevron via CSS */
.raw-chevron {
  width: 20px; height: 20px;
  flex-shrink: 0;
  position: relative;
}
.raw-chevron::before,
.raw-chevron::after {
  content: "";
  position: absolute;
  top: 50%; 
  width: 8px; height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.20s;
}
.raw-chevron::before { right: 50%; transform: translateY(-50%) rotate(45deg); }
.raw-chevron::after  { left: 50%; transform: translateY(-50%) rotate(-45deg); }

details[open] .raw-chevron::before { transform: translateY(-50%) rotate(-45deg); }
details[open] .raw-chevron::after  { transform: translateY(-50%) rotate(45deg); }
details[open] .raw-toggle-hint { display: none; }

.raw-details .metadata-table { margin-top: 18px; }

/* Metadata table */
.metadata-table {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.metadata-section { margin-bottom: 8px; }

.metadata-ns-header {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent-2); padding: 6px 10px;
  background: rgba(107, 143, 255, .06);
  border-radius: 6px 6px 0 0;
  border: 1px solid rgba(107, 143, 255, .15);
  display: flex; align-items: center; gap: 8px;
}

.metadata-ns-count {
  font-size: 10px;
  background: rgba(107, 143, 255, .15);
  padding: 1px 6px;
  border-radius: 8px;
}

.metadata-row {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(255, 255, 255, 0.050);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  transition: background 0.14s;
}
.metadata-row:hover { background: rgba(255, 255, 255, 0.038); }

.metadata-key {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  word-break: break-word;
}

.metadata-value {
  line-height: 1.62;
  word-break: break-word;
  font-size: 0.92rem;
}

/* ── 33. COPY BUTTON ────────────────────────────────────────────────────── */
.copy-btn {
  font-size: 11px; margin-left: 6px;
  background: none; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); cursor: pointer; padding: 1px 5px;
  transition: color .15s, border-color .15s; vertical-align: middle;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn--meta { font-size: 10px; }

/* ── 34. ENTRANCE ANIMATIONS ────────────────────────────────────────────── */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel.visible     { animation: panelIn 0.52s var(--ease-out) both; }
.intel-card.visible { animation: panelIn 0.44s var(--ease-out) both; }

/* Scroll-triggered fade */
.anim-fade { opacity: 0; transform: translateY(14px); transition: opacity .4s ease, transform .4s ease; }
.anim-fade.visible { opacity: 1; transform: translateY(0); }

/* ── 35. TOOLTIP ────────────────────────────────────────────────────────── */
.tooltip-term {
  border-bottom: 1px dashed var(--muted);
  cursor: help;
  text-decoration: none;
  color: inherit;
}
.tooltip-bubble {
  display: none;
  position: absolute;
  z-index: 9999;
  max-width: 280px;
  padding: 8px 12px;
  background: rgba(15, 18, 26, .96);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

/* ── 36. UTILITY ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── 37. LIGHT THEME ────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #f0f0f8;
  --panel:        #ffffff;
  --panel-strong: #ffffff;
  --panel-soft:   rgba(0, 0, 0, 0.03);
  --line:         rgba(0, 0, 0, 0.08);
  --line-strong:  rgba(0, 0, 0, 0.16);
  --text:         #0e0f14;
  --muted:        #505566;
  --muted-2:      #6a7080;
  --accent:       #6E6AE8;
  --accent-soft:  rgba(110, 106, 232, 0.12);
  --accent-2:     #4A7CF0;
  --danger:       #FF1F3D;
  --danger-soft:  rgba(255, 31, 61, 0.10);
  --warning:      #FF6A00;
  --ok:           #00B85C;
  --shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-sm:    0 2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse 680px 520px at  0%  30%, rgba(139, 115, 235, 0.30) 0%, transparent 65%),
    radial-gradient(ellipse 380px 340px at 94%   6%, rgba(100, 118, 230, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 340px 290px at 88%  68%, rgba(58,  190, 228, 0.20) 0%, transparent 62%),
    radial-gradient(ellipse 260px 230px at 22%  90%, rgba(148, 98,  242, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 200px 180px at 55%  15%, rgba(110, 106, 232, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #f5f4ff 0%, #efeefd 100%);
}
[data-theme="light"] body::after { opacity: 0.015; }
[data-theme="light"] .ambient { display: none; }

[data-theme="light"] .panel {
  background: linear-gradient(148deg, rgba(255,255,255,0.98), rgba(248,249,252,0.96));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.90);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .panel::before {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06) 40%, rgba(0,0,0,0.06) 60%, transparent);
}

[data-theme="light"] .topbar--visible {
  background: rgba(244, 244, 252, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(16px);
}

[data-theme="light"] .topbar--scrolled.topbar--visible {
  background: rgba(244, 244, 252, 0.50);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-theme-toggle {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .btn-theme-toggle .theme-svg {
  color: #555;
}
[data-theme="light"] .btn-theme-toggle:hover {
  border-color: rgba(110, 106, 232, 0.45);
  background: rgba(110, 106, 232, 0.06);
}
[data-theme="light"] .btn-theme-toggle:hover .theme-svg {
  color: #6E6AE8;
  filter:
    drop-shadow(0 0 5px rgba(110, 106, 232, 0.80))
    drop-shadow(0 0 10px rgba(110, 106, 232, 0.40));
}

/* "Curated" gradient — light mode: blu chiaro → viola (palette logo light) */
[data-theme="light"] .brand-curated {
  background: linear-gradient(90deg, #4AADEE 0%, #8B52E0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .brand-mark-img {
  box-shadow: 0 4px 16px rgba(30, 93, 181, 0.22);
}

[data-theme="light"] .pill.subtle {
  background: rgba(110, 106, 232, 0.09);
  border: 1px solid rgba(110, 106, 232, 0.22);
  color: var(--accent);
}
[data-theme="light"] .pill {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .dropzone {
  background: #f2f2f9;
  border: 2px dashed rgba(0, 0, 0, 0.15);
  backdrop-filter: none;
}
[data-theme="light"] .dropzone.filled    { border-color: var(--accent); border-style: solid; }
/* Dropzone icon — viola in light mode */
[data-theme="light"] .dropzone-icon {
  background: linear-gradient(140deg, #8B7AEE 0%, #6E62E8 100%);
  box-shadow: 0 10px 32px rgba(110, 106, 232, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
[data-theme="light"] .dropzone:hover .dropzone-icon {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 44px rgba(110, 106, 232, 0.44),
              inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* Dropzone hover — glow viola */
[data-theme="light"] .dropzone:hover,
[data-theme="light"] .dropzone.dragover {
  border-color: rgba(110, 106, 232, 0.55);
  border-style: dashed;
  background: linear-gradient(135deg,
    rgba(110, 106, 232, 0.06) 0%,
    rgba(58,  185, 228, 0.04) 100%
  );
  box-shadow:
    0 0 0 3px rgba(110, 106, 232, 0.10),
    0 16px 48px rgba(110, 106, 232, 0.08);
}

[data-theme="light"] .mode-switch {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .mode-button.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 14px rgba(110, 106, 232, 0.35);
}
[data-theme="light"] .mode-button:not(.active):hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

[data-theme="light"] .primary-button,
[data-theme="light"] .cta-primary,
[data-theme="light"] .link-button {
  background: linear-gradient(140deg, #8B7AEE 0%, #6E62E8 55%, #5A52D8 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 28px rgba(110, 106, 232, 0.38),
              inset 0 1px 0 rgba(255,255,255,0.22);
}
[data-theme="light"] .primary-button:hover,
[data-theme="light"] .cta-primary:hover,
[data-theme="light"] .link-button:hover {
  background: linear-gradient(140deg, #9A88F8 0%, #7C70F0 55%, #6860E8 100%);
  box-shadow: 0 14px 40px rgba(110, 106, 232, 0.48),
              inset 0 1px 0 rgba(255,255,255,0.28);
}

[data-theme="light"] .secondary-button {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
  backdrop-filter: none;
}
[data-theme="light"] .secondary-button:hover {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .status-banner {
  background: #f2f2f9;
  border-color: rgba(0, 0, 0, 0.08);
  backdrop-filter: none;
}
[data-theme="light"] .status-dot {
  animation-name: statusPingLight;
}
@keyframes statusPingLight {
  0%   { box-shadow: 0 0 0 0   rgba(110, 106, 232, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(110, 106, 232, 0); }
  100% { box-shadow: 0 0 0 0   rgba(45, 111, 0, 0); }
}

[data-theme="light"] .results-nav {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(10px);
}
[data-theme="light"] .rnav-item.active {
  color: var(--accent);
  background: rgba(110, 106, 232, 0.09);
  box-shadow: none;
}

[data-theme="light"] .intel-card {
  background: linear-gradient(148deg, #ffffff, #f6f8fc);
  border-color: rgba(0, 0, 0, 0.09);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
}
[data-theme="light"] .intel-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .intel-card--critical { background: rgba(255,31,61,0.06);  border-color: rgba(255,31,61,0.28); }
[data-theme="light"] .intel-card--high     { background: rgba(255,106,0,0.06);  border-color: rgba(255,106,0,0.25); }
[data-theme="light"] .intel-card--medium   { background: rgba(34,68,168,0.04);  border-color: rgba(34,68,168,0.15); }
[data-theme="light"] .intel-card--ok       { background: rgba(110,106,232,0.06); border-color: rgba(110,106,232,0.22); }
[data-theme="light"] .intel-card--ok .intel-card-value      { color: var(--accent); }
[data-theme="light"] .intel-card--critical .intel-card-value { color: var(--danger); }
[data-theme="light"] .intel-card--high .intel-card-value     { color: var(--warning); }
[data-theme="light"] .intel-card--medium .intel-card-value   { color: var(--accent-2); }

[data-theme="light"] .metric-card {
  background: #f2f2f9;
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .metric-card strong {
  color: #0e0f14;
}

[data-theme="light"] .section-kicker,
[data-theme="light"] .eyebrow {
  background: rgba(110, 106, 232, 0.09);
  border-color: rgba(110, 106, 232, 0.20);
  color: var(--accent);
}

[data-theme="light"] .badge.critical { background: rgba(255,31,61,0.10);  border-color: rgba(255,31,61,0.28);  color: #FF1F3D; }
[data-theme="light"] .badge.high     { background: rgba(255,106,0,0.10); border-color: rgba(255,106,0,0.25);  color: #FF6A00; }
[data-theme="light"] .badge.medium   { background: rgba(0,184,92,0.10);  border-color: rgba(0,184,92,0.22);   color: #009948; }
[data-theme="light"] .badge.low      { background: rgba(0,0,0,0.04);     border-color: rgba(0,0,0,0.10);      color: var(--muted); }

[data-theme="light"] .summary-list-card,
[data-theme="light"] .info-card {
  background: linear-gradient(148deg, #ffffff, #f6f8fc);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .info-card.highlight {
  background: linear-gradient(148deg, rgba(110,106,232,0.06), rgba(34,68,168,0.04));
  border-color: rgba(110,106,232,0.20);
}

[data-theme="light"] .file-chip { background: #eaeaf4; border-color: rgba(0,0,0,0.10); }
[data-theme="light"] .chip-privacy { background: rgba(0,0,0,0.07); color: var(--text); border-color: rgba(0,0,0,0.12); }

[data-theme="light"] .finding-item {
  background: linear-gradient(148deg, #ffffff, #f6f8fc);
  border-color: rgba(0, 0, 0, 0.07);
}
[data-theme="light"] .finding-item[data-severity="critical"] { border-left-color: var(--danger); }
[data-theme="light"] .finding-item[data-severity="high"]     { border-left-color: var(--warning); }
[data-theme="light"] .finding-item[data-severity="medium"]   { border-left-color: var(--accent-2); }
[data-theme="light"] .finding-item[data-severity="low"]      { border-left-color: var(--ok); }

[data-theme="light"] .filter-chip      { background: #eaeaf4; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .filter-chip.active { background: rgba(110,106,232,0.12); border-color: var(--accent); color: var(--accent); box-shadow: none; }

[data-theme="light"] .story-narrative { border-left-color: var(--accent); background: rgba(110, 106, 232, 0.05); }
[data-theme="light"] .story-badge { background: #f2f2f9; border-color: rgba(0,0,0,0.09); }
[data-theme="light"] .story-q-item { background: #f2f2f9; border-color: rgba(0,0,0,0.08); }

[data-theme="light"] .inference-card { background: #f2f2f9; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .inference-card--active { border-color: var(--accent-2); background: rgba(34,68,168,0.04); }

[data-theme="light"] .fact-card { background: #f2f2f9; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .fact-badge--certain      { background: rgba(14,107,64,0.10);  color: var(--ok); }
[data-theme="light"] .fact-badge--probable     { background: rgba(154,94,0,0.10);   color: var(--warning); }
[data-theme="light"] .fact-badge--compatibility { background: rgba(34,68,168,0.10); color: var(--accent-2); }

[data-theme="light"] .forensics-ok    { background: rgba(14,107,64,0.05);  border-color: rgba(14,107,64,0.15); color: var(--ok); }
[data-theme="light"] .forensics-alert { background: rgba(154,94,0,0.06);   border-color: rgba(154,94,0,0.18);  color: var(--warning); }

[data-theme="light"] .metadata-row { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
[data-theme="light"] .metadata-row:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .metadata-key { color: var(--muted); }
[data-theme="light"] .metadata-ns-header { background: rgba(34,68,168,0.05); border-color: rgba(34,68,168,0.12); color: var(--accent-2); }
[data-theme="light"] .metadata-ns-count  { background: rgba(34,68,168,0.10); }

[data-theme="light"] .checklist-item   { background: #f2f2f9; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .journey-step     { background: #f2f2f9; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .strip-panel      { border-color: rgba(110,106,232,0.35); background: linear-gradient(148deg, rgba(110,106,232,0.07) 0%, rgba(245,244,255,0.95) 100%); box-shadow: 0 0 28px rgba(110,106,232,0.10); }
[data-theme="light"] .strip-panel h2   { color: var(--accent); }

[data-theme="light"] .skeleton-card,
[data-theme="light"] .skeleton-panel { background: #e6e5f4; border-color: rgba(0,0,0,0.06); }

[data-theme="light"] .tooltip-bubble { background: #ffffff; border-color: rgba(0,0,0,0.14); color: var(--text); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

[data-theme="light"] ::selection { background: rgba(110, 106, 232, 0.22); }
[data-theme="light"] ::-webkit-scrollbar-thumb       { background: rgba(0,0,0,0.14); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.24); }

/* Hero in light — viola palette, no text-stroke */
[data-theme="light"] .splash-keyword {
  color: var(--accent);
  border-color: rgba(110, 106, 232, 0.38);
  background: rgba(110, 106, 232, 0.07);
  box-shadow: none;
  -webkit-text-stroke: none;
  text-shadow: none;
}

[data-theme="light"] .splash-eyebrow {
  -webkit-text-stroke: none;
  text-shadow: none;
}

[data-theme="light"] .stag {
  background: rgba(110, 106, 232, 0.06);
  border-color: rgba(110, 106, 232, 0.18);
  color: var(--text);
}

/* Glow orbs in light — viola + teal */
[data-theme="light"] .splash-glow-a {
  background: radial-gradient(circle, rgba(110, 106, 232, 0.28) 0%, transparent 70%);
  opacity: 1;
}
[data-theme="light"] .splash-glow-b {
  background: radial-gradient(circle, rgba(58, 185, 228, 0.22) 0%, transparent 70%);
  opacity: 1;
}

/* ── 38. RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
  .intel-cards { grid-template-columns: repeat(2, 1fr); }
  .metrics-band,
  .summary-columns,
  .keyfacts-grid,
  .info-grid,
  .info-grid.dual,
  .forensics-row { grid-template-columns: 1fr; }
  #locationGrid.location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-top { flex-direction: column; align-items: flex-start; }
  .inference-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .page-shell {
    width: calc(100vw - 20px);
    padding-bottom: 48px;
  }
  .topbar--visible { border-radius: 0; padding: 12px 16px; }
  .topbar { flex-wrap: wrap; }
  .brand-subtitle { display: none; }
  .hero-splash { padding: 48px 16px 44px; }
  .splash-title { font-size: clamp(1.7rem, 8vw, 2.4rem); gap: 10px; }
  .splash-keyword { font-size: 0.6em; padding: 5px 16px; }
  .section-heading { flex-direction: column; align-items: stretch; }
  .actions-row { flex-direction: column; }
  .primary-button, .secondary-button { width: 100%; justify-content: center; }
  .link-button { width: 100%; justify-content: center; }
  .dropzone { min-height: 220px; }
  .metadata-row { grid-template-columns: 1fr; }
  .intel-cards { grid-template-columns: 1fr; }
  .story-badges { flex-direction: column; }
  .mode-switch { align-self: flex-start; }
  #locationGrid.location-grid { grid-template-columns: 1fr; }
  .inference-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar-actions .pill { display: none; }
  .splash-tags { gap: 8px; }
  .stag { font-size: 0.76rem; padding: 6px 12px; }
}

/* ── 39. SCROLL PILL — Privacy-first ↔ Back to top ──────────────────────── */

/* Topbar pill base: inherits .pill.subtle naturally (yellow-green in dark, purple in light) */
.topbar-privacy-pill {
  cursor: default;
  transition:
    background  0.30s ease,
    border      0.30s ease,
    color       0.24s ease,
    box-shadow  0.30s ease;
}

/* ── Back to workspace: dark mode = neon yellow-green (palette accent) ── */
.topbar-privacy-pill--backtop {
  cursor: pointer;
  user-select: none;
  background: rgba(200, 241, 53, 0.13) !important;
  border:     1px solid rgba(200, 241, 53, 0.72) !important;
  color:      #d8f53a !important;
  animation:  pill-neon-pulse 1.8s ease-in-out infinite;
}

.topbar-privacy-pill--backtop:hover {
  background: rgba(200, 241, 53, 0.22) !important;
  color:      #eaff6a !important;
}

@keyframes pill-neon-pulse {
  0%, 100% {
    box-shadow:
      0 0  6px rgba(200, 241, 53, 0.65),
      0 0 18px rgba(200, 241, 53, 0.26);
  }
  50% {
    box-shadow:
      0 0 10px rgba(218, 255, 60, 0.95),
      0 0 28px rgba(200, 241, 53, 0.58),
      0 0 52px rgba(190, 230, 40, 0.22);
  }
}

/* ── Light mode: neon purple instead ── */
[data-theme="light"] .topbar-privacy-pill--backtop {
  background: rgba(110, 30, 200, 0.09) !important;
  border:     1px solid rgba(148, 58, 228, 0.60) !important;
  color:      #7c3aed !important;
  animation:  pill-neon-pulse-light 1.8s ease-in-out infinite;
}

[data-theme="light"] .topbar-privacy-pill--backtop:hover {
  background: rgba(110, 30, 200, 0.18) !important;
  color:      #6d28d9 !important;
}

@keyframes pill-neon-pulse-light {
  0%, 100% {
    box-shadow:
      0 0  5px rgba(148, 58, 228, 0.55),
      0 0 14px rgba(148, 58, 228, 0.20);
  }
  50% {
    box-shadow:
      0 0  9px rgba(148, 58, 228, 0.90),
      0 0 24px rgba(148, 58, 228, 0.45),
      0 0 44px rgba(120, 40, 210, 0.18);
  }
}

@media (max-width: 480px) {
  .topbar-privacy-pill { display: none; }
}

/* ── 40. PRINT STYLES ───────────────────────────────────────────────────── */

/* ── MOBILE PERFORMANCE & OVERFLOW FIX ─────────────────────────────────── */
html { overflow-x: hidden; }

@media (max-width: 780px) {
  /* Kill expensive animations on mobile */
  .ambient { animation: none !important; display: none; }
  /* Reduce heavy blur on panels */
  .panel {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  /* Contain horizontal overflow */
  .page-shell { overflow-x: hidden; }
}

@media (max-width: 480px) {
  /* No blur at all on very small screens */
  .panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body::after { display: none; }
}

@media print {
  .topbar, .hero-splash, .analyzer-grid, .results-nav,
  .actions-row, .status-banner, #skeletonLoader,
  .raw-details summary .raw-chevron, .rnav-export, .btn-theme-toggle,
  .filter-chip, .copy-btn, .findings-filters,
  .ambient, body::after { display: none !important; }

  body {
    background: white !important;
    color: black !important;
    font-size: 12px !important;
  }

  .page-shell { width: 100% !important; padding: 0 !important; }

  .panel {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    background: white !important;
    break-inside: avoid;
  }

  .intel-card { break-inside: avoid; }
  .results-shell { display: block !important; }

  .badge.critical { background: #fee !important; color: #900 !important; }
  .badge.high     { background: #ffd !important; color: #760 !important; }
}

/* ── 40. PANEL ROLE CLASSES (referenced by JS, no additional styles needed) */
.findings-panel,
.forensics-panel,
.inference-panel,
.raw-panel,
.summary-panel {
  /* inherits .panel styles — role-specific selectors for JS targeting */
}
