/* clean design system */

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


html, body { height: 100%; overflow: hidden; }
body.upload-active { overflow: auto; } /* Allow scroll on upload/landing screen */

/* ─── Design Tokens — Industrial Skeuomorphism ─── */
:root {
  /* ── Core palette ── */
  --background:    #e0e5ec;   /* Chassis — base surface */
  --foreground:    #f0f2f5;   /* Raised panel */
  --muted:         #d1d9e6;   /* Recessed wells */
  --text:          #2d3436;
  --text-muted:    #4a5568;
  --accent:        #ff4757;   /* Safety-red — use sparingly */
  --accent-fg:     #ffffff;
  --border-shadow: #babecc;   /* Dark half of neumorphic shadow */
  --border-light:  #ffffff;   /* Light half */
  --border-dark:   #a3b1c6;

  /* ── Neumorphic shadows ── */
  --shadow-card:     8px 8px 16px #babecc, -8px -8px 16px #ffffff;
  --shadow-floating: 12px 12px 24px #babecc, -12px -12px 24px #ffffff, inset 1px 1px 0 rgba(255,255,255,0.5);
  --shadow-pressed:  inset 6px 6px 12px #babecc, inset -6px -6px 12px #ffffff;
  --shadow-recessed: inset 4px 4px 8px #babecc, inset -4px -4px 8px #ffffff;
  --shadow-glow:     0 0 10px 2px rgba(255,71,87,0.6);

  /* legacy aliases */
  --accent-light:  #ff6b81;
  --accent-dim:    rgba(255, 71, 87, 0.22);
  --accent-faint:  rgba(255, 71, 87, 0.07);

  --gold:        var(--accent);
  --gold-light:  var(--accent-light);
  --gold-dim:    var(--accent-dim);
  --gold-glow:   var(--accent-dim);
  --gold-faint:  var(--accent-faint);

  /* ── Surface aliases ── */
  --obsidian:      var(--background);
  --charcoal:      var(--foreground);
  --charcoal-mid:  #e8ecf1;
  --midnight:      #d5dbe3;
  --cream:         var(--text);
  --pewter:        var(--text-muted);

  --bg:    var(--background);
  --bg2:   var(--foreground);
  --bg3:   var(--charcoal-mid);
  --border:  rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.14);
  --text2: #64748b;
  --text3: var(--text-muted);

  /* ── Status colors ── */
  --correct:       #22c55e;
  --incorrect:     #ef4444;
  --unattempted:   #64748b;
  --unat-chart:    #d1d9e6;

  /* ── Radii ── */
  --radius:    8px;
  --radius-lg: 14px;

  /* ── Typography ── */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* shadow aliases */
  --neon-sm:  var(--shadow-card);
  --neon:     var(--shadow-card);
  --neon-lg:  var(--shadow-floating);
  --neon-mag: none;
  --neon-cya: none;

  --ph:    var(--accent);
  --phb:   #e8384f;
}

/* light theme */
[data-theme="light"] {
  --obsidian:     var(--background);
  --charcoal:     var(--foreground);
  --charcoal-mid: #e8ecf1;
  --cream:        var(--text);
  --pewter:       var(--text-muted);
  --bg:    var(--background);
  --bg2:   var(--foreground);
  --bg3:   var(--charcoal-mid);
  --text2: #64748b;
  --text3: var(--text-muted);
  --border:  rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.14);
  --correct:    #16a34a;
  --incorrect:  #dc2626;
  --unat-chart: #d1d9e6;
  --gold-dim:   rgba(255, 71, 87, 0.2);
  --gold-faint: rgba(255, 71, 87, 0.07);
  --gold:       var(--accent);
}

html[data-theme="light"] body {
  background: var(--bg);
}

[data-theme="light"] .q-img-placeholder { background: #e0e5ec; color: var(--pewter); }
[data-theme="light"] .cmd-box,
[data-theme="light"] .mismatch-box { box-shadow: var(--shadow-floating); }

/* dark theme */
[data-theme="dark"] {
  --background:    #1a1d23;
  --foreground:    #22262e;
  --muted:         #2a2f38;
  --text:          #e2e8f0;
  --text-muted:    #94a3b8;

  --border-shadow: #111318;
  --border-light:  #2e3340;
  --border-dark:   #111318;

  --shadow-card:     6px 6px 14px #111318, -6px -6px 14px #2e3340;
  --shadow-floating: 10px 10px 20px #111318, -10px -10px 20px #2e3340, inset 1px 1px 0 rgba(255,255,255,0.04);
  --shadow-pressed:  inset 5px 5px 10px #111318, inset -5px -5px 10px #2e3340;
  --shadow-recessed: inset 3px 3px 6px #111318, inset -3px -3px 6px #2e3340;

  --obsidian:      #1a1d23;
  --charcoal:      #22262e;
  --charcoal-mid:  #2a2f38;
  --midnight:      #1e2128;
  --cream:         #e2e8f0;
  --pewter:        #94a3b8;

  --bg:    #1a1d23;
  --bg2:   #22262e;
  --bg3:   #2a2f38;
  --border:  rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.14);
  --text2: #94a3b8;
  --text3: #64748b;

  --correct:       #4ade80;
  --incorrect:     #f87171;
  --unattempted:   #64748b;
  --unat-chart:    #2a2f38;

  --accent-dim:    rgba(255, 71, 87, 0.28);
  --accent-faint:  rgba(255, 71, 87, 0.10);
  --gold-dim:      rgba(255, 71, 87, 0.28);
  --gold-faint:    rgba(255, 71, 87, 0.10);
}

html[data-theme="dark"] body {
  background: #1a1d23;
}

[data-theme="dark"] .q-img-placeholder { background: #1a1d23; color: var(--pewter); }
[data-theme="dark"] .cmd-box,
[data-theme="dark"] .mismatch-box { box-shadow: var(--shadow-floating); }
[data-theme="dark"] .upload-zone { background: #22262e; }
[data-theme="dark"] .upload-zone:hover { background: #2a2f38; }
[data-theme="dark"] .about-avatar { background: #2a2f38; }
[data-theme="dark"] .mode-btn { background: #22262e; }
[data-theme="dark"] .mode-btn.active { background: var(--accent-faint); }
[data-theme="dark"] .device__bezel { background: #0e1015; border-color: #1a1d23; }
[data-theme="dark"] .device__screen { background: #0a0c10; }
[data-theme="dark"] .neu-testimonial { background: #22262e; }
[data-theme="dark"] .step__node { background: #22262e; }
[data-theme="dark"] .score-tab { color: #94a3b8; }
[data-theme="dark"] .score-tab.active { color: var(--accent); }
[data-theme="dark"] .q-table th { background: #2a2f38; }
[data-theme="dark"] .q-table tbody tr:nth-child(even) { background: #252930; }
[data-theme="dark"] .modal-side-btn { background: #22262e; }
[data-theme="dark"] .modal-side-btn:hover { background: #2a2f38; }
[data-theme="dark"] .q-detail-close:hover { background: #2a2f38; }
[data-theme="dark"] .filter-chip { border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .filter-chip:hover { background: #2a2f38; border-color: rgba(255,255,255,0.18); }
[data-theme="dark"] .mismatch-overlay .mismatch-box { background: #22262e; }
[data-theme="dark"] .loading-overlay { background: rgba(26,29,35,.95); }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #1a1d23; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,71,87,0.35); }


/* animations */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}


/* base */
body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--text);

  transition: background .35s, color .35s;
  position: relative;
}

/* SVG noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  mix-blend-mode: soft-light;
  will-change: opacity;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

input, button, select { font-family: var(--font-body); }

/* Scrollbar */
::-webkit-scrollbar              { width: 4px; height: 4px; }
::-webkit-scrollbar-track        { background: var(--obsidian); }
::-webkit-scrollbar-thumb        { background: var(--accent-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover  { background: var(--accent); }

/* Selection */
::selection { background: var(--accent-dim); color: var(--accent-light); }


/* theme toggle button */
.theme-toggle-btn {
  background: var(--charcoal);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0 12px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  border-radius: var(--radius);
}
.theme-toggle-btn:hover {
  background: var(--charcoal-mid);
  border-color: var(--border2);
  color: var(--text);
}
#uploadThemeBtn { position: fixed; top: 1rem; right: 1rem; z-index: 110; }

/* Sun/moon icon visibility — light mode: show moon (to switch to dark), dark mode: show sun (to switch to light) */
.theme-icon-sun  { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun  { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

.theme-toggle-btn svg { transition: transform .3s ease; }
.theme-toggle-btn:hover svg { transform: rotate(20deg); }


/* upload screen */
.upload-screen {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}
.upload-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  max-width: 1100px;
  width: 100%;
  gap: 1.5rem;
  align-items: stretch;
}
.upload-left, .upload-right {
  background: var(--charcoal);
  border: 1px solid var(--border);
  padding: 2.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  transition: background .35s, border-color .35s;
  border-radius: var(--radius-lg);
}
.upload-left:hover, .upload-right:hover {
  border-color: var(--border2);
}
.upload-right { align-items: center; justify-content: center; text-align: center; padding: 2.5rem 2rem; }

/* Brand */
.brand-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--text);
  margin-bottom: .4rem;
}
.brand-sub { font-size: 13px; color: var(--pewter); line-height: 1.75; max-width: 500px; }

/* Separator */
.deco-rule { display: flex; align-items: center; gap: .75rem; margin: .5rem 0; }
.deco-rule::before, .deco-rule::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.deco-rule span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--pewter); font-weight: 600; white-space: nowrap; }

/* Mode selector */
.mode-selector { width: 100%; }
.mode-selector-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text2);
  font-weight: 600;
  margin-bottom: .875rem;
}
.mode-btns { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mode-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  padding: .875rem 1rem;
  cursor: pointer;
  transition: all .15s;
  color: var(--pewter);
  text-align: center;
  font-family: var(--font-body);
}
.mode-btn:last-child { border-right: none; }
.mode-btn-title { display: block; font-size: 20px; font-weight: 700; line-height: 1; margin-bottom: .3rem; color: inherit; }
.mode-btn-sub   { display: block; font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: inherit; opacity: .7; }
.mode-btn:hover:not(.active) { background: var(--charcoal-mid); color: var(--text); }
.mode-btn.active { background: var(--accent-faint); color: var(--accent-light); }
.mode-btn.active .mode-btn-title { color: var(--accent-light); }

/* Upload zone */
.upload-zone {
  width: 100%;
  border: 1.5px dashed var(--border);
  padding: 3rem 2rem;
  cursor: pointer;
  transition: all .2s;
  background: transparent;
  text-align: center;
  position: relative;
  border-radius: var(--radius);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-faint); }
.upload-zone .drag-preview { display: none; font-size: 12px; color: var(--accent-light); margin-top: .5rem; font-weight: 600; }
.upload-zone.drag .drag-preview { display: block; }
.upload-icon  { width: 40px; height: 40px; margin: 0 auto 1.25rem; color: var(--accent); opacity: .7; }
.upload-title { font-size: 14px; font-weight: 600; margin-bottom: .5rem; color: var(--text); letter-spacing: .01em; }
.upload-sub   { font-size: 13px; color: var(--pewter); margin-bottom: 1.5rem; line-height: 1.75; }


/* restore session banner */
#restoreBanner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 150;
  background: var(--charcoal);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .875rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.restore-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-light);
  padding: 2px 10px;
  border: 1px solid var(--accent-dim);
  background: var(--accent-faint);
  white-space: nowrap;
  border-radius: 4px;
}
.restore-info { flex: 1; font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.restore-btns { display: flex; gap: .5rem; flex-shrink: 0; }


/* buttons */

/* ── Shared base ── */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 12px;
  transition: all 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Focus ring — all variants */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── PRIMARY ── */
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 4px 4px 8px rgba(166,50,60,0.4), -4px -4px 8px rgba(255,100,110,0.4);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 5px 5px 10px rgba(166,50,60,0.5), -5px -5px 10px rgba(255,100,110,0.5);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-pressed);
  filter: brightness(0.95);
}

/* ── SECONDARY ── */
.btn-secondary {
  background: var(--background);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-card);
}
.btn-secondary:hover {
  color: var(--accent);
  filter: brightness(1.1);
  box-shadow: var(--shadow-floating);
}
.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-pressed);
}

/* ── GHOST ── */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  box-shadow: none;
  min-height: 48px;
}
.btn-ghost:hover {
  background: var(--muted);
  box-shadow: var(--shadow-recessed);
  filter: brightness(1.1);
  color: var(--text);
}
.btn-ghost:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-pressed);
}
.btn-ghost.active {
  background: var(--accent-faint);
  border-color: var(--accent-dim);
  color: var(--accent-light);
  box-shadow: var(--shadow-recessed);
}

/* ── FILTER CHIP — compact pill for filter bar ── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 32px;
  padding: .3rem .95rem;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all 150ms ease;
  white-space: nowrap;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip:hover {
  background: var(--muted);
  color: var(--text);
  border-color: var(--border2);
}
.filter-chip:active { transform: scale(.97); }
.filter-chip.active {
  background: var(--accent-faint);
  border-color: var(--accent-dim);
  color: var(--accent-light);
  box-shadow: var(--shadow-recessed);
}

/* ── ICON BUTTON (inherits ghost base) ── */
.btn-icon {
  background: var(--background);
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-card);
  padding: .5rem .85rem;
  min-height: 48px;
  font-weight: 500;
}
.btn-icon:hover {
  filter: brightness(1.1);
  color: var(--text);
  box-shadow: var(--shadow-floating);
}
.btn-icon:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-pressed);
}

/* ── SIZE MODIFIERS ── */
.btn-sm {
  min-height: 36px;
  padding: .4rem 1rem;
  font-size: 11px;
  border-radius: 8px;
}
.btn-md {

  min-height: 48px;
  padding: .75rem 1.75rem;
  font-size: 13px;
  border-radius: 12px;
}
.btn-lg {
  min-height: 56px;
  padding: 1rem 2.25rem;
  font-size: 15px;
  border-radius: 16px;
}


/* about / credit panel */
.about-avatar {
  width: 64px; height: 64px;
  background: var(--accent-faint);
  border: 2px solid var(--accent-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  color: var(--accent-light);
  flex-shrink: 0;
}
.about-avatar span { display: block; }
.about-built { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--pewter); font-weight: 600; margin-bottom: .4rem; }
.about-name    { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: .01em; line-height: 1.2; }
.about-role    { font-size: 12px; color: var(--pewter); margin-top: .3rem; }
.about-college { font-size: 12px; color: var(--pewter); margin-top: .2rem; line-height: 1.6; }
.about-links   { display: flex; flex-direction: column; gap: .5rem; width: 100%; }
.about-link {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .65rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all .15s;
  border-radius: var(--radius);
}
.about-link:hover { border-color: var(--accent-dim); color: var(--accent-light); background: var(--accent-faint); }
.about-note { font-size: 12px; color: var(--pewter); line-height: 1.8; padding: .875rem 1rem; border: 1px solid var(--border); background: var(--charcoal-mid); text-align: left; border-radius: var(--radius); }


/* loading screen */
.loading-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 2rem; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
.step-label { font-size: 14px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text); }
.step-sub { font-size: 13px; color: var(--pewter); margin-top: .2rem; text-align: center; }


/* dashboard */
.dashboard { display: none; flex-direction: column; height: 100vh; overflow: hidden; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal);
  position: relative;
  z-index: 100;
  gap: 1rem;
  transition: background .35s, border-color .35s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: .85rem; min-width: 0; overflow: hidden; }
.topbar-brand {
  font-size: 14px; font-weight: 700;
  letter-spacing: .03em;
  color: var(--text);
  white-space: nowrap;
}
.topbar-file {
  font-size: 12px; color: var(--pewter); background: var(--bg3);
  padding: 3px 10px; border: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; max-width: 180px; white-space: nowrap;
  border-radius: 4px;
}
.topbar-mode {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; background: var(--accent-faint); color: var(--accent-light);
  border: 1px solid var(--accent-dim); flex-shrink: 0;
  border-radius: 4px;
}
.topbar-actions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }

/* Compact buttons inside topbar */
.topbar-actions .btn-ghost,
.topbar-actions .btn-icon,
.topbar-actions .export-btn {
  min-height: 36px;
  padding: .3rem .75rem;
  font-size: 11px;
  border-radius: 8px;
}

/* Hamburger (mobile only) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 5px 4px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s;
  border-radius: 4px;
}
.hamburger-btn:hover { background: var(--charcoal-mid); }
.hamburger-btn span  { display: block; width: 18px; height: 1.5px; background: var(--text2); transition: all .3s; }

/* Main layout */
.main-layout { display: grid; grid-template-columns: 1fr; height: calc(100vh - 53px); overflow: hidden; }

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--charcoal);
  overflow-y: auto;


  transition: background .35s, border-color .35s;
}
.sidebar-inner  { padding: 1.25rem 1rem; }
.subject-group  { margin-bottom: 1.75rem; }
.subject-label  {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text2); margin-bottom: .75rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* Sidebar overlay (mobile) */
#sidebarOverlay { display: none; position: fixed; inset: 0; top: 53px; background: rgba(0, 0, 0, .7); z-index: 89; }
#sidebarOverlay.open { display: block; }

/* Question grid buttons */
.q-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.q-btn {
  height: 32px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  border-radius: 4px;
  transition: transform .1s;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
}
.q-btn:hover  { transform: scale(1.05); }
.q-btn:active { transform: scale(.95); }
.q-btn.correct    { background: rgba(34,197,94,.1);   border-color: rgba(34,197,94,.4);  color: #4ade80; }
.q-btn.incorrect  { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.4);  color: #f87171; }
.q-btn.unattempted{ background: transparent;           border-color: var(--border);       color: var(--pewter); }
.q-btn.active { border-color: var(--accent) !important; background: var(--accent-faint) !important; color: var(--accent-light) !important; }

/* Content area */
.content        { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.content-inner  { padding: 1.5rem; max-width: 1000px; margin: 0 auto; overflow-x: hidden; }


.metrics-grid > *,
.chart-grid > *,
.subject-charts-grid > * { min-width: 0; }


/* metric cards + tooltips */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}
.metric-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  border-radius: var(--radius);
}
.metric-card:hover { border-color: var(--border2); box-shadow: 0 4px 16px rgba(0,0,0,.2); transform: translateY(-2px); }

/* CSS tooltip via data-tooltip attribute */
.metric-card[data-tooltip] { overflow: visible; }
.metric-card[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal-mid);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px; font-weight: 500;
  padding: 5px 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.metric-val { font-size: 30px; font-weight: 700; line-height: 1; margin-bottom: .5rem; }
.metric-lbl { font-size: 10px; color: var(--pewter); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.mv-blue  { color: #60a5fa; }
.mv-green { color: #4ade80; }
.mv-red   { color: #f87171; }
.mv-amber { color: var(--accent-light); }


/* chart cards */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.chart-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  padding: 1.5rem;
  position: relative;
  transition: background .35s, border-color .2s;
  border-radius: var(--radius);
}
.chart-card:hover { border-color: var(--border2); }
.chart-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text2); margin-bottom: 1.25rem; }
.donut-wrap   { position: relative; height: 160px; display: flex; align-items: center; justify-content: center; }
.donut-center { position: absolute; text-align: center; pointer-events: none; }
.donut-pct    { font-size: 24px; font-weight: 700; color: var(--accent-light); }
.donut-sub    { font-size: 10px; color: var(--pewter); text-transform: uppercase; letter-spacing: .1em; }

.bar-row    { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar-rowlbl { font-size: 10px; min-width: 70px; color: var(--text2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bar-track  { flex: 1; height: 4px; background: var(--border); overflow: hidden; border-radius: 2px; }
.bar-fill   { height: 100%; transition: width .7s cubic-bezier(.4, 0, .2, 1); border-radius: 2px; }
.bar-pct    { font-size: 12px; min-width: 36px; text-align: right; font-weight: 600; color: var(--text2); }

/* Subject accuracy charts grid */
.subject-charts-grid {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.subject-charts-grid .donut-wrap { height: 130px; }
.subject-charts-grid .donut-pct  { font-size: 18px; }

/* Filter bar */
.filter-bar { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.filter-group { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }


/* ui change: tabbed score card */
.score-tabs-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Tab header row */
.score-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal-mid);
}
.score-tab {
  flex: 1;
  padding: .875rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--pewter);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.score-tab:hover { color: var(--text); }
.score-tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
  background: var(--charcoal);
}

/* Tab panels */
.score-tab-panel {
  display: none;
  padding: 1.5rem;
}
.score-tab-panel.active {
  display: block;
}

/* ── Arc Gauge (semicircular speedometer) ── */
.arc-gauge-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  max-width: 260px;
  aspect-ratio: 200 / 120;
}
.arc-gauge {
  width: 100%;
  height: auto;
  overflow: visible;
}
.arc-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 12;
  stroke-linecap: round;
}
.arc-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;

}
.arc-tick {
  fill: var(--pewter);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  text-anchor: middle;
}
.arc-tick-mid {
  font-weight: 700;
  fill: var(--text2);
}

/* Score centered inside the arc */
.arc-score-center {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.arc-score-val {
  display: block;
  font-size: 38px;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  font-family: var(--font-display);
}
.arc-score-max {
  display: block;
  font-size: 13px;
  color: var(--pewter);
  font-weight: 600;
  margin-top: 2px;
}

/* 3 stat pills below gauge */
.arc-stat-pills {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.arc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .4rem .9rem;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  border: 1px solid;
}
.arc-pill--correct {
  color: var(--correct);
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.25);
}
.arc-pill--incorrect {
  color: var(--incorrect);
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
}
.arc-pill--accuracy {
  color: var(--accent-light);
  background: var(--accent-faint);
  border-color: var(--accent-dim);
}
.arc-pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Subject-wise Score Rows (Tab 2) ── */
.subject-score-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.subject-score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background .15s;
}
.subject-score-row:last-child { border-bottom: none; }
.subject-score-row:hover { background: var(--charcoal-mid); }

/* Subject color borders — CSS variables only */
.subject-score-row[data-subject="Physics"]     { border-left-color: var(--correct); }
.subject-score-row[data-subject="Chemistry"]   { border-left-color: #c084fc; }
.subject-score-row[data-subject="Mathematics"] { border-left-color: var(--accent); }
.subject-score-row[data-subject="Biology"]     { border-left-color: var(--accent); }

.subject-score-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.subject-score-earned {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1;
}
.subject-score-max {
  font-size: 14px;
  color: var(--pewter);
  font-weight: 500;
}


/* ui change: question table */
.q-table-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  max-height: 50vh;
  overflow-y: auto;
}
.q-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.q-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
.q-table th {
  background: var(--charcoal-mid);
  padding: .65rem .75rem;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.q-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.q-table tbody tr {
  cursor: pointer;
  transition: background .12s;
}
.q-table tbody tr:nth-child(even) {
  background: var(--bg3);
}
.q-table tbody tr:nth-child(odd) {
  background: var(--bg);
}
.q-table tbody tr:hover {
  background: var(--accent-faint);
}
.q-table tbody tr.q-table-active {
  background: var(--accent-faint);
  outline: 1px solid var(--accent-dim);
  outline-offset: -1px;
}

/* Table status icons */
.q-table-status {
  font-weight: 700;
  font-size: 14px;
}
.q-table-status--correct    { color: var(--correct); }
.q-table-status--incorrect  { color: var(--incorrect); }
.q-table-status--unattempted{ color: var(--pewter); }

/* Table marks cell */
.q-table-marks {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12px;
}
.q-table-marks--pos  { color: var(--correct); }
.q-table-marks--zero { color: var(--pewter); }

/* Table preview thumbnail */
.q-table-thumb {
  width: 40px; height: 28px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--obsidian);
  display: block;
}
.q-table-no-thumb {
  width: 40px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--obsidian);
  color: var(--pewter);
  font-size: 10px;
}


/* question viewer */
.q-viewer {
  background: var(--charcoal);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  transition: background .35s, border-color .35s;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
}
.q-header { display: flex; align-items: center; gap: .75rem; padding: .875rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--charcoal-mid); flex-shrink: 0; }
.q-num { font-size: 13px; font-weight: 600; color: var(--text); }
.q-badge { font-size: 10px; padding: 2px 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; border-radius: 4px; }
.badge-correct     { background: rgba(34,197,94,.1);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.badge-incorrect   { background: rgba(239,68,68,.1);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.badge-unattempted { background: var(--charcoal-mid); color: var(--pewter); border: 1px solid var(--border); }
.marks-pill { font-size: 12px; padding: 2px 8px; font-weight: 600; margin-left: auto; border-radius: 4px; }
.marks-pos  { background: rgba(34,197,94,.1);  color: #4ade80;      border: 1px solid rgba(34,197,94,.25); }
.marks-zero { background: var(--charcoal-mid); color: var(--pewter); border: 1px solid var(--border); }

.q-body { flex: 1; overflow-y: auto; min-height: 0; }
.q-img-area { background: var(--obsidian); display: flex; align-items: flex-start; justify-content: center; border-bottom: 1px solid var(--border); overflow: hidden; }
.q-img-area img { max-width: 100%; display: block; cursor: zoom-in; transition: opacity .2s; }
.q-img-area > * { max-width: 100%; }
.q-img-area img:hover { opacity: .9; }
.q-img-placeholder { display: flex; align-items: center; justify-content: center; min-height: 180px; width: 100%; color: var(--pewter); font-size: 13px; background: var(--obsidian); flex-direction: column; gap: .75rem; text-align: center; padding: 1.5rem; }

.q-ans-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.ans-cell  { display: flex; align-items: center; gap: .875rem; padding: 1.1rem 1.25rem; }
.ans-cell + .ans-cell { border-left: 1px solid var(--border); }
.ans-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; border-radius: 50%; }
.ans-icon span { display: block; }
.ic { background: rgba(34,197,94,.1);  color: #22c55e; border: 1px solid rgba(34,197,94,.3); }
.iw { background: rgba(239,68,68,.1);  color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.is { background: var(--charcoal-mid); color: var(--pewter); border: 1px solid var(--border); }
.ia { background: var(--accent-faint); color: var(--accent-light); border: 1px solid var(--accent-dim); }
.ans-detail { display: flex; flex-direction: column; gap: .25rem; }
.ans-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--pewter); font-weight: 600; }
.ans-val { font-size: 18px; font-weight: 700; }
.vc { color: #4ade80; }
.vw { color: #f87171; text-decoration: line-through; text-decoration-thickness: 2px; }
.vs { color: var(--pewter); }
.va { color: var(--accent-light); }

.q-footer { display: flex; justify-content: space-between; align-items: center; padding: .875rem 1.25rem; margin-top: auto; flex-shrink: 0; }
.nav-btns  { display: flex; gap: .5rem; }


/* ui change: question detail modal */
.q-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 3rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}
.q-detail-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


.q-detail-wrapper {
  position: relative;
  width: 100%;
  max-width: calc(680px + 10rem);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.q-detail-modal {
  width: 100%;
  max-width: 680px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-floating);
}

.q-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal-mid);
  flex-shrink: 0;
}
.q-detail-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.q-detail-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  transition: all .2s;
  flex-shrink: 0;
}
.q-detail-close:hover {
  background: var(--charcoal);
  border-color: var(--border2);
  color: var(--text);
}

.q-detail-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}


.q-detail-img {
  background: var(--obsidian);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 40vh;
}
.q-detail-img img {
  max-width: 100%;
  display: block;
}

.q-detail-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.q-detail-ans {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.25rem;
}
.q-detail-ans + .q-detail-ans {
  border-left: 1px solid var(--border);
}


.q-detail-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: .875rem 1.25rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--charcoal-mid);
}
.q-detail-counter {
  font-size: 11px;
  color: var(--pewter);
  font-weight: 600;
  letter-spacing: .1em;
}

/* Footer nav buttons — hidden on desktop (side arrows handle it), shown on mobile */
.q-detail-nav-btn {
  display: none;
  min-height: 36px;
  padding: .4rem 1rem;
  font-size: 11px;
  border-radius: 8px;
}


.modal-side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--charcoal);
  color: var(--text);
  border: 1px solid var(--border);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-floating);
  z-index: 410;
  transition: all .2s;
}
.modal-side-btn:hover {
  transform: translateY(-50%) scale(1.08);
  background: var(--charcoal-mid);
  color: var(--accent);
  border-color: var(--border2);
}

.modal-side-prev { left: -3rem; }
.modal-side-next { right: -3rem; }

/* Mobile responsive for modal */
@media (max-width: 800px) {
  .q-detail-overlay { padding: .75rem; }
  .q-detail-modal { max-width: 100%; max-height: 95vh; }
  .q-detail-answers { grid-template-columns: 1fr; }
  .q-detail-ans + .q-detail-ans { border-left: none; border-top: 1px solid var(--border); }
  .q-detail-img { max-height: 30vh; }

  /* MOBILE FIX: move nav arrows inside the modal footer area instead of floating outside */
  .q-detail-wrapper { flex-direction: column; max-width: 100%; }
  .modal-side-btn {
    position: static;
    transform: none;
    width: 40px; height: 40px;
    font-size: 16px;
    flex-shrink: 0;
  }
  .modal-side-btn:hover { transform: scale(1.08); }
  .modal-side-prev,
  .modal-side-next { left: auto; right: auto; }
  /* Reflow: put arrows in a row below the modal */
  .q-detail-wrapper {
    flex-direction: column;
    align-items: center;
    gap: .75rem;
  }
  /* Hide the side buttons, show them in footer row instead */
  .modal-side-prev { order: -1; display: none; }
  .modal-side-next { order: 1; display: none; }
  /* Show a bottom nav row inside the modal footer */
  .q-detail-footer {
    justify-content: space-between;
    gap: .75rem;
  }
  /* MOBILE FIX: show footer prev/next buttons */
  .q-detail-nav-btn {
    display: inline-flex;
  }
}


/* lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightboxImg {
  max-width: 95vw; max-height: 90vh;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 0 50px rgba(0,0,0,.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lightbox-close {
  position: fixed; top: 1.25rem; right: 1.25rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; transition: all .2s; z-index: 501;
  border-radius: 50%;
}
.lightbox-close:hover { background: var(--charcoal-mid); border-color: var(--border2); color: var(--text); }
.lightbox-hint { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--pewter); pointer-events: none; }


/* cmd overlay */
.cmd-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmd-overlay.open { display: flex; }
.cmd-box {
  background: var(--charcoal);
  border: 1px solid var(--border);
  width: 520px; max-width: 92vw;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
  border-radius: var(--radius-lg);
}
.cmd-input {
  width: 100%; border: none; background: transparent;
  padding: 1rem 1.25rem; font-size: 14px;
  color: var(--text); outline: none;
  font-family: var(--font-body);
  caret-color: var(--accent-light);
}
.cmd-input::placeholder { color: var(--pewter); }
.cmd-results   { border-top: 1px solid var(--border); max-height: 360px; overflow-y: auto; }
.cmd-item      { padding: .875rem 1.25rem; cursor: pointer; display: flex; gap: .75rem; align-items: center; border-left: 2px solid transparent; transition: background .1s; }
.cmd-item:hover{ background: var(--charcoal-mid); border-left-color: var(--accent); }
.cmd-item-sub  { font-size: 12px; color: var(--pewter); margin-top: .15rem; }
.cmd-item-badge{ font-size: 10px; padding: 2px 8px; margin-left: auto; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; }
.empty-state   { text-align: center; padding: 3rem 1rem; color: var(--pewter); font-size: 13px; }


/* mismatch popup */
.mismatch-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(10px); z-index: 300; display: none; align-items: center; justify-content: center; }
.mismatch-overlay.open { display: flex; }
.mismatch-box {
  background: var(--charcoal);
  border: 1px solid rgba(239, 68, 68, .35);
  width: 480px; max-width: 92vw;
  padding: 2.75rem;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
  border-radius: var(--radius-lg);
}
.mismatch-icon  { font-size: 22px; margin-bottom: 1rem; display: block; }
.mismatch-title { font-size: 15px; font-weight: 700; color: #ef4444; margin-bottom: .75rem; }
.mismatch-msg   { font-size: 13px; color: var(--pewter); line-height: 1.75; margin-bottom: 1rem; }
.mismatch-badge {
  display: inline-block;
  font-size: 11px; letter-spacing: .06em; font-weight: 600; text-transform: uppercase;
  color: #ef4444;
  padding: .4rem 1rem;
  border: 1px solid rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .05);
  margin-bottom: 1.75rem;
  border-radius: 4px;
}
.mismatch-btns { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Credit card */
.credit-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  padding: .875rem 1.25rem;
  max-width: 480px; width: 100%;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  border-radius: var(--radius);
}
.credit-avatar { width: 42px; height: 42px; background: var(--accent-faint); border: 1px solid var(--accent-dim); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--accent-light); flex-shrink: 0; }
.credit-avatar span { display: block; }
.credit-info    { flex: 1; min-width: 0; text-align: left; }
.credit-madeby  { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--pewter); font-weight: 600; margin-bottom: .2rem; }
.credit-name    { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.credit-college { font-size: 11px; color: var(--text2); margin-top: .2rem; }
.credit-links   { display: flex; gap: .45rem; flex-shrink: 0; }
.credit-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--charcoal-mid); border: 1px solid var(--border);
  color: var(--text2); text-decoration: none; transition: all .15s;
  border-radius: var(--radius);
}
.credit-link:hover { background: var(--accent-faint); border-color: var(--accent-dim); color: var(--accent-light); }


/* share card */
#shareCardEl {
  position: fixed;
  left: -9999px; top: 0;
  width: 600px; height: 330px;
  background: #e0e5ec;
  border: 1px solid rgba(255, 71, 87, .25);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
}


/* card */

/* ── Base card ── */
.neu-card {
  background: var(--background);
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  transition: transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: visible;
}

.neu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

/* ── Elevated variant ── */
.neu-card--elevated {
  box-shadow: var(--shadow-floating);
}
.neu-card--elevated:hover {
  /* Super-elevated: amplify the floating shadow slightly */
  box-shadow: 16px 16px 32px var(--border-shadow), -16px -16px 32px var(--border-light), inset 1px 1px 0 rgba(255,255,255,0.6);
}

/* ── Corner screws (manufacturing DNA) ── */
.neu-card::before,
.neu-card::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

/* Top-left + top-right screws */
.neu-card::before {
  background:
    radial-gradient(circle at 12px 12px,
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px
    ),
    radial-gradient(circle at calc(100% - 12px) 12px,
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px
    );
}

/* Bottom-left + bottom-right screws */
.neu-card::after {
  background:
    radial-gradient(circle at 12px calc(100% - 12px),
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px
    ),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px),
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px
    );
}

/* ── Vent slots (manufacturing DNA) ── */
.neu-card__vents {
  position: absolute;
  top: 14px;
  right: 28px;
  display: flex;
  flex-direction: row;
  gap: 3px;
  z-index: 2;
}

.neu-card__vent {
  width: 3px;
  height: 24px;
  border-radius: 9999px;
  background: var(--muted);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}


/* input */

.neu-input {
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  background: var(--background);
  color: var(--text);
  border: none;
  border-radius: 8px;
  box-shadow: var(--shadow-recessed);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  outline: none;
  transition: box-shadow 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-appearance: none;
  appearance: none;
}

.neu-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* LED-backlight focus ring */
.neu-input:focus-visible {
  box-shadow: var(--shadow-recessed), 0 0 0 2px var(--accent);
}

/* Disabled state */
.neu-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Textarea variant */
textarea.neu-input {
  padding: 16px 24px;
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}


/* led status indicator */

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.led {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.led__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: led-pulse 2s ease-in-out infinite;
}

.led__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

/* Green — ONLINE */
.led--green .led__dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}
.led--green .led__label { color: #22c55e; }

/* Red — ALERT */
.led--red .led__dot {
  background: #ff4757;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.8);
}
.led--red .led__label { color: #ff4757; }

/* Yellow — STANDBY */
.led--yellow .led__dot {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}
.led--yellow .led__label { color: #f59e0b; }

/* Size variants */
.led--sm .led__dot { width: 8px; height: 8px; }
.led--lg .led__dot { width: 12px; height: 12px; }


/* page wrapper / container */

.page-wrap {
  width: 100%;
  min-height: 100vh;
  background: var(--background);
  position: relative;
}

/* Noise texture overlay (matches body::before but scoped) */
.page-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  mix-blend-mode: soft-light;
  will-change: opacity;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

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

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-spacing {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}


/* hero section */

.hero {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 3rem;
  align-items: center;
  padding: 5rem 0 3rem;
}

/* ── Text block ── */
.hero__text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
  text-shadow: 0 1px 1px #ffffff;
}

.hero__sub {
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Device mockup (CSS-only) ── */
.device {
  position: relative;
  width: 100%;
  max-width: 420px;
  justify-self: center;
  transition: transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.device:hover {
  transform: scale(1.02);
}

.device__bezel {
  background: #1a1a2e;
  border: 4px solid #2d3436;
  border-radius: 16px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-floating);
}


.device__bezel::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.3) 2px,
      rgba(0,0,0,0.3) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.15) 2px,
      rgba(0,0,0,0.15) 4px
    );
  background-size: 4px 4px;
}

/* Side hardware buttons */
.device__hw-btn {
  position: absolute;
  right: -8px;
  width: 4px;
  background: #3d3d5c;
  border-radius: 2px;
  z-index: 3;
}
.device__hw-btn:nth-child(1) { top: 25%; height: 28px; }
.device__hw-btn:nth-child(2) { top: 42%; height: 20px; }
.device__hw-btn:nth-child(3) { top: 55%; height: 20px; }

/* Power LED */
.device__power-led {
  position: absolute;
  top: 8px;
  right: 14px;
  z-index: 3;
}

/* Inner screen */
.device__screen {
  background: #0a0a0f;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
  z-index: 2;
}

/* CRT scanlines */
.device__screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(18,16,16,0) 50%,
    rgba(0,0,0,0.25) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 4;
}

/* Screen content — abstract dashboard */
.device__content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  position: relative;
  z-index: 3;
}

/* Status line */
.device__status {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #22c55e;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.device__status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.8);
  animation: led-pulse 2s ease-in-out infinite;
}

/* Glowing bars */
.device__bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1;
  padding-bottom: 4px;
}

.device__bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

/* Loader ring */
@keyframes device-spin {
  to { transform: rotate(360deg); }
}

.device__loader {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,71,87,0.2);
  border-top-color: #ff4757;
  border-radius: 50%;
  animation: device-spin 1.2s linear infinite;
  position: absolute;
  bottom: 14px;
  right: 14px;
}

/* Bottom status text */
.device__readout {
  font-family: var(--font-mono);
  font-size: 8px;
  color: rgba(255,255,255,0.35);
  letter-spacing: .06em;
  text-transform: uppercase;
}


/* stats strip */

.stats-strip {
  background: #2d3436;
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  box-shadow: var(--shadow-floating);
  position: relative;
  overflow: hidden;
}

/* Accent top border */
.stats-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
}

.stat-cell {
  text-align: center;
  position: relative;
}

/* Left divider on cells 2–4 */
.stat-cell + .stat-cell::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 10%;
  height: 80%;
  width: 1px;
  background: rgba(255,255,255,0.1);
}

.stat-cell__number {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: .6rem;
}

.stat-cell__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #a8b2d1;
}


/* how it works */

.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  width: 140px;
}

.step__node {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--background);
  box-shadow: var(--shadow-floating);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.step__number {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.step__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: .875rem;
  line-height: 1.3;
}

.step__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: .4rem;
  line-height: 1.6;
  max-width: 140px;
}

/* Pipe connector */
.step__pipe {
  flex: 1;
  min-width: 40px;
  height: 10px;
  border-radius: 9999px;
  background: var(--muted);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
  align-self: center;
  margin-top: 0;
  /* vertically center with node (48/2 - 10/2 = 19px from top) */
  position: relative;
  top: -19px;
}


/* responsive */
@media (max-width: 700px) {
  .upload-screen  { padding: 1rem 1rem 5rem; align-items: flex-start; }
  .upload-container { grid-template-columns: 1fr; }
  .upload-left, .upload-right { padding: 1.75rem 1.5rem; }

  .main-layout { grid-template-columns: 1fr; }

  /* MOBILE FIX: sidebar is hidden in HTML (display:none) — don't force it back */
  /* Sidebar drawer code removed — question table replaces sidebar */

  .hamburger-btn { display: none !important; } /* MOBILE FIX: hamburger not needed — sidebar removed */

  /* MOBILE FIX: show export buttons on mobile (compact) */
  .export-btn {
    display: inline-flex !important;
    min-height: 32px;
    padding: .25rem .5rem;
    font-size: 10px;
    border-radius: 6px;
    gap: .25rem;
  }
  .export-btn svg { width: 10px; height: 10px; }


  .metrics-grid       { grid-template-columns: repeat(2, 1fr); }
  .chart-grid         { grid-template-columns: 1fr; }
  .subject-charts-grid{ grid-template-columns: repeat(2, 1fr) !important; }
  .q-ans-row          { grid-template-columns: 1fr; }
  .ans-cell + .ans-cell { border-left: none; border-top: 1px solid var(--border); }


  .topbar-file        { display: none; }
  .topbar-actions     { gap: .25rem; }
  .topbar-actions .btn-ghost,
  .topbar-actions .btn-icon { padding: .3rem .5rem; font-size: 10px; }

  /* ── New component responsive ── */
  .section-spacing { gap: 4rem; }

  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 0 2rem;
    gap: 2.5rem;
  }
  .hero__headline { font-size: 2.8rem; }
  .hero__cta { width: 100%; }
  .hero__cta .btn-primary,
  .hero__cta .btn-ghost { width: 100%; }

  .device { max-width: 320px; }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }
  .stat-cell:nth-child(3)::before { display: none; }

  .steps {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .step { width: 100%; max-width: 280px; }
  .step__pipe { display: none; }


  .score-tab { font-size: 10px; padding: .7rem .5rem; }
  .score-tab-panel { padding: .75rem; }
  .arc-gauge-wrap { max-width: 220px; }
  .arc-score-val { font-size: 28px; }
  .arc-stat-pills { gap: 8px; }
  .arc-pill { font-size: 11px; padding: .3rem .7rem; }
  .subject-score-earned { font-size: 20px; }


  .q-table-preview-col { display: none; }
  .q-table td:nth-child(3) { display: none; }
  .q-table-card { max-height: 240px; }

  /* MOBILE FIX: center-align filter chip groups */
  .filter-bar { align-items: center; }
  .filter-group { justify-content: center; }
  .filter-chip { font-size: 10px; padding: .25rem .7rem; min-height: 28px; }

  /* MOBILE FIX: topbar — compact Upload New button */
  .topbar-actions .btn-ghost { min-height: 32px; }
}

/* Desktop container padding */
@media (min-width: 768px) {
  .container { padding: 0 3rem; }
}


/* testimonial card */

/* ── Grid wrapper ── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: start;
}

/* ── Base testimonial card ── */
.neu-testimonial {
  background: var(--background);
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 2rem;
  padding-top: 2.5rem; /* extra room for push-pin */
  position: relative;
  transition:
    transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: visible;
  /* Manufacturing: corner screws (inherited pattern) */
}

/* Corner screws — top-left + top-right */
.neu-testimonial::before {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 12px 12px,
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px),
    radial-gradient(circle at calc(100% - 12px) 12px,
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px);
}

/* Corner screws — bottom-left + bottom-right */
.neu-testimonial::after {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 12px calc(100% - 12px),
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px),
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px);
}

/* Card hover lift */
.neu-testimonial:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

/* ── Physical rotation for realism ── */
.neu-testimonial:nth-child(odd)  { transform: rotate(-1deg); }
.neu-testimonial:nth-child(even) { transform: rotate(1deg); }
.neu-testimonial:nth-child(odd):hover  { transform: rotate(-1deg) translateY(-4px); }
.neu-testimonial:nth-child(even):hover { transform: rotate(1deg)  translateY(-4px); }

/* ── Vent slots ── */
.neu-testimonial__vents {
  position: absolute;
  top: 14px;
  right: 28px;
  display: flex;
  flex-direction: row;
  gap: 3px;
  z-index: 2;
}
.neu-testimonial__vent {
  width: 3px;
  height: 24px;
  border-radius: 9999px;
  background: var(--muted);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

/* ── Push-pin ── */
.neu-testimonial__pin {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(0,0,0,0.2);
  z-index: 10;
  /* Shine dot */
  background:
    radial-gradient(circle at 6px 5px,
      rgba(255,255,255,0.6) 3px,
      transparent 4px),
    var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* ── Avatar block ── */
.neu-testimonial__avatar-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.neu-testimonial__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  filter: grayscale(1);
  transition: filter 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-card);
  border: 2px solid var(--border-light);
}
.neu-testimonial:hover .neu-testimonial__avatar {
  filter: grayscale(0);
}

/* Monogram fallback avatar */
.neu-testimonial__monogram {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: var(--shadow-recessed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  filter: grayscale(1);
  transition: filter 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.neu-testimonial:hover .neu-testimonial__monogram {
  filter: grayscale(0);
  color: var(--accent);
}

/* ── Masking tape date label ── */
.neu-testimonial__tape {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(255, 230, 0, 0.30);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transform: skewX(12deg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  border-radius: 2px;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

/* ── Quote ── */
.neu-testimonial__quote {
  font-size: 14px;
  line-height: 1.75;
  font-style: italic;
  color: var(--text);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

/* Opening quotemark */
.neu-testimonial__quote::before {
  content: '"';
  font-size: 3rem;
  line-height: 0;
  vertical-align: -0.6em;
  color: var(--accent);
  opacity: 0.35;
  font-style: normal;
  margin-right: 2px;
}

/* ── Author ── */
.neu-testimonial__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.neu-testimonial__role {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-top: 3px;
}


/* pricing cards */

/* ── Grid wrapper ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: start;
}

/* ── Base pricing card ── */
.neu-pricing {
  background: var(--background);
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  padding-top: 3rem; /* room for hanging hole */
  position: relative;
  transition:
    transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: visible;
}

/* Corner screws */
.neu-pricing::before {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 12px 12px,
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px),
    radial-gradient(circle at calc(100% - 12px) 12px,
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px);
}
.neu-pricing::after {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 12px calc(100% - 12px),
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px),
      rgba(0,0,0,0.2) 0px,
      rgba(0,0,0,0.15) 1.5px,
      rgba(255,255,255,0.3) 1.5px,
      rgba(255,255,255,0.3) 2px,
      transparent 2px);
}

/* Hover lift — Basic + Enterprise only */
.neu-pricing:not(.neu-pricing--pro):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

/* ── Vent slots ── */
.neu-pricing__vents {
  position: absolute;
  top: 14px;
  right: 28px;
  display: flex;
  flex-direction: row;
  gap: 3px;
  z-index: 2;
}
.neu-pricing__vent {
  width: 3px;
  height: 24px;
  border-radius: 9999px;
  background: var(--muted);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

/* ── Hanging hole (punched metal) ── */
.neu-pricing__hole {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--background);
  box-shadow: var(--shadow-recessed);
  border: 1px solid var(--border-shadow);
  z-index: 10;
}

/* ── Pro variant (dark panel, pre-elevated) ── */
.neu-pricing--pro {
  background: #2d3436;
  box-shadow: var(--shadow-floating);
  /* No hover transform — already elevated */
}
.neu-pricing--pro .neu-pricing__hole {
  background: #3d4f52;
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.4), inset -4px -4px 8px rgba(255,255,255,0.04);
}
/* Vent slots on dark card */
.neu-pricing--pro .neu-pricing__vent {
  background: rgba(255,255,255,0.08);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);
}

/* ── "MOST POPULAR" badge ── */
.neu-pricing__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--accent);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

/* ── Tier name ── */
.neu-pricing__tier {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}
.neu-pricing--pro .neu-pricing__tier { color: #a8b2d1; }

/* ── Price display ── */
.neu-pricing__price {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 1.5rem;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.neu-pricing__currency {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding-top: 6px; /* vertically top-align with large numeral */
}
.neu-pricing--pro .neu-pricing__currency { color: #ffffff; }

.neu-pricing__amount {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.neu-pricing--pro .neu-pricing__amount { color: #ffffff; }

.neu-pricing__period {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 4px;
  align-self: flex-end;
}
.neu-pricing--pro .neu-pricing__period { color: #a8b2d1; }

/* ── Description ── */
.neu-pricing__desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 2;
}
.neu-pricing--pro .neu-pricing__desc { color: #e0e5ec; }

/* ── Feature list ── */
.neu-pricing__features {
  list-style: none;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.neu-pricing__feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid rgba(186, 190, 204, 0.3);
}
.neu-pricing__feature:last-child { border-bottom: none; }
.neu-pricing--pro .neu-pricing__feature { color: #e0e5ec; border-color: rgba(255,255,255,0.08); }

/* Checkmark icon */
.neu-pricing__check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-faint);
  border: 1px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.neu-pricing__check::after {
  content: '✓';
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.neu-pricing--pro .neu-pricing__check {
  background: rgba(255, 71, 87, 0.15);
  border-color: rgba(255, 71, 87, 0.35);
}

/* ── CTA button (full width) ── */
.neu-pricing__cta {
  width: 100%;
  position: relative;
  z-index: 2;
}


/* section labels */
.section-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-label__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.section-label__eyebrow::before,
.section-label__eyebrow::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}
.section-label__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  text-shadow: 0 1px 1px #ffffff;
}
.section-label__sub {
  max-width: 54ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}


/* responsive additions */
@media (max-width: 700px) {

  /* Testimonials: single column on mobile */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  /* Flatten rotation on mobile (prevents clipping) */
  .neu-testimonial:nth-child(odd),
  .neu-testimonial:nth-child(even)            { transform: none; }
  .neu-testimonial:nth-child(odd):hover,
  .neu-testimonial:nth-child(even):hover      { transform: translateY(-4px); }

  /* Pricing: single column on mobile */
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Card padding reduction on mobile */
  .neu-testimonial,
  .neu-pricing {
    padding: 1.5rem;
    padding-top: 2.25rem;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  /* Tablets: testimonials 2 columns */
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  /* Pricing stays 1 column, let it scroll or stack */
  .pricing-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════════════
   BRIEF LIVE STATS STRIP (dashboard inline)
   ═══════════════════════════════════════════════════════════════ */

.live-brief-strip {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  animation: fade-in .4s ease;
}

.live-brief-strip__led {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.live-brief-strip__stats {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  flex-wrap: wrap;
}

.live-brief-stat {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.live-brief-stat__val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-display);
}

.live-brief-stat__val.accent { color: var(--accent-light); }
.live-brief-stat__val.green  { color: var(--correct); }
.live-brief-stat__val.purple { color: #c084fc; }
.live-brief-stat__val.amber  { color: #f59e0b; }

.live-brief-stat__lbl {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--pewter);
}

.live-brief-strip__action {
  flex-shrink: 0;
}

.live-brief-strip__action .btn-ghost {
  min-height: 36px;
  padding: .4rem 1rem;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   DETAILED ANALYSIS SCREEN
   ═══════════════════════════════════════════════════════════════ */

#analysisScreen,
#communityScreen {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--background);
}

.analysis-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--background);
}

.analysis-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Page header */
.analysis-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.analysis-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: .3rem;
}

.analysis-subtitle {
  font-size: 13px;
  color: var(--pewter);
}

.analysis-live-badge {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
  margin-top: .25rem;
}

.analysis-total-badge {
  font-size: 11px;
  font-weight: 600;
  padding: .3rem .8rem;
  background: var(--accent-faint);
  color: var(--accent-light);
  border: 1px solid var(--accent-dim);
  border-radius: 20px;
  white-space: nowrap;
}

/* Loading */
.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 5rem 2rem;
}

/* Section titles */
.analysis-section-title {
  margin: 2.5rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .875rem;
}

.analysis-section-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--accent);
  display: block;
  margin-bottom: .35rem;
}

.analysis-section-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

/* Cards */
.analysis-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color .2s, box-shadow .2s;
}

.analysis-card:hover {
  border-color: var(--border2);
}

.analysis-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text2);
  margin-bottom: 1rem;
}

.analysis-card-sub {
  font-size: 12px;
  color: var(--pewter);
  text-align: center;
  margin-top: .75rem;
  line-height: 1.6;
}

.analysis-card--full {
  width: 100%;
  margin-bottom: 1rem;
}

/* Card grid rows */
.analysis-cards-row {
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.analysis-card--tall {
  grid-row: span 1;
}

.analysis-card--wide {
  grid-column: span 2;
}

/* Vertical stat stack */
.analysis-vstack {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Stat cards (inside vstack) */
.analysis-stat-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  gap: .875rem;
  flex: 1;
  transition: border-color .2s;
}

.analysis-stat-card:hover { border-color: var(--border2); }

.analysis-stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.analysis-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-display);
}

.analysis-stat-lbl {
  font-size: 10px;
  color: var(--pewter);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-top: .2rem;
}

/* Chart wrapper */
.analysis-chart-wrap {
  position: relative;
  width: 100%;
}



/* Subject compare rows */
.subject-compare-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .25rem 0;
}

.subject-compare-row {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.subject-compare-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subject-compare-row__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.subject-compare-row__vals {
  font-size: 11px;
  color: var(--pewter);
}

.subject-compare-track {
  height: 8px;
  background: var(--muted);
  border-radius: 4px;
  overflow: visible;
  position: relative;
}

.subject-compare-bar {
  height: 100%;
  border-radius: 4px;
  position: absolute;
  top: 0; left: 0;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

.subject-compare-bar--you   { height: 100%; border-radius: 4px; }
.subject-compare-bar--avg   { height: 4px; top: 2px; opacity: .55; border-radius: 4px; }

/* Distribution stats row */
.distribution-stats-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dist-stat {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .75rem 1rem;
  background: var(--charcoal-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 100px;
}

.dist-stat__val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-display);
}

.dist-stat__lbl {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--pewter);
}

/* Drill down table */
.drill-down-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: .75rem;
}

.drill-cell {
  background: var(--charcoal-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem;
}

.drill-cell__val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-display);
}

.drill-cell__lbl {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--pewter);
  margin-top: .2rem;
}

.drill-subject-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  gap: .5rem;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

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

.drill-subject-name {
  font-weight: 600;
  color: var(--text);
}

.drill-subject-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text2);
  text-align: right;
}

/* Disclaimer */
.analysis-disclaimer {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--pewter);
  margin-top: 2rem;
  line-height: 1.6;
}

/* Mobile responsive for analysis screen */
@media (max-width: 700px) {
  .analysis-cards-row {
    grid-template-columns: 1fr;
  }
  .analysis-card--wide { grid-column: span 1; }
  .drill-down-grid { grid-template-columns: repeat(2, 1fr); }
  .analysis-title { font-size: 20px; }
  .analysis-page-header { flex-direction: column; }
  .drill-subject-row { grid-template-columns: 100px 1fr 1fr; font-size: 11px; }
  .live-brief-strip { flex-direction: column; align-items: flex-start; }
  .live-brief-strip__stats { gap: 1rem; }
  .comm-stream-toggle { flex-direction: column; }
  .comm-stream-btn { min-height: 56px; }
}

/* ── Community Stream Selector ── */
.comm-stream-selector {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.comm-stream-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--pewter);
  margin-bottom: 1rem;
}

.comm-stream-toggle {
  display: flex;
  gap: .75rem;
}

.comm-stream-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  min-height: 68px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 250ms cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.comm-stream-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  transition: background 250ms;
}

.comm-stream-btn:hover {
  border-color: var(--pewter);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.comm-stream-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(255,71,87,.12);
}

.comm-stream-btn.active::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-light, #ff6b81));
}

/* PCB active uses blue accent */
#commStreamBtnPCB.active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px #60a5fa, 0 4px 16px rgba(96,165,250,.15);
}
#commStreamBtnPCB.active::before {
  background: linear-gradient(90deg, #60a5fa, #93c5fd);
}

.comm-stream-btn__icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.comm-stream-btn__text {
  font-family: var(--font-display, var(--font-mono));
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .04em;
  line-height: 1;
}

.comm-stream-btn__sub {
  font-size: 11px;
  color: var(--pewter);
  letter-spacing: .02em;
  white-space: nowrap;
}

.comm-stream-btn.active .comm-stream-btn__text {
  color: var(--accent);
}
#commStreamBtnPCB.active .comm-stream-btn__text {
  color: #60a5fa;
}
