:root {
  --void: #0b0f1a;
  --surface: #131a2a;
  --raised: #1b2a4a;
  --line: #25334f;

  --orange: #ff6a00;
  --orange-soft: #ff8a33;
  --cyan: #00d9ff;
  --cyan-soft: #5fe9ff;

  --ink: #e8ecf4;
  --ink-muted: #7c8aa8;
  --ink-faint: #4a5773;

  --success: #39ff88;
  --warning: #ffc93c;
  --danger: #ff3860;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--void);
  color: var(--ink);
}

body {
  font-family: var(--font-body);
  background-image:
    linear-gradient(rgba(0, 217, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 217, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient breathing glow — two soft radial pools that slowly pulse,
   reinforcing the cyberpunk atmosphere without competing with content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(0, 217, 255, 0.08), transparent 60%),
    radial-gradient(600px circle at 85% 90%, rgba(255, 106, 0, 0.07), transparent 60%);
  animation: breathe 8s ease-in-out infinite;
}

.page {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

/* ---------- Real Movmentum site-header (namespaced tokens) ---------- */
:root {
  --mm-bg: #07111f;
  --mm-panel: #101c31;
  --mm-text: #f4f7fb;
  --mm-muted: #92a1b8;
  --mm-accent: #4cc9f0;
  --mm-accent-2: #7c4dff;
  --mm-border: rgba(255, 255, 255, 0.12);
}

.site-header {
  border-bottom: 1px solid transparent;
  background: transparent;
  backdrop-filter: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  transition: background 250ms ease, border-color 250ms ease, backdrop-filter 250ms ease, box-shadow 250ms ease;
  font-family: "Rajdhani", "Segoe UI", Roboto, Arial, sans-serif;
}

.site-header.scrolled {
  background: rgba(16, 28, 49, 0.68);
  border-bottom: 1px solid var(--mm-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand { display: flex; align-items: center; text-decoration: none; color: var(--mm-text); }

.logo-wrap {
  position: relative;
  display: block;
  height: 40px;
  width: 99px;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 480ms cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 40px;
  width: auto;
  max-width: none;
  transition: opacity 340ms ease;
}

.brand-logo-icon { opacity: 1; }
.brand-logo-full { opacity: 0; }

.site-header.scrolled .logo-wrap { width: 170px; }
.site-header.scrolled .brand-logo-icon { opacity: 0; }
.site-header.scrolled .brand-logo-full { opacity: 1; }

.site-nav { display: flex; align-items: center; gap: 24px; }

.site-nav a {
  color: var(--mm-muted);
  text-decoration: none;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color 180ms ease;
}

.site-nav a:hover { color: var(--mm-text); }
.site-nav a.nav-link-active { color: var(--mm-text) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--mm-text);
  border-radius: 2px;
  transition: transform 220ms ease, opacity 220ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 10px);
  right: 16px;
  width: 190px;
  max-width: 62vw;
  max-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(16, 28, 49, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--mm-border);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: max-height 320ms ease, opacity 240ms ease;
  z-index: 60;
}

.nav-dropdown a {
  color: var(--mm-muted);
  text-decoration: none;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  padding: 14px 18px;
  border-top: 1px solid var(--mm-border);
  transition: color 180ms ease, background 180ms ease;
}

.nav-dropdown a:first-child { border-top: none; }
.nav-dropdown a:hover { color: var(--mm-text); background: rgba(255, 255, 255, 0.06); }
.nav-dropdown a.nav-link-active { color: var(--mm-accent); }
.nav-dropdown.open { max-height: 220px; opacity: 1; }

@media (max-width: 640px) {
  .site-header-inner { padding: 14px 16px; }
  .logo-wrap { height: 32px; width: 79px; }
  .brand-logo { height: 32px; }
  .site-header.scrolled .logo-wrap { width: 136px; }
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .nav-dropdown { display: flex; }
}

/* ---------- Site footer (Movmentum shell) ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin: 0;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.accent-orange {
  color: var(--orange);
}

.headline .accent-orange {
  display: inline-block;
  animation: glitchIn 0.9s steps(6) 0.2s both;
}

@keyframes glitchIn {
  0% {
    opacity: 0;
    text-shadow: 2px 0 var(--cyan), -2px 0 var(--orange);
    transform: translateX(-2px);
  }
  30% {
    opacity: 1;
    text-shadow: -2px 0 var(--cyan), 2px 0 var(--orange);
    transform: translateX(2px);
  }
  55% {
    text-shadow: 2px 0 var(--orange), -2px 0 var(--cyan);
    transform: translateX(-1px);
  }
  80% {
    text-shadow: none;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    text-shadow: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .headline .accent-orange {
    animation: none;
  }
}

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

.subhead {
  color: var(--ink-muted);
  margin-top: 1rem;
  line-height: 1.5;
}

/* ---------- Session info (this run's date/time) ---------- */
.session-info {
  max-width: 640px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.session-info .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  flex-shrink: 0;
}

.session-info .session-id {
  color: var(--cyan-soft);
}

/* ---------- Upload console (signature element) ---------- */
.console-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.console-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, 0.35);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(19, 26, 42, 0.9), rgba(11, 15, 26, 0.9));
  padding: 3rem 2rem;
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.console-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 217, 255, 0.06) 45%,
    rgba(0, 217, 255, 0.12) 50%,
    rgba(0, 217, 255, 0.06) 55%,
    transparent 100%
  );
  height: 200%;
  animation: scan 4.5s linear infinite;
}

.console-frame:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.console-frame.idle-pulse {
  animation: idlePulse 3.2s ease-in-out infinite;
}

.console-frame.dragging {
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 217, 255, 0.35);
  animation: none;
}

.console-frame.success {
  box-shadow: 0 0 24px rgba(255, 106, 0, 0.35);
  animation: none;
}

.console-frame.error {
  border-color: rgba(255, 56, 96, 0.5);
  box-shadow: 0 0 24px rgba(255, 56, 96, 0.3);
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .console-frame.idle-pulse {
    animation: none;
  }
}

.console-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon.status-idle svg#iconUpload {
  color: var(--cyan);
}

.status-icon.status-success svg#iconSuccess {
  color: var(--success);
}

.status-icon.status-error svg#iconError {
  color: var(--danger);
}

.file-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0;
}

.file-hint {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ---------- Terminal log ---------- */
.terminal-log {
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: rgba(19, 26, 42, 0.7);
  border-radius: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  min-height: 3rem;
}

.terminal-log p {
  margin: 0.15rem 0;
}

.log-idle {
  color: var(--ink-faint);
}

.log-info {
  color: var(--ink-muted);
}

.log-success {
  color: var(--success);
}

.log-warning {
  color: var(--warning);
}

.log-error {
  color: var(--danger);
}

.caret::after {
  content: "_";
  animation: blink 1s step-start infinite;
  color: var(--orange);
}

/* ---------- Preview section ---------- */
.preview-section {
  max-width: 980px;
  margin: 3rem auto 0;
}

.preview-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.6);
}

.preview-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}

.sheet-panel {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(19, 26, 42, 0.6);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.sheet-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(27, 42, 74, 0.4);
}

.sheet-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cyan);
  margin-right: 0.5rem;
}

.sheet-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.sheet-rowcount {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--orange);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(37, 51, 79, 0.6);
  color: var(--ink-muted);
  white-space: nowrap;
}

tbody tr:nth-child(odd) {
  background: rgba(11, 15, 26, 0.4);
}

.preview-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ---- Platform picker ---- */
.platform-picker {
  margin-bottom: 1.5rem;
}

.platform-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}

.platform-heading strong {
  color: var(--cyan);
  font-weight: 600;
}

.platform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.platform-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: rgba(19, 26, 42, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.platform-chip:hover {
  border-color: rgba(0, 217, 255, 0.5);
  color: var(--ink);
}

.platform-chip.active {
  border-color: rgba(255, 106, 0, 0.6);
  color: var(--orange);
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.25);
}

.platform-mismatch {
  margin-top: 0.85rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 201, 60, 0.35);
  border-radius: 0.5rem;
  background: rgba(255, 201, 60, 0.06);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--warning);
}

.platform-mismatch strong {
  color: var(--ink);
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(19, 26, 42, 0.4);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.filter-group select {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
  background: rgba(11, 15, 26, 0.7);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  padding: 0.4rem 0.6rem;
  min-width: 140px;
  max-width: 180px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filter-group select:hover:not(:disabled) {
  border-color: rgba(0, 217, 255, 0.45);
}

.filter-group select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.filter-clear-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.filter-clear-btn:hover {
  border-color: rgba(255, 56, 96, 0.5);
  color: var(--danger);
}

.filter-summary {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  margin-left: auto;
  white-space: nowrap;
}

/* ---------- Dashboard (Phase 1) ---------- */
.dashboard-section {
  max-width: 1080px;
  margin: 3rem auto 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(19, 26, 42, 0.75), rgba(11, 15, 26, 0.75));
  padding: 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease-out forwards;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 217, 255, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 217, 255, 0.12);
}

.dashboard-grid .card:nth-child(1) {
  animation-delay: 0.05s;
}
.dashboard-grid .card:nth-child(2) {
  animation-delay: 0.18s;
}
.dashboard-grid .card:nth-child(3) {
  animation-delay: 0.31s;
}
.theme-card {
  animation-delay: 0.42s;
}
.focus-card {
  animation-delay: 0.56s;
}
.suggestions-card {
  animation-delay: 0.68s;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .card:hover {
    transform: none;
  }
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
}

/* ---- Gauge ---- */
.gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 240px;
}

.gauge-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.gauge-band {
  stroke-linecap: butt;
  opacity: 0.9;
}

.gauge-band-red {
  stroke: var(--danger);
}

.gauge-band-amber {
  stroke: var(--warning);
}

.gauge-band-green {
  stroke: var(--success);
}

.gauge-needle {
  stroke: var(--orange);
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 106, 0, 0.8));
  transform-origin: 120px 130px;
  transform: rotate(90deg);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge-hub {
  fill: var(--void);
  stroke: var(--orange);
  stroke-width: 2.5;
}

.gauge-readout {
  margin-top: -1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.gauge-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
}

.gauge-rating {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.gauge-rating.rating-good {
  color: var(--success);
  border-color: rgba(57, 255, 136, 0.4);
}

.gauge-rating.rating-ok {
  color: var(--warning);
  border-color: rgba(255, 201, 60, 0.4);
}

.gauge-rating.rating-bad {
  color: var(--danger);
  border-color: rgba(255, 56, 96, 0.4);
}

.gauge-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 1rem;
  line-height: 1.5;
}

/* ---- Bar chart (content type) ---- */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bar-row-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.bar-row-label {
  color: var(--ink);
}

.bar-row-value {
  color: var(--cyan);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 51, 79, 0.6);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-dim, #0a4a57), var(--cyan));
  width: 0%;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-row-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
}

/* ---- Leaderboard (contributors) ---- */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.leader-row {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.leader-rank {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-align: center;
}

.leader-row.rank-1 .leader-rank {
  color: var(--orange);
  text-shadow: 0 0 8px rgba(255, 106, 0, 0.6);
}

.leader-main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.leader-name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(37, 51, 79, 0.6);
  overflow: hidden;
}

.leader-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-dim, #7a3b12), var(--orange));
  width: 0%;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.leader-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ---- Content Themes card (topic detection) ---- */
.theme-card {
  margin-top: 1.25rem;
}

.theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.theme-header .card-title {
  margin-bottom: 0;
}

.beta-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(0, 217, 255, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(0, 217, 255, 0.06);
  white-space: nowrap;
}

.theme-note {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--ink-faint);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 2rem 0 1rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.analysis-grid .card {
  animation-delay: 0.44s;
}

@media (max-width: 860px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Next Quarter Focus card ---- */
.focus-card {
  margin-top: 1.25rem;
}

.focus-block {
  margin-bottom: 1rem;
}

.focus-block:last-child {
  margin-bottom: 0;
}

.focus-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.4rem;
}

.focus-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

/* ---- Suggestions card (locked/premium) ---- */
.suggestions-card {
  margin-top: 1.25rem;
}

.suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.suggestions-header .card-title {
  margin-bottom: 0;
}

.premium-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--orange);
  border: 1px solid rgba(255, 106, 0, 0.4);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 106, 0, 0.08);
}

.suggestions-locked {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  background: rgba(11, 15, 26, 0.4);
}

.suggestions-locked p {
  margin: 0 0 1rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
  line-height: 1.6;
}

.unlock-btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--void);
  background: linear-gradient(90deg, var(--orange), var(--orange-soft, #ff8a33));
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 106, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.unlock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(255, 106, 0, 0.45);
}

.suggestions-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.suggestion-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(19, 26, 42, 0.5);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.4s ease-out forwards;
}

.suggestion-item:nth-child(1) { animation-delay: 0.03s; }
.suggestion-item:nth-child(2) { animation-delay: 0.11s; }
.suggestion-item:nth-child(3) { animation-delay: 0.19s; }
.suggestion-item:nth-child(4) { animation-delay: 0.27s; }
.suggestion-item:nth-child(5) { animation-delay: 0.35s; }
.suggestion-item:nth-child(6) { animation-delay: 0.43s; }

@media (prefers-reduced-motion: reduce) {
  .suggestion-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.suggestion-index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 217, 255, 0.5);
}

.suggestion-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.suggestion-text {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
}

.suggestions-footnote {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--ink-faint);
}

.empty-state {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- Scan progress bar ---------- */
.scan-progress {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scan-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(37, 51, 79, 0.6);
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  box-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
  transition: width 0.15s linear;
}

.scan-progress-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.sheet-footnote {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  padding: 0.6rem 1rem;
  margin: 0;
  border-top: 1px solid var(--line);
}

/* ---------- History & comparison (Phase 4) ---------- */
.history-section {
  max-width: 1080px;
  margin: 3rem auto 0;
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.history-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin: 0.35rem 0 0;
  max-width: 480px;
  line-height: 1.5;
}

.history-clear {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.history-clear:hover {
  border-color: rgba(255, 56, 96, 0.5);
  color: var(--danger);
}

.history-list {
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(19, 26, 42, 0.5);
}

.history-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.history-remove:hover {
  border-color: rgba(255, 56, 96, 0.6);
  color: var(--danger);
}

.history-compare {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .history-compare {
    grid-template-columns: 1fr;
  }
}

.trend-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
}

.trend-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.trend-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(0, 217, 255, 0.6));
}

.trend-point {
  fill: var(--orange);
  stroke: var(--void);
  stroke-width: 1.5;
}

.trend-axis-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  fill: var(--ink-faint);
}

.trend-value-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: var(--cyan-soft, var(--cyan));
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--void);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--raised);
}

/* ---------- Animations ---------- */
@keyframes scan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

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

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

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

@keyframes idlePulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(0, 217, 255, 0);
    border-color: rgba(0, 217, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 217, 255, 0.22);
    border-color: rgba(0, 217, 255, 0.55);
  }
}

@keyframes cardGlow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(0, 217, 255, 0);
  }
  50% {
    box-shadow: 0 0 14px rgba(0, 217, 255, 0.12);
  }
}

.fade-up {
  animation: fadeUp 0.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .console-frame::before,
  .caret::after {
    animation: none;
  }
}