/* Holiday Hub — warm paper by day, lamplight by night.
   Phone-first: the family will read this on a sofa, not at a desk. */

:root{
  --bg:#faf7f2; --bg-2:#f2ece2;
  --surface:#ffffff; --surface-2:#f7f3ec; --line:#e4dbcd;
  --ink:#1f1b16; --ink-2:#4a4137; --muted:#7a6e60;
  --accent:#bf4f26; --accent-ink:#ffffff; --accent-soft:#fbeade;
  --sea:#2c6b5e; --sea-soft:#e2efeb;
  --gold:#a8760c;
  --shadow:0 1px 2px rgba(41,31,18,.06), 0 8px 24px rgba(41,31,18,.07);
  --shadow-lg:0 12px 40px rgba(41,31,18,.18);
  --r:14px; --r-sm:9px; --r-lg:20px;
  --tap:44px;
  --ff:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#16130f; --bg-2:#100e0b;
    --surface:#211c16; --surface-2:#2a231c; --line:#3a3128;
    --ink:#f3ece2; --ink-2:#d6cbbc; --muted:#a29585;
    --accent:#f2814f; --accent-ink:#2a1206; --accent-soft:#3a251a;
    --sea:#6fb9a7; --sea-soft:#1e3a34;
    --gold:#e0a63a;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg:0 12px 40px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"]{
  --bg:#16130f; --bg-2:#100e0b;
  --surface:#211c16; --surface-2:#2a231c; --line:#3a3128;
  --ink:#f3ece2; --ink-2:#d6cbbc; --muted:#a29585;
  --accent:#f2814f; --accent-ink:#2a1206; --accent-soft:#3a251a;
  --sea:#6fb9a7; --sea-soft:#1e3a34;
  --gold:#e0a63a;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:0 12px 40px rgba(0,0,0,.55);
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink); font-family:var(--ff);
  font-size:16px; line-height:1.5; -webkit-font-smoothing:antialiased;
  overflow-wrap:anywhere;
}
img{max-width:100%; display:block}
/* A class that sets `display` outranks the browser's own rule for [hidden],
   so .lightbox/.sheet/.gate would stay painted over the app. Make hidden win. */
[hidden]{display:none !important}
button,input,textarea,select{font:inherit; color:inherit}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{margin:0; line-height:1.2; letter-spacing:-.015em}
.muted{color:var(--muted)}
:focus-visible{outline:2.5px solid var(--accent); outline-offset:2px; border-radius:4px}

/* ---------- gate ---------- */
.gate{position:fixed; inset:0; z-index:60; display:grid; place-items:center; padding:24px;
  background:radial-gradient(120% 90% at 50% 0%, var(--bg-2), var(--bg)); overflow:auto}
.gate-card{width:min(420px,100%); background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:28px 24px 22px; box-shadow:var(--shadow-lg); text-align:center}
.gate-mark{width:56px; height:56px; margin:0 auto 14px; border-radius:50%;
  background:var(--accent); color:var(--accent-ink); display:grid; place-items:center; font-size:26px}
.gate-card h1{font-size:26px; margin-bottom:6px}
.gate-card form{text-align:left; margin-top:20px; display:grid; gap:6px}
.gate-card label{font-size:13px; font-weight:650; color:var(--ink-2); margin-top:8px}
.gate-card input{width:100%; padding:12px 14px; min-height:var(--tap);
  border:1.5px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2)}
.gate-card input:focus{border-color:var(--accent); outline:none}
.gate-error{margin:10px 0 0; padding:10px 12px; border-radius:var(--r-sm);
  background:var(--accent-soft); color:var(--accent); font-size:14px; font-weight:600}
.gate-foot{font-size:12.5px; margin:14px 0 0}
.setup-steps{text-align:left; font-size:14.5px; color:var(--ink-2); padding-left:20px; line-height:1.7}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.9em;
  background:var(--surface-2); padding:1px 5px; border-radius:5px; border:1px solid var(--line)}

/* ---------- chrome ---------- */
.topbar{position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:10px;
  padding:10px 14px; padding-top:calc(10px + env(safe-area-inset-top,0px));
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:saturate(1.4) blur(12px); border-bottom:1px solid var(--line)}
.tb-title{flex:1; min-width:0}
.tb-title h1{font-size:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.tb-title p{margin:1px 0 0; font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.tb-btn,.tb-back{min-width:var(--tap); min-height:var(--tap); border:0; background:transparent;
  color:var(--ink-2); font-size:22px; border-radius:var(--r-sm); cursor:pointer}
.tb-btn:hover,.tb-back:hover{background:var(--surface-2)}
.tb-back{font-size:30px; line-height:1; margin-left:-8px}

.view{max-width:760px; margin:0 auto; padding:16px 14px calc(96px + var(--safe-b))}
.view:focus{outline:none}

.tabbar{position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex; gap:2px;
  padding:6px 6px calc(6px + var(--safe-b));
  background:color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter:saturate(1.4) blur(12px); border-top:1px solid var(--line)}
.tab{flex:1 1 0; min-width:0; position:relative; display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:7px 2px; border-radius:var(--r-sm); color:var(--muted);
  font-size:10.5px; font-weight:650; letter-spacing:.01em; text-decoration:none; min-height:var(--tap)}
.tab:hover{text-decoration:none; background:var(--surface-2)}
.tab-i{width:21px; height:21px; display:block}
.tab span:not(.tab-i){max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tab[aria-current="page"]{color:var(--accent); background:var(--accent-soft)}
.tab-dot{position:absolute; top:5px; right:calc(50% - 18px); width:8px; height:8px;
  border-radius:50%; background:var(--accent); border:2px solid var(--bg)}

/* ---------- cards ---------- */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:16px; box-shadow:var(--shadow); margin-bottom:14px}
.card-h{display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:10px}
.card-h h2{font-size:12px; font-weight:750; letter-spacing:.09em; text-transform:uppercase; color:var(--muted)}
.card-lede{font-size:15px; color:var(--ink-2); margin:0}

.hero{background:linear-gradient(160deg,var(--accent) 0%, color-mix(in srgb,var(--accent) 72%, #7a2f12) 100%);
  color:#fff; border:0; padding:22px 18px 20px}
.hero .eyebrow{font-size:11.5px; font-weight:750; letter-spacing:.12em; text-transform:uppercase; opacity:.82}
.hero h2{font-size:30px; margin:6px 0 2px; color:#fff; letter-spacing:-.02em}
.hero .sub{font-size:15px; opacity:.92; margin:0}
.hero .hero-row{display:flex; gap:18px; margin-top:16px; flex-wrap:wrap}
.hero .stat b{display:block; font-size:22px; font-variant-numeric:tabular-nums; line-height:1.1}
.hero .stat span{font-size:11.5px; opacity:.82; text-transform:uppercase; letter-spacing:.07em}
.hero a{color:#fff}

.btn{display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:var(--tap); padding:10px 16px; border:1.5px solid var(--line);
  background:var(--surface); color:var(--ink); border-radius:var(--r-sm);
  font-size:14.5px; font-weight:650; cursor:pointer}
.btn:hover{background:var(--surface-2); text-decoration:none}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn-primary{background:var(--accent); border-color:var(--accent); color:var(--accent-ink)}
.btn-primary:hover{background:color-mix(in srgb,var(--accent) 88%, #000)}
.btn-ghost{background:transparent; border-color:transparent; color:var(--muted); padding:8px 10px; min-height:36px}
.btn-ghost:hover{color:var(--ink); background:var(--surface-2)}
.btn-block{width:100%; margin-top:16px}
.btn-sm{min-height:34px; padding:6px 12px; font-size:13px}
.btn-danger{color:#b3261e; border-color:#e8c6c2}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .btn-danger{color:#ff9b91; border-color:#5a2f2a}}

.row{display:flex; align-items:center; gap:10px}
.wrap{flex-wrap:wrap}
.spacer{flex:1}
.chips{display:flex; gap:7px; flex-wrap:wrap}
.chip{display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px;
  background:var(--surface-2); border:1px solid var(--line); font-size:12.5px; font-weight:650; color:var(--ink-2)}
.chip-sea{background:var(--sea-soft); border-color:transparent; color:var(--sea)}
.chip-now{background:var(--accent); border-color:transparent; color:var(--accent-ink)}

/* ---------- itinerary ---------- */
.stay{margin-bottom:18px}
.stay-h{display:flex; align-items:baseline; gap:9px; margin-bottom:8px; padding:0 2px}
.stay-h h3{font-size:19px}
.stay-h .dates{font-size:12.5px; color:var(--muted); font-weight:650; white-space:nowrap}
.daylist{background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow); overflow:hidden}
.dayrow{display:grid; grid-template-columns:52px 1fr auto; gap:12px; align-items:center;
  padding:12px 14px; border-bottom:1px solid var(--line); color:inherit; text-decoration:none; min-height:var(--tap)}
.dayrow:last-child{border-bottom:0}
.dayrow:hover{background:var(--surface-2); text-decoration:none}
.dayrow.is-today{background:var(--accent-soft)}
.dayrow.is-past .d-date{opacity:.55}
.d-date{text-align:center; line-height:1.05}
.d-date b{display:block; font-size:19px; font-variant-numeric:tabular-nums}
.d-date span{font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted)}
.d-main{min-width:0}
.d-main b{display:block; font-size:15px; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.d-main span{font-size:12.5px; color:var(--muted)}
.d-meta{display:flex; align-items:center; gap:7px; font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums}
.d-meta .pill{background:var(--surface-2); border:1px solid var(--line); border-radius:999px; padding:1px 7px}
.d-meta .pill.hot{background:var(--accent); border-color:transparent; color:var(--accent-ink)}

/* ---------- feed ---------- */
.feed{display:grid; gap:12px}
.post{background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow); overflow:hidden}
.post-h{display:flex; align-items:center; gap:9px; padding:11px 13px 0}
.avatar{width:30px; height:30px; flex:none; border-radius:50%; display:grid; place-items:center;
  font-size:11.5px; font-weight:750; color:#fff; letter-spacing:.02em}
.post-who{font-size:14px; font-weight:700; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.post-when{font-size:12px; color:var(--muted); white-space:nowrap}
.post-body{padding:7px 13px 12px; font-size:15.5px; color:var(--ink-2); white-space:pre-wrap}
.post-body:empty{display:none}
.post-photo{display:block; width:100%; background:var(--surface-2); cursor:zoom-in; border:0; padding:0}
.post-photo img{width:100%; height:auto; display:block}
.post-scope{display:inline-block; margin:0 13px 10px; font-size:11.5px; font-weight:650;
  color:var(--sea); background:var(--sea-soft); padding:2px 9px; border-radius:999px}
.post-f{display:flex; align-items:center; gap:6px; padding:0 9px 9px; flex-wrap:wrap}
.react{display:inline-flex; align-items:center; gap:4px; min-height:32px; padding:3px 10px;
  border-radius:999px; border:1px solid var(--line); background:var(--surface-2);
  font-size:13.5px; cursor:pointer; font-variant-numeric:tabular-nums}
.react:hover{border-color:var(--accent)}
.react.mine{background:var(--accent-soft); border-color:var(--accent); color:var(--accent); font-weight:700}
.react-add{color:var(--muted); font-size:15px; padding:3px 11px}
.post-uploading{opacity:.55}
.post-bar{height:3px; background:var(--accent); width:0; transition:width .25s ease}

/* ---------- composer ---------- */
.composer{position:sticky; bottom:calc(72px + var(--safe-b)); z-index:20; margin-top:14px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-lg); padding:9px}
.composer-row{display:flex; align-items:flex-end; gap:8px}
.composer textarea{flex:1; min-height:42px; max-height:140px; resize:none; padding:10px 12px;
  border:1.5px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2); line-height:1.45}
.composer textarea:focus{border-color:var(--accent); outline:none}
.icon-btn{width:42px; height:42px; flex:none; border:1.5px solid var(--line); border-radius:var(--r-sm);
  background:var(--surface-2); font-size:19px; cursor:pointer; display:grid; place-items:center}
.icon-btn:hover{border-color:var(--accent)}
.icon-btn.send{background:var(--accent); border-color:var(--accent); color:var(--accent-ink)}
.icon-btn:disabled{opacity:.45; cursor:not-allowed}
.queue{display:flex; gap:7px; padding:0 2px 9px; overflow-x:auto}
.queue img{width:56px; height:56px; object-fit:cover; border-radius:var(--r-sm); border:1px solid var(--line)}
.queue-item{position:relative; flex:none}
.queue-x{position:absolute; top:-5px; right:-5px; width:20px; height:20px; border-radius:50%;
  border:0; background:var(--ink); color:var(--bg); font-size:11px; cursor:pointer; line-height:1}

/* ---------- photos ---------- */
.grid{display:grid; grid-template-columns:repeat(3,1fr); gap:4px}
@media (min-width:560px){.grid{grid-template-columns:repeat(4,1fr); gap:6px}}
.grid button{border:0; padding:0; background:var(--surface-2); aspect-ratio:1; cursor:zoom-in;
  border-radius:6px; overflow:hidden}
.grid img{width:100%; height:100%; object-fit:cover}
.photo-group{margin-bottom:18px}
.photo-group h3{font-size:13px; font-weight:750; letter-spacing:.05em; text-transform:uppercase;
  color:var(--muted); margin-bottom:8px}

/* ---------- lightbox ---------- */
.lightbox{position:fixed; inset:0; z-index:70; background:rgba(12,9,6,.96);
  display:grid; place-items:center; padding:12px}
.lightbox img{max-width:100%; max-height:86vh; object-fit:contain; border-radius:6px}
.lb-close,.lb-prev,.lb-next{position:absolute; border:0; background:rgba(255,255,255,.12);
  color:#fff; width:46px; height:46px; border-radius:50%; font-size:24px; cursor:pointer; line-height:1}
.lb-close{top:calc(14px + env(safe-area-inset-top,0px)); right:14px; font-size:18px}
.lb-prev{left:12px} .lb-next{right:12px}
.lb-cap{position:absolute; left:0; right:0; bottom:calc(16px + var(--safe-b)); text-align:center;
  color:rgba(255,255,255,.88); font-size:13.5px; padding:0 60px}

/* ---------- sheet + toasts ---------- */
.sheet{position:fixed; inset:0; z-index:65; background:rgba(12,9,6,.5);
  display:flex; align-items:flex-end; justify-content:center; padding:0}
.sheet-card{width:min(520px,100%); max-height:86vh; overflow:auto; background:var(--surface);
  border-radius:var(--r-lg) var(--r-lg) 0 0; padding:18px 18px calc(18px + var(--safe-b));
  box-shadow:var(--shadow-lg)}
@media (min-width:560px){.sheet{align-items:center; padding:20px}
  .sheet-card{border-radius:var(--r-lg)}}
.sheet-card h2{font-size:19px; margin-bottom:4px}
.sheet-card .field{display:grid; gap:5px; margin:14px 0}
.sheet-card label{font-size:13px; font-weight:650; color:var(--ink-2)}
.sheet-card input,.sheet-card textarea{padding:11px 13px; border:1.5px solid var(--line);
  border-radius:var(--r-sm); background:var(--surface-2); width:100%; min-height:var(--tap)}
.sheet-card textarea{min-height:110px; resize:vertical; font-family:inherit}
.sheet-actions{display:flex; gap:9px; margin-top:16px}
.sheet-actions .btn{flex:1}

.toasts{position:fixed; left:50%; transform:translateX(-50%); z-index:90;
  bottom:calc(86px + var(--safe-b)); display:grid; gap:8px; width:min(420px,calc(100% - 28px))}
.toast{background:var(--ink); color:var(--bg); padding:11px 15px; border-radius:var(--r-sm);
  font-size:14px; font-weight:600; box-shadow:var(--shadow-lg)}
.toast.bad{background:#b3261e; color:#fff}

/* ---------- map ---------- */
/* A trip that crosses the Pacific fits by WIDTH, so a tall box just adds grey
   bands above and below the tiles. Keep it wide and short. */
#map{height:clamp(240px,46vh,420px); border-radius:var(--r); border:1px solid var(--line); overflow:hidden}
.leaflet-container{background:var(--surface-2); font:inherit}
.pin{display:grid; place-items:center; width:26px; height:26px; border-radius:50% 50% 50% 4px;
  transform:rotate(-45deg); background:var(--sea); color:#fff; font-size:11px; font-weight:750;
  border:2px solid var(--surface); box-shadow:var(--shadow)}
.pin span{transform:rotate(45deg)}
.pin.now{background:var(--accent)}

/* ---------- misc ---------- */
.empty{text-align:center; padding:38px 18px; color:var(--muted)}
.empty .big{font-size:34px; margin-bottom:10px; opacity:.5}
.empty p{margin:0 0 4px; font-size:15px}
.skel{background:linear-gradient(90deg,var(--surface-2) 25%,var(--line) 37%,var(--surface-2) 63%);
  background-size:400% 100%; animation:sh 1.3s ease-in-out infinite; border-radius:var(--r); height:74px; margin-bottom:12px}
@keyframes sh{0%{background-position:100% 50%}100%{background-position:0 50%}}
.tbl{width:100%; border-collapse:collapse; font-size:14px}
.tbl th,.tbl td{text-align:left; padding:7px 9px; border-bottom:1px solid var(--line)}
.tbl th{font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted)}
.scroll-x{overflow-x:auto; -webkit-overflow-scrolling:touch}
.errline{font-size:13px; color:var(--muted); padding:3px 0; border-bottom:1px dotted var(--line)}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important; animation-iteration-count:1!important;
    transition-duration:.01ms!important}
}

/* Weather is supporting detail: present when known, never a gap when not. */
.pill.wx{font-variant-numeric:tabular-nums; white-space:nowrap}
.wx-row{display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:10px 12px; background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--r-sm); font-size:14.5px}
