:root {
  --paper: #f6f1e8;
  --paper-2: #efe7da;
  --ink: #1f1a17;
  --ink-2: #57504a;
  --line: #ddd2c2;
  --accent: #c2410c;
  --hsr: #b91c1c;
  --bus: #0e7490;
  --train: #a16207;
  --radius: 16px;
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.layout {
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  height: 100vh;
}

.panel {
  overflow-y: auto;
  padding: 0 clamp(20px, 3.2vw, 48px) 48px;
  scroll-behavior: smooth;
  background:
    radial-gradient(1200px 400px at -10% -5%, #f3d9c4 0%, transparent 60%),
    var(--paper);
}

.map-wrap { position: relative; }
#map { position: absolute; inset: 0; background: #dfe7ea; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: 12px;
  color: var(--accent); font-weight: 600; margin: 0 0 12px;
}
.hero h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(48px, 6vw, 84px);
  line-height: .95; margin: 0; letter-spacing: -.02em;
}
.subtitle { font-family: var(--display); font-size: 22px; color: var(--ink-2); margin: 10px 0 22px; }

.countdown { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.cd-box {
  background: var(--ink); color: var(--paper); border-radius: 12px;
  padding: 10px 14px; min-width: 78px; text-align: center;
}
.cd-box b { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.cd-box span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }

.countries { display: flex; gap: 8px; flex-wrap: wrap; }
.country {
  border: 1px solid var(--line); background: #fff8; border-radius: 999px;
  padding: 8px 14px; font: 500 14px var(--body); color: var(--ink); cursor: default;
  display: inline-flex; gap: 8px; align-items: center;
}
.country.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.country small { opacity: .7; font-size: 12px; }
.country.soon { opacity: .65; }

/* ---------- Blocks ---------- */
.block { padding: 32px 0 8px; }
.block h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 0 0 16px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.muted { color: var(--ink-2); font-size: 14px; margin-top: -8px; }
button.ghost {
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  font: 500 13px var(--body); color: var(--ink); cursor: pointer;
}
button.ghost:hover { background: var(--paper-2); }

/* Nights strip */
.nights { display: flex; border-radius: 12px; overflow: hidden; height: 64px; box-shadow: 0 1px 0 var(--line); }
.night {
  display: flex; flex-direction: column; justify-content: center; padding: 0 12px;
  color: #fff; min-width: 0; cursor: pointer; transition: filter .2s;
}
.night:hover { filter: brightness(1.08); }
.night b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.night span { font-size: 12px; opacity: .85; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: #fff9; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { font-family: var(--display); font-size: 26px; display: block; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--ink-2); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 12px);
}
.day { position: relative; padding-left: 70px; margin-bottom: 18px; }
.day-badge {
  position: absolute; left: 0; top: 14px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--c); color: #fff; display: grid; place-items: center; text-align: center;
  font-family: var(--display); line-height: 1; box-shadow: 0 0 0 5px var(--paper);
}
.day-badge b { font-size: 20px; display: block; }
.day-badge span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }

.card {
  background: #fffdf9; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; cursor: pointer; transition: box-shadow .25s, border-color .25s, transform .25s;
}
.card:hover { box-shadow: 0 8px 28px -14px #0004; }
.day.active .card { border-color: var(--c); box-shadow: 0 10px 34px -16px var(--c); transform: translateX(2px); }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.date { font-size: 13px; color: var(--ink-2); }
.sleep {
  font-size: 12px; background: var(--paper-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.card h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 6px 0 6px; }
.card p.sum { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }

.stops { list-style: none; margin: 0; padding: 0; display: none; }
.day.active .stops, .day.active .legs, .day.active .options { display: block; }
.stop { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.stop-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff;
  font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 1px;
}
.stop-num.opt { background: #8a8178; }
.stop-name { font-weight: 600; font-size: 15px; }
.stop-time { font-size: 12px; color: var(--ink-2); margin-left: 6px; font-weight: 500; }
.stop-info { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 4px 0 0; }
.stop a, .leg a { color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 500; }
.stop a:hover, .leg a:hover { text-decoration: underline; }

.legs, .options { display: none; margin-top: 10px; }
.options h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin: 12px 0 0; }
.leg {
  display: flex; gap: 10px; align-items: flex-start; background: var(--paper-2);
  border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: 14px;
}
.leg-ico { font-size: 18px; line-height: 1.2; }
.leg b { display: block; font-size: 14px; }
.leg span { color: var(--ink-2); }
.leg.optional { opacity: .75; }
.expand-hint { font-size: 13px; color: var(--accent); font-weight: 500; }
.day.active .expand-hint { display: none; }

/* ---------- Bookings ---------- */
.bookings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.booking {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  background: #fffdf9; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.booking input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; }
.booking b { font-size: 15px; }
.booking span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.booking.done b { text-decoration: line-through; opacity: .55; }

/* ---------- Next ---------- */
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.next-card {
  border: 1px dashed #c9bba6; border-radius: var(--radius); padding: 18px; background: #fff6;
}
.next-card .flag { font-size: 28px; }
.next-card h3 { font-family: var(--display); margin: 6px 0 4px; font-size: 22px; }
.next-card .when { font-size: 13px; color: var(--ink-2); }
.next-card p { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; line-height: 1.5; }
.tag { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 3px 8px; margin-top: 10px; }

.foot { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* ---------- Map bits ---------- */
.legend {
  position: absolute; z-index: 500; left: 14px; bottom: 18px; background: #fffdf9ee;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12px;
  display: flex; gap: 12px; backdrop-filter: blur(4px);
}
.legend i { display: inline-block; width: 22px; height: 0; border-top: 3px dashed; vertical-align: middle; margin-right: 6px; }
.pin {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2px solid #fff; box-shadow: 0 3px 8px #0005; display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); color: #fff; font: 600 12px var(--body); }
.pin.dim { opacity: .35; }
.pin.opt { background: #8a8178; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--body); }
.pop-day { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.pop-name { font-family: var(--display); font-size: 18px; font-weight: 600; margin: 2px 0 4px; }
.pop-info { font-size: 13px; color: var(--ink-2); line-height: 1.45; margin: 0 0 6px; }
.pop a { color: var(--accent); font-weight: 500; text-decoration: none; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .layout { display: flex; flex-direction: column-reverse; height: auto; }
  .map-wrap { position: sticky; top: 0; height: 42vh; z-index: 10; box-shadow: 0 6px 18px -10px #0006; }
  .panel { overflow: visible; }
  .hero { padding-top: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .next { grid-template-columns: 1fr; }
  .legend { bottom: 8px; left: 8px; padding: 6px 8px; gap: 8px; }
}
