/* ============================================================
   PACER — Shared Stylesheet
   Used by: landing.html, scoring.html, calibration.html
   ============================================================ */

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

:root {
  --purple: #6B21E8;
  --purple-mid: #7C3AED;
  --purple-light: #8B5CF6;
  --purple-faint: #F3EFFF;
  --purple-border: #E5DAFF;
  --ink: #0F0A1E;
  --ink-2: #2D2540;
  --muted: #6B6880;
  --muted-lt: #9894A8;
  --surface: #FAFAF9;
  --white: #FFFFFF;
  --border: #ECEAF2;
  --nav-h: 60px;

  /* App shell tokens */
  --ok: #059669;
  --ok-lt: rgba(5,150,105,.1);
  --err: #dc2626;
  --err-lt: rgba(220,38,38,.08);
  --warn: #d97706;
  --tx: #13182a;
  --tx2: #4b5470;
  --tx3: #8890ae;
  --accent: #4f46e5;
  --accent2: #06b6d4;
  --acc-lt: rgba(79,70,229,.08);
  --bg: #f0f2f8;
  --surface2: #f7f8fd;
  --border2: #c8cfe0;
  --sh1: 0 1px 3px rgba(0,0,20,.06), 0 4px 16px rgba(0,0,20,.07);
  --sh2: 0 2px 8px rgba(0,0,20,.07), 0 12px 40px rgba(0,0,20,.10);
  --sh3: 0 4px 20px rgba(0,0,20,.10), 0 24px 60px rgba(0,0,20,.13);
  --r: 14px;
  --r2: 8px;
  --sb: 276px;
  --top: 58px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

html, body, #root { height: 100%; }

.page-wrap { overflow-x: hidden; }

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

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

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s ease forwards;
}

.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.25s; }
.d4 { animation-delay: 0.35s; }
.d5 { animation-delay: 0.45s; }
.d6 { animation-delay: 0.55s; }

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 100px;
  padding-left: 32px;
  padding-right: 32px;
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-faint);
  border: 1px solid var(--purple-border);
  color: var(--purple);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(38px, 4.5vw, 58px);
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin-bottom: 22px;
}

.hero-title em {
  font-style: italic;
  color: var(--purple);
}

.hero-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 400;
  max-width: 460px;
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-hero {
  padding: 13px 26px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.btn-hero-primary {
  background: var(--purple);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(107,33,232,0.28);
}

.btn-hero-primary:hover {
  background: var(--purple-mid);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(107,33,232,0.36);
}

.btn-hero-secondary {
  background: white;
  color: var(--ink-2);
  border: 1.5px solid var(--border);
}

.btn-hero-secondary:hover {
  border-color: var(--purple-light);
  color: var(--purple);
  background: var(--purple-faint);
  transform: translateY(-1px);
}

.hero-trust {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted-lt);
}

.hero-trust-avatars { display: flex; }

.hero-trust-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--purple-faint);
  margin-left: -8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple);
}

.hero-trust-av:first-child { margin-left: 0; }

/* ── HERO VISUAL ────────────────────────────────────────────── */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-card-stack {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(15,10,30,0.07);
}

.stat-card-main { position: relative; z-index: 2; }

.stat-card-back {
  position: absolute;
  top: -12px; left: 16px; right: 16px;
  z-index: 1;
  opacity: 0.6;
  transform: scale(0.97);
}

.stat-card-back2 {
  position: absolute;
  top: -22px; left: 28px; right: 28px;
  z-index: 0;
  opacity: 0.35;
  transform: scale(0.94);
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-lt);
}

.sc-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--purple-faint);
  color: var(--purple);
  letter-spacing: 0.3px;
}

.sc-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.sc-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.sc-cell-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-lt);
  margin-bottom: 4px;
}

.sc-cell-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.sc-cell-val.purple { color: var(--purple); }

.sc-ll {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--purple-faint);
  border-radius: 8px;
  margin-top: 10px;
}

.sc-ll-label { font-size: 11px; font-weight: 600; color: var(--purple); }
.sc-ll-val   { font-size: 15px; font-weight: 700; color: var(--purple); letter-spacing: -0.5px; }

.sc-conv {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: #059669;
}

.sc-conv-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #059669;
}

/* ── FLOATING BADGES ────────────────────────────────────────── */
.float-badge {
  position: absolute;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(15,10,30,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  animation: floatY 4s ease-in-out infinite;
  white-space: nowrap;
}

.float-badge-1 { top: -30px; right: -20px; animation-delay: 0s; }
.float-badge-2 { bottom: 20px; left: -30px; animation-delay: 2s; }

.fb-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.fb-icon.green { background: #DCFCE7; }
.fb-icon.blue  { background: #DBEAFE; }

/* ── SECTION SHARED ─────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--purple);
  margin-bottom: 12px;
}

.section-heading {
  font-family: 'Inter', sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  color: var(--ink);
  letter-spacing: -0.8px;
  margin-bottom: 8px;
  line-height: 1.15;
}

.section-sub {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 48px;
  max-width: 520px;
  line-height: 1.6;
}

/* ── FEATURES STRIP ─────────────────────────────────────────── */
.features-strip {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 60px 32px;
}

.features-inner {
  max-width: 1160px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.feature-card:hover {
  border-color: var(--purple-border);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(107,33,232,0.08);
}

.feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--purple-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.feature-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── TOOLS SECTION ──────────────────────────────────────────── */
.tools-section {
  padding: 80px 32px;
  max-width: 1160px;
  margin: 0 auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.tool-card {
  padding: 24px 20px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: white;
  text-align: center;
  text-decoration: none;
  color: var(--ink-2);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.tool-card:hover {
  border-color: var(--purple);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(107,33,232,0.1);
  background: var(--purple-faint);
}

.tool-card:hover .tool-icon { background: var(--purple); color: white; }

.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--purple-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: background 0.2s, color 0.2s;
}

.tool-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  line-height: 1.3;
  text-align: center;
}

.tool-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--purple-faint);
  color: var(--purple);
  letter-spacing: 0.3px;
}

.tool-tag.new { background: #DCFCE7; color: #059669; }

/* ── STATS BAR ──────────────────────────────────────────────── */
.stats-bar {
  background: var(--ink);
  padding: 56px 32px;
}

.stats-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.stat-item { text-align: center; }

.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 42px;
  color: white;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-num span { color: var(--purple-light); }

.stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 40px 32px;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.footer-logo {
  width: 22px; height: 22px;
  object-fit: contain;
  opacity: 0.8;
}

.footer-name {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: rgba(255,255,255,0.7);
}

.footer-links { display: flex; gap: 24px; }

.footer-link {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover { color: rgba(255,255,255,0.8); }

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* ── NAV BAR ────────────────────────────────────────────────── */
.pac-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(135deg, #0a3d6e 0%, #0B4A8B 50%, #0d5299 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 4px 24px rgba(2,8,23,.22);
}

/* top shimmer line */
.pac-nav::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.30) 40%, rgba(148,210,255,.38) 60%, transparent);
  pointer-events: none; z-index: 1;
}

.pac-nav-inner {
  max-width: 1680px; margin: 0 auto;
  padding: 0 24px; height: 58px;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* Brand */
.pac-nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -.02em; font-size: 15px;
  white-space: nowrap; text-decoration: none; color: #fff; flex-shrink: 0;
}
.pac-nav-brand:hover { color: #fff; }

.pac-brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 2px 8px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .15s, box-shadow .15s; overflow: hidden;
}
.pac-brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.pac-nav-brand:hover .pac-brand-mark { transform: scale(1.06); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.pac-nav-wordmark { font-family: 'Inter', sans-serif; font-size: 16px; letter-spacing: -.01em; font-weight: 400; }

/* Center nav links */
.pac-nav-links { display: flex; align-items: center; gap: 2px; }
.pac-nav-link {
  color: rgba(255,255,255,.70); text-decoration: none; font-weight: 700; font-size: 13px;
  padding: 6px 14px; border-radius: 8px; border: 1px solid transparent;
  transition: color .14s, background .14s; position: relative;
  background: none; cursor: pointer; font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.pac-nav-link:hover  { color: #fff; background: rgba(255,255,255,.09); }
.pac-nav-link.active { color: #fff; background: rgba(255,255,255,.13); }
.pac-nav-link.active::after {
  content: ''; position: absolute; bottom: -1px; left: 14px; right: 14px; height: 2px;
  background: linear-gradient(90deg, #60c5ff, #93d6ff); border-radius: 99px;
}

/* Dropdown */
.pac-nav-item { position: relative; }
.pac-nav-chevron { width: 13px; height: 13px; opacity: .55; transition: transform .2s; }
.pac-nav-item:hover .pac-nav-chevron { transform: rotate(180deg); opacity: .9; }

.pac-dropdown {
  position: absolute;
  top: 100%; left: 0; min-width: 220px;
  padding: 8px 5px 5px;
  background: transparent;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s, transform .16s, visibility 0s linear .16s;
  pointer-events: none; z-index: 10000;
}

.pac-dropdown-inner {
  background: #fff; border: 1px solid rgba(13,110,253,.12); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(2,8,23,.18); padding: 5px;
}

.pac-nav-item:hover .pac-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: all;
  transition: opacity .16s, transform .16s, visibility 0s linear 0s;
}

.pac-dd-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 8px;
  text-decoration: none; color: #1e293b; font-size: 12.5px; font-weight: 500; transition: background .12s;
}
.pac-dd-item:hover { background: #f0f7ff; color: #1d4ed8; }
.pac-dd-icon {
  width: 26px; height: 26px; border-radius: 6px; background: #eff6ff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.pac-dd-label { font-size: 12.5px; font-weight: 600; }
.pac-dd-sub   { font-size: 10.5px; color: #94a3b8; font-weight: 400; }

/* Right actions */
.pac-nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pac-nav-sep   { width: 1px; height: 18px; background: rgba(255,255,255,.18); margin: 0 4px; }

/* Chip buttons */
.pac-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 12px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.10);
  color: #fff; cursor: pointer; transition: background .14s, border-color .14s;
  font-family: 'Inter', sans-serif; text-decoration: none; white-space: nowrap;
}
.pac-chip:hover { background: rgba(255,255,255,.17); border-color: rgba(255,255,255,.28); }

/* Icon-only buttons */
.pac-icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.78);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
  transition: background .14s, color .14s, border-color .14s; flex-shrink: 0;
  font-size: 15px; font-weight: 700; font-family: 'Inter', sans-serif;
}
.pac-icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.26); }

/* Hero root override */
#hero-root { margin-top: 0; }


/* ============================================================
   APP SHELL — shared by calibration.html + scoring.html
   ============================================================ */

/* ── App-level tokens ──────────────────────────────────────── */

/* ══ DARK MODE ══════════════════════════════════════════════ */

/* App shell tokens */
[data-dark] {
  --bg: #0c0e17; --surface: #141720; --surface2: #1b1f2e;
  --border: #252a3d; --border2: #303654;
  --tx: #e2e6f8; --tx2: #8890ae; --tx3: #3f4660;
  --acc-lt: rgba(79,70,229,.14);
  --ok-lt: rgba(5,150,105,.13);
  --err-lt: rgba(220,38,38,.11);
  --sh1: 0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.45);
  --sh2: 0 2px 8px rgba(0,0,0,.45), 0 12px 40px rgba(0,0,0,.5);
  --sh3: 0 4px 20px rgba(0,0,0,.6), 0 24px 60px rgba(0,0,0,.6);
}

/* Landing page CSS variable overrides */
html[data-dark] {
  --ink: #e2e6f8; --ink-2: #b8bdd4;
  --muted: #8890ae; --muted-lt: #5a6080;
  --surface: #141720; --white: #1b1f2e;
  --border: #252a3d;
  --purple-faint: rgba(107,33,232,.15);
  --purple-border: rgba(107,33,232,.30);
}
html[data-dark] body { background: #0c0e17; color: #e2e6f8; }

/* Landing page section overrides */
html[data-dark] .features-strip { background:#141720; border-color:#252a3d; }
html[data-dark] .feature-card   { background:#1b1f2e; border-color:#252a3d; }
html[data-dark] .feature-title  { color:#e2e6f8; }
html[data-dark] .feature-desc   { color:#8890ae; }
html[data-dark] .section-heading{ color:#e2e6f8; }
html[data-dark] .section-sub    { color:#8890ae; }
html[data-dark] .tool-card      { background:#1b1f2e; border-color:#252a3d; color:#b8bdd4; }
html[data-dark] .tool-card:hover{ background:rgba(107,33,232,.18); }
html[data-dark] .stat-card      { background:#1b1f2e; border-color:#252a3d; }
html[data-dark] .sc-cell        { background:#141720; border-color:#252a3d; }
html[data-dark] .sc-cell-val    { color:#e2e6f8; }
html[data-dark] .float-badge    { background:#1b1f2e; border-color:#252a3d; color:#b8bdd4; }
html[data-dark] .hero-title     { color:#e2e6f8; }
html[data-dark] .btn-hero-secondary { background:#1b1f2e; color:#b8bdd4; border-color:#252a3d; }
html[data-dark] .btn-hero-secondary:hover { background:rgba(107,33,232,.18); color:#a78bfa; }

/* Hero stat cards — fully dark */
[data-dark] .hero-card                { border-color:#252a3d !important; }

[data-dark] .hero-green  {
  background: #051f16 !important;
  border-color: rgba(16,185,129,.25) !important;
  box-shadow: 0 2px 12px rgba(16,185,129,.08), 0 14px 36px rgba(16,185,129,.06) !important;
}
[data-dark] .hero-green .hero-value        { color:#6ee7b7 !important; }
[data-dark] .hero-green .hero-interpretive { color:#34d399 !important; }
[data-dark] .hero-green .hero-sub          { color:rgba(110,231,183,.60) !important; }
[data-dark] .hero-green .hero-kicker       { color:rgba(110,231,183,.50); }

[data-dark] .hero-blue  {
  background: #12113a !important;
  border-color: rgba(99,102,241,.30) !important;
  box-shadow: 0 2px 12px rgba(99,102,241,.10), 0 14px 36px rgba(99,102,241,.08) !important;
}
[data-dark] .hero-blue .hero-value         { color:#a5b4fc !important; }
[data-dark] .hero-blue .hero-interpretive  { color:#818cf8 !important; }
[data-dark] .hero-blue .hero-sub           { color:rgba(165,180,252,.60) !important; }
[data-dark] .hero-blue .hero-kicker        { color:rgba(165,180,252,.50); }

[data-dark] .hero-amber {
  background: #1c1400 !important;
  border-color: rgba(234,179,8,.28) !important;
  box-shadow: 0 2px 12px rgba(234,179,8,.08), 0 14px 36px rgba(234,179,8,.06) !important;
}
[data-dark] .hero-amber .hero-value        { color:#fcd34d !important; }
[data-dark] .hero-amber .hero-interpretive { color:#fbbf24 !important; }
[data-dark] .hero-amber .hero-sub          { color:rgba(252,211,77,.60) !important; }
[data-dark] .hero-amber .hero-kicker       { color:rgba(252,211,77,.50); }

[data-dark] .hero-slate {
  background: #0e1118 !important;
  border-color: rgba(100,116,139,.25) !important;
  box-shadow: 0 2px 12px rgba(15,23,42,.20), 0 14px 36px rgba(15,23,42,.18) !important;
}
[data-dark] .hero-slate .hero-value        { color:#e2e6f8 !important; }
[data-dark] .hero-slate .hero-interpretive { color:#b8bdd4 !important; }
[data-dark] .hero-slate .hero-sub          { color:rgba(226,230,248,.50) !important; }
[data-dark] .hero-slate .hero-kicker       { color:rgba(226,230,248,.45); }

/* Hide SVG bg in dark mode — CSS handles the background instead */
[data-dark] .hero-bg-svg { opacity:0.12; }

[data-dark] .hero-kicker { color:rgba(226,230,248,.50); }

/* Sidebar */
[data-dark] .sidebar { background:#141720; border-right-color:#252a3d; }
[data-dark] .sb-header,
[data-dark] .sb-header-inner { background:#1b1f2e; border-color:#252a3d; }
[data-dark] .sb-header-title { color:rgba(226,230,248,.88); }
[data-dark] .sb-header-sub   { color:#8890ae; }

/* Accordions */
[data-dark] .acc          { background:#1b1f2e; border-color:#252a3d; }
[data-dark] .acc-hd       { background:#1b1f2e; }
[data-dark] .acc-hd:hover,
[data-dark] .acc-open .acc-hd { background:#20253a; }
[data-dark] .acc-open     { border-color:rgba(99,102,241,.35); }
[data-dark] .acc-title    { color:#e2e6f8; }
[data-dark] .acc-summary  { color:#5a6080; }
[data-dark] .acc-arr      { color:#3f4660; }
[data-dark] .acc-open .acc-arr { color:#818cf8; }

/* Form fields */
[data-dark] .f-label      { color:#5a6080; }
[data-dark] .fi, [data-dark] .fs { background:#0c0e17; border-color:#303654; color:#e2e6f8; }
[data-dark] .fi:focus, [data-dark] .fs:focus { border-color:#6366f1; box-shadow:0 0 0 3px rgba(99,102,241,.15); }

/* Pills / toggles */
[data-dark] .pills         { background:#1b1f2e; }
[data-dark] .pill          { color:#8890ae; }
[data-dark] .pill.on       { background:#252a3d; color:#a5b4fc; box-shadow:0 1px 5px rgba(0,0,0,.4),0 0 0 1.5px rgba(99,102,241,.3); }
[data-dark] .src-toggle    { background:#1b1f2e; }
[data-dark] .src-btn       { color:#8890ae; }
[data-dark] .src-btn.on    { background:#252a3d; color:#a5b4fc; }

/* Tables */
[data-dark] .tsec          { background:#141720; border-color:#252a3d; }
[data-dark] .thd           { background:linear-gradient(90deg,rgba(99,102,241,.08),rgba(6,182,212,.06),rgba(20,23,32,.70)); border-color:#252a3d; }
[data-dark] .ttitle        { color:#c7d2f8; }
[data-dark] .irt-t thead th { background:#141720; color:rgba(199,210,248,.65); border-color:#252a3d; }
[data-dark] .irt-t tbody tr { border-color:#252a3d; }
[data-dark] .irt-t tbody tr:nth-child(even) { background:rgba(255,255,255,.02); }
[data-dark] .irt-t tbody tr:hover { background:rgba(99,102,241,.09)!important; }
[data-dark] .irt-t tbody td { color:rgba(226,230,248,.85); }
[data-dark] .irt-t td:first-child { color:#a5b4fc; }
[data-dark] .irt-t .num    { color:rgba(226,230,248,.75); }
[data-dark] .tfoot         { background:rgba(20,23,32,.7); border-color:#252a3d; color:rgba(226,230,248,.40); }
[data-dark] .aid-t th { background:#141720; color:rgba(199,210,248,.65); border-color:#252a3d; }
[data-dark] .aid-t td { color:rgba(226,230,248,.85); border-color:#252a3d; }
[data-dark] .aid-t tbody tr:hover td { background:rgba(99,102,241,.09); }
[data-dark] .aid-t td:first-child { color:#a5b4fc; }
[data-dark] .aid-t thead tr.ia-group-row th { background:#141720; color:rgba(199,210,248,.25); }
[data-dark] .aid-t thead tr.ia-group-row th.ia-grp-classic { color:rgba(129,140,248,.60); border-left-color:rgba(99,102,241,.25); }
[data-dark] .aid-t thead tr.ia-group-row th.ia-grp-disc    { color:rgba(52,211,153,.55);  border-left-color:rgba(16,185,129,.22); }
[data-dark] .aid-t th.ia-col-classic-first,
[data-dark] .aid-t th.ia-col-classic { color:rgba(129,140,248,.80) !important; }
[data-dark] .aid-t th.ia-col-disc-first { color:rgba(52,211,153,.80) !important; }
[data-dark] .irt-t thead tr.ia-group-row th { background:#141720; color:rgba(199,210,248,.25); }
[data-dark] .irt-t thead tr.ia-group-row th.ia-grp-classic { color:rgba(129,140,248,.60); border-left-color:rgba(99,102,241,.25); }
[data-dark] .irt-t thead tr.ia-group-row th.ia-grp-disc    { color:rgba(52,211,153,.55);  border-left-color:rgba(16,185,129,.22); }
[data-dark] .irt-t thead tr.ia-group-row th.ia-grp-meta    { color:rgba(251,191,36,.50);  border-left-color:rgba(202,138,4,.22); }
[data-dark] .irt-t thead th.ia-col-classic,
[data-dark] .irt-t thead th.ia-col-classic-first { color:rgba(129,140,248,.80) !important; }
[data-dark] .irt-t thead th.ia-col-disc,
[data-dark] .irt-t thead th.ia-col-disc-first    { color:rgba(52,211,153,.80) !important; }
[data-dark] .irt-t thead th.ia-col-meta,
[data-dark] .irt-t thead th.ia-col-meta-first    { color:rgba(251,191,36,.75) !important; }
[data-dark] .irt-t .ia-col-disc-hl { background-image:linear-gradient(180deg,rgba(16,185,129,.10),rgba(16,185,129,.03)) !important; }
[data-dark] .ia-val-classic { color: #818cf8; }
[data-dark] .ia-val-disc    { color: #34d399; }
[data-dark] .ia-val-meta    { color: #fbbf24; }
[data-dark] .tsearch       { background:#1b1f2e; border-color:#303654; color:#e2e6f8; }
[data-dark] .btn-exp       { background:#1b1f2e; border-color:#303654; color:#8890ae; }
[data-dark] .btn-exp:hover { border-color:#6366f1; color:#a5b4fc; background:rgba(99,102,241,.10); }

/* Plot cards */
[data-dark] .plot-card { background:#141720; border-color:#252a3d; }
[data-dark] .plot-hd   { background:linear-gradient(90deg,rgba(99,102,241,.08),rgba(6,182,212,.06),rgba(20,23,32,.70)); color:#c7d2f8; border-color:#252a3d; }

/* Calibration-specific */
[data-dark] .calib-loaded      { background:rgba(37,99,235,.12); border-color:rgba(37,99,235,.25); }
[data-dark] .calib-loaded-title{ color:#60a5fa; }
[data-dark] .calib-loaded-meta { color:#8890ae; }
[data-dark] .no-calib          { background:rgba(202,138,4,.12); border-color:rgba(202,138,4,.25); color:#fbbf24; }
[data-dark] .fmt-hint          { background:#1b1f2e; border-color:#252a3d; }
[data-dark] .fmt-hint-title    { color:#8890ae; }
[data-dark] .fmt-hint p        { color:#5a6080; }
[data-dark] .col-list          { border-color:#252a3d; }
[data-dark] .col-row           { color:#8890ae; }
[data-dark] .col-row:hover     { background:#1b1f2e; }
[data-dark] .col-row.on        { color:#a5b4fc; background:rgba(79,70,229,.14); }

/* Pac-nav (already dark — subtle tweaks) */
[data-dark] .pac-nav { background:linear-gradient(135deg,#060d1a 0%,#081222 50%,#0a1527 100%); border-bottom-color:rgba(255,255,255,.08); }
[data-dark] .pac-dropdown-inner { background:#1b1f2e; border-color:rgba(99,102,241,.20); }
[data-dark] .pac-dd-item       { color:#c7d2f8; }
[data-dark] .pac-dd-item:hover { background:rgba(99,102,241,.14); color:#a5b4fc; }
[data-dark] .pac-dd-icon       { background:rgba(99,102,241,.15); }


/* ── App shell ──────────────────────────────────────────────── */
/* padding-top scoped to app pages (scoring/calibration) which have .shell;
   landing page has no .shell so it is unaffected */
body:has(.shell) { padding-top: 58px; }
.shell { display: flex; min-height: calc(100vh - 58px); }

/* ── Sidebar ─────────────────────────────────────────────────  */
.sidebar {
  position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--sb);
  background: #EEF2F7; border-right: 1px solid rgba(15,23,42,.10);
  overflow-y: auto; z-index: 200; display: flex; flex-direction: column;
  padding: 8px; gap: 6px;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(15,23,42,.15); border-radius: 2px; }

.sb-header {
  background: #F6F8FB; border: 1px solid rgba(15,23,42,.10); border-radius: 16px;
  box-shadow: 0 8px 18px rgba(2,6,23,.08); overflow: hidden; margin-bottom: 2px;
}
.sb-header-inner {
  padding: 10px 13px; background: #F6F8FB; border-bottom: 1px solid rgba(15,23,42,.08);
  display: flex; align-items: center; gap: 10px;
}
.sb-header-icon {
  width: 28px; height: 28px; border-radius: 10px; flex-shrink: 0;
  background: rgba(37,99,235,.12); border: 1px solid rgba(37,99,235,.25);
  display: flex; align-items: center; justify-content: center;
  color: #1D4ED8; font-weight: 900; font-size: 14px;
}
.sb-header-title { font-size: 12px; font-weight: 900; color: rgba(15,23,42,.88); letter-spacing: .02em; }
.sb-header-sub   { font-size: 11px; font-weight: 600; color: rgba(71,85,105,.90); margin-top: 1px; }

/* ── Accordions ─────────────────────────────────────────────── */
.acc {
  background: #F6F8FB; border: 1px solid rgba(15,23,42,.10); border-radius: 14px;
  box-shadow: 0 4px 10px rgba(2,6,23,.06); transition: border-color .15s, box-shadow .15s; overflow: hidden;
}
.acc-hd {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px;
  cursor: pointer; user-select: none; background: #F6F8FB; border: none; width: 100%; transition: background .13s;
  min-width: 0; box-sizing: border-box;
}
.acc-hd:hover { background: #EEF5FF; }
.acc-open .acc-hd { background: #EEF5FF; border-bottom: 1.5px solid #e8ecf0; }
.acc-open { border-color: rgba(37,99,235,.35); box-shadow: 0 6px 14px rgba(2,6,23,.10); }
.acc-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: rgba(37,99,235,.09); border: 1px solid rgba(37,99,235,.18);
  display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1;
}
.acc-open .acc-ico { background: rgba(37,99,235,.16); border-color: rgba(37,99,235,.32); }
.acc-title-wrap { flex: 1; min-width: 0; overflow: hidden; }
.acc-title   { font-size: 12px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-summary { font-size: 10px; font-weight: 600; color: #94a3b8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-arr     { font-size: 10px; color: #cbd5e1; font-weight: 700; transition: transform .2s, color .15s; flex-shrink: 0; margin-left: 2px; }
.acc-open .acc-arr { transform: rotate(180deg); color: #818cf8; }
.acc-body { padding: 11px 10px 13px; animation: lv-sb-in .18s ease; }
.acc-body.shut { display: none; }
.acc-body.scrollable { max-height: 260px; overflow-y: auto; padding-right: 8px; }
@keyframes lv-sb-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Fields ─────────────────────────────────────────────────── */
.f { margin-bottom: 9px; }
.f-label {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; margin-bottom: 5px;
}
.f-row { display: flex; gap: 8px; }
.f-row .f { flex: 1; min-width: 0; }
.fi, .fs {
  width: 100%; padding: 7px 10px; background: #fff; border: 1.5px solid #c8cdd8;
  border-radius: 9px; color: #111827; font-family: inherit; font-size: 12px;
  font-weight: 600; outline: none; transition: border-color .13s;
}
.fi:focus, .fs:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ── Pills ──────────────────────────────────────────────────── */
.pills { display: flex; gap: 3px; background: #e8ecf3; padding: 3px; border-radius: 11px; }
.pill {
  flex: 1; padding: 6px 4px; border-radius: 8px; border: none;
  font-size: 11px; font-weight: 700; cursor: pointer;
  background: transparent; color: #4b5563; transition: all .13s; line-height: 1; font-family: inherit;
}
.pill.on { background: #fff; color: #3730a3; box-shadow: 0 1px 5px rgba(0,0,0,.12), 0 0 0 1.5px rgba(79,70,229,.25); }

/* ── Run button ─────────────────────────────────────────────── */
.sb-run { padding: 8px 0 10px; margin-top: auto; }
.btn-run {
  width: 100%; padding: 14px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, rgba(37,99,235,1), rgba(29,78,216,1));
  color: #fff; font-size: 13px; font-weight: 900; letter-spacing: .01em;
  border: 1px solid rgba(37,99,235,.35); box-shadow: 0 10px 20px rgba(2,6,23,.12);
  transition: transform .12s, box-shadow .15s, filter .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-run:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 12px 24px rgba(2,6,23,.18); }
.btn-run:active:not(:disabled) { transform: translateY(0); }
.btn-run:disabled { background: rgba(148,163,184,.35); color: rgba(15,23,42,.55); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-run.busy { background: rgba(148,163,184,.35); box-shadow: none; }
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: rot .65s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* Status dot */
.sdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; transition: background .3s; }
.sdot.idle { background: var(--tx3); }
.sdot.run  { background: var(--warn); animation: pulse .9s ease-in-out infinite; }
.sdot.ok   { background: var(--ok); }
.sdot.err  { background: var(--err); }

/* ── Main panel ─────────────────────────────────────────────── */
/* margin-left is set by responsive media queries in the responsive section above */
.main { margin-left: var(--sb); flex: 1; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ── Upload zone ─────────────────────────────────────────────── */
.upload {
  background: var(--surface); border: 2px dashed var(--border2); border-radius: var(--r);
  padding: 28px 24px; text-align: center; cursor: pointer; transition: all .18s;
  position: relative; box-shadow: var(--sh1);
}
.upload:hover, .upload.drag { border-color: var(--accent); background: var(--acc-lt); }
.upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-ico  { font-size: 36px; margin-bottom: 8px; }
.upload-t    { font-size: 16px; font-weight: 700; color: var(--tx); }
.upload-s    { font-size: 12px; color: var(--tx3); margin-top: 4px; }
.upload-loaded { display: flex; align-items: center; gap: 16px; justify-content: center; }
.upload-chk  { font-size: 32px; color: var(--ok); }
.uinfo-name  { font-size: 15px; font-weight: 700; color: var(--tx); }
.uinfo-meta  { font-size: 12px; color: var(--tx3); margin-top: 2px; }
.uinfo-change { font-size: 11px; color: var(--accent); margin-top: 3px; cursor: pointer; }

/* ── Hero stat cards ─────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.hero-card {
  border-radius: 20px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hero-card:hover { transform: translateY(-4px); }
.hero-bg-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-card-content {
  position: relative; z-index: 2; padding: 14px 16px 15px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
}
.hero-kicker { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: rgba(15,23,42,.72); font-weight: 700; margin-bottom: 2px; }
.hero-value  { font-family: 'DM Serif Display', Georgia, 'Times New Roman', serif; font-size: 46px; line-height: 1.0; font-weight: 400; letter-spacing: -0.01em; }
.hero-interpretive { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.hero-sub    { margin-top: 3px; font-size: 12.5px; font-weight: 700; color: rgba(15,23,42,.50); }
.hero-value.ok  { color: #065f46; }
.hero-value.bad { color: #991b1b; }

.hero-green  { border: 1px solid rgba(16,185,129,.20); background: #f0fdf8; box-shadow: 0 2px 12px rgba(16,185,129,.08), 0 14px 36px rgba(16,185,129,.11); }
.hero-green:hover { box-shadow: 0 4px 18px rgba(16,185,129,.14), 0 22px 52px rgba(16,185,129,.18); border-color: rgba(16,185,129,.34); }
.hero-green .hero-value { color: #022c22; }
.hero-green .hero-interpretive { color: #065f46; }
.hero-green .hero-sub { color: #065f46; }

.hero-blue   { border: 1px solid rgba(99,102,241,.22); background: #f5f3ff; box-shadow: 0 2px 12px rgba(99,102,241,.09), 0 14px 36px rgba(99,102,241,.12); }
.hero-blue:hover { box-shadow: 0 4px 18px rgba(99,102,241,.16), 0 22px 52px rgba(99,102,241,.20); border-color: rgba(99,102,241,.34); }
.hero-blue .hero-value { color: #1e1b4b; }
.hero-blue .hero-interpretive { color: #3730a3; }
.hero-blue .hero-sub { color: #3730a3; }

.hero-amber  { border: 1px solid rgba(202,138,4,.20); background: #fefce8; box-shadow: 0 2px 12px rgba(202,138,4,.08), 0 14px 36px rgba(202,138,4,.10); }
.hero-amber:hover { box-shadow: 0 4px 18px rgba(202,138,4,.14), 0 22px 52px rgba(202,138,4,.18); border-color: rgba(202,138,4,.34); }
.hero-amber .hero-value { color: #451a03; }
.hero-amber .hero-interpretive { color: #854d0e; }
.hero-amber .hero-sub { color: #854d0e; }

.hero-slate  { border: 1px solid rgba(100,116,139,.18); background: #f8fafc; box-shadow: 0 2px 12px rgba(15,23,42,.05), 0 14px 36px rgba(15,23,42,.07); }
.hero-slate:hover { box-shadow: 0 4px 18px rgba(15,23,42,.10), 0 22px 52px rgba(15,23,42,.14); border-color: rgba(100,116,139,.30); }
.hero-slate .hero-value { color: #0f172a; }
.hero-slate .hero-interpretive { color: #334155; }
.hero-slate .hero-sub { color: rgba(15,23,42,.50); }

/* ── Table section ──────────────────────────────────────────── */
.tsec {
  background: #fff; border: 1px solid rgba(13,110,253,.12); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(2,8,23,.06), 0 12px 32px rgba(2,8,23,.08); overflow: hidden; transition: box-shadow .22s;
}
.tsec:hover { box-shadow: 0 4px 16px rgba(2,8,23,.09), 0 20px 48px rgba(2,8,23,.11); }
.thd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(13,110,253,.10);
  background: linear-gradient(90deg, rgba(99,102,241,.06), rgba(6,182,212,.05), rgba(255,255,255,.70));
}
.ttitle  { font-size: 13px; font-weight: 800; color: #0b1b3a; }
.tbadge  { font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: rgba(99,102,241,.10); color: #3730a3; }
.thd-sep { flex: 1; }
.toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tsw     { position: relative; }
.tsico   { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--tx3); pointer-events: none; }
.tsearch {
  padding: 6px 10px 6px 26px; width: 160px; background: rgba(248,250,255,.95);
  border: 1px solid rgba(13,110,253,.14); border-radius: 6px;
  color: #0b1b3a; font-family: inherit; font-size: 12px; outline: none; transition: all .15s;
}
.tsearch:focus { border-color: #6366f1; width: 200px; }
.btn-exp { padding: 5px 11px; border-radius: 6px; background: rgba(255,255,255,.95); border: 1px solid rgba(13,110,253,.18); color: rgba(11,27,58,.9); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: all .14s; }
.btn-exp:hover { border-color: #6366f1; color: #4f46e5; background: rgba(99,102,241,.06); }
.tscroll { overflow-x: auto; }
.tscroll::-webkit-scrollbar { height: 4px; }
.tscroll::-webkit-scrollbar-thumb { background: rgba(13,110,253,.18); border-radius: 2px; }
.irt-t { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.irt-t thead th {
  padding: 10px 16px; text-align: center; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: rgba(15,23,42,.70);
  background: rgba(248,250,255,.95); border-bottom: 1px solid rgba(13,110,253,.10);
  white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 2; transition: color .14s;
}
.irt-t thead th:hover { color: #6366f1; }
.irt-t thead th.asc::after  { content: ' ↑'; color: #6366f1; }
.irt-t thead th.desc::after { content: ' ↓'; color: #6366f1; }
.irt-t tbody tr { border-bottom: 1px solid rgba(13,110,253,.08); transition: background .1s; }
.irt-t tbody tr:last-child { border-bottom: none; }
.irt-t tbody tr:nth-child(even) { background: rgba(15,23,42,.018); }
.irt-t tbody tr:hover { background: rgba(59,130,246,.07) !important; }
.irt-t th:first-child, .irt-t td:first-child { position: sticky; left: 0; z-index: 3; background: inherit; }
.irt-t thead th:first-child { z-index: 5; background: rgba(248,250,255,.98); }
.irt-t tbody td { padding: 10px 16px; color: rgba(15,23,42,.86); text-align: center; }
.irt-t td:first-child { font-weight: 700; color: #3730a3; }
.irt-t .num { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: rgba(15,23,42,.80); }
.irt-t .mdl span { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; background: rgba(99,102,241,.10); color: #3730a3; }
.tfoot { font-size: 11px; color: rgba(15,23,42,.50); padding: 8px 18px; border-top: 1px solid rgba(13,110,253,.08); background: rgba(248,250,255,.60); }

/* ── Alpha-if-deleted table (aid-t) ────────────────── */
.aid-t { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.aid-t th { padding: 9px 14px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(15,23,42,.70); background: rgba(248,250,255,.95); border-bottom: 1px solid rgba(13,110,253,.10); position: sticky; top: 0; z-index: 2; }
.aid-t td { padding: 9px 14px; border-bottom: 1px solid rgba(13,110,253,.08); color: rgba(15,23,42,.86); }
.aid-t tr:last-child td { border-bottom: none; }
.aid-t tbody tr:hover td { background: rgba(59,130,246,.05); }
.aid-t td:first-child { font-weight: 700; color: #3730a3; }
.aid-t thead tr.ia-group-row th { padding: 5px 14px 3px; border-bottom: none; font-size: 9px; font-weight: 800; letter-spacing: .10em; color: rgba(15,23,42,.30); background: rgba(248,250,255,.98); cursor: default; }
.aid-t thead tr.ia-group-row th.ia-grp-classic { color: rgba(99,102,241,.75);  border-left: 2px solid rgba(99,102,241,.20); }
.aid-t thead tr.ia-group-row th.ia-grp-disc    { color: rgba(16,185,129,.80);  border-left: 2px solid rgba(16,185,129,.22); }
.aid-t th.ia-col-classic-first { color: rgba(99,102,241,.80) !important; border-left: 2px solid rgba(99,102,241,.20); }
.aid-t th.ia-col-classic       { color: rgba(99,102,241,.80) !important; }
.aid-t th.ia-col-disc-first    { color: rgba(16,185,129,.85) !important; border-left: 2px solid rgba(16,185,129,.22); }
.aid-t td.ia-col-classic-first { border-left: 2px solid rgba(99,102,241,.12); }
.aid-t td.ia-col-disc-first    { border-left: 2px solid rgba(16,185,129,.15); }


/* ── Grouped header row ───────────────────────────────────────── */
.irt-t thead tr.ia-group-row th {
  font-size: 9px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  padding: 5px 16px 3px; border-bottom: none; color: rgba(15,23,42,.35);
  background: rgba(248,250,255,.98); cursor: default;
}
.irt-t thead tr.ia-group-row th.ia-grp-item {
  text-align: left; color: rgba(15,23,42,.30);
}
.irt-t thead tr.ia-group-row th.ia-grp-classic {
  text-align: center;
  border-left: 2px solid rgba(99,102,241,.20);
  color: rgba(99,102,241,.75);
}
.irt-t thead tr.ia-group-row th.ia-grp-disc {
  text-align: center;
  border-left: 2px solid rgba(16,185,129,.22);
  color: rgba(16,185,129,.80);
}
.irt-t thead tr.ia-group-row th.ia-grp-meta {
  text-align: center;
  border-left: 2px solid rgba(202,138,4,.20);
  color: rgba(202,138,4,.70);
}

/* ── Column identity borders on data rows ─────────────────────── */
.irt-t .ia-col-classic-first { border-left: 2px solid rgba(99,102,241,.12) !important; }
.irt-t .ia-col-disc-first    { border-left: 2px solid rgba(16,185,129,.15) !important; }
.irt-t .ia-col-meta-first    { border-left: 2px solid rgba(202,138,4,.13) !important; }

/* ── Column header text color identity ───────────────────────── */
.irt-t thead th.ia-col-classic { color: rgba(99,102,241,.80) !important; }
.irt-t thead th.ia-col-classic-first { color: rgba(99,102,241,.80) !important; border-left: 2px solid rgba(99,102,241,.20); }
.irt-t thead th.ia-col-disc    { color: rgba(16,185,129,.85) !important; }
.irt-t thead th.ia-col-disc-first { color: rgba(16,185,129,.85) !important; border-left: 2px solid rgba(16,185,129,.22); }
.irt-t thead th.ia-col-meta    { color: rgba(202,138,4,.80) !important; }
.irt-t thead th.ia-col-meta-first { color: rgba(202,138,4,.80) !important; border-left: 2px solid rgba(202,138,4,.20); }

/* ── Discrimination column subtle tint (replaces nth-child approach) ── */
.irt-t .ia-col-disc-hl {
  background-image: linear-gradient(180deg, rgba(16,185,129,.06), rgba(16,185,129,.015)) !important;
  font-weight: 700 !important;
}

/* ── Cell value colors by group ──────────────────────────────── */
.ia-val-classic { color: #4338ca; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.ia-val-disc    { color: #0d9668; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; }
.ia-val-meta    { color: #92660a; font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ── Flagged row — upgraded to milestone style ────────────────── */
.row-flagged {
  background-image: linear-gradient(90deg, rgba(239,68,68,.06), rgba(239,68,68,.02)) !important;
}
.row-flagged td:first-child {
  border-left: 3px solid #ef4444 !important;
  padding-left: calc(16px - 3px) !important;
}
[data-dark] .row-flagged {
  background-image: linear-gradient(90deg, rgba(239,68,68,.10), rgba(239,68,68,.03)) !important;
}

/* ── Placeholder ─────────────────────────────────────────────── */
.pholder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 60px 24px; text-align: center; box-shadow: var(--sh1); }
.ph-ico  { font-size: 52px; opacity: .3; margin-bottom: 14px; }
.ph-txt  { font-size: 14px; color: var(--tx3); font-weight: 500; }
.muted   { font-size: 11px; color: var(--tx3); line-height: 1.5; }

/* ── Topbar (hidden — replaced by Pacer navbar) ──────────────── */
.topbar { display: none !important; }

/* ============================================================
   SCORING PAGE — scoring.html only
   ============================================================ */

/* Source toggle */
.src-toggle { display: flex; gap: 3px; background: #e8ecf3; padding: 3px; border-radius: 11px; margin-bottom: 10px; }
.src-btn {
  flex: 1; padding: 7px 4px; border-radius: 8px; border: none; font-size: 11px; font-weight: 700;
  cursor: pointer; background: transparent; color: #4b5563; transition: all .13s; font-family: inherit; text-align: center; line-height: 1.3;
}
.src-btn.on { background: #fff; color: #3730a3; box-shadow: 0 1px 5px rgba(0,0,0,.12), 0 0 0 1.5px rgba(79,70,229,.25); }
.src-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Calibration loaded badge */
.calib-loaded { background: #eff6ff; border: 1px solid rgba(37,99,235,.20); border-radius: 10px; padding: 9px 11px; }
.calib-loaded-top { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.calib-dot   { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.calib-loaded-title { font-size: 11px; font-weight: 700; color: #1d4ed8; }
.calib-loaded-meta  { font-size: 10px; color: #64748b; line-height: 1.5; }
.calib-clear        { font-size: 10px; color: #94a3b8; cursor: pointer; margin-top: 4px; display: inline-block; }
.calib-clear:hover  { color: var(--err); }
.no-calib { background: #fef9c3; border: 1px solid rgba(202,138,4,.25); border-radius: 10px; padding: 8px 10px; font-size: 11px; font-weight: 600; color: #854d0e; line-height: 1.5; }

/* Format hint */
.fmt-hint { background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin-top: 8px; }
.fmt-hint-title { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; margin-bottom: 5px; }
.fmt-hint p { font-size: 10px; color: var(--tx3); line-height: 1.7; margin: 0; }
.fmt-hint code { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #3730a3; background: rgba(99,102,241,.08); padding: 1px 4px; border-radius: 3px; }

/* Plot cards */
.plots-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plot-card { background: #fff; border: 1px solid rgba(13,110,253,.12); border-radius: 16px; box-shadow: 0 2px 8px rgba(2,8,23,.06), 0 12px 32px rgba(2,8,23,.08); overflow: hidden; }
.plot-hd   { padding: 12px 16px 8px; border-bottom: 1px solid rgba(13,110,253,.10); background: linear-gradient(90deg, rgba(99,102,241,.06), rgba(6,182,212,.05), rgba(255,255,255,.70)); font-size: 12px; font-weight: 800; color: #0b1b3a; }
.plot-body { padding: 4px; }

/* ============================================================
   CALIBRATION PAGE — calibration.html only
   ============================================================ */

/* Accordion color theme overrides (calibration uses named variants) */
.acc-items, .acc-model, .acc-settings, .acc-priors, .acc-anchor, .acc-optimizer { background: #F6F8FB; }

/* Checkbox */
.cb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tx2); cursor: pointer; padding: 2px 0; }
.cb input { accent-color: var(--accent); }

/* Column list */
.csw     { position: relative; margin-bottom: 6px; }
.csico   { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--tx3); pointer-events: none; }
.csinput {
  width: 100%; padding: 6px 8px 6px 26px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r2);
  color: var(--tx); font-family: inherit; font-size: 12px; outline: none; transition: border-color .15s;
}
.csinput:focus { border-color: var(--accent); }
.cqrow { display: flex; gap: 5px; margin-bottom: 6px; }
.cqbtn {
  flex: 1; padding: 5px 4px; text-align: center; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--tx3); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.cqbtn:hover { border-color: var(--accent); color: var(--accent); }
.col-list { max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r2); }
.col-list::-webkit-scrollbar { width: 3px; }
.col-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.col-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; transition: background .1s; font-size: 12px; color: var(--tx2); font-weight: 500; }
.col-row:hover { background: var(--surface2); }
.col-row.on    { color: var(--accent); background: var(--acc-lt); }
.col-row input { accent-color: var(--accent); flex-shrink: 0; }
.col-count { font-size: 10px; color: var(--tx3); margin-top: 5px; }

/* Anchor rows */
.anc-row { display: flex; gap: 4px; align-items: center; margin-bottom: 5px; }
.anc-row select, .anc-row input {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--tx); font-family: inherit; font-size: 12px; padding: 5px 6px; outline: none;
}
.anc-row select { flex: 2; }
.anc-row select:nth-child(2) { flex: 1; }
.anc-row input { flex: 2; }
.anc-rm {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface2); color: var(--tx3); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s;
}
.anc-rm:hover { background: var(--err); border-color: var(--err); color: #fff; }
.btn-add-anc {
  width: 100%; padding: 6px; border-radius: 6px; background: none;
  border: 1.5px dashed var(--border); color: var(--accent);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; margin-top: 4px; text-align: center;
}
.btn-add-anc:hover { background: var(--acc-lt); border-color: var(--accent); }

/* Theme toggle button */
.btn-theme {
  display: flex; align-items: center; gap: 5px; padding: 6px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 20px;
  color: var(--tx2); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn-theme:hover { border-color: var(--accent); color: var(--accent); }

/* ICC pill */
.icc-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; border: 1.5px solid var(--accent);
  background: var(--acc-lt); color: var(--accent);
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap;
}
.icc-pill:hover { background: var(--accent); color: #fff; }
.fit-pill { border-color: #10b981; background: #f0fdf8; color: #059669; }
.fit-pill:hover { background: #10b981; color: #fff; }

/* Column tint highlights — now handled via named ia-col-* classes in itemAnalysis.html */

/* ============================================================
   RESPONSIVE — must stay at end of file so media queries
   override base rules correctly (cascade order)
   ============================================================ */
/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .nav { padding: 0 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}

/* ── FEATURES ROOT (landing page vanilla-JS section) ────────── */
@media (max-width: 680px) {
  #features-root [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── NAV BAR — responsive collapse ─────────────────────────── */

/* Hamburger button — hidden on desktop */
.pac-nav-hamburger {
  display: none;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  color: #fff; cursor: pointer; font-size: 18px; line-height: 1;
  align-items: center; justify-content: center; flex-shrink: 0;
  font-family: inherit;
}

/* Mobile nav drawer */
.pac-nav-drawer {
  display: none;
  position: fixed; top: 58px; left: 0; right: 0;
  background: linear-gradient(135deg, #0a3d6e 0%, #0B4A8B 50%, #0d5299 100%);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 32px rgba(2,8,23,.30);
  z-index: 9998; padding: 12px 16px 16px;
  flex-direction: column; gap: 4px;
  animation: nav-drawer-in .18s ease;
}
@keyframes nav-drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pac-nav-drawer.open { display: flex; }

.pac-drawer-link {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: rgba(255,255,255,.85); text-decoration: none;
  font-size: 14px; font-weight: 700; border: 1px solid transparent;
  transition: background .13s, color .13s;
}
.pac-drawer-link:hover { background: rgba(255,255,255,.10); color: #fff; }
.pac-drawer-link.active { background: rgba(255,255,255,.13); color: #fff; }

.pac-drawer-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.40);
  padding: 10px 14px 4px; margin-top: 4px;
}
.pac-drawer-sep { height: 1px; background: rgba(255,255,255,.10); margin: 8px 0; }

@media (max-width: 860px) {
  .pac-nav-links  { display: none; }
  .pac-nav-hamburger { display: inline-flex; }
  .pac-chip { display: none; }
  .pac-nav-sep { display: none; }
}

/* ── APP SHELL — sidebar responsive collapse ────────────────── */

.sb-toggle-btn {
  display: none;
  position: fixed; bottom: 20px; right: 20px; z-index: 9000;
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; border: none; cursor: pointer; font-size: 20px;
  box-shadow: 0 4px 20px rgba(79,70,229,.45);
  align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.sb-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(79,70,229,.55); }

.sb-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(6,8,20,.50);
  backdrop-filter: blur(4px);
  animation: sb-overlay-in .2s ease;
}
@keyframes sb-overlay-in { from { opacity: 0; } to { opacity: 1; } }
.sb-overlay.visible { display: block; }

/* Sidebar always has a transition so the slide animation works when toggled */
.sidebar {
  transition: transform .22s cubic-bezier(0.16,1,0.3,1);
}

@media (max-width: 860px) {
  .sb-toggle-btn { display: inline-flex; }

  /* Hide sidebar off-screen — user must tap FAB to open */
  .sidebar {
    transform: translateX(-100%);
    z-index: 210;
    box-shadow: none;
  }
  /* When FAB is tapped, JS adds .sb-open */
  .sidebar.sb-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(2,8,23,.22);
  }

  /* Main fills full width when sidebar is off-screen */
  .main { margin-left: 0; }
  .plots-row { grid-template-columns: 1fr; }
}

/* On desktop the sidebar is always visible — undo any transform */
@media (min-width: 861px) {
  .sidebar {
    transform: translateX(0) !important;
  }
  .main { margin-left: var(--sb); }
}

@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px; }
  .tsearch { width: 120px; }
  .tsearch:focus { width: 150px; }
}

/* ── PLOTS ROW — stack on smaller laptops ───────────────────── */
@media (max-width: 1200px) {
  .plots-row { grid-template-columns: 1fr; }
}
