:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #2a2118;
  --muted: #7a6a58;
  --line: #e8dccb;
  --accent: #b8692e;
  --accent-soft: #f6e6d4;
  --nile: #1f6f8b;
  --tbc: #a33b2b;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f;
    --surface: #221c16;
    --ink: #f1e8dc;
    --muted: #b3a491;
    --line: #3a3027;
    --accent: #e3995c;
    --accent-soft: #3a2a1c;
    --nile: #6bb8d4;
    --tbc: #ec8a77;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--nile); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; margin-top: .8em; }
ul, ol { padding-left: 1.2em; margin: .3em 0; }
li { margin: .25em 0; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: .9rem; }

main { max-width: 680px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.view { padding-top: 16px; }
.js .view { display: none; }
.js .view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 10px; }
.mt { margin-top: 32px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.js .bottom-nav { display: flex; }
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; min-height: 56px;
  font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav a.active { color: var(--accent); }

/* Today */
.hero { position: relative; margin: -16px -16px 0; height: 210px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-text {
  position: absolute; inset: auto 0 0 0; padding: 48px 16px 14px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
}
.hero h1 { font-size: 1.6rem; margin: 0; }
.hero-kicker { margin: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.big { font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.next { margin-top: 12px; }
.checklist { list-style: none; padding: 0; }
.checklist li::before { content: "☐ "; color: var(--accent); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.qa {
  display: flex; flex-direction: column; gap: 2px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); min-height: 64px;
}
.qa b { font-size: 1.1rem; color: var(--accent); }
.qa span { font-size: .82rem; color: var(--muted); }

/* Day strip */
.strip {
  position: sticky; top: 0; z-index: 15;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: -16px -16px 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  scroll-snap-type: x proximity;
}
.strip::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center;
  min-width: 48px; padding: 6px 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; line-height: 1.15;
}
.chip small { font-size: .65rem; color: var(--muted); text-transform: uppercase; }
.chip b { font-size: 1.05rem; }
.chip.past { opacity: .5; }
.chip.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active small { color: #fff; }

/* Places grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius); background: var(--accent-soft); text-decoration: none; color: #fff;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.7)); }
.tile-name, .tile-day { position: absolute; left: 10px; right: 10px; z-index: 1; }
.tile-name { bottom: 22px; font-weight: 700; line-height: 1.15; }
.tile-day { bottom: 6px; font-size: .72rem; opacity: .9; }
.noimg { display: grid; place-items: center; height: 100%; font-size: 2.5rem; color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--line)); }

/* Accordions */
.acc { padding: 0; }
.acc summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.acc[open] summary::after { content: "–"; }
.acc > :not(summary) { margin: 0 16px 14px; }
.acc > ul { padding-left: 1.2em; }

/* Schedule */
.week {
  margin: 24px 0 10px; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
}
.day {
  scroll-margin-top: 76px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.day header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.day .num {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 8px; border-radius: 999px;
}
.day time { font-weight: 700; }
.day .where { color: var(--muted); font-size: .9rem; width: 100%; }
.day ul { list-style: none; padding: 0; }
.day ul.sub { list-style: disc; padding-left: 1.2em; color: var(--muted); font-size: .92rem; }
.day .t {
  display: inline-block; min-width: 5.2em;
  font-size: .8rem; font-weight: 700; color: var(--muted);
}
.day .stay {
  margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: .9rem;
}
.day.today { border: 2px solid var(--accent); box-shadow: 0 2px 12px rgba(184,105,46,.18); }
.day.today .num::after { content: " · today"; }
.day.past { opacity: .6; }
.day.highlight { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--accent), #d6a65a) border-box; border: 2px solid transparent; }

a.site { font-weight: 600; text-decoration: none; }
a.site::after { content: " ›"; }

.tbc {
  display: inline-block; font-size: .72rem; font-weight: 700;
  color: var(--tbc); border: 1px solid currentColor;
  border-radius: 6px; padding: 0 5px; vertical-align: middle;
}

.flight {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0 8px;
}
.fl-head { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fl-head .ref { font-weight: 600; font-family: ui-monospace, monospace; font-size: .9rem; }
.fl-route { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; margin-top: 4px; }
.fl-route span:last-child { text-align: right; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card p { margin: .4em 0; }
.btn {
  display: inline-block; margin: 4px 6px 4px 0;
  padding: 8px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: .9rem;
}
.phones { list-style: none; padding: 0; }
.phones a { display: inline-block; min-width: 9.5em; font-weight: 700; text-decoration: none; }
.refs { width: 100%; border-collapse: collapse; font-size: .9rem; }
.refs td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.refs td:first-child { white-space: nowrap; color: var(--muted); }
.refs td:last-child { font-family: ui-monospace, monospace; text-align: right; }
.words { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.words dt { color: var(--muted); }
.words dd { margin: 0; font-style: italic; }

.ideas { padding-left: 1.4em; }
.ideas li { margin-bottom: .7em; }
.dur {
  font-size: .75rem; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}

.foot { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 32px; }

/* Detail sheets */
.sheet {
  display: none;
  position: fixed; inset: 0; z-index: 50;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--bg);
}
.sheet:target { display: block; animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet:target { animation: none; } }
body:has(.sheet:target) { overflow: hidden; }

.sheet-bar {
  position: sticky; top: 0; z-index: 2;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.close { font-weight: 700; text-decoration: none; color: var(--accent); }
.sheet > img { width: 100%; max-height: 42vh; object-fit: cover; }
.sheet-body {
  max-width: 680px; margin: 0 auto;
  padding: 18px 16px calc(40px + env(safe-area-inset-bottom));
}
.sheet-body h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; }
.sheet-body h3 { margin-top: 1.3em; color: var(--accent); }
.sheet-body .lead { font-size: 1.05rem; }
.sheet-body img.inline { border-radius: var(--radius); margin: 14px 0; width: 100%; }
.callout {
  margin-top: 1.4em; padding: 12px 16px;
  border-left: 4px solid var(--nile);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
}
.callout h3 { margin-top: .2em; color: var(--nile); }
#cairo, #contacts { scroll-margin-top: 16px; }
