:root {
  /* meaning colours: orange = needs attention, green = money,
     blue = weather dependent, yellow = happening now */
  --warn: #b84a0e;
  --warn-soft: #ffedd9;
  --money: #187a3e;
  --money-soft: #e2f5e8;
  --weather: #1667a0;
  --weather-soft: #e1f0fb;
  --now: #b88a00;
  --now-soft: #fff4c2;
  --cobalt: #1d3f8f;
  --cobalt-deep: #142d68;
  --wash: #f5f7f8;
  --paper: #ffffff;
  --ink: #18233a;
  --slate: #5c6a80;
  --rule: #dde3ea;
  --saffron: #e0a12a;
  --saffron-soft: #fcf1d9;
  --sky: #e8eef9;
  --k-flight: #1d3f8f;
  --k-train: #2f6f5e;
  --k-bus: #7b3fa0;
  --k-taxi: #4b5563;
  --k-food: #7a5c2e;
  --k-show: #8a2f5b;
  --k-rest: #5c6a80;
  --k-stay: #5c6a80;
  --k-sight: #18233a;
  --tile-line: rgba(255, 255, 255, 0.22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --warn: #ffa366;
    --warn-soft: #43260f;
    --money: #6fd59a;
    --money-soft: #123524;
    --weather: #7cc4f5;
    --weather-soft: #12304a;
    --now: #f5cf4a;
    --now-soft: #3d3410;
    --wash: #0f1830;
    --paper: #16213e;
    --ink: #e9eef7;
    --slate: #a2afc4;
    --rule: #26355a;
    --saffron: #f0b444;
    --saffron-soft: #3a2f17;
    --sky: #1b2a50;
    --k-flight: #8fb0ff;
    --k-train: #7cc7b2;
    --k-bus: #cfa6f2;
    --k-taxi: #b8c0cc;
    --k-food: #d9b98a;
    --k-show: #f08fbf;
    --k-rest: #a2afc4;
    --k-stay: #a2afc4;
    --k-sight: #e9eef7;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }

/* ---------- header: the one decorative moment, an azulejo band */
.band {
  background-color: var(--cobalt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='1.6'%3E%3Cpath d='M0 14A14 14 0 0 0 14 0M42 0a14 14 0 0 0 14 14M56 42a14 14 0 0 0-14 14M14 56A14 14 0 0 0 0 42'/%3E%3Cpath d='M28 8l20 20-20 20L8 28z'/%3E%3Ccircle cx='28' cy='28' r='6'/%3E%3Cpath d='M28 0v8M28 48v8M0 28h8M48 28h8'/%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  padding: max(20px, env(safe-area-inset-top)) 16px 22px;
}
.band-inner { max-width: 760px; margin: 0 auto; }
.back { font-size: 15px; opacity: 0.85; text-decoration: none; }
.back:hover { text-decoration: underline; }
.band h1 {
  margin: 18px 0 2px;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.sub { margin: 0; font-size: 18px; opacity: 0.92; }
.status { margin: 14px 0 0; font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.status .live::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #6fe0a2; margin-right: 7px; vertical-align: 1px;
}
.status .live.stale::before { background: var(--saffron); }
.status a { opacity: 0.9; }
.status .sheetwarn { background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.editcell small { opacity: 0.75; font-weight: 400; }

/* ---------- section switcher */
.views {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 4px; overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 8px max(16px, calc((100vw - 760px) / 2));
  scrollbar-width: none;
}
.views::-webkit-scrollbar { display: none; }
.views button {
  flex: none; font: inherit; font-size: 16px; font-weight: 700;
  color: var(--slate); background: none; border: 0;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
}
.views button[aria-pressed="true"] { color: #fff; background: var(--cobalt); }

main { max-width: 760px; margin: 0 auto; padding: 0 16px 80px; }
.empty { color: var(--slate); padding: 32px 0; }
.error { background: var(--saffron-soft); border-radius: 10px; padding: 14px 16px; margin: 20px 0; }

/* ---------- day tiles */
.daystrip {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 6px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.daytile {
  flex: none; scroll-snap-align: start;
  width: 92px; text-align: left; font: inherit;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--rule); border-radius: 10px;
  padding: 8px 10px; cursor: pointer;
}
.daytile .dow { display: block; font-size: 14px; color: var(--slate); }
.daytile .num { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.daytile .city { display: block; font-size: 13px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daytile[aria-pressed="true"] { border-color: var(--cobalt); background: var(--sky); }
.daytile.today .num::after {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--saffron); margin-left: 6px; vertical-align: 6px;
}

/* ---------- a day */
.dayhead { padding: 18px 0 6px; }
.dayhead .when { margin: 0; color: var(--slate); font-size: 16px; }
.dayhead h2 { margin: 2px 0 0; font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; }
.facts { display: grid; gap: 10px; margin: 14px 0 6px; }
.fact {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  padding: 12px 14px;
}
.fact h3 { margin: 0 0 2px; font-size: 15px; color: var(--slate); font-weight: 400; }
.fact p { margin: 0; }
.fact .maplink { font-size: 15px; }
.sun { display: flex; gap: 18px; color: var(--slate); font-size: 15px; margin: 10px 0 0; }
.booklist { list-style: none; margin: 0; padding: 0; }
.booklist li { padding-left: 26px; position: relative; }
.booklist li::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 14px; height: 14px;
  border: 2px solid var(--slate); border-radius: 4px;
}
.booklist li.done::before { background: var(--saffron); border-color: var(--saffron); }
.booklist li.done::after {
  content: ""; position: absolute; left: 7px; top: 8px; width: 5px; height: 9px;
  border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.booklist li + li { margin-top: 6px; }

/* timeline */
.timeline { margin: 18px 0 0; }
.slot { display: grid; grid-template-columns: 74px 1fr; column-gap: 12px; }
.slotlabel {
  grid-column: 1 / -1; font-size: 14px; color: var(--slate);
  border-top: 1px solid var(--rule); padding: 10px 0 2px;
}
.item { display: contents; }
.item .t {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px;
  padding: 8px 0; color: var(--ink);
}
.item .t small { display: block; font-weight: 400; font-size: 14px; color: var(--slate); }
.item .body { padding: 8px 0 10px 12px; border-left: 3px solid var(--kc, var(--rule)); }
.item .kind { font-size: 14px; color: var(--kc); font-weight: 700; }
.item .title { display: block; font-size: 19px; font-weight: 700; line-height: 1.3; }
.item .detail { display: block; color: var(--slate); font-size: 16px; margin-top: 2px; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 15px; }
.tag { border-radius: 6px; padding: 1px 8px; background: var(--sky); color: var(--ink); }
.tag.weather { background: var(--saffron-soft); }
.item.now .body { background: linear-gradient(90deg, var(--saffron-soft), transparent 80%); }
.item.now .t { color: var(--saffron); }
.k-flight { --kc: var(--k-flight); } .k-train { --kc: var(--k-train); } .k-bus { --kc: var(--k-bus); }
.k-taxi { --kc: var(--k-taxi); } .k-food { --kc: var(--k-food); } .k-show { --kc: var(--k-show); }
.k-rest { --kc: var(--k-rest); } .k-stay { --kc: var(--k-stay); } .k-sight { --kc: var(--k-sight); }

.daynav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.daynav button {
  font: inherit; font-size: 16px; font-weight: 700; color: var(--cobalt);
  background: var(--paper); border: 1.5px solid var(--rule); border-radius: 10px;
  padding: 10px 14px; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .daynav button { color: var(--k-flight); } }
.daynav button[hidden] { visibility: hidden; display: block; }

/* ---------- lists (travel, bookings, notes) */
.section h2 { font-size: 26px; margin: 24px 0 4px; }
.section > p.lead { margin: 0 0 12px; color: var(--slate); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.rows > li { padding: 12px 14px; display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.rows > li + li { border-top: 1px solid var(--rule); }
.rows .d { color: var(--slate); font-size: 15px; }
.rows .d b { display: block; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.rows .x b { display: block; }
.rows .x span { color: var(--slate); font-size: 16px; }
.rows .x .meta { margin-top: 6px; font-size: 15px; }
.rows .x .meta .tag { color: var(--ink); }
.rows .x .booklist { margin-top: 4px; }

table.costs { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 10px; overflow: hidden; font-size: 16px; }
.costs th, .costs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.costs th { color: var(--slate); font-weight: 400; }
.costs tfoot td { font-weight: 700; border-bottom: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; }
.note { background: var(--saffron-soft); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }

@media (min-width: 640px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts .fact.wide { grid-column: 1 / -1; }
  .slot { grid-template-columns: 96px 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .daystrip { scroll-behavior: smooth; }
}

/* day route + lounges */
.routes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.routebtn {
  display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none;
  background: var(--cobalt); color: #fff; font-weight: 700; font-size: 16px;
  padding: 10px 14px; border-radius: 10px;
}
.routebtn small { font-weight: 400; opacity: 0.85; font-size: 14px; }
.lounge {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--sky); font-size: 15px; display: grid; gap: 2px;
}
.lounge b { font-size: 15px; }
.lounge span { color: var(--slate); }
.lounge .ln { color: var(--ink); }
.rows .x .lounge span { font-size: 15px; }
.rows .x .info { color: var(--ink); font-size: 17px; }
.rows .x span { display: block; }
.rows.totals { margin-top: 10px; background: var(--sky); }
.rows > li { grid-template-columns: 112px 1fr; }

/* cost summary */
.costsum { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; margin: 10px 0 14px; }
.costsum .big { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.costsum .lbl { margin: 2px 0 10px; color: var(--slate); font-size: 15px; }
.costsum .split { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--rule); }
.costsum .split li { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.costsum .split b { font-variant-numeric: tabular-nums; text-align: right; }
.costsum .split small { grid-column: 1 / -1; color: var(--slate); font-size: 14px; }
.costsum .fx { margin: 6px 0 0; color: var(--slate); font-size: 14px; }
.costsum .fx.warn { color: var(--ink); background: var(--saffron-soft); padding: 6px 8px; border-radius: 6px; }

/* ---------- meaning colours */
.note { background: var(--sky); }
.status .live.stale::before { background: var(--warn); }
.error, .note.warn { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.note.warn { color: var(--ink); }

/* happening now / today: yellow highlighter */
.item.now .body { background: linear-gradient(90deg, var(--now-soft), transparent 85%); }
.item.now .t, .item.now .kind { color: var(--now); }
.daytile.today .num::after { background: var(--now); }

/* still to book: orange */
.daytile.pending { box-shadow: inset 0 -4px 0 var(--warn); }
.fact.warn { border-color: var(--warn); border-left-width: 4px; background: var(--warn-soft); }
.fact.warn h3 { color: var(--warn); font-weight: 700; }
.booklist li:not(.done) { color: var(--ink); }
.booklist li:not(.done)::before { border-color: var(--warn); }
.booklist li.done { color: var(--slate); }
.booklist li.done::before { background: var(--cobalt); border-color: var(--cobalt); }
.booklist li.done::after { border-color: #fff; }

/* tags */
.tag.weather { background: var(--weather-soft); color: var(--weather); font-weight: 700; }
.tag.weather::before { content: "☁ "; }
.tag.warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.tag.warn::before { content: "! "; }
.item.is-weather .body { border-left-style: dashed; border-left-color: var(--weather); }
.item.is-warn .detail { color: var(--ink); }

/* departure / arrival */
.timing { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--sky); font-size: 15px; display: grid; gap: 2px; }
.timing b { font-variant-numeric: tabular-nums; font-size: 16px; }
.timing .lab { display: inline-block; min-width: 64px; color: var(--slate); }
.timing .dur { color: var(--slate); }
.timing .nextday { color: var(--warn); font-weight: 700; }
.timing .pickup { margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--paper); border-left: 3px solid var(--cobalt); color: var(--ink); }
.timing .tl { display: grid; grid-template-columns: 64px 1fr; gap: 6px; }
.timing .lab { min-width: 0; }
.timing .nextday { font-style: normal; }
.rows .x .timing span { display: inline; font-size: 15px; color: var(--ink); }
.rows .x .timing .lab { display: block; color: var(--slate); }
.rows .x .meta .tag { display: inline-block; }
.rows .x span.run { font-weight: 600; }

/* money: green */
.costsum { border-left: 4px solid var(--money); }
.costsum .big { color: var(--money); }
.costsum .split b { color: var(--money); }
.costsum .fx.warn { background: var(--warn-soft); border-left: 3px solid var(--warn); }
.costlist .d b.amt { color: var(--money); }
.rows .x span.run { color: var(--money); font-weight: 700; }
.views button[data-view="notes"][aria-pressed="true"] { background: var(--money); }
@media (prefers-color-scheme: dark) { .views button[data-view="notes"][aria-pressed="true"] { color: #0f1830; } }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: 14px; color: var(--slate); }
.legend .lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.legend .warn::before { background: var(--warn); }
.legend .weather::before { background: transparent; border: 2px dashed var(--weather); width: 8px; height: 8px; }
.legend .money::before { background: var(--money); }
.legend .now::before { background: var(--now); }

/* flight status */
.timing .hometime { display: grid; grid-template-columns: 64px 1fr; gap: 6px; color: var(--ink); }
.timing .hometime .lab { color: var(--cobalt); font-weight: 700; font-size: 13px; line-height: 1.6; }
@media (prefers-color-scheme: dark) { .timing .hometime .lab { color: var(--k-flight); } }
.timing .status { margin-top: 4px; }
.timing .status b { display: inline-block; border-radius: 6px; padding: 0 8px; }
.timing .status.ok b { background: var(--paper); color: var(--cobalt); }
.timing .status.bad b { background: var(--warn); color: #fff; }
.timing .status small { color: var(--slate); }
.timing .revised, .timing .revised b { color: var(--warn); }
.timing.is-bad { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.timing .track { margin-top: 4px; font-size: 14px; color: var(--slate); }
.timing .track a { color: var(--ink); }
.timing .src { font-size: 13px; color: var(--slate); }
.rows .x .timing .hometime span { color: var(--ink); }
.rows .x .timing .hometime .lab { color: var(--cobalt); }
.rows .x .timing .status small, .rows .x .timing .track small { display: inline; }
.rows .x .timing .src { display: block; }

/* transport icons, estimates, be-there-by */
.ico { width: 1.05em; height: 1.05em; fill: currentColor; vertical-align: -0.15em; margin-right: 5px; }
.item .kind .ico { width: 16px; height: 16px; }
.rows .x b.legtitle .ico { color: var(--cobalt); width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) { .rows .x b.legtitle .ico { color: var(--k-flight); } }
.item .t .est { font-style: italic; color: var(--slate); }
.item .estwhy { display: block; font-size: 14px; color: var(--slate); font-style: italic; margin-top: 2px; }
.timing .bethere { margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--paper); }
.timing .bethere small { color: var(--slate); }
.timing .bethere .why { display: block; font-size: 14px; color: var(--slate); }
.timing .bethere.tight { border-left: 3px solid var(--warn); }
.timing .bethere .warnline { color: var(--warn); font-weight: 700; }
.rows .x .timing .bethere span.why { display: block; }
.rows .x .timing .bethere small { display: inline; }

/* travel-list icons take the colour of their kind */
.rows .x b.legtitle.k-train .ico { color: var(--k-train); }
.rows .x b.legtitle.k-bus .ico { color: var(--k-bus); }
.rows .x b.legtitle.k-flight .ico { color: var(--k-flight); }

/* ---------- food */
.muted { color: var(--slate); margin: 4px 0 0; font-size: 16px; }
.chip { display: inline-block; font-size: 13px; line-height: 1.3; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--rule); background: var(--wash); color: var(--slate); }
.chip.price { background: var(--money-soft); color: var(--money); border-color: transparent; font-weight: 700; }
.bk.ahead { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 700; }
.bk.same { background: var(--weather-soft); color: var(--weather); border-color: transparent; }
.bk.walk { background: var(--wash); color: var(--slate); }
span.bk { font-size: 12px; padding: 1px 6px; border-radius: 999px; }
.meal { margin: 14px 0 22px; }
.mealhead h4 { margin: 0; font-size: 19px; }
.mealhead .mtime { color: var(--slate); font-weight: 400; }
.mealhead .muted { font-size: 15px; }
.fopts { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 2px 8px; margin: 0 -2px; }
.fopt { flex: 0 0 86%; scroll-snap-align: start; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fopt.pick { border-top: 4px solid var(--k-food); }
.fopt.chosen { border: 2px solid var(--cobalt); box-shadow: 0 0 0 3px var(--sky); }
.fopt h5 { margin: 2px 0 0; font-size: 19px; line-height: 1.25; }
.ftop { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.rank { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--k-food); }
.fopt.chosen .rank { color: var(--cobalt); }
@media (prefers-color-scheme: dark) { .fopt.chosen .rank { color: var(--k-flight); } .fopt.chosen { border-color: var(--k-flight); } }
.farea { color: var(--slate); text-align: right; }
.vibe { margin: 0; font-style: italic; color: var(--slate); font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.fl { margin: 0; font-size: 15px; line-height: 1.4; }
.fl b { color: var(--slate); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; margin-right: 2px; }
.fl.warnline { color: var(--warn); }
.fl.warnline b { color: var(--warn); }
.fl .flag { font-size: 12px; background: var(--now-soft); color: var(--now); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.flinks { margin-top: auto; padding-top: 8px; display: flex; gap: 14px; font-size: 15px; }
/* Ratings, from the sheet's Rating column; the bands are set by lib/rating.js */
.chips.frate { margin: 2px 0 0; }
.chip.rate { font-weight: 700; border-color: transparent; }
.chip.rate-top { background: var(--money-soft); color: var(--money); }
.chip.rate-ok { background: var(--sky); color: var(--ink); font-weight: 600; }
.chip.rate-few { background: var(--now-soft); color: var(--now); }
.chip.rate-low { background: var(--warn-soft); color: var(--warn); }
.legend .lgtext { align-self: center; }
.foodintro .legend.rates { margin-top: 8px; }
.avoid { font-size: 15px; color: var(--slate); }
.avoid p { margin: 0 0 4px; }
.foodintro .legend { gap: 6px; }
.fact.food { border-left: 4px solid var(--k-food); }
.linkbtn { margin-top: 6px; background: none; border: 0; padding: 0; color: var(--cobalt); text-decoration: underline; font: inherit; font-size: 15px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .linkbtn { color: var(--k-flight); } }
@media (min-width: 760px) {
  .fopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .fopt { flex: none; }
}
.foodbook .booklist li { list-style: none; }

/* Food view folds: a day per fold, today open; earlier days grouped; book-ahead list; "why" */
.fday { scroll-margin-top: calc(var(--views-h, 56px) + 10px); }
.fdhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fcity { color: var(--slate); font-size: 15px; }
.tag.fwhen { font-size: 13px; font-weight: 700; }
.tag.fwhen.now { background: var(--now-soft); color: var(--now); }
/* meal | chosen-or-pick ★ — two columns, so names line up */
.fsum { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: fit-content(9.5em) 1fr; gap: 6px 12px; align-items: baseline; font-size: 15px; }
.fsum li { display: contents; }
.fsum .fmeal { color: var(--slate); font-weight: 700; }
.fsum .fmeal .mtime { font-weight: 400; }
.fsum .fpick { font-weight: 600; }
.fsum .fpick .chip { margin-left: 6px; }
.chip.rate.short { font-size: 12px; padding: 1px 7px; }
.fwhy { font-size: 15px; line-height: 1.4; }
.fwhy p { margin: 0 0 4px; }
/* past days: where we ate; unused suggestions in the Archive at the bottom */
.ateday { margin: 8px 0 16px; scroll-margin-top: calc(var(--views-h, 56px) + 10px); }
.ateday h4 { margin: 0; font-size: 17px; }
.ateday h4 .fcity { font-weight: 400; margin-left: 4px; }
.ateday .fsum { margin-top: 6px; }
.fsum .fpick a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.fsum .fpick.unrec { color: var(--slate); font-weight: 400; font-style: italic; }
.farchive { margin-top: 30px; }
.arch { margin: 12px 0; }
.arch h4 { margin: 0 0 4px; font-size: 14px; color: var(--slate); }
.arch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.arch li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.arch li a { color: var(--ink); }
.arch .aarea { color: var(--slate); font-size: 13px; }
.fact.food .booklist li { padding-left: 0; }
.fact.food .booklist li::before, .fact.food .booklist li::after { display: none; }
.item .meta a.editcell { color: var(--slate); text-decoration: none; }

/* ---------- weather on each part of the day */
.slotlabel { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.wxp { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--ink); font-size: 15px; }
.wxp b { font-size: 17px; }
.wet { color: var(--weather); font-weight: 700; }
.sky { font-size: 16px; line-height: 1; }
.uv { font-size: 13px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--saffron-soft); color: var(--ink); }
.uv.hi { background: var(--warn-soft); color: var(--warn); }
.wxday { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin: 10px 0 0; font-size: 15px; }
.wxday .wxcity { display: inline-flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.wxday small { flex-basis: 100%; color: var(--slate); font-size: 13px; }
.wxday.muted { color: var(--slate); }

/* ---------- maps */
.mapbox { margin: 14px 0 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--sky); }
.daymap { height: 260px; }
.routemap { height: 380px; }
@media (min-width: 640px) { .daymap { height: 320px; } .routemap { height: 460px; } }
.leaflet-container { font: inherit; background: var(--sky); }
.lpin {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; color: var(--cobalt); border: 2.5px solid var(--cobalt);
  font-weight: 700; font-size: 14px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.lpin.home { background: var(--cobalt); color: #fff; }
.lpin.city { background: var(--cobalt); color: #fff; }
.ltip { font: inherit; font-size: 14px; line-height: 1.3; }
.pinbadge {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--cobalt); color: var(--cobalt); font-size: 12px; font-weight: 700;
  margin-right: 6px; vertical-align: 1px; background: var(--paper);
}

/* ---------- overview */
.ov .ovtodo { margin: 12px 0 0; }
.ovdays { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.ovday {
  width: 100%; display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start;
  text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--rule); border-radius: 12px; padding: 12px 14px;
}
.ovday:hover { border-color: var(--cobalt); }
.ovday.today { border-color: var(--now); box-shadow: inset 4px 0 0 var(--now); }
.ovdate { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ovdate .dow { font-size: 13px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.05em; }
.ovdate .num { font-size: 28px; font-weight: 700; }
.ovdate .mon { font-size: 13px; color: var(--slate); }
.ovbody { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ovn { font-size: 14px; color: var(--slate); }
.ovroute { font-size: 19px; font-weight: 700; line-height: 1.25; }
.ovstay { font-size: 15px; color: var(--slate); overflow-wrap: anywhere; }
.ovbody .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ovbody .chip { font-size: 14px; padding: 2px 10px; border-color: transparent; background: var(--sky); color: var(--ink); display: inline-flex; gap: 4px; align-items: center; }
.ovbody .chip.warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.ovbody .chip.wx { background: var(--weather-soft); }
.views button[data-view="overview"][aria-pressed="true"] { background: var(--cobalt); }

/* ---------- phone readability (Oct 4) */
/* parts of the day: big, bold, and they stay at the top while you scroll that part */
.slotlabel {
  position: sticky; top: var(--views-h, 52px); z-index: 3;
  margin: 18px 0 0; padding: 10px 0 8px;
  background: var(--wash); border-top: 2px solid var(--rule);
  font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.2;
  gap: 4px 14px;
}
.slot:first-child .slotlabel { margin-top: 4px; }
.slotlabel .sl { letter-spacing: -0.01em; }
.slotlabel .wxp { font-size: 16px; font-weight: 400; }
.slotlabel .wxp b { font-size: 18px; }
.slotlabel .sky { font-size: 18px; }

/* more air between items; the time column a little narrower on phones */
.slot { grid-template-columns: 64px 1fr; }
.item .t { padding: 12px 0 8px; font-size: 18px; }
.item .body { padding: 12px 0 14px 14px; }
.item .kind { font-size: 15px; }
.item .title { font-size: 20px; margin-top: 2px; }
.item .detail { font-size: 17px; line-height: 1.45; }
.item .meta { gap: 8px 14px; margin-top: 8px; font-size: 16px; align-items: center; }
.item .meta a { padding: 6px 0; } /* taller tap targets */
.item .meta a.mapsbtn {
  padding: 6px 12px; border-radius: 999px; text-decoration: none; font-weight: 700;
  background: var(--sky); color: var(--cobalt);
}
@media (prefers-color-scheme: dark) { .item .meta a.mapsbtn { color: var(--k-flight); } }
.item .meta a.editcell { font-size: 14px; }
.pinbadge { width: 22px; height: 22px; font-size: 13px; }

/* day header: weather and sun times easier to read */
.dayhead h2 { font-size: 34px; }
.sun { flex-wrap: wrap; gap: 4px 16px; font-size: 16px; color: var(--ink); }
.sun b { font-variant-numeric: tabular-nums; }
.wxday { font-size: 17px; gap: 6px 16px; }
.wxday .wxcity b { font-size: 18px; }
.daymap { height: 230px; }

/* day tiles: room for "to Granada" */
.daytile { width: 104px; padding: 8px 10px 10px; }
.daytile .city { font-size: 14px; }

/* boxes after the plan */
.facts.after { margin-top: 26px; }
.legend { margin-top: 18px; }
.daynav button { padding: 14px 18px; font-size: 17px; }
.views button { padding: 10px 14px; font-size: 17px; }

@media (min-width: 640px) {
  .slot { grid-template-columns: 96px 1fr; }
  .daymap { height: 320px; }
}

/* leave-by and off-the-map airports */
.timing .bethere .leave { display: block; margin-top: 4px; font-size: 15px; }
.timing .bethere .leave b { font-size: 16px; }
.timing .bethere .leave small { color: var(--slate); }
.timing .bethere .okline { color: var(--money); font-weight: 700; }
.tag.ok { background: var(--money-soft); color: var(--money); font-weight: 700; }
.offmap { margin: 0; padding: 8px 12px; font-size: 15px; background: var(--paper); border-top: 1px solid var(--rule); }
.rows .x .timing .bethere span.leave { display: block; }

/* ---------- gyms */
.chip.herechip { background: var(--now-soft); color: var(--now); border-color: transparent; font-weight: 700; font-size: 13px; }
.gymmap { height: 240px; }
@media (min-width: 640px) { .gymmap { height: 300px; } }
.gyms { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.gym { display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; }
.gym .pinbadge { width: 24px; height: 24px; margin: 3px 0 0; font-size: 13px; }
.gymbody { min-width: 0; }
.gym h4 { margin: 0; font-size: 19px; line-height: 1.25; }
.gymmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 0; font-size: 15px; }
.chip.unconf { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 700; }
.gdist { color: var(--slate); }
.gkit { margin: 8px 0 0; font-size: 16px; }
.gl { margin: 6px 0 0; font-size: 15px; color: var(--ink); }
.gl b { display: block; font-size: 13px; color: var(--slate); text-transform: uppercase; letter-spacing: .03em; }
.gnote { margin: 8px 0 0; font-size: 15px; color: var(--slate); font-style: italic; }
.glinks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 10px 0 0; font-size: 16px; }
.glinks a.mapsbtn { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 700; background: var(--sky); color: var(--cobalt); }
@media (prefers-color-scheme: dark) { .glinks a.mapsbtn { color: var(--k-flight); } }

/* lounge showers */
.lounge .shower { color: var(--ink); font-weight: 700; }
.lounge .shower.no { color: var(--slate); font-weight: 400; }
.rows .x .lounge span.shower { display: block; color: var(--ink); }
.rows .x .lounge span.shower.no { color: var(--slate); }

/* ---------- stays */
.stays { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.stay { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; }
.stay.here { border: 2px solid var(--now); box-shadow: inset 4px 0 0 var(--now); }
.staycity { margin: 0; font-size: 14px; color: var(--slate); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stay .fold-title { font-size: 24px; line-height: 1.2; }
.stay.done .fold-title { color: var(--slate); }
.stay .booked { margin: 0 0 2px; font-size: 15px; }
.chip.nextchip { background: var(--sky); color: var(--cobalt); border-color: transparent; font-weight: 700; text-transform: none; letter-spacing: 0; }
.staycity .chip { text-transform: none; letter-spacing: 0; font-size: 13px; }
.inout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; }
.inout div { background: var(--sky); border-radius: 10px; padding: 8px 10px; }
.inout span { display: block; font-size: 13px; color: var(--slate); text-transform: uppercase; letter-spacing: .03em; }
.inout b { display: block; font-size: 16px; line-height: 1.35; }
.saddr { margin: 12px 0 0; font-size: 17px; }
.sgood { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--saffron-soft); font-size: 16px; }
.sfacts { margin: 12px 0 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.sfact { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.sfact dt { font-size: 14px; color: var(--slate); font-weight: 700; }
.sfact dd { margin: 0; font-size: 16px; }
.sfact.missing dd { color: var(--slate); font-style: italic; }
.sfact.warn dd { color: var(--warn); font-weight: 700; }
@media (min-width: 640px) { .sfacts { grid-template-columns: 1fr 1fr; column-gap: 24px; } }

/* ---------- photos */
.pstrip { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; scroll-snap-type: x proximity; }
.pstrip .pthumb { flex: 0 0 auto; width: 96px; height: 96px; scroll-snap-align: start; }
.pthumb {
  position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--sky); display: block;
}
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb.vid::after {
  content: "▶"; position: absolute; inset: auto 6px 6px auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; color: #fff; background: rgba(0, 0, 0, 0.6);
}
.pthumb.broken img { visibility: hidden; }
.pthumb.broken::before { content: "📷"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 8px; }
.pgrid .pthumb { aspect-ratio: 1; border-radius: 8px; }
.pday { scroll-margin-top: calc(var(--views-h, 56px) + 10px); }
.pday .pgrid { margin-top: 0; }
.peekpics { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.peekpics img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--sky); display: block; }
.peekmore { font-size: 15px; font-weight: 700; color: var(--slate); padding-left: 4px; }
.pcount, .phelp { color: var(--slate); font-size: 15px; margin: 8px 0 0; }
.addphotos {
  display: inline-block; margin-top: 10px; padding: 9px 16px; border-radius: 999px; text-decoration: none;
  font-weight: 700; background: var(--cobalt); color: #fff;
}
.moments { margin: 18px 0 0; padding: 14px; border: 1.5px solid var(--rule); border-radius: 12px; background: var(--paper); }
.moments h3 { margin: 0; font-size: 18px; }
.ovday:has(.ovcover) { grid-template-columns: 58px 1fr 72px; }
.ovcover { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; align-self: center; }
body.noscroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.94); color: #fff; display: flex; flex-direction: column; }
.lbtop { display: flex; align-items: center; gap: 14px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); font-size: 15px; }
.lbtop span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbtop a { color: #fff; }
.lbtop button { background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; padding: 4px 8px; }
.lbmedia { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 0 max(10px, env(safe-area-inset-bottom)); }
.lbmedia img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lbmedia iframe { width: min(100%, 960px); height: min(100%, 70vh); border: 0; }
.lbnav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 34px; cursor: pointer;
}
.lbnav.prev { left: 8px; }
.lbnav.next { right: 8px; }
.addrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.addrow .addphotos { margin-top: 0; cursor: pointer; }
.folderlink { color: var(--cobalt); font-size: 15px; }
@media (prefers-color-scheme: dark) { .folderlink { color: var(--k-flight); } }
.uppanel {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 1500;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); max-width: 560px; margin: 0 auto;
}
.uppanel .upmsg { flex: 1; font-weight: 700; }
.uppanel small { display: block; font-weight: 400; opacity: 0.85; margin-top: 2px; }
.upbar { width: 90px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.upbar span { display: block; height: 100%; background: var(--saffron); }
.uppanel button { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }

/* ---------- food: Google photos + description, our notes */
.gstrip { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 64px 64px; gap: 4px; margin: 4px 0 2px; border-radius: 10px; overflow: hidden; }
.gstrip .gph { display: block; background: var(--sky); }
.gstrip .gph:first-child { grid-row: span 2; }
.gstrip .gph:nth-child(4) { grid-column: 2 / span 2; }
.gstrip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gstrip:has(.gph:only-child) { grid-template-columns: 1fr; }
.gstrip:has(.gph:nth-child(2):last-child) { grid-template-columns: 2fr 1fr; }
.gcredit { margin: 0 0 6px; font-size: 12px; color: var(--slate); }
.fnotes { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--saffron-soft); font-size: 15px; }
.gsum { margin: 6px 0; font-size: 15px; }
.gattr { font-size: 12px; color: var(--slate); white-space: nowrap; }
.atebody { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.atebody .fnotes, .atebody .gsum { margin: 0; flex: 1; }
.atecover { position: relative; flex: 0 0 96px; height: 72px; border-radius: 8px; overflow: hidden; display: block; }
.atecover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atecover span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 1px 4px; }
.fsum li.ate .pstrip { grid-column: 1 / -1; margin-top: 0; }
.atebody:empty { display: none; }
.pgrid.meal { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin: 4px 0 6px; }
.pmore { position: absolute; right: 6px; top: 6px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.6); }
.ateday.todayate { margin: 6px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--paper); border: 1.5px solid var(--rule); }
.ateday.todayate h4 { font-size: 16px; color: var(--slate); }
.pthumb[hidden] { display: none; }

/* numbered dish photos on a meal: tile n matches "n dish" in that place's Our notes */
.pgrid.dishes { align-items: start; }
.pdish { margin: 0; display: grid; gap: 4px; min-width: 0; }
.pdish .pthumb { width: 100%; }
.pnum { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; color: #fff; background: rgba(0, 0, 0, 0.62); }
.pdish figcaption { font-size: 13px; line-height: 1.25; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dishrest { margin: 2px 0 8px; font-size: 14px; color: var(--ink); }
.dishrest b { color: var(--slate); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin-right: 4px; }
.lbdesc { margin: 0; padding: 8px 16px max(14px, env(safe-area-inset-bottom)); font-size: 15px; line-height: 1.45; color: #eee; max-height: 28vh; overflow: auto; }

/* ---------- folds (Oct 11): the collapsible parts of Travel, Food, Stays, Gyms and Photos.
   Each part's heading holds a real button (aria-expanded) that opens and closes what's under it.
   The whole header is the tap target. The round chevron shows the state: light and pointing down
   while closed, filled and pointing up while open. */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fold-head { position: relative; }
.fold-h { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; }
.fold-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px;
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.fold-btn::after { content: ""; position: absolute; inset: 0; border-radius: 12px; } /* the whole header taps */
.fold-btn:focus-visible { outline: none; }
.fold-btn:focus-visible::after { outline: 3px solid var(--saffron); outline-offset: 2px; }
.fold-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fold-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.fold-title { font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.fold-sub { font-size: 15px; line-height: 1.4; color: var(--slate); font-weight: 400; }
.fold-ic {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--sky); color: var(--cobalt);
}
.fold-ic svg { width: 22px; height: 22px; display: block; }
.fold-btn[aria-expanded="true"] .fold-ic { background: var(--cobalt); color: #fff; }
.fold-btn[aria-expanded="true"] .fold-ic svg { transform: rotate(180deg); }
.fold-btn:active .fold-ic { filter: brightness(0.9); }
@media (hover: hover) { .fold-btn:hover .fold-ic { filter: brightness(0.92); } }
.fold-peek[hidden] { display: none !important; }
.fold-body[hidden]:not([hidden="until-found"]) { display: none !important; }
.fold-body[hidden] { padding: 0 !important; margin: 0 !important; }
@media (prefers-color-scheme: dark) {
  .fold-ic { color: var(--k-flight); }
  .fold-btn[aria-expanded="true"] .fold-ic { background: var(--k-flight); color: var(--wash); }
  @media (hover: hover) { .fold-btn:hover .fold-ic { filter: brightness(1.2); } }
}

/* tile: the header is a card, the content flows below it (Food days, Gyms cities, Photos days) */
.fold-tile { margin: 10px 0; }
.fold-tile.open { margin-bottom: 24px; }
.fold-tile > .fold-head { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 10px 10px 14px; }
.fold-tile.open > .fold-head { margin-bottom: 10px; }
.fold-tile.today > .fold-head, .fold-tile.here > .fold-head { border: 2px solid var(--now); box-shadow: inset 4px 0 0 var(--now); }
@media (hover: hover) { .fold-tile:not(.today):not(.here) > .fold-head:hover { border-color: var(--cobalt); } }

/* box: the whole part is one card, header on top (Stays, Travel journeys) */
.fold-box > .fold-head { padding: 12px 10px 12px 16px; }
.fold-box > .fold-body { padding: 0 16px 16px; }
.fold-box .fold-btn:focus-visible::after { outline-offset: -3px; border-radius: 10px; }

/* line: a full-width row with a rule above (earlier days, earlier journeys, the Archive) */
.fold-line { margin: 16px 0 4px; border-top: 1px solid var(--rule); }
.fold-line > .fold-head { padding: 8px 0; }
.fold-line .fold-title { font-size: 18px; }
.fold-line .fold-ic { width: 32px; height: 32px; }
.fold-line .fold-btn::after { border-radius: 8px; }
.fold-line > .fold-body { padding-bottom: 6px; }

/* mini: a small toggle inside a card ("Why this place", "Skip nearby") */
.fold-mini .fold-btn { min-height: 40px; gap: 8px; }
.fold-mini .fold-text { flex: 0 1 auto; }
.fold-mini .fold-title { font-size: 15px; color: var(--slate); }
.fold-mini .fold-ic { width: 26px; height: 26px; }
.fold-mini .fold-ic svg { width: 17px; height: 17px; }
.fold-mini .fold-btn::after { border-radius: 8px; }
.fold-mini .fold-btn:focus-visible::after { outline-offset: 0; }
.fwhy .fold-title { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }

/* warn: an orange box (Food's book-ahead list) */
.fold-warn { margin: 12px 0 4px; background: var(--warn-soft); border: 1px solid var(--warn); border-left-width: 4px; border-radius: 10px; }
.fold-warn > .fold-head { padding: 6px 8px 6px 12px; }
.fold-warn .fold-title { font-size: 16px; color: var(--warn); }
.fold-warn .fold-ic { width: 32px; height: 32px; background: var(--paper); color: var(--warn); }
.fold-warn .fold-btn[aria-expanded="true"] .fold-ic { background: var(--warn); color: #fff; }
.fold-warn .fold-btn::after { border-radius: 8px; }
.fold-warn .fold-btn:focus-visible::after { outline-offset: -2px; }
.fold-warn > .fold-body { padding: 0 12px 12px; }
@media (prefers-color-scheme: dark) { .fold-warn .fold-btn[aria-expanded="true"] .fold-ic { color: var(--wash); } }

/* "Open all" / "Close all" */
.foldtools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.toolbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px;
  border-radius: 999px; border: 1.5px solid var(--rule); background: var(--paper); color: var(--cobalt);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.toolbtn .tb-ic svg { width: 18px; height: 18px; display: block; }
.toolbtn .tb-ic.up svg { transform: rotate(180deg); }
.toolbtn:active { background: var(--sky); }
@media (hover: hover) { .toolbtn:hover { border-color: var(--cobalt); } }
@media (prefers-color-scheme: dark) { .toolbtn { color: var(--k-flight); } }

/* opening answers the tap with a short slide; nothing moves for people who ask for less motion */
@media (prefers-reduced-motion: no-preference) {
  .fold-ic, .fold-ic svg { transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease; }
  .fold-body.opening { animation: fold-in 0.2s ease-out; }
}
@keyframes fold-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Travel: one row per journey, when on the left, what on the right */
.rows.legs > li.fold { display: block; padding: 0; }
.leg > .fold-head { padding: 12px 10px 12px 14px; }
.leg .fold-text { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.lg-when { display: flex; flex-direction: column; font-size: 15px; line-height: 1.35; color: var(--slate); }
.lg-time { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.lg-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.lg-title .ico { color: var(--kc, var(--cobalt)); width: 18px; height: 18px; }
.lg-detail { font-size: 16px; color: var(--slate); }
.lg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 14px; }
.tag.now { background: var(--now-soft); color: var(--now); font-weight: 700; }
.tag.next { background: var(--sky); color: var(--cobalt); font-weight: 700; }
@media (prefers-color-scheme: dark) { .tag.next { color: var(--k-flight); } }
.leg.done .lg-title, .leg.done .lg-time { color: var(--slate); }
.leg > .fold-body { padding: 0 14px 14px; }
.leg > .fold-body .timing { margin-top: 0; }
@media (min-width: 560px) { .leg > .fold-body { padding-left: calc(14px + 96px + 12px); } }
.legsdone > .fold-body .rows { margin-bottom: 10px; }

/* Food, Gyms and Photos inside their folds */
.fday .fsum { margin-top: 8px; }
.fdhead .fold-title { margin-right: 2px; }
.gymgroup .fold-title { font-size: 22px; }
.gymgroup .mapbox { margin-top: 0; }
/* the "Toronto time" label on the Travel tab kept its light-mode blue in dark mode */
@media (prefers-color-scheme: dark) { .rows .x .timing .hometime .lab { color: var(--k-flight); } }
