/* "Refined Atlas Dashboard" (design option 1B) — dark earthy theme.
   Tokens: page #0b0a09 · panel #0f0e0c · card rgba(255,255,255,0.03) ·
   hairline rgba(255,255,255,0.08) · text #f2ede6 / #e4ddd2 / #cfc7b9 /
   #8f887d / #7a7367 · accent #e8845a (hover #f3a37c) · chart line #7fa8c9
   (deliberately distinct from the brand accent). Sans = Manrope, serif =
   Newsreader (title). */
* { box-sizing: border-box; }
html, body { margin: 0; }
/* the panel grows with its content, so the page scrolls as one — no nested
   scrollbars (the plugin iframe grows to fit too; see reportFrameHeight) */
body { display: flex; background: #0b0a09; color: #f2ede6;
  font-family: Manrope, system-ui, sans-serif; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
a { color: #e8845a; text-decoration: none; }
a:hover { color: #f3a37c; }
.muted { color: #8f887d; font-size: 13px; }
.err { color: #ff8787; }

/* the whole app is one rounded dashboard card, filling the window edge-to-edge */
#app { flex: 1; min-width: 0;
  display: flex; flex-direction: column; background: #0f0e0c;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; overflow: hidden; }

/* --- top stat bar ---------------------------------------------------------- */
#statbar { display: flex; align-items: baseline; gap: 40px; padding: 22px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08); flex: none; }
#statbar h1 { font-family: Newsreader, Georgia, serif; font-size: 22px;
  font-weight: 500; color: #f2ede6; margin: 0; }
#summary { display: flex; gap: 32px; flex: 1; flex-wrap: wrap;
  font-size: 13px; color: #8f887d; }
#summary .stat b { color: #e8845a; font-size: 20px; font-weight: 800;
  font-variant-numeric: tabular-nums; }

/* --- hero tab nav ---------------------------------------------------------- */
#tabbar { display: flex; align-items: center; gap: 36px; padding: 0 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08); flex: none; overflow-x: auto; }
.tab { background: none; border: none; padding: 16px 2px; font-size: 15px;
  cursor: pointer; color: #7a7367; font-weight: 600;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: #cfc7b9; }
.tab.active { color: #f2ede6; font-weight: 700; border-bottom-color: #e8845a; }

/* --- tab content area ------------------------------------------------------ */
#content { position: relative; }
.pane { display: none; padding: 28px 32px; }
.pane.active { display: block; }
[data-pane="table"] { overflow-x: auto; }
/* the Map tab is the one fixed-height widget (its sidebar scrolls internally
   when the collapsible sections are opened) */
.pane[data-pane="map"] { padding: 0; overflow: hidden; }
.pane[data-pane="map"].active { display: flex; height: 720px; }

/* --- map tab: region sidebar ----------------------------------------------- */
#sidebar { width: 260px; flex: 0 0 260px; overflow-y: auto; padding: 20px 18px;
  border-right: 1px solid rgba(255,255,255,0.08); }
.panel { margin-top: 22px; }
.panel h2 { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #7a7367; margin: 0 0 10px; padding: 0 2px; }

/* collapsible panels (Map layers, Filters): the header toggles its body */
.panel.collapsible > h2 { cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; }
.panel.collapsible > h2::after { content: "▾"; font-size: 11px; color: #7a7367;
  transition: transform .15s ease; }
.panel.collapsible.collapsed > h2 { margin-bottom: 0; }
.panel.collapsible.collapsed > h2::after { transform: rotate(-90deg); }
.panel.collapsible.collapsed > :not(h2) { display: none; }

/* omnibox: one search box over facets, hikes, and free text; suggestions
   drop over the panels below */
#omni { position: relative; }
#omni input { width: 100%; background: rgba(255,255,255,0.04); color: #f2ede6;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; }
#omni input::placeholder { color: #7a7367; }
#omni input:focus { outline: none; border-color: rgba(232,132,90,0.5); }
#omni-sug { position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: #171512; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; margin-top: 4px; max-height: 260px; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.omni-item { padding: 7px 10px; font-size: 13px; cursor: pointer; color: #e4ddd2;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.omni-item.active, .omni-item:hover { background: rgba(255,255,255,0.06); }
.omni-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-cat { color: #7a7367; font-size: 11px; flex: none; }

/* active-filter chips (from the omnibox or the dropdowns alike) */
#chips { margin-top: 8px; display: flex; flex-wrap: wrap; }
#chips:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 5px;
  background: rgba(232,132,90,0.12); border: 1px solid rgba(232,132,90,0.4);
  border-radius: 100px; padding: 2px 5px 2px 10px; font-size: 12px;
  color: #f2ede6; margin: 0 6px 6px 0; }
.fchip button { background: none; border: none; color: #e8845a;
  cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1; }
.fchip button:hover { color: #f3a37c; }

/* region rows */
#region-list, #hike-list, #longest-list { list-style: none; margin: 0; padding: 0; }
#region-list li { display: flex; justify-content: space-between;
  align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; }
#region-list li:hover { background: rgba(255,255,255,0.04); }
#region-list li.active { background: rgba(232,132,90,0.12);
  border-color: rgba(232,132,90,0.4); }
.rg-name { color: #e4ddd2; font-size: 14px; font-weight: 600; }
#region-list li.active .rg-name { color: #f2ede6; }
.rg-sub { color: #7a7367; font-size: 12px; }
.rg-count { color: #8f887d; font-size: 12px; font-weight: 600; flex: none;
  font-variant-numeric: tabular-nums; }
#region-list li.active .rg-count { color: #e8845a; font-weight: 700; }

/* "Longest hikes" quick list */
#longest-list li { padding: 8px 10px; border-radius: 10px; cursor: pointer; }
#longest-list li:hover { background: rgba(255,255,255,0.04); }
.lg-name { color: #e4ddd2; font-size: 13px; font-weight: 600; }
.lg-mi { color: #e8845a; font-size: 12px; font-weight: 700; }

/* map layer controls + filters */
.control { margin: 10px 0; padding: 0 2px; }
.control label { display: block; font-size: 13px; color: #cfc7b9; margin-bottom: 6px; }
.control input[type=range] { width: 100%; accent-color: #e8845a; }
.control input[type=checkbox] { accent-color: #e8845a; }
.control label + label { margin-top: 8px; }
.legend { margin: 12px 0 0; padding: 0 2px; font-size: 12px; color: #8f887d;
  display: grid; gap: 6px; }
.swatch { display: inline-block; width: 14px; height: 8px; border-radius: 2px;
  margin-right: 6px; vertical-align: middle; }
.filters { padding: 0 2px; }
.filters label { display: block; font-size: 12px; color: #cfc7b9; margin-bottom: 8px; }
.filters select, .filters input { width: 100%; margin-top: 3px;
  background: rgba(255,255,255,0.04); color: #f2ede6;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
  padding: 6px 8px; font-size: 13px; }
.filters select:focus, .filters input:focus { outline: none;
  border-color: rgba(232,132,90,0.5); }
.filters .range { display: flex; gap: 8px; }
.filters .range label { flex: 1; }
select option { background: #171512; color: #e4ddd2; }

.btn { background: rgba(255,255,255,0.05); color: #e4ddd2;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { background: rgba(255,255,255,0.09); }
.btn.primary { background: #e8845a; border-color: #e8845a; color: #0f0e0c;
  font-weight: 700; }
.btn.primary:hover { background: #f3a37c; }

/* --- map tab: map + floating hike list ------------------------------------- */
#map-area { flex: 1; min-width: 0; position: relative; }
#map { position: absolute; inset: 0; }
/* left-edge dark gradient for legibility (pointer-events pass through) */
#map-shade { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgba(11,10,9,0.4) 0%, rgba(11,10,9,0.03) 30%); }
#loading { position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 6; background: rgba(15,14,12,0.88); color: #e4ddd2;
  border: 1px solid rgba(255,255,255,0.1); padding: 6px 14px;
  border-radius: 100px; font-size: 12px; }

/* floating glass hike-list panel */
#hike-panel { position: absolute; top: 20px; right: 20px; width: 360px;
  max-height: calc(100% - 40px); z-index: 5; display: flex; flex-direction: column;
  background: rgba(15,14,12,0.88); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.hike-panel-head { padding: 16px 18px; flex: none; color: #e4ddd2;
  font-size: 14px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.08); }
.hp-count { color: #8f887d; font-weight: 600; }
#hike-list { overflow-y: auto; }
#hike-list li { display: flex; gap: 12px; align-items: center; padding: 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer; }
#hike-list li:last-child { border-bottom: none; }
#hike-list li:hover { background: rgba(255,255,255,0.04); }
#hike-list li.active { background: rgba(232,132,90,0.12); }
#hike-list li.dim { opacity: 0.35; }
.hk-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8845a;
  flex: none; }
.hk-main { flex: 1; min-width: 0; }
.hk-name { color: #f2ede6; font-size: 14px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hk-meta { color: #7a7367; font-size: 12px; }
.hk-gain { color: #e8845a; font-size: 13px; font-weight: 700; flex: none;
  font-variant-numeric: tabular-nums; }

/* --- charts pane / stats-pane controls -------------------------------------- */
.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  margin-bottom: 18px; }
.chart-controls label { font-size: 12px; color: #cfc7b9; font-weight: 600; }
.chart-controls select { margin-left: 6px; background: rgba(255,255,255,0.04);
  color: #f2ede6; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
  padding: 5px 8px; font-size: 13px; }

#chart { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 80px;
  align-items: center; gap: 10px; font-size: 13px; }
.bar-label { text-align: right; color: #cfc7b9; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: rgba(255,255,255,0.05); border-radius: 4px; height: 18px; }
.bar-fill { background: #7fa8c9; height: 100%; border-radius: 4px; }
.bar-val { color: #f2ede6; }

/* --- table ------------------------------------------------------------------ */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06); }
th { color: #7a7367; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; cursor: pointer; user-select: none;
  position: sticky; top: 0; background: #0f0e0c; }
th:hover { color: #e4ddd2; }
td { color: #cfc7b9; }
tbody tr:hover { background: rgba(255,255,255,0.04); cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- SQL pane --------------------------------------------------------------- */
#sql-input { width: 100%; height: 90px; background: rgba(0,0,0,0.35);
  color: #e4ddd2; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  padding: 10px; font-family: ui-monospace, monospace; font-size: 13px;
  resize: vertical; margin-top: 10px; }
.sql-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
#sql-result table { margin-top: 4px; }

.stars { color: #e8845a; }

/* --- detail drawer (per-hike) ------------------------------------------------
   Pinned to the viewport's right edge, whichever tab is active. */
#detail { position: fixed; top: 0; right: 0; bottom: 0; width: 360px;
  z-index: 20; background: rgba(15,14,12,0.96); backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255,255,255,0.1);
  transform: translateX(100%); transition: transform .22s ease;
  box-shadow: -20px 0 50px rgba(0,0,0,0.5); }
#detail.open { transform: translateX(0); }
.detail-close { position: absolute; top: 8px; right: 8px; z-index: 1;
  background: none; border: none; color: #8f887d; font-size: 16px;
  cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.detail-close:hover { color: #f2ede6; background: rgba(255,255,255,0.06); }
.detail-body { position: absolute; inset: 0; overflow-y: auto; padding: 18px 18px 24px; }
.detail-title { font-size: 15px; font-weight: 700; color: #f2ede6;
  line-height: 1.25; padding-right: 28px; }
.detail-sub { color: #7a7367; font-size: 12px; margin-top: 4px; }

.d-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.d-stat { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 8px 10px; }
.d-stat .v { font-size: 16px; font-weight: 700; color: #f2ede6;
  font-variant-numeric: tabular-nums; }
.d-stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #7a7367; margin-top: 2px; }

.d-section { margin-top: 16px; }
.d-section h4 { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #7a7367; margin: 0 0 8px; }
.d-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #cfc7b9; }
.d-list li { padding: 5px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.d-list li:first-child { border-top: none; }
.chip { display: inline-block; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 100px;
  padding: 2px 9px; font-size: 12px; color: #cfc7b9; margin: 0 5px 5px 0; }
.d-kv { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; color: #cfc7b9; }
.d-k { color: #7a7367; flex: 0 0 90px; }
.d-journal { font-size: 13px; line-height: 1.6; color: #cfc7b9; white-space: pre-wrap; }

.d-prof { position: relative; }
.d-prof svg { display: block; width: 100%; height: 110px;
  background: rgba(255,255,255,0.03); border-radius: 10px; }
.d-prof .ep-area { fill: #e8845a; fill-opacity: 0.14; stroke: none; }
.d-prof .ep-climb { fill: #e8845a; fill-opacity: 0.12; stroke: none; }
.d-prof-cap { display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: #8f887d; margin-top: 4px;
  font-variant-numeric: tabular-nums; }
.d-leg { display: inline-flex; align-items: center; gap: 5px; }
.d-grad { display: inline-block; width: 70px; height: 7px; border-radius: 3px;
  background: linear-gradient(90deg, #e03131, #f1c40f, #37b24d); }
.d-grad.grade { background: linear-gradient(90deg, #2b6cb0, #4fa3d1, #74c476, #f1c40f, #f08a4b, #e03131); }
.d-modes { float: right; display: inline-flex; gap: 4px; }
.d-mode { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: #8f887d; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.06em; border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.d-mode.on { background: rgba(232,132,90,0.15); color: #f2ede6;
  border-color: rgba(232,132,90,0.45); }
.d-actions { margin: 12px 0 2px; }
.d-fly { width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1); color: #e4ddd2; border-radius: 10px;
  padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.d-fly:hover { background: rgba(255,255,255,0.08); }
.d-fly.on { background: rgba(232,132,90,0.15); border-color: rgba(232,132,90,0.45);
  color: #e8845a; }
.d-tip { position: absolute; top: 2px; pointer-events: none; background: #171512;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 3px 7px;
  font-size: 11px; color: #e4ddd2; white-space: nowrap;
  transform: translateX(-50%); display: none; font-variant-numeric: tabular-nums; }

/* summits along the route: a label strip above the profile (up to two packed
   rows; height set inline) + dashed ticks in it (labels are HTML because the
   stretched SVG would distort text) */
.d-peaks { position: relative; margin-bottom: 1px; }
.d-peak { position: absolute; transform: translateX(-50%);
  font-size: 10px; line-height: 13px; color: #e8845a; white-space: nowrap;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.d-prof .ep-peak { stroke: #e8845a; stroke-width: 1; stroke-dasharray: 3 3;
  opacity: .75; }

/* POI popups (peak pins / waypoints / trail overlay), restyled to the theme */
.maplibregl-popup-content { background: #171512; color: #e4ddd2;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  padding: 10px 12px; font-family: Manrope, system-ui, sans-serif; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #171512; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #171512; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #171512; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #171512; }
.maplibregl-popup-close-button { color: #8f887d; font-size: 16px; }
.poi-pop { font-size: 13px; }
.poi-name { font-weight: 600; color: #f2ede6; }
.poi-sub { font-size: 12px; color: #8f887d; margin-top: 2px; }
.poi-hikes { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; }
.poi-hikes li { padding: 2px 0; }
.poi-hikes a { color: #e8845a; text-decoration: none; }
.poi-hikes a:hover { color: #f3a37c; text-decoration: underline; }

/* --- highlights pane --------------------------------------------------------- */
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px; align-items: start; }
.hl-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 18px 20px; }
.hl-big { font-size: 30px; font-weight: 800; color: #f2ede6; line-height: 1.1; }
.hl-denom { font-size: 15px; font-weight: 500; color: #7a7367; }
.hl-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #7a7367; margin-bottom: 8px; }
.hl-peaks { font-size: 12px; color: #cfc7b9; margin-top: 6px; line-height: 1.5; }
.hl-list { list-style: none; margin: 0; padding: 0; }
.hl-list li { display: grid; grid-template-columns: 1fr auto; column-gap: 8px;
  align-items: baseline; padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.hl-list li:first-child { border-top: none; }
.hl-name { color: #e4ddd2; font-size: 13px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hl-list .num { color: #e8845a; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.hl-sub { grid-column: 1 / -1; color: #7a7367; font-size: 11px; }

/* derived-classification badges (detail drawer) */
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { display: inline-block; border-radius: 100px; padding: 2px 9px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05);
  color: #cfc7b9; }
.badge.diff-easy { background: #15331f; border-color: #1f5132; color: #5fce8a; }
.badge.diff-moderate { background: #15291a; border-color: #2f5e2f; color: #9fd16a; }
.badge.diff-hard { background: #322a12; border-color: #6b5a1e; color: #f1c40f; }
.badge.diff-strenuous { background: #331c12; border-color: #6b3a1e; color: #f08a4b; }

/* --- stats pane (year in review) --------------------------------------------- */
.stats-h { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #7a7367; margin: 26px 0 12px; }
/* fluid: cells stretch so the calendar fills its column (same cap as the
   seasonality chart beside it) */
.cal-heatmap { max-width: 640px; font-variant-numeric: tabular-nums; }
.cal-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.cal-yr { width: 38px; flex: none; font-size: 11px; color: #8f887d; }
.cal-cell { flex: 1; min-width: 0; height: 24px; border-radius: 4px;
  box-sizing: border-box; }
.cal-mname { height: auto; font-size: 9px; color: #7a7367;
  text-transform: uppercase; letter-spacing: 0.04em;
  text-align: center; background: none; }

/* the calendar + seasonality charts share a row; wraps to a column when
   narrow (mobile, or a slim window) */
.stats-row { display: flex; gap: 48px; flex-wrap: wrap; }
.stats-row > div { flex: 1; min-width: 340px; }

/* seasonality column chart (Stats tab): baseline-anchored bars, rounded
   data-ends, chart-data blue (single series — no legend), miles axis with
   recessive gridlines */
.seas { display: flex; gap: 10px; max-width: 640px; }
.seas-y { position: relative; width: 44px; height: 120px; flex: none;
  font-size: 10px; color: #7a7367; font-variant-numeric: tabular-nums; }
.seas-tick { position: absolute; right: 0; transform: translateY(50%); }
.seas-plot { flex: 1; min-width: 0; position: relative; }
.seas-gridlines { position: absolute; top: 0; left: 0; right: 0; height: 120px; }
.seas-grid { position: absolute; left: 0; right: 0; height: 1px;
  background: rgba(255,255,255,0.06); }
.seas-cols { position: relative; display: flex; gap: 6px; }
.seas-col { flex: 1; min-width: 0; text-align: center; cursor: default; }
.seas-stack { display: flex; flex-direction: column; justify-content: flex-end;
  height: 120px; }
.seas-bar { background: #7fa8c9; border-radius: 4px 4px 0 0; }
.seas-col:hover .seas-bar { background: #9dbedb; }
.seas-bar.zero { height: 2px; background: rgba(255,255,255,0.08); border-radius: 0; }
.seas-lbl { font-size: 9px; color: #7a7367; margin-top: 5px;
  text-transform: uppercase; letter-spacing: 0.04em; }

/* --- routes pane -------------------------------------------------------------- */
.routes-h { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #7a7367; margin: 0 0 14px; }
.route-grid + .routes-h, .route-list + .routes-h { margin-top: 28px; }
.route-grid { display: grid; gap: 20px; align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-list { display: grid; gap: 20px; align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* trip cards use the card title style; route cards are slightly tighter */
.route-grid .hl-label { font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  color: #e4ddd2; margin-bottom: 10px; }
.route-card { padding: 16px 18px; }
.route-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.route-name { font-size: 14px; font-weight: 700; color: #e4ddd2; }
.route-count { font-size: 12px; font-weight: 700; color: #e8845a;
  font-variant-numeric: tabular-nums; }
.route-avg { font-size: 12px; color: #8f887d; margin: 0 0 10px; }
.route-profile { margin: 0 0 10px; }
.route-profile svg { display: block; width: 100%; height: 60px; }
.route-grid .route-profile svg { height: 90px; }
.route-profile .ep-area { fill: #e8845a; fill-opacity: 0.18; stroke: none; }
.route-profile .ep-line { fill: none; stroke: #7fa8c9; stroke-width: 2;
  vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.route-profile .ep-day { stroke: rgba(255,255,255,0.15); stroke-width: 1;
  stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.route-profile .ep-caption { display: block; text-align: right; margin-top: 4px;
  font-size: 11px; color: #7a7367; font-variant-numeric: tabular-nums; }
.route-yoy, .route-log { font-size: 13px; margin-top: 4px; }
.route-yoy th, .route-log th { position: static; background: none; padding: 4px 8px; }
.route-yoy td, .route-log td { padding: 6px 8px; }
/* most recent year reads bold, older years dimmer */
.route-yoy tbody tr:last-child td { color: #f2ede6; font-weight: 600; }
.route-yoy tbody tr { cursor: default; }
.route-yoy tbody tr:hover { background: transparent; }
.route-log tbody tr { cursor: pointer; }

/* ---------------------------------------------------------------------------
   Mobile: the panel goes full-bleed and each pane scrolls with the page. The
   Map tab stacks (sidebar above the map); the floating hike list becomes a
   bottom sheet over the map.
   --------------------------------------------------------------------------- */
@media (max-width: 760px) {
  #app { border: none; border-radius: 0; min-height: 100vh; }

  #statbar { flex-wrap: wrap; gap: 10px 24px; padding: 16px 18px; }
  #summary { gap: 20px; }
  #tabbar { gap: 22px; padding: 0 18px; }

  .pane { padding: 18px; }
  .pane[data-pane="map"].active { display: block; height: auto; }
  #sidebar { width: 100%; border-right: none; overflow: visible;
    border-bottom: 1px solid rgba(255,255,255,0.08); }
  #map-area { height: 70vh; min-height: 300px; }
  #hike-panel { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto;
    max-height: 45%; }

  /* the per-hike drawer becomes a full-screen overlay */
  #detail { inset: 0; width: 100%; z-index: 1000; border-left: none; }

  /* keep wide content usable on narrow screens */
  .bar-row { grid-template-columns: 84px 1fr 52px; gap: 8px; }
  /* minmax(0,…) (not a bare 1fr) so the track can shrink below the route
     table's min-content width — otherwise the track blows past the viewport
     and the width:100% elevation graph stretches out with it */
  .route-grid, .route-list { grid-template-columns: minmax(0, 1fr); }
  /* the 5–6 col route tables can still exceed a phone's width — let each card
     scroll its own table rather than widen the card (and its graph) */
  .route-grid > .hl-card, .route-list > .hl-card { overflow-x: auto; }
}

/* mid-width: fewer route columns, slimmer floating panel */
@media (min-width: 761px) and (max-width: 1150px) {
  .route-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #hike-panel { width: 300px; }
}
