/* Shared resort context (A9): the app bar at the top of every page (on the map, map.css fixes it above the map), and the "Which resort are you at?"
   picker dialog (resort.js). Colours, type and motion come from design/tokens.css. */

/* ---------- App bar ---------- */
/* Three columns on one line: the brand on the left (the logo and "Alpine", the way back to the dashboard), the
   resort pill in the middle (opens the picker; one line, only as wide as the resort's name), and the page links on the
   right as a segmented control, followed by the profile picture (Account, Settings, Sign out). The side columns share the free space equally, so the pill sits centred in the window
   and the bar's contents line up with the dashboard's 1120 px column. Up to 960 px the links, the search button and
   the picture give way to one three-line menu button (a 48 px tile, profile-menu.css), whose menu holds them all, on
   every page (2026-10-31); under 600 px the brand shrinks to a navy tile of the same size with just the logo, and the
   pill stays centred between the two. */

/* The same size on every page, whatever box model the page's own stylesheet uses (trail-map.css sets none) */
.app-bar, .app-bar * { box-sizing: border-box; }
.app-bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center;
  column-gap: 16px;
  min-height: 65px;   /* 48 px of buttons, 8 px above and below, the hairline: the same on every page (map.css --app-bar-h) */
  padding: 8px max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));   /* same content edge as .dash */
  background: var(--glass-thick);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--separator);
  font-family: var(--font);
  color: var(--text);
}

/* Scenery behind the bar (owner's request, 2026-10-15): a faint two-layer mountain ridge along the bottom edge that
   drifts slowly sideways, with a little light snow falling over it. Kept quiet on purpose: navy tints of a few
   percent, slow loops, and nothing at all when the system asks for reduced motion. The bar's stacking context
   (sticky/fixed with a z-index) keeps the scene above its glass background and under the buttons. */
.app-scene {
  position: absolute; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.app-scene i { position: absolute; left: 0; right: 0; bottom: 0; display: block; }
.app-scene-ridge {
  height: 40px;
  -webkit-mask: var(--ridge) repeat-x 0 100% / 600px 40px;
          mask: var(--ridge) repeat-x 0 100% / 600px 40px;
  animation: app-ridge 150s linear infinite;
}
.app-scene-ridge.back {
  --ridge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V26L40 18 70 24 110 8 150 22 190 14 230 26 280 10 320 20 360 6 410 22 450 16 500 26 540 12 580 22 600 26V40Z'/%3E%3C/svg%3E");
  background: rgb(var(--navy-rgb) / .045);
}
.app-scene-ridge.front {
  --ridge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V32L50 26 90 31 140 22 200 30 250 24 300 32 360 25 420 31 480 23 540 30 600 32V40Z'/%3E%3C/svg%3E");
  background: rgb(var(--navy-rgb) / .06);
  animation-duration: 90s;
  -webkit-mask-position: 300px 100%; mask-position: 300px 100%;
  animation-name: app-ridge-front;
}
@keyframes app-ridge { to { -webkit-mask-position: -600px 100%; mask-position: -600px 100%; } }
@keyframes app-ridge-front { to { -webkit-mask-position: -300px 100%; mask-position: -300px 100%; } }
/* Two layers of flakes, each a repeating tile that falls exactly one tile height per loop, so the loop never jumps */
.app-scene-snow { top: 0; }
.app-scene-snow::before, .app-scene-snow::after {
  content: ""; position: absolute; inset: 0;
  --flake: rgb(116 137 173 / .42);   /* --snow-mid, faint */
  background-image:
    radial-gradient(circle 1.6px at 22px 14px, var(--flake) 50%, transparent 100%),
    radial-gradient(circle 1.2px at 118px 52px, var(--flake) 50%, transparent 100%),
    radial-gradient(circle 1.8px at 196px 30px, var(--flake) 50%, transparent 100%),
    radial-gradient(circle 1.1px at 74px 70px, var(--flake) 50%, transparent 100%);
  background-size: 260px 80px;
  animation: app-snow 11s linear infinite;
}
.app-scene-snow::after {
  background-size: 340px 100px;
  background-position: 130px 0;
  opacity: .7;
  animation: app-snow-far 19s linear infinite;
}
@keyframes app-snow { from { background-position: 0 0; } to { background-position: 0 80px; } }
@keyframes app-snow-far { from { background-position: 130px 0; } to { background-position: 130px 100px; } }
@media (prefers-reduced-motion: reduce) {
  .app-scene i, .app-scene-snow::before, .app-scene-snow::after { animation: none; }
}

/* "Skip to content" (resort.js, R13 in design/accessibility.md): the bar's first link, out of sight until it has the
   keyboard focus, then a navy pill over the bar's left. The content it goes to takes the focus once (tabindex -1) and
   shows no ring of its own around the whole page. */
.app-skip {
  position: absolute; left: var(--gutter); top: 10px; z-index: 5;
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  padding: 0; border-radius: 999px; background: var(--navy); color: #fff;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.app-skip:focus { width: auto; height: 44px; clip-path: none; padding: 0 18px; line-height: 44px; outline: 3px solid var(--focus-ring); outline-offset: 2px; }
:is(main, #map)[tabindex="-1"]:focus { outline: none; }

/* Brand: the dashboard button, a navy pill holding the logo (three peaks, resort.js ICON.logo) and the name in the
   logo's spaced serif capitals (Alpine, owner's request 2026-10-27; it was the pin and "Ski Maps eu"). As tall as the bar's
   content allows (48 px of its 64, the Ski Map's bar too), the peaks 62 px wide: "more present, at least bigger" (owner,
   2026-10-27; they were 44 px and 46) */
.app-logo {
  grid-column: 1; justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px 0 12px;
  border-radius: 999px; background: var(--navy); color: #fff;
  text-decoration: none;
  font-family: var(--font-brand); font-weight: 600; font-size: 19px; letter-spacing: .2em; text-transform: uppercase;
  white-space: nowrap;
  transition: filter var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.app-logo:hover { filter: brightness(1.22); }
.app-logo:active { transform: scale(.97); }
.app-logo-tile { display: grid; place-items: center; color: inherit; }
.app-logo-tile svg { width: 62px; height: auto; display: block; margin-top: -4px; }   /* the peaks sit on the name's baseline */
/* A hairline outline in the mark's own colour, so its finest tips hold up at this size (thicker in the phone tile) */
.app-logo-tile path { stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.app-logo-name { margin-right: -.2em; }   /* no tracking after the last letter */

/* The resort pill: one line, only as wide as its name (long names are cut with an ellipsis) */
.app-resort {
  grid-column: 2; justify-self: center;
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0; max-width: min(40vw, 360px);
  height: 44px; padding: 0 12px 0 10px;
  border: 0; border-radius: 999px;
  background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.app-resort:hover { background: var(--fill-hover); }
.app-resort:active { transform: scale(.97); }
.app-resort-icon { display: grid; place-items: center; flex: none; color: var(--navy); }
.app-resort-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-resort-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-resort-name.short { display: none; }   /* "Resort" instead of "Choose your resort" on phones (below) */
.app-resort > svg { width: 16px; height: 16px; flex: none; transition: transform var(--dur-fast) var(--ease); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
/* The resort header (owner's request 2026-10-20): the name over "Your resort · Savoie, France" or "Viewing · Tyrol,
   Austria", so it's clear which resort the page shows, where it is and whether it's the user's own */
.app-resort-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.app-resort-place { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; color: var(--muted); }
.app-resort.viewing { box-shadow: inset 0 0 0 1.5px rgb(var(--accent-rgb) / .45); }
.app-resort.viewing .app-resort-icon { color: var(--accent); }
.app-resort[aria-expanded="true"] { background: var(--fill-hover); }
.app-resort[aria-expanded="true"] > svg { transform: rotate(180deg); }
/* Read by screen readers only */
.app-rs-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Right column: the page links (or the menu button), the search button (feature-search.css) and the profile picture
   (profile-menu.js, profile-menu.css) */
.app-end { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; }

/* Page links: a segmented control, the current page as the raised white segment */
.app-nav {
  display: flex; gap: 2px; padding: 4px;
  border-radius: 999px; background: var(--fill-2);
}
.app-nav a {
  display: block; height: 36px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; line-height: 36px; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.app-nav a:hover { color: var(--text); background: var(--fill-hover); }
.app-nav a[aria-current="page"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px var(--stroke); }

.app-bar button:focus-visible, .app-bar a:focus-visible, .rp button:focus-visible, .rp a:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 1px;
}

@media (max-width: 960px) {
  .app-bar { column-gap: 10px; }
  .app-nav { display: none; }   /* the ☰ menu lists the page links (profile-menu.js reads them from here) */
  .app-resort { max-width: 100%; }   /* no wider than its column, so it never runs under the logo or the buttons beside it */
}

@media (max-width: 600px) {
  /* Phones: just the logo, a navy tile as tall as the menu button and a little wider, so the wide peaks are drawn
     bigger (54 px; the tile was 48 px square with 44 px peaks); the bar's gaps give the room back to the resort pill */
  .app-bar { column-gap: 8px; }
  .app-logo { width: 60px; height: 48px; padding: 0; justify-content: center; border-radius: var(--radius); }
  .app-logo-name { display: none; }
  .app-logo-tile svg { width: 54px; margin-top: 0; }
  .app-logo-tile path { stroke-width: 2; }
  /* The pill has about 175 px here: no mountain icon, so a resort's name gets 30 px more, and a short prompt that fits
     in every language (OBJECTIVES D-2; "Choose your resort" read "Choose you…") */
  .app-resort { padding-left: 14px; }
  .app-resort-icon, .app-resort-name.long { display: none; }
  .app-resort-name.short { display: block; }
}

/* ---------- Resort picker dialog ---------- */

.rp {
  width: min(540px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--glass-solid);
  box-shadow: var(--shadow);
  color: var(--text); font-family: var(--font); font-size: 15px;
}
.rp[open] { display: flex; flex-direction: column; animation: rp-in var(--dur) var(--ease-out); }
.rp::backdrop { background: rgb(var(--navy-rgb) / .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: rp-fade var(--dur) var(--ease); }
@keyframes rp-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes rp-fade { from { opacity: 0; } }

/* Two-line labels in the picker rows (name over place), also used by the dashboard's favourites widget */
.rp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rp-text small { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rp-text strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A resort a search found by another name (resort.js's akaHTML): that name in grey brackets after its own,
   "SkiWelt Wilder Kaiser - Brixental (Söll)", in every resort search; the row takes two lines rather than cut it off */
.resort-aka { font-weight: 400; color: var(--muted); }
.rp-text strong:has(> .resort-aka) { white-space: normal; }

.rp-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 8px 20px; }
.rp-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-size: var(--text-title); font-weight: 700; letter-spacing: var(--tracking-title); color: var(--navy); }
.rp-icon {
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 50%; background: var(--fill-2); color: var(--text); cursor: pointer;
  display: grid; place-items: center;
}
.rp-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rp-icon:hover { background: var(--fill-hover); }

.rp-search { padding: 0 16px 8px; }
.rp-search input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 0; border-radius: 12px; background: var(--fill);
  font: inherit; font-size: 16px; color: var(--text);
}
.rp-search input::placeholder { color: var(--muted); }
.rp-search input:focus { outline: 3px solid var(--focus-ring); }

/* flex: 1 1 auto, not flex: 1: Safari sizes the sheet by its content, and a 0% basis made the list count as no height, so
   on iPhones the results were there but squeezed to nothing (Benji's report, 2026-10-24). min-height: 0 lets it scroll
   once the sheet reaches its max-height. */
.rp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px; }
.rp-group { margin: 14px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rp-list { list-style: none; margin: 0; padding: 0; }
.rp-item { display: flex; align-items: center; gap: 2px; }
.rp-row {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border: 0; border-radius: 12px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.rp-row:hover { background: var(--fill); }
.rp-row .rp-text strong { font-size: 15px; }
.rp-row .rp-text small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-icon-circle {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--fill-2); color: var(--navy);
}
.rp-icon-circle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp-item.mine .rp-icon-circle { background: var(--navy); color: #fff; }
.rp-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; vertical-align: 2px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
}

.rp-star {
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.rp-star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.rp-star:hover { background: var(--fill); color: var(--text); }
.rp-star[aria-pressed="true"] { color: var(--caution); }
/* A darker rim, so the filled star is 3:1 on white (R7 in design/accessibility.md; the fill alone is 2.06:1) */
.rp-star[aria-pressed="true"] svg { fill: currentColor; stroke: var(--caution-strong); }
.rp-star:active { transform: scale(.9); }

.rp-locate {
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - 8px); margin: 4px; padding: 10px 12px;
  border: 0; border-radius: 12px;
  background: rgb(var(--accent-rgb) / .1); color: var(--accent);
  font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.rp-locate:hover { background: rgb(var(--accent-rgb) / .16); }
.rp-locate:disabled { opacity: .6; cursor: default; }
.rp-locate svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.rp-current { display: flex; align-items: center; gap: 12px; margin: 4px; padding: 8px 12px; border-radius: 12px; background: var(--fill); }
.rp-current .rp-text { flex: 1; }
.rp-small {
  height: 32px; padding: 0 12px; flex: none;
  border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px var(--stroke);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.rp-small:hover { background: var(--snow); }
.rp-note { margin: 12px; font-size: 14px; color: var(--muted); }
.rp-foot { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--separator); font-size: 12px; color: var(--muted); }
.rp-foot a { color: var(--accent); }

@media (max-width: 600px) {
  .rp {
    width: 100vw; max-width: 100vw; max-height: 92vh;
    margin: auto 0 0; inset: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rp[open] { animation-name: rp-up; }
  @keyframes rp-up { from { transform: translateY(40px); opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .rp[open] { animation: rp-fade var(--dur-fast) linear; }
  .rp-star:active, .app-resort:active, .app-logo:active { transform: none; }
}

/* Loading and failure in the picker and the search */
.rp-loading { display: flex; align-items: center; gap: 10px; }
.rp-spinner { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill-hover); border-top-color: var(--accent); animation: rp-spin .8s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
.rp-failed { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.rp-failed p { flex: 1 1 200px; margin: 0; }
.rp-tag.quiet { background: var(--fill-2); color: var(--navy); }

/* ---------- The resort search under the header (resort.js, owner's request 2026-10-20) ----------
   A panel under the app bar's resort header, centred on it (resort.js sets --rs-top and --rs-left); the full width on
   phones. Not a modal: the page stays usable, and a press or the focus outside closes it. */
.app-rs {
  position: fixed; z-index: 1000;
  top: calc(var(--rs-top, 64px) + 6px); left: var(--rs-left, 8px);
  width: min(440px, calc(100vw - 16px));
  max-height: calc(100vh - var(--rs-top, 64px) - 18px);
  max-height: calc(var(--rs-bottom, 100dvh) - var(--rs-top, 64px) - 18px);   /* above the keyboard (resort.js placeSearch) */
  display: flex; flex-direction: column;
  border: 1px solid var(--separator); border-radius: var(--radius-lg);
  background: var(--glass-solid);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  color: var(--text); font-family: var(--font); font-size: 15px;
  animation: rp-in var(--dur) var(--ease-out);
}
.app-rs[hidden] { display: none; }
/* The close button and the veil over the page are for phones (below); wider, the page beside the panel is the way out */
.app-rs-close, .app-rs-scrim { display: none; }
.app-rs-head { padding: 14px 18px 12px; border-bottom: 1px solid var(--separator); }
.app-rs-label { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.app-rs-name {
  margin: 2px 0 0; color: var(--navy); overflow-wrap: anywhere;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: var(--tracking-title);
}
.app-rs-place { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.app-rs-mine, .app-rs-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.app-rs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.app-rs-btn {
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}
.app-rs-btn:hover { background: var(--fill-hover); }
.app-rs-btn.primary { background: var(--accent); color: #fff; }
.app-rs-btn.primary:hover { background: var(--accent); filter: brightness(1.12); }
.app-rs-field { position: relative; margin: 12px 14px 6px; }
.app-rs-field svg {
  position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
/* 16 px, so iOS Safari doesn't zoom in on the box */
.app-rs-field input {
  width: 100%; height: 44px; padding: 0 12px 0 38px;
  border: 0; border-radius: 12px; background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 16px;
}
.app-rs-field input::placeholder { color: var(--muted); }
.app-rs-field input:focus { outline: 3px solid var(--focus-ring); }
.app-rs-open { padding: 4px 14px; }
/* flex: 1 1 auto for the same reason as .rp-body above */
.app-rs-results {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 8px 8px; scroll-padding-bottom: var(--kb-bar, 0px);
}
/* iOS's form bar (resort.js formBarInset): room to scroll the last row above it, as content rather than padding, so the
   list can still shrink to nothing in a card short of room (the head and note shown, the keyboard up) */
.app-rs-results::after { content: ""; display: block; height: var(--kb-bar, 0px); }
.app-rs .rp-row { min-height: 52px; }
.app-rs .rp-row[aria-current="true"] { background: var(--fill); }
.app-rs .rp-star { width: 44px; height: 44px; }
.app-rs-note { margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--separator); font-size: 12px; color: var(--muted); }
/* The keyboard up with too little room under the app bar (a phone on its side): the card at the visual viewport's top,
   over the bar (resort.js placeSearch), keeping to the field and what results fit; the rest with the keyboard put away */
.app-rs.short :is(.app-rs-head, .app-rs-open, .app-rs-note) { display: none; }
.app-rs.short .app-rs-field { margin: 6px 12px 4px; }
/* ...and never shorter than its field: with Safari's word suggestions over the keyboard a phone on its side leaves 50 px
   of visual viewport, under the field's 44 (iOS 27.2, 2026-11-05); the field stays on the card, a little past that foot */
.app-rs.short { min-height: 64px; }
.app-rs button:focus-visible, .app-viewing button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }

/* The resort being viewed, under the app bar on every page but the map: what it is, that it isn't the user's resort,
   and the two explicit ways out */
.app-viewing { background: rgb(var(--accent-rgb) / .07); border-bottom: 1px solid rgb(var(--accent-rgb) / .18); }
.app-viewing-in {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px;
  padding: 10px max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));   /* the app bar's content edge */
}
.app-viewing .app-rs-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-width: 0; }
.app-viewing .app-rs-name { margin: 0; font-size: 17px; }
.app-viewing .app-rs-place { margin: 0; }
.app-viewing .app-rs-mine { flex: 1 1 220px; margin: 0; }
.app-viewing .app-rs-actions { margin: 0; }

@media (max-width: 600px) {
  /* Phones (owner's report 2026-10-27: the panel took the whole screen): a card inset from the edges, never taller
     than 70% of the screen and always ending above the keyboard (--rs-bottom, the visual viewport's foot, resort.js),
     so the page shows under it; a close button and a tap on the veiled page both close it */
  .app-rs {
    top: calc(var(--rs-top, 64px) + 4px); left: 8px; right: 8px; width: auto;
    max-height: min(70vh, calc(100vh - var(--rs-top, 64px) - 16px));
    max-height: min(70dvh, calc(var(--rs-bottom, 100dvh) - var(--rs-top, 64px) - 12px));
  }
  .app-rs-scrim:not([hidden]) {
    display: block; position: fixed; z-index: 999; top: var(--rs-top, 64px); left: 0; right: 0; bottom: 0;
    background: rgb(var(--navy-rgb) / .28);
    touch-action: none; overscroll-behavior: contain;   /* a drag on the veil doesn't scroll the page under the card */
    animation: rs-veil var(--dur-fast) linear;
  }
  @keyframes rs-veil { from { opacity: 0; } }
  .app-rs-close {
    display: grid; place-items: center; position: absolute; top: 4px; right: 4px; z-index: 1;
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px;
    background: none; color: var(--muted); cursor: pointer;
  }
  .app-rs-close:hover { background: var(--fill-2); color: var(--text); }
  .app-rs-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  /* A shorter head, so the results keep most of the room once the keyboard is up */
  .app-rs-head { padding: 10px 52px 10px 16px; }
  .app-rs-name { font-size: 17px; }
  .app-rs-place, .app-rs-mine, .app-rs-hint { font-size: 13px; }
  .app-rs-actions { margin-top: 8px; }
  .app-rs-field { margin: 10px 12px 4px; }
  .app-rs.short .app-rs-field { margin: 4px 52px 4px 12px; }   /* beside the ×, the head being folded away */
  /* While typing, the room goes to the results: the head keeps only the resort's name, and the note about viewing
     (both come back when the box is empty) */
  .app-rs:has(.app-rs-field input:not(:placeholder-shown)) :is(.app-rs-note, .app-rs-place, .app-rs-mine, .app-rs-hint, .app-rs-actions) { display: none; }
  .app-rs-note { padding: 8px 16px 10px; }
  /* The header above already says where it is: the bar keeps to what it is and the two ways out */
  .app-viewing-in { gap: 6px 12px; padding-top: 8px; padding-bottom: 10px; }
  .app-viewing .app-rs-place { display: none; }
  .app-viewing .app-rs-name { font-size: 15px; }
  .app-viewing .app-rs-btn { position: relative; min-height: 36px; padding: 0 12px; font-size: 13px; }
  .app-viewing .app-rs-btn::after { content: ""; position: absolute; inset: -4px 0; }   /* 44 px tall for a finger, the bar no taller */
}
/* A phone on its side (338 px tall in Safari with the keyboard put away, iOS 27.2): the head, field and switch filled the
   card and left the results no height. As on phones held upright, while typing the head keeps only the resort's name */
@media (min-width: 601px) and (max-height: 500px) {
  .app-rs:has(.app-rs-field input:not(:placeholder-shown)) :is(.app-rs-note, .app-rs-place, .app-rs-mine, .app-rs-hint, .app-rs-actions) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-rs { animation: rp-fade var(--dur-fast) linear; }
  .rp-spinner { animation-duration: 2.4s; }
  .app-resort[aria-expanded="true"] > svg { transform: none; }
}

/* ---------- Resort summary card (inner pages) and the piste mix bar (also used by the dashboard) ---------- */

.rs-card {
  padding: 20px 22px; margin: 0 0 24px;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgb(var(--navy-rgb) / .08), 0 6px 20px rgb(var(--navy-rgb) / .06);
  font-family: var(--font); color: var(--text);
}
.rs-head { display: flex; align-items: center; gap: 12px; }
.rs-head .rp-icon-circle { width: 44px; height: 44px; background: var(--navy); color: #fff; }
.rs-head .rp-icon-circle svg { width: 24px; height: 24px; }
.rs-titles { flex: 1; min-width: 0; }
.rs-titles h2 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: var(--tracking-title); color: var(--navy); line-height: 1.2; }
.rs-titles p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.rs-lead { margin: 14px 0 0; color: var(--muted); font-size: 15px; max-width: 640px; }
.rs-facts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rs-facts li { padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.rs-actions .rs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.rs-actions .rs-btn:hover { background: var(--fill-hover); }
.rs-actions .rs-btn.primary { background: var(--accent); color: var(--on-accent); }
.rs-actions .rs-btn.primary:hover { background: var(--accent-hover); }
.rs-actions .rs-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rs-head .rp-star { width: 44px; height: 44px; }   /* a finger's target, as in the app bar's resort search */
/* Phones: the buttons share the row's width, two to a row when they fit, else one above the other, never ragged at the
   left (here and in Home's hero, dashboard.css) */
@media (max-width: 640px) { .rs-actions .rs-btn, .hero-actions .dbtn { flex: 1 1 auto; } }

.mix { margin-top: 16px; max-width: 560px; }
.mix-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.mix-bar i { display: block; min-width: 3px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Buttons that look like links (widget footers, notes on the inner pages) */
.link-btn { border: 0; padding: 0; background: none; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Open now (resort-status.js): one switch, the same in the resort picker, on the Ski Map and in Browse */
.open-now-toggle {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 32px; padding: 4px 12px 4px 6px;
  border: 0; border-radius: 999px; background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.open-now-toggle:hover { background: var(--fill-hover); }
.open-now-toggle:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.open-now-toggle .on-track {
  position: relative; width: 32px; height: 20px; border-radius: 999px;
  background: rgb(var(--navy-rgb) / .22); transition: background var(--dur-fast) var(--ease);
  box-shadow: inset 0 0 0 1.5px var(--switch-off-edge);   /* the off track's rim (R6 in design/accessibility.md; the fill alone is 1.55:1) */
}
.open-now-toggle .on-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform var(--dur-fast) var(--ease-out);
}
.open-now-toggle[aria-checked="true"] .on-track { background: var(--switch-on); box-shadow: none; }
.open-now-toggle[aria-checked="true"] .on-knob { transform: translateX(12px); }
@media (prefers-reduced-motion: reduce) { .open-now-toggle .on-knob, .open-now-toggle .on-track { transition: none; } }
/* "Open" beside a resort's name in a list */
.open-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; vertical-align: 2px;
  border-radius: 999px; background: #177a43; color: #fff;   /* --live is 3.49:1 under white at 11 px; this is 5.4:1 (R5 in design/accessibility.md) */
  font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.rp-open { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 16px 8px; }
.rp-open-status { flex: 1; min-width: 160px; margin: 0; font-size: 13px; color: var(--muted); }
.rp-open-note { margin: 4px 12px 10px; font-size: 12px; color: var(--muted); }
/* Fingers (iOS Safari 2026-11-08): in the resort search and the picker, "Open now" was 32 px, "Find the resorts nearest
   me" 42 and the head's "Make it my resort" / "Back to …" 40 (the Viewing bar's own copies keep 36 px with their 44 px
   area, above) */
@media (max-width: 600px), (pointer: coarse) {
  .open-now-toggle, .rp-locate, .app-rs .app-rs-btn { min-height: 44px; }
}

/* Offline mode (auth-gate.js): a banner at the foot of every page while the account can't be reached; the map uses
   its own "Offline" chip (offline.js). Navy like that chip. */
.offline-banner {
  position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(520px, calc(100% - 32px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px;
  border-radius: var(--radius-lg); background: var(--navy); color: #fff;
  box-shadow: var(--shadow), 0 0 0 1px rgb(255 255 255 / .3);   /* the light edge keeps it apart from the navy footer */
  font-family: var(--font); animation: offline-banner-in var(--dur) var(--ease-out);
}
.offline-banner-icon { flex: none; width: 22px; height: 22px; }
.offline-banner-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.offline-banner-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.offline-banner-text strong { font-size: 14px; }
.offline-banner-text small { font-size: 12.5px; line-height: 1.35; opacity: .85; }
.offline-banner-close {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: inherit;
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.offline-banner-close:hover { background: rgb(255 255 255 / .12); }
.offline-banner-close:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
@keyframes offline-banner-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) { .offline-banner { animation: none; } }

/* ---------- The page behind the cards, and the footer ----------
   Owner's request (2026-10-20): the pages had a lot of bare white. Every page with the app bar except the Ski Map now
   has a pale sky that fades into the snow, a faint mountain ridge behind the page's head (the cards sit over it), a
   cooler snow than the map's so white cards stand out, and the navy footer at the foot of the window even when the
   page is short (the body is a flex column and the footer takes the spare height). The page's own stylesheet sets the
   plain snow, and loads after this one, so these rules carry the html prefix to win. */
:root { --page-tint: #eef3f9; --page-sky: #d7e4f3; }
html body.dash-page, html body.settings-doc, html body.tm-page, html body.page-inner {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    linear-gradient(to bottom, rgb(238 243 249 / 0) 150px, var(--page-tint) 330px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 230' preserveAspectRatio='none'%3E%3Cpath fill='%230b2545' fill-opacity='.055' d='M0 230V150L60 120 120 140 180 96 240 128 300 70 350 110 400 84 470 130 530 60 580 100 640 40 700 90 760 56 820 112 880 78 950 126 1010 66 1070 100 1130 48 1200 96 1260 70 1320 118 1400 90V230Z'/%3E%3Cpath fill='%230b2545' fill-opacity='.035' d='M0 230V110L70 80 140 104 200 60 260 92 330 30 390 74 450 48 520 96 590 24 650 70 720 44 790 84 850 36 920 90 980 50 1050 82 1110 30 1180 72 1250 46 1310 90 1400 56V230Z'/%3E%3C/svg%3E") center 56px / max(100%, 1400px) 230px no-repeat,
    linear-gradient(to bottom, var(--page-sky), var(--page-tint) 330px),
    var(--page-tint);
}
/* The page's main block keeps its full width as a flex item (auto side margins would shrink it to its content) */
html body.dash-page > :where(main, section), html body.settings-doc > :where(main, section),
html body.tm-page > :where(main, section), html body.page-inner > :where(main, section) { width: 100%; }

/* The footer of every page with the app bar except the Ski Map (D-6): one pattern, a navy band with the logo, the
   credits and the app's pages, with the app bar's mountain ridge along its top edge. The links are 44 px tall on
   phones and touch screens, so they're easy to tap. */
.site-foot {
  margin-top: auto;   /* the foot of the window on short pages */
  position: relative;
  padding: 30px var(--gutter) calc(26px + env(safe-area-inset-bottom));
  background: var(--navy);
  color: rgb(255 255 255 / .72);
  font: 13px/1.5 var(--font);
}
.site-foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40px; pointer-events: none;
  background: rgb(255 255 255 / .07);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3Cpath d='M0 0V14L40 22 70 16 110 32 150 18 190 26 230 14 280 30 320 20 360 34 410 18 450 24 500 14 540 28 580 18 600 14V0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 600px 40px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3Cpath d='M0 0V14L40 22 70 16 110 32 150 18 190 26 230 14 280 30 320 20 360 34 410 18 450 24 500 14 540 28 580 18 600 14V0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 600px 40px;
}
.site-foot-inner {
  position: relative; max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 6px; align-items: start;
}
/* The logo mark (ICON.logo in resort.js, the same path) in white, beside the credits; 88 px wide since 2026-10-27
   (it was 56) */
.site-foot-inner::before {
  content: ""; grid-row: 1 / 3; width: 88px; height: 33px; margin-top: 2px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 37.3'%3E%3Cpath d='M0 35.84C10.2 34.02 20.55 25.8 29.38 16.44L36 21.39L29.53 19.56C22.98 24.73 13.85 32.5 0 35.84ZM100 35.84C86.15 32.5 77.02 24.73 70.47 19.56L64 21.39L70.62 16.44C79.45 25.8 89.8 34.02 100 35.84ZM26.03 25.34L26.94 25.34C28.01 25.8 28.31 27.93 27.25 29.6C24.51 33.41 15.37 35.84 6.85 36.91C15.22 35.54 23.44 32.65 25.57 29.6C26.64 27.93 26.79 26.41 26.03 25.34ZM73.97 25.34C73.21 26.41 73.36 27.93 74.43 29.6C76.56 32.65 84.78 35.54 93.15 36.91C84.63 35.84 75.49 33.41 72.75 29.6C71.69 27.93 71.99 25.8 73.06 25.34L73.97 25.34ZM50 0L48.4 11.64L37.44 23.21C33.79 27.02 24.51 34.02 18.04 36C22.98 34.32 26.79 31.58 29.98 28.23C30.9 26.71 30.14 25.49 28.92 25.27C32.88 24.89 35.92 23.67 38.2 20.93L50 0ZM50 0L61.8 20.93C64.08 23.67 67.12 24.89 71.08 25.27C69.86 25.49 69.1 26.71 70.02 28.23C73.21 31.58 77.02 34.32 81.96 36C75.49 34.02 66.21 27.02 62.56 23.21L51.6 11.64L50 0ZM50 0L53.42 13.7L50.08 25.65L50 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 37.3'%3E%3Cpath d='M0 35.84C10.2 34.02 20.55 25.8 29.38 16.44L36 21.39L29.53 19.56C22.98 24.73 13.85 32.5 0 35.84ZM100 35.84C86.15 32.5 77.02 24.73 70.47 19.56L64 21.39L70.62 16.44C79.45 25.8 89.8 34.02 100 35.84ZM26.03 25.34L26.94 25.34C28.01 25.8 28.31 27.93 27.25 29.6C24.51 33.41 15.37 35.84 6.85 36.91C15.22 35.54 23.44 32.65 25.57 29.6C26.64 27.93 26.79 26.41 26.03 25.34ZM73.97 25.34C73.21 26.41 73.36 27.93 74.43 29.6C76.56 32.65 84.78 35.54 93.15 36.91C84.63 35.84 75.49 33.41 72.75 29.6C71.69 27.93 71.99 25.8 73.06 25.34L73.97 25.34ZM50 0L48.4 11.64L37.44 23.21C33.79 27.02 24.51 34.02 18.04 36C22.98 34.32 26.79 31.58 29.98 28.23C30.9 26.71 30.14 25.49 28.92 25.27C32.88 24.89 35.92 23.67 38.2 20.93L50 0ZM50 0L61.8 20.93C64.08 23.67 67.12 24.89 71.08 25.27C69.86 25.49 69.1 26.71 70.02 28.23C73.21 31.58 77.02 34.32 81.96 36C75.49 34.02 66.21 27.02 62.56 23.21L51.6 11.64L50 0ZM50 0L53.42 13.7L50.08 25.65L50 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.site-foot p { margin: 0; max-width: 720px; }
.site-foot strong { color: #fff; font-size: 15px; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot p a { text-decoration: underline; text-decoration-color: rgb(255 255 255 / .35); text-underline-offset: 2px; }
.site-foot a:hover { text-decoration: underline; }
.site-foot a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.site-foot-links { display: flex; flex-wrap: wrap; column-gap: 22px; }
.site-foot-links a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; color: rgb(255 255 255 / .85); }
.site-foot-links a:hover { color: #fff; }
@media (max-width: 600px), (pointer: coarse) {
  .site-foot-links { column-gap: 22px; }
  .site-foot-links a { min-height: 44px; min-width: 44px; justify-content: center; }
}
