/* Ski Map — Apple-style frosted glass over a map that fills the window under the app bar (D2). Colours, type and timing come from design/tokens.css */

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
/* The shared app bar (resort.js, resort.css) sits on top as on every other page; the body is the space under it, so
   the map and everything floating over it (search, controls, cards, sheets) measure from the bar's bottom edge. The
   bar takes the notch's height too, so nothing below it needs safe-area-inset-top. */
.map-page { --app-bar-h: calc(65px + env(safe-area-inset-top, 0px)); }
.map-page .app-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--app-bar-h); min-height: 0;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
body.map-page {
  position: absolute; top: var(--app-bar-h); left: 0; right: 0; bottom: 0;
  height: auto;
}
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); }

#map { position: absolute; inset: 0; background: var(--snow); }   /* beyond the edge of the world: the same snow as outside Europe (europe.js) */
/* The map itself takes the keyboard (arrows pan, + and − zoom): the same ring as everything else, inside its edge */
.maplibregl-canvas:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }

/* Europe's edge (europe.js): the side of the screen that has reached the frame fades into snow, so the map stopping
   there reads as the end of the map, not a stuck gesture. In screen pixels, whatever the zoom; under the map's buttons. */
.europe-edge {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease-out;
  --edge: 40px;
}
.europe-edge-top    { top: 0; left: 0; right: 0; height: var(--edge); background: linear-gradient(to bottom, var(--snow), transparent); }
.europe-edge-bottom { bottom: 0; left: 0; right: 0; height: var(--edge); background: linear-gradient(to top, var(--snow), transparent); }
.europe-edge-left   { top: 0; bottom: 0; left: 0; width: var(--edge); background: linear-gradient(to right, var(--snow), transparent); }
.europe-edge-right  { top: 0; bottom: 0; right: 0; width: var(--edge); background: linear-gradient(to left, var(--snow), transparent); }
@media (max-width: 600px) { .europe-edge { --edge: 28px; } }
@media (prefers-reduced-motion: reduce) { .europe-edge { transition: none; } }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* Search */
.search {
  position: absolute;
  top: 16px;
  left: var(--gutter);
  width: min(380px, calc(100% - 2 * 16px - 96px));   /* the SOS pill (sos.css) is about 84 px wide */
  display: flex; align-items: center;
  z-index: 4;   /* its results open over the info card, which sits just under it on wide screens */
}
/* A magnifier (the way home is the logo in the app bar) */
.search-icon {
  flex: none; width: 20px; height: 20px; margin: 0 10px 0 14px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.search input {
  flex: 1; min-width: 0;
  height: 44px;
  border: 0; background: transparent;
  font: inherit; font-size: 16px;
  color: var(--text);
  padding: 0 14px 0 0;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search:focus-within { box-shadow: var(--shadow), 0 0 0 3px var(--focus-ring); }
.search, .control-group, .sos-button { transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-out); }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  background: var(--glass-solid);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: drop var(--dur-fast) var(--ease-out);
}
.search-results li {
  display: flex; flex-direction: column;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.search-results li strong { font-weight: 600; font-size: 15px; }
.search-results li span { font-size: 13px; color: var(--muted); }
.search-results li strong .resort-aka { font-size: inherit; }   /* the other name a resort was found by (resort.css) */
.search-results li[aria-selected="true"], .search-results li[role=option]:hover { background: rgb(var(--accent-rgb) / .1); }
.search-results li[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--accent); }   /* the row arrowed to, not only a tint */
.search-results .search-empty { color: var(--muted); cursor: default; font-size: 14px; }

@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* Controls */
.controls {
  position: absolute;
  top: 16px;
  right: max(16px, env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100% - 16px - max(16px, env(safe-area-inset-bottom)));
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 2;
}
.controls { align-items: flex-end; }   /* the open Layers and tools menu is wider than the round buttons */
.controls:has(.layers.open) { z-index: 4; }   /* the open menu grows down over the resort card (z-index 3), not behind it */
.controls > * { flex-shrink: 0; }
/* The column is as wide as the SOS pill: its empty part beside the round buttons lets taps and drags through to the map */
.controls { pointer-events: none; }
.controls > * { pointer-events: auto; }
.control-group[hidden] { display: none; }
.control-group { display: flex; flex-direction: column; overflow: hidden; }
.control {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.control + .control { border-top: 1px solid rgb(var(--navy-rgb) / .1); }
.control:hover { background: rgba(255, 255, 255, .6); }
.control:active { background: var(--separator); }
.control:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; box-shadow: inset 0 0 0 5px #fff; }   /* a white band inside the ring, so it reads over dark ground too */
.control svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Layers and tools (map-layers.js): one button that opens into a list of named controls below it */
#layers-toggle { position: relative; margin-left: auto; }
.layers.open #layers-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 14px; color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.layers.open { background: var(--glass-solid); }   /* the names and the muted 3D sign stay readable over dark ground */
.layers-title { display: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.layers.open .layers-title { display: block; }
/* A dot on the button while one of its layers is on, so it isn't forgotten behind the menu */
.layers:has(#focus-toggle[aria-pressed="true"], #avalanche-toggle[aria-pressed="true"]):not(.open) #layers-toggle::after {
  content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--glass-solid);
}
.layers-menu { display: flex; flex-direction: column; border-top: 1px solid rgb(var(--navy-rgb) / .1); animation: content-in var(--dur-fast) var(--ease-out); }
.layers-menu[hidden] { display: none; }
.layers-menu .control {
  width: auto; min-width: 216px; height: 46px;
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  padding: 0 14px 0 12px;
  font: inherit; font-size: 15px; font-weight: 500; text-align: left; color: var(--text);
}
.layers-menu .control[hidden] { display: none; }
/* A heading over a group of the menu's switches (the trail map's "Show on map") */
.layers-section {
  margin: 0; padding: 10px 14px 4px; border-top: 1px solid rgb(var(--navy-rgb) / .1);
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.layers-section:first-child { border-top: 0; }
.layers-section + .control { border-top: 0; }
.layers-menu .control > svg, .layers-menu .control-text { flex: none; width: 20px; }
.layers-menu .control-text { font-size: 12px; font-weight: 700; letter-spacing: .02em; text-align: center; color: var(--muted); }
.control-label { flex: 1; white-space: nowrap; color: var(--text); }
/* A switch for the ones that turn something on or off */
.layers-menu .control[aria-pressed]::after {
  content: ""; flex: none; width: 34px; height: 20px; border-radius: 999px;
  background: var(--separator) radial-gradient(circle at 10px 50%, #fff 7px, transparent 7.5px);
  box-shadow: inset 0 0 0 1.5px var(--switch-off-edge);   /* the off track's rim, 3:1 or more (WCAG 1.4.11) */
  transition: background-color var(--dur-fast) var(--ease);
}
.layers-menu .control[aria-pressed="true"]::after { box-shadow: none; background: var(--switch-on) radial-gradient(circle at 24px 50%, #fff 7px, transparent 7.5px); }
.layers-menu .control[aria-pressed="true"], .layers-menu .control[aria-pressed="true"]:hover { background: transparent; color: var(--text); }
.layers-menu .control[aria-pressed="true"]:hover, .layers-menu .control:hover { background: rgba(255, 255, 255, .6); }
.layers-menu .control[aria-pressed="true"] > svg { fill: none; }
.layers-menu .control[aria-pressed="true"] .control-text { color: var(--accent); }

#compass-needle { transition: transform .15s linear; }
#compass-needle .needle-n { fill: var(--badge); stroke: none; }
#compass-needle .needle-s { fill: var(--lift-closed); stroke: none; }

#locate .arrow { fill: none; stroke: var(--accent-map); }
#locate[data-state="on"] .arrow { fill: var(--accent-map); }
#locate[data-state="follow"] { background: var(--accent-map); }
#locate[data-state="follow"] .arrow { fill: #fff; stroke: #fff; }
#locate[data-state="locating"] svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* User location */
.user-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-map);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}
.user-dot::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent-map);
  animation: ring 2s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }

/* Chips, toast, legend */
.chips {
  position: absolute;
  top: calc(16px + 54px);
  left: var(--gutter);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  z-index: 1;
}
.chip {
  padding: 6px 12px;
  font-size: 13px; font-weight: 500;
  border-radius: 999px;
  z-index: 1;
}
.chip.poor { color: var(--caution-strong); }
.chip { transition: opacity var(--dur-fast) var(--ease); }

.toast {
  position: absolute;
  left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px);
  width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  font-size: 14px; line-height: 1.4;
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  z-index: 4;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:not(.show) { pointer-events: none; }   /* always in the page as a status region (map.js), only faded out */

.legends {
  position: absolute;
  left: var(--gutter);
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: calc(100% - 32px - 40px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  z-index: 1;
}
.legend {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
}
.legend.off, .legend.folded { display: none; }
/* The "Key" button that folds the key away (map-layers.js) */
.legend-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px 0 11px;
  border: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer;
}
.legend-toggle[hidden] { display: none; }
@media (max-width: 600px), (pointer: coarse) { .legend-toggle { min-height: 44px; } }   /* a finger's target */
.legend-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.legend-toggle.open { color: var(--accent); }
.legend-toggle:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; }
.legend .line { width: 16px; height: 0; border-top: 2px solid var(--lift); }
/* Each colour has its shape, as on the map (map.js, piste-shapes) and on printed European piste maps:
   circle green, square blue, diamond red, hexagon black */
.dot.novice { background: var(--piste-green); }
.dot.easy { background: var(--piste-blue); }
.dot.intermediate { background: var(--piste-red); }
.dot.advanced { background: var(--piste-black); }
.legend .dot.easy { border-radius: 1px; }
.legend .dot.intermediate { width: 8px; height: 8px; margin: 0 1px; border-radius: 0; transform: rotate(45deg); }
.legend .dot.advanced { width: 12px; border-radius: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.legend .pin { width: 9px; height: 9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); margin: 0 1px 2px; }   /* a map pin (parks.js) */
.pin.park { background: var(--poi-park); }
.pin.kids { background: var(--poi-kids); }
/* A piste junction (junctions.js): the white disc with a ring, like the marker on the map */
.legend .junction { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 1.5px solid var(--poi-junction); }
/* A car park (map.js): the blue "P" sign drawn on the map */
.legend .parking-key { width: 15px; height: 15px; border-radius: 4px; background: var(--poi-parking); color: #fff; font: 800 11px/15px var(--font); font-style: normal; text-align: center; }

/* Info card for a selected piste, lift or resort (A3). Buttons reuse .btn and .sheet-icon from friends.css.
   Phones: a frosted bottom sheet that slides up from the bottom edge and can be swiped down (sheets.js).
   Wider screens: a floating card at the bottom centre. */
.place-card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: calc(100% - 16px - 60px);   /* stays below the search bar */
  overflow-y: auto; overscroll-behavior: contain;
  padding: 10px var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  background: var(--glass-thick);
  -webkit-backdrop-filter: var(--blur-thick);
  backdrop-filter: var(--blur-thick);
  border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-sheet);
  z-index: 3;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-sheet);
}
.place-card.open { transform: none; }
.place-card:not(.open) { pointer-events: none; }
/* The grabber that says "swipe me" */
.place-card::before, .sheet::before {
  content: ""; display: block; flex: none;
  width: 36px; height: 5px; margin: 0 auto 10px;
  border-radius: 3px; background: var(--grabber);
}
.sheet::before { margin: 7px auto 0; }
@media (min-width: 700px) {
  .place-card {
    left: 50%; right: auto; bottom: max(16px, env(safe-area-inset-bottom)); width: 380px; margin-left: -190px;
    max-height: calc(100% - 16px - 60px - max(16px, env(safe-area-inset-bottom)));
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transform: translateY(24px) scale(.98); opacity: 0;
    transition: transform var(--dur) var(--ease-sheet), opacity var(--dur) var(--ease);
  }
  .place-card.open { opacity: 1; }
  .place-card::before, .sheet::before { display: none; }
  /* With the friends panel open on the left, sit next to it */
  body:has(#sheet.open) .place-card { left: calc(var(--gutter) + 396px); margin-left: 0; }
}
/* Wide screens: the card docks on the left under the search bar, as a side panel, instead of floating in the middle
   over the resort's own pistes (OBJECTIVES D-4). map.js (CARD_DOCKED, mapCover) frames what's selected in the map beside
   it. Lowered, it's just its name bar under the search. The chips and the key on the left move beside it. */
@media (min-width: 960px) {
  .place-card {
    left: var(--gutter); top: 72px; bottom: auto; margin-left: 0;
    max-height: calc(100% - 72px - max(16px, env(safe-area-inset-bottom)));
    transform: translateX(-16px) scale(.98);
  }
  body.place-open .chips, body.place-open .legends { left: calc(var(--gutter) + 396px); }
  body.place-open .legends { max-width: calc(100% - 32px - 40px - 396px); }
  /* The Friends, Directions and Filter panels sit on the left too (route.css, map-filter.css move the card beside them):
     the key moves beside them as well, and hides while the card is open next to a panel */
  body:has(#sheet.open, #route-sheet.open, #filter-sheet.open):not(.place-open) .legends { left: calc(var(--gutter) + 396px); max-width: calc(100% - 32px - 40px - 396px); }
  body:has(#sheet.open, #route-sheet.open, #filter-sheet.open).place-open .legends { opacity: 0; visibility: hidden; }
}
/* The card's heights (select.js): a resort's short "preview", the "full" card, and lowered to its name bar ("peek")
   so the map is in view. A tap anywhere on the bar raises it again; the chevron turns to point up. */
.place-card[data-detent="peek"] > :not(.place-head) { display: none; }
.place-card[data-detent="peek"] { cursor: pointer; }
.place-head .sheet-icon + .sheet-icon { margin-left: -4px; }   /* star, chevron and close sit a little closer */
.place-lower svg { transition: transform var(--dur) var(--ease); }
.place-card[data-detent="peek"] .place-lower svg { transform: rotate(180deg); }
/* The preview keeps each warning to its title; "Details" shows the rest */
.place-card[data-detent="preview"] .cond-alert { padding: 7px 0; align-items: center; }
.place-card[data-detent="preview"] .cond-alert div > span { display: none; }

/* Switching to another piste, lift or resort, or to another tab: the new content settles in */
.place-card.swap-item > :not(.place-head), .place-card.swap-tab .place-tabs ~ * { animation: content-in var(--dur) var(--ease-out) both; }
.place-card.swap-item .place-head { animation: fade var(--dur-fast) var(--ease) both; }
@keyframes content-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }

/* The card covers the legends unless the screen is wide enough for both (docked, they move beside it, above) */
@media (max-width: 1239px) {
  .legends { transition: opacity var(--dur-fast) var(--ease); }
  body.place-open .legends { opacity: 0; visibility: hidden; }
}

.place-head { display: flex; align-items: flex-start; gap: 12px; }
.place-titles { flex: 1; min-width: 0; padding-top: 2px; }
.place-head h2:focus { outline: none; }   /* focused when a search opens the card (map.js), as the panels' titles */
.place-head h2 { margin: 0; font-size: var(--text-title); font-weight: 700; line-height: 1.2; letter-spacing: var(--tracking-title); overflow-wrap: anywhere; }
.place-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.place-badge {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
}
.place-badge.piste { background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--stroke); }
.place-badge.lift { background: var(--lift); color: #fff; }
.place-badge.resort { background: var(--navy); color: #fff; }
.place-badge.junction { background: #fff; color: var(--poi-junction); border: 2px solid var(--poi-junction); }

/* A junction's card (junctions.js): the pistes that meet there, as coloured dots, and what the place is for */
.place-pistes { display: flex; flex-direction: column; gap: 6px; margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.place-pistes li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.place-pistes li i { flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px var(--stroke); }
.place-pistes li small { font-weight: 500; color: var(--muted); }
.place-hint { margin: var(--space-3) 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.place-badge svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.place-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: var(--space-2);
  margin: var(--space-4) 0 0;
}
.place-stats div { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--fill); }
.place-stats dt { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.place-stats dd { margin: 1px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.place-mix { margin-top: 12px; }
.mix-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; }
.mix-bar i { min-width: 3px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mix-legend i { width: 8px; height: 8px; border-radius: 50%; }

.place-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.place-tags li { padding: 3px 9px; border-radius: 999px; background: var(--fill-2); font-size: 12px; font-weight: 600; }
.place-tags li.warn { background: rgba(178, 80, 0, .12); color: #8a3d00; }
.place-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.place-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.place-actions .btn { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; }
.place-actions .btn { white-space: nowrap; }
.place-actions .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-actions .btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Live cameras (webcams.js): a square icon button, labelled once the card is wide enough for four labels. On a
   narrow resort card "Centre" turns square too (its name stays as the tooltip and for screen readers), so "Directions"
   and "Details" keep their words */
.place-actions { container-type: inline-size; }
.place-actions .btn.cams { flex: none; width: 44px; padding: 0; }
.place-actions .btn.cams span { display: none; }
@container (max-width: 439px) {
  .place-actions:has(.cams) .btn[data-action="centre"] { flex: none; width: 44px; padding: 0; font-size: 0; gap: 0; }
}
@container (min-width: 560px) {
  .place-actions .btn.cams { flex: 1; width: auto; padding: 0 12px; }
  .place-actions .btn.cams span { display: inline; }
}

/* MapLibre attribution, tucked into the glass look */
.maplibregl-ctrl-bottom-right {
  margin: 0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) 0;
  transition: transform var(--dur-slow) var(--ease-sheet), opacity var(--dur-fast) var(--ease), visibility var(--dur-fast);
}
/* On phones the (i) rides on top of an open bottom sheet, so the map credits stay reachable (--sheet-h from sheets.js).
   It moves to the left there, clear of the map controls, and opens to the right like MapLibre's bottom-left layout. */
@media (max-width: 699px) {
  .place-head, .sheet-header { touch-action: none; }   /* drag handles for sheets.js, not scroll areas */
  body.sheet-up .maplibregl-ctrl-bottom-right {
    right: auto; left: 0;
    margin-left: var(--gutter);
    transform: translateY(calc(max(16px, env(safe-area-inset-bottom)) - var(--sheet-h, 0px) - 8px));
  }
  body.sheet-up .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib-button { left: 0; right: auto; }
  body.sheet-tall .maplibregl-ctrl-bottom-right { opacity: 0; visibility: hidden; }
  body.sheet-up .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact-show { padding: 2px 8px 2px 28px; }
  body.sheet-up .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact::after { left: 0; right: auto; }
  /* ...with its 44 px area all above the sheet's edge, as the sheets (z-index 5) are over it; over the resort card
     (z-index 3) it reaches down over the 8 px gap into the card's empty top edge instead, as the chips on the left
     (Filters, Open now) can end 1 px above it (iOS Safari 2026-11-08: a 33 px gap at 402×714). sheets.js hides it
     (sheet-tall) when the chips leave less room than that; still under the search results (4, later in the page) */
  body.sheet-up .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-button::after { inset: -12px -10px -8px; }
  body.sheet-card .maplibregl-ctrl-bottom-right { z-index: 4; }
  body.sheet-card.sheet-rising .maplibregl-ctrl-bottom-right { z-index: 2; }   /* the card grown at once, while the (i) catches up (sheets.js) */
  body.sheet-card .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-button::after { inset: 0 -10px -20px; }
}
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0; }
.maplibregl-ctrl-attrib.maplibregl-compact {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
/* The credits' (i) is 24 px (MapLibre's own, absolutely placed): a 44 px tap area around it while the credits are
   closed (open, it would cover the end of their first line) */
.maplibregl-ctrl-attrib:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-button::after { content: ""; position: absolute; inset: -10px; }

@media (max-width: 600px) {
  /* The results scroll inside a box that stays clear of the on-screen keyboard (owner's report 2026-10-27) */
  .search-results { max-height: 45vh; max-height: 45dvh; overflow-y: auto; overscroll-behavior: contain; }
  .place-stats dd { font-size: 14px; }
  .legend { font-size: 11px; gap: 2px 10px; padding: 7px 12px; }
}

/* Reduce motion (D2): nothing slides, zooms or bounces. Panels, cards and messages fade in place instead, and looping
   animations stop. The SOS press-and-hold fill is kept (sos.css) because it shows progress. The map camera jumps
   instead of flying (map.js). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .place-card, .sheet { transform: none !important; transition: opacity var(--dur-fast) linear !important; }
  .place-card:not(.open), .sheet:not(.open) { opacity: 0; }
  .toast { transform: translate(-50%, 0) !important; transition: opacity var(--dur-fast) linear !important; }
  .legends, .maplibregl-ctrl-bottom-right { transition: opacity var(--dur-fast) linear !important; }
  .place-card.swap-item > *, .place-card.swap-tab .place-tabs ~ *, .sheet-body.view-in > *, .dialog[open], .search-results {
    animation: fade var(--dur-fast) linear both !important;
  }
}

/* Favourite star in the resort card's header, and the "I'm here" row (A9, map-links.js) */
.place-star { color: var(--muted); }
.place-star svg { fill: none; stroke-width: 1.8; }
.place-star[aria-pressed="true"] { color: var(--caution); }
.place-star[aria-pressed="true"] svg { fill: currentColor; }
.myresort-row.saved .browse-icon { background: var(--navy); color: #fff; }
.myresort-row + .offline-row { margin-top: var(--space-2); }
/* The card's small buttons (Home, I'm here, Save, Cancel, Remove, Try again) are 32 px: 44 px for a finger inside their
   row's 10 px padding, the rows no taller (iOS Safari 2026-11-08) */
@media (max-width: 600px), (pointer: coarse) {
  #place-card .btn.small { position: relative; }
  #place-card .btn.small::after { content: ""; position: absolute; inset: -6px 0; }
}

/* Open now (resort-status.js): the switch under the search box and how the check is going */
.open-now-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.open-now-chip .open-now-toggle, .open-now-status {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.open-now-chip .open-now-toggle:hover { background: var(--glass-solid); }
.open-now-status {
  max-width: min(320px, calc(100vw - 2 * var(--gutter) - 64px));
  padding: 5px 11px; border: 0; border-radius: 999px;
  font: inherit; font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer;
}
.open-now-status[hidden] { display: none; }
.search-results li .open-tag { margin-left: 6px; color: #fff; font-size: 11px; }   /* not the grey place line */
/* The resort card's live status line (select.js openStatusHTML) */
.open-status {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: var(--space-3); padding: 9px 12px; border-radius: 12px; background: var(--fill);
}
.os-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.open-status[data-state="open"] .os-dot { background: var(--live); box-shadow: 0 0 0 3px rgb(31 157 85 / .18); }
.open-status[data-state="closed"] .os-dot { background: var(--lift-closed); }
.os-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.os-text strong { font-size: 14px; font-weight: 600; }
.open-status[data-state="open"] .os-text strong { color: #177a43; }   /* a darker green than --live (3.5:1) for text: 5.3:1 */
.os-text span { font-size: 13px; }
.os-text small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.os-text small a { color: inherit; }
