/* Quiet palette: warm off-white, slate ink, one Nile-blue accent. Gold is kept for the birthday only. */
:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #2a3142;
  --soft: #6a7284;
  --line: #e3e0d8;
  --accent: #2f6f8f;
  --accent-wash: #e8f1f5;
  --gold: #c49a2c;
  --gold-wash: #faf3df;
  --want: #3b8a6e;
  --maybe: #cfa238;
  --skip: #b5695a;
  --shadow: 0 1px 2px rgba(42, 49, 66, .05);
  --display: 'Marcellus', 'Times New Roman', serif;
  --body: 'Albert Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a21;
    --card: #1f232c;
    --ink: #e2e5ea;
    --soft: #9aa2b3;
    --line: #313746;
    --accent: #82b8d2;
    --accent-wash: #233641;
    --gold: #d6b25a;
    --gold-wash: #322b18;
    --want: #58a98b;
    --maybe: #d6b25a;
    --skip: #cf8474;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.ceiling { border-bottom: 1px solid var(--line); }
.ceiling-inner { max-width: 1440px; margin: 0 auto; padding: 44px 32px 24px; }
.ceiling h1 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); line-height: 1.1; }
.who { margin-top: 8px; color: var(--soft); font-size: 1.05rem; }
.how { margin-top: 4px; color: var(--soft); max-width: 60ch; }

.jump { display: flex; gap: 18px; margin-top: 18px; font-size: .93rem; }
.jump a { text-decoration: none; font-weight: 500; }
.jump a:hover { text-decoration: underline; }
.strip { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; padding-bottom: 4px; }
.strip button {
  flex: 1 0 auto;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.3;
}
.strip button:hover { border-color: var(--accent); }
.strip button.on { background: var(--accent-wash); border-color: var(--accent); }
.strip .d { display: block; font-size: .78rem; color: var(--soft); }
.strip .p { display: block; font-weight: 500; font-size: .9rem; white-space: nowrap; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 700px) minmax(0, 1fr);
  gap: 32px;
  padding: 0 32px;
  align-items: start;
}
.plan { padding: 24px 0 64px; min-width: 0; }
.mapwrap { position: sticky; top: 0; height: 100vh; padding: 24px 0; display: flex; flex-direction: column; }
#map { flex: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--card); min-height: 0; overflow: hidden; }
.mapbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; font-weight: 500; }
.mapbtns { display: flex; gap: 6px; }
#mapClose, .fab, .onmap { display: none; }
.mapbtns .btn { white-space: nowrap; }
#mapTitle { min-width: 0; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; margin-bottom: 16px; }
.tally { color: var(--soft); font-size: .93rem; }
.tally b { color: var(--ink); font-weight: 600; }
.tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .93rem; color: var(--soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .88rem;
  font-weight: 500;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: .82rem; }

/* ---------- Days ---------- */
.day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.day.birthday { border-color: var(--gold); }
.day-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 18px 22px;
  border-radius: 12px;
}
.day-date { grid-column: 1; font-size: .82rem; font-weight: 500; color: var(--soft); }
.day.birthday .day-date { color: var(--gold); }
.day-title { grid-column: 1; font-family: var(--display); font-size: 1.45rem; line-height: 1.2; }
.day-sum { grid-column: 1; color: var(--soft); font-size: .95rem; }
.day-meta { grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: center; gap: 12px; }
.pips { display: flex; gap: 4px; }
.pip { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.pip.want { background: var(--want); }
.pip.maybe { background: var(--maybe); }
.pip.skip { background: var(--skip); opacity: .55; }
.chev { width: 9px; height: 9px; border-right: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft); transform: rotate(45deg); transition: transform .2s; margin: 0 4px 4px; flex: none; }
[aria-expanded="true"] > .day-meta .chev, [aria-expanded="true"] > .chev { transform: rotate(-135deg); margin-bottom: -4px; }

.day-body { padding: 0 22px 14px; }
.day-note { background: var(--gold-wash); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: .92rem; }

/* ---------- Stops ---------- */
.leg {
  margin-left: 12px;
  padding: 6px 0 6px 26px;
  border-left: 1px dashed var(--line);
  color: var(--soft);
  font-size: .82rem;
}
.stop { border-top: 1px solid var(--line); }
.stop.is-skip .stop-name, .stop.is-skip .stop-blurb, .stop.is-skip .stop-time { opacity: .45; }
.hide-skipped .stop.is-skip, .hide-skipped .stop.is-skip + .leg { display: none; }
.stop-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 14px; align-items: start; padding: 14px 0; }
.num {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; align-self: start; justify-self: start;
  width: 26px; height: 26px; min-width: 26px;
  border-radius: 50%;
  background: var(--accent-wash); color: var(--accent);
  font-size: 12px; font-weight: 600; line-height: 1;
  margin-top: 1px;
}
.num.opt { background: transparent; border: 1.5px solid var(--line); color: var(--soft); }
.num.none { background: none; }
.stop-head { background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.stop-time { display: block; font-size: .8rem; color: var(--soft); }
.stop-name { display: block; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.stop-head:hover .stop-name { color: var(--accent); }
.stop-blurb { display: block; color: var(--soft); font-size: .92rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 500; padding: 1px 8px; border-radius: 99px; margin-left: 8px; vertical-align: 1px; }
.tag.opt { background: var(--bg); color: var(--soft); border: 1px solid var(--line); }
.tag.book { background: var(--gold-wash); color: var(--gold); }

.vote { display: inline-flex; gap: 4px; }
.vote button {
  background: none; border: 1px solid var(--line); border-radius: 99px;
  padding: 3px 11px; font-size: .78rem; font-weight: 500; color: var(--soft);
}
.vote button:hover { border-color: var(--soft); color: var(--ink); }
.vote button[aria-pressed="true"] { color: #fff; }
.vote button[aria-pressed="true"].v-want { background: var(--want); border-color: var(--want); }
.vote button[aria-pressed="true"].v-maybe { background: var(--maybe); border-color: var(--maybe); color: #2a2410; }
.vote button[aria-pressed="true"].v-skip { background: var(--skip); border-color: var(--skip); }

.stop-body { padding: 0 0 22px 40px; }
.stop-body > * + * { margin-top: 16px; }
.detail { max-width: 62ch; }

.photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.photos a { flex: 0 0 auto; scroll-snap-align: start; display: block; height: 180px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.photos img { height: 100%; width: auto; min-width: 140px; max-width: 300px; object-fit: cover; display: block; }

.facts { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: .9rem; margin-bottom: 0; }
.facts dt { display: inline; color: var(--soft); }
.facts dd { display: inline; margin: 0 0 0 5px; font-weight: 500; }

.know { background: var(--bg); border-radius: 8px; padding: 12px 16px; max-width: 66ch; }
.know h4 { margin: 0 0 4px; font: 600 .86rem var(--body); color: var(--soft); }
.know ul { margin: 0; padding-left: 18px; }
.know li { margin-bottom: 3px; font-size: .93rem; }
.know li::marker { color: var(--soft); }

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.video button { position: absolute; inset: 0; padding: 0; border: 0; background: #000; width: 100%; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .85; display: block; }
.video button:hover img { opacity: 1; }
.video .play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; background: rgba(255, 255, 255, .92); border-radius: 50%; }
.video .play::after { content: ''; position: absolute; left: 19px; top: 15px; border-left: 14px solid #2a3142; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pin.hotel { height: 24px; background: #fff; color: #2a3142; border: 1.5px solid #c49a2c; font-size: 11px; }
.opts { display: grid; gap: 10px; }
.credit { font-size: .78rem !important; color: var(--soft); margin: 4px 0 10px; }
.opts > * { min-width: 0; }
.hotel-card .photos, .fold-body .photos { margin: 8px 0 0 !important; padding: 0 0 6px !important; }
.hotel-card .photos a { height: 160px; }
.hotel-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.hotel-card h4 { margin: 0; font: 600 1rem var(--body); }
.opt-bank { color: var(--soft); font-size: .86rem; margin-bottom: 6px; }
.hotel-card p { font-size: .94rem; max-width: 62ch; }
.opt-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.opt-times dt { color: var(--soft); font-size: .78rem; }
.opt-times dd { margin: 0; font-size: .9rem; font-weight: 500; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; }

/* ---------- Before you go ---------- */
.after { margin-top: 44px; }
.after h2 { font-size: 1.6rem; margin-bottom: 14px; }
.fold { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.fold-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 14px 22px; font-weight: 500; border-radius: 12px; }
.fold-head small { font-weight: 400; color: var(--soft); margin-left: 10px; font-size: .86rem; }
.fold-body { padding: 0 22px 18px; }
.fold-body > * + * { margin-top: 14px; }
.fold-head small.status { color: var(--accent); }
.fold-body ul { margin: 0; padding-left: 18px; max-width: 64ch; }
.fold-body li { margin-bottom: 6px; font-size: .95rem; }
.fold-body li::marker { color: var(--soft); }
.todo { list-style: none; padding: 0 !important; }
.todo label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.todo input { width: 17px; height: 17px; margin-top: 4px; accent-color: var(--accent); flex: none; }
.todo input:checked + span { color: var(--soft); text-decoration: line-through; }
.decide { margin: 0; }
.decide dt { font-weight: 500; margin-top: 12px; }
.decide dt:first-child { margin-top: 0; }
.decide dd { margin: 0; color: var(--soft); max-width: 62ch; font-size: .95rem; }

.foot { margin-top: 32px; color: var(--soft); font-size: .84rem; max-width: 64ch; }
.foot p + p { margin-top: 6px; }

/* ---------- Map markers ---------- */
.pin {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2f6f8f; color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  display: grid; place-items: center;
  font: 600 12px var(--body);
}
.pin.opt { background: #fff; color: #2f6f8f; border: 2px solid #9fbccb; }
.pin.skip { background: #b4b8c2; border: 2px solid #fff; color: #fff; }
.pin.hot { background: #c49a2c; color: #fff; border-style: solid; border-color: #fff; transform: scale(1.25); }
.pin.dot { width: 14px; height: 14px; }
.pin.multi { width: 100%; border-radius: 14px; white-space: nowrap; }
.poplink { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 4px 0; color: #2a3142; }
.poplink + .poplink { border-top: 1px solid #e3e0d8; }
.poplink:hover b { color: #2f6f8f; }
.leaflet-container { font-family: var(--body); }
.leaflet-popup-content { font: 400 14px/1.4 var(--body); margin: 10px 14px; color: #2a3142; }
.leaflet-popup-content b { display: block; font-weight: 600; }
.leaflet-popup-content span { color: #6a7284; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 2000;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; }

/* ---------- Phones and tablets: one column, map in a full-screen sheet ---------- */
@media (max-width: 960px) {
  .layout { display: block; padding: 0 14px; }
  .ceiling-inner { padding: 22px 14px 14px; }
  .ceiling h1 { font-size: 2rem; }
  .who { font-size: .95rem; margin-top: 4px; }
  .how { font-size: .9rem; }
  .jump { margin-top: 14px; }
  .strip { margin: 12px -14px 0; padding: 0 14px 6px; scrollbar-width: none; }
  .strip::-webkit-scrollbar { display: none; }
  .strip button { flex: 0 0 auto; padding: 8px 12px; }

  .plan { padding: 16px 0 96px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .tools { justify-content: space-between; }
  .btn { padding: 9px 14px; }
  .btn.small { padding: 8px 12px; font-size: .86rem; }

  .day-head { padding: 14px 14px; gap: 2px 10px; }
  .day-title { font-size: 1.25rem; }
  .day-sum { font-size: .9rem; }
  .day-meta { flex-direction: column-reverse; gap: 10px; align-self: start; padding-top: 4px; }
  .pips { flex-wrap: wrap; max-width: 44px; justify-content: flex-end; }
  .day-body { padding: 0 14px 10px; }

  .stop-row { grid-template-columns: 26px minmax(0, 1fr); gap: 4px 12px; padding: 14px 0 12px; }
  .stop-row .vote { grid-column: 2; justify-self: start; margin-top: 8px; gap: 6px; }
  .vote button { padding: 8px 16px; font-size: .86rem; min-height: 38px; }
  .tag { margin-left: 0; margin-right: 6px; }
  .stop-name .tag { display: inline-block; margin: 2px 0 0 6px; }
  .stop-body { padding: 0 0 18px; }
  .leg { margin-left: 12px; padding-left: 24px; }
  .photos { margin: 0 -14px; padding: 0 14px 6px; scrollbar-width: none; }
  .photos::-webkit-scrollbar { display: none; }
  .photos a { height: 170px; }
  .photos img { max-width: 78vw; }
  .videos { grid-template-columns: 1fr; }
  .know { padding: 12px 14px; }
  .links { gap: 10px 18px; align-items: center; }
  .links a { padding: 4px 0; }
  .onmap { display: block; }
  .hotel-card { padding: 14px; }
  .opt-times { grid-template-columns: 1fr 1fr; }
  .fold-head { padding: 14px; flex-wrap: nowrap; }
  .fold-head small { display: block; margin: 2px 0 0; }
  .fold-body { padding: 0 14px 16px; }
  .after { margin-top: 36px; scroll-margin-top: 12px; }

  .mapwrap {
    position: fixed; inset: 0; z-index: 1500;
    height: auto; width: auto;
    padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg);
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity .15s;
  }
  .mapwrap.open { visibility: visible; opacity: 1; pointer-events: auto; }
  body.map-open { overflow: hidden; }
  #mapClose { display: inline-block; }
  .mapbar { font-size: .95rem; }
  .fab {
    display: block;
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1200;
    background: var(--accent); color: var(--bg);
    border: 0; border-radius: 99px;
    padding: 13px 22px; font-weight: 600; font-size: .95rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
  }
  body.map-open .fab { display: none; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chev, .toast, .mapwrap { transition: none; }
}
