@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Design tokens. Profile themes (themes.css) override these; always use a token instead of a raw colour. */
:root {
  --paper: #f6f4eb;
  --ink: #203b35;
  --green: #214d45;
  --accent: #dafa82;
  --muted: #727b70;
  --line: #dbded1;
  --personal: #dafa82;

  --card: #fffdf7;
  --surface: #ffffff;
  --soft: #eef0e5;
  --hover: #e9eedf;
  --badge: #e7eddc;
  --pending-bg: #f3e8d3;
  --pending-ink: #8c6d33;
  --optional-ink: #936f42;
  --stop-line: #e7e8df;
  --visit-border: #bfc9bb;
  --focus: #bb692f;
  --on-primary: #ffffff;

  --hero-bg: var(--green);
  --hero-text: #f6f4eb;
  --hero-overlay: var(--green);
  --hero-ink: #d0dace;
  --hero-dim: #b5c6bb;
  --stamp: #a2b58b;

  --map-bg: #dce4de;
  --route: #214d45;
  --route-day: #b77540;
  --warm: #b77540;
  --marker-fill: #f5d6a8;
  --sight: #e9a36b;

  --sky-1: #142e36;
  --sky-2: #38535b;
  --sky-3: #739088;
  --aurora-1: #bded9b55;
  --aurora-2: #69c7b44a;
  --moon: #eeeed6;
  --mountain: #879b94;
  --mountain-back: #617b79;
  --mountain-front: linear-gradient(115deg, #334b4b 30%, #6a8078 31%, #263e40 57%);
  --snow: #d2dbcd;
  --water: linear-gradient(#66877e, #345a53);
  --terrain: #1e3f38;
  --postcard: #edf6d4;

  --font-body: 'DM Sans', sans-serif;
  --font-head: 'Space Grotesk', sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

/* ---------- Top bar and profiles ---------- */

.topbar { max-width: 1320px; margin: auto; padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; display: flex; align-items: center; gap: 10px; }
.brand-icon { background: var(--green); color: var(--accent); border-radius: 50%; width: 34px; height: 34px; font-size: 27px; text-align: center; line-height: 32px; }
.brand small { font-size: 9px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; }
.profiles, #profiles { display: flex; align-items: center; gap: 8px; }
.profile-label { font-size: 11px; margin-right: 5px; color: var(--muted); }
.profile { border: 1px solid transparent; background: transparent; color: inherit; display: flex; align-items: center; gap: 6px; padding: 5px 8px; min-height: 44px; border-radius: 24px; font-size: 11px; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; background: var(--color); border: 1px solid #203b3520; border-radius: 50%; font-size: 17px; }
.profile[aria-pressed=true] { border-color: var(--green); background: var(--surface); }
.profile[aria-pressed=true] .avatar { box-shadow: 0 0 0 2px var(--paper); }

/* ---------- Hero ---------- */

main { max-width: 1240px; margin: auto; }
.hero { display: grid; grid-template-columns: 1fr 1fr; min-height: 435px; border-radius: 12px; overflow: hidden; background: var(--hero-bg); color: var(--hero-text); }
.hero-copy { padding: 46px 48px; }
.eyebrow { font-size: 10px; letter-spacing: 1.6px; font-weight: 700; }
.hero .eyebrow { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); }
h1 { font-size: 76px; line-height: .99; letter-spacing: -5px; margin: 25px 0 20px; font-weight: 600; }
h1 em { color: var(--personal); font-style: normal; }
.hero p { color: var(--hero-ink); font-size: 15px; line-height: 1.7; }
.hero-bottom { display: flex; gap: 18px; align-items: center; margin-top: 30px; font-size: 11px; }
.hero-bottom strong, .hero-bottom div > span { display: block; }
.hero-bottom div > span { margin-top: 6px; color: var(--hero-dim); }
.stamp { transform: rotate(-9deg); border: 1px solid var(--stamp); border-radius: 50%; height: 65px; width: 65px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 10px; letter-spacing: 1px; color: var(--accent); }
.stamp b { font-size: 7px; margin-top: 6px; }

.countdown { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 22px; }
.countdown-label { font-size: 10px; letter-spacing: 1.6px; font-weight: 700; text-transform: uppercase; color: var(--accent); }
.countdown-units { display: flex; gap: 6px; }
.countdown-units > span { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 7px 8px 6px; border: 1px solid color-mix(in srgb, var(--hero-text) 22%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--hero-text) 7%, transparent); }
.countdown-units b { font-family: var(--font-head); font-size: 24px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-units small { font-size: 9px; letter-spacing: 1px; color: var(--hero-dim); margin-top: 3px; }

.landscape { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--sky-1), var(--sky-2) 60%, var(--sky-3)); min-height: 360px; }
.aurora { position: absolute; width: 650px; height: 110px; top: 50px; left: -50px; transform: rotate(-27deg); border-radius: 50%; filter: blur(20px); border-top: 35px solid var(--aurora-1); }
.a2 { top: 115px; left: 40px; border-color: var(--aurora-2); transform: rotate(-35deg); }
.moon { position: absolute; right: 100px; top: 56px; width: 35px; height: 35px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 30px #efffd22a; }
.mountain { position: absolute; bottom: 60px; left: -20%; width: 145%; height: 240px; clip-path: polygon(0 100%, 23% 28%, 29% 40%, 42% 0, 53% 31%, 61% 18%, 100% 100%); background: var(--mountain); }
.back { bottom: 90px; left: 25%; background: var(--mountain-back); height: 230px; }
.front { background: var(--mountain-front); }
.snow { position: absolute; bottom: 211px; left: 41%; height: 90px; width: 130px; background: var(--snow); clip-path: polygon(45% 0, 100% 100%, 64% 70%, 57% 92%, 33% 58%, 0 80%); }
.water { position: absolute; bottom: 0; width: 100%; height: 100px; background: repeating-linear-gradient(0deg, #688c8320 0 2px, transparent 2px 13px), var(--water); }
.terrain { position: absolute; bottom: 0; left: -10%; width: 75%; height: 120px; background: var(--terrain); clip-path: polygon(0 30%, 25% 48%, 35% 39%, 48% 68%, 75% 84%, 100% 100%, 0 100%); }
.zodiac { display: none; }
.landscape-label { position: absolute; top: 24px; left: 24px; font-size: 8px; letter-spacing: 2px; color: #cad7c9; }
.postcard { position: absolute; bottom: 35px; right: 28px; transform: rotate(-9deg); color: var(--postcard); font-family: Georgia, serif; font-style: italic; font-size: 24px; }

/* ---------- Booking strip and tabs ---------- */

.booking-strip { display: flex; align-items: center; gap: 28px; font-size: 11px; padding: 23px 4px; border-bottom: 1px solid var(--line); }
.booking-strip b { color: var(--green); font-size: 17px; margin-right: 6px; }
.draft-tag { margin-left: auto; font-size: 8px; letter-spacing: 1px; color: var(--muted); }
.tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); padding-top: 12px; }
.tabs a { padding: 17px 2px; text-decoration: none; font-size: 10px; color: var(--muted); }
.tabs b { font-size: 13px; margin-left: 7px; color: var(--ink); }
.tabs a.active { border-bottom: 3px solid var(--green); }

/* ---------- Sections ---------- */

.section { padding-top: 48px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; gap: 20px; }
.section-heading .eyebrow { color: var(--muted); }
h2 { font-size: 34px; letter-spacing: -1.5px; font-weight: 500; margin: 10px 0 0; }
.section-heading p { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0; }

/* ---------- Map ---------- */

.map-layout { display: grid; grid-template-columns: 1fr 270px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.map-wrap { position: relative; min-width: 0; }
#map { width: 100%; height: 475px; background: var(--map-bg); }
#map-fallback { position: absolute; top: 40px; left: 30px; right: 30px; background: var(--paper); padding: 20px; z-index: 500; }
.map-note { position: absolute; bottom: 26px; left: 12px; background: color-mix(in srgb, var(--card) 94%, transparent); padding: 8px 10px; border-radius: 4px; z-index: 450; font-size: 10px; pointer-events: none; }
.route-swatch { display: inline-block; width: 20px; border-top: 2px solid var(--route); margin-right: 5px; vertical-align: middle; }
.route-sidebar { min-width: 0; padding: 23px 18px; }
.route-sidebar > .eyebrow { font-size: 9px; margin-bottom: 16px; }
.day-filter { display: flex; width: 100%; align-items: center; text-align: left; border: 0; background: none; padding: 9px; border-radius: 6px; gap: 10px; color: var(--ink); }
.day-filter:hover, .day-filter.selected { background: var(--hover); }
.day-number { font-size: 11px; border: 1px solid var(--line); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0; }
.day-filter.selected .day-number { background: var(--green); color: var(--on-primary); }
.day-filter strong { font-size: 11px; font-weight: 600; display: block; }
.day-filter small { font-size: 9px; color: var(--muted); }
.text-button { border: 0; background: transparent; color: var(--green); font-size: 11px; padding: 15px 8px; text-decoration: underline; }
.legend { display: flex; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 9px; color: var(--muted); }
.pin { background: var(--green); color: var(--on-primary); border: 2px solid white; border-radius: 50%; box-shadow: 0 2px 6px #0003; text-align: center; line-height: 23px; font-size: 11px; font-weight: bold; }
.sight-pin { background: var(--sight); }
.pending-pin { background: var(--card); color: var(--green); border: 2px solid var(--green); }
.sight-pin.pending-pin { color: var(--route-day); border-color: var(--warm); }
.route-summary { font-size: 13px; font-weight: 600; margin: 16px 0 7px; }
.route-disclaimer { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 0; max-width: 800px; }
.leaflet-popup-content { font-family: var(--font-body); line-height: 1.6; }
.leaflet-popup-content a { color: var(--green); }

/* ---------- Day cards ---------- */

.day-card { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: var(--card); overflow: hidden; }
.day-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 20px; padding: 20px 24px; }
.day-card summary::-webkit-details-marker { display: none; }
.date-box { width: 48px; flex-shrink: 0; text-align: center; }
.date-box small { font-size: 9px; letter-spacing: 1px; display: block; }
.date-box b { font-family: var(--font-head); font-size: 30px; font-weight: 500; }
.day-title { flex: 1; }
.day-title h3 { font-size: 18px; margin: 0 0 5px; font-weight: 500; letter-spacing: -.4px; }
.day-title p { font-size: 11px; color: var(--muted); margin: 0; }
.badge { font-size: 9px; border-radius: 20px; padding: 6px 10px; background: var(--badge); white-space: nowrap; }
.badge.pending { background: var(--pending-bg); color: var(--pending-ink); }
.expand { font-size: 22px; font-weight: 400; }
.day-card[open] .expand { transform: rotate(45deg); }
.day-body { padding: 0 26px 24px 92px; }
.day-intro { font-size: 13px; line-height: 1.65; max-width: 760px; }
.drive-estimate { font-size: 12px; font-weight: 600; color: var(--green); background: var(--soft); padding: 10px 12px; border-radius: 5px; }
.daylight { font-size: 12px; color: var(--muted); margin: 10px 0; }
.star-chart { display: none; }
.stop-list { list-style: none; padding: 0; margin: 18px 0; }
.stop { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--stop-line); align-items: start; }
.visit { height: 23px; width: 23px; min-width: 32px; min-height: 32px; flex-shrink: 0; border: 1px solid var(--visit-border); background: var(--surface); border-radius: 50%; color: var(--green); margin-top: 1px; }
.visit[aria-pressed=true] { background: var(--green); color: var(--on-primary); }
.stop-copy { flex: 1; }
.stop-copy strong { font-size: 13px; }
.stop-copy p { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 4px 0 0; }
.stop > a { font-size: 11px; text-decoration: none; padding: 5px; min-width: 40px; min-height: 40px; text-align: center; }
.optional { font-size: 9px; margin-left: 6px; color: var(--optional-ink); }
.stay { background: var(--soft); padding: 14px 16px; border-radius: 6px; font-size: 12px; line-height: 1.7; }
.day-actions { display: flex; gap: 20px; align-items: center; margin-top: 15px; font-size: 11px; }
.day-actions button { padding: 0; border: 0; background: none; text-decoration: underline; color: var(--green); }
.progress-note { font-size: 10px; color: var(--muted); margin-top: 15px; }

/* ---------- Essentials and footer ---------- */

.essentials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.essentials article { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); }
.card-icon { font-size: 27px; }
.essentials h3 { font-size: 19px; font-weight: 500; }
.essentials p { font-size: 12px; line-height: 1.9; }
.essentials small { font-size: 10px; color: var(--muted); line-height: 1.7; }
.useful-links { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; }
footer { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); padding: 35px 0; margin-top: 45px; border-top: 1px solid var(--line); }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 8px; z-index: 2000; font-size: 12px; display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1300px) {
  main { margin: 0 32px; }
  .topbar { padding: 20px 32px; }
}

@media (max-width: 800px) {
  .topbar { flex-direction: column; align-items: flex-start; padding: 18px 20px; gap: 15px; }
  .profiles { width: 100%; justify-content: space-between; }
  .profile-label { font-size: 10px; }
  .profile { padding: 4px 5px; }
  .profile span:last-child { font-size: 10px; }
  main { margin: 0 18px; }
  .hero { grid-template-columns: 1fr .75fr; min-height: 350px; }
  .hero-copy { padding: 30px 25px; }
  h1 { font-size: 57px; letter-spacing: -3px; }
  .hero .eyebrow { font-size: 8px; line-height: 1.8; }
  .hero p { font-size: 12px; }
  .hero-bottom { gap: 10px; font-size: 9px; }
  .stamp { display: none; }
  .countdown-units > span { min-width: 44px; padding: 6px 5px 5px; }
  .countdown-units b { font-size: 20px; }
  .landscape { min-height: 350px; }
  .postcard { font-size: 19px; }
  .booking-strip { gap: 15px; flex-wrap: wrap; font-size: 10px; padding: 16px 0; }
  .draft-tag { display: none; }
  .map-layout { grid-template-columns: 1fr; }
  .route-sidebar { padding: 14px; }
  .route-sidebar > .eyebrow, .legend { display: none; }
  #day-filters { display: flex; overflow: auto; gap: 6px; }
  .day-filter { min-width: 140px; padding: 8px; }
  .text-button { padding: 10px 8px 0; }
  #map { height: 390px; }
  .section-heading p { display: none; }
  .essentials { grid-template-columns: 1fr; }
  .section { padding-top: 35px; }
  h2 { font-size: 29px; }
  .day-card summary { padding: 17px 15px; gap: 12px; }
  .day-title h3 { font-size: 16px; }
  .day-body { padding: 0 18px 20px; }
  .badge { font-size: 8px; padding: 5px 7px; }
  .date-box { width: 35px; }
  footer { gap: 20px; line-height: 1.8; }
}

@media (max-width: 480px) {
  .hero { grid-template-columns: 1fr; position: relative; }
  .hero-copy { z-index: 1; background: linear-gradient(90deg, var(--hero-overlay) 25%, color-mix(in srgb, var(--hero-overlay) 53%, transparent)); padding: 30px 24px; }
  .landscape { position: absolute; inset: 0; left: 25%; opacity: .65; }
  .landscape-label, .postcard { display: none; }
  h1 { font-size: 68px; }
  .hero-bottom { margin-top: 24px; }
  .hero p { color: var(--hero-text); }
  .hero-bottom div > span { color: var(--hero-ink); }
  .profiles { display: block; }
  .profile-label { display: none; }
  #profiles { justify-content: space-between; }
  .profile { font-size: 11px; }
  .tabs { justify-content: space-between; gap: 5px; }
  .tabs a { font-size: 9px; }
  .tabs b { font-size: 12px; margin-left: 4px; }
  .day-title p { font-size: 10px; }
  .day-title h3 { font-size: 14px; }
  .badge { max-width: 75px; white-space: normal; text-align: center; }
  .section-heading .eyebrow { font-size: 8px; }
  .booking-strip { justify-content: space-between; gap: 6px; font-size: 9px; }
  .booking-strip b { font-size: 14px; margin-right: 3px; }
  footer { flex-direction: column; gap: 6px; margin-bottom: 20px; }
  #toast { width: 85%; text-align: center; }
}

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