/* Nilgiri night · tea green · Mysuru marigold · Mysore silk */
:root {
  --bg: #e6eee9;
  --surface: #fbfdfc;
  --surface-2: #dbe6df;
  --ink: #0f241d;
  --muted: #557064;
  --line: #c6d6cc;
  --night: #0d2a22;
  --night-2: #15392e;
  --on-night: #e9f2ed;
  --asphalt: #2f3d38;
  --d1: #2e9e6e;
  --d2: #e9961f;
  --d3: #c23b7a;
  --go: #f3a531;
  --go-ink: #1d1404;
  --warn: #b04c0c;
  --warn-bg: #fbe5d0;
  --ok: #217a52;
  --food: #b1432a;
  --food-bg: #f8e0d6;
  --sight: #2a6796;
  --sight-bg: #dbe9f4;
  --shadow: 0 1px 2px rgb(13 42 34 / 8%), 0 8px 24px -8px rgb(13 42 34 / 18%);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09160f; --surface: #10221b; --surface-2: #173026; --ink: #e3eee8; --muted: #8ea89b; --line: #22403a;
    --night: #071a14; --night-2: #0f2c22; --asphalt: #253530;
    --d1: #4cc38f; --d2: #f5b041; --d3: #e2629f; --go: #f5b041;
    --warn: #f3a566; --warn-bg: #3a2614; --ok: #6fd3a2;
    --food: #f1a08a; --food-bg: #3b211a; --sight: #8fc0ea; --sight-bg: #172b3b;
    --shadow: 0 1px 0 rgb(255 255 255 / 3%) inset, 0 8px 24px -10px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09160f; --surface: #10221b; --surface-2: #173026; --ink: #e3eee8; --muted: #8ea89b; --line: #22403a;
  --night: #071a14; --night-2: #0f2c22; --asphalt: #253530;
  --d1: #4cc38f; --d2: #f5b041; --d3: #e2629f; --go: #f5b041;
  --warn: #f3a566; --warn-bg: #3a2614; --ok: #6fd3a2;
  --food: #f1a08a; --food-bg: #3b211a; --sight: #8fc0ea; --sight-bg: #172b3b;
  --shadow: 0 1px 0 rgb(255 255 255 / 3%) inset, 0 8px 24px -10px rgb(0 0 0 / 60%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2.5px solid var(--go); outline-offset: 2px; }

main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.tab { display: grid; gap: 18px; }
.tab[hidden] { display: none; }
.tab-in { animation: tab-in .42s var(--ease) both; }
@keyframes tab-in { from { opacity: 0; transform: translateY(10px); } }
.hint { color: var(--muted); font-size: 13px; }
.pad { padding: 4px 4px 0; }
.eyebrow { font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c, var(--muted)); }

/* ───────── hero ───────── */
.hero {
  position: relative;
  margin: 0 -16px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 48px;
  background:
    radial-gradient(120% 70% at 85% 0%, rgb(243 165 49 / 14%), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgb(46 158 110 / 22%), transparent 70%),
    var(--night);
  color: var(--on-night);
  overflow: hidden;
  isolation: isolate;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-dates { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgb(255 255 255 / 16%); background: rgb(255 255 255 / 6%); color: inherit; cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.round-btn:active { transform: scale(.92); }
.round-btn svg { width: 18px; height: 18px; }
.hero h1 {
  margin-top: 18px;
  font-size: clamp(40px, 12.5vw, 64px);
  font-weight: 800;
  font-variation-settings: "wdth" 75, "opsz" 96;
  letter-spacing: -0.02em;
  line-height: .92;
  max-width: 9ch;
}
.hero h1 span { color: var(--go); font-weight: 500; }
.hero-map { width: 100%; height: auto; margin: 6px 0 -4px; overflow: visible; }
.hero-map .contours path { fill: none; stroke: rgb(233 242 237 / 9%); stroke-width: 1; }
.hero-route { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; transition: opacity .5s var(--ease), stroke-width .5s var(--ease); }
.hero-route.r1 { stroke: var(--d1); } .hero-route.r2 { stroke: var(--d2); } .hero-route.r3 { stroke: var(--d3); }
.hero-route.dim { opacity: .3; stroke-width: 2.5; }
.hero-map.intro .hero-route { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s cubic-bezier(.65, 0, .35, 1) var(--delay) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-map.intro .towns { animation: fade .8s ease 1.8s both; }
.hero-map.intro .contours { animation: fade 1.6s ease both; }
@keyframes fade { from { opacity: 0; } }
.town circle { fill: var(--night); stroke: rgb(233 242 237 / 55%); stroke-width: 1.5; }
.town text { font: 500 8.5px var(--mono); fill: rgb(233 242 237 / 55%); letter-spacing: .04em; }
.town.big circle { fill: var(--on-night); stroke: none; }
.town.big text { font: 800 14px var(--display); fill: var(--on-night); letter-spacing: 0; }
.hero-car circle { fill: var(--c, var(--go)); }
.hero-car .halo { opacity: .35; transform-box: fill-box; transform-origin: center; animation: halo 1.6s ease-out infinite; }
@keyframes halo { from { transform: scale(.6); opacity: .5; } to { transform: scale(2.2); opacity: 0; } }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid rgb(233 242 237 / 12%); padding-top: 14px; }
.hero-stats b { display: block; font: 700 24px/1 var(--display); font-variation-settings: "wdth" 85; }
.hero-stats span { font-size: 12px; opacity: .65; }

/* ───────── next up ───────── */
.next-up {
  position: relative; z-index: 2;
  margin-top: -34px;
  background: var(--surface);
  border-radius: 20px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  display: grid; gap: 6px;
  animation: tab-in .6s var(--ease) .25s both;
}
.next-up:empty { display: none; }
.nu-label { font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.nu-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 0 var(--go); animation: beacon 2s infinite; }
@keyframes beacon { 70% { box-shadow: 0 0 0 8px rgb(243 165 49 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(243 165 49 / 0%); } }
.nu-title { font: 700 24px/1.1 var(--display); font-variation-settings: "wdth" 85; }
.nu-sub { color: var(--muted); font-size: 14px; }
.countdown { display: flex; gap: 14px; font-family: var(--display); font-variation-settings: "wdth" 75; }
.countdown span { font-size: 18px; color: var(--muted); font-weight: 600; }
.countdown b { font-size: 52px; line-height: 1; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; }
.next-up .btn.go { margin-top: 8px; justify-self: start; }

/* ───────── buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-weight: 650; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn.go { background: var(--go); border-color: transparent; color: var(--go-ink); box-shadow: 0 6px 18px -8px rgb(233 150 31 / 80%); }
.btn.ghost { background: transparent; }
.btn.danger, .mini.danger { color: var(--warn); }
.btn:disabled { opacity: .5; cursor: default; }
.mini {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 6px 8px; margin: -6px 0 -6px -8px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer;
}
.mini svg { width: 15px; height: 15px; }
.mini:hover { color: var(--ink); }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: transform .15s var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:active { transform: scale(.9); }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* ───────── day tabs ───────── */
.day-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.day-tab {
  position: relative; text-align: left; cursor: pointer;
  display: grid; gap: 2px; align-content: start;
  padding: 12px 12px 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, color .25s;
  overflow: hidden;
}
.day-tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 3px; border-radius: 3px;
  background: var(--c); transform: scaleX(.18); transform-origin: left; transition: transform .45s var(--ease);
}
.day-tab[aria-selected="true"] { background: var(--night); border-color: var(--night); color: var(--on-night); transform: translateY(-2px); }
.day-tab[aria-selected="true"]::after { transform: scaleX(1); }
.dt-date { font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.dt-title { font: 700 15px/1.15 var(--display); font-variation-settings: "wdth" 85; }
.dt-meta { font-size: 12px; opacity: .7; }
.dt-meta em { font-style: normal; color: var(--warn); font-weight: 650; }
.day-tab[aria-selected="true"] .dt-meta em { color: var(--go); }

/* ───────── day header ───────── */
.roadmap { display: grid; gap: 20px; }
.day-hero { display: grid; gap: 14px; padding-top: 6px; }
.day-hero h2 { font-size: 34px; font-weight: 800; font-variation-settings: "wdth" 78; letter-spacing: -0.01em; }
.day-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-block: 1px solid var(--line); }
.day-stats div { padding: 10px 0; }
.day-stats div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.day-stats dt { font-size: 12px; color: var(--muted); }
.day-stats dd { margin: 2px 0 0; font: 700 18px/1.1 var(--mono); letter-spacing: -0.02em; }
.nav-btns { display: grid; gap: 8px; }
.notes summary { cursor: pointer; font-weight: 650; font-size: 14px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.notes summary::before { content: "+"; font: 700 16px/1 var(--mono); color: var(--c); transition: transform .25s var(--ease); }
.notes[open] summary::before { transform: rotate(45deg); }
.notes ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 6px; }
.reset-order { justify-self: start; }

/* ───────── the road ───────── */
.road { list-style: none; margin: 0; padding: 4px 0 8px; position: relative; display: grid; }
.road::before, .road::after {
  content: ""; position: absolute; z-index: 0; top: 14px; bottom: 14px; left: 66px; border-radius: 8px;
}
.road::before { width: 14px; background: var(--asphalt); }
.road::after { width: 2px; margin-left: 6px; background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 75%) 0 9px, transparent 9px 20px); }
.road.enter::before, .road.enter::after { transform-origin: top; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } }
.road > li { display: grid; grid-template-columns: 56px 1fr; column-gap: 40px; position: relative; z-index: 1; padding: 5px 0; }
.road.enter > li { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 120ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.road time { font: 700 12px/1.2 var(--mono); text-align: right; padding-top: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.02em; }

/* driving legs */
.road .leg { grid-template-columns: 1fr; }
.road .leg span { grid-column: 1; margin-left: 96px; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.road .leg.ghat span { color: var(--warn); font-weight: 650; }
.road .leg.free span { color: var(--ok); font-weight: 650; }
.road .leg.warn span { color: var(--warn); font-weight: 650; }
.squiggle {
  display: inline-block; width: 22px; height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 12'%3E%3Cpath d='M1 6c2-5 4-5 5 0s3 5 5 0 3-5 5 0 3 5 5 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%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 22 12'%3E%3Cpath d='M1 6c2-5 4-5 5 0s3 5 5 0 3-5 5 0 3 5 5 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* stop dots on the road */
.road .stop::before, .road .ep::before {
  content: ""; position: absolute; left: 63px; top: 15px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--c); border: 4px solid var(--bg); box-shadow: 0 0 0 1.5px var(--c); z-index: 1;
}
.road .ep::before { width: 24px; height: 24px; left: 61px; top: 11px; background: var(--ink); box-shadow: 0 0 0 2px var(--c); }
.road .stop.food::before { border-radius: 6px; }

/* endpoints */
.road .ep time { font: 800 17px/1 var(--display); font-variation-settings: "wdth" 80; padding-top: 14px; }
.ep-kicker { font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c); padding-top: 12px; }
.ep-name { font: 800 22px/1.1 var(--display); font-variation-settings: "wdth" 82; margin-top: 3px; }

/* town milestones */
.road .via { grid-template-columns: 1fr; padding: 7px 0; }
.road .via > * { margin-left: 96px; }
.road .via::before {
  content: ""; position: absolute; left: 66px; top: 50%; width: 14px; height: 2px; background: var(--c); opacity: .9;
}
.milestone {
  justify-self: start;
  position: relative; display: inline-grid; gap: 1px; padding: 13px 12px 6px; min-width: 96px;
  background: #fbfbf7; color: #1b1b17;
  border-radius: 16px 16px 5px 5px; border: 1.5px solid #cfcfc4;
  box-shadow: 0 2px 0 rgb(0 0 0 / 6%);
  text-align: center; overflow: hidden;
}
.milestone::before { content: ""; position: absolute; inset: 0 0 auto; height: 9px; background: var(--c); }
.milestone b { font: 800 12.5px/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em; font-variation-settings: "wdth" 85; }
.milestone small { font: 500 10.5px/1.2 var(--mono); color: #6a6a5e; }
.forest-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--ok); margin-top: 4px; }
.forest-tag svg { width: 14px; height: 14px; }

/* stop cards */
.stop-card {
  background: var(--surface); border-radius: 18px; padding: 12px 14px 12px;
  box-shadow: var(--shadow); display: grid; gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.stop-card header { display: flex; align-items: center; justify-content: space-between; }
.stay { font: 500 12px var(--mono); color: var(--muted); }
.stop-card h3 { font-size: 19px; font-weight: 750; font-variation-settings: "wdth" 88; letter-spacing: -0.005em; }
.tip { font-size: 13.5px; color: color-mix(in srgb, var(--ink) 80%, var(--muted)); }
.hours { font: 500 11.5px var(--mono); color: var(--muted); }
.stop-card footer { display: flex; align-items: center; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 2px; }
.spacer { flex: 1; }
.road .leaving { animation: leave .28s ease-in forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(40px); } }
.road .bump .stop-card { animation: bump .7s var(--ease); }
@keyframes bump { 30% { transform: scale(1.02); box-shadow: 0 0 0 3px var(--c), var(--shadow); } }

.tag { font: 700 10px/1 var(--mono); padding: 4px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .08em; }
.tag.food { background: var(--food-bg); color: var(--food); }
.tag.sight { background: var(--sight-bg); color: var(--sight); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip.warn { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); }

/* ───────── pages (places / settings) ───────── */
.page-head { padding: calc(28px + env(safe-area-inset-top)) 2px 0; display: grid; gap: 8px; }
.page-head h1 { font-size: 40px; font-weight: 800; font-variation-settings: "wdth" 75; letter-spacing: -0.015em; }
.lede { color: var(--muted); font-size: 15px; max-width: 36ch; }
.card { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.card h2 { font-size: 19px; font-weight: 750; font-variation-settings: "wdth" 88; }
.label { font-size: 14px; color: var(--muted); }
.label strong { color: var(--ink); }

.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; }
input[type="search"], input:not([type]), input[type="time"], input[type="number"], select {
  min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
}
input[type="number"] { width: 84px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.results li { animation: rise .35s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.results button {
  width: 100%; text-align: left; display: grid; gap: 2px; padding: 11px 13px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
}
.results span { font-size: 12px; color: var(--muted); }
.searching::after { content: "…"; display: inline-block; animation: dots 1s steps(4) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } }
.add-form { display: grid; gap: 12px; animation: rise .35s var(--ease) both; }
.pctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); justify-self: start; }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font-weight: 650; font-size: 14px; color: var(--muted); transition: background-color .2s, color .2s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }

.pgroup { display: grid; gap: 8px; }
.pgroup h3 { display: flex; align-items: baseline; gap: 8px; font-size: 20px; font-weight: 750; font-variation-settings: "wdth" 85; padding: 8px 2px 0; }
.pgroup h3 span { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.pgroup h3 small { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.pgroup ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.place {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow);
  border-left: 4px solid var(--c); transition: opacity .3s;
}
.place .switch { grid-column: 2; grid-row: 1; }
.place .pbody { grid-column: 1; grid-row: 1; display: grid; gap: 5px; min-width: 0; }
.place.off { opacity: .62; border-left-color: var(--line); }
.pname { font: 700 16.5px/1.2 var(--display); font-variation-settings: "wdth" 90; }
.pmeta { display: flex; align-items: center; gap: 8px; }
.pmeta time { font: 500 12px var(--mono); color: var(--muted); }
.pctl select { min-height: 36px; font-size: 13px; padding: 0 8px; }

.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); transition: background-color .25s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 30%); transition: transform .3s var(--ease);
}
.switch input:checked + span { background: var(--d1); border-color: var(--d1); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--go); outline-offset: 2px; }

.field-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 0 10px 12px; border-left: 3px solid var(--c); margin-bottom: 8px; }
.field-row p { flex-basis: 100%; font-size: 14px; }
.field-row p b { font-family: var(--mono); font-size: 12px; color: var(--c); margin-right: 4px; }
.field-row label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.checklist { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }
.checklist a { color: var(--d1); font-weight: 650; }
.checklist .done { list-style: "✓  "; color: var(--ok); font-weight: 650; }

/* ───────── map ───────── */
body[data-tab="map"] main { max-width: none; padding: 0; }
body[data-tab="map"] { padding-bottom: 0; }
.map-wrap { position: relative; height: 100dvh; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.map-top { position: absolute; z-index: 500; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 60px; }
.glass {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
#map-days button { padding: 0 12px; }
#map-days button[aria-pressed="true"] { background: var(--c, var(--ink)); color: #fff; }
#map-days button[data-map-day="0"][aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.map-bottom {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom));
  display: grid; gap: 10px; justify-items: center;
}
.replay { min-width: 200px; }
.hud { width: min(100%, 420px); border-radius: 18px; padding: 12px 16px 14px; display: grid; gap: 2px; animation: rise .4s var(--ease) both; }
.hud[hidden] { display: none; }
.hud time { font: 800 34px/1 var(--display); font-variation-settings: "wdth" 75; font-variant-numeric: tabular-nums; color: var(--ink); }
.hud p { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-track { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.hud-track span { display: block; height: 100%; background: var(--c); transform: scaleX(0); transform-origin: left; }
.leaflet-top.leaflet-right { top: env(safe-area-inset-top); }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-container { font-family: var(--body); }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; }
.pop-k { font: 700 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #6b7d75; }
.pop-t { font: 700 16px/1.2 var(--display); margin: 2px 0 6px; }
.pin {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c); color: #fff; font: 700 12px/1 var(--mono);
  border: 2.5px solid #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 35%);
  animation: pop .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 300ms);
}
.pin.food { border-radius: 9px; }
.pin.start, .pin.end { background: #0d2a22; font-size: 10px; }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.15); } }
.car { display: block; width: 34px; height: 34px; color: var(--c); filter: drop-shadow(0 3px 5px rgb(0 0 0 / 45%)); transition: transform .25s linear; }
.car svg { width: 100%; height: 100%; }

/* ───────── nav ───────── */
nav.tabs {
  --x: 0;
  position: fixed; z-index: 800; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--night) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / 50%);
}
.tab-ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4);
  border-radius: 16px; background: var(--go);
  transform: translateX(calc(var(--x) * 100%)); transition: transform .45s var(--ease);
}
nav.tabs button {
  position: relative; z-index: 1; min-height: 54px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; gap: 2px; align-content: center;
  color: rgb(233 242 237 / 65%); font-size: 11px; font-weight: 650; letter-spacing: .02em;
  transition: color .3s;
}
nav.tabs button svg { width: 21px; height: 21px; transition: transform .35s var(--ease); }
nav.tabs button[aria-current="page"] { color: var(--go-ink); }
nav.tabs button[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }

#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); z-index: 900; width: max-content; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  .hero { margin: 0; border-radius: 0 0 28px 28px; }
  .nav-btns { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───────── live journey ───────── */
body.live .hero { padding-bottom: 44px; }
body.live .hero-map, body.live .hero-stats { display: none; }
body.live .hero h1 { font-size: 30px; max-width: none; margin-top: 12px; }
.next-up[data-state="live"] { border: 2px solid var(--go); }
.nu-live-head { display: flex; align-items: center; gap: 8px; font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #e0342b; animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .35; transform: scale(.8); } }
.drift { margin-left: auto; padding: 4px 8px; border-radius: 99px; letter-spacing: .04em; text-transform: none; font-size: 11.5px; }
.drift.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.drift.slip { background: var(--warn-bg); color: var(--warn); }
.drift.late { background: #e0342b; color: #fff; }
.next-up .nu-label::before { display: none; }
.next-up[data-state="idle"] .nu-label::before { display: block; }
.nu-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn.big { min-height: 54px; font-size: 16px; padding: 0 22px; flex: 1 1 auto; }
.nu-actions .btn:not(.big) { min-height: 54px; }
.nu-progress { height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.nu-progress span { display: block; height: 100%; background: var(--go); transform: scaleX(var(--p)); transform-origin: left; transition: transform .6s var(--ease); }
.nu-foot { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.nu-foot span { flex: 1; }
.nu-foot .mini { margin: 0; }
.nu-done { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--ok); }
.nu-done svg { width: 16px; height: 16px; }
.start-day { justify-self: stretch; border: 2px dashed var(--c); color: var(--ink); }

.dt-badge { margin-left: 6px; padding: 2px 6px; border-radius: 5px; font-size: 9px; letter-spacing: .06em; vertical-align: 1px; }
.dt-badge.live { background: #e0342b; color: #fff; animation: livepulse 1.4s ease-in-out infinite; }
.dt-badge.done { background: var(--ok); color: #fff; }

.st-badge { display: inline-flex; align-items: center; gap: 3px; font: 700 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; margin-left: 6px; }
.st-badge svg { width: 12px; height: 12px; }
.st-badge.done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.st-badge.here { background: var(--go); color: var(--go-ink); }
.st-badge.next { background: var(--night); color: var(--on-night); }
.st-badge.missed { background: var(--surface-2); color: var(--muted); }
.stop-card header .st-badge { margin-right: auto; }

.road [data-status="done"] .stop-card, .road [data-status="missed"] .stop-card { opacity: .55; box-shadow: none; }
.road [data-status="done"] time, .road [data-status="missed"] time { color: var(--muted); }
.road [data-status="missed"] h3 { text-decoration: line-through; }
.road .stop[data-status="done"]::before, .road .ep[data-status="done"]::before { background: var(--ok); box-shadow: 0 0 0 1.5px var(--ok); }
.road [data-status="here"] .stop-card { box-shadow: 0 0 0 2.5px var(--go), var(--shadow); }
.road [data-status="here"]::before { animation: herepulse 1.6s ease-out infinite; }
.road [data-status="next"] .stop-card { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow); }
@keyframes herepulse { 0% { box-shadow: 0 0 0 1.5px var(--c), 0 0 0 0 rgb(243 165 49 / 60%); } 100% { box-shadow: 0 0 0 1.5px var(--c), 0 0 0 14px rgb(243 165 49 / 0%); } }
.road .via[data-status="done"] .milestone { opacity: .5; }
.road .leg.past span { opacity: .55; }
.mini.strong { color: var(--go-ink); background: var(--go); padding: 7px 10px; margin: -4px 0; }
.mini.strong:hover { color: var(--go-ink); }
.ep-actions { margin-top: 8px; }
