@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f8f7fa;
  --panel: #fff;
  --surface: #fff;
  --ink: #1a1a2e;
  --ink-secondary: #3d3d5c;
  --muted: #7a7a99;
  --accent: #7bada5;
  --accent-dark: #5a918a;
  --accent-soft: rgba(123, 173, 165, 0.12);
  --accent-pale: rgba(123, 173, 165, 0.06);
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.13);
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { appearance: none; }

/* ── Layout shell ── */

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar panel ── */

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.panel-header { display: grid; gap: 8px; }

.panel-brand {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.brand-logo { display: block; width: 64px; height: auto; }

.panel h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.subhead {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── View tabs ── */

.view-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.view-tab {
  flex: 1;
  border: none;
  border-radius: 4px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.view-tab:hover { color: var(--ink-secondary); }

.view-tab.is-active {
  background: var(--accent);
  color: #fff;
}

/* ── Sidebar sections ── */

.sidebar-view {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-view.is-active { display: flex; }

.control-stack { display: flex; flex-direction: column; gap: 10px; }

.control-group {
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: visible;
}

.control-group > label:first-child:not(.pill-input):not(.checkbox-chip) {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Sidebar details (collapsible) ── */

.sidebar-details {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.sidebar-details summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-details summary::before {
  content: "▸";
  font-size: 0.7rem;
  transition: transform 150ms;
}

.sidebar-details[open] summary::before {
  transform: rotate(90deg);
}

.sidebar-details summary::-webkit-details-marker { display: none; }

.sidebar-details-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

/* ── Main workspace ── */

.workspace {
  min-width: 0;
  padding: 24px 28px;
  background: var(--bg);
}

.workspace-view { display: none; }

.workspace-view.is-active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Page header ── */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.page-header .muted {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

/* ── Tags ── */

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ── KPI row ── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi-row:has(.kpi:nth-child(5)) {
  grid-template-columns: repeat(5, 1fr);
}
.kpi-row:has(.kpi:nth-child(5)) .kpi { padding: 10px 10px; }
.kpi-row:has(.kpi:nth-child(5)) .kpi-value { font-size: 1.05rem; }

.kpi {
  padding: 12px 14px;
  background: var(--surface);
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-value {
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.kpi-note {
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ── Delta note ── */

.delta-note {
  margin: 0;
  padding: 8px 12px;
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

/* ── Chart wrap ── */

.chart-wrap {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
}

.chart-wrap canvas {
  width: 100% !important;
}

.chart-wrap--main {
  min-height: 500px;
}

.chart-wrap--main canvas {
  min-height: 480px;
}

.chart-wrap--scatter {
  min-height: 480px;
}

.chart-wrap--scatter canvas {
  min-height: 460px;
}

/* ── Fare-type overlay (inside chart, top-right) ── */

.fare-type-overlay {
  position: absolute;
  top: 52px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.88);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.72rem;
  z-index: 5;
  pointer-events: auto;
}

.fare-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--ink-secondary);
  font-weight: 500;
  user-select: none;
  transition: opacity 150ms;
}

.fare-type-btn:hover {
  opacity: 0.7;
}

.fare-type-btn.is-dimmed {
  color: #aaa;
  text-decoration: line-through;
}

.fare-type-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.fare-type-swatch--solid {
  background: var(--accent);
}

.fare-type-swatch--striped {
  background: repeating-linear-gradient(
    -45deg,
    var(--accent),
    var(--accent) 3px,
    rgba(255,255,255,0.5) 3px,
    rgba(255,255,255,0.5) 5px
  );
}

.fare-type-swatch--circle {
  border-radius: 50%;
  background: var(--accent);
}

.fare-type-swatch--diamond {
  width: 12px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.fare-type-swatch--striped-diamond {
  width: 12px;
  height: 12px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  background: repeating-linear-gradient(
    -45deg,
    var(--accent),
    var(--accent) 3px,
    rgba(255,255,255,0.5) 3px,
    rgba(255,255,255,0.5) 5px
  );
}

.fare-type-overlay .info-tip {
  margin-left: 2px;
}

/* ── Legend row ── */

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--muted);
  cursor: pointer;
  transition: opacity 150ms;
}

.legend-item:hover { color: var(--ink-secondary); }

.legend-item.is-dimmed {
  opacity: 0.35;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Insights ── */

.insights {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.insights p {
  margin: 0 0 4px;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.insights p:last-child { margin-bottom: 0; }

/* ── Two-column layout ── */

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ── Section labels ── */

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}
.section-label--ghost {
  visibility: hidden;
}

/* ── Fact rows ── */

.fact-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.fact-row span { color: var(--muted); }
.fact-row strong { color: var(--ink); font-weight: 600; text-align: right; }

/* ── Tables ── */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: var(--bg);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  color: var(--muted);
}

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  vertical-align: top;
}

tbody tr:hover { background: var(--accent-pale); }

/* ── Note and meta lists ── */

.note-list, .meta-list {
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
}

.note-list { padding-left: 16px; color: var(--muted); }
.note-list.compact { gap: 4px; font-size: 0.78rem; }
.note-list strong { color: var(--ink); }

.meta-list { padding: 0; list-style: none; }

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}

.meta-list li span { color: var(--muted); }
.meta-list li strong { font-weight: 600; }

.sidebar-caveats-plain li {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: none;
}

/* ── Muted utility ── */

.muted { color: var(--muted); }

/* ── Info tooltips ── */

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border-strong);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

/* Tooltip popup — rendered by JS at body level to escape overflow */
.tip-popup {
  position: fixed;
  max-width: 320px;
  padding: 8px 11px;
  border-radius: 6px;
  background: rgba(45,45,55,0.95);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 120ms;
}
.tip-popup.is-visible { opacity: 1; }
.tip-popup b { font-weight: 600; }

/* ── City map embed ── */

.city-map {
  width: 100%;
  height: 240px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.map-link-btn {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ── Pill with tip wrapper ── */

.pill-with-tip {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill-with-tip .pill-input { flex: 1; min-width: 0; }

/* ── Fare intro ── */

.fare-intro {
  margin: 0 0 6px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.fare-intro strong { color: var(--ink); }

/* ── Form controls ── */

select, input[type="text"], input[type="search"] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
}

select:focus, input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

/* ── Pill inputs (radio/checkbox styled) ── */

.pill-grid { display: grid; gap: 4px; overflow: visible; }
.pill-grid--two { grid-template-columns: repeat(2, 1fr); }
.check-grid { display: grid; gap: 4px; }

.pill-input, .checkbox-chip { position: relative; }

.pill-input input, .checkbox-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.pill-input span, .checkbox-chip span {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: border-color 100ms, background 100ms, color 100ms;
}

.pill-input span {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.checkbox-chip span { font-size: 0.75rem; }
.checkbox-chip--dense span { padding: 5px 7px; }

.pill-input input:checked + span,
.checkbox-chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pill-input span:hover,
.checkbox-chip span:hover {
  border-color: var(--accent);
}

/* ── Scrollbars ── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Methodology overlay ── */

/* ── Bottom sidebar links ── */

.sidebar-bottom-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.sidebar-details {
  margin-top: 0 !important;
}

.disclaimer-link {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  color: #b08820;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.disclaimer-link:hover { text-decoration: underline; }

/* ── Disclaimer modal ── */

.disclaimer-modal[hidden] { display: none; }

.disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: disclaimerFadeIn 180ms ease-out;
}

@keyframes disclaimerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.disclaimer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.disclaimer-modal-card {
  position: relative;
  width: 560px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.disclaimer-modal-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #b08820;
}

.disclaimer-modal-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.disclaimer-modal-card strong { color: var(--ink); }

.disclaimer-contact {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}
.disclaimer-contact a { color: var(--accent-dark); }

.disclaimer-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}

.disclaimer-modal-close:hover { background: var(--accent-soft); }

.methodology-link {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.methodology-link:hover { text-decoration: underline; }

/* ── Chart click hint ── */

.chart-click-hint {
  position: absolute;
  top: 18%;
  right: 10%;
  z-index: 4;
  display: inline-block;
  width: 120px;
  padding: 7px 10px 10px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: center;
  pointer-events: none;
  opacity: 0.85;
}

.methodology-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  overflow-y: auto;
  animation: methodFadeIn 200ms ease-out;
}

.methodology-overlay[hidden] { display: none; }

@keyframes methodFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.methodology-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.methodology-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1001;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}

.methodology-close:hover { background: var(--accent-soft); }

.methodology-back {
  position: fixed;
  top: 16px;
  left: 20px;
  z-index: 1001;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 120ms;
}
.methodology-back:hover { background: var(--accent-soft); }

.methodology-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.methodology-header h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.methodology-header .subhead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Methodology tabs */
.methodology-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 28px;
}

.methodology-tab {
  flex: 1;
  border: none;
  border-radius: 4px;
  padding: 9px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.methodology-tab:hover { color: var(--ink-secondary); }
.methodology-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.methodology-panel { display: none; }
.methodology-panel.is-active { display: block; }

/* Benchmark highlight in findings */
.finding-benchmark-highlight {
  color: var(--accent-dark);
  font-weight: 700;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 3px;
}

.methodology-toc {
  margin-bottom: 28px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.methodology-toc .section-label {
  display: block;
  margin-bottom: 8px;
}

.methodology-toc ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
}

.methodology-toc a { color: var(--accent-dark); }

.methodology-section {
  margin-bottom: 32px;
  scroll-margin-top: 20px;
}

.methodology-section h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.methodology-section h3 {
  margin: 16px 0 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.methodology-section p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.methodology-list {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-secondary);
  display: grid;
  gap: 6px;
}

.methodology-list strong { color: var(--ink); }

.methodology-definitions { margin: 0 0 10px; }

.methodology-definitions dt {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 12px;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.methodology-definitions dd {
  margin: 4px 0 0 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.methodology-formula {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  font-family: "Space Grotesk", monospace;
}

.methodology-caveat {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fef9e7;
  border-left: 3px solid #f0c040;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

/* Data-at-a-glance table */
.glance-table-wrap {
  margin: 16px 0 20px;
}
.glance-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.5;
}
.glance-table col.col-label { width: 24%; }
.glance-table col.col-region { width: 15.2%; }
.glance-table th,
.glance-table td {
  padding: 7px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.glance-table th {
  background: var(--surface);
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.glance-table td:first-child,
.glance-table th:first-child {
  text-align: left;
}
.glance-table .col-total {
  border-left: 2px solid var(--border);
  font-weight: 600;
}
.glance-table tfoot td {
  border-top: 2px solid var(--accent);
  border-bottom: none;
  background: var(--surface);
}

/* Heat-map cell shading (accent green scale) */
.glance-table .heat-0 { color: var(--muted); }
.glance-table .heat-1 { background: rgba(123,173,165,0.10); }
.glance-table .heat-2 { background: rgba(123,173,165,0.18); }
.glance-table .heat-3 { background: rgba(123,173,165,0.26); }
.glance-table .heat-4 { background: rgba(123,173,165,0.34); }
.glance-table .heat-5 { background: rgba(123,173,165,0.40); }
.glance-table .heat-6 { background: rgba(123,173,165,0.46); }
.glance-table .heat-7 { background: rgba(123,173,165,0.52); }
.glance-table .heat-8 { background: rgba(123,173,165,0.58); }

/* Fare structure tooltip on hover */
.glance-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--muted);
}
.glance-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: max-content;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}
.glance-tip:hover::after {
  opacity: 1;
}

.methodology-refs {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  display: grid;
  gap: 4px;
}

.methodology-refs a { color: var(--accent-dark); }

/* ── Responsive ── */

@media (max-width: 1200px) {
  .two-col { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-row:has(.kpi:nth-child(5)) { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .panel {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .workspace { padding: 16px; }
  .page-header { flex-direction: column; }
}

@media (max-width: 600px) {
  .panel { padding: 16px 12px; }
  .workspace { padding: 12px; }
  .kpi-row { grid-template-columns: 1fr; }
  .panel-brand { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
  .brand-logo { width: 44px; }
  .panel h1 { font-size: 1.1rem; }
  .chart-wrap--main { min-height: 350px; }
  .chart-wrap--main canvas { min-height: 340px; }
  .methodology-page { padding: 32px 16px 60px; }
  .methodology-close { top: 10px; right: 12px; }
  .methodology-back { top: 10px; left: 12px; }
}
