/* Matches the Cabin Mode guest portal: warm off-white background, white cards,
   forest-green headings, colored icon tiles, system font. */
:root {
  --bg: #F5F3EF;
  --card: #FFFFFF;
  --ink: #2B2B2B;
  --muted: #6E6A64;
  --line: #E7E3DC;
  --primary: #2F4F3E;
  --primary-soft: #E6EDE8;
  --accent: #8B6A4E;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --tile: 52px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
img { max-width: 100%; }
button { font: inherit; color: inherit; }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------- Home header ---------- */
.brandbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brandbar img { height: 54px; width: auto; }
.back-portal {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--primary); text-decoration: none;
  background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 8px 14px;
}
.welcome { font-size: 16px; color: #55524D; margin: 0; }
.cabin-name { font-size: 28px; font-weight: 700; color: var(--primary); margin: 0 0 16px; line-height: 1.2; }
.hero {
  width: 100%; aspect-ratio: 5 / 2; object-fit: cover; display: block;
  border-radius: var(--radius); box-shadow: var(--shadow); background: #dfe5df;
}

/* ---------- Quick info ---------- */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 8px; }
.quick .card { margin: 0; }
.quick-wifi { grid-column: 1 / -1; }
.qi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.qi-value { font-size: 18px; font-weight: 600; margin: 2px 0 0; color: var(--ink); word-break: break-word; }
.wifi-row { display: flex; align-items: center; gap: 12px; }
.wifi-row .grow { flex: 1; min-width: 0; }
.wifi-pair { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin: 0 0 16px;
}
.nav-list { margin-top: 20px; }
.nav-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin: 0 0 16px; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform .12s ease;
}
.nav-card:active { transform: scale(.985); }
.tile {
  flex: none; width: var(--tile); height: var(--tile); border-radius: var(--radius);
  display: grid; place-items: center; color: #fff; background: var(--primary);
}
.tile svg { width: 26px; height: 26px; stroke-width: 1.8; }
.tile.sm { --tile: 40px; border-radius: 10px; }
.tile.sm svg { width: 20px; height: 20px; }
.nav-text { flex: 1; min-width: 0; }
.nav-title { font-size: 17px; font-weight: 600; margin: 0; line-height: 1.3; }
.nav-sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.chev { color: #C9C4BC; flex: none; }
.chev svg { width: 20px; height: 20px; }

/* ---------- Section pages ---------- */
.page-top { display: flex; align-items: center; margin-bottom: 8px; min-height: 40px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--primary); cursor: pointer; margin-left: -8px;
}
.icon-btn svg { width: 22px; height: 22px; }
.page-head { text-align: center; margin: 0 0 20px; }
.page-head .tile { margin: 0 auto 10px; }
.page-head h1 { font-size: 26px; font-weight: 700; color: var(--primary); margin: 0; line-height: 1.2; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 15px; }

.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.sec-title svg { width: 20px; height: 20px; color: var(--primary); }
.big-time { font-size: 30px; font-weight: 700; color: var(--primary); margin: 0; line-height: 1.1; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* Rich text from the guidebook */
.rich { font-size: 15.5px; overflow-wrap: anywhere; }
.rich p { margin: 0 0 10px; }
.rich p:last-child { margin-bottom: 0; }
.rich h3, .rich h4 { color: var(--primary); font-size: 16px; margin: 16px 0 6px; }
.rich ul, .rich ol { padding-left: 20px; margin: 0 0 10px; }
.rich li { margin: 2px 0; }
.rich img { display: block; border-radius: 10px; margin: 10px 0; height: auto; }
.rich strong { font-weight: 600; }

/* Buttons */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 600; text-decoration: none;
  background: var(--primary); color: #fff; flex: 1 1 auto;
}
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; flex: none; }
.copy-btn {
  flex: none; border: 0; background: var(--primary-soft); color: var(--primary);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 40px;
}
.copy-btn svg { width: 16px; height: 16px; }

/* ---------- Cabin manual accordion ---------- */
.search {
  position: relative; margin: 0 0 16px;
}
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius);
  padding: 12px 14px 12px 42px; font-size: 16px; color: var(--ink); outline: none;
}
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.acc { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 12px; overflow: hidden; }
.acc-head {
  display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none;
  padding: 12px 14px; text-align: left; cursor: pointer;
}
.acc-head .nav-title { font-size: 16px; }
.acc-head .chev svg { transition: transform .2s ease; }
.acc.open .acc-head .chev svg { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 16px 16px; }
.acc.open .acc-body { display: block; }
.acc-photo { width: 100%; border-radius: 10px; margin: 0 0 12px; display: block; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---------- Departure checklist ---------- */
.check { list-style: none; padding: 0; margin: 0; }
.check li { border-top: 1px solid var(--line); }
.check li:first-child { border-top: 0; }
.check button {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none;
  padding: 12px 0; text-align: left; cursor: pointer; font-size: 16px;
}
.box {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid #CFC9BF; flex: none;
  display: grid; place-items: center; color: #fff;
}
.box svg { width: 16px; height: 16px; opacity: 0; }
.check .done .box { background: var(--primary); border-color: var(--primary); }
.check .done .box svg { opacity: 1; }
.check .done .lbl { color: var(--muted); text-decoration: line-through; }

/* ---------- Things to do ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg { display: flex; background: #E9E5DE; border-radius: 10px; padding: 3px; margin: 0 0 14px; }
.seg button {
  flex: 1; border: 0; background: none; border-radius: 8px; padding: 8px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.count { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.place {
  display: flex; gap: 12px; align-items: stretch; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; margin: 0 0 12px;
}
.thumb {
  flex: none; width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #E9E5DE;
  display: grid; place-items: center; color: #fff;
}
.thumb svg { width: 28px; height: 28px; }
.place-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.place-name { font-size: 16px; font-weight: 600; margin: 0; line-height: 1.3; }
.place-blurb { font-size: 14px; color: var(--muted); margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.place-meta { font-size: 13px; color: var(--accent); margin: 4px 0 0; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.place-meta svg { width: 14px; height: 14px; }
#map { height: 62vh; min-height: 340px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 0; }
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.pin svg { width: 15px; height: 15px; color: #fff; transform: rotate(45deg); }
.pin.home { width: 38px; height: 38px; }
.pin.home svg { width: 19px; height: 19px; }
.leaflet-popup-content { margin: 10px 12px; font: 14px/1.4 -apple-system, system-ui, sans-serif; }
.leaflet-popup-content b { display: block; font-size: 15px; }
.leaflet-popup-content button { margin-top: 6px; border: 0; background: var(--primary); color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 600; cursor: pointer; }

/* ---------- Bottom sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 20, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet-panel {
  background: var(--bg); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 0 0 calc(24px + env(safe-area-inset-bottom));
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #E9E5DE; }
.sheet-body { padding: 16px; }
.sheet-close {
  position: sticky; top: 10px; float: right; margin: 10px 10px -50px 0; z-index: 2;
  width: 38px; height: 38px; border-radius: 999px; border: 0; background: rgba(255,255,255,.92);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.sheet-close svg { width: 20px; height: 20px; }
.sheet h2 { margin: 0; font-size: 22px; color: var(--primary); line-height: 1.25; }
.tagline { color: var(--muted); margin: 4px 0 0; font-size: 15px; }
.addr { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.addr svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- Destination Doug ---------- */
.dd-hero {
  border-radius: var(--radius); padding: 20px; color: #fff; margin: 0 0 16px;
  background: linear-gradient(135deg, #C25E2D, #8E3B46); box-shadow: var(--shadow);
}
.dd-hero h2 { margin: 0; font-size: 24px; }
.dd-hero p { margin: 6px 0 0; opacity: .92; font-size: 15px; }
.follow { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.follow a {
  flex: 1 1 0; min-width: 90px; text-align: center; text-decoration: none; color: #8E3B46; background: #fff;
  border-radius: 10px; padding: 10px 8px; font-weight: 700; font-size: 14px;
}
.ep-num { font-size: 12px; font-weight: 700; color: #C25E2D; text-transform: uppercase; letter-spacing: .05em; margin: 0; }

/* ---------- Book again ---------- */
.code-card { text-align: center; border: 2px dashed #CFC9BF; background: #FBFAF7; }
.code { font-size: 28px; font-weight: 800; letter-spacing: .08em; color: var(--primary); margin: 4px 0 10px; }

/* ---------- Host + footer ---------- */
.host { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.host img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.host h3 { margin: 0; font-size: 17px; }
.footer { text-align: center; margin-top: 28px; color: var(--muted); font-size: 13px; }
.footer img { height: 34px; width: auto; display: block; margin: 0 auto 6px; }
.footer a { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px;
  font-weight: 600; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Destination Doug episode cards */
.nav-card.ep { align-items: stretch; gap: 14px; padding: 12px; }
.ep-thumb { position: relative; flex: none; width: 92px; height: 132px; border-radius: 10px; overflow: hidden; background: #E9E5DE; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.ep-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
  display: grid; place-items: center;
}
.ep-play svg { width: 18px; height: 18px; fill: #fff; }
.nav-card.ep .nav-text { display: flex; flex-direction: column; justify-content: center; }
.ep-town { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--accent); font-weight: 600; margin: 2px 0 0; }
.ep-town svg { width: 13px; height: 13px; }
.ep-sum { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.ep-watch { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #C25E2D; margin: 6px 0 0; }
.ep-watch svg { width: 14px; height: 14px; }
