/* Do names follow the ground? A plain-page chart: no filled surfaces, colour only where it means something. */
.terrain { position: relative; }
.terrain-lede { max-width: 74ch; }
.terrain-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 28px; margin: 14px 0 6px; }
.terrain-summary { max-width: 86ch; color: var(--muted); line-height: 1.5; margin: 8px 0 10px; }
.terrain-summary b { color: var(--ink); }
.terrain-chart { width: 100%; overflow-x: auto; }
.terrain-chart svg { display: block; }

.terrain-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 8px; color: var(--subtle); font-size: 0.8rem; font-weight: 800; }
.terrain-key span { display: inline-flex; align-items: center; gap: 7px; }
.terrain-key span::before { content: ""; display: inline-block; }
.terrain-key .k-dots::before { width: 5px; height: 5px; border-radius: 50%; background: var(--k-built); opacity: 0.5; }
.terrain-key .k-iqr::before { width: 18px; height: 2px; background: var(--subtle); }
.terrain-key .k-med::before { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.terrain-key .k-sig::before { width: 9px; height: 9px; border-radius: 50%; background: var(--map-accent); }
.terrain-key .k-cut::before { width: 2px; height: 14px; background: var(--map-accent); }
.terrain-key .k-band::before { width: 18px; height: 10px; background: hsla(var(--hue-primary), 30%, 50%, 0.1); }

.t-band { fill: hsla(var(--hue-primary), 30%, 50%, 0.08); }
.t-allmed { stroke: var(--faded); stroke-width: 1; stroke-dasharray: 3 3; }
.t-axis { fill: var(--faded); font-size: 11px; font-weight: 700; }
.t-allmed-label { fill: var(--subtle); }
.t-tick { stroke: var(--line); }
.t-hit { fill: transparent; }
.t-row { cursor: pointer; outline: none; }
.t-row:hover .t-hit, .t-row:focus-visible .t-hit { fill: hsla(var(--hue-primary), 30%, 50%, 0.06); }
.t-name { fill: var(--muted); font-size: 13px; font-weight: 700; }
.t-name.is-root { font-style: italic; }
.t-row:hover .t-name, .t-row:focus-visible .t-name { fill: var(--ink); }
.t-row.is-sig .t-name { fill: var(--ink); font-weight: 800; }
.t-dot { opacity: 0.32; fill: var(--k-built); }
.t-row.k-water .t-dot { fill: var(--k-water); }
.t-row.k-land .t-dot { fill: var(--k-land); }
.t-row.k-people .t-dot { fill: var(--k-people); }
.t-iqr { stroke: var(--subtle); stroke-width: 2; stroke-linecap: round; }
.t-med { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.t-row.is-sig .t-med { fill: var(--map-accent); }
.t-cut { stroke: var(--map-accent); stroke-width: 2; stroke-linecap: round; }
.t-stat { fill: var(--faded); font-size: 12px; font-weight: 700; }
.t-row.is-sig .t-stat { fill: var(--muted); font-weight: 800; }

.terrain-tip {
  position: absolute; z-index: 3; width: 290px; padding: 10px 14px; border-radius: 14px;
  background: var(--paper); box-shadow: 0 16px 36px var(--shadow-medium);
  color: var(--muted); font-size: 0.86rem; line-height: 1.4; pointer-events: none;
}
.terrain-tip b { display: block; color: var(--ink); font-family: "Raleway", ui-sans-serif, system-ui, sans-serif; font-weight: 800; }
.terrain-tip span { display: block; margin-top: 3px; }
.terrain-tip small { display: block; margin-top: 6px; color: var(--subtle); font-size: 0.76rem; font-weight: 700; }
.terrain-caveat { max-width: 86ch; margin-top: 14px; font-size: 0.84rem; }
