/* Colours for profile-chart.js and the map's legend. Keyed on :root only,
   like the site tokens: dark is the default, light is the stamped override.
   Ramps and category hues were run through the dataviz palette validator
   (ordinal ramp: monotone, light end >= 2:1 on the surface; categories: the
   first three reference slots, which pass all-pairs CVD in both modes).
   The light values are copied into build_web.mjs for the static infographic. */
:root, :root[data-theme="dark"] {
  --pc-surface: #14120d;
  --pc-ink: #f0ead9;
  --pc-muted: #a89f88;
  --pc-grid: #3a352a;
  --pc-band-1: #184f95;
  --pc-band-2: #2a78d6;
  --pc-band-3: #6da7ec;
  --pc-band-4: #b7d3f6;
  --pc-cat-town: #d95926;
  --pc-cat-park: #199e70;
  --pc-cat-attraction: #199e70;
  --pc-cat-station: #3987e5;
  --pc-cat-airport: #3987e5;
  --pc-warn: #ec835a;
}
:root[data-theme="light"] {
  --pc-surface: #faf9f6;
  --pc-ink: #16140f;
  --pc-muted: #59523f;
  --pc-grid: #dedbd4;
  --pc-band-1: #86b6ef;
  --pc-band-2: #3987e5;
  --pc-band-3: #1c5cab;
  --pc-band-4: #0d366b;
  --pc-cat-town: #eb6834;
  --pc-cat-park: #1baf7a;
  --pc-cat-attraction: #1baf7a;
  --pc-cat-station: #2a78d6;
  --pc-cat-airport: #2a78d6;
  --pc-warn: #ec835a;
}

.pc-wrap { position: relative; }
.pc-wrap svg { display: block; width: 100%; height: auto; }
/* Below 640px the chart keeps a readable size and scrolls sideways. */
.pc-wrap.is-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.pc-wrap.is-scroll svg { width: 720px; max-width: none; }
.pc-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius-chip); }
/* Inside the chart's top edge, over the label lane: a scroller would clip it
   anywhere above, and outside it covers whatever sits on top of the chart. */
.pc-tip {
  position: absolute; top: var(--space-1); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-chip);
  background: var(--pc-surface); border: 1px solid var(--pc-grid);
  font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--pc-muted);
  pointer-events: none; white-space: nowrap;
}
.pc-tip strong { color: var(--pc-ink); font-size: var(--text-sm); }
.pc-tip[hidden] { display: none; }
