/* Joyful Rides — the planner.
   Layout: a reading column on the left (choose → compare → take it along),
   the map filling the rest, and the selected ride's profile docked under
   the map. On a phone: choices, then the map, then the rides. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--sky); color: var(--ink); font: 1rem/1.5 var(--body); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lake); outline-offset: 2px; border-radius: 6px; }

.app { display: grid; grid-template-columns: minmax(380px, 480px) 1fr; height: 100%; }
.col { overflow-y: auto; padding: 32px 28px 48px; display: flex; flex-direction: column; gap: 32px; border-right: 1px solid var(--rule); background: var(--sky); min-width: 0; }
.stage { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
#map { min-height: 0; }

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand a { color: inherit; text-decoration: none; }
.brand b { font: 800 22px/1 var(--display); letter-spacing: -.01em; }
.brand span { font: 600 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--lake); }
h1 { font: 700 clamp(2.5rem, 3.4vw, 3.25rem)/1.05 var(--display); letter-spacing: -.015em; margin: 24px 0 16px; text-wrap: balance; }
.lede { color: var(--muted); margin: 0; }

.q { display: flex; flex-direction: column; gap: 10px; }
.q > label, .q > .qh { font: 600 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.level { all: unset; cursor: pointer; display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1.5px solid var(--rule); }
.level svg { grid-row: span 2; width: 34px; height: 34px; color: var(--lake); }
.level b { font-weight: 600; }
.level small { color: var(--muted); font-size: .8125rem; line-height: 1.3; }
.level[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { all: unset; cursor: pointer; padding: 7px 13px; border-radius: 999px; background: var(--chip); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle { all: unset; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 999px; border: 1.5px dashed var(--rule); color: var(--muted); font-weight: 500; }
.toggle[aria-pressed="true"] { border-style: solid; border-color: var(--ink); color: var(--ink); }
.toggle i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; }
.toggle[aria-pressed="true"] i::after { content: "✓"; }

.results-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.results-h h2 { font: 600 1.75rem/1.15 var(--display); margin: 0; text-wrap: balance; }
.note { color: var(--muted); font-size: .875rem; margin: 0; }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--paper); border: 1.5px solid var(--rule); border-radius: 12px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; box-shadow: none; transition: box-shadow .15s, border-color .15s; }
.card:hover { box-shadow: var(--shadow); }
.card.on { border-color: var(--rc); box-shadow: var(--shadow); }
.card-top { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; }
.swatch { width: 10px; height: 34px; border-radius: 5px; background: var(--rc); }
.card h3 { margin: 0; font: 600 18px/1.2 var(--display); }
.card .sub { color: var(--muted); font-size: .8125rem; }
.pill { font: 600 11.5px/1 var(--body); padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.pill.easy { background: color-mix(in srgb, var(--g0) 18%, transparent); color: color-mix(in srgb, var(--g0) 70%, var(--ink)); }
.pill.comfortable { background: color-mix(in srgb, var(--lake) 16%, transparent); color: color-mix(in srgb, var(--lake) 70%, var(--ink)); }
.pill.stretch { background: color-mix(in srgb, var(--g3) 20%, transparent); color: color-mix(in srgb, var(--g3) 70%, var(--ink)); }
.pill.hard { background: color-mix(in srgb, var(--g4) 18%, transparent); color: color-mix(in srgb, var(--g4) 75%, var(--ink)); }
.explore { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--clay); }
.time { font: 600 1.5rem/1.2 var(--body); }
.time small { font: 500 13px var(--body); color: var(--muted); }
.stats { display: flex; gap: 14px; flex-wrap: wrap; font: 500 13.5px/1.2 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.stats span { display: inline-flex; gap: 5px; align-items: center; }
.stats svg { width: 14px; height: 14px; color: var(--muted); }
.spark { width: 100%; height: 44px; display: block; }
.why { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: .875rem; }
.why li::before { content: "·"; color: var(--lake); font-weight: 800; margin-right: 7px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stopicons { display: flex; gap: 6px; }
.stopicons span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--ink); }
.stopicons svg { width: 14px; height: 14px; }
.cmp { all: unset; cursor: pointer; font-size: .8125rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.cmp i { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 4px; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; }
.cmp[aria-pressed="true"] { color: var(--ink); }
.cmp[aria-pressed="true"] i::after { content: "✓"; }
.go { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--sky); font-weight: 600; font-size: .875rem; }

.take { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.take h3 { margin: 0; font: 600 18px/1.2 var(--display); }
.take .row { display: flex; gap: 8px; flex-wrap: wrap; }
.take a, .take button { all: unset; cursor: pointer; padding: 9px 14px; border-radius: 999px; background: var(--chip); font-weight: 600; font-size: .875rem; }
.take a.primary { background: var(--ink); color: var(--sky); }

.compare { overflow-x: auto; background: var(--paper); border: 1.5px solid var(--rule); border-radius: 12px; padding: 12px; }
.compare table { border-collapse: collapse; width: 100%; font-size: .875rem; font-variant-numeric: tabular-nums; }
.compare th, .compare td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare th { font-weight: 600; color: var(--muted); font-size: 12px; }
.compare td.best { font-weight: 700; }

.profile { border-top: 1px solid var(--rule); background: var(--paper); padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.profile-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.profile-h b { font: 600 15px var(--display); }
.legend { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
#profile { width: 100%; height: 132px; display: block; touch-action: none; }
.readout { font: 500 12.5px var(--mono); color: var(--muted); min-height: 1.2em; font-variant-numeric: tabular-nums; }

.small { color: var(--muted); font-size: .8125rem; }
.small a { color: inherit; }
.share .toggle { font-size: 13px; padding: 5px 10px; margin: 0 6px 6px 0; }
.empty { color: var(--muted); padding: 18px; border: 1.5px dashed var(--rule); border-radius: 14px; }
.mapnote { position: absolute; left: 10px; top: 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 9px; font-size: 12px; color: var(--muted); z-index: 2; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }

@media (max-width: 860px) {
  .app { display: flex; flex-direction: column; height: auto; }
  .col { border-right: 0; overflow: visible; padding-inline: 16px; }
  .stage { order: 0; height: 58vh; }
  .level { padding: 9px 10px; grid-template-columns: 26px 1fr; }
  .level svg { width: 26px; height: 26px; }
  .entrance { order: -2; }
  .col { display: contents; }
  .col > * { padding-inline: 16px; }
  .brandbox { order: -3; padding-top: 18px; }
  .entrance { padding-bottom: 6px; }
  .resultsbox { order: 1; padding-block: 18px 40px; }
  h1 { font-size: 28px; }
  #profile { height: 104px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Brand application: editorial entrance, quiet operational surfaces. */
a { color: var(--link); text-underline-offset: .2em; }
.brand { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.brand a { display: block; padding: 4px 0; }
.brand img { display: block; width: 200px; height: auto; }
.brand span { letter-spacing: .1em; }
.eyebrow { color: var(--clay); font: 600 .75rem/1.4 var(--body); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 20px; }
.entrance { border-block: 1px solid var(--rule); padding-block: 24px; }
.q > .qh { font: 600 1rem/1.4 var(--body); letter-spacing: 0; text-transform: none; color: var(--ink); }
.level { border-radius: 8px; min-height: 64px; min-width: 0; }
.level[aria-pressed="true"] { background: var(--action); color: var(--onAction); border-color: var(--action); box-shadow: none; }
.level[aria-pressed="true"] svg, .level[aria-pressed="true"] small { color: inherit; }
.level b, .level small { overflow-wrap: anywhere; }
.chip, .toggle, .go, .cmp, .take a, .take button { box-sizing: border-box; min-height: 44px; }
.chip, .toggle, .go, .take a, .take button { border-radius: 8px; }
.toggle { border-style: solid; }
.toggle[aria-pressed="true"] { background: var(--surface); border-color: var(--action); }
.go, .take a.primary { background: var(--action); color: var(--onAction); }
.card { padding: 20px; gap: 14px; }
.card.on { border-color: var(--ink); box-shadow: inset 4px 0 var(--rc); }
.card-top { grid-template-columns: 8px minmax(0, 1fr); }
.card-top .pill { grid-column: 2; justify-self: start; }
.card h3 { font-size: 1.4rem; overflow-wrap: anywhere; }
.pill { color: var(--ink) !important; line-height: 1.3; white-space: normal; }
.stats { font-size: .875rem; line-height: 1.4; }
.compare { max-width: 100%; }
.compare table { min-width: 360px; }
.compare th { color: var(--ink); }
.take { background: var(--surface); }
.take h3, .take button { overflow-wrap: anywhere; }
.take a { text-decoration: none; }
.map-heading { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--paper); padding: 20px 24px; border-bottom: 1px solid var(--rule); font-size: .875rem; }
.map-heading .eyebrow { margin: 0; }
.mapnote { top: 74px; right: 60px; max-width: 420px; }
.profile { padding: 20px 24px; gap: 12px; }
.profile-h b { font: 600 1.2rem var(--display); overflow-wrap: anywhere; }
.small, .readout { font-size: .8125rem; }
.empty { background: var(--surface); border-style: solid; }
.empty button { display: block; margin-top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 860px) {
  .brandbox { padding-top: 24px; }
  .brand img { width: 180px; }
  .entrance { margin: 24px 16px 16px; padding: 24px 0; }
  h1 { font-size: clamp(2.5rem, 9vw, 3.25rem); }
  .stage { height: 560px; max-height: none; margin: 0 16px; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
  .map-heading { padding: 16px; }
  .mapnote { top: 84px; right: 52px; }
  .profile { padding: 16px; }
  .resultsbox { padding-block: 32px 48px; }
  .card { padding: 16px; }
}
@media (max-width: 360px) {
  .level { grid-template-columns: 1fr; }
  .level svg { display: none; }
  .brand { gap: 8px; }
  .card-foot > div { flex-wrap: wrap; }
}

/* Control boundaries and selection stay identifiable without colour alone. */
.level, .toggle { border-color: var(--muted); }
.chip { border: 1px solid var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--action); text-decoration: underline; text-underline-offset: .25em; }
.level[aria-pressed="true"] b::after { content: " ✓"; }

/* Keep map inspection available beside comparison and choice on phones. */
.inspect { border: 0; background: transparent; color: var(--link); cursor: pointer; font-size: .8125rem; padding: 8px 4px; min-height: 44px; }
.card-foot > div:last-child { flex-wrap: wrap; }
