/* ============================================================
   TRIPT v2 — Block Workspace
   Design system carried verbatim from v1 public/styles.css.
   Item-era styles (wizard, item modals, map, calendar, ledger)
   are deliberately not carried over.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- v1 design system, unchanged ---- */
  --primary-blue: #3498db;
  --primary-blue-dark: #2980b9;
  --accent-orange: #f39c12;
  --accent-orange-dark: #e67e22;

  --warm-sand: #fdfaf5;
  --cream: #f8f4eb;
  --white: #ffffff;

  --dark-ink: #2c3e50;
  --text-secondary: #5d6d7e;
  --text-muted: #95a5a6;

  --success: #27ae60;
  --warning: #f1c40f;
  --danger: #e74c3c;

  --border-width: 3px;
  --border-color: var(--dark-ink);
  --shadow-retro: 6px 6px 0px 0px var(--dark-ink);
  --shadow-retro-sm: 3px 3px 0px 0px var(--dark-ink);
  --radius-retro: 12px;
  --radius-sm: 6px;
  --radius-pill: 50px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --font-display: 'Bungee', cursive;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --transition-fast: 150ms ease;

  /* ---- new in v2 (README §Design Tokens "not yet variables") ---- */
  --hairline: 1px solid rgba(44, 62, 80, .13);
  --hairline-divider: 1px solid rgba(44, 62, 80, .07);
  --card-shadow: 0 1px 2px rgba(44, 62, 80, .05);
  --input-border: 2px solid rgba(44, 62, 80, .18);
  --head-fill: #fbfaf7;
  --chip-bg: #f4f2ee;
  --chip-fg: #5d6d7e;
  --scrim: rgba(20, 26, 32, .45);

  /* tag tints */
  --tint-green-bg: #e7f6ed;  --tint-green-fg: #1e7a45;
  --tint-red-bg:   #fdeae8;  --tint-red-fg:   #b8352a;
  --tint-amber-bg: #fdf1dd;  --tint-amber-fg: #9a6206;
  --tint-blue-bg:  #e8f2fb;  --tint-blue-fg:  #1f6ea8;
  --tint-neutral-bg: #eceef0; --tint-neutral-fg: #5d6d7e;

  --nav-h: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--warm-sand);
  color: var(--dark-ink);
  font-family: var(--font-body);
  /* NO overscroll-behavior here: none/contain on the root is what kills
     Chrome Android's pull-to-refresh. Sheets contain their own overscroll. */
}

body { display: flex; justify-content: center; }

/* Designed at 390px; scales up by centering one 640px column (v3 §4).
   The DOCUMENT scrolls, not an inner container — an inner scroller puts the
   scrollbar against the column edge, which reads as a panel rather than a page.
   The nav is pinned with position:fixed instead. */
#app {
  width: 100%;
  max-width: 640px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--warm-sand);
  /* `clip`, not `hidden`. Both stop sideways overflow, but `hidden` makes
     overflow-y compute to `auto`, which turns this into a scroll container and
     silently breaks `position: sticky` for everything inside it — the app bar
     scrolled away with the page while still computing to `position: sticky`.
     `clip` creates no scroll container, so sticky works against the viewport. */
  overflow-x: clip;
  /* Hairline column edges against the same page colour, so white content does
     not just fade into off-white with no boundary. */
  border-left: 1px solid rgba(44, 62, 80, .1);
  border-right: 1px solid rgba(44, 62, 80, .1);
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary-blue); outline-offset: 2px;
}

.scroll {
  flex: 1;
  /* Room for the fixed nav so the last block is never trapped under it. */
  padding-bottom: var(--nav-h);
}
/* No nav on the pre-trip screens — reserving its space there paints a blank
   strip below the door/login and forces a scroll on phones. */
body:has(#nav.hidden) .scroll { padding-bottom: 0; }

/* ============================================================
   Retro button — header actions, sheet save, RSVP
   ============================================================ */
.btn-retro {
  /* Spec gives padding 10px 0 + 13.5px text = 40px. The stated hard constraint
     is >=44px, so add a floor without changing the specified padding or font. */
  min-height: 44px;
  border: 2.5px solid var(--dark-ink);
  border-radius: 10px;
  padding: 10px 0;
  background: var(--white);
  color: var(--dark-ink);
  box-shadow: var(--shadow-retro-sm);
  font: 700 13.5px var(--font-body);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn-retro:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--dark-ink); }
.btn-retro.primary { background: var(--primary-blue); color: #fff; }
.btn-retro.go { background: var(--success); color: #fff; }
.btn-retro.warn { background: var(--accent-orange); color: var(--dark-ink); }
.btn-retro.ink { background: var(--dark-ink); color: var(--warm-sand); }
.btn-retro.danger { background: var(--danger); color: #fff; }
.btn-retro[disabled] { opacity: .5; pointer-events: none; }

/* ============================================================
   Cover + trip header
   ============================================================ */
.cover {
  height: 128px;
  border-bottom: 3px solid var(--dark-ink);
  background: repeating-linear-gradient(135deg, #f2e8d7 0 11px, #e9dcc4 11px 22px);
  background-size: cover;
  background-position: center;
  position: relative;
  flex: none;
}
.cover-caption {
  position: absolute; left: 10px; bottom: 8px;
  font: 400 10.5px ui-monospace, monospace;
  color: #a8977a;
}
/* The cover is a <button> for an organizer and a <div> for everyone else, so
   the button reset has to be undone here — width, alignment and font all leak
   in otherwise, and the striped fallback loses its edges. */
button.cover {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cover-edit,
.cover-busy {
  position: absolute; right: 10px; top: 8px;
  background: var(--white);
  color: var(--dark-ink);
  border: 2px solid var(--dark-ink);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font: 700 10px var(--font-body);
}
.cover-busy { background: var(--accent-orange); }

.cover-tag {
  position: absolute; right: 10px; bottom: 8px;
  background: var(--accent-orange);
  color: var(--dark-ink);
  border: 2px solid var(--dark-ink);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font: 700 10px var(--font-body);
}

.trip-header {
  padding: 14px 14px 13px;
  background: var(--white);
  border-bottom: var(--hairline);
  flex: none;
}
.trip-title {
  margin: 0 0 9px;
  font: 400 21px/1.18 var(--font-display);
  color: var(--dark-ink);
  text-transform: uppercase;
}
.meta-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-pill {
  font: 600 11.5px var(--font-body);
  background: var(--cream);
  border: 1.5px solid rgba(44, 62, 80, .18);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: var(--dark-ink);
}
.trip-meta-line {
  font: 500 12.5px var(--font-body);
  color: var(--text-secondary);
  margin-top: 8px;
}
.trip-actions { display: flex; gap: 8px; margin-top: 13px; }
.trip-actions .btn-retro { flex: 1; }
.trip-actions .btn-icon { flex: none; width: 48px; }

/* Guest */
.guest-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--dark-ink);
  color: var(--warm-sand);
  font: 500 11.5px var(--font-body);
  flex: none;
}
.guest-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-orange); flex: none; }
.guest-token { margin-left: auto; font: 400 10.5px ui-monospace, monospace; opacity: .6; }
.rsvp-label {
  font: 700 10.5px var(--font-body);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 13px;
}
.rsvp-row { display: flex; gap: 8px; margin-top: 7px; }
.rsvp-row .btn-retro { flex: 1; }

/* ============================================================
   Block list
   ============================================================ */
.block-list {
  padding: 12px 12px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--warm-sand);
}

.block {
  background: var(--white);
  overflow: hidden;
  border: var(--hairline);
  border-radius: var(--radius-retro);
  box-shadow: var(--card-shadow);
}

.block-head {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 12px;
  background: var(--head-fill);
}
.block-title {
  font: 700 11px var(--font-heading);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.block-type {
  font: 500 9.5px ui-monospace, monospace;
  color: #b6bcc1;
  flex: none;
}
/* Reset the ··· button only. A blanket `.block-head button` reset (0,1,1)
   outranks .order-toggle/.comment-pill (0,1,0) and already ate their padding
   once and their border/background twice — the "⇅ order" pill was rendering
   as bare text. Scope resets to the element that wants them. */
.block-head .block-dots { background: none; border: none; }
/* Small header controls: the spec draws them as compact pills, so keep the drawn
   size but give them a 32px hit box — the same floor the spec uses for + Me and
   the reorder nudges. */
/* 40px — the block-header tier (BRAND_AND_FRONT_DOOR.md §7), matching .blk-act
   beside it. `.comment-pill` and `.block-dots` used to be listed here too; both
   were replaced by .blk-act and neither is rendered any more. */
.block-head .order-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.head-pill {
  font: 700 9.5px var(--font-body);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  border: none;
}
.head-pill.open { background: var(--tint-red-bg); color: var(--tint-red-fg); }
.head-pill.decided { background: var(--tint-green-bg); color: var(--tint-green-fg); }
.order-toggle {
  font: 600 10.5px var(--font-body);
  border: 1.5px solid rgba(44, 62, 80, .2);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  background: transparent;
  color: var(--text-secondary);
}
.order-toggle.active { background: var(--dark-ink); color: var(--warm-sand); border-color: var(--dark-ink); }
.comment-pill {
  font: 600 11px var(--font-body);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: var(--chip-bg);
  color: var(--chip-fg);
}
.block-dots { font-size: 15px; color: var(--text-muted); padding: 0 6px; line-height: 1; }

.note-strip {
  background: var(--tint-amber-bg);
  padding: 7px 12px;
  font: 400 11px/1.4 var(--font-body);
  color: var(--dark-ink);
}
.note-strip b { font: 700 10px var(--font-body); color: var(--tint-amber-fg); margin-right: 6px; }

/* ---- text ---- */
.blk-text { padding: 12px; }
.blk-text p { margin: 0; font: 400 14px/1.55 var(--font-body); color: var(--dark-ink); text-wrap: pretty; }
/* Paragraphs are real paragraphs now that the renderer keeps the breaks. The
   gap is what makes a long logistics note scannable rather than a wall — the
   first one gets no top margin so the block does not gain padding it had. */
.blk-text p + p { margin-top: 10px; }
.blk-text p.emphasis { font-weight: 700; margin-top: 8px; }

/* ---- cards ---- */
.card-row { display: flex; border-top: var(--hairline-divider); }
.card-row:first-child { border-top: none; }
.card-main {
  flex: 1; min-width: 0;
  padding: 11px 12px;
  background: none; border: none;
  text-align: left;
  display: flex; flex-direction: column; gap: 4px;
}
.card-main:hover { filter: brightness(.985); }
.card-title-row { display: flex; align-items: flex-start; gap: 7px; }
.card-title {
  font: 600 14px/1.3 var(--font-body);
  color: var(--dark-ink);
  flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tag {
  font: 700 10.5px var(--font-body);
  border-radius: var(--radius-pill);
  padding: 3.5px 9px;
  flex: none;
  background: var(--tint-neutral-bg); color: var(--tint-neutral-fg);
}
.tag.green   { background: var(--tint-green-bg);   color: var(--tint-green-fg); }
.tag.red     { background: var(--tint-red-bg);     color: var(--tint-red-fg); }
.tag.amber   { background: var(--tint-amber-bg);   color: var(--tint-amber-fg); }
.tag.blue    { background: var(--tint-blue-bg);    color: var(--tint-blue-fg); }
.tag.neutral { background: var(--tint-neutral-bg); color: var(--tint-neutral-fg); }

.card-meta {
  font: 500 12.3px var(--font-body);
  color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-notes {
  font: 400 12.3px/1.45 var(--font-body);
  color: var(--text-muted);
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-notes.expanded { -webkit-line-clamp: 99; }
.more-toggle {
  font: 700 11.5px var(--font-body);
  color: var(--primary-blue-dark);
  background: none; border: none; padding: 2px 0; text-align: left;
}
.card-link {
  font: 400 11.2px ui-monospace, monospace;
  color: var(--primary-blue-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-side {
  flex: none; width: 62px;
  border: none; border-left: var(--hairline-divider);
  background: none;
  font: 700 11.5px var(--font-body);
  color: var(--text-secondary);
}
.card-side.leave { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.card-side.full  { background: var(--chip-bg); color: var(--text-muted); pointer-events: none; }

.claim-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 2px; }
.cap-pill {
  font: 700 10.5px var(--font-body);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: var(--chip-bg); color: var(--chip-fg);
}
.cap-pill.some { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.cap-pill.full { background: var(--tint-red-bg);  color: var(--tint-red-fg); }
.claimer {
  font: 500 11.2px var(--font-body);
  border-radius: 5px; padding: 3px 7px;
  background: var(--chip-bg); color: var(--chip-fg);
}
.claimer.me { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }

.vote-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.vote-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(44, 62, 80, .09); overflow: hidden; }
.vote-fill { height: 100%; border-radius: 3px; background: var(--primary-blue); transition: width 260ms ease; }
.vote-fill.mine { background: var(--tint-blue-fg); }
.vote-fill.closed { background: var(--text-muted); }
.vote-count { font: 700 11px var(--font-body); color: var(--text-secondary); min-width: 14px; text-align: right; }

.block-foot {
  width: 100%;
  border: none; border-top: 1px dashed rgba(44, 62, 80, .2);
  background: var(--head-fill);
  font: 600 12.5px var(--font-body);
  color: var(--text-secondary);
  padding: 10px 12px;
  text-align: center;
}
.outcome-banner {
  background: var(--tint-green-bg);
  padding: 10px 12px;
  font: 600 12.6px/1.4 var(--font-body);
  color: var(--tint-green-fg);
  display: flex; gap: 7px; align-items: flex-start;
}
/* Its counterpart: something went wrong but nothing is lost. */
.sheet-warn {
  background: var(--tint-red-bg);
  color: var(--tint-red-fg);
  padding: 10px 12px;
  margin-top: 10px;
  font: 400 12.6px/1.5 var(--font-body);
}
.sheet-warn strong { font-weight: 700; }

/* ---- groups (schedule + checklist) ---- */
.group-head {
  display: flex; align-items: center;
  padding: 7px 12px;
  background: var(--head-fill);
  font: 700 10.5px ui-monospace, monospace;
  letter-spacing: .06em;
  color: var(--text-secondary);
}
.group-head.noday { background: var(--tint-amber-bg); color: var(--tint-amber-fg); }
.group-count { margin-left: auto; font: 500 10px ui-monospace, monospace; color: #b6bcc1; }

/* ---- schedule ---- */
/* Fixed time column, not a chip that sizes to its text. "time TBD" measures
   60px against 44-47px for a real time, so a flex layout shunted every
   blank-time row's title 16px to the right. The column keeps titles aligned
   without truncating free text - a long value ("after the tunnel") wraps
   inside its column instead of pushing the title out. */
.sch-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border-top: var(--hairline-divider);
}
.group-head + .sch-row { border-top: none; }
.time-chip {
  justify-self: start;
  font: 600 10.5px var(--font-body);
  border-radius: 5px; padding: 3px 7px;
  background: var(--chip-bg); color: var(--chip-fg);
  max-width: 100%;
  overflow-wrap: break-word;
}
.time-chip.tbd { background: var(--tint-amber-bg); color: var(--tint-amber-fg); }
.sch-main { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 3px; text-align: left; background: none; border: none; padding: 0; }
.sch-title { font: 600 13.8px/1.3 var(--font-body); color: var(--dark-ink); }
.sch-note { font: 400 12.3px/1.45 var(--font-body); color: var(--text-muted); }

/* ---- checklist ---- */
.chk-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-top: var(--hairline-divider); }
.group-head + .chk-row { border-top: none; }
.chk-box {
  flex: none; width: 24px; height: 24px;
  border: 2px solid rgba(44, 62, 80, .28);
  border-radius: 7px;
  background: var(--white);
  display: grid; place-items: center;
  font: 700 13px var(--font-body);
  color: transparent;
  padding: 0;
}
.chk-box[aria-checked="true"] { background: var(--success); border-color: var(--success); color: #fff; }
.chk-main { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 4px; text-align: left; background: none; border: none; padding: 0; }
.chk-label { font: 500 13.8px/1.35 var(--font-body); color: var(--dark-ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.chk-row[data-done="true"] .chk-label { color: var(--text-muted); text-decoration: line-through; }
.chk-label .tag { font-size: 10px; }
.chk-meta { font: 400 11.8px var(--font-body); color: var(--text-muted); }
.owner-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.owner-chip {
  font: 700 10.5px var(--font-body);
  border-radius: var(--radius-pill); padding: 3px 8px;
  background: #f1ede4; color: var(--text-secondary);
}
.owner-chip.me { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.me-btn {
  flex: none; min-height: 34px;
  border: 1.5px solid var(--primary-blue);
  border-radius: var(--radius-pill);
  background: var(--tint-blue-bg);
  color: var(--tint-blue-fg);
  font: 700 11px var(--font-body);
  padding: 0 11px;
}

/* ---- people ---- */
.col-strip {
  padding: 7px 12px;
  background: var(--head-fill);
  font: 600 9.5px ui-monospace, monospace;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.person-row {
  width: 100%; text-align: left;
  padding: 9px 12px;
  border: none; border-top: var(--hairline-divider);
  background: var(--white);
  display: flex; flex-direction: column; gap: 5px;
}
.col-strip + .person-row { border-top: none; }
.person-row.me { background: #f3f8fd; }
.person-name { font: 600 13.6px var(--font-body); color: var(--dark-ink); display: flex; align-items: center; gap: 7px; }
.edit-pill {
  font: 700 10px var(--font-body);
  background: var(--tint-blue-bg); color: var(--tint-blue-fg);
  border-radius: var(--radius-pill); padding: 2px 8px;
}
.answer-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.answer {
  font: 500 11.2px var(--font-body);
  border-radius: 5px; padding: 3px 7px;
  background: var(--chip-bg); color: var(--chip-fg);
}
/* An unanswered question is a visible state, not an empty cell — the single
   most valuable thing on the page for the organizer. */
.answer.unanswered { background: var(--tint-amber-bg); color: var(--tint-amber-fg); }

.foot-note {
  padding: 8px 12px 10px;
  font: 400 11px/1.45 var(--font-body);
  color: var(--text-muted);
  background: var(--white);
}

/* ============================================================
   Reorder mode
   ============================================================ */
.reorder-banner {
  padding: 7px 12px;
  background: #f3f8fd;
  font: 500 11px/1.4 var(--font-body);
  color: var(--tint-blue-fg);
  display: flex; align-items: center; gap: 8px;
}
.reorder-banner b { font-weight: 700; }
.sort-time-btn {
  margin-left: auto; flex: none;
  font: 700 10.5px var(--font-body);
  border: 1.5px solid rgba(44, 62, 80, .2);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--text-secondary);
  padding: 4px 10px;
}
.drag-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border-top: var(--hairline-divider);
  touch-action: none;
  background: var(--white);
}
.drag-row.dragging { background: var(--tint-blue-bg); }
.drag-handle {
  flex: none; width: 36px; height: 36px;
  border-radius: 9px; background: #f1ede4;
  border: none;
  display: grid; place-items: center;
  cursor: grab; touch-action: none;
  font-size: 14px; color: var(--text-secondary);
}
.drag-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.drag-label span:first-child {
  font: 600 13.4px/1.3 var(--font-body); color: var(--dark-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drag-sub { font: 500 10.5px ui-monospace, monospace; color: var(--text-muted); }
.drag-nudge {
  flex: none; width: 32px; height: 32px;
  border: 1.5px solid rgba(44, 62, 80, .18);
  border-radius: 8px; background: var(--white);
  color: var(--text-secondary); font-size: 13px;
  display: grid; place-items: center;
}

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  border: 2px dashed rgba(44, 62, 80, .22);
  border-radius: var(--radius-retro);
  padding: 16px;
  display: flex; flex-direction: column; gap: 9px;
}
.empty-state h3 { margin: 0; font: 700 13.5px var(--font-body); color: var(--dark-ink); }
.empty-state p { margin: 0; font: 400 12.5px/1.5 var(--font-body); color: var(--text-secondary); }
.add-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 3px; }
.add-chip {
  min-height: 42px;
  border: 2px solid rgba(44, 62, 80, .16);
  border-radius: var(--radius-pill);
  background: var(--head-fill);
  font: 600 12.5px var(--font-body);
  color: var(--dark-ink);
  padding: 0 14px;
}

/* ============================================================
   Bottom nav
   ============================================================ */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  z-index: 6;
  width: 100%; max-width: 640px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(44, 62, 80, .14);
  border-left: 1px solid rgba(44, 62, 80, .1);
  border-right: 1px solid rgba(44, 62, 80, .1);
  background: var(--white);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav button {
  flex: 1; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-muted); position: relative;
}
.nav button.active { color: var(--primary-blue-dark); }
.nav-glyph { display: grid; place-items: center; line-height: 1; }
.nav-glyph .icon { display: block; }
.nav-label { font: 700 9.5px var(--font-body); letter-spacing: .07em; }
.nav-dot {
  position: absolute; top: 8px; left: calc(50% + 8px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
}

/* ============================================================
   Sheets
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: var(--scrim);
  animation: fadeIn 160ms ease;
}
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 41;
  width: 100%; max-width: 560px;
  transform: translateX(-50%);
  background: var(--warm-sand);
  border-top: 3px solid var(--dark-ink);
  border-radius: 20px 20px 0 0;
  max-height: 86%;
  display: flex; flex-direction: column;
  animation: sheetUp 220ms cubic-bezier(.2, .8, .25, 1);
}
@keyframes sheetUp { from { transform: translate(-50%, 102%); } to { transform: translate(-50%, 0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .scrim { animation: none; }
  .vote-fill { transition: none; }
}
.grabber { width: 38px; height: 4px; border-radius: 99px; background: rgba(44, 62, 80, .22); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex: none; }
.sheet-title { margin: 0; flex: 1; font: 700 15px var(--font-heading); color: var(--dark-ink); }
.sheet-close {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--chip-bg); color: var(--text-secondary);
  display: grid; place-items: center; font-size: 13px;
}
.sheet-body { padding: 0 16px 16px; overflow-y: auto; overscroll-behavior-y: contain; display: flex; flex-direction: column; gap: 14px; }
/* The body is a height-constrained flex column, so its children default to
   flex-shrink:1 and get SQUASHED once the content is taller than the sheet —
   silently, and worst on exactly the sheets with the most in them. It cost the
   Share sheet its Send it button on any trip with a few invites: the card was
   compressed from 242px to 179px and its own overflow:hidden clipped the
   button off. A scrolling column should scroll, not compress. */
.sheet-body > * { flex: none; }
.sheet-foot { flex: none; padding: 14px 16px; border-top: 1px solid rgba(44, 62, 80, .1); }
.sheet-foot .btn-retro { width: 100%; }
.sheet-intro { font: 400 12.5px/1.55 var(--font-body); color: var(--text-secondary); margin: 0; }
.sheet-hint { font: 400 11.5px/1.45 var(--font-body); color: var(--text-muted); margin: 0; }

.field { display: flex; flex-direction: column; }
.field > label {
  font: 700 10.5px var(--font-body);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input, .field textarea {
  border: var(--input-border);
  border-radius: 10px;
  background: var(--white);
  padding: 12px;
  font: 400 16px var(--font-body);   /* 16px minimum — smaller zooms iOS on focus */
  color: var(--dark-ink);
  min-height: 46px;
  width: 100%;
}
.field textarea { line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary-blue); outline: none; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.suggestion {
  min-height: 34px;
  border: 1.5px dashed rgba(44, 62, 80, .22);
  border-radius: var(--radius-pill);
  background: none;
  font: 500 12px var(--font-body);
  color: var(--text-secondary);
  padding: 0 12px;
}

.toggle-row {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid rgba(44, 62, 80, .14);
  border-radius: 11px;
  padding: 12px;
  min-height: 56px;
  background: var(--white);
}
/* flex column, not bare inline spans — otherwise the title runs straight into
   the description (same bug the Add-a-block rows had) */
.toggle-row .t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.toggle-row .t-title { font: 600 13.5px var(--font-body); color: var(--dark-ink); }
.toggle-row .t-desc { font: 400 11.5px/1.4 var(--font-body); color: var(--text-muted); }
.track {
  flex: none; width: 46px; height: 27px; border-radius: var(--radius-pill);
  background: rgba(44, 62, 80, .22);
  border: none; padding: 3px;
  display: flex; justify-content: flex-start; align-items: center;
  transition: background 160ms ease;
}
.track[aria-checked="true"] { background: var(--success); justify-content: flex-end; }
.knob { width: 21px; height: 21px; border-radius: 50%; background: #fff; }

.kind-row {
  display: flex; align-items: center; gap: 11px;
  border: 2px solid rgba(44, 62, 80, .14);
  border-radius: 11px; padding: 12px;
  background: var(--white); width: 100%; text-align: left;
}
.kind-row[disabled] { opacity: .55; cursor: not-allowed; }
.kind-glyph {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  background: var(--chip-bg); display: grid; place-items: center; font-size: 15px;
}
.kind-main { flex: 1; min-width: 0; }
/* block, not inline — inline spans run "Text box" straight into its description */
.kind-title { display: block; font: 700 13.5px var(--font-body); color: var(--dark-ink); }
.kind-desc { display: block; font: 400 11.5px/1.35 var(--font-body); color: var(--text-muted); margin-top: 1px; }
.kind-pill {
  flex: none; font: 700 9.5px var(--font-body);
  border-radius: var(--radius-pill); padding: 3px 8px;
  background: var(--tint-green-bg); color: var(--tint-green-fg);
}
.kind-pill.soon { background: var(--chip-bg); color: var(--text-muted); }

.token-card {
  font: 400 13px ui-monospace, monospace;
  word-break: break-all;
  background: var(--white);
  border: var(--input-border);
  border-radius: 10px;
  padding: 12px;
  color: var(--dark-ink);
}
.token-card.fresh { color: var(--tint-green-fg); border-color: var(--success); }

/* ---- Share sheet (SHARE_SHEET.md) ----
   Two groups and a quiet footer. One bordered card carries the primary act;
   the email invite is a labelled section, not a card; destructive and
   secondary actions are unboxed text below a hairline. What this replaced was
   six boxes at identical weight separated by three all-caps dividers doing the
   structural work layout should do. */

.link-card {
  background: var(--white);
  border: 2.5px solid var(--dark-ink);
  border-radius: 13px;
  box-shadow: 3px 3px 0 0 var(--dark-ink);
  overflow: hidden;
}

/* Mode is a property of the LINK, not a third way to share — so it is a
   segmented control inside the card rather than another box below it. */
.mode-seg { display: flex; gap: 2px; padding: 8px 8px 0; }
.mode-btn {
  flex: 1; min-height: 44px;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  border: none; border-radius: 8px; padding: 5px 8px;
  background: transparent; cursor: pointer; text-align: center;
}
.mode-label { font: 700 11.5px var(--font-body); color: var(--text-secondary); }
/* NOT a lighter grey. #b6bcc1 and #78838d were both tried and fail contrast
   at 10px — the sub-label is the half that says what the mode actually does. */
.mode-sub { font: 400 10px var(--font-body); color: var(--text-secondary); }
.mode-btn.on { background: var(--dark-ink); }
.mode-btn.on .mode-label { color: var(--warm-sand); }
.mode-btn.on .mode-sub { color: rgba(253, 250, 245, .72); }

.mode-note {
  margin: 0; padding: 10px 12px 0;
  font: 400 11.5px/1.45 var(--font-body); color: var(--text-muted);
  text-wrap: pretty;
}

.token-row {
  display: flex; align-items: center; gap: 8px;
  margin: 9px 12px 0; padding: 9px 10px;
  background: var(--warm-sand-deep, #f8f4eb);
  border: 1.5px solid rgba(44, 62, 80, .14);
  border-radius: 9px;
}
/* Single-line ellipsis, never word-break: a wrapped token looks broken. */
.token-text {
  flex: 1; min-width: 0;
  font: 500 12.2px ui-monospace, monospace; color: var(--dark-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.token-copy {
  flex: none; height: 36px; padding: 0 12px;
  border: 1.5px solid var(--dark-ink); border-radius: 7px;
  background: var(--white); color: var(--dark-ink);
  font: 700 11.5px var(--font-body); cursor: pointer;
}
.token-copy.done {
  background: var(--tint-green-bg); color: var(--tint-green-fg);
  border-color: var(--tint-green-fg);
}

.send-it {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: calc(100% - 24px); height: 48px; margin: 10px 12px 12px;
  border: 2px solid var(--dark-ink); border-radius: 10px;
  background: var(--primary-blue); color: #fff;
  font: 700 13.5px var(--font-body); cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--dark-ink);
}
.send-it:active { transform: translate(2px, 2px); box-shadow: none; }
.send-it svg { transform: translateY(-1px); }

/* A labelled section, not a card — the weight difference is the structure. */
.sec-label {
  display: flex; align-items: center; gap: 9px;
  margin: 18px 0 9px;
  font: 700 10.5px var(--font-body); letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-muted);
}
.sec-label i { flex: 1; height: 1px; background: rgba(44, 62, 80, .1); }

.inv-send { display: flex; gap: 7px; }
.inv-send input {
  flex: 1; min-width: 0; height: 46px;
  border: 2px solid rgba(44, 62, 80, .18); border-radius: 9px;
  padding: 0 12px;
  /* 16px minimum or iOS zooms the page on focus. */
  font: 400 16px var(--font-body); color: var(--dark-ink);
  background: var(--white);
}
.inv-send input:focus { border-color: var(--primary-blue); outline: none; }
.inv-send-btn {
  flex: none; height: 46px; padding: 0 16px;
  border: 2px solid var(--dark-ink); border-radius: 9px;
  background: var(--white); color: var(--dark-ink);
  font: 700 12.5px var(--font-body); cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--dark-ink);
}
.inv-send-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.inv-send-btn[disabled] { opacity: .5; box-shadow: none; }
.inv-note {
  margin: 8px 0 0;
  font: 400 11.5px/1.45 var(--font-body); color: var(--text-muted);
  text-wrap: pretty;
}

/* Collapsed by default. Fifteen outstanding invites is normal, and as chips
   that wrapped to six rows of full addresses. */
.inv-box {
  margin-top: 12px;
  border: 1.5px solid rgba(44, 62, 80, .14); border-radius: 11px;
  overflow: hidden;
}
.inv-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 42px; padding: 0 12px;
  border: none; background: #fbfaf7; cursor: pointer;
}
.inv-summary { flex: 1; min-width: 0; text-align: left;
  font: 600 12.2px var(--font-body); color: var(--dark-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-toggle { flex: none; font: 700 10.5px var(--font-body); color: #2980b9; letter-spacing: .04em; }

/* ≈4.3 rows, so the scroll is obvious rather than a hidden sixteenth row. */
.inv-list { max-height: 184px; overflow-y: auto; border-top: 1.5px solid rgba(44, 62, 80, .1); }
.inv-row {
  display: flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 8px 0 12px;
  background: var(--white);
  border-bottom: 1px solid rgba(44, 62, 80, .07);
}
.inv-row:last-child { border-bottom: none; }
.inv-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgba(44, 62, 80, .16); }
.inv-dot.in { background: #27ae60; }
.inv-email {
  flex: 1; min-width: 0;
  font: 400 12.5px var(--font-body); color: var(--dark-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-status { flex: none; font: 500 10.5px var(--font-body); color: var(--text-muted); }
/* #5d6d7e, NOT #b6bcc1: at #b6bcc1 this measures 1.92:1 against white —
   effectively invisible — and hover does not exist on a phone. With fifteen
   rows it is the only way to prune the list. */
.inv-x {
  flex: none; width: 34px; height: 34px; padding: 0;
  border: none; border-radius: 8px; background: none; cursor: pointer;
  font: 700 14px var(--font-body); color: var(--text-secondary); line-height: 1;
}
.inv-x:hover { background: var(--tint-red-bg); color: #c0392b; }
.inv-nudge {
  display: block; width: 100%; height: 42px;
  border: none; border-top: 1px solid rgba(44, 62, 80, .07);
  background: var(--white); cursor: pointer;
  font: 700 11.5px var(--font-body); color: #2980b9;
}
.inv-nudge[disabled] { color: var(--text-muted); cursor: default; }

/* Revoke used to be a full-bordered red button, which gave a destructive,
   rarely-used action the same weight as Send it. Quiet text now — still
   findable, no longer competing. */
.share-foot {
  margin-top: 18px; padding-top: 12px;
  border-top: 1px solid rgba(44, 62, 80, .1);
  display: flex; flex-direction: column; align-items: flex-start;
}
.foot-link {
  height: 40px; padding: 0; border: none; background: none; cursor: pointer;
  font: 700 12.5px var(--font-body); color: #2980b9;
}
.foot-danger {
  height: 36px; padding: 0; border: none; background: none; cursor: pointer;
  font: 600 12px var(--font-body); color: #c0392b;
}

.sheet-action {
  width: 100%; text-align: left;
  border: 2px solid rgba(44, 62, 80, .14);
  border-radius: 11px; padding: 13px;
  background: var(--white);
  font: 700 13.5px var(--font-body);
  color: var(--dark-ink);
}
.sheet-action.danger { border-color: rgba(231, 76, 60, .5); color: #c0392b; }

.seg { display: flex; gap: 8px; }
.seg .btn-retro { flex: 1; }

/* ============================================================
   Chat + trips
   ============================================================ */
.chat { padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 9px; }
/* The composer belongs at the bottom of the tab, ALWAYS — not just when the
   thread is empty. With one short message the old rule left it floating in the
   middle of the screen with dead space beneath, which reads as a broken layout
   rather than a short conversation. The surface is a plain block container by
   default, so it has to become a column for .chat to grow into it. */
.scroll:has(.composer) { display: flex; flex-direction: column; }
.chat { flex: 1; }
.chat.chat-empty { justify-content: flex-end; }
.chat-preamble { font: 400 11.5px/1.5 var(--font-body); color: var(--text-muted); margin: 0 0 4px; }
.msg {
  background: var(--white);
  border: var(--hairline);
  border-radius: var(--radius-retro);
  padding: 10px 12px;
  display: flex; gap: 9px;
}
.avatar {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 10px var(--font-body); color: #fff;
}
.msg-main { flex: 1; min-width: 0; }
.msg-who { font: 700 12.5px var(--font-body); color: var(--dark-ink); }
.msg-when { font: 400 11px var(--font-body); color: var(--text-muted); margin-left: 6px; }
.msg-body { font: 400 13.2px/1.5 var(--font-body); color: var(--dark-ink); margin-top: 3px; }
.msg-ctx {
  display: inline-block; margin-top: 6px;
  font: 700 10.5px var(--font-body);
  color: var(--primary-blue-dark);
  background: var(--head-fill);
  border: none;
  border-radius: var(--radius-pill);
  padding: 4px 9px;
}
.composer { display: flex; gap: 8px; padding: 12px 14px; border-top: var(--hairline); background: var(--white); }
.composer input {
  /* min-width: 0 is the whole reason Send stayed on screen. A flex item's
     min-width defaults to `auto` — its min-CONTENT width — and for an <input>
     that is roughly 20 characters, which is wider than the space left over on
     a 375px phone. `flex: 1` could not shrink past it, so the row overflowed
     and the Send button hung off the right edge, clipped. */
  flex: 1; min-width: 0; min-height: 46px;
  border: var(--input-border); border-radius: 10px;
  padding: 12px; font: 400 16px var(--font-body);
}
.composer .btn-retro { flex: none; padding: 10px 16px; }
.composer .btn-icon { padding: 10px 14px; font-size: 18px; line-height: 1; }

/* Picked but not yet sent. Sits above the composer so it reads as attached to
   the message being written, not as part of the thread above it. */
.composer-photos {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px 0;
  background: var(--white);
}
.composer-photo { position: relative; display: block; }
.composer-photo img {
  width: 56px; height: 56px; object-fit: cover;
  border: 2px solid var(--dark-ink); border-radius: 8px;
  display: block;
}
.composer-photo.busy {
  width: 56px; height: 56px;
  border: 2px dashed rgba(44, 62, 80, .3); border-radius: 8px;
  display: grid; place-items: center;
  font: 400 16px ui-monospace, monospace; color: var(--text-muted);
}
.composer-photo > button {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; padding: 0;
  border: 2px solid var(--dark-ink); border-radius: 50%;
  background: var(--white); color: var(--dark-ink);
  font: 700 12px var(--font-body); line-height: 1;
  cursor: pointer;
}

/* Photos on a posted message.

   Each tile is a BUTTON wrapping the image, so it is tappable, focusable and
   announced — an <img> with a click handler is none of those. */
/* Capped rather than filling the bubble: a photo is part of a message, not the
   message, and a pair spanning the full width reads as an album. */
.msg-photos { display: flex; gap: 6px; margin-top: 6px; max-width: 260px; }
.msg-photo {
  position: relative;
  padding: 0; border: 2px solid var(--dark-ink); border-radius: 10px;
  background: repeating-linear-gradient(135deg, #f2e8d7 0 8px, #e9dcc4 8px 16px);
  overflow: hidden; cursor: zoom-in;
  display: block; max-width: min(240px, 62vw);
  -webkit-tap-highlight-color: transparent;
}
.msg-photo img {
  display: block;
  width: 100%; height: auto;
  /* width/height attributes give the intrinsic ratio, so the box is the right
     shape before the bytes land and nothing below it jumps. */
  max-height: 300px; object-fit: cover;
}
/* Two photos share the row evenly rather than one dominating. */
.msg-photos.pair .msg-photo { flex: 1 1 0; min-width: 0; max-width: none; }
.msg-photos.pair .msg-photo img { aspect-ratio: 1; max-height: none; }

.msg-photo-expiry {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(44, 62, 80, .82); color: #fff;
  border-radius: var(--radius-pill); padding: 3px 8px;
  font: 700 9px var(--font-body); letter-spacing: .03em;
  pointer-events: none;
}

/* ── full-screen photo viewer ─────────────────────────────────────────────── */

body.viewer-open { overflow: hidden; }
.viewer-layer:empty { display: none; }

/* THE BACKDROP LIVES HERE, on the container that survives a re-render — not on
   .viewer, which is inside the markup that gets replaced when you swipe.
   Rebuilding the layer's contents removed the dark backing for a frame or two
   and the whole app showed through underneath, which read as a flash on every
   swipe. The container never leaves, so now there is nothing to flash. */
.viewer-layer.open {
  position: fixed; inset: 0; z-index: 200;
  background: #14181c;
}
.viewer {
  /* Above every other layer including the nav and any open sheet. A viewer you
     can see the app through is not a viewer, it is a scrim. */
  position: fixed; inset: 0; z-index: 200;
  background: #14181c;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* dvh, not vh: Android Chrome's toolbar would otherwise crop the image. */
  height: 100dvh;
  animation: viewer-in .14s ease-out;
}
@keyframes viewer-in { from { opacity: 0 } to { opacity: 1 } }

.viewer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  color: rgba(255, 255, 255, .82);
  font: 400 12px ui-monospace, monospace;
}
.viewer-tools { display: flex; gap: 6px; }
.viewer-btn {
  width: 44px; height: 44px;           /* full touch target, not a 20px × */
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  font: 400 22px var(--font-body); line-height: 1;
  cursor: pointer; text-decoration: none;
}
.viewer-btn:active { background: rgba(255, 255, 255, .24); }

.viewer-stage {
  display: grid; place-items: center;
  min-height: 0; padding: 0 8px;
  /* none, not pan-y: with the pinch, the drag and the swipe all handled here,
     every touch on the stage belongs to the app. Leaving pan-y to the browser
     let a two-finger pinch zoom the PAGE around a position: fixed overlay,
     which looks exactly like the app breaking. */
  touch-action: none;
  overflow: hidden;                    /* a zoomed photo stays out of the bar */
}
.viewer-stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;                 /* never crop in the viewer */
  border-radius: 4px;
}
/* Zoom is written straight to `transform` by the gesture handler, one property
   on one element, so a pinch never touches layout. No transition: a smoothed
   transform lags the fingers, which feels like the photo is on elastic. */
.viewer-layer.zoomed .viewer-stage img { border-radius: 0; cursor: grab; }
.viewer-layer.zoomed .viewer-stage img:active { cursor: grabbing; }
/* Fill the stage and letterbox, rather than pinning a small image at its
   natural size in the middle of a black screen. Everything reaching here is at
   least 400px on its long edge, so upscaling is not a real risk. */
.viewer-stage img { width: 100%; height: 100%; }

.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 72px;
  border: none; background: rgba(255, 255, 255, .1); color: #fff;
  font: 400 30px var(--font-body); line-height: 1;
  cursor: pointer;
}
.viewer-nav.prev { left: 0; border-radius: 0 8px 8px 0; }
.viewer-nav.next { right: 0; border-radius: 8px 0 0 8px; }
/* Arrows are a pointer affordance; on touch the gesture is the swipe. */
@media (hover: none) { .viewer-nav { display: none; } }

.viewer-note {
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  text-align: center;
  color: rgba(255, 255, 255, .7);
  font: 400 12px var(--font-body);
}

/* ── gallery ──────────────────────────────────────────────────────────────── */

.trip-photos-link {
  display: flex; align-items: center; gap: 7px;
  width: 100%; margin-top: 10px; padding: 10px 12px;
  background: var(--white);
  border: var(--input-border); border-radius: 10px;
  font: 700 12.5px var(--font-body); color: var(--dark-ink);
  cursor: pointer; text-align: left;
}
.trip-photos-link .icon { width: 17px; height: 17px; flex: none; }
.trip-photos-link .see-who { font-weight: 400; color: var(--text-muted); }

.gal-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.gal-actions .btn-retro { flex: 1; }

/* Square tiles, three across. A masonry of mixed-orientation phone photos is
   harder to scan, and every tile opens full size anyway. */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (min-width: 560px) { .gal-grid { grid-template-columns: repeat(4, 1fr); } }

.gal-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0; border: 2px solid var(--dark-ink); border-radius: 8px;
  background: repeating-linear-gradient(135deg, #f2e8d7 0 8px, #e9dcc4 8px 16px);
  overflow: hidden; cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.gal-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* A kept photo says so instead of counting down. */
.gal-tile.kept .gal-expiry { background: var(--accent-orange); color: var(--dark-ink); }
.gal-expiry {
  position: absolute; left: 4px; bottom: 4px; right: 4px;
  background: rgba(44, 62, 80, .82); color: #fff;
  border-radius: var(--radius-pill); padding: 2px 6px;
  font: 700 8.5px var(--font-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none;
}

.viewer-btn.danger { background: var(--danger, #c0392b); }
/* Kept: a state, not a button. No pointer, no press feedback. */
.viewer-btn.kept { background: var(--accent-orange); color: var(--dark-ink); cursor: default; }
.viewer-note.danger { color: #ff9a8f; }
.viewer-note.quiet { opacity: .65; font-size: 11px; }

/* ── drag and drop ────────────────────────────────────────────────────────── */

body.dropping .cover { outline: 3px dashed var(--accent-orange); outline-offset: -6px; }
.cover.drop-target { outline-color: var(--success); }

.sheet-photo-add {
  width: 100%; margin-top: 8px; padding: 12px;
  border: 2px dashed rgba(44, 62, 80, .28); border-radius: 10px;
  background: none; color: var(--text-muted);
  font: 700 13px var(--font-body); cursor: pointer;
}
.sheet-photo-add:disabled { opacity: .6; cursor: default; }

.trips { padding: 16px 14px 30px; display: flex; flex-direction: column; gap: 12px; }
.trips-head { display: flex; align-items: center; gap: 10px; }
.trips-head h1 { margin: 0; flex: 1; font: 400 18px var(--font-display); color: var(--dark-ink); }
.trip-card {
  background: var(--white);
  border: 2px solid rgba(44, 62, 80, .14);
  border-radius: var(--radius-retro);
  padding: 12px;
  text-align: left; width: 100%;
  display: flex; flex-direction: column; gap: 4px;
}
.trip-card-title { font: 600 15px var(--font-body); color: var(--dark-ink); display: flex; align-items: center; gap: 8px; }
.role-pill {
  font: 700 9.5px var(--font-body); border-radius: var(--radius-pill); padding: 3px 8px;
  background: var(--tint-blue-bg); color: var(--tint-blue-fg);
}
.role-pill.draft { background: var(--chip-bg); color: var(--chip-fg); }
.trip-card-sub { font: 500 12.3px var(--font-body); color: var(--text-secondary); }
.trip-card-meta { font: 400 11.6px var(--font-body); color: var(--text-muted); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 60;
  max-width: 528px; margin: 0 auto;
  background: var(--dark-ink); color: var(--warm-sand);
  border-radius: 11px; padding: 11px 13px;
  font: 600 12.5px/1.4 var(--font-body);
  box-shadow: 0 8px 22px rgba(20, 26, 32, .3);
  animation: fadeIn 140ms ease;
}
.toast.with-nav { bottom: 76px; }
.toast.no-nav { bottom: 22px; }

.hidden { display: none !important; }


/* Organizer previewing their own share link. Same chrome as the guest banner so
   it reads as "this is the shared view", with a way back to editing. */
.guest-banner.preview { background: var(--primary-blue-dark); }
.preview-exit {
  margin-left: auto; flex: none;
  min-height: 28px;
  border: 1.5px solid rgba(253, 250, 245, .55);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--warm-sand);
  font: 700 11px var(--font-body);
  padding: 0 12px;
}
.preview-exit:hover { background: rgba(253, 250, 245, .14); }

/* ============================================================
   App bar (v3 §2) — trip switcher + account.
   The bottom bar is trip-scoped (a few taps a minute); switching
   trips is a few taps a month, so it lives up here. No Trips tab.
   ============================================================ */
.app-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--white);
  border-bottom: 1px solid rgba(44, 62, 80, .12);
  position: sticky; top: 0; z-index: 5;
  flex: none;
}
.app-bar-trip {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  border: none; background: none; padding: 4px 0;
  font: 700 14px var(--font-heading);
  color: var(--dark-ink);
  min-height: 34px;
}
.app-bar-trip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar-trip .caret { font-size: 9px; color: var(--text-muted); flex: none; }
.app-bar-avatar {
  flex: none; width: 32px; height: 32px;
  border: 2px solid var(--dark-ink); border-radius: 50%;
  background: var(--primary-blue);
  padding: 0; overflow: hidden;
  display: grid; place-items: center;
}
.app-bar-avatar .avatar { width: 100%; height: 100%; border-radius: 50%; font-size: 12px; }


/* Share and Edit, in the app bar. 44px — the app-bar tier of the touch-target
   floor (design handoff CHANGES §4). Icons are display:block and centred, since
   a diagonal glyph on the text baseline reads as visibly off-centre. */
.app-bar-act {
  flex: none; width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 2px solid var(--dark-ink); border-radius: 11px;
  background: var(--white); color: var(--dark-ink);
  cursor: pointer; font: 700 17px var(--font-body);
}
.app-bar-act .icon { display: block; margin: 0 auto; }
.app-bar-act.share { background: var(--primary-blue); border-color: var(--primary-blue); color: #fff; }
.app-bar-act.edit.on { background: var(--dark-ink); color: var(--white); }

/* The block-header set: order, comment, pencil. One matched size, 40px — the
   icon-button tier. Replaces the old ··· glyph. */
.blk-act {
  flex: none; min-width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0 10px;
  border: 1.5px solid rgba(44, 62, 80, .2); border-radius: 9px;
  background: var(--white); color: #5d6d7e; cursor: pointer;
}
.blk-act .icon { display: block; }
.blk-act.comment.has { background: #e8f2fb; color: #1f6ea8; border-color: rgba(52, 152, 219, .45); }
.blk-act:hover { color: var(--dark-ink); }
/* The count only appears once there is one. The page payload does not carry a
   comment count today, so in practice this shows after posting within a
   session — the tinted variant is what signals "there is a thread here". */
.blk-act-n { font: 700 11px var(--font-body); margin-left: 5px; }
.blk-act.comment { gap: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Jump to (JUMP_TO_NAV.md) — one bordered list inside a standard sheet.
   Replaces the sticky contents bar, which sat out of thumb reach, cost ~40px
   of every screen forever, and pushed the content down as it opened. */
.jump-list {
  border: 1.5px solid rgba(44, 62, 80, .14);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
}
/* 46px rows put ~7 blocks on screen before scrolling, which is the right
   density for a twelve-block trip: enough to scan, obviously more below. */
.jump-row {
  width: 100%; height: 46px;
  display: flex; align-items: center; gap: 11px;
  padding: 0 12px; border: none; background: var(--white); cursor: pointer;
  border-bottom: 1px solid rgba(44, 62, 80, .07); text-align: left;
}
.jump-row:last-child { border-bottom: none; }
.jump-row:hover { background: #f8f4eb; }
.jump-i { flex: none; width: 15px; font: 500 10.5px ui-monospace, Menlo, monospace; color: #b6bcc1; }
.jump-title {
  flex: 1; min-width: 0; font: 600 13.6px var(--font-body); color: var(--dark-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jump-count { flex: none; font: 500 9.5px ui-monospace, Menlo, monospace; color: #b6bcc1; }

/* View-only: the ticks somebody else made stay legible, but nothing invites a
   tap. Only the CONTROL greys — the words are the reason you were sent the
   link, so they keep their colour. */
.chk-box:disabled { opacity: .45; cursor: default; }
.chk-main:disabled, .sch-main:disabled, .card-main:disabled { cursor: default; }

/* Trip switcher sheet */
.switch-section {
  display: flex; align-items: center; gap: 10px;
  font: 700 10px var(--font-body);
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-top: 4px;
}
.switch-section::after {
  content: ""; flex: 1; height: 1px; background: rgba(44, 62, 80, .12);
}
.trip-card.current { border-color: var(--primary-blue); border-width: 2px; }
.role-pill.past { background: var(--chip-bg); color: var(--text-muted); }

/* Account sheet */
.identity {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border: var(--hairline);
  border-radius: var(--radius-retro);
  padding: 12px;
}
.identity-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.identity-name { font: 700 14px var(--font-body); color: var(--dark-ink); }
.identity-email { font: 400 12px var(--font-body); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.sheet-action.quiet-danger { color: var(--text-muted); border-color: rgba(44, 62, 80, .1); font-weight: 600; }
.sheet-action.quiet-danger:hover { color: #c0392b; }

/* "opened" on an invite row. The shared link could never say who clicked, so
   this is information an organizer has not had before — worth showing, not
   worth shouting. */
.share-seen {
  font: 700 10px var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); background: var(--chip-bg);
  padding: 2px 6px; border-radius: 6px; margin-left: 6px;
}

/* A write token is the one worth noticing in a list. Read-only borrows the
   muted .past treatment so the two are told apart at a glance, not read. */
.role-pill.write { background: var(--tint-amber-bg); color: var(--tint-amber-fg); }

/* Connect sheet. A plain list rather than paragraphs: the two choices being
   explained are the two the consent screen will ask for, and they want to be
   scannable in the moment somebody is deciding, not read. */
.sheet-list {
  margin: 0; padding-left: 18px;
  display: flex; flex-direction: column; gap: 8px;
  font: 400 13px/1.5 var(--font-body); color: var(--text-muted);
}
.sheet-list strong { color: var(--dark-ink); font-weight: 700; }
.sheet-hint code {
  font: 600 12px var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  color: var(--dark-ink);
  background: var(--chip-bg);
  padding: 2px 6px; border-radius: 6px;
  overflow-wrap: anywhere;
}

/* The Home prompt. This is the whole discovery mechanism — connecting worked
   before it existed, but only for somebody who already knew to go looking. It
   dismisses to localStorage rather than to a column on the user, because
   knowing whether somebody has connected an assistant is not worth a query on
   every Home load. */
.home-connect {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin-top: 14px;
  background: var(--white);
  border: 1px solid rgba(44, 62, 80, .13);
  border-radius: 12px;
  padding: 13px 12px;
  text-align: left;
}
.home-connect-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  border: none; background: none; padding: 0; text-align: left; cursor: pointer;
}
.home-connect-title { font: 700 13px var(--font-body); color: var(--dark-ink); }
.home-connect-sub { font: 400 12px var(--font-body); color: var(--text-muted); }
.home-connect-x {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: none; cursor: pointer;
  font: 400 17px/1 var(--font-body); color: var(--text-muted);
}

/* Access tokens. Same row shape as .toggle-row so the account sheet reads as
   one thing, with Revoke where the switch would be — it is the only control. */
.token-list { display: flex; flex-direction: column; gap: 8px; }
.token-row {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid rgba(44, 62, 80, .14);
  border-radius: 11px;
  padding: 12px;
  min-height: 56px;
  background: var(--white);
}
.token-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.token-name {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font: 600 13.5px var(--font-body); color: var(--dark-ink);
}
.token-meta {
  font: 400 11.5px/1.4 var(--font-body); color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.token-revoke {
  flex: none; min-height: 36px; padding: 0 12px;
  border: 2px solid rgba(44, 62, 80, .12); border-radius: var(--radius-pill);
  background: var(--white); color: var(--text-muted);
  font: 700 11.5px var(--font-body);
}
.token-revoke:hover { color: #c0392b; border-color: rgba(192, 57, 43, .35); }

/* The one-time reveal. Wraps rather than scrolls: a token you cannot see all
   of is a token somebody copies half of. */
.token-reveal {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--white);
  border: 2px solid var(--dark-ink);
  border-radius: var(--radius-retro);
  padding: 12px;
}
.token-reveal code {
  font: 400 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--dark-ink);
  word-break: break-all;
  user-select: all;
}

/* Guest name masking (v3 §6): a tally, not a roster. */
.masked-strip {
  background: var(--tint-amber-bg);
  color: var(--tint-amber-fg);
  font: 600 12px/1.45 var(--font-body);
  padding: 11px 12px;
}

/* Derived RSVP status dot on people rows (v3 §7). From membership, never a column. */
.rsvp-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  display: inline-block;
  background: rgba(44, 62, 80, .22);
}
.rsvp-dot.going { background: var(--success); }
.rsvp-dot.maybe { background: var(--accent-orange); }
.rsvp-dot.not_going { background: var(--danger); }

/* Roster (v3 §7) */
.trip-meta-line {
  display: flex; align-items: center; gap: 7px;
  width: 100%; text-align: left;
  border: none; background: none; padding: 0;
  /* A full-width row, so 34 is the right tier rather than 44 — the floor for a
     wide target in a low-error position (BRAND_AND_FRONT_DOOR.md §7). It is a
     <button> opening the roster when there is anybody to show. */
  min-height: 34px;
}
.see-who { color: var(--primary-blue-dark); font-weight: 700; flex: none; }
.tallies { display: flex; gap: 8px; }
.tally {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px;
  border-radius: var(--radius-retro);
  background: var(--chip-bg);
}
.tally-n { font: 700 17px var(--font-body); color: var(--dark-ink); }
.tally-l { font: 700 10.5px var(--font-body); letter-spacing: .07em; color: var(--text-secondary); }
.tally.go { background: var(--tint-green-bg); }
.tally.go .tally-n { color: var(--tint-green-fg); }
.tally.maybe { background: var(--tint-amber-bg); }
.tally.maybe .tally-n { color: var(--tint-amber-fg); }
.roster-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.roster-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px var(--font-body);
  border-radius: var(--radius-pill);
  padding: 4px 10px 4px 4px;
  background: #f1ede4; color: var(--dark-ink);
  /* A person who has not signed in yet is shown by their email address, which
     is a good deal longer than a first name — ellipsis rather than a chip that
     runs off a 390px screen. */
  max-width: 100%; min-width: 0;
}
.roster-chip > span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.roster-chip.maybe { background: var(--tint-amber-bg); }
.roster-chip.no { background: var(--chip-bg); color: var(--text-muted); }
.roster-chip .avatar { width: 20px; height: 20px; font-size: 9px; }

/* Contributor read view (v3 sheet 12) — static pairs, never disabled inputs. */
.read-pair {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 0;
  border-bottom: var(--hairline-divider);
}
.read-label {
  font: 700 10.5px var(--font-body);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
}
.read-value { font: 400 14px/1.5 var(--font-body); color: var(--dark-ink); overflow-wrap: anywhere; }
.read-note {
  background: var(--tint-amber-bg);
  color: var(--tint-amber-fg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: 500 12px/1.45 var(--font-body);
}

/* Placeholder "+1" person row — unclaimed, anyone can adopt it (v3 §3.5). */
.person-row.placeholder { background: var(--tint-amber-bg); }
.person-row.placeholder .person-name { color: var(--tint-amber-fg); }
.edit-pill.adopt { background: var(--accent-orange); color: var(--dark-ink); }

/* ============================================================
   Desktop (v3 §4) — Instagram's translation, not a redesign.

   THERE IS NO DESKTOP BREAKPOINT. #app is a centred 640px column
   at every width and .nav is pinned to that column rather than to
   the viewport, so a wide window is the same design with more room
   around it. Nothing below 640px changes above it.

   There used to be one exception: from 768px up the bottom bar was
   hidden and the same two tabs were rebuilt as a segmented control
   in the app bar. Two navigations, one of which only existed on
   screens nobody tested on — and it cost a real bug, because the
   tabs lived ONLY in that bar, so switching to Chat on a desktop
   removed every control for leaving Chat and the way out was
   reloading the page. One nav, everywhere, is fewer things that
   can disagree.
   ============================================================ */

/* ============================================================
   §0 — Pre-trip surfaces (README §0.1–0.7)
   Front door, auth, dead-ends, Home, and the draft banner.
   Measurements come from the handoff prototype verbatim.
   ============================================================ */

/* ---- §0.1 the wordmark stamp ---- */
.stamp { display: inline-flex; align-self: flex-start; border-radius: 6px; }

/* ---- §0.2 front door ---- */
.door {
  /* dvh, not vh: Android Chrome's 100vh includes the retracted URL bar, which
     pushes the CTA below the fold on a real phone while desktop emulation
     (no collapsing bar) looks fine. vh line stays as the older-browser fallback. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 24px 22px 26px; background: #f2e8d7;
}
/* 232px is the pile's true content floor (lowest snap at 52% + card height) —
   below that the cards clip. Above it, give the headline room first. */
.snap-pile { flex: 1; position: relative; margin: 20px 0 22px; min-height: 368px; }
.snap {
  position: absolute; background: #fff; padding: 8px 8px 26px;
  box-shadow: 0 6px 18px rgba(44, 62, 80, .22);
}
/* SQUARE, and this is the whole silhouette (BRAND_AND_FRONT_DOOR.md §5).
   It was `height: 78px` against a ~50% width, which made every photo a
   letterbox strip — nothing like a polaroid. A real polaroid is a square image
   with a thick bottom border, and it is the square PLUS the 26px of padding
   below that produces the shape. Let the width drive the height. */
.snap-photo {
  aspect-ratio: 1;
  background-color: var(--warm-sand);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.snap-caption {
  margin-top: 7px; font: 400 11px var(--font-display);
  color: var(--text-secondary); text-align: center; letter-spacing: .3px;
}
.snap-tape {
  position: absolute; top: -9px; left: 50%; margin-left: -22px;
  width: 44px; height: 17px; background: rgba(243, 156, 18, .55);
  border-left: 1px dashed rgba(44, 62, 80, .2);
  border-right: 1px dashed rgba(44, 62, 80, .2);
}
.door-headline { font: 400 27px/1.08 var(--font-display); color: var(--dark-ink); }
.door-sub { margin-top: 9px; font: 400 13.5px/1.5 var(--font-body); color: var(--text-secondary); text-wrap: pretty; }
.door-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.door-actions .btn-retro { width: 100%; padding: 15px 0; }
.door-login {
  border: 0; background: transparent; color: var(--text-secondary);
  font: 600 13px var(--font-body); padding: 6px 0;
}
.door-login:hover { color: var(--primary-blue-dark); }

/* What the app is, under the door.
   Lives in app.html rather than in a render, because the point of it is to be
   in the markup a crawler receives — everything inside #surface arrives from
   JavaScript. It sits below the fold by construction (.scroll is `flex: 1`
   against a 100dvh column), so it is never the first thing anybody sees.
   Hidden on every screen except the door: "How it works" under somebody's
   packing list would be an advert inside their trip. */
body.no-door-more .door-more { display: none; }
.door-more {
  flex: none;
  padding: 4px 22px 40px;
  background: #f2e8d7;                     /* the door's ground, continued */
  border-top: 1px solid rgba(44, 62, 80, .12);
}
.door-more h2 {
  margin: 26px 0 14px;
  font: 700 11px var(--font-body);
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted);
}
.door-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 15px; }
.door-points li { font: 400 13.5px/1.5 var(--font-body); color: var(--dark-ink); text-wrap: pretty; }
.door-points b { display: block; font: 700 13.5px var(--font-body); margin-bottom: 2px; }
.door-foot {
  margin: 22px 0 0; padding-top: 16px;
  border-top: var(--hairline);
  font: 400 12px/1.6 var(--font-body); color: var(--text-muted);
}

/* ---- §0.4–0.6 auth screens ---- */
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 22px 22px 26px; background: var(--warm-sand);
}
.auth-back {
  align-self: flex-start; border: 0; background: transparent;
  color: var(--text-secondary); font: 600 12.5px var(--font-body); padding: 4px 0;
}
.auth-heading { margin-top: 20px; font: 400 24px/1.12 var(--font-display); color: var(--dark-ink); }
.auth-sub { margin-top: 9px; font: 400 13.4px/1.55 var(--font-body); color: var(--text-secondary); text-wrap: pretty; }
.auth-label {
  display: block; margin: 22px 0 6px; font: 700 10.5px var(--font-body);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.auth-screen input[type="email"], .auth-screen input[type="password"] {
  width: 100%; box-sizing: border-box; border-radius: 10px; background: #fff;
  padding: 13px; font: 400 16px var(--font-body); color: var(--dark-ink); min-height: 48px;
  border: var(--input-border);
}
.auth-screen input[type="email"]:focus, .auth-screen input[type="password"]:focus { border-color: var(--primary-blue); outline: none; }
.auth-error { margin-top: 10px; border-radius: 11px; padding: 12px 13px; }
.auth-error-title { font: 700 12.4px var(--font-body); }
.auth-error-body { margin-top: 4px; font: 400 12.4px/1.5 var(--font-body); text-wrap: pretty; }
.auth-fix {
  margin-top: 9px; border: 2px solid; background: #fff; border-radius: var(--radius-pill);
  padding: 7px 13px; font: 700 11.5px var(--font-body); min-height: 36px;
}
.auth-cta { margin-top: 12px; width: 100%; padding: 15px 0; }
.auth-cta.inert { background: #e4dccc; color: var(--text-muted); cursor: not-allowed; box-shadow: 3px 3px 0 0 var(--dark-ink); }
.auth-cta.inert:active { transform: none; }
.auth-foot {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(44, 62, 80, .12);
  font: 400 12.6px/1.5 var(--font-body); color: var(--text-muted);
}
.auth-foot a, .auth-foot-link {
  border: 0; background: none; padding: 0; color: var(--primary-blue-dark);
  font: 700 12.6px var(--font-body); text-decoration: none;
}
.auth-quiet {
  margin-top: 12px; border: 0; background: transparent; color: var(--text-secondary);
  font: 600 12.5px var(--font-body); padding: 6px 0;
}
.auth-footnote { margin-top: 14px; font: 400 11.5px/1.5 var(--font-body); color: var(--text-muted); }
.check-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 30px; }

/* the six digit boxes; the real input sits off-screen and drives them */
.code-row { display: flex; gap: 7px; margin-top: 20px; cursor: text; }
.code-box {
  flex: 1; height: 54px; border: 2px solid rgba(44, 62, 80, .18); border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font: 700 21px var(--font-body); color: var(--dark-ink);
}
.code-box.active { border-color: var(--primary-blue); }
.code-box.bad { border-color: #b8352a; }
.code-input { position: absolute; opacity: 0; pointer-events: none; height: 0; }

.dead-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 36px; }
.spoiled-card {
  align-self: flex-start; background: #fff; padding: 8px 8px 24px;
  box-shadow: 0 6px 18px rgba(44, 62, 80, .18); transform: rotate(-3deg);
  width: 150px; margin-bottom: 24px;
}
.spoiled-photo {
  height: 78px; background: repeating-linear-gradient(118deg, #d9d2c6 0 14px, #cec6b8 14px 28px);
  display: flex; align-items: center; justify-content: center;
  font: 700 26px var(--font-body); color: #b0a696;
}
.spoiled-stamp { margin-top: 7px; font: 400 10px var(--font-display); color: var(--text-muted); text-align: center; }

/* ---- §0.7 home ---- */
.home-bar {
  display: flex; align-items: center; gap: 9px; padding: 14px 16px 12px;
  background: #fff; border-bottom: 1px solid rgba(44, 62, 80, .12);
}
.home-bar-mark { flex: 1; display: flex; }
.home-avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--dark-ink); background: var(--primary-blue); color: #fff;
  font: 700 12px var(--font-body);
}
.home-body { padding: 16px 14px 26px; background: var(--warm-sand); min-height: calc(100vh - 59px); min-height: calc(100dvh - 59px); }
.home-section { margin-bottom: 18px; }
.home-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.home-section-head span:first-child { font: 700 10px var(--font-body); letter-spacing: .09em; color: var(--text-muted); }
.home-section-head .rule { flex: 1; height: 1px; background: rgba(44, 62, 80, .1); }
.home-cards { display: flex; flex-direction: column; gap: 10px; }
.home-card {
  display: block; width: 100%; text-align: left; background: #fff;
  border: 2.5px solid var(--dark-ink); border-radius: 14px; padding: 0;
  overflow: hidden; box-shadow: 4px 4px 0 0 var(--dark-ink);
}
.home-card.past { opacity: .72; }
.home-card-cover { display: block; height: 104px; position: relative; }
.home-card-tag {
  position: absolute; left: 10px; bottom: 10px;
  font: 700 9.5px var(--font-body); letter-spacing: .06em;
  border-radius: var(--radius-pill); padding: 4px 10px;
}
.home-card-body { display: block; padding: 11px 13px 13px; border-top: 2.5px solid var(--dark-ink); }
.home-card-title { display: block; font: 400 15px/1.1 var(--font-display); color: var(--dark-ink); }
.home-card-sub { display: block; margin-top: 5px; font: 500 12.3px var(--font-body); color: var(--text-secondary); }
.home-card-meta { display: block; margin-top: 1px; font: 400 11.5px var(--font-body); color: var(--text-muted); }
.home-start { width: 100%; padding: 14px 0; }
.home-zero {
  background: #fff; border: 2px dashed rgba(44, 62, 80, .22); border-radius: 14px;
  padding: 24px 18px; text-align: center;
}
.home-zero-title { font: 400 17px/1.15 var(--font-display); color: var(--dark-ink); }
.home-zero-sub { margin: 8px 0 0; font: 400 13px/1.5 var(--font-body); color: var(--text-secondary); text-wrap: pretty; }
.home-zero .btn-retro { width: 100%; margin-top: 16px; padding: 14px 0; }
.home-paste { margin-top: 14px; background: #fff; border: 1px solid rgba(44, 62, 80, .13); border-radius: 12px; padding: 14px; }
.home-paste-label { font: 700 10.5px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.home-paste-row { display: flex; gap: 7px; margin-top: 9px; }
.home-paste-row input {
  flex: 1; min-width: 0; border: var(--input-border); border-radius: 10px;
  background: var(--warm-sand); padding: 11px; font: 400 16px var(--font-body);
  color: var(--dark-ink); min-height: 46px;
}
.home-paste-row input:focus { border-color: var(--primary-blue); outline: none; }
.home-paste-row .btn-retro { flex: none; padding: 0 15px; box-shadow: var(--shadow-retro-sm); }

/* ---- §0.3 the draft banner ---- */
.draft-banner {
  display: flex; align-items: center; gap: 9px; padding: 10px 14px;
  background: #fdf1dd; border-bottom: 1px solid rgba(154, 98, 6, .2);
}
.draft-banner span { flex: 1; min-width: 0; font: 500 11.6px/1.4 var(--font-body); color: #9a6206; }
.draft-save {
  flex: none; border: 2px solid #9a6206; background: #fff; color: #9a6206;
  border-radius: var(--radius-pill); padding: 5px 11px; font: 700 11px var(--font-body);
  min-height: 34px; white-space: nowrap;
}

/* trip header edit affordances (edit mode, README §3: dashed blue) */
.trip-title.as-button { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.trip-title.editable { border-bottom: 2px dashed rgba(52, 152, 219, .55); }
.meta-pill.editable { border: 1.5px dashed rgba(52, 152, 219, .6); cursor: pointer; font: inherit; background: none; }
.meta-pill.hint { color: var(--text-muted); }

/* ---- the two-tap date picker (README §3) ---- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn {
  flex: none; width: 38px; height: 38px;
  border: 2px solid rgba(44, 62, 80, .18); border-radius: 10px;
  background: #fff; color: var(--dark-ink); font: 700 14px var(--font-body);
}
.cal-month { flex: 1; text-align: center; font: 700 14px var(--font-heading); color: var(--dark-ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 12px; }
.cal-dow { text-align: center; font: 700 9.5px var(--font-body); letter-spacing: .06em; color: var(--text-muted); padding: 2px 0; }
.cal-cell {
  height: 44px; border: 0; padding: 0; background: transparent;
  font: 600 13.5px var(--font-body); color: var(--dark-ink); border-radius: 10px;
}
.cal-cell.blank { pointer-events: none; }
.cal-cell.edge { background: var(--dark-ink); color: var(--warm-sand); }
.cal-cell.start { border-radius: 10px 0 0 10px; }
.cal-cell.end { border-radius: 0 10px 10px 0; }
.cal-cell.single { border-radius: 10px; }
.cal-cell.inside { background: #e8f2fb; color: #1f6ea8; border-radius: 0; }
.cal-status {
  margin-top: 12px; background: #fff; border: 2px solid rgba(44, 62, 80, .14);
  border-radius: 11px; padding: 11px 12px; display: flex; align-items: center; gap: 9px;
}
.cal-status-label { flex: 1; min-width: 0; font: 600 13.5px var(--font-body); color: var(--dark-ink); }
.cal-status-label.empty { color: var(--text-muted); }
.cal-clear {
  flex: none; border: 1.5px solid rgba(44, 62, 80, .2); background: #fff;
  border-radius: var(--radius-pill); padding: 5px 11px;
  font: 600 11px var(--font-body); color: var(--text-secondary); min-height: 34px;
}

/* the "throw away what you typed?" strip that replaces the sheet foot */
.discard-confirm { display: flex; align-items: center; gap: 8px; }
.discard-confirm span { flex: 1; min-width: 0; font: 600 12.5px/1.35 var(--font-body); color: var(--dark-ink); }
.discard-confirm .btn-retro { flex: none; width: auto; padding: 10px 14px; font-size: 12.5px; background: var(--white); color: var(--dark-ink); }
.discard-confirm .btn-retro.danger { background: var(--danger); color: #fff; }

/* inline "delete this block?" confirm, swapped in for the delete button */
.delete-confirm {
  border: 2px solid var(--danger); border-radius: 11px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: var(--tint-red-bg);
}
.delete-confirm > span { font: 500 12.5px/1.45 var(--font-body); color: var(--tint-red-fg); }
.delete-confirm-row { display: flex; gap: 8px; }
.delete-confirm-row .btn-retro { flex: 1; }

/* message edit / delete (chat tab and block comments share these) */
.msg-actions { display: flex; gap: 12px; margin-top: 5px; }
.msg-actions button {
  border: 0; background: none; padding: 2px 0; min-height: 34px;
  font: 600 11.5px var(--font-body); color: var(--text-muted);
}
.msg-actions button:hover { color: var(--primary-blue-dark); }
.msg-edited { font: 400 10.5px var(--font-body); color: var(--text-muted); margin-left: 6px; }
.msg-edit { margin-top: 4px; }
.msg-edit textarea {
  width: 100%; box-sizing: border-box;
  border: var(--input-border); border-radius: 10px;
  padding: 10px; font: 400 16px var(--font-body); color: var(--dark-ink);
}
.msg-edit textarea:focus { border-color: var(--primary-blue); outline: none; }
.msg-edit-row { display: flex; gap: 8px; margin-top: 7px; }
.msg-edit-row .btn-retro { flex: 1; padding: 8px 0; min-height: 40px; font-size: 12.5px; }

/* roster: who can edit the plan (co-organizers) */
.roles-head { font: 700 10px var(--font-body); letter-spacing: .09em; color: var(--text-muted); margin-top: 4px; }
.role-list { display: flex; flex-direction: column; gap: 6px; }
.role-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: var(--hairline); border-radius: 10px; padding: 8px 10px;
}
.role-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  font: 600 13px var(--font-body); color: var(--dark-ink); }
.role-note { flex: none; font: 600 10.5px var(--font-body); letter-spacing: .04em;
  color: var(--text-muted); text-transform: uppercase; }
.role-btn {
  flex: none; min-height: 34px; border: 1.5px solid rgba(44, 62, 80, .22); background: #fff;
  border-radius: var(--radius-pill); padding: 5px 11px;
  font: 700 11px var(--font-body); color: var(--text-secondary); white-space: nowrap;
}
.role-btn.promote { border-color: var(--primary-blue); color: var(--primary-blue-dark); }
/* Removal is destructive, so it never competes with the role button for the
   eye: no border until it is the thing being confirmed. */
.role-btn.quiet { border-color: transparent; color: var(--text-muted); padding: 5px 6px; }
.role-btn.danger { border-color: var(--tint-red-fg); color: var(--tint-red-fg); background: var(--tint-red-bg); }
.role-actions, .role-confirm { flex: none; display: flex; align-items: center; gap: 6px; }
.role-row.confirming { border-color: var(--tint-red-fg); background: var(--tint-red-bg); }
.role-warn { margin-top: -2px; }
