/* Base site styles - GR20-M3-SITE-SPEC.md §3a/§0 + GR20-M5-VISUAL-SPEC.md. No
   framework, no build step. Loaded after tokens.css; every color here is a
   var(--token). Typeface: Inter variable (self-hosted subset, see
   static/fonts/LICENSE-Inter-OFL.txt), system stack fallback. */

@font-face {
  font-family: InterVariable;
  src: url("/static/fonts/InterVariable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }

/* The `hidden` attribute (used for progressive-enhancement surfaces like the watch
   builder's chip picker/summary bar - see watch.html/watch.js) must always win over
   any later same-specificity class rule that sets its own `display`. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: InterVariable, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.wrap-wide {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { display: block; padding-bottom: 4rem; }

/* --- skip link --------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--page);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--duration-fast) var(--ease);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* --- focus states -------------------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- header -------------------------------------------------------------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}
header.site .bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem 1rem;
}
a.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}
a.brand svg { display: block; }
header.site nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
header.site nav a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.95rem;
}
header.site nav a:hover { color: var(--ink); }
header.site nav a.cta-nav {
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
header.site nav a.cta-nav:hover { background: var(--accent-hover); }

/* --- theme toggle (§2) - quiet ghost button in the header ------------------------ */
button.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
button.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
button.theme-toggle .icon { vertical-align: 0; }
button.theme-toggle [data-theme-icon] { display: inline-flex; }

.lang-switch { display: flex; gap: 0.35rem; font-size: 0.85rem; }
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
}
.lang-switch a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.lang-switch a:hover { color: var(--ink); }

/* --- typography ------------------------------------------------------ */
/* Inter variable weight: headings at ~650 with tighter tracking; body stays 400. */
h1 {
  font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.8rem);
  line-height: 1.12;
  margin: 0.3rem 0 0.9rem;
  font-weight: 680;
  letter-spacing: -0.022em;
}
h2 {
  font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.7rem);
  margin: 3rem 0 1rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; font-weight: 650; letter-spacing: -0.008em; }

/* Quiet accent tick above content h2s; cards/board opt out. */
main h2::before {
  content: "";
  display: block;
  width: 1.4rem;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
  margin-bottom: 0.55rem;
}
main .crosssell-card h2::before, main .board h2::before { display: none; }

.icon { display: inline-block; vertical-align: -0.18em; flex: none; }
p { margin: 0 0 1rem; }
p.lede { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); color: var(--secondary); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- buttons ----------------------------------------------------------- */
.cta, button.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.cta:hover { background: var(--accent-hover); }
.cta:active { transform: translateY(1px); }
/* Hover lift is real motion - gated on the OS preference itself. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .cta { transition: background 150ms var(--ease), transform 150ms var(--ease), box-shadow 150ms var(--ease); }
  .cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
  .cta:active { transform: translateY(0); box-shadow: none; }
  .btn-secondary { transition: border-color 150ms var(--ease), transform 150ms var(--ease); }
  .btn-secondary:hover { transform: translateY(-1px); }
}
.cta:disabled { background: var(--hairline); color: var(--muted); cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--ink); }

/* --- hero + layered panorama (GR20-M5-VISUAL-SPEC.md §4) ------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 0 7.5rem;
}
/* Accent wash - 5% tint fading before the text ends; per-area/theme via --accent. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 72%);
  pointer-events: none;
}
.hero .panorama {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: auto;
  z-index: 0;
  pointer-events: none;
}
/* Atmospheric perspective: back (1) lightest, front (3) strongest; all from --accent. */
.pano-l1 { fill: var(--accent); opacity: 0.16; }
.pano-l2 { fill: var(--accent); opacity: 0.28; }
.pano-l3 { fill: var(--accent); opacity: 0.42; }
.pano-glacier { fill: var(--page); opacity: 0.7; }
.hero-content { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .hero-content { animation: hero-fade-up 700ms var(--ease) both; }
  @keyframes hero-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* --- motion layer (motion.js). .reveal-init is ONLY ever added by JS. ------------ */
.reveal-init {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}
.reveal-init.reveal-in { opacity: 1; transform: none; }

/* FAQ smooth expand - [data-anim] is JS-added; without JS, native <details>. */
.faq details[data-anim] {
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows var(--duration-slow) var(--ease);
}
.faq details[data-anim].faq-open { grid-template-rows: auto 1fr; }
.faq details[data-anim] > .answer {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  padding-top: 0;
  transition: padding-top var(--duration-slow) var(--ease);
}
.faq details[data-anim].faq-open > .answer { padding-top: 0.6rem; }

/* --- how it works steps ------------------------------------------------- */
.step { display: flex; gap: 0.9rem; margin: 1.4rem 0; align-items: flex-start; }
.step .num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem; height: 1.8rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}
.step .icon { flex: none; color: var(--accent); }
.step p { margin: 0.15rem 0 0; color: var(--secondary); }

/* --- pricing --------------------------------------------------------- */
.price-box {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface) 55%);
}
.price-box .amount { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* --- FAQ (native details/summary - no JS needed) ---------------------- */
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 0.9rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 400;
  font-size: 1.3rem;
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq dd, .faq .answer { margin: 0.6rem 0 0; color: var(--secondary); }

/* --- availability board ------------------------------------------------- */
.board { margin: 1.5rem 0; }
.board-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.board-row {
  display: block;
  text-decoration: none;
  color: inherit;
}
.board-row-inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--hairline);
}
.board-list li:first-child .board-row-inner { border-top: none; }
.board-row:hover .board-row-inner, .board-row:focus-visible .board-row-inner {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.status-dot {
  flex: none;
  width: 0.65rem; height: 0.65rem;
  border-radius: 50%;
  background: var(--status-unknown);
}
.status-dot.status-available { background: var(--status-available); }
.status-dot.status-limited { background: var(--status-limited); }
.status-dot.status-full { background: var(--status-full); }
.status-dot.status-unknown { border: 1.5px solid var(--hairline); background: transparent; }

.board-name { flex: 1 1 auto; font-weight: 600; min-width: 0; }
.board-name .stage-order { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.status-label {
  flex: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
/* Status text = theme tokens; no color-scheme media query may live in this file. */
.status-label.status-available { color: var(--status-available-text); background: color-mix(in srgb, var(--status-available) 18%, transparent); }
.status-label.status-limited { color: var(--status-limited-text); background: color-mix(in srgb, var(--status-limited) 25%, transparent); }
.status-label.status-full { color: var(--muted); background: var(--status-full-bg); }
.status-label.status-unknown { color: var(--muted); background: transparent; border: 1px solid var(--hairline); }
.board-count { flex: none; font-size: 0.85rem; color: var(--muted); text-align: right; min-width: 6.5rem; }
.board-arrow { flex: none; color: var(--muted); }

/* --- interactive trail v2 (GR20-M5-VISUAL-SPEC.md §3, gr20watcher/trail.py) ------ */
.trail-frame {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface);
}
/* Mobile pan edge-fade hints (pinned to the frame). */
.trail-frame::before, .trail-frame::after {
  content: "";
  position: absolute;
  top: 1px; bottom: 1px;
  width: 22px;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}
@media (max-width: 640px) {
  .trail-frame::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); opacity: 1; }
  .trail-frame::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); opacity: 1; }
}
.trail-scroller {
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  border-radius: inherit;
}
.trail-canvas { position: relative; min-width: 640px; scroll-snap-align: start; padding: 0.75rem 0.4rem 0.3rem; }
.trail-v2 { display: block; width: 100%; height: auto; }

.trail-grid-line { stroke: var(--hairline); stroke-width: 1; }
.trail-grid-label { fill: var(--muted); font-size: 9.5px; font-family: inherit; }
.trail-curve { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; }
.trail-area { fill: url(#trail-fill); }
.trail-fill-top { stop-color: var(--accent); stop-opacity: 0.16; }
.trail-fill-bottom { stop-color: var(--accent); stop-opacity: 0; }

.trail-marker { cursor: pointer; }
.trail-dot {
  stroke: var(--surface);
  stroke-width: 2;
  fill: var(--status-unknown);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--duration-fast) var(--ease);
}
.trail-dot.status-available { fill: var(--status-available); }
.trail-dot.status-limited { fill: var(--status-limited); }
.trail-dot.status-full { fill: var(--status-full); }
.trail-dot.status-unknown { fill: var(--surface); stroke: var(--muted); }
.trail-marker:hover .trail-dot, .trail-marker:focus-visible .trail-dot { transform: scale(1.35); }
.trail-marker:focus-visible .trail-dot { stroke: var(--ink); }
.trail-elev { fill: var(--muted); font-size: 9px; font-family: inherit; }
.trail-name { fill: var(--secondary); font-size: 10.5px; font-family: inherit; }
.trail-marker-offtrail .trail-name { fill: var(--muted); font-style: italic; }
.trail-marker:hover .trail-name, .trail-marker:focus-visible .trail-name { fill: var(--ink); font-weight: 600; }

/* Draw-in (trail.js, once); hiding classes are ONLY added by JS. */
.trail-anim .trail-curve { transition: stroke-dashoffset 1100ms var(--ease-out); }
.trail-anim .trail-area { opacity: 0; transition: opacity 700ms var(--ease) 500ms; }
.trail-anim .trail-marker { opacity: 0; }
.trail-anim .trail-marker .trail-dot { transform: scale(0.4); }
.trail-anim .trail-marker.in { opacity: 1; transition: opacity 300ms var(--ease-out); }
.trail-anim .trail-marker.in .trail-dot { transform: scale(1); transition: transform 300ms var(--ease-out); }
.trail-anim .trail-marker.in:hover .trail-dot, .trail-anim .trail-marker.in:focus-visible .trail-dot { transform: scale(1.35); }
.trail-drawn .trail-area { opacity: 1; }

/* Hover/focus card - HTML overlay positioned by trail.js. */
.trail-card {
  position: absolute;
  z-index: 3;
  top: 0; left: 0;
  width: 15.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px var(--ring);
  padding: 0.7rem 0.85rem 0.75rem;
  font-size: 0.85rem;
}
.trail-card p { margin: 0 0 0.35rem; }
.trail-card-name { font-weight: 650; display: flex; align-items: center; gap: 0.4rem; padding-right: 1.4rem; }
.trail-card-name .icon { color: var(--accent); }
.trail-card-meta { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.trail-card-beds { display: flex; align-items: center; gap: 0.4rem; color: var(--secondary); }
.trail-card-beds .icon { color: var(--muted); }
.trail-card-links { display: flex; gap: 1.1rem; margin: 0.55rem 0 0 !important; }
.trail-card-links a { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.trail-card-close {
  position: absolute;
  top: 0.4rem; right: 0.4rem;
  border: none; background: none;
  color: var(--muted);
  padding: 0.2rem;
  cursor: pointer;
  line-height: 0;
}
.trail-card-close:hover { color: var(--ink); }

/* --- refuge page --------------------------------------------------------- */
.refuge-meta { color: var(--muted); margin-bottom: 1rem; }
.status-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--surface);
  margin: 1.25rem 0;
}
.status-card .status-dot { width: 0.85rem; height: 0.85rem; }
.status-card .status-text { font-weight: 700; }
.refuge-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
}
.refuge-nav a { text-decoration: none; }

/* --- watch builder ------------------------------------------------------- */
.chip-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1.25rem; }
.chip {
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[disabled] { opacity: 0.45; cursor: not-allowed; }

.summary-bar {
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.92rem;
}
.summary-bar strong { font-variant-numeric: tabular-nums; }
.row-cap-note { color: var(--muted); font-size: 0.85rem; margin: -0.5rem 0 1rem; }
.field-hint { font-size: 0.8rem; margin-top: 0.25rem; }
.field-hint.field-hint-error { color: var(--danger); }
.field-hint.field-hint-dup { color: var(--status-limited-text); }

form.watch-form fieldset {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: var(--surface);
}
form.watch-form fieldset[data-duplicate="true"] { border-color: var(--status-limited); }
form.watch-form legend { padding: 0 0.4rem; font-weight: 600; color: var(--secondary); }
form.watch-form label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0.25rem; }
form.watch-form select, form.watch-form input {
  width: 100%;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--page);
  color: var(--ink);
  font-family: inherit;
}
.row-actions { text-align: right; margin-top: 0.6rem; }
.row-actions button.remove-row {
  background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.88rem; padding: 0.3rem 0;
}
button.add-row {
  background: var(--surface); border: 1px dashed var(--hairline); border-radius: var(--radius-sm);
  padding: 0.65rem 1rem; cursor: pointer; color: var(--accent); font-weight: 600; width: 100%;
}
button.add-row:hover { border-color: var(--accent); }
button.add-row:disabled { color: var(--muted); border-color: var(--hairline); cursor: not-allowed; }

@media (prefers-reduced-motion: no-preference) {
  .watch-row { animation: row-in var(--duration-med) var(--ease) both; }
  @keyframes row-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
}

/* --- rifugi shelter picker (static/rifugi.js) + ffcam hut picker (static/ffcam.js).
   Class names stay distinct per area (GR20-R3-FFCAM-SPEC.md §3's "independently
   editable" judgement) but the rule bodies were byte-identical, so M5's budget pass
   merged them into shared selector lists - fork a selector out if one area ever
   needs to diverge. -------------------------------------------------------------- */
.shelter-picker, .hut-picker { position: relative; }
input.shelter-search, input.hut-search {
  width: 100%;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--page);
  color: var(--ink);
  font-family: inherit;
}
ul.shelter-results, ul.hut-results {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px var(--ring);
}
ul.shelter-results li, ul.hut-results li { margin: 0; }
button.shelter-result, button.hut-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  background: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
}
button.shelter-result:hover, button.shelter-result:focus-visible,
button.hut-result:hover, button.hut-result:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.shelter-result-empty, .hut-result-empty { padding: 0.5rem 0.6rem; color: var(--muted); font-size: 0.88rem; }

/* --- rifugi route preset pages -------------------------------------------- */
.route-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.route-list li a {
  display: inline-block;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.route-list li a:hover { border-color: var(--accent); }

/* --- cross-sell card (GR20-R3-FFCAM-SPEC.md §4) - homepage + rifugi/ffcam landings,
   each pointing at the OTHER two products. Deliberately quiet: same surface/hairline
   tokens as .price-box, muted heading size, no accent background - must never compete
   with a page's own primary CTA. -------------------------------------------------- */
.crosssell-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--surface);
}
.crosssell-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  letter-spacing: normal;
}
.crosssell-card p { margin: 0 0 0.75rem; color: var(--secondary); font-size: 0.92rem; }
.crosssell-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 0 !important; }
.crosssell-links a { font-weight: 600; text-decoration: none; }
.crosssell-links a:hover { text-decoration: underline; }

/* --- errors / notices ---------------------------------------------------- */
.errors {
  background: color-mix(in srgb, var(--danger) 10%, var(--page));
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}
.errors ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.notice {
  background: color-mix(in srgb, var(--status-available) 12%, var(--page));
  border: 1px solid var(--status-available);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}

/* --- manage card ---------------------------------------------------------- */
.watch-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  background: var(--surface);
}
.watch-card .status { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.watch-card .actions { margin-top: 0.9rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.watch-card .actions button {
  padding: 0.55rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--hairline);
  background: var(--page); color: var(--ink); cursor: pointer; font-size: 0.9rem;
}
.watch-card .actions button.danger { color: var(--danger); border-color: var(--danger); }

/* --- footer ---------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--hairline);
  margin-top: 3rem;
  padding: 2rem 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}
footer.site .wrap-wide { display: flex; flex-direction: column; gap: 0.6rem; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--ink); }
footer.site .foot-links { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 640px) {
  .board-list .board-count { display: none; }
  header.site .bar { justify-content: flex-start; }
  header.site nav { width: 100%; gap: 0.9rem; justify-content: space-between; }
}

/* Header region bar - the three-product hub strip under the main bar. Quiet by
   design: hairline separator, small type; the active region wears the area accent. */
header.site .regions { border-top: 1px solid var(--hairline); font-size: 0.85rem; }
header.site .regions .wrap-wide { display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.35rem 1.1rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.regions-lead { color: var(--muted); }
header.site .regions a { color: var(--secondary); text-decoration: none; }
header.site .regions a:hover { color: var(--accent); text-decoration: underline; }

/* --- availability pulse (GR20-M4-PULSE-SPEC.md §2) ----------------------------------
   Dataviz method rules followed throughout: thin 2px marks, 4px rounded bar data-ends
   anchored to the baseline with 2px gaps, recessive hairline gridlines/axes, text
   always in ink/secondary/muted - never the series (accent) color - tabular-nums for
   every value, no draw animation under prefers-reduced-motion (nothing here animates
   on load in the first place), and a <details> table fallback per chart. */
.pulse { margin: 1.5rem 0; }
.pulse-subline { color: var(--muted); font-size: 0.9rem; margin-top: -0.25rem; }

.pulse-tiles {
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.pulse-tile {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 4%, var(--surface)), var(--surface) 70%);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pulse-tile-value { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.pulse-tile-label { font-size: 0.78rem; color: var(--muted); }

.pulse-chart-block { margin: 1.25rem 0; }
.pulse-chart-block h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.pulse-chart-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.75rem 0.5rem;
  overflow-x: auto;
}
.pulse-chart { display: block; min-width: 480px; width: 100%; height: auto; }

.pulse-grid-line { stroke: var(--hairline); stroke-width: 1; }
.pulse-axis-label { fill: var(--muted); font-size: 9px; font-family: system-ui, sans-serif; }
.pulse-empty-text { fill: var(--muted); font-size: 12px; font-family: system-ui, sans-serif; }

.pulse-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.pulse-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.pulse-hover-overlay { fill: transparent; cursor: crosshair; }
.pulse-crosshair { stroke: var(--secondary); stroke-width: 1; stroke-dasharray: 2 2; }

.pulse-bar-shape { fill: var(--accent); }
.pulse-bar-hit { fill: transparent; cursor: pointer; }

.pulse-tooltip-bg { fill: var(--surface); stroke: var(--hairline); stroke-width: 1; }
.pulse-tooltip-line { font-size: 10px; font-family: system-ui, sans-serif; }
.pulse-tooltip-line1 { fill: var(--secondary); }
.pulse-tooltip-line2 { fill: var(--ink); font-weight: 600; }

.pulse-sparkline { display: block; width: 100%; height: auto; max-width: 160px; }
.pulse-sparkline-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.pulse-sparkline-end { fill: var(--accent); }
.pulse-sparkline-flat { stroke: var(--hairline); stroke-width: 1.5; }

.pulse-table-toggle { margin-top: 0.6rem; font-size: 0.85rem; }
.pulse-table-toggle summary { cursor: pointer; color: var(--secondary); }
.pulse-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.85rem; }
.pulse-table th, .pulse-table td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--hairline); }
.pulse-table th { color: var(--muted); font-weight: 600; }
.pulse-table td.tabular-nums, .pulse-table th:nth-child(2), .pulse-table th:nth-child(3) { text-align: right; }

.refuge-sparkline-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem;
}
.refuge-sparkline-label { font-size: 0.8rem; color: var(--muted); flex: none; }
.refuge-sparkline-wrap { flex: none; }

@media (max-width: 640px) {
  .pulse-tiles { grid-template-columns: repeat(2, 1fr); }
}
header.site .regions a.active { color: var(--accent); font-weight: 600; }

/* ====================== M6: explore links (GR20-M6-EXPLORE-LAYOUT-SPEC.md §1) ======
   Quiet affordances by design: muted ink, no accent backgrounds - an "about" link must
   never compete with the row's real controls or the page CTA. */

/* GR20 chip picker: the pill moves to the wrapper; the chip button keeps its whole
   add/fill behavior (watch.js targets .chip - the info link is outside it). */
.chip-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.chip-wrap:hover, .chip-wrap:focus-within { border-color: var(--accent); }
.chip-wrap .chip { border: none; border-radius: 0; background: none; padding: 0.45rem 0.55rem 0.45rem 0.9rem; }
.chip-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem; /* >= 24px hit target at default rem */
  padding: 0 0.55rem 0 0.35rem;
  color: var(--muted);
  border-left: 1px solid var(--hairline);
  text-decoration: none;
}
.chip-info:hover, .chip-info:focus-visible { color: var(--accent); }
.chip-info .icon { vertical-align: 0; }

/* Per-row "About ↗" under the location select (all three forms). */
.row-about { margin: 0.4rem 0 0; font-size: 0.82rem; }
.row-about-link { font-weight: 600; text-decoration: none; }
.row-about-link:hover { text-decoration: underline; }

/* Search-result rows (rifugi/ffcam pickers) gain a trailing info link. */
ul.shelter-results li, ul.hut-results li { display: flex; align-items: stretch; }
button.shelter-result, button.hut-result { flex: 1 1 auto; }
.result-about {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  padding: 0 0.5rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.result-about:hover, .result-about:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Detail pages (refuge / CAI shelter / FFCAM hut). */
.detail-meta { margin: -0.5rem 0 1.25rem; font-size: 0.9rem; display: flex; align-items: center; gap: 0.45rem; }
.detail-side-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.25rem 0 -0.75rem;
}
.detail-status-note { font-size: 0.85rem; margin: -0.75rem 0 1.25rem; }
.official-link { font-size: 0.9rem; }
.official-link a { font-weight: 600; text-decoration: none; }
.official-link a:hover { text-decoration: underline; }

/* Watch-form rail: invisible wrapper on mobile (summary bar keeps its M5 sticky-bottom
   behavior untouched); becomes the sticky right rail in the wide grid below. */
.watch-rail { display: contents; }
.watch-rail-art { display: none; }

/* ================== M6: responsive layout (GR20-M6-EXPLORE-LAYOUT-SPEC.md §3) ======
   Mobile (<=~700px) is untouched by design - no rule below applies there. */

/* Comfortable single column between phone and the wide grid. */
@media (min-width: 700px) and (max-width: 1049.98px) {
  .wrap { max-width: 800px; }
}

/* Wide grid (>=1050px): 1160px container, two-zone hero, 2-col board, side-by-side
   pulse charts, 2x2 steps, 2-col FAQ (a real grid - NOT css columns: <details>
   toggling reflows column layouts disturbingly), right-rail watch forms, 2-col
   detail pages. Same rhythm, more whitespace discipline, never louder. */
@media (min-width: 1050px) {
  :root { --max-width: 1160px; }
  .wrap { max-width: var(--max-width); }

  /* Prose discipline: a 1160px container never means 1160px text lines. */
  main.wrap > p, main.wrap section > p, .detail-body p { max-width: 70ch; }

  /* Hero: copy left (~55%), panorama in the right zone, wash truly full-bleed
     (classic negative-margin breakout; the padding restores content alignment).
     overflow-x: clip (NOT hidden - hidden would trap the sticky rails) guards the
     50vw math against a scrollbar-width overflow. Fold-friendly padding so the
     board peeks above the fold on 16:10 screens. */
  body { overflow-x: clip; }
  .hero {
    padding: 3.5rem 0 4rem;
    margin-inline: calc(50% - 50vw);
    padding-inline: calc(50vw - 50%);
  }
  .hero-content { max-width: 36rem; }
  /* Bottom-anchored at ~72% height: full height over-zooms the silhouettes into
     single giant shapes (the slice crop scales by height). */
  .hero .panorama { inset: auto 0 0 auto; width: 52%; height: 58%; }

  /* Board: two columns, trail order flowing down the first column (7) then the
     second (6); the second column gets its own hairline. */
  .board .board-list { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; }
  .board .board-list li:nth-child(8) .board-row-inner { border-top: none; }
  .board .board-list li:nth-child(n+8) .board-row-inner { border-left: 1px solid var(--hairline); }

  /* Pulse: tiles row spans, then the two chart blocks side by side. */
  .pulse { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .pulse > h2, .pulse > .pulse-subline, .pulse > .pulse-tiles { grid-column: 1 / -1; }
  .pulse-chart-block { margin-top: 0.5rem; }
  .pulse-chart { min-width: 0; }

  /* How it works: 2x2. */
  .steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 3rem; }
  .steps .step { margin: 0.9rem 0; }

  /* FAQ: two-column grid, items placed row-wise. */
  .faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; align-items: start; }

  /* Pricing card: centered, never a full-width slab. */
  .price-box { max-width: 40rem; margin-inline: auto; }

  /* Watch forms: form column + sticky right rail carrying the live summary
     (same #summary-bar element - the grid places it, no duplication). */
  .watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    grid-template-areas: "chips rail" "form rail";
    column-gap: 3rem;
    align-items: start;
  }
  .watch-layout > .chip-picker { grid-area: chips; }
  .watch-layout > .watch-form { grid-area: form; max-width: 42rem; }
  .watch-rail { display: block; grid-area: rail; position: sticky; top: 7rem; }
  .watch-rail .summary-bar { position: static; margin: 0; display: block; }
  .watch-rail-art {
    display: block;
    margin-top: 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
  }
  .watch-rail-art .panorama { display: block; width: 100%; height: auto; }

  /* Detail pages: facts left, status/CTA card as a sticky right rail. */
  .detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; column-gap: 3.5rem; align-items: start; }
  .detail-body { grid-column: 1; grid-row: 1; }
  .detail-body h2:first-child { margin-top: 0.5rem; }
  .detail-side { grid-column: 2; grid-row: 1; position: sticky; top: 7rem; }
  .detail-side-label { margin-top: 0; }
}
