/* ==========================================================================
   VECA 2026 — Light Consulting-Report Theme
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  --bg-page: #F7F7F7;
  --bg-card: #FFFFFF;
  --bg-surface: #F9FAFB;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --text-primary: #1A1A1A;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: #EFF6FF;
  --accent-border: #BFDBFE;
  --green: #059669;
  --green-light: #ECFDF5;
  --green-bg: #D1FAE5;
  --amber: #F59E0B;
  --amber-dark: #D97706;
  --amber-light: #FFF7ED;
  --amber-bg: #FEF3C7;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --red-bg: #FEE2E2;
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'Menlo', monospace;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
  --nav-height: 64px;
  --sub-nav-height: 48px;
  --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
select { font-family: inherit; }

/* --- Material Icons --- */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ==========================================================================
   TOP NAV
   ========================================================================== */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-height);
  padding: 0 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-size: 20px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-primary);
}
.mode-toggle {
  display: flex; gap: 2px;
  background: var(--border-light);
  border-radius: var(--radius);
  padding: 4px;
  height: 36px;
}
.mode-btn {
  padding: 0 16px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.mode-btn--active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.nav-export {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--accent);
  transition: color var(--transition);
}
.nav-export:hover { color: var(--accent-hover); }
.nav-export .material-symbols-rounded { font-size: 18px; }

/* ==========================================================================
   SUB NAV (TABS)
   ========================================================================== */
.sub-nav {
  display: flex; align-items: center; gap: 0;
  height: var(--sub-nav-height);
  padding: 0 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.sub-tab {
  display: flex; align-items: center; gap: 6px;
  height: var(--sub-nav-height);
  padding: 0 20px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.sub-tab:hover { color: var(--text-secondary); }
.sub-tab--active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.sub-tab .material-symbols-rounded { font-size: 18px; }

/* ==========================================================================
   FILTER BAR
   ========================================================================== */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  height: 56px;
  padding: 0 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.filter-icon { font-size: 20px; color: var(--text-secondary); }
.filter-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.filter-select-wrap { position: relative; }
.filter-select {
  appearance: none;
  padding: 6px 32px 6px 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--border-light);
  font-size: 12px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}
.filter-select-wrap::after {
  content: '▾';
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px; color: var(--text-secondary);
  pointer-events: none;
}

/* ==========================================================================
   VIEW CONTAINERS
   ========================================================================== */
.report-container, .analyst-container { min-height: calc(100vh - var(--nav-height)); }
.analyst-container--hidden, .view--hidden { display: none; }
.view-inner { padding: 40px 80px; max-width: 1440px; margin: 0 auto; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
.view-title {
  font-size: 32px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 8px;
}
.view-subtitle {
  font-size: 16px; color: var(--text-secondary);
  margin-bottom: 32px; max-width: 700px;
}
.section-title {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 8px;
}
.section-subtitle {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 20px;
}
.section-block { margin-bottom: 48px; }

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 12px;
}
.card-subtitle {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 16px;
}

/* KPI Cards */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.kpi-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.kpi-value {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0;
}
.kpi-sub { font-size: 11px; color: var(--text-muted); }

/* Dataset Scope */
.dataset-note {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.dataset-note-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.dataset-note-desc {
  font-size: 13px;
  color: var(--text-secondary);
}
.dataset-note-foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.access-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.access-badge--green {
  background: var(--green-light);
  color: var(--green);
}
.access-badge--amber {
  background: var(--amber-light);
  color: var(--amber-dark);
}
.access-badge--red {
  background: var(--red-light);
  color: var(--red);
}
.access-badge--muted {
  background: var(--border-light);
  color: var(--text-secondary);
}

/* Exception Cards */
.exception-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.exception-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.exception-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.exception-card-count {
  font-size: 12px;
  color: var(--text-secondary);
}
.exception-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.exception-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exception-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  text-align: left;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.exception-item:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.exception-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.exception-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Opportunity Cards */
.opp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.opp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.opp-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.opp-card-icon .material-symbols-rounded { font-size: 22px; }
.opp-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.opp-card-metric {
  font-family: var(--font-mono);
  font-size: 24px; font-weight: 700;
}
.opp-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ==========================================================================
   GRIDS & LAYOUTS
   ========================================================================== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sidebar-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; }

/* ==========================================================================
   TRUST BANNER
   ========================================================================== */
.trust-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.trust-banner .material-symbols-rounded { font-size: 24px; color: var(--accent); }
.trust-banner-text { font-size: 14px; color: var(--accent); font-weight: 500; }

/* ==========================================================================
   BADGES & GRADES
   ========================================================================== */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; font-family: var(--font-body);
}

/* Store type badges */
.store-type-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  white-space: nowrap;
}
.store-type-badge--retailer {
  background: #eef2ff; color: #4f46e5;
}
.store-type-badge--brand {
  background: #fef3c7; color: #b45309;
}
.podium-name-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; margin-bottom: 4px;
}
.col-store-type { width: 64px; }
.modal-brands-note {
  font-size: 11px; color: var(--text-muted);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grade-a-plus, .grade-a { background: var(--green-light); color: var(--green); }
.grade-b-plus, .grade-b { background: var(--amber-light); color: var(--amber-dark); }
.grade-c, .grade-d { background: var(--red-light); color: var(--red); }

.phase-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.phase-pre { background: var(--accent-light); color: var(--accent); }
.phase-during { background: var(--green-light); color: var(--green); }
.phase-post { background: var(--amber-light); color: var(--amber-dark); }

/* ==========================================================================
   TABLES
   ========================================================================== */
.rankings-table-wrap {
  overflow: hidden; /* clip border-radius on desktop */
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table thead th {
  padding: 10px 20px;
  background: var(--bg-surface);
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.data-table tbody td {
  padding: 10px 20px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-surface); }
.data-table .col-rank {
  font-family: var(--font-mono); font-weight: 700; width: 40px;
}
.data-table .col-name { font-weight: 600; cursor: pointer; }
.data-table .col-name:hover { color: var(--accent); }
.data-table .col-market { color: var(--text-secondary); width: 60px; }
.data-table .col-score {
  font-family: var(--font-mono); font-weight: 600; font-size: 11px; width: 50px;
}
.data-table .col-total {
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; width: 60px;
}
.data-table .col-grade { width: 50px; }
.data-table .col-traffic { min-width: 108px; }
.traffic-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.traffic-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.traffic-value--estimate { color: var(--amber-dark); }
.traffic-value--missing { color: var(--text-muted); }
.traffic-source-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.04em;
  opacity: 0.75;
  align-self: flex-start;
}
.traffic-meta {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Expand row for show-more */
.table-expand {
  text-align: center; padding: 12px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  cursor: pointer;
  border-top: 1px solid var(--border-light);
}
.table-expand:hover { background: var(--accent-light); }

/* ==========================================================================
   SCORE COLORS (applied via JS)
   ========================================================================== */
.score-green { color: var(--green); }
.score-amber { color: var(--amber); }
.score-red { color: var(--red); }

/* ==========================================================================
   METHODOLOGY PAGE
   ========================================================================== */
.method-steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 40px;
}
.method-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.method-step-num {
  width: 32px; height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
}
.method-step-title { font-size: 15px; font-weight: 700; }
.method-step-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.score-scale {
  display: flex; gap: 12px;
}
.score-scale-item {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
}
.score-scale-num {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  display: block; margin-bottom: 4px;
}
.score-scale-label { font-size: 12px; font-weight: 600; }

.dim-table-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.dim-table {
  width: 100%;
  background: var(--bg-card);
  border-collapse: collapse;
  border: none;
}
.dim-table thead th {
  padding: 10px 24px;
  background: var(--bg-surface);
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.dim-table tbody td {
  padding: 10px 24px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.dim-table tbody tr:last-child td { border-bottom: none; }
.dim-table .dim-name { font-weight: 600; }
.dim-table .dim-weight {
  font-family: var(--font-mono); font-weight: 600;
}
.dim-table .dim-cases {
  font-family: var(--font-mono); color: var(--text-secondary);
}

.source-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.source-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.source-card-icon .material-symbols-rounded { font-size: 28px; }
.source-card-title { font-size: 15px; font-weight: 700; }
.source-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.source-tag {
  display: inline-block;
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.calc-step { margin-bottom: 24px; }
.calc-step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.calc-step-num {
  width: 28px; height: 28px;
  background: var(--accent); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.calc-step-title { font-size: 16px; font-weight: 700; }
.calc-step-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 8px;
}
.calc-formula {
  display: inline-block;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
}
.calc-divider {
  height: 1px; background: var(--border-light);
  margin: 24px 0;
}
.calc-example {
  padding: 16px 20px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius);
}
.calc-example-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.calc-example-line { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.fairness-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}
.fairness-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.fairness-header .material-symbols-rounded { font-size: 28px; color: var(--green); }
.fairness-title { font-size: 20px; font-weight: 700; }
.fairness-item {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 12px;
}
.fairness-check { color: var(--green); font-weight: 700; font-size: 14px; }
.fairness-text { font-size: 14px; color: #4B5563; line-height: 1.6; }
.fairness-footer { font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* ==========================================================================
   ANALYST SIDEBAR
   ========================================================================== */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.sidebar-card-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 12px;
}
.market-bar-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.market-bar-label {
  font-size: 12px; color: var(--text-secondary);
  width: 80px; flex-shrink: 0;
}
.market-bar-bg {
  flex: 1; height: 20px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.market-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}
.market-bar-val {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  width: 40px; flex-shrink: 0;
}

.weak-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.weak-rank { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.weak-name { font-size: 12px; font-weight: 600; }
.weak-score { font-family: var(--font-mono); font-size: 11px; }

.platform-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.platform-stat {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
}
.platform-stat-val {
  font-family: var(--font-mono);
  font-size: 24px; font-weight: 700;
}
.platform-stat-label { font-size: 11px; color: var(--text-secondary); }
.platform-stat-pct {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-muted);
}

/* ==========================================================================
   CHARTS
   ========================================================================== */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap--square { aspect-ratio: 1; }
.chart-wrap--wide { height: 300px; }
.chart-wrap--tall { height: 400px; }

/* Histogram bars */
.hist-area {
  display: flex; gap: 4px; align-items: flex-end;
  height: 140px; padding-bottom: 20px;
}
.hist-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.hist-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
}

/* ==========================================================================
   PODIUM (Top 3)
   ========================================================================== */
.podium-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 32px;
}
.podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
}
.podium-rank {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.podium-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; } /* kept for any other reference */
.podium-market { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.podium-score {
  font-family: var(--font-mono);
  font-size: 32px; font-weight: 700;
}
.podium-traffic {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.podium-phases {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 12px;
}
.podium-phase { text-align: center; }
.podium-phase-label { font-size: 11px; color: var(--text-muted); }
.podium-phase-val {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
}
.podium-card:nth-child(1) { border-top: 3px solid #EAB308; }
.podium-card:nth-child(2) { border-top: 3px solid #94A3B8; }
.podium-card:nth-child(3) { border-top: 3px solid #D97706; }

/* ==========================================================================
   HEATMAP
   ========================================================================== */
.heatmap-wrap { overflow-x: auto; }
.heatmap-table { border-collapse: collapse; width: 100%; }
.heatmap-table th, .heatmap-table td {
  padding: 8px 12px; font-size: 11px; text-align: center;
}
.heatmap-table th {
  font-weight: 600; color: var(--text-secondary);
  background: var(--bg-surface);
}
.heatmap-table th:first-child { text-align: left; }
.heatmap-cell {
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-weight: 600;
  min-width: 52px;
}

/* ==========================================================================
   REGION CARDS
   ========================================================================== */
.region-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 32px;
}
.region-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.region-card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.region-dot { width: 10px; height: 10px; border-radius: 50%; }
.region-card-title { font-size: 16px; font-weight: 700; }
.region-stat { margin-bottom: 8px; }
.region-stat-label { font-size: 12px; color: var(--text-secondary); }
.region-stat-value {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.modal-overlay[hidden] { display: none; }
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 900px; width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  font-size: 24px; color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--border-light); }
.modal-header { padding: 32px 32px 0; }
.modal-body { padding: 24px 32px 32px; }
.modal-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.modal-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.modal-section-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 16px;
}
.modal-screenshots {
  padding: 12px 32px 0;
}

/* Carousel */
.screenshot-carousel {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  outline: none;
}
.carousel-img-wrap {
  width: 100%; height: 220px;
  background: var(--bg-page);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.carousel-img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  transition: opacity 0.2s;
  display: block;
}
.carousel-note {
  font-size: 12px; color: var(--text-primary);
  font-weight: 600; line-height: 1.45; padding: 0 2px;
  margin: 0;
}
.carousel-desc {
  font-size: 11px; color: var(--text-secondary);
  line-height: 1.5; padding: 2px 2px 0;
  margin: 0;
  max-height: 60px;
  overflow-y: auto;
}
.carousel-empty {
  font-size: 12px; color: var(--text-muted); padding: 12px 4px;
  text-align: center; font-style: italic; margin: 0;
}
.carousel-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.carousel-btn {
  width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-primary);
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.carousel-btn:hover { background: var(--accent-light); }
.carousel-indicator { font-size: 12px; color: var(--text-muted); min-width: 40px; text-align: center; }

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  color: white; font-size: 32px;
}
.lightbox-body { max-width: 90vw; max-height: 72vh; }
.lightbox-img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.lightbox-caption {
  color: rgba(255,255,255,0.7);
  font-size: 14px; text-align: center;
  margin-top: 12px;
}
.lightbox-notes {
  color: rgba(255,255,255,0.5);
  font-size: 12px; text-align: center; line-height: 1.5;
  max-width: 680px; margin-top: 6px; padding: 0 16px;
}

/* ==========================================================================
   ERROR OVERLAY
   ========================================================================== */
.error-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
}
.error-overlay[hidden] { display: none; }
.error-content { text-align: center; }
.error-content h2 { font-size: 24px; margin-bottom: 12px; }
.error-content p { color: var(--text-secondary); margin-bottom: 20px; }
.error-content code {
  background: var(--border-light); padding: 2px 6px;
  border-radius: var(--radius-sm); font-family: var(--font-mono);
}
.btn-primary {
  padding: 10px 24px;
  background: var(--accent); color: white;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
  .view-inner { padding: 32px 40px; }
  .sidebar-layout { grid-template-columns: 1fr 320px; }
}
@media (max-width: 960px) {
  .view-inner { padding: 24px 20px; }
  .top-nav { padding: 0 20px; }
  .sub-nav { padding: 0 20px; }
  .filter-bar { padding: 0 20px; }
  .opp-grid, .three-col, .method-steps, .source-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .podium-row { grid-template-columns: 1fr; }
  .region-grid { grid-template-columns: 1fr; }
  .modal-two-col { grid-template-columns: 1fr; }
  .modal-overlay { padding: 20px; }
}
@media (max-width: 640px) {
  .nav-export span:not(.material-symbols-rounded) { display: none; }
  .mode-btn { padding: 0 12px; font-size: 12px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .score-scale { flex-wrap: wrap; }
  /* Table scroll on mobile */
  .dim-table-wrap, .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rankings-table-wrap { overflow-x: auto; overflow-y: visible; }
  .dim-table thead th, .dim-table tbody td { padding: 8px 12px; font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 8px 12px; font-size: 11px; }
  /* Modal tighter on phone */
  .modal-overlay { padding: 12px; }
  .modal-body { padding: 16px; max-height: 88vh; }
  .modal-header { padding: 12px 16px; }
  /* View inner tighter */
  .view-inner { padding: 16px 14px; }
  .section-title { font-size: 16px; }
  .view-title { font-size: 20px; }
  /* Sub-nav: compact tabs on phone */
  .sub-nav { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; padding: 0 12px; }
  .sub-tab { padding: 0 12px; font-size: 12px; }
  .sub-tab .material-symbols-rounded { display: none; }
  .sub-nav-btn { flex-shrink: 0; }
  /* Filter bar wrap */
  .filter-bar { flex-wrap: wrap; gap: 6px; padding: 8px 14px; height: auto; min-height: 44px; }
  /* KPI cards smaller */
  .kpi-card { padding: 12px 14px; }
  .kpi-value { font-size: 24px; }
}
@media (max-width: 480px) {
  .dim-table thead th, .dim-table tbody td { padding: 6px 10px; font-size: 11px; }
  .dim-table .dim-name { min-width: 90px; }
  .top-nav-title { font-size: 13px; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ==========================================================================
   TEST CASES SEARCH (Methodology Tab)
   ========================================================================== */
.tc-search-bar { margin-bottom: 16px; }
.tc-search-input {
  width: 100%; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font-body);
  background: var(--bg-card); color: var(--text-primary);
  outline: none; margin-bottom: 10px;
}
.tc-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.tc-filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tc-dim-btn {
  font-size: 11px; font-weight: 500; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; transition: 0.15s;
}
.tc-dim-btn:hover, .tc-dim-btn--active { background: var(--accent); color: white; border-color: var(--accent); }
.tc-result-count { font-size: 12px; color: var(--text-muted); }
.tc-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.tc-case-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tc-case-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tc-case-id { font-size: 10px; font-weight: 700; font-family: var(--font-mono); color: var(--text-muted); }
.tc-smok-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.tc-smok-s1 { background: #FEE2E2; color: #B91C1C; }
.tc-smok-s2 { background: #FECACA; color: #DC2626; }
.tc-smok-s3 { background: #FEF3C7; color: #D97706; }
.tc-smok-s4 { background: #D1FAE5; color: #065F46; }
.tc-smok-s5 { background: #A7F3D0; color: #065F46; }
.tc-smok-na { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border); }
.tc-case-title { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.tc-case-scales { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.tc-scale-row { display: flex; align-items: flex-start; gap: 6px; }
.tc-scale-num { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.tc-scale-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.3; }
.tc-case-evidence { font-size: 10px; color: var(--text-muted); padding-top: 6px; border-top: 1px solid var(--border-light); line-height: 1.3; }

/* limitedData indicator */
.dim-limited-tag {
  font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px;
  background: var(--amber-bg); color: var(--amber-dark);
  margin-left: 4px; vertical-align: middle;
  cursor: help;
}
.limited-data-explain {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
  margin-top: 10px; padding: 8px 10px;
  background: var(--amber-bg); border-left: 3px solid var(--amber-dark);
  border-radius: var(--radius-sm);
}

/* Screenshot notes */
.screenshot-item { display: flex; flex-direction: column; gap: 4px; }
.screenshot-note { font-size: 10px; color: var(--text-muted); line-height: 1.3; max-width: 120px; }

/* SMOK audit link in nav */
.nav-smok-link {
  font-size: 13px; font-weight: 500; color: var(--accent);
  text-decoration: none; padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--accent-border); background: var(--accent-light);
  transition: 0.15s;
}
.nav-smok-link:hover { background: var(--accent); color: white; }

@media (max-width: 900px) { .tc-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tc-cards-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  .top-nav, .sub-nav, .filter-bar, .nav-export { display: none; }
  /* Only unhide report views; analyst container stays hidden when in report mode */
  #report-container .view--hidden { display: block !important; }
  .view-inner { padding: 20px; }
  body { background: white; }
}

/* ========= Pitch Hero ========= */
.pitch-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.pitch-hero-number {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.pitch-hero-denom {
  font-size: 2.5rem;
  color: var(--text-muted);
  font-weight: 700;
}
.pitch-hero-label {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-top: 0.75rem;
  font-weight: 600;
}
.pitch-hero-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  letter-spacing: 0.06em;
}

/* ========= Rubric 98 Test Cases ========= */
.rubric-dim-group {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.rubric-dim-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: var(--bg-surface);
  user-select: none;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
}
.rubric-dim-summary::-webkit-details-marker { display: none; }
.rubric-dim-summary:hover { background: var(--accent-light, #EEF2FF); }
.rubric-dim-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  background: var(--bg-base);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.rubric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.rubric-th {
  background: var(--bg-base);
  padding: 0.45rem 0.65rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.rubric-row td, .rubric-row-alt td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
}
.rubric-row-alt { background: var(--bg-surface); }
.rubric-id {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  width: 72px;
}
.rubric-title { font-weight: 600; width: 130px; }
.rubric-desc { color: var(--text-secondary); width: 190px; font-size: 0.75rem; }
.rubric-score { width: 150px; font-size: 0.75rem; }
.rubric-score-1 { color: var(--red, #DC2626); }
.rubric-score-3 { color: var(--amber-dark, #92400E); }
.rubric-score-5 { color: var(--green, #16A34A); }

/* CEO summary is the new hero entry point — hide old hardcoded pitch-hero */
.pitch-hero { display: none; }

/* ============================================================
   Screenshot Gallery (截图库)
   ============================================================ */
.gallery-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.gallery-filter-wrap {}
.gallery-filter-select {
  appearance: none;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%236B7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 160px;
}
.gallery-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}
.gallery-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.gallery-market-section {}
.gallery-market-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.gallery-site-block {
  margin-bottom: 28px;
}
.gallery-site-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.gallery-site-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.gallery-site-domain {
  font-size: 12px;
  color: var(--text-muted);
}
.gallery-site-score {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.gallery-thumb {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.gallery-thumb:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.gallery-thumb[data-status="not_found"] {
  opacity: 0.6;
}
.gallery-thumb-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  display: block;
  background: var(--bg-surface);
}
.gallery-thumb-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 8px 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.gallery-thumb-note {
  font-size: 10.5px;
  color: var(--text-secondary);
  padding: 0 8px 8px;
  line-height: 1.5;
  flex: 1;
}
.gallery-thumb-status {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.gallery-thumb-status--captured {
  background: var(--green-bg);
  color: var(--green);
}
.gallery-thumb-status--not_found {
  background: var(--red-bg);
  color: var(--red);
}
.gallery-thumb-status--partial {
  background: var(--amber-bg);
  color: var(--amber-dark);
}
.gallery-thumb-status--blocked,
.gallery-thumb-status--error,
.gallery-thumb-status--failed {
  background: #F3F4F6;
  color: var(--text-muted);
}
.gallery-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px;
  font-size: 14px;
}
