:root {
  color-scheme: dark;
  --bg: #101012;
  --elev: #1b1b1f;
  --elev-2: #242428;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --gold: #e4b15a;
  --gold-ink: #1c1407;
  --red: #d5202a;
  --amber: #e6c27a;
  --amber-ink: #241c0c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.top {
  padding: calc(14px + env(safe-area-inset-top)) 16px 4px;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.draft-pill,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.draft-pill,
.badge.placeholder {
  background: var(--amber);
  color: var(--amber-ink);
}

.badge.rec {
  background: var(--red);
  color: #fff;
}

.badge.alt,
.badge.draft {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  letter-spacing: 0.03em;
}

.text-btn,
.map-btn {
  border: 1px solid var(--line);
  background: var(--elev);
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
}

.date {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(32px, 9vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
}

h1 .arrow {
  display: block;
  margin: 2px 0;
  color: var(--faint);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.depart {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 16px;
}

.banner {
  margin: 12px 16px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(230, 194, 122, 0.65);
  background: #2a2418;
  color: #f6e7c8;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

.toggle {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}

.toggle-btn {
  width: 100%;
  text-align: left;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--elev);
  padding: 12px 14px;
  min-height: 76px;
}

.toggle-btn.is-on {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
  background: #2a2416;
}

.toggle-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.toggle-btn.is-on .toggle-kicker { color: var(--gold); }

.toggle-title {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.toggle-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.baseline {
  margin: 8px 0 18px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #141416;
}

.baseline p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

.plan-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.layout { display: flex; flex-direction: column; }

.pad { padding: 0 16px; }

h2 {
  margin: 8px 0 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}

.loading { color: var(--muted); }

.timeline { margin-top: 4px; }

.tl-row {
  position: relative;
  padding: 12px 0 12px 28px;
}

.tl-row::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 28px;
  bottom: -8px;
  width: 2px;
  background: rgba(228, 177, 90, 0.35);
}

.tl-row:last-child::before { display: none; }

.tl-num,
.tl-dot {
  position: absolute;
  left: 0;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.tl-num {
  background: var(--gold);
  color: var(--gold-ink);
}

.tl-row.is-placeholder .tl-num {
  background: transparent;
  color: var(--amber);
  border: 1.5px dashed var(--amber);
}

.tl-dot {
  background: var(--text);
}

.tl-when {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.tl-what {
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tl-what .win {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tl-what .place { font-size: 16px; }

.tl-batt,
.tl-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tbd { color: var(--amber); font-weight: 650; }

.map-col {
  position: relative;
  margin: 8px 12px 4px;
}

#map {
  height: min(48vh, 440px);
  min-height: 250px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #16161a;
}

.leaflet-container {
  background: #16161a;
  font-family: inherit;
}

.leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  background: #1b1b1f;
  color: var(--text);
  border-bottom-color: var(--line);
}

.leaflet-bar {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.leaflet-control-attribution {
  font-size: 10px;
  max-width: 70%;
}

.map-btn {
  position: absolute;
  z-index: 500;
  top: 12px;
  right: 12px;
  background: rgba(16, 16, 18, 0.9);
}

.map-note {
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.leaflet-div-icon.pin {
  background: transparent;
  border: none;
}

.pin span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.pin-stop span {
  background: var(--gold);
  color: var(--gold-ink);
}

.pin-dash span {
  background: #1b1b1f;
  color: var(--amber);
  border: 2px dashed var(--amber);
  box-shadow: none;
}

.pin-ghost span {
  width: 14px;
  height: 14px;
  margin: 10px;
  background: transparent;
  border: 2px solid #f4f4f5;
  box-shadow: none;
}

.pin-food span,
.pin-food-on span {
  border-radius: 6px;
  background: #3a3428;
  border: 2px solid #c8b89a;
}

.pin-food-on span {
  background: #f4f4f5;
  border-color: #f4f4f5;
}

.pin-start span,
.pin-end span {
  background: #f4f4f5;
  color: #111;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.stops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.window {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 18px;
  background: var(--elev);
  border: 1px solid var(--line);
}

.window.is-placeholder {
  border-style: dashed;
  border-color: rgba(230, 194, 122, 0.7);
  background:
    repeating-linear-gradient(-45deg, rgba(230, 194, 122, 0.05) 0 8px, transparent 8px 14px),
    var(--elev);
}

.window h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.window-flag {
  margin: -4px 0 10px;
  color: var(--amber);
  font-size: 13px;
}

.choices, .foods { display: flex; flex-direction: column; gap: 8px; }

.choice, .food {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--elev-2);
  padding: 12px;
  min-height: 44px;
}

.choice.is-on, .food.is-on {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.choice.is-placeholder, .food.is-placeholder {
  border-style: dashed;
  border-color: rgba(230, 194, 122, 0.75);
  background:
    repeating-linear-gradient(-45deg, rgba(230, 194, 122, 0.07) 0 8px, transparent 8px 14px),
    #211e18;
}

.choice-name, .food-name {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 650;
}

.choice-sub, .food-sub, .pin-note, .choice-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.food-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.use {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.window h4 {
  margin: 14px 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot {
  padding: 8px 16px 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
}

.foot p { margin: 0 0 6px; }

@media (min-width: 700px) {
  .toggle { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
  .top, .banner, .foot, #lunch-toggle {
    width: min(1120px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
  }

  .banner { margin-top: 12px; }

  h1 { font-size: 44px; }
  h1 .arrow {
    display: inline;
    margin: 0 0.35em;
    font-size: 22px;
    text-transform: none;
    letter-spacing: -0.03em;
  }

  .layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.15fr) minmax(400px, 560px);
    gap: 8px 18px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    align-items: start;
  }

  .map-col {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: 12px;
    margin: 0;
  }

  #map {
    height: calc(100vh - 108px);
    min-height: 560px;
  }

  .timeline { grid-column: 2; grid-row: 1; margin-top: 0; }
  #windows { grid-column: 2; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
