/* ===== Wintersport tracker — "alpine editorial" =====
   Warm snow-paper by day, night-slope by dark. Chart series colors are the
   validated data-viz palette and must stay entity-stable per country. */

:root {
  --font-display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  --page: #f6f5f1;
  --surface-1: #fdfdfb;
  --surface-2: #f1efe9;
  --ink: #131311;
  --ink-2: #514f49;
  --muted: #8a877e;
  --grid: #e5e3da;
  --axis: #c6c3b8;
  --border: rgba(19, 19, 17, 0.09);
  --sel-bg: #1d1c18;
  --sel-ink: #f6f5f1;
  --sky: #e3ecf3;
  --ridge: #d5dee7;
  --star: #eda100;
  --good: #006300;
  --good-bg: rgba(0, 99, 0, 0.09);
  --bad: #c33636;
  --bad-bg: rgba(195, 54, 54, 0.09);
  --shadow: 0 1px 2px rgba(19, 19, 17, 0.04), 0 8px 24px -12px rgba(19, 19, 17, 0.1);

  /* categorical, fixed per country (entity-stable, validated palette) */
  --c-frankrijk: #2a78d6;
  --c-oostenrijk: #1baf7a;
  --c-italie: #eda100;
  --c-zwitserland: #4a3aa7;
  --c-noorwegen: #e34948;
  --c-zweden: #e87ba4;
  --c-andorra: #008300;
  --c-duitsland: #eb6834;
  --c-other: #898781;
  --c-alle: #898781;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #101216;
    --surface-1: #171a20;
    --surface-2: #1d2129;
    --ink: #f2f3f5;
    --ink-2: #b9bdc6;
    --muted: #82868f;
    --grid: #262a32;
    --axis: #343943;
    --border: rgba(255, 255, 255, 0.09);
    --sel-bg: #eef0f3;
    --sel-ink: #14161a;
    --sky: #161d29;
    --ridge: #1b212b;
    --good: #0ca30c;
    --good-bg: rgba(12, 163, 12, 0.14);
    --bad: #e66767;
    --bad-bg: rgba(230, 103, 103, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.5);

    --c-frankrijk: #3987e5;
    --c-oostenrijk: #199e70;
    --c-italie: #c98500;
    --c-zwitserland: #9085e9;
    --c-noorwegen: #e66767;
    --c-zweden: #d55181;
    --c-andorra: #008300;
    --c-duitsland: #d95926;
    --c-other: #898781;
  }
}
:root[data-theme="dark"] {
  --page: #101216;
  --surface-1: #171a20;
  --surface-2: #1d2129;
  --ink: #f2f3f5;
  --ink-2: #b9bdc6;
  --muted: #82868f;
  --grid: #262a32;
  --axis: #343943;
  --border: rgba(255, 255, 255, 0.09);
  --sel-bg: #eef0f3;
  --sel-ink: #14161a;
  --sky: #161d29;
  --ridge: #1b212b;
  --good: #0ca30c;
  --good-bg: rgba(12, 163, 12, 0.14);
  --bad: #e66767;
  --bad-bg: rgba(230, 103, 103, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.5);

  --c-frankrijk: #3987e5;
  --c-oostenrijk: #199e70;
  --c-italie: #c98500;
  --c-zwitserland: #9085e9;
  --c-noorwegen: #e66767;
  --c-zweden: #d55181;
  --c-andorra: #008300;
  --c-duitsland: #d95926;
  --c-other: #898781;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.dialog-open { overflow: hidden; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.fit:focus-visible {
  outline: 2px solid var(--c-frankrijk);
  outline-offset: 2px;
}
/* faint paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .masthead, .page-footer { position: relative; z-index: 1; }

/* ===== masthead ===== */
.masthead {
  background: linear-gradient(180deg, var(--sky) 0%, var(--page) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.masthead .ridge {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 90px;
  pointer-events: none;
}
.masthead-inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 20px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  justify-content: space-between;
  align-items: flex-end;
}
.brand-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.5vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 4px 0 6px;
}
h1 .season { color: var(--muted); font-weight: 600; }
.meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}
.controls { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.control-group { display: flex; flex-direction: column; gap: 5px; }
.control-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-1);
  box-shadow: var(--shadow);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button:hover { background: var(--surface-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button .seg-main { font-weight: 600; letter-spacing: 0.01em; }
.seg button .seg-sub { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }
.seg button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-ink); }
.seg button[aria-pressed="true"] .seg-sub { color: var(--sel-ink); opacity: 0.65; }
.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink-2);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-btn:hover { background: var(--surface-2); }

/* ===== shared page navigation ===== */
.site-nav {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  box-shadow: var(--shadow);
}
.site-nav a {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--sel-ink); background: var(--sel-bg); }
.masthead-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.dashboard-header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
}
.dashboard-header-tools .controls { justify-content: flex-end; }

/* ===== layout ===== */
main { max-width: 1280px; margin: 0 auto; padding: 22px 20px 40px; }
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0;
}
.subtle { color: var(--ink-2); font-weight: 400; }
.page-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 34px;
  font-size: 12.5px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== past wintersports ===== */
.history-page { overflow-x: clip; }
.history-main { max-width: none; padding: 0 20px 52px; overflow-x: clip; }
.history-overview {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.history-context {
  display: inline-flex;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}
.history-country-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  margin-left: auto;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
}
.history-summary-label {
  color: var(--muted);
  font: 9px/1.25 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.history-country-stat { position: relative; display: grid; gap: 1px; padding-left: 10px; }
.history-country-stat::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--axis);
}
.history-country-stat:nth-of-type(2)::before { background: var(--c-oostenrijk); }
.history-country-stat:nth-of-type(3)::before { background: var(--c-frankrijk); }
.history-country-name {
  color: var(--muted);
  font: 9px/1.2 var(--font-mono);
}
.history-country-value {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
}
.history-country-hoger .history-country-value { color: var(--bad); }
.history-country-lager .history-country-value { color: var(--good); }
.history-load-error {
  max-width: 780px;
  margin: 30px auto;
  padding: 16px;
  border: 1px solid var(--bad);
  border-radius: 12px;
  color: var(--bad);
  background: var(--bad-bg);
}
.history-mountain {
  position: relative;
  max-width: 1180px;
  min-height: 1280px;
  margin: 8px auto 0;
  padding: 24px 8px 64px;
}
.history-ridges,
.history-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.history-ridges { opacity: 0.86; }
.history-ridge-back { fill: var(--ridge); }
.history-ridge-front { fill: color-mix(in srgb, var(--surface-2) 82%, var(--page)); }
.history-route-snow {
  fill: none;
  stroke: color-mix(in srgb, var(--surface-1) 90%, transparent);
  stroke-width: 24;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.history-route-line {
  fill: none;
  stroke: var(--c-frankrijk);
  stroke-width: 2.5;
  stroke-dasharray: 5 8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.history-route-mobile { display: none; }
.trip-timeline {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trip-stop { position: relative; width: min(326px, 88vw); }
.trip-stop:nth-child(1) { margin-left: 0; }
.trip-stop:nth-child(2) { margin-left: 9%; }
.trip-stop:nth-child(3) { margin-left: 18%; }
.trip-stop:nth-child(4) { margin-left: 27%; }
.trip-stop:nth-child(5) { margin-left: 36%; }
.trip-stop:nth-child(6) { margin-left: 45%; }
.trip-stop:nth-child(7) { margin-left: 54%; }
.trip-stop:nth-child(8) { margin-left: 63%; }
.trip-stop:nth-child(9) { margin-left: calc(100% - min(326px, 88vw)); }
.trip-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-1) 95%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(7px);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.trip-stop.is-active .trip-card {
  border-color: color-mix(in srgb, var(--c-frankrijk) 58%, var(--border));
  box-shadow: 0 12px 30px -22px color-mix(in srgb, var(--c-frankrijk) 45%, transparent);
}
.trip-card-button {
  position: relative;
  width: 100%;
  padding: 12px 14px 11px 38px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.trip-stop:not(.is-active) .trip-card-button:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.trip-card-button:focus-visible { outline: 2px solid var(--c-frankrijk); outline-offset: 3px; }
.trip-marker {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--c-frankrijk);
  border-radius: 50%;
  background: var(--surface-1);
}
.trip-card-kicker {
  display: block;
  color: var(--muted);
  font: 10px/1.35 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.trip-card-title {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.trip-card-meta { display: block; margin-top: 3px; color: var(--ink-2); font-size: 11px; }
.trip-card-facts {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--grid);
  color: var(--ink-2);
  font-size: 10.5px;
}
.trip-card-facts strong { color: var(--ink); font-size: 13px; white-space: nowrap; }
.trip-details { padding: 0 14px 12px; border-top: 1px solid var(--grid); }
.trip-comparison {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px 0 0;
}
.trip-comparison > div { min-width: 0; }
.trip-comparison dt {
  color: var(--muted);
  font: 9.5px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.trip-comparison dd { margin: 2px 0 0; font-weight: 700; font-size: 11px; overflow-wrap: anywhere; }
.trip-delta-hoger { color: var(--bad); }
.trip-delta-lager { color: var(--good); }
.trip-current-unavailable { padding-top: 14px; }
.trip-current-unavailable strong { display: block; font-size: 13px; }
.trip-current-unavailable span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.trip-listing-link { display: inline-flex; margin-top: 8px; color: var(--ink-2); font-size: 10.5px; }
.trip-stop-cancelled {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(315px, 80vw);
  padding: 10px 13px;
  border: 1px dashed var(--axis);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  color: var(--ink-2);
  font-size: 11.5px;
}
.trip-stop-cancelled strong { display: block; color: var(--muted); font: 9.5px/1.2 var(--font-mono); }
.trip-cancel-marker { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--axis); color: var(--surface-1); }
#timeline-skier {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -58%) scaleX(-1) rotate(-10deg);
  transition: left 0.3s cubic-bezier(.2,.8,.2,1), top 0.3s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 3px 2px rgba(19, 19, 17, 0.18));
}
.history-method {
  max-width: 760px;
  margin: 5px auto 0;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--ink-2);
  font-size: 12.5px;
}
.history-method strong { display: block; margin-bottom: 3px; color: var(--ink); }

/* ===== booking decision ===== */
.decision-band {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.5fr);
  gap: 22px;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--axis);
  border-radius: 14px;
  padding: 17px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}
.decision-band.decision-book { border-left-color: var(--bad); }
.decision-band.decision-wait { border-left-color: var(--good); }
.decision-band.decision-watch { border-left-color: var(--c-frankrijk); }
.decision-status { text-align: left; }
.decision-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.decision-confidence {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: none;
}
.decision-band h2 {
  margin-top: 5px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.decision-status p {
  max-width: 55ch;
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}
.decision-evidence {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.decision-evidence > div {
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid var(--grid);
}
.decision-evidence dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}
.decision-evidence dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
}
.decision-evidence dd span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
}

/* ===== highlights ===== */
.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}
.hl-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
  animation: rise 0.45s ease both;
}
.hl-card:nth-child(2) { animation-delay: 0.06s; }
.hl-card:nth-child(3) { animation-delay: 0.12s; }
.hl-card img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
}
.hl-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
.hl-value {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 1px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hl-value .trend { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.hl-name { font-size: 13px; color: var(--ink-2); }
.hl-name a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.hl-name a:hover { color: var(--ink); border-bottom-style: solid; }
.hl-reason { margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }

/* ===== panels ===== */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease 0.12s both;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.chart-head-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.seg-small button { padding: 5px 11px; font-size: 12.5px; }
.legend { display: flex; gap: 13px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend .swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 5px;
}
.lost-summary {
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 9px 0 8px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.lost-summary[hidden] { display: none; }
.lost-summary:empty { display: none; }
.lost-summary-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lost-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.lost-summary-item strong { color: var(--ink); font-weight: 700; }
.lost-summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.market-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}
.market-summary[hidden], .market-note[hidden] { display: none; }
.market-summary-item {
  display: grid;
  grid-template-areas:
    "country current"
    "low distance"
    "low-evidence count";
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 10px 12px;
  background: var(--surface-1);
  font-size: 12px;
}
.market-summary-country { grid-area: country; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.market-summary-current { grid-area: current; text-align: right; }
.market-summary-low { grid-area: low; }
.market-summary-item strong { font-family: var(--font-mono); }
.market-summary-distance { grid-area: distance; color: var(--muted); text-align: right; }
.market-summary-low-evidence { grid-area: low-evidence; color: var(--muted); }
.market-summary-count { grid-area: count; color: var(--muted); text-align: right; }
.market-note { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; }
.trend small { margin-left: 4px; color: var(--muted); font: 500 10px/1.2 var(--font-body); }
.trend-flat { color: var(--muted); }

/* ===== chart ===== */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap svg text { font-family: var(--font-mono); }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 5;
  display: none;
}
.chart-tip .tip-date { color: var(--muted); font-family: var(--font-mono); font-size: 11px; margin-bottom: 4px; }
.chart-tip .row { display: flex; justify-content: space-between; gap: 16px; }
.chart-tip strong { font-family: var(--font-mono); font-weight: 600; }
.chart-tip .tip-cohort {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 400;
  text-align: right;
}
.chart-tip-market {
  box-sizing: border-box;
  max-width: calc(100% - 16px);
  white-space: normal;
}
.chart-tip-market .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
.chart-tip-market strong { min-width: 0; text-align: right; }
.chart-tip-market .tip-cohort {
  max-width: 22ch;
  margin-left: auto;
  overflow-wrap: anywhere;
}
.chart-empty { margin: 28px 0; color: var(--muted); font-size: 13px; text-align: center; }
.table-alt { margin-top: 10px; font-size: 13px; }
.table-alt summary { color: var(--muted); cursor: pointer; }
#avg-table { max-width: 100%; overflow-x: auto; }
.table-alt table { width: max-content; min-width: 100%; border-collapse: collapse; margin-top: 8px; }
.table-alt caption { padding: 4px 0; color: var(--muted); text-align: left; }
.table-alt th, .table-alt td { padding: 3px 12px; text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
.table-alt th:first-child, .table-alt td:first-child { text-align: left; }
.table-alt .table-cohort { display: block; color: var(--muted); font-size: 9.5px; }

/* ===== filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.filters input[type="search"], .filters select, .filters input[type="number"] {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-1);
  color: var(--ink);
  max-width: 120px;
}
.filters input[type="search"] { max-width: 185px; }
.filters .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-1);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.filters .chip:hover { background: var(--surface-2); }
.filters .chip input { position: absolute; opacity: 0; pointer-events: none; }
.filters .chip:has(input:checked) { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-bg); }
.filters .chip:has(input:focus-visible) {
  outline: 2px solid var(--c-frankrijk);
  outline-offset: 2px;
}
.filters .num-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.filters .reset-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: auto;
}
.filters .reset-btn:hover { color: var(--ink); }

/* ===== listing table ===== */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
}
table#listing-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
#listing-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 9px;
  border-bottom: 1px solid var(--axis);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface-1);
  z-index: 3;
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.sort-btn:hover { color: var(--ink); }
.sort-arrow { opacity: 0.4; }
#listing-table th.sort-active {
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--sel-bg);
}
#listing-table th[aria-sort="ascending"] .sort-arrow,
#listing-table th[aria-sort="descending"] .sort-arrow { opacity: 1; }
#listing-table th.num .sort-btn { margin-left: auto; }
#listing-table th.num, #listing-table td.num { text-align: right; }
#listing-table td.num, #listing-table .delta { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
#listing-table td { padding: 8px 9px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
#listing-table tbody tr { transition: background 0.12s ease; }
#listing-table tbody tr:hover td { background: var(--surface-2); }
#listing-table tbody tr:last-child td { border-bottom: 0; }
/* mute via color, not td opacity — transparent cells let scrolled content
   bleed through the sticky name column */
#listing-table tr.gone { color: var(--muted); }
#listing-table tr.gone .name-main a, #listing-table tr.gone .name-sub { color: var(--muted); }
#listing-table tr.gone img { opacity: 0.45; }
#listing-table tr.gone .fit, #listing-table tr.gone .delta, #listing-table tr.gone .spark,
#listing-table tr.gone .check, #listing-table tr.gone .badge { opacity: 0.5; }
#listing-table s { color: var(--muted); text-decoration-color: var(--bad); }
.tag-gone { background: var(--bad-bg); color: var(--bad); }
#listing-table a { color: inherit; text-decoration: none; }
#listing-table a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* sticky star + name columns while scrolling horizontally */
#listing-table th:nth-child(1), #listing-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface-1);
  width: 52px;
  min-width: 52px;
  white-space: nowrap;
}
#listing-table th:nth-child(2), #listing-table td:nth-child(2) {
  position: sticky;
  left: 52px;
  z-index: 2;
  background: var(--surface-1);
}
#listing-table th:nth-child(2).sort-active {
  background: var(--surface-2);
}
/* shadow only once the table is actually scrolled */
.table-scroll.scrolled th:nth-child(2), .table-scroll.scrolled td:nth-child(2) {
  box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.18);
}
#listing-table th:nth-child(1) { z-index: 4; }
#listing-table th:nth-child(2) { z-index: 4; }
#listing-table tbody tr:hover td:nth-child(-n + 2) { background: var(--surface-2); }

#listing-table .name-cell { min-width: 250px; max-width: 320px; }
.name-flex { display: flex; align-items: center; gap: 10px; }
.name-flex img {
  width: 46px;
  height: 36px;
  object-fit: cover;
  border-radius: 7px;
  flex: none;
}
.name-text { min-width: 0; }
.name-main { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.star-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  padding: 2px 4px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.12s ease;
}
.star-btn:hover { transform: scale(1.2); }
.star-btn.on { color: var(--star); }
.heart { font-size: 12px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  color: var(--ink-2);
  white-space: nowrap;
  background: var(--surface-2);
}
.badge.excellent { border-color: var(--c-zwitserland); color: var(--c-zwitserland); background: transparent; }
.badge.selections { border-color: var(--c-frankrijk); color: var(--c-frankrijk); background: transparent; }

.delta { font-size: 12px; white-space: nowrap; padding: 2px 7px; border-radius: 7px; }
.delta.up { color: var(--bad); background: var(--bad-bg); }
.delta.down { color: var(--good); background: var(--good-bg); }
.delta.flat { color: var(--muted); }
.spark { display: block; }
.note-cell { max-width: 190px; font-size: 12.5px; color: var(--ink-2); }
.check { color: var(--good); font-weight: 700; }

.empty-row td {
  text-align: center;
  padding: 34px 16px !important;
  color: var(--muted);
}
.empty-row button {
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* row highlight when jumped to from a highlight card */
#listing-table tr.row-flash td { animation: flash 1.8s ease; }

/* badges in the name cell */
.tag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  vertical-align: 2px;
  white-space: nowrap;
}
.tag-low { background: var(--good-bg); color: var(--good); }
.tag-new { background: var(--sel-bg); color: var(--sel-ink); }

/* compare checkbox + bar + modal */
.cmp-touch { display: inline-grid; place-items: center; vertical-align: middle; cursor: pointer; }
.cmp-box { accent-color: var(--sel-bg); cursor: pointer; margin: 0; }
.cmp-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sel-bg);
  color: var(--sel-ink);
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 13.5px;
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.4);
  /* dedicated keyframes: the generic 'rise' ends at transform:none, which
     would wipe the translateX(-50%) centering */
  animation: rise-center 0.25s ease both;
}
@keyframes rise-center {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.cmp-bar button {
  border: 0;
  border-radius: 20px;
  padding: 6px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--sel-ink);
  color: var(--sel-bg);
}
.cmp-bar button:disabled { opacity: 0.45; cursor: default; }
.cmp-bar button.ghost {
  background: transparent;
  color: var(--sel-ink);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 4px;
}
.cmp-bar[hidden], .cmp-overlay[hidden] { display: none; }
.cmp-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cmp-modal {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  animation: rise 0.25s ease both;
}
.cmp-modal h2 { margin-bottom: 12px; }
.cmp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 9px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
}
.cmp-scroll { overflow: auto; }
.cmp-table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.cmp-table th {
  text-align: left;
  vertical-align: top;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 9px 12px 9px 0;
  white-space: nowrap;
}
.cmp-table td {
  vertical-align: top;
  padding: 9px 14px;
  border-bottom: 1px solid var(--grid);
  border-left: 1px solid var(--grid);
  min-width: 190px;
}
.cmp-head img {
  width: 100%;
  max-width: 220px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 8px;
}
.cmp-head strong { display: block; }
.cmp-head a { color: inherit; }
.cmp-head .subtle { font-size: 12px; }
.cmp-matrix { border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.cmp-matrix th {
  font-size: 10px;
  padding: 2px 8px 2px 0;
  text-transform: none;
  letter-spacing: 0.03em;
}
.cmp-matrix td { border: 0; padding: 2px 10px 2px 0; min-width: 0; white-space: nowrap; }

/* room types (expandable rows + compare) */
.expand-btn {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  flex: none;
}
.expand-btn:hover { color: var(--ink); }
.detail-row td {
  position: static !important;
  background: var(--surface-2) !important;
  padding: 12px 16px 14px 60px;
  /* the single spanning cell must not inherit the sticky first-column rules */
  white-space: normal !important;
  width: auto !important;
  min-width: 0 !important;
}
.roomtypes { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.roomtype strong { color: var(--ink); font-weight: 600; }
.roomtype-footnote { font-size: 11px; margin-top: 8px; }

/* ===== detail row (expanded listing) ===== */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  max-width: 1100px;
}
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-h {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 12px 0 7px;
}
.detail-main .detail-h:first-child { margin-top: 0; }
.unit-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
  min-width: 180px;
}
.unit-card .unit-name { font-weight: 600; font-size: 12.5px; }
.unit-card .unit-facts { font-size: 12px; color: var(--ink-2); font-family: var(--font-mono); margin-top: 2px; }
.unit-off { opacity: 0.55; }
.other-units { margin-top: 10px; font-size: 12.5px; }
.other-units summary { color: var(--muted); cursor: pointer; margin-bottom: 8px; }
.note-line { margin-bottom: 10px; font-size: 13px; color: var(--ink-2); font-style: italic; }
.exact-room {
  border: 1px solid var(--border);
  border-left: 4px solid var(--axis);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-1);
}
.exact-room-good { border-left-color: var(--good); background: var(--good-bg); }
.exact-room-bad { border-left-color: var(--bad); background: var(--bad-bg); }
.exact-room-summary { font-size: 12.5px; color: var(--ink-2); }
.exact-status { font-weight: 750; color: var(--ink); margin-right: 5px; }
.exact-room-good .exact-status { color: var(--good); }
.exact-room-bad .exact-status { color: var(--bad); }
.exact-room-cards { display: grid; gap: 7px; margin-top: 8px; }
.exact-room-card {
  border-top: 1px solid var(--border);
  padding-top: 7px;
}
.exact-room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.exact-room-empty { font-size: 12.5px; color: var(--muted); }

.detail-resort {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  align-self: start;
}
.detail-resort .detail-h { margin-top: 0; }
.resort-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.resort-km { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 2px 0; }
.resort-km-unit { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.resort-local { font-size: 12px; }
.piste-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
  margin: 10px 0 6px;
}
.piste-seg { display: block; height: 100%; min-width: 3px; }
.piste-seg:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.piste-legend { display: grid; gap: 3px; font-size: 11.5px; font-family: var(--font-mono); color: var(--ink-2); }
.piste-leg { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 5px; }
.piste-legend .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.resort-height { margin-top: 8px; font-size: 12px; font-family: var(--font-mono); color: var(--ink-2); }
.resort-visits { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; font-size: 12px; }
.resort-visits summary { color: var(--ink-2); cursor: pointer; font-weight: 650; }
.resort-visits ul { list-style: none; margin: 7px 0 0; padding: 0; display: grid; gap: 7px; }
.resort-visits li { display: grid; gap: 1px; }
.resort-visits li span { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.resort-market {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.resort-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 7px 0 0;
  font-family: var(--font-mono);
}
.resort-facts > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.resort-facts dt {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  text-transform: uppercase;
}
.resort-facts dd {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.resort-facts > .resort-fact-primary {
  border-color: var(--axis);
  background: var(--surface-1);
}
.resort-fact-primary dd {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}
.resort-sample,
.resort-change {
  margin: 7px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.resort-change { color: var(--ink-2); }
.resort-change strong { display: block; font-weight: 650; }
.resort-change span { display: block; margin-top: 2px; color: var(--muted); }
.resort-reveal {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--ink-2);
  font-size: 11.5px;
}
.resort-reveal p { margin: 0 0 7px; }
.resort-reveal button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.resort-reveal button:hover { background: var(--surface-2); }
.focused-map-wrap {
  min-width: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.focused-map {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 0;
}
.focused-map-text {
  margin: 7px 0 8px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.45;
}
.focused-map-open,
.focused-map-status button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.focused-map-open:hover,
.focused-map-status button:hover { background: var(--surface-2); }
.focused-map-open:focus-visible { outline: 2px solid var(--c-frankrijk); outline-offset: 2px; }
.focused-map-status {
  margin-top: 7px;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.45;
}
.focused-map-status:empty { display: none; }
.focused-map-status button { margin-top: 6px; }

/* ===== price-history popover ===== */
.spark-btn { background: none; border: 0; padding: 0; cursor: pointer; display: block; border-radius: 6px; }
.spark-btn:hover { background: var(--surface-2); }
.hist-sub { margin: 0 0 10px; font-size: 12.5px; }
.hist-h3 { font-family: var(--font-display); font-size: 14px; margin: 16px 0 8px; }
.hist-table { border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.hist-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
  padding: 4px 10px;
  border-bottom: 1px solid var(--axis);
  white-space: nowrap;
}
.hist-table td { text-align: right; padding: 4px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.hist-table th:first-child, .hist-table td:first-child { text-align: left; }

/* ===== advanced filter rules ===== */
.chip-btn { font: inherit; font-size: 13px; }
.chip-active { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-bg); }
.adv-filters {
  border: 1px dashed var(--axis);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
.adv-head { color: var(--ink-2); margin-bottom: 10px; }
.adv-head select, .adv-rule select, .adv-rule input {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--ink);
}
.adv-rule { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; flex-wrap: wrap; }
.adv-rule input { max-width: 130px; }
.adv-del {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 3px 5px;
}
.adv-del:hover { color: var(--bad); }
.adv-foot { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.adv-foot #adv-add {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink);
  border-radius: 7px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.adv-foot #adv-add:hover { background: var(--surface-2); }

.ai-review {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  max-width: 860px;
}
.ai-review-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: inline-block;
  margin-right: 6px;
}

/* criteria fit pill */
.fit {
  display: inline-block;
  border: 0;
  padding: 2px 9px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  cursor: help;
}
.fit-ideaal { background: var(--good-bg); color: var(--good); }
.fit-oke { background: var(--surface-2); color: var(--ink-2); }
.fit-onbekend { background: var(--surface-2); color: var(--muted); }
.fit-nee { background: var(--bad-bg); color: var(--bad); }

/* per-criterion fit tooltip */
.fit-tooltip {
  position: fixed;
  z-index: 70;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  max-width: 320px;
  pointer-events: auto;
}
.fit-tip-head { margin-bottom: 7px; }
.fit-row { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.fit-icon { font-family: var(--font-mono); font-weight: 700; width: 13px; text-align: center; flex: none; }
.fit-icon-good { color: var(--good); }
.fit-icon-ok { color: var(--ink-2); }
.fit-icon-bad { color: var(--bad); }
.fit-icon-unknown { color: var(--muted); }
.fit-crit { font-weight: 600; white-space: nowrap; }
.fit-val { color: var(--ink-2); }

/* map */
#map-toggle summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13.5px;
}
#map-toggle summary:hover { color: var(--ink); }
#map {
  height: 540px;
  border-radius: 12px;
  margin-top: 12px;
  z-index: 0;
  background: var(--surface-2);
}
.leaflet-container { font: 12.5px/1.4 var(--font-body); }
.leaflet-popup-content a { font-weight: 600; }
.leaflet-control-container { max-width: 100%; }
.leaflet-control-attribution {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes flash {
  0%, 60% { background: var(--good-bg); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  #timeline-skier { transition: none; }
}

@media (max-width: 700px) {
  .history-main { padding-inline: 8px; }
  .history-overview { align-items: flex-end; padding: 12px 8px 0; }
  .history-context { max-width: 180px; line-height: 1.45; }
  .history-country-summary { gap: 9px; padding: 7px 9px; }
  .history-summary-label { display: none; }
  .history-mountain { min-height: 1320px; padding: 20px 12px 60px; }
  .history-route-desktop { display: none; }
  .history-route-mobile { display: block; }
  .trip-timeline { gap: 20px; }
  .trip-stop { width: calc(100% - 28px); margin-left: 0; }
  .trip-stop:nth-child(2), .trip-stop:nth-child(3) { margin-left: 4px; }
  .trip-stop:nth-child(4), .trip-stop:nth-child(5) { margin-left: 8px; }
  .trip-stop:nth-child(6), .trip-stop:nth-child(7) { margin-left: 12px; }
  .trip-stop:nth-child(8), .trip-stop:nth-child(9) { margin-left: 16px; }
  .trip-stop-cancelled { width: calc(100% - 46px); }
  .trip-card-title { font-size: 17px; }
  .trip-card-facts { align-items: end; gap: 8px; }
  .trip-comparison { grid-template-columns: 1fr 1fr; }
  .trip-comparison > div:last-child { grid-column: 1 / -1; }
  #timeline-skier { font-size: 27px; }
}

@media (max-width: 600px) {
  .market-summary { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .masthead-inner { padding: 22px 16px 20px; }
  .dashboard-header-tools { width: 100%; }
  .dashboard-header-tools .controls { width: 100%; justify-content: flex-end; }
  main { padding: 16px 12px 32px; }
  .decision-band { grid-template-columns: 1fr; gap: 15px; }
  .decision-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hl-card .hl-value { font-size: 22px; }
  .seg button { padding: 7px 11px; }
  .filters .reset-btn { margin-left: 0; }
  .filters input[type="search"],
  .filters input[type="number"],
  .filters select,
  .adv-head select,
  .adv-rule select,
  .adv-rule input { font-size: 16px; }
  .seg button,
  .theme-btn,
  .cmp-bar button,
  .cmp-close,
  .filters .chip,
  .filters .reset-btn,
  .adv-del,
  .adv-foot button,
  .empty-row button,
  .sort-btn,
  .table-alt summary,
  #map-toggle summary,
  .other-units summary,
  .resort-reveal button,
  .focused-map-open,
  .star-btn,
  .cmp-touch,
  .expand-btn,
  .spark-btn,
  .fit {
    min-height: 44px;
  }
  .theme-btn,
  .cmp-close,
  .adv-del,
  .star-btn,
  .cmp-touch,
  .expand-btn,
  .sort-btn,
  .spark-btn {
    min-width: 44px;
  }
  .table-alt summary,
  #map-toggle summary,
  .other-units summary,
  .star-btn,
  .expand-btn,
  .spark-btn {
    display: inline-flex;
    align-items: center;
  }
  #listing-table th:nth-child(1), #listing-table td:nth-child(1) {
    position: static;
    width: 104px;
    min-width: 104px;
  }
  #listing-table th:nth-child(2), #listing-table td:nth-child(2) { left: 0; }
  #listing-table .name-cell {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }
  .name-flex img { display: none; }
  .detail-grid {
    width: calc(100vw - 82px);
    max-width: calc(100vw - 82px);
  }
  .resort-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .focused-map-wrap,
  .focused-map-open { width: 100%; }
}
