/* ============================================================
   Design tokens — from the validated categorical palette
   (blue primary accent, orange secondary). Light mode only.
   ============================================================ */
:root {
  --surface-1: #fcfcfb;
  --page-plane: #f9f9f7;
  --surface-raised: #ffffff;

  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;

  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);

  --series-1: #2a78d6; /* blue — primary accent */
  --series-2: #eb6834; /* orange — secondary accent */
  --series-3: #1baf7a; /* aqua */
  --series-4: #eda100; /* yellow */
  --series-5: #4a3aa7; /* violet */

  --ink-navy: #101a2b;
  --ink-navy-raised: #172441;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.06), 0 4px 16px rgba(11, 11, 11, 0.05);
  --shadow-lg: 0 8px 28px rgba(8, 12, 24, 0.35);

  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --content-width: 1080px;

  --report-bg-base: #0e1a30;
  --report-text-onbg-muted: rgba(231, 233, 240, 0.6);
  --report-text-onbg-faint: rgba(231, 233, 240, 0.4);
}

/* ---------------- Report page: colored, glowing backdrop ---------------- */
body.page--report {
  background:
    radial-gradient(1100px 650px at 6% 0%, rgba(42, 120, 214, 0.33), transparent 60%),
    radial-gradient(900px 620px at 96% 16%, rgba(235, 104, 52, 0.26), transparent 55%),
    radial-gradient(1000px 700px at 4% 46%, rgba(27, 175, 122, 0.22), transparent 55%),
    radial-gradient(950px 680px at 97% 70%, rgba(74, 58, 167, 0.28), transparent 55%),
    radial-gradient(900px 620px at 8% 98%, rgba(237, 161, 0, 0.18), transparent 55%),
    var(--report-bg-base);
  background-attachment: fixed;
}

@media (max-width: 820px) {
  body.page--report {
    background-attachment: scroll;
  }
}

/* Finding accent colors — cycled across findings to replace the old numbered
   badge with a distinct identity per section. */
.c1 { --accent: var(--series-1); }
.c2 { --accent: var(--series-2); }
.c3 { --accent: var(--series-3); }
.c4 { --accent: var(--series-4); }
.c5 { --accent: var(--series-5); }

* {
  box-sizing: border-box;
}

/* ---------------- Icons ---------------- */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-inline {
  width: 17px;
  height: 17px;
  color: var(--series-1);
  margin-right: 7px;
  vertical-align: -3px;
}

@keyframes spin-vinyl {
  to {
    transform: rotate(360deg);
  }
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: var(--series-2);
  margin-right: 2px;
}

.site-nav__brand:hover .nav-icon {
  animation: spin-vinyl 1.8s linear infinite;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--page-plane);
  color: var(--text-primary);
  line-height: 1.55;
}

img,
svg,
canvas {
  max-width: 100%;
}

a {
  color: var(--series-1);
}

/* ---------------- Nav ---------------- */
.site-nav {
  background: var(--ink-navy);
  color: #fff;
}

.site-nav__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-nav__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-nav__brand .badge {
  background: var(--series-2);
  color: #17131108;
  color: #1a1005;
  font-weight: 800;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.site-nav__links {
  display: flex;
  gap: 4px;
}

.site-nav__links a {
  color: #d7dbe6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav__links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-nav__links a[aria-current="page"] {
  background: var(--series-1);
  color: #fff;
}

/* ---------------- Layout shells ---------------- */
.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.hero {
  background: linear-gradient(160deg, var(--ink-navy) 0%, var(--ink-navy-raised) 100%);
  color: #fff;
  padding: 56px 0 72px;
  position: relative;
  overflow: hidden;
}

.hero__deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__deco svg {
  position: absolute;
}

.hero__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}

.hero__text {
  flex: 1 1 420px;
  min-width: 280px;
}

.hero__kicker {
  color: var(--series-2);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.12;
  margin: 0 0 18px;
  max-width: 18ch;
}

.hero__byline {
  color: #c7cddc;
  font-size: 15px;
  margin: 0 0 18px;
}

.hero__summary {
  color: #e7e9f0;
  font-size: 17px;
  max-width: 68ch;
  margin: 0;
}

/* ---------------- Hero interactive graphic (equalizer) ---------------- */
.hero__viz {
  flex: 0 0 340px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px 20px 16px;
  backdrop-filter: blur(3px);
}

.hero__viz-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 4px;
}

.hero__viz-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin: 0 0 16px;
}

.hero__viz-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 148px;
}

.hero__viz-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.hero__viz-bar-fill {
  position: relative;
  width: 100%;
  height: var(--h);
  min-height: 4px;
  background: linear-gradient(180deg, var(--series-2) 0%, var(--series-1) 100%);
  border-radius: 3px 3px 0 0;
  transform-origin: bottom center;
  animation: viz-pulse 2.6s ease-in-out infinite;
  animation-delay: var(--delay);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.hero__viz-bar-value {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.hero__viz-bar:hover .hero__viz-bar-fill,
.hero__viz-bar:focus-visible .hero__viz-bar-fill {
  filter: brightness(1.35);
  animation-play-state: paused;
  transform: scaleY(1.04);
}

.hero__viz-bar-label {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.hero__viz-bar:hover .hero__viz-bar-label,
.hero__viz-bar:focus-visible .hero__viz-bar-label {
  color: #fff;
}

@keyframes viz-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.86); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__viz-bar-fill {
    animation: none;
  }
}

.hero__viz-readout {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: #fff;
  min-height: 18px;
}

.hero__viz-readout .num {
  color: var(--series-2);
  font-weight: 700;
}

/* ---------------- Headline stat strip ---------------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: -44px;
  position: relative;
  z-index: 2;
}

.stat-tile {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-strip .stat-tile:nth-child(1) { transition-delay: 0s; }
.stat-strip .stat-tile:nth-child(2) { transition-delay: 0.08s; }
.stat-strip .stat-tile:nth-child(3) { transition-delay: 0.16s; }
.stat-strip .stat-tile:nth-child(4) { transition-delay: 0.24s; }

.stat-tile__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(42, 120, 214, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--series-1);
}

.stat-tile__icon .icon {
  width: 20px;
  height: 20px;
}

.stat-tile__text {
  min-width: 0;
}

.stat-tile__value {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: proportional-nums;
  line-height: 1.1;
}

.stat-tile__label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------------- Report sections ---------------- */
.section-list {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.finding {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px 32px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
}

.finding::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

/* Grid items default to min-width:auto, which lets a nowrap-truncated
   descendant blow out the track past the viewport. Force them shrinkable. */
.finding > div,
.finding__visual,
.finding__chart {
  min-width: 0;
}

.finding.finding--stacked {
  display: block;
}

.finding__tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, white);
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.finding__tag .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.finding h2 {
  font-size: 21px;
  margin: 0 0 10px;
  line-height: 1.3;
  color: var(--text-primary);
}

.finding p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 15px;
}

.finding p:last-of-type {
  margin-bottom: 0;
}

.finding__chart {
  background: var(--surface-1);
  border: 1px solid var(--gridline);
  border-radius: var(--radius);
  padding: 16px 16px 8px;
  height: 320px;
  display: flex;
  flex-direction: column;
}

.finding__chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
  flex: 0 0 auto;
}

.finding__chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.finding__chart canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.chart-note {
  margin: 10px 0 0;
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  flex: 0 0 auto;
}

/* Unboxed slot for the custom (non-Chart.js) visuals, so they don't all
   repeat the same bordered-canvas shape. */
.finding__visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
}

.finding--stacked .finding__visual {
  margin-top: 22px;
  min-height: 0;
}

/* ---- Hero finding: full-width colored moment for the headline stats,
   breaking from the repeated white-card shape on purpose. ---- */
.finding.finding--hero {
  display: block;
  border: none;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 48%, var(--ink-navy)) 0%, var(--ink-navy) 100%);
  padding: 44px 36px;
  text-align: center;
}

.finding--hero::before {
  display: none;
}

.finding--hero .finding__tag {
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.finding--hero .finding__tag .icon {
  color: #fff;
}

.finding--hero h2 {
  color: #fff;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.finding--hero p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
}

.finding--hero code {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
}

.finding--hero .finding__visual {
  margin-top: 28px;
}

.finding--hero .waffle-callout__label,
.finding--hero .big-compare__label {
  color: rgba(255, 255, 255, 0.65);
}

.finding--hero .waffle-callout__value {
  color: #fff;
}

.finding--hero .waffle__cell {
  background: rgba(255, 255, 255, 0.12);
}

.finding--hero .big-compare__value {
  color: rgba(255, 255, 255, 0.55);
}

.finding--hero .big-compare__value.is-accent {
  color: #fff;
}

.finding__visual-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 14px;
}

@media (max-width: 820px) {
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .finding {
    grid-template-columns: 1fr;
  }
  .hero__deco {
    display: none;
  }
  .hero__viz {
    flex-basis: 100%;
  }
}

/* ---------------- Closing / methodology ---------------- */
.methodology {
  margin-top: 56px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.methodology h2 {
  margin-top: 0;
}

.methodology dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 20px;
  margin: 18px 0 0;
}

.methodology dt {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.methodology dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.methodology ul {
  margin: 6px 0 0;
  padding-left: 20px;
  color: var(--text-secondary);
}

/* ---------------- Footer ---------------- */
.site-footer {
  text-align: center;
  padding: 32px 20px 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer .icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  margin-right: 6px;
  vertical-align: -2px;
}

.section-heading {
  display: flex;
  align-items: center;
}

.site-footer a {
  color: var(--text-secondary);
}

.page--report .site-footer {
  color: var(--report-text-onbg-muted);
}

.page--report .site-footer .icon {
  color: var(--report-text-onbg-faint);
}

.page--report .site-footer a {
  color: var(--report-text-onbg-muted);
  text-decoration-color: var(--report-text-onbg-faint);
}

/* ============================================================
   Dashboard
   ============================================================ */
.dash-header {
  padding: 36px 0 0;
}

.dash-header h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  margin: 0 0 6px;
}

.dash-header p {
  color: var(--text-secondary);
  margin: 0;
  max-width: 70ch;
}

.filter-bar {
  margin-top: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.filter-field.filter-field--grow {
  flex: 1;
  min-width: 200px;
}

.filter-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-field select,
.filter-field input[type="search"],
.filter-field input[type="number"] {
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--baseline);
  background: var(--surface-1);
  color: var(--text-primary);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-inputs input {
  width: 72px;
}

.reset-btn {
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--baseline);
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.reset-btn:hover {
  background: #fff;
  border-color: var(--series-2);
  color: var(--series-2);
}

.filter-count {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.filter-count strong {
  color: var(--text-primary);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.chart-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px 12px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.chart-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chart-card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
}

.chart-card__switches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-card__switches select {
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--baseline);
  background: var(--surface-1);
  color: var(--text-secondary);
}

.chart-card__body {
  flex: 1;
  position: relative;
}

.table-card {
  margin-top: 20px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px 8px;
}

.table-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.table-card__head h2 {
  font-size: 15px;
  margin: 0;
}

.table-card__note {
  font-size: 12px;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
  border-top: 1px solid var(--gridline);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}

.data-table th.is-sorted {
  color: var(--series-1);
}

.data-table td.num,
.data-table th.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state .icon {
  width: 34px;
  height: 34px;
  color: var(--baseline);
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Chart Skyline (3D)
   ============================================================ */
.skyline-section {
  margin-top: 40px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}

.skyline-section > p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 18px;
  max-width: 70ch;
}

/* ---- Skyline toggle (segmented control) ---- */
.skyline-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--baseline);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}

.skyline-toggle__btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.skyline-toggle__btn:hover {
  color: var(--text-primary);
}

.skyline-toggle__btn.is-active {
  background: var(--series-1);
  color: #fff;
}

/* ---- Skyline layout: canvas + leaderboard ---- */
.skyline-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.skyline-canvas-wrap {
  position: relative;
  height: 460px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--ink-navy) 0%, var(--ink-navy-raised) 100%);
}

.skyline-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.skyline-canvas-wrap canvas:active {
  cursor: grabbing;
}

.skyline-label-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.skyline-tower-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 26, 43, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(2px);
  white-space: nowrap;
  transform: translate(-50%, -100%);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.skyline-tower-label__name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.skyline-tower-label__value {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.skyline-tower-label.is-active {
  background: var(--series-2);
  border-color: var(--series-2);
  transform: translate(-50%, -100%) scale(1.08);
}

.skyline-tower-label.is-active .skyline-tower-label__value {
  color: rgba(255, 255, 255, 0.9);
}

.skyline-hint {
  position: absolute;
  left: 14px;
  bottom: 12px;
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.85);
  padding: 5px 10px;
  border-radius: 999px;
  pointer-events: none;
}

.skyline-reset-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--baseline);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

.skyline-reset-btn:hover {
  border-color: var(--series-2);
  color: var(--series-2);
}

.skyline-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gridline);
  border-radius: var(--radius);
  overflow: hidden auto;
  max-height: 460px;
}

.skyline-leaderboard__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gridline);
  cursor: pointer;
  transition: background 0.15s ease;
}

.skyline-leaderboard__row:last-child {
  border-bottom: none;
}

.skyline-leaderboard__row:hover {
  background: var(--surface-1);
}

.skyline-leaderboard__row.is-active {
  background: rgba(235, 104, 52, 0.1);
}

.skyline-leaderboard__rank {
  flex: 0 0 20px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.skyline-leaderboard__row.is-active .skyline-leaderboard__rank {
  color: var(--series-2);
}

.skyline-leaderboard__name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  min-width: 0;
}

.skyline-leaderboard__value {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .skyline-layout {
    grid-template-columns: 1fr;
  }
  .skyline-canvas-wrap {
    height: 360px;
  }
}

/* ============================================================
   Report: scroll motion
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

.count-up {
  font-variant-numeric: tabular-nums;
}

/* Side rail showing scroll progress through the findings, one dot per
   section, colored to match that section's accent. */
.scroll-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  z-index: 60;
}

.scroll-rail__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.scroll-rail__dot:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

.scroll-rail__dot.is-active {
  background: var(--dot-color);
  border-color: var(--dot-color);
  transform: scale(1.5);
}

@media (max-width: 1240px) {
  .scroll-rail {
    display: none;
  }
}

/* ============================================================
   Report: custom finding visuals (replace repeated Chart.js boxes)
   ============================================================ */

/* ---- Waffle / pictogram (one-hit wonders) ---- */
.waffle-block {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.waffle {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  width: 190px;
  flex: 0 0 auto;
}

.waffle__cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--gridline);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.35s ease;
  transition-delay: var(--d, 0s);
}

.waffle.is-visible .waffle__cell {
  opacity: 1;
  transform: scale(1);
}

.waffle__cell.is-filled {
  background: var(--accent);
}

.waffle-callout {
  text-align: center;
}

.waffle-callout__value {
  font-size: clamp(40px, 5.5vw, 58px);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
}

.waffle-callout__label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  max-width: 24ch;
}

/* ---- Ranked bar list (replaces horizontal Chart.js bars) ---- */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rank-list__row {
  display: grid;
  grid-template-columns: 20px minmax(92px, 150px) 1fr auto;
  align-items: center;
  gap: 10px;
}

.rank-list__pos {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.rank-list__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.rank-list__track {
  position: relative;
  height: 16px;
  background: var(--gridline);
  border-radius: 5px;
  overflow: hidden;
}

.rank-list__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent);
  border-radius: 5px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-list.is-visible .rank-list__fill {
  width: var(--pct);
}

.rank-list__value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Big-number comparison (replaces a second decade line chart) ---- */
.big-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  text-align: center;
  padding: 8px 0 4px;
}

.big-compare__item {
  min-width: 120px;
}

.big-compare__value {
  font-size: clamp(38px, 5.5vw, 58px);
  font-weight: 900;
  line-height: 1;
  color: var(--text-muted);
}

.big-compare__value.is-accent {
  color: var(--accent);
}

.big-compare__label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.big-compare__arrow {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  align-self: center;
}

@media (max-width: 560px) {
  .big-compare__item {
    flex-basis: 100%;
  }
  .big-compare__arrow {
    display: block;
    transform: rotate(90deg);
    margin: -4px 0;
  }
}

.big-compare__multiplier {
  display: block;
  flex-basis: 100%;
  margin: 18px auto 0;
  width: fit-content;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 999px;
}

/* ---- Combined climb chart (debut-at-#100 -> #1, all four songs together) ---- */
.climb-chart {
  min-width: 0;
}

.climb-chart__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.climb-chart__body {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.climb-chart__yaxis {
  flex: 0 0 auto;
  position: relative;
  width: 26px;
}

.climb-chart__yaxis-tick {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.climb-chart__plot {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.climb-chart__svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.climb-band {
  fill: color-mix(in srgb, var(--accent) 10%, transparent);
}

.climb-gridline {
  stroke: var(--gridline);
  stroke-width: 1;
}

.climb-dashed {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.climb-line {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.25s ease;
}

.climb-line-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  cursor: pointer;
  pointer-events: stroke;
}

.climb-dot {
  fill: var(--c);
  stroke: var(--surface-raised);
  transition: opacity 0.25s ease;
}

.climb-dot.is-debut {
  stroke-width: 2;
}

.climb-dot.is-peak {
  stroke-width: 1.5;
}

.climb-leader {
  stroke: var(--c);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.climb-chart__xaxis {
  position: relative;
  height: 16px;
  margin-top: 2px;
}

.climb-chart__xaxis-tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.climb-chart__xaxis-title {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
}

.climb-chart__finish-label {
  position: absolute;
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-1);
  padding: 0 4px;
  transform: translate(-100%, -120%);
  white-space: nowrap;
}

.climb-chart__label {
  position: absolute;
  transform: translateY(-50%);
  min-width: 0;
  color: var(--c);
  transition: opacity 0.25s ease;
}

.climb-chart__label-song {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.climb-chart__label-artist {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0.8;
}

.climb-chart.has-hover .climb-line:not(.is-active),
.climb-chart.has-hover .climb-dot:not(.is-active),
.climb-chart.has-hover .climb-leader:not(.is-active),
.climb-chart.has-hover .climb-chart__label:not(.is-active) {
  opacity: 0.2;
}

.climb-chart__tooltip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  background: var(--ink-navy);
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.15s ease;
  max-width: 200px;
}

.climb-chart__tooltip.is-visible {
  opacity: 1;
}

.climb-chart__tooltip strong {
  display: block;
  font-size: 12px;
}

.climb-chart__tooltip span {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.climb-chart__caption {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .climb-chart__yaxis {
    width: 22px;
  }
  .climb-chart__yaxis-tick,
  .climb-chart__xaxis-tick,
  .climb-chart__finish-label {
    font-size: 8px;
  }
}

/* ---- Calendar strip (year grids: recurring songs, #1s-by-year timeline) ----
   Cells use a (var(--n)) responsive grid rather than a fixed px width, so the
   full year range always fits the container with no horizontal scroll. */
.calendar-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-strip__axis {
  display: grid;
  grid-template-columns: repeat(var(--n, 64), 1fr);
  margin-left: 166px;
  height: 14px;
}

.calendar-strip__axis span {
  grid-row: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.calendar-strip__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-strip__label {
  flex: 0 0 156px;
  min-width: 0;
}

.calendar-strip__song {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.calendar-strip__artist {
  margin: 1px 0 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-muted);
}

.calendar-strip__cells {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 64), 1fr);
  gap: 1px;
}

.calendar-strip__cell {
  height: 16px;
  border-radius: 1px;
  background: var(--gridline);
  transform: scaleY(0.2);
  transform-origin: bottom;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  transition-delay: var(--d, 0s);
}

.calendar-strip.is-visible .calendar-strip__cell {
  opacity: 1;
  transform: scaleY(1);
}

.calendar-strip__cell.is-on {
  background: var(--accent);
}

@media (max-width: 640px) {
  .calendar-strip__axis {
    margin-left: 96px;
  }
  .calendar-strip__label {
    flex-basis: 86px;
  }
  .calendar-strip__cell {
    height: 13px;
  }
}
