*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.45;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
img { max-width: 100%; display: block; }
.ic { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* No rings or outlines anywhere. Keyboard focus shows as a quiet background. */
:focus, :focus-visible { outline: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { background-color: var(--focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { background-color: #FFFDF8; border-color: var(--border-strong); }
.btn-primary:focus-visible { background: var(--action-press); }
.btn-green:focus-visible { background: var(--primary-press); }
.btn-danger:focus-visible { background: var(--danger-press); }

/* ---------- Layout shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
#main { padding-bottom: calc(var(--nav-h, 72px) + env(safe-area-inset-bottom)); }
.page { max-width: 680px; margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s1);
  min-height: calc(var(--tap) + 16px);
  padding: 8px 8px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-actions { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.back, .btn-text {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); min-width: var(--tap);
  padding: 0 12px; border: 0; border-radius: var(--r-input);
  background: transparent; color: var(--primary);
  font-weight: 700; font-size: var(--t-body); text-decoration: none;
}
.back { padding-left: 4px; }
.back:hover, .btn-text:hover { background: var(--surface-2); }
.btn-text[disabled] { color: var(--muted); opacity: .6; cursor: not-allowed; }

.content { padding: 0 var(--s2) var(--s4); }
.title { font-size: min(var(--t-h1), 10.5vw); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 4px 0 var(--s1); overflow-wrap: break-word; hyphens: auto; }
.sub { color: var(--muted); margin-bottom: var(--s3); }
.eyebrow { color: var(--muted); font-weight: 700; margin-bottom: 4px; }

.section { margin-top: var(--s4); }
.section:first-of-type { margin-top: var(--s2); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); margin-bottom: var(--s1); flex-wrap: wrap; }
.section-head h2 { font-size: var(--t-h2); font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.75rem; height: 1.75rem; padding: 0 8px;
  border-radius: var(--r-full); background: var(--primary); color: #fff;
  font-size: var(--t-body); font-weight: 700;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.card-pad { padding: var(--s2); }
.list { overflow: hidden; }
.list > * + * { border-top: 1px solid var(--border); }

/* ---------- Rows ---------- */
.row {
  display: flex; align-items: center; gap: var(--s2);
  width: 100%; min-height: 4.5rem; padding: 12px var(--s2);
  border: 0; background: transparent; text-align: left; text-decoration: none; color: inherit;
}
.row:hover { background: #FCFAF6; }
.row.is-selected { background: var(--primary-tint); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: var(--t-label); overflow-wrap: anywhere; }
.row-meta { color: var(--muted); }
.row-end { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; flex: none; text-align: right; }
.row-end .ic { color: var(--border-strong); }
.status { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.status.yes { color: var(--success); }
.status.todo { color: var(--action); }
.date-chip {
  flex: none; width: 3.5rem; padding: 6px 0; border-radius: 12px;
  background: var(--primary-tint); color: var(--primary); text-align: center; line-height: 1.1;
}
.date-chip span { display: block; font-weight: 700; font-size: var(--t-body); }
.date-chip b { display: block; font-size: 1.5rem; font-weight: 800; }
.row-icon {
  flex: none; width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--action-tint); color: var(--action);
}
.row-icon.green { background: var(--primary-tint); color: var(--primary); }

.see-all { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 8px; border: 0; background: none; color: var(--primary); font-weight: 700; border-radius: var(--r-input); }
.see-all:hover { background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap-lg); padding: 12px var(--s3);
  border-radius: var(--r-input); border: 1px solid transparent;
  font-weight: 700; font-size: var(--t-label); text-decoration: none; text-align: center;
  line-height: 1.2;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-press); }
.btn-green { background: var(--primary); color: #fff; }
.btn-green:hover { background: var(--primary-press); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-quiet { background: var(--surface-2); color: var(--ink); }
.btn-quiet:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-press); }
.btn-danger-text { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-3); color: #6F685F; border-color: transparent; cursor: not-allowed; }
.btn-row { display: flex; gap: var(--s1); flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 10rem; }

/* ---------- Sticky bottom bar ---------- */
.sticky-bar {
  position: sticky; bottom: calc(var(--nav-h, 72px) + env(safe-area-inset-bottom)); z-index: 15;
  padding: 12px var(--s2);
  background: color-mix(in srgb, var(--canvas) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.no-tabs .sticky-bar { bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.sticky-label { font-weight: 700; margin-bottom: 8px; }

/* RSVP control */
.rsvp { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s1); }
.rsvp button {
  min-height: var(--tap-lg); border-radius: var(--r-input);
  border: 2px solid var(--border-strong); background: var(--surface);
  font-weight: 800; font-size: var(--t-label);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px;
}
.rsvp button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.rsvp button[aria-pressed="true"]:focus-visible { background: var(--primary-press); }
.rsvp-big button { min-height: 4.5rem; font-size: var(--t-h3); }

/* ---------- Bottom tabs / left rail ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 4.5rem; padding: 6px 2px; text-decoration: none;
  color: var(--muted); font-weight: 700; font-size: var(--t-body); border: 0; background: none;
}
.tab[aria-current="page"] { color: var(--primary); }
.tab[aria-current="page"] .tab-ic { background: var(--primary-tint); }
.tab-ic { display: grid; place-items: center; width: 4rem; height: 2rem; border-radius: var(--r-full); }
.tab-label { line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.tabs .rail-brand { display: none; }
.tab-label { font-size: 17px; letter-spacing: -0.01em; overflow-wrap: normal; hyphens: manual; }
h1[tabindex]:focus-visible { background: none; }
html.large-text .topbar { position: static; backdrop-filter: none; }
html.large-text .tab-ic { height: 1.75rem; }
.topbar { flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s3); }
.field label, .field .label { display: block; font-weight: 700; font-size: var(--t-label); margin-bottom: 8px; }
.hint { color: var(--muted); margin-top: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap-lg); padding: 12px var(--s2);
  border: 1.5px solid var(--border-strong); border-radius: var(--r-input);
  background: var(--surface); font-size: var(--t-body);
}
textarea.input { min-height: 7rem; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--danger); background: #FFFBFA; }
.err { color: var(--danger); font-weight: 700; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.err:empty { display: none; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.code-input { font-size: 1.75rem; letter-spacing: .4em; text-align: center; font-weight: 800; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.seg button, .seg a {
  min-height: var(--tap); border: 0; border-radius: 10px; background: transparent;
  font-weight: 700; color: var(--muted); text-decoration: none; display: grid; place-items: center; padding: 4px 8px; text-align: center;
}
.seg [aria-selected="true"], .seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28,27,25,.12); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 4rem; padding: 10px var(--s2); }
.switch-row .row-main { font-weight: 700; }
.switch {
  flex: none; position: relative; width: 4rem; height: 2.25rem; min-height: var(--tap); border: 0; background: transparent; padding: 0;
}
.switch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2.25rem; transform: translateY(-50%); border-radius: var(--r-full); background: var(--border-strong); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 50%; left: 4px; width: 1.75rem; height: 1.75rem; transform: translateY(-50%); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch[aria-checked="true"]::before { background: var(--primary); }
.switch[aria-checked="true"]::after { left: calc(100% - 1.75rem - 4px); }
.switch:focus-visible { background: transparent; }
.switch:focus-visible::before { background: var(--primary-press); }
.switch[aria-checked="false"]:focus-visible::before { background: #B3A692; }

.stepper { display: flex; align-items: center; gap: var(--s2); justify-content: center; }
.stepper button { width: var(--tap-lg); height: var(--tap-lg); border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; }
.stepper button[disabled] { opacity: .4; cursor: not-allowed; }
.stepper output { min-width: 3.5rem; text-align: center; font-size: 2.25rem; font-weight: 800; }

/* ---------- Detail pieces ---------- */
.info { display: grid; gap: 0; }
.info-row { display: flex; gap: var(--s2); padding: var(--s2); align-items: flex-start; }
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row > .ic { color: var(--primary); margin-top: 2px; }
.info-strong { font-weight: 700; font-size: var(--t-label); }
.muted { color: var(--muted); }
.hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-card); margin-bottom: var(--s2); background: var(--surface-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 2.5rem; padding: 4px 12px; border-radius: var(--r-full); background: var(--surface-2); font-weight: 700; }
.people { display: flex; flex-wrap: wrap; gap: 12px var(--s2); padding: var(--s2); }
.person { display: flex; align-items: center; gap: 8px; }
.avatar {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: var(--t-body); background: var(--primary);
}
.avatar.lg { width: 5rem; height: 5rem; font-size: 1.75rem; }
.avatar-btn { border: 0; padding: 4px; border-radius: var(--r-full); background: transparent; display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-weight: 700; color: var(--primary); }
.role { display: inline-block; padding: 2px 10px; border-radius: var(--r-full); background: var(--surface-2); font-weight: 700; color: var(--ink); }
.role.admin { background: var(--primary-tint); color: var(--primary); }
.role.organizer { background: var(--action-tint); color: var(--action-press); }

.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.counts div { background: var(--surface); padding: 12px var(--s2); }
.counts b { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1.1; }

/* Contribution items */
.item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 14px var(--s2); }
.item:hover { background: #FCFAF6; }
.item-top { display: flex; justify-content: space-between; gap: var(--s1); align-items: baseline; flex-wrap: wrap; }
.item-label { font-weight: 700; font-size: var(--t-label); }
.item-count { font-weight: 700; color: var(--muted); }
.item-count.done { color: var(--success); display: inline-flex; gap: 4px; align-items: center; }
.bar { height: 10px; border-radius: var(--r-full); background: var(--surface-3); margin: 10px 0 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.item-names { color: var(--muted); }
.item-names b { color: var(--ink); }

/* Decision options */
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: var(--s2); width: 100%; text-align: left;
  min-height: 4.5rem; padding: 14px var(--s2);
  border: 2px solid var(--border); border-radius: var(--r-card); background: var(--surface);
  font-size: var(--t-label); font-weight: 700;
}
.option[aria-checked="true"] { border-color: var(--primary); background: var(--primary-tint); }
.option[disabled] { cursor: default; }
.option .mark { flex: none; width: 1.75rem; height: 1.75rem; border: 2px solid var(--border-strong); border-radius: 50%; display: grid; place-items: center; background: #fff; }
.option.multi .mark { border-radius: 8px; }
.option[aria-checked="true"] .mark { background: var(--primary); border-color: var(--primary); color: #fff; }
.option .opt-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.option .opt-sub { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-body); }
.tally { font-weight: 700; color: var(--muted); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: var(--s2); border-radius: var(--r-card); background: var(--success-tint); color: #1F4A28; font-weight: 700; margin-bottom: var(--s2); }
.notice.warn { background: var(--action-tint); color: #6E2A17; }
.notice.danger { background: var(--danger-tint); color: #6E1911; }
.notice.info { background: var(--primary-tint); color: var(--primary-press); }
.notice p { font-weight: 400; margin-top: 4px; }

.result { padding: var(--s2); }
.result + .result { border-top: 1px solid var(--border); }
.result-top { display: flex; justify-content: space-between; gap: var(--s1); font-weight: 700; font-size: var(--t-label); flex-wrap: wrap; }
.result.win .bar span { background: var(--action); }
.winner { display: inline-flex; align-items: center; gap: 4px; color: var(--action-press); }

/* ---------- States ---------- */
.empty, .error-state { text-align: center; padding: var(--s6) var(--s2); display: grid; justify-items: center; gap: var(--s2); }
.empty-ic { width: 4.5rem; height: 4.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); }
.error-state .empty-ic { background: var(--danger-tint); color: var(--danger); }
.empty p, .error-state p { font-size: var(--t-label); max-width: 24rem; }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-row { display: flex; gap: var(--s2); align-items: center; padding: 14px var(--s2); }
.skel-line { height: 1rem; margin: 6px 0; }
.offline-banner { display: flex; gap: 10px; align-items: center; padding: 12px var(--s2); background: var(--ink); color: #fff; font-weight: 700; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(28, 27, 25, .45); z-index: 60; animation: fade .18s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 92vh; max-height: 92dvh; overflow: auto;
  background: var(--canvas); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px var(--s2) max(var(--s3), env(safe-area-inset-bottom));
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 12px; }
.sheet h2 { font-size: var(--t-h2); font-weight: 800; margin-bottom: var(--s1); overflow-wrap: anywhere; }
.sheet .sheet-body { margin-bottom: var(--s3); }
.sheet-close { position: absolute; top: 8px; right: 8px; }
.sheet-actions { display: grid; gap: var(--s1); }
.danger-gap { height: var(--s3); }
.link-box { display: flex; align-items: center; gap: 8px; padding: 12px var(--s2); border-radius: var(--r-input); border: 1.5px dashed var(--border-strong); background: var(--surface); font-weight: 700; overflow-wrap: anywhere; margin-bottom: var(--s2); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h, 72px) + 96px); z-index: 80; display: grid; justify-items: center; pointer-events: none; padding: 0 var(--s2); }
.toast { display: flex; align-items: center; gap: 10px; max-width: 30rem; padding: 14px var(--s2); border-radius: var(--r-card); background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: up .22s ease-out; }
.toast .ic { color: #9FD6AE; }
.toast.err .ic { color: #F5A99F; }

/* ---------- Onboarding + guest ---------- */
.no-tabs #main { padding-bottom: 0; }
.solo { max-width: 560px; margin: 0 auto; }
.welcome { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: var(--s3) var(--s3) max(var(--s3), env(safe-area-inset-bottom)); }
.welcome-top { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--s2); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--t-h3); color: var(--primary); }
.brand-mark { width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--primary); display: grid; place-items: center; }
.display { font-size: var(--t-display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; }
.lede { font-size: var(--t-h3); color: var(--muted); max-width: 30rem; }
.steps { color: var(--muted); font-weight: 700; margin-bottom: var(--s1); }
.greeting { display: flex; gap: 12px; align-items: flex-start; padding: var(--s2); margin-bottom: var(--s3); }
.greeting q { quotes: "\201C" "\201D"; font-size: var(--t-label); }
.done-panel { text-align: center; padding: var(--s4) var(--s2); display: grid; justify-items: center; gap: var(--s2); }
.done-ic { width: 5rem; height: 5rem; border-radius: 50%; background: var(--success-tint); color: var(--success); display: grid; place-items: center; }
.guest-foot { color: var(--muted); text-align: center; padding: var(--s3) var(--s2); }

/* ---------- Demo controls (prototype only, not part of the product) ---------- */
.demo-btn { position: fixed; left: 0; top: 30%; z-index: 90; writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 4px; border: 0; border-radius: 0 10px 10px 0; background: #2B2A27; color: #fff; font-weight: 700; font-size: 13px; opacity: .8; }
.demo-btn:hover { opacity: 1; }
.demo-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); z-index: 95; overflow: auto; background: #1F1E1C; color: #F2EEE7; padding: 16px; font-size: 15px; box-shadow: -8px 0 24px rgba(0,0,0,.25); }
.demo-panel h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #A79F94; margin: 18px 0 8px; }
.demo-panel .dseg { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-panel button { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid #45423D; background: #2B2A27; color: #F2EEE7; font-size: 15px; font-weight: 600; }
.demo-panel button[aria-pressed="true"] { background: #F2EEE7; color: #1F1E1C; border-color: #F2EEE7; }
.demo-panel p { color: #A79F94; margin: 6px 0 0; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  .content { padding: 0 var(--s3) var(--s4); }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, 92vw); transform: translate(-50%, -50%); border-radius: var(--r-sheet); padding: var(--s2) var(--s3) var(--s3); animation: fade .18s ease-out; }
  .sheet .grabber { display: none; }
  .split { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; min-height: 100vh; }
  .pane-list { position: sticky; top: 0; height: calc(100vh - var(--nav-h, 0px)); overflow: auto; border-right: 1px solid var(--border); }
  .pane-detail { min-width: 0; }
  .pane-detail .page { max-width: 720px; }
  .split-empty { display: grid; place-items: center; min-height: 70vh; text-align: center; color: var(--muted); padding: var(--s3); }
}
@media (min-width: 1024px) {
  .app:not(.no-tabs) { display: grid; grid-template-columns: 248px 1fr; }
  #main { padding-bottom: 0; min-width: 0; }
  .tabs {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
    padding: var(--s3) 12px; border-top: 0; border-right: 1px solid var(--border);
  }
  .tabs .rail-brand { display: inline-flex; margin: 0 8px var(--s3); }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: var(--tap-lg); padding: 0 12px; border-radius: var(--r-input); font-size: var(--t-label); }
  .tab-ic { width: auto; height: auto; background: none !important; }
  .tab[aria-current="page"] { background: var(--primary-tint); }
  .sticky-bar { bottom: 0; }
  .pane-list { height: 100vh; }
  #toast-root { bottom: var(--s4); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tab { min-height: 3.5rem; flex-direction: row; gap: 8px; }
  .tab-ic { width: auto; }
  .welcome-top { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Tab bar keeps a fixed size at large text sizes, like the system tab bars; content above it scales. */
.tabs .tab { min-height: 72px; min-width: 0; padding: 6px 2px; }
.tabs .tab-ic { width: 56px; height: 32px; }
html.large-text .tabs .tab-ic { height: 28px; }
@media (min-width: 1024px) { .tabs .tab { min-height: 56px; padding: 0 12px; } .tabs .tab-ic { width: auto; height: auto; } }

/* =====================================================================
   Direction 2: one loud color (our blue) with black, white and greys.
   Huge numbers with tiny units, stacked and notched cards, chunky pills,
   round buttons, hatched empty space, real faces.
   ===================================================================== */
body { letter-spacing: -0.005em; }
.title { font-weight: 800; letter-spacing: -0.035em; }
.section-head h2 { letter-spacing: -0.025em; }
.card { border-color: transparent; }
.list > * + * { border-top-color: var(--surface-3); }

/* Chunky pills */
.btn { border-radius: var(--r-full); padding: 12px 28px; }
.btn-secondary { background: var(--surface); border: 1.5px solid var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--surface-3); }
.btn-quiet { background: var(--surface-3); }
.btn-danger-text { border-color: var(--danger); border-width: 1.5px; }
.seg { border-radius: var(--r-full); background: var(--surface-3); padding: 5px; }
.seg button, .seg a { border-radius: var(--r-full); }
.seg [aria-selected="true"], .seg [aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.pill { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 6px 16px; border-radius: var(--r-full); font-weight: 700; }
.pill-blue { background: var(--action); color: #fff; }
.pill-light { background: #fff; color: var(--ink); }
.pill-outline { border: 1.5px solid #4A4A52; color: #fff; }
.chip { background: var(--surface); }
.role { background: var(--surface-3); }
.role.admin { background: var(--ink); color: #fff; }
.role.organizer { background: var(--action); color: #fff; }
.badge { background: var(--action); }
.input, select.input, textarea.input { border: 1.5px solid var(--surface-3); background: #fff; }

/* RSVP: big pills, blue when chosen */
.rsvp button { border-radius: var(--r-full); border: 1.5px solid var(--ink); background: #fff; }
.rsvp button[aria-pressed="true"] { background: var(--action); border-color: var(--action); }
.rsvp button[aria-pressed="true"]:focus-visible { background: var(--action-press); }

/* Round buttons: back, topbar actions, chevrons */
.back .ic, .btn-text .ic { box-sizing: content-box; padding: 8px; border-radius: 50%; background: #fff; }
.back:hover, .btn-text:hover { background: transparent; }
.back:hover .ic, .btn-text:hover .ic { background: var(--surface-3); }
.row-end .ic { color: var(--ink); width: 18px; height: 18px; padding: 7px; border-radius: 50%; background: var(--surface-2); box-sizing: content-box; }
.row-icon { border-radius: 50%; background: var(--action-tint); color: var(--action); }
.row-icon.green { background: var(--surface-3); color: var(--ink); }
.date-chip { border-radius: 18px; background: var(--ink); color: #fff; }
.row.is-selected { background: var(--action-tint); }
.round-btn {
  position: absolute; right: 8px; bottom: -28px; z-index: 2;
  width: 3.5rem; height: 3.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; text-decoration: none;
}
.round-btn:hover, .round-btn:focus-visible { background: var(--action); }

/* Hero cards: huge numbers, tiny units */
.hero-card { display: block; position: relative; border-radius: 28px; padding: 22px 22px 24px; text-decoration: none; color: inherit; }
.hero-card.blue { background: var(--action); color: #fff; }
.hero-card.dark { background: var(--ink); color: #fff; }
.eyebrow-light { display: block; font-weight: 700; opacity: .8; }
.hero-title { display: block; font-size: var(--t-h2); font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.big { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 4rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin: 14px 0 10px; }
.big small { font-size: var(--t-body); font-weight: 700; letter-spacing: 0; opacity: .85; }
.hero-meta { display: block; font-weight: 600; opacity: .9; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-row .big { margin: 6px 0 0; font-size: 3rem; }

/* Notch: a half-circle bite in the bottom edge that holds the round button */
.notch-wrap { position: relative; }
.notch { -webkit-mask: radial-gradient(circle 36px at calc(100% - 36px) 100%, transparent 35px, #000 36px); mask: radial-gradient(circle 36px at calc(100% - 36px) 100%, transparent 35px, #000 36px); padding-bottom: 36px; }
.hero-stack { margin-top: var(--s2); }
.overlap { margin-top: -18px; padding-top: 36px; z-index: 0; }
.hero-stack .notch-wrap { z-index: 1; }
.date-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.date-hero .big { font-size: 3.5rem; }

/* Real faces, overlapping */
.avatar { position: relative; overflow: hidden; border: 2.5px solid #fff; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.face-stack { display: inline-flex; }
.face-stack .avatar + .avatar { margin-left: -14px; }
.hero-card .avatar, .card-dark .avatar { border-color: var(--ink); }
.avatar.more { background: var(--action) !important; font-size: 15px; }

/* Dark card: who's coming */
.card-dark { background: var(--ink); color: #fff; }
.card-dark .counts { background: #2A2A31; border-bottom-color: #2A2A31; }
.card-dark .counts div { background: var(--ink); color: #B9B9C2; font-weight: 600; }
.card-dark .counts b { color: #fff; font-size: 2.75rem; letter-spacing: -0.04em; }
.card-dark .counts div:first-child b { color: #7FA0FF; }
.faint { color: #B9B9C2; }
.counts b { font-size: 2.25rem; letter-spacing: -0.04em; }

/* Hatched empty space */
.bar { height: 14px; background: var(--hatch), var(--surface-2); }
.bar span { background: var(--action); }
.result.win .bar span { background: var(--ink); }
.item-count .num { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.item-count small { font-size: var(--t-body); }
.item-count.done { color: var(--action); }
.empty, .error-state { background: var(--hatch), var(--surface-2); border-radius: var(--r-card); margin-top: var(--s2); }
.empty-ic { background: #fff; color: var(--ink); }
.split-empty { background: var(--hatch); border-radius: var(--r-card); margin: var(--s3); }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; }

/* Option cards */
.option { border-radius: 22px; border-color: transparent; }
.option[aria-checked="true"] { border-color: var(--action); background: var(--action-tint); }
.option[aria-checked="true"] .mark { background: var(--action); border-color: var(--action); }
.winner { color: var(--action); }

/* Notices in the palette */
.notice { color: var(--ink); background: var(--action-tint); border-radius: 22px; }
.notice > .ic { color: var(--action); }
.notice.warn { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.notice.warn > .ic { color: var(--ink); }
.notice.danger { color: #7A1A1E; }
.notice.danger > .ic { color: var(--danger); }
.notice.info { background: var(--surface-3); color: var(--ink); }
.notice.info > .ic { color: var(--ink); }
.done-ic { background: var(--action); color: #fff; }
.switch[aria-checked="true"]::before { background: var(--action); }
.switch:focus-visible::before { background: var(--action-press); }
.stepper button { border: 0; background: var(--ink); color: #fff; }
.stepper output { font-size: 3rem; letter-spacing: -0.04em; }
.toast .ic { color: #7FA0FF; }
.toast { border-radius: var(--r-full); padding: 14px 22px; }
.brand { color: var(--ink); }
.brand-mark { background: var(--action); border-radius: 50%; }
.link-box { border-radius: var(--r-full); border-color: var(--border-strong); }

/* Floating black tab bar */
.tabs {
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  padding: 6px; border: 0; border-radius: 32px; background: var(--ink);
}
.tabs .tab { min-height: 64px; color: #A8A8B2; border-radius: 26px; }
.tabs .tab[aria-current="page"] { color: #fff; }
.tabs .tab[aria-current="page"] .tab-ic { background: var(--action); }
.tabs .tab:focus-visible { background: #2A2A31; }
.sticky-bar { border-top: 0; }
@media (min-width: 1024px) {
  .tabs { left: auto; right: auto; bottom: auto; top: 12px; margin: 12px; height: calc(100vh - 24px); border-radius: 32px; padding: var(--s3) 12px; }
  .tabs .rail-brand { color: #fff; }
  .tabs .tab { min-height: 56px; }
  .tabs .tab[aria-current="page"] { background: var(--action); }
  .tabs .tab[aria-current="page"] .tab-ic { background: none; }
}
@media (min-width: 768px) {
  .date-hero .big { font-size: 4.5rem; }
}
html.large-text .big { font-size: 3rem; }
html.large-text .date-hero { grid-template-columns: 1fr; }
/* Fit the floating bar on narrow phones; the RSVP bar's background runs under it so nothing shows through the gap. */
.tabs { left: 8px; right: 8px; padding: 4px; }
.tabs .tab { padding: 6px 0; }
.tab-label { font-weight: 600; letter-spacing: -0.02em; }
.sticky-bar { bottom: 0; padding-bottom: calc(var(--nav-h, 0px) + 12px); background: var(--canvas); }
.no-tabs .sticky-bar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.card-dark .counts { grid-template-columns: 1fr 1fr; }
@media (min-width: 1024px) { .sticky-bar { padding-bottom: 12px; } }
