/* ============================================================
   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);
  overflow-x: hidden;
  /* 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;
}
.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. */
.block-head .order-toggle,
.block-head .comment-pill,
.block-head .block-dots {
  min-height: 32px;
  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; }
.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;
}

/* ---- 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: 32px;
  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; }
.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); }
.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; }
/* Nothing to read yet: grow so the composer sits at the bottom of the tab
   rather than floating under a one-line empty state. 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.chat-empty { flex: 1; 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 {
  flex: 1; 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; }

.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; }

/* 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; }

/* 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;
  min-height: 32px;
}
.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);
}
.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.
   Same column, same measurements. The one structural change is
   that the bottom bar becomes a segmented control in the app bar.
   ============================================================ */
.app-bar-tabs { display: none; }

@media (min-width: 768px) {
  .nav { display: none !important; }
  .scroll { padding-bottom: 0; }

  .app-bar-tabs {
    display: flex; flex: none; gap: 2px;
    background: var(--chip-bg);
    border-radius: var(--radius-pill);
    padding: 2px;
  }
  .app-bar-tabs button {
    border: none; background: none;
    font: 700 11px var(--font-body);
    letter-spacing: .06em;
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    min-height: 32px;
  }
  .app-bar-tabs button.active { background: var(--white); color: var(--dark-ink); }
  /* The trip name yields space to the tabs rather than pushing them off. */
  .app-bar-trip { flex: 0 1 auto; min-width: 0; }
  .app-bar-spacer { flex: 1; }
}

/* ============================================================
   §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: 232px; }
.snap {
  position: absolute; background: #fff; padding: 8px 8px 26px;
  box-shadow: 0 6px 18px rgba(44, 62, 80, .22);
}
.snap-photo { height: 78px; }
.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); }

/* ---- §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: 32px; 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: 32px;
}

/* 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: 32px;
  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: 32px; 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); }
