/* hikepace: "golden hour on the trail". Warm cream paper with faint map contour lines, deep pine,
   sunset orange. Round, friendly type (Fredoka + Nunito). One question per screen, big thumbs-first
   buttons, a tab bar at the bottom like a phone app. Dark mode follows the phone. */
:root {
  --cream: #fff8ef;
  --sand: #f5ead9;
  --card: #ffffff;
  --ink: #13261e;
  --muted: #66746c;
  --pine: #1e5c46;
  --pine-2: #2f8063;
  --pine-soft: #e1f0e8;
  --sun: #ff7a3d;
  --sun-2: #ffb347;
  --sun-soft: #ffeadb;
  --sky: #bfe3f5;
  --night: #24324a;
  --line: #eadfce;
  --warn-bg: #fff2d1;
  --warn-text: #7a5300;
  --danger-bg: #ffe1dc;
  --danger-text: #8a1c12;
  --s1: #2a78d6;
  --s2: #eb6834;
  --shadow: 0 2px 4px rgba(19, 38, 30, 0.05), 0 10px 30px rgba(19, 38, 30, 0.08);
  --head: "Fredoka", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, sans-serif;
  /* faint topographic contour lines */
  --topo: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'><g fill='none' stroke='%23d9c9b0' stroke-opacity='.45' stroke-width='1'><path d='M-20 60c40-30 80 10 120-10s70-40 140 0'/><path d='M-20 90c50-25 90 15 130-5s60-35 130 5'/><path d='M-20 150c40-20 70 20 120 0s80-30 140 10'/><path d='M-20 185c45-15 85 25 130 5s70-25 130 10'/><ellipse cx='170' cy='120' rx='28' ry='16'/><ellipse cx='170' cy='120' rx='14' ry='7'/></g></svg>");
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #0f1713;
    --sand: #18231d;
    --card: #1a261f;
    --ink: #eef3ef;
    --muted: #a3b0a8;
    --pine: #79cfa9;
    --pine-2: #5bb58f;
    --pine-soft: #1e3a2e;
    --sun: #ff8f5a;
    --sun-soft: #3b2619;
    --line: #2c3b33;
    --warn-bg: #3a2f14;
    --warn-text: #f3d48b;
    --danger-bg: #3d1d1a;
    --danger-text: #f5aaa0;
    --night: #0b1220;
    --s1: #3987e5;
    --s2: #d95926;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    --topo: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'><g fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1'><path d='M-20 60c40-30 80 10 120-10s70-40 140 0'/><path d='M-20 90c50-25 90 15 130-5s60-35 130 5'/><path d='M-20 150c40-20 70 20 120 0s80-30 140 10'/><path d='M-20 185c45-15 85 25 130 5s70-25 130 10'/><ellipse cx='170' cy='120' rx='28' ry='16'/></g></svg>");
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); background: var(--topo), var(--cream);
  font: 500 16.5px/1.5 var(--body); -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--pine); }
button { font: inherit; color: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; background: #2b3a67; overflow: hidden; transition: opacity 0.5s, transform 0.5s; }
.splash.gone { opacity: 0; transform: scale(1.06); pointer-events: none; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .sun { animation: sunrise 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes sunrise { from { transform: translateY(90px); } }
.scene .m3 { animation: slide 1.6s ease both; }
.scene .m2 { animation: slide 1.4s 0.1s ease both; }
.scene .m1 { animation: slide 1.2s 0.2s ease both; }
@keyframes slide { from { transform: translateY(40px); } }
.scene .trail { stroke-dashoffset: 200; animation: draw 1.6s 0.9s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scene .flag { opacity: 0; animation: pop-in 0.4s 2.3s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes pop-in { from { opacity: 0; transform: translate(210px, 207px) scale(0); } to { opacity: 1; transform: translate(210px, 207px) scale(1); } }
.splash-text { position: absolute; left: 0; right: 0; top: calc(16vh + env(safe-area-inset-top)); text-align: center; color: #fff; padding: 0 24px; }
.splash-text h1 { margin: 0; font: 700 56px/1 var(--head); letter-spacing: -1px; animation: rise 0.8s 0.3s both; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.25); }
.splash-text p { margin: 8px 0 0; font-size: 18px; opacity: 0.92; animation: rise 0.8s 0.5s both; }
.splash-text .btn { margin-top: 26px; width: auto; padding: 14px 40px; animation: rise 0.6s 1.6s both; }

/* ---------- Screens ---------- */
#app { max-width: 560px; margin: 0 auto; }
.screen {
  min-height: 100dvh; padding: calc(14px + env(safe-area-inset-top)) 20px calc(110px + env(safe-area-inset-bottom));
  display: none; flex-direction: column;
}
.screen.on { display: flex; animation: in-right 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.screen.on.backwards { animation-name: in-left; }
@keyframes in-right { from { opacity: 0; transform: translateX(28px); } }
@keyframes in-left { from { opacity: 0; transform: translateX(-28px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.top { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 8px; }
.top .dots { flex: 1; }
.top-title { flex: 1; font: 600 18px var(--head); text-align: center; }
.back { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 28px; line-height: 1; padding-bottom: 4px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 22px; height: 6px; border-radius: 6px; background: var(--line); transition: background 0.3s, width 0.3s; }
.dots i.done { background: var(--pine-2); }
.dots i.on { background: var(--sun); width: 34px; }
.big-h { font: 700 31px/1.12 var(--head); letter-spacing: -0.4px; margin: 10px 0 8px; }
.lead { font-size: 17.5px; color: var(--muted); margin: 0 0 14px; }
.lead b { color: var(--ink); }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0; }
.center { text-align: center; }
.label-h { font: 600 16px var(--head); margin: 22px 0 8px; color: var(--ink); }
.hero-art { font-size: 88px; margin: 9vh 0 4px; animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(6deg) translateY(-4px); } }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--cream) 30%); display: flex; flex-direction: column; gap: 8px;
  max-width: 560px; margin: 0 auto;
}
body.has-tabs .bottom { bottom: calc(64px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
.empty { text-align: center; color: var(--muted); margin-top: 12vh; font-size: 17px; }

/* ---------- Buttons, chips, segments ---------- */
.btn {
  display: block; width: 100%; min-height: 56px; border: 0; border-radius: 999px; padding: 14px 22px;
  font: 600 19px var(--head); letter-spacing: 0.2px; transition: transform 0.12s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.sun { color: #fff; background: linear-gradient(135deg, var(--sun-2), var(--sun)); box-shadow: 0 10px 24px rgba(255, 122, 61, 0.38); }
.btn.ghost { background: transparent; color: var(--pine); box-shadow: inset 0 0 0 2px var(--pine-soft); font-size: 16px; min-height: 48px; }
.btn.danger { color: var(--danger-text); box-shadow: inset 0 0 0 2px var(--danger-bg); }
.btn:disabled { opacity: 0.6; }
.chip-btn { border: 0; border-radius: 999px; padding: 8px 14px; min-height: 38px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 14px; }
.chip-btn.ghosty { box-shadow: none; background: var(--pine-soft); color: var(--pine); }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 15px; min-height: 42px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 15px; cursor: pointer; }
.or-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px; background: var(--card); box-shadow: var(--shadow);
  font-weight: 700; font-size: 15px; transition: transform 0.12s, background 0.2s;
}
.chips button[aria-pressed="true"] { background: var(--pine); color: #fff; transform: scale(1.03); }
.inline-input { margin-top: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--sand); padding: 4px; border-radius: 18px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg button { border: 0; border-radius: 14px; padding: 10px 8px; min-height: 44px; background: transparent; font-weight: 700; font-size: 14.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--pine); box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tiles button { border: 0; border-radius: 18px; padding: 12px 4px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tiles button span { font-size: 26px; }
.tiles button[aria-pressed="true"] { background: var(--pine); color: #fff; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--pine); }
.pace-chip {
  margin-top: 22px; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-radius: 20px;
  padding: 12px 14px; background: var(--sun-soft); font-size: 15px;
}
.pace-chip .pc-emoji { font-size: 30px; }
.pace-chip small { display: block; color: var(--muted); font-size: 13px; }
.pace-chip .pc-change { margin-left: auto; color: var(--sun); font-weight: 800; font-size: 14px; }

/* ---------- Inputs ---------- */
input, select {
  width: 100%; min-height: 50px; padding: 12px 16px; font: inherit; font-size: 16.5px; color: var(--ink);
  background: var(--card); border: 2px solid transparent; border-radius: 16px; box-shadow: var(--shadow); outline: none;
}
input:focus, select:focus { border-color: var(--pine-2); }
.field label { display: block; font-weight: 800; font-size: 14px; margin: 12px 0 6px; }
.grid { display: grid; gap: 0 12px; }

/* ---------- Search with suggestions ---------- */
.search-box { position: relative; }
.search-box input { padding-left: 46px; min-height: 58px; font-size: 18px; border-radius: 20px; }
.search-box .s-icon { position: absolute; left: 16px; top: 17px; font-size: 20px; pointer-events: none; }
.search-box .s-go { position: absolute; right: 6px; top: 6px; height: 46px; border: 0; border-radius: 16px; padding: 0 16px; background: var(--pine); color: #fff; font-weight: 800; }
.suggest { list-style: none; padding: 0; margin: 10px 0 0; }
.suggest li { animation: rise 0.25s both; animation-delay: calc(var(--i, 0) * 35ms); }
.suggest button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; margin: 0 0 8px;
  padding: 12px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
}
.suggest .r-icon { font-size: 24px; width: 34px; text-align: center; flex: none; }
.suggest .r-text { flex: 1; min-width: 0; }
.suggest .r-text b { display: block; font-weight: 800; }
.suggest .r-text span { color: var(--muted); font-size: 13.5px; }
.suggest .tag { font-size: 12px; font-weight: 800; color: var(--pine); background: var(--pine-soft); border-radius: 999px; padding: 3px 10px; flex: none; }
.suggest .msg { color: var(--muted); padding: 6px 4px; }

/* "Measuring the trail…": a boot hiking up a little hill */
.measuring { text-align: center; padding: 26px 0 6px; color: var(--muted); font-weight: 700; }
.measuring svg { width: 180px; height: 90px; display: block; margin: 0 auto 6px; }
.measuring .hill { fill: var(--pine-soft); }
.measuring .path { fill: none; stroke: var(--pine-2); stroke-width: 3; stroke-dasharray: 3 6; stroke-linecap: round; }
.measuring .boot { font-size: 22px; offset-path: path("M10 80 C 60 78, 90 30, 150 18"); animation: climb 2.2s ease-in-out infinite; }
@keyframes climb { from { offset-distance: 0%; } to { offset-distance: 100%; } }

/* ---------- Trail screen ---------- */
.trail-hero { position: relative; border-radius: 28px; padding: 20px 18px 14px; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, #2f8063, #173f31 70%); box-shadow: 0 14px 34px rgba(23, 63, 49, 0.35); animation: pop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }
.trail-hero h2 { margin: 0; font: 700 26px/1.15 var(--head); }
.trail-hero .area { opacity: 0.8; font-size: 14px; margin: 2px 0 12px; }
.trail-hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; position: relative; z-index: 1; }
.trail-hero .stats b { display: block; font: 700 22px var(--head); }
.trail-hero .stats small { opacity: 0.8; font-size: 12.5px; }
.trail-hero svg.mini { display: block; width: calc(100% + 36px); height: 70px; margin: 10px -18px -14px; }
.trail-hero svg.mini .area { fill: rgba(255, 255, 255, 0.16); }
.trail-hero svg.mini .ln { fill: none; stroke: #ffd59e; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trail-hero .note { font-size: 12.5px; opacity: 0.75; margin: 8px 0 0; position: relative; }
.trail-hero.empty-hero { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.ways { display: grid; gap: 8px; margin-top: 14px; }
.ways .way { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid transparent; border-radius: 18px; padding: 10px 14px; background: var(--card); box-shadow: var(--shadow); }
.ways .way[aria-pressed="true"] { border-color: var(--sun); background: var(--sun-soft); }
.ways .way b { flex: 1; }
.ways .way span { color: var(--muted); font-weight: 700; font-size: 14px; }
.fix { margin-top: 16px; }
.fix summary { cursor: pointer; font-weight: 800; color: var(--pine); padding: 8px 0; list-style: none; }
.fix summary::-webkit-details-marker { display: none; }
.totals { font-weight: 800; color: var(--pine); margin: 12px 0 0; }
.totals:empty { display: none; }
.trail-mini { background: var(--card); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow); margin: 4px 0 16px; }
.trail-mini b { font: 600 18px var(--head); display: block; }
.trail-mini span { color: var(--muted); font-size: 14px; }

/* Time stepper for "how long did it take" */
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 26px 0 4px; }
.stepper output { font: 700 40px var(--head); min-width: 190px; text-align: center; color: var(--pine); }
.step-btn { width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 30px; font-weight: 700; color: var(--pine); }
.step-btn:active { transform: scale(0.92); background: var(--pine-soft); }

/* Preset pace cards (first time) */
.preset-cards { display: grid; gap: 12px; }
.preset { display: flex; gap: 14px; align-items: center; text-align: left; border: 0; border-radius: 22px; padding: 16px; background: var(--card); box-shadow: var(--shadow); }
.preset .p-emoji { font-size: 40px; }
.preset b { font: 600 20px var(--head); display: block; }
.preset small { color: var(--muted); font-size: 14px; display: block; }
.preset:active { transform: scale(0.98); }

/* "You're a … hiker": the pace meter */
.you-are { text-align: center; padding-top: 6vh; }
.you-are .ya-emoji { font-size: 84px; animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; display: inline-block; }
.you-are h2 { font: 700 32px/1.1 var(--head); margin: 8px 0 6px; }
.meter { position: relative; height: 16px; border-radius: 999px; margin: 30px 6px 8px; background: linear-gradient(90deg, #ffb347, #8fd0a8, #6fa8dc); }
.meter .marker { position: absolute; top: -10px; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 18px; left: var(--x); animation: meter 1.1s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes meter { from { left: 50%; } }
.meter-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; padding: 0 2px; }
.you-are .detail { color: var(--muted); margin-top: 18px; }

/* ---------- Plan results ---------- */
.plan-screen { padding-left: 14px; padding-right: 14px; }
.r-hero { border-radius: 28px; padding: 18px 18px 16px; background: var(--card); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.r-hero::after { content: ""; position: absolute; right: -10px; bottom: -6px; width: 180px; height: 70px; opacity: 0.12;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 70'><path d='M0 70 L45 25 L70 45 L110 5 L150 40 L180 20 V70Z' fill='%231e5c46'/></svg>") no-repeat bottom right / contain; }
.eyebrow { margin: 0; font-size: 12.5px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; color: var(--sun); }
.r-hero h2 { margin: 4px 0 2px; font: 700 23px/1.15 var(--head); }
.r-hero .sub { margin: 0; color: var(--muted); font-size: 14.5px; }
.big-time { margin: 14px 0 4px; font: 700 38px/1.05 var(--head); color: var(--pine); letter-spacing: -0.5px; }
.big-time small { display: block; font: 700 14px var(--body); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.tabs { position: sticky; top: env(safe-area-inset-top); z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 12px 2px 10px; margin: 0 -2px; background: linear-gradient(var(--cream) 75%, transparent); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; border-radius: 999px; padding: 9px 16px; min-height: 42px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 14.5px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--cream); }
.panel { display: none; animation: rise 0.3s both; }
.panel.on { display: block; }
.box { background: var(--card); border-radius: 22px; padding: 14px 16px; box-shadow: var(--shadow); margin: 0 0 12px; }
.box h3 { margin: 0 0 8px; font: 600 18px var(--head); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .c-emoji { position: absolute; right: 8px; top: 4px; font-size: 30px; }
.stat .label { font-size: 13px; font-weight: 800; color: var(--muted); }
.stat .big { font: 700 25px/1.15 var(--head); color: var(--pine); margin: 2px 0; }
.stat .small { font-size: 12.5px; color: var(--muted); }
.alert { border-radius: 18px; padding: 12px 14px; margin: 0 0 10px; font-weight: 700; font-size: 15px; }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); }
.alert.danger { background: var(--danger-bg); color: var(--danger-text); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline li b { text-align: right; white-space: nowrap; }
.timeline li.hint-row { color: var(--sun); font-weight: 700; }
.range-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.small { font-size: 13.5px; }
.muted { color: var(--muted); }
button.link { border: 0; background: none; color: var(--pine); text-decoration: underline; font-weight: 800; padding: 0; }
.actions { display: flex; gap: 8px; margin: 6px 0 12px; }
.actions .btn { min-height: 50px; font-size: 16px; }
.disclaimer { font-size: 12.5px; color: var(--muted); }

/* Sun bar */
.sunbar { position: relative; height: 46px; margin: 18px 0 28px; }
.sunbar .sky { position: absolute; inset: 12px 0 12px; border-radius: 999px;
  background: linear-gradient(90deg, var(--night) 0, var(--night) calc(var(--rise) - 3%), #f7c77a var(--rise), #9fd4f0 calc(var(--rise) + 12%), #9fd4f0 calc(var(--set) - 12%), #f39b5b var(--set), var(--night) calc(var(--set) + 3%)); }
.sunbar .band { position: absolute; top: 9px; height: 28px; border-radius: 999px; }
.top-band { background: repeating-linear-gradient(45deg, #ffffffdd 0 4px, #ffffff77 4px 8px); border: 2px solid #fff; }
.finish-band { background: var(--pine); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.sunbar .pin { position: absolute; top: -6px; transform: translateX(-50%); font-size: 18px; }
.walker { position: absolute; top: -10px; left: var(--to); transform: translateX(-50%); font-size: 24px; animation: walk 1.6s ease-out both; }
.walker span { display: inline-block; animation: step 0.4s ease-in-out 4; }
@keyframes walk { from { left: var(--from); } }
@keyframes step { 50% { transform: translateY(-4px) rotate(-8deg); } }
.sunbar-labels span { position: absolute; top: 42px; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; font-weight: 700; }
.sunbar-labels span:first-child { transform: none; }
.sunbar-labels span:last-child { transform: translateX(-85%); }
.sunbar-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.sunbar-key .k { display: inline-block; width: 14px; height: 10px; border-radius: 4px; margin-right: 5px; vertical-align: middle; }
.sunbar-key .k.top-band { border: 1px solid var(--muted); }
.sunbar-key .k.night { background: var(--night); }

/* Climb chart */
.profile { position: relative; }
.profile svg { width: 100%; height: 200px; display: block; touch-action: pan-y; overflow: visible; }
.pf-line { fill: none; stroke: var(--pine-2); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.top-label { font-weight: 800; fill: var(--ink); }
.pin-emoji { font-size: 16px; animation: drop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }
.axis { fill: var(--muted); font-size: 12px; }
.cross { stroke: var(--ink); stroke-width: 1; opacity: 0.45; vector-effect: non-scaling-stroke; }
.dot { fill: var(--card); stroke-width: 2.5; }
.dot.s1 { stroke: var(--s1); }
.dot.s2 { stroke: var(--s2); }
.hit { fill: transparent; cursor: crosshair; }
.tip { position: absolute; top: 8px; min-width: 160px; background: var(--card); border-radius: 14px; padding: 8px 12px; font-size: 13px; box-shadow: var(--shadow); pointer-events: none; z-index: 2; }
.tip-head { color: var(--muted); margin-bottom: 3px; }

/* Weather */
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart-box { position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid; vertical-align: middle; margin-right: 6px; }
.key.s1 { border-color: var(--s1); }
.key.s2 { border-color: var(--s2); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .night { fill: var(--muted); opacity: 0.12; }
.chart .freeze { stroke: var(--s1); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.7; }
.chart .mark { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.6; }
.chart .mark-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.s1 { stroke: var(--s1); }
.chart .ln.s2 { stroke: var(--s2); }
.hour-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; scroll-snap-type: x proximity; }
.hour { flex: 0 0 auto; min-width: 62px; text-align: center; background: var(--sand); border-radius: 16px; padding: 8px 4px; scroll-snap-align: start; }
.h-time { font-size: 12px; color: var(--muted); font-weight: 700; }
.h-icon { font-size: 24px; line-height: 1.3; }
.h-temp { font: 700 17px var(--head); }
.h-sub { font-size: 11.5px; color: var(--muted); }
.day-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.day-card { background: var(--sand); border-radius: 18px; padding: 10px; }
.d-icon { font-size: 30px; }
details summary { cursor: pointer; color: var(--pine); font-weight: 800; font-size: 14px; margin: 6px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); }
tr.danger-row td { background: var(--danger-bg); color: var(--danger-text); }

/* Pack list */
.packed { font: 600 17px var(--head); color: var(--pine); margin: 0 0 4px; }
.pack-bar { height: 10px; border-radius: 999px; background: var(--sand); overflow: hidden; margin: 6px 0 4px; }
.pack-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun-2), var(--sun)); transition: width 0.35s ease; }
.gear-group { margin: 16px 0 4px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 800; }
.gear { list-style: none; padding: 0; margin: 0; }
.gear li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.gear label { display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.gear input { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--pine); box-shadow: none; padding: 0; }
.gear input:checked + b { text-decoration: line-through; opacity: 0.55; }
.gear span { display: block; margin-left: 36px; font-size: 13px; color: var(--muted); }

/* Camp + water */
.camp { background: var(--sand); border-radius: 18px; padding: 12px 14px; margin: 8px 0; }
.camp.pick { background: var(--pine-soft); box-shadow: inset 0 0 0 2px var(--pine-2); }
.camp.reach { background: var(--sun-soft); box-shadow: inset 0 0 0 2px var(--sun); }
.camp .label { font-size: 12px; font-weight: 800; color: var(--pine); text-transform: uppercase; letter-spacing: 0.6px; }
.camp .small { margin-top: 3px; }
.camp-list, .water-list { list-style: none; padding: 0; margin: 0; }
.water-list li { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.water-list li > span:first-child { display: inline-block; min-width: 76px; font-weight: 800; color: var(--pine); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; margin-left: 4px; }
.tag.easy { background: var(--pine); color: #fff; }
.tag.maybe { background: var(--sun); color: #fff; }
.land.ok { color: var(--pine); }
.land.no { color: var(--danger-text); }
.land.check { color: var(--warn-text); }
.loading { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--pine); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Trips + You ---------- */
.saved-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.trip { display: flex; align-items: center; gap: 12px; border: 0; width: 100%; text-align: left; padding: 14px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.trip .t-emoji { font-size: 30px; }
.trip b { font: 600 17px var(--head); display: block; }
.trip small { color: var(--muted); }
.trip-row { display: flex; gap: 8px; align-items: center; }
.trip-row .del { border: 0; background: none; color: var(--muted); font-size: 22px; padding: 8px; }
.me-card { background: linear-gradient(160deg, var(--sun-soft), var(--card)); border-radius: 26px; padding: 18px; box-shadow: var(--shadow); text-align: center; margin-bottom: 12px; }
.me-card .ya-emoji { font-size: 56px; }
.me-card h3 { font: 700 24px var(--head); margin: 4px 0; }
.explain { background: var(--card); border-radius: 20px; padding: 12px 14px; margin: 8px 0; box-shadow: var(--shadow); }
.explain p { margin: 4px 0; font-size: 14.5px; }
.explain-head { display: flex; align-items: center; gap: 8px; font: 600 18px var(--head); }
.credits { font-size: 12.5px; color: var(--muted); margin-top: 24px; }
.offline { position: sticky; top: 0; z-index: 60; background: var(--warn-bg); color: var(--warn-text); text-align: center; font-weight: 800; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 -6px 24px rgba(19, 38, 30, 0.08);
}
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--muted); padding: 6px 0; min-height: 52px; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tabbar button[aria-current="page"] { color: var(--sun); }
.tabbar button[aria-current="page"] svg { fill: var(--sun-soft); }

/* ---------- Toast + confetti ---------- */
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); z-index: 120; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); padding: 12px 20px; border-radius: 999px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toast 2.6s ease both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 110; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .tabbar, .bottom, .top, .tabs, .actions, #splash { display: none !important; }
  .panel { display: block !important; }
  body { background: #fff; }
}
