/*
  Wedding HQ, the couple's and the WO's dashboard. Mobile first: every screen is designed for a phone held in one
  hand, then given room on wider screens (a sidebar from 960px, the detail sheet as a side panel from 768px).
  · One primary action per screen; secondary actions live in the detail sheet.
  · Status words and colours mean the same thing everywhere: Coming · Awaiting reply · Not coming · Arrived.
  · Chart colours are validated (dataviz validate_palette.js): categorical #2f8657 #c98f1f #b35a78 #4a6fb5 pass on
    #fffefa (the ochre is under 3:1, so every chart that uses it prints its labels and has a table view); the
    ordinal sage ramp (--seq-*) passes for funnel steps. Text never takes a series colour.
  · Built for reading at a glance: a clean system sans for every word and number, the invitation's inks and deep
    sage as the one accent, white cards on a quiet background. The invitation's Bodoni and Italianno appear only in
    the C&M monogram. Status chips stay neutral with a coloured dot; colour is saved for the charts.
*/
@font-face { font-family: 'Oakwood Bodoni'; src: url('/frontend/assets/fonts/bodoni-moda-vf.woff2') format('woff2'); font-style: normal; font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Oakwood Bodoni'; src: url('/frontend/assets/fonts/bodoni-moda-vf-italic.woff2') format('woff2'); font-style: italic; font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Oakwood Signature'; src: url('/frontend/assets/fonts/italianno-regular.woff2') format('woff2'); font-display: swap; }

:root {
  --bg: #f5f6f3; --surface: #ffffff; --surface-2: #fafaf8; --sunken: #f0f1ed;
  --line: #e4e6e1; --line-strong: #d3d7d0; --grid: #eceee9;
  --ink: #26352b; --ink-2: #3d4e42; --muted: #5b6b5e; --faint: #7d887f;
  --brand: #3c5444; --brand-hover: #304638; --brand-soft: #edf1ec; --on-brand: #ffffff;
  --rose: #8e6964; --rose-soft: #f5ebe8;
  --danger: #a3313b; --danger-soft: #fbecec;
  --ring: #b8862a;
  /* Data colours: identity, never text. */
  --series-coming: #2f8657; --series-awaiting: #c98f1f; --series-declined: #b35a78; --series-4: #4a6fb5; --series-none: #cfcabe;
  --seq-1: #86b593; --seq-2: #5f9c76; --seq-3: #3a7f57; --seq-4: #1f5c3c; --seq-5: #123f28;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px #1b261f0d;
  --shadow-lg: 0 12px 40px #1b261f26, 0 2px 6px #1b261f14;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: var(--font);
  --brand-serif: 'Oakwood Bodoni', 'Bodoni 72', Didot, Georgia, serif;
  --script: 'Oakwood Signature', 'Snell Roundhand', cursive;
  --track-label: .16em;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --tabbar-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { font-optical-sizing: auto; font-kerning: normal; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
/* Labels: small, sentence case, muted. Easy to scan, never shouting. */
.kicker, .stat-label, .hero-label, .filter-group legend, .sub-head, .row-divider, .facts dt, .split-table th, .table-view th { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field > span small { font-weight: 400; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.monogram { font: 400 1.5rem/1 var(--brand-serif); letter-spacing: -.06em; color: var(--ink); }
.monogram i { font: 400 1.25em/0 var(--script); color: var(--rose); padding: 0 .04em; }
.monogram.small { font-size: 1.2rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s, border-color .15s, transform .12s var(--ease); -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--brand); padding: 0 10px; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--surface); border-color: #e3c3c6; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { min-height: 52px; font-size: 16px; border-radius: 12px; padding: 0 20px; }
.btn-xl { min-height: 64px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; padding: 8px 4px; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunken); }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; }

/* ---------- Fields ---------- */
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field > span { font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.field > span small, .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.field input, .field select, .field textarea, .search input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 16px; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #2f5d4626; }
.form-error { min-height: 1.2em; margin: 0 0 12px; color: var(--danger); font-size: .88rem; }
.form-error:empty { min-height: 0; margin: 0; }

/* ---------- Sign in ---------- */
.login { min-height: 100dvh; display: grid; align-content: center; gap: 28px; padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); background: var(--bg); }
.login-intro { max-width: 460px; }
.login-intro .monogram { font-size: 2.4rem; }
.kicker { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-intro h1 { margin: 0; font: 700 2rem/1.15 var(--font); letter-spacing: -.025em; }
.login-intro h1 em { font-style: normal; color: var(--brand); }
.lede { margin: 12px 0 0; color: var(--muted); }
.login-card { position: relative; width: 100%; max-width: 420px; padding: 28px 22px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 4px; font: 700 1.5rem/1.2 var(--font); letter-spacing: -.015em; }
.login-card > .muted { margin: 0 0 20px; }
.login-pets { display: block; width: 150px; height: auto; margin: -64px 0 4px auto; }
@media (min-width: 860px) { .login { grid-template-columns: 1fr minmax(360px, 420px); max-width: 1000px; margin: 0 auto; align-items: center; gap: 64px; } .login-intro h1 { font-size: 2.6rem; } }

/* ---------- The workspace frame ---------- */
.workspace { min-height: 100dvh; }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: env(safe-area-inset-top) 8px 0 16px; background: #f5f6f3eb; backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.appbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; font-weight: 700; }
.appbar-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.sync.is-stale { color: var(--danger); }
.sync::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--series-coming); vertical-align: 1px; }
.sync.is-stale::before { background: var(--danger); }
.sync:empty::before { display: none; }
.menu { position: absolute; top: calc(100% + 4px); right: 8px; z-index: 30; min-width: 240px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--sunken); }
.menu .menu-head { padding: 10px 12px 8px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.preview-banner, .offline-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; font-size: .88rem; }
.preview-banner { background: #eef1f6; color: #2f3e58; }
.offline-banner { background: var(--danger-soft); color: #7d2730; }
.content { padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); max-width: 1120px; outline: none; }
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px 4px env(safe-area-inset-bottom); background: #fffefbf2; backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tabbar button { display: grid; justify-items: center; gap: 2px; min-height: 56px; padding: 6px 2px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: .7rem; font-weight: 650; }
.tabbar button .icon { width: 22px; height: 22px; }
.tabbar button[aria-current="page"] { color: var(--brand); }
.tabbar button[aria-current="page"] .icon { stroke-width: 2.2; }
.sidebar { display: none; }
@media (min-width: 960px) {
  .workspace { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; }
  .sidebar { display: flex; flex-direction: column; grid-row: 1 / -1; position: sticky; top: 0; height: 100dvh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface-2); }
  .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: var(--ink); text-decoration: none; font-weight: 700; }
  .brand small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
  .side-nav { display: grid; gap: 2px; }
  .side-nav button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-weight: 600; text-align: left; }
  .side-nav button:hover { background: var(--sunken); }
  .side-nav button[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
  .sidebar-foot { margin-top: auto; padding: 8px; }
  .appbar { padding-left: 32px; }
  .appbar .monogram, .appbar .sync { display: none; }
  .tabbar { display: none; }
  .content { padding: 28px 32px 64px; }
}

/* ---------- Page structure ---------- */
.page-head { display: grid; gap: 14px; margin: 0 0 20px; }
.page-head h1 { margin: 0; font: 700 1.75rem/1.2 var(--font); letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 720px) { .page-head { grid-template-columns: 1fr auto; align-items: end; } .page-head h1 { font-size: 2rem; } }
.section { margin: 28px 0 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-title h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.section-title p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 12px; }
.grid-2 { display: grid; gap: 12px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.note { padding: 12px 14px; border-radius: 12px; background: var(--sunken); color: var(--ink-2); font-size: .88rem; }
.note.warn { background: #fbf4e4; color: #5a3f0a; }
.note.info { background: var(--brand-soft); color: var(--brand); }

/* Segmented control: the event, or a page's tabs. */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--sunken); }
.seg button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 650; font-size: .9rem; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #1f2a241f; }
.seg-wide { display: flex; width: 100%; } .seg-wide button { flex: 1; }

/* ---------- Figures ---------- */
.hero { display: grid; gap: 4px; }
.hero-label { font-size: .9rem; color: var(--muted); font-weight: 600; }
.hero-value { font: 700 3.25rem/1 var(--font); letter-spacing: -.025em; color: var(--ink); }
.hero-sub { color: var(--muted); font-size: .9rem; }
.meter { height: 10px; margin-top: 14px; border-radius: 99px; background: #dfeae2; overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--fill, 0%); border-radius: inherit; background: var(--series-coming); transition: width .4s var(--ease); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat-label { display: block; font-size: .82rem; color: var(--muted); }
.stat-value { display: block; margin-top: 4px; font: 700 1.6rem/1.1 var(--font); letter-spacing: -.015em; color: var(--ink); }
.stat-sub { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }

/* The entity flow, one step after another: invited → sent → replied → coming → arrived. */
.flow { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.flow li { position: relative; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; }
.flow li + li::before { content: ''; position: absolute; left: 13px; top: -10px; height: 20px; width: 2px; background: var(--line-strong); }
.flow .step-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); font-size: .75rem; font-weight: 700; }
.flow .step-dot.is-done { background: var(--brand); color: #fff; }
.flow b { font-weight: 650; }
.flow small { display: block; color: var(--muted); font-size: .8rem; }
.flow .step-num { font: 700 1.3rem/1 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.flow .step-num small { font-weight: 500; }
@media (min-width: 860px) {
  .flow { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
  .flow li { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-items: start; padding: 0; }
  .flow li + li::before { left: -14px; top: 13px; width: 18px; height: 2px; }
  .flow .step-num { text-align: left; font-size: 1.6rem; }
}

/* ---------- Status chips: a mark for identity, words for meaning ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.coming { background: var(--sunken); color: var(--ink); }
.chip.coming::before { background: var(--series-coming); opacity: 1; }
.chip.awaiting { background: var(--sunken); color: var(--ink); }
.chip.awaiting::before { background: var(--series-awaiting); opacity: 1; }
.chip.declined { background: var(--sunken); color: var(--ink); }
.chip.declined::before { background: var(--series-declined); opacity: 1; }
.chip.arrived { background: var(--brand); color: #fff; }
.chip.arrived::before { background: #fff; }
.chip.plain::before, .chip.no-dot::before { display: none; }
.prio { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; border: 1.5px solid #9aa39d; color: #4b544e; }
.prio[data-p="1"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.prio[data-p="2"] { background: #5b665f; border-color: #5b665f; color: #fff; }
.prio[data-p="3"] { background: var(--surface); }
.prio.none { border-style: dashed; color: var(--faint); }

/* ---------- Find & filter ---------- */
.finder { position: sticky; top: 57px; z-index: 10; display: flex; gap: 8px; margin: 0 -16px 10px; padding: 10px 16px; background: #f5f6f3f0; backdrop-filter: blur(8px); }
@media (min-width: 960px) { .finder { margin: 0 0 10px; padding: 10px 0; top: 57px; } }
.search { position: relative; flex: 1; min-width: 0; }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input { padding-left: 44px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.filter-button { position: relative; min-width: 48px; min-height: 48px; padding: 0 14px; border-radius: 12px; }
.filter-button .count-badge { position: absolute; top: -6px; right: -6px; }
@media (max-width: 420px) { .filter-button .label { display: none; } .filter-button { padding: 0 12px; } }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-size: .85rem; font-weight: 600; }
.filter-chip .icon { width: 16px; height: 16px; }
.result-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; font-size: .88rem; color: var(--muted); }
.result-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.filter-group { margin: 0 0 20px; border: 0; padding: 0; }
.filter-group legend { margin: 0 0 8px; padding: 0; font-size: 14px; font-weight: 650; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 12px; cursor: pointer; }
.check-row:hover { background: var(--sunken); }
.check-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; }
.check-row span { flex: 1; }
.check-row small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Lists ---------- */
.list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 14px 12px 16px; border: 0; border-top: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; }
.row:first-child { border-top: 0; }
button.row:hover, .row.is-tappable:hover { background: var(--surface-2); }
.row-main { display: block; flex: 1; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 650; color: var(--ink); }
.row-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.row .chev { color: var(--faint); }
.gb-no { flex: none; min-width: 46px; font: 600 11px/1 var(--font); letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--muted); }
.gb-no b { display: block; margin-top: 4px; font-size: 1.15rem; letter-spacing: 0; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.row-divider { padding: 14px 16px 8px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 14px; font-weight: 650; color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* Pagination. */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 0; }
.pager-pages { display: none; gap: 4px; }
.pager-pages button, .pager-pages span { min-width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager-pages span { display: grid; place-items: center; color: var(--faint); }
.pager-pages button[aria-current="page"] { background: var(--ink); color: #fff; }
.pager-status { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .pager-pages { display: flex; } .pager-status.compact { display: none; } }

/* ---------- The detail sheet: from the bottom on a phone, a side panel on wider screens ---------- */
.sheet { width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .28s var(--ease); }
.sheet::backdrop { background: #1a241f70; backdrop-filter: blur(2px); }
.sheet-inner { display: flex; flex-direction: column; min-height: 0; max-height: 94dvh; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.sheet-head::before { content: ''; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-strong); }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { margin: 0; font: 700 1.25rem/1.3 var(--font); letter-spacing: -.01em; }
.sheet-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 20px; overscroll-behavior: contain; }
.sheet-foot { display: grid; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot.two { grid-template-columns: 1fr 1fr; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 768px) {
  .sheet { width: 480px; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 22px 0 0 22px; }
  .sheet[open] { animation-name: sheet-in; }
  .sheet-inner { max-height: 100dvh; height: 100%; }
  .sheet-head::before { display: none; }
  @keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
}
.facts { display: grid; gap: 0; margin: 0 0 16px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.action-list { display: grid; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.action-list button { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 0; border-top: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 600; }
.action-list button:first-child { border-top: 0; }
.action-list button:hover { background: var(--surface-2); }
.action-list button .chev { margin-left: auto; color: var(--faint); }
.action-list button.danger { color: var(--danger); }
.sub-head { margin: 22px 0 8px; font-size: 14px; font-weight: 650; color: var(--muted); }

/* A big count for the day: 56px steps around a number you can read across a table. */
.big-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 6px; }
.big-stepper button { width: 64px; height: 64px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); }
.big-stepper button .icon { width: 26px; height: 26px; }
.big-stepper button:disabled { opacity: .35; }
.big-stepper output { min-width: 3ch; font: 700 3rem/1 var(--font); color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.stepper-caption { margin: 0 0 18px; text-align: center; color: var(--muted); font-size: .88rem; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills label { position: relative; }
.pills input { position: absolute; opacity: 0; inset: 0; }
.pills span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-weight: 600; font-size: .92rem; cursor: pointer; }
.pills input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pills input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ---------- Toast with an undo ---------- */
.toast { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .22s var(--ease); }
.toast span { flex: 1; }
.toast button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: #ffffff1f; color: #fff; font-weight: 700; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* ---------- Charts ---------- */
.chart { margin: 0; }
.chart-head { margin: 0 0 12px; }
.chart-head h3 { margin: 0; font-size: 1rem; }
.chart-head p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .84rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend b { font-variant-numeric: tabular-nums; }
/* Tall segmented bar: one whole, split into its parts. */
.segbar { display: flex; gap: 2px; height: 28px; }
.segbar > div { position: relative; min-width: 0; height: 100%; border-radius: 4px; background: var(--c); transition: filter .15s; }
.segbar > div:hover, .segbar > div:focus-visible { filter: brightness(1.08); outline-offset: 2px; }
.segbar > div span { position: absolute; left: 8px; top: 50%; translate: 0 -50%; font-size: .75rem; font-weight: 700; color: var(--on, #fff); white-space: nowrap; }
.segbar.is-empty > div { background: var(--series-none); }
/* Horizontal bars: thin, rounded at the value end, square at the baseline. */
.hbars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hbars li { display: grid; gap: 5px; }
.hbar-label { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.hbar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-label small { color: var(--muted); font-weight: 500; }
.hbar-track { height: 14px; }
.hbar-track i { display: block; height: 100%; width: var(--w); min-width: 2px; border-radius: 0 4px 4px 0; background: var(--c, var(--series-coming)); }
/* Funnel: one ordinal sage per step, the step-to-step rate beside it, the biggest drop called out. */
.funnel { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.funnel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.funnel .f-label { font-size: .9rem; font-weight: 600; }
.funnel .f-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.funnel .f-value small { font-weight: 500; color: var(--muted); }
.funnel .f-track { grid-column: 1 / -1; height: 20px; }
.funnel .f-track i { display: block; height: 100%; width: var(--w); min-width: 2px; border-radius: 0 4px 4px 0; background: var(--c); }
.funnel .f-rate { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.funnel .f-rate.is-drop { color: #7c3b52; font-weight: 650; }
/* Columns over time (SVG). */
.cols-svg { display: block; width: 100%; height: auto; overflow: visible; }
.cols-svg .grid { stroke: var(--grid); stroke-width: 1; }
.cols-svg .axis-text { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.cols-svg .col { fill: var(--c, var(--series-4)); }
.cols-svg .hit { fill: transparent; cursor: crosshair; }
.cols-svg .hit:hover + .col, .cols-svg .hit:focus + .col { filter: brightness(1.12); }
.cols-svg .line { fill: none; stroke: var(--c, var(--series-coming)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cols-svg .area { fill: var(--c, var(--series-coming)); opacity: .1; }
.cols-svg .end-dot { fill: var(--c, var(--series-coming)); stroke: var(--surface); stroke-width: 2; }
.cols-svg .crosshair { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
.chart-tip { position: fixed; z-index: 80; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: .8rem; box-shadow: var(--shadow-lg); max-width: 240px; }
.chart-tip b { display: block; font-size: 1rem; }
.chart-tip span { color: #d9e0db; }
.table-view { margin: 12px 0 0; font-size: .85rem; }
.table-view summary { cursor: pointer; color: var(--brand); font-weight: 650; min-height: 32px; display: inline-flex; align-items: center; }
.table-view table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view th { font-weight: 650; color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* Side table on the summary. */
.split-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.split-table th, .split-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.split-table th:first-child, .split-table td:first-child { text-align: left; padding-left: 0; }
.split-table th { font-size: .78rem; font-weight: 650; color: var(--muted); }
.split-table tr:last-child td { border-bottom: 0; }

/* ---------- Activity: one household's visits ---------- */
.timeline { display: grid; gap: 14px; }
.visit { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.visit-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.visit-head b { display: block; }
.visit-head small { color: var(--muted); }
.steps { margin: 0; padding: 6px 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 52px 18px 1fr; gap: 8px; align-items: start; padding: 6px 14px; font-size: .88rem; }
.steps time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; padding-top: 1px; }
.steps i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--c, var(--line-strong)); }
.steps .k-rsvp { --c: var(--series-coming); }
.steps .k-trouble { --c: var(--series-declined); }
.steps .k-section { --c: var(--series-4); }
.steps .k-media { --c: var(--series-awaiting); }
.steps small { color: var(--muted); }

/* ---------- Photo queue, for the day ---------- */
.stage { display: grid; gap: 12px; }
.stage-card { padding: 20px; border-radius: 22px; background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.stage-card .kicker { margin: 0; color: #d6e6db; }
.stage-card h2 { margin: 6px 0 4px; font: 700 1.75rem/1.15 var(--font); letter-spacing: -.02em; overflow-wrap: anywhere; }
.stage-card p { margin: 0 0 16px; color: #e3eee6; }
.stage-card .btn-xl { background: #fff; color: var(--brand); }
.stage-card.is-empty { background: var(--surface); color: var(--ink); border: 1px dashed var(--line-strong); }
.stage-card.is-empty .kicker, .stage-card.is-empty p { color: var(--muted); }
.stage-card.is-empty .btn-xl { background: var(--brand); color: #fff; }
.next-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--series-awaiting); border-radius: 14px; background: var(--surface); }
.next-card b { display: block; font-size: 1.05rem; }
.next-card small { color: var(--muted); }
.queue-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.q-item { position: relative; overflow: hidden; border-radius: 16px; background: var(--brand); }
.q-item .q-under { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 18px; color: #fff; font-weight: 700; }
.q-face { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); touch-action: pan-y; transition: transform .2s var(--ease); }
.q-face.is-dragging { transition: none; }
.q-pos { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--sunken); font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.q-main { flex: 1; min-width: 0; }
.q-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-main small { color: var(--muted); }
.swipe-hint { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: .8rem; }

/* ---------- Review: one invitation at a time ---------- */
.review { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.review-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--muted); }
.review-progress .meter { flex: 1; margin: 0; height: 6px; }
.review-card { padding: 22px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); touch-action: pan-y; transition: transform .2s var(--ease), opacity .2s; }
.review-card.is-dragging { transition: none; }
.review-card h2 { margin: 0; font: 700 1.5rem/1.2 var(--font); letter-spacing: -.015em; overflow-wrap: anywhere; }
.review-card .salute { margin: 4px 0 16px; color: var(--muted); }
.prio-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prio-pick button { min-height: 56px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); font-weight: 700; }
.prio-pick button small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }
.prio-pick button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.prio-pick button[aria-pressed="true"] small { color: #d9dcda; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Team ---------- */
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Printing the paper guest book ---------- */
.print-sheet { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .workspace, .login, .sheet, .toast, .chart-tip { display: none !important; }
  .print-sheet { display: block; color: #000; font: 10.5pt/1.35 var(--font); }
  .print-sheet h1 { font: 400 20pt var(--display); margin: 0 0 4pt; }
  .print-sheet p { margin: 0 0 10pt; }
  .print-sheet table { width: 100%; border-collapse: collapse; }
  .print-sheet th, .print-sheet td { border: .5pt solid #888; padding: 5pt 6pt; text-align: left; vertical-align: top; }
  .print-sheet th { background: #eee; }
  .print-sheet tr { break-inside: avoid; }
  .print-sheet .box { width: 46pt; }
  .print-sheet.qr { text-align: center; padding-top: 30mm; }
  .print-sheet.qr canvas, .print-sheet.qr img { width: 90mm; height: 90mm; }
}

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

/* ---------- Before you send ---------- */
.ready-card { margin-bottom: 14px; }
.ready-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ready-head h3 { margin: 0; font-size: 1.05rem; }
.ready-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.ready-pct { font: 700 1.5rem/1 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.todo { display: grid; margin: 14px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.todo li + li { border-top: 1px solid var(--line); }
.todo button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; background: var(--surface); text-align: left; }
.todo button:hover { background: var(--surface-2); }
.todo-mark { width: 10px; height: 10px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); }
.todo-mark.is-needed { border-color: var(--series-awaiting); background: var(--series-awaiting); }
.todo-text { flex: 1; min-width: 0; font-size: 15px; }
.todo-text small { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.todo .chev { color: var(--faint); }
.ready-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.row-missing { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.row-missing::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; border: 1.5px solid var(--faint); vertical-align: 1px; }
.row-missing.is-blocking { color: #5a3f0a; }
.row-missing.is-blocking::before { border-color: var(--series-awaiting); background: var(--series-awaiting); }

/* ---------- Selecting several ---------- */
.row-check { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 2px solid var(--line-strong); border-radius: 7px; color: #fff; }
.row.is-picked { background: var(--brand-soft); }
.row.is-picked .row-check { background: var(--brand); border-color: var(--brand); }
.result-line .btn-link { padding: 4px 0; }
.bulk-bar { position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.bulk-bar > span { flex: 1; }
@media (min-width: 960px) { .bulk-bar { left: calc(248px + 32px); bottom: 24px; } }

/* ---------- Forms: errors by the field, and a summary that takes focus ---------- */
.field-error { min-height: 0; font-size: 13px; color: var(--danger); }
.field-error:empty { display: none; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.error-summary { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e3c3c6; border-radius: 12px; background: var(--danger-soft); color: #7d2730; font-size: 14px; }
.error-summary ul { margin: 6px 0 0; padding-left: 18px; }
.error-summary a { color: inherit; }
.hint { margin: 6px 0 0; }
.insert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 16px; }
.insert-row .filter-chip { padding: 0 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.meter.thin { display: block; height: 6px; margin-top: 8px; }

/* ---------- Messages ---------- */
.message-grid { display: grid; gap: 12px; }
@media (min-width: 860px) { .message-grid { grid-template-columns: 1fr 1fr; } }
.message-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.message-top h3 { margin: 0; font-size: 1.05rem; }
.message-top p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.message-count { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.message-card .meter { margin-top: 8px; }
.message-snippet { margin: 12px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.message-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sending-head { display: grid; gap: 10px; margin: 0 0 12px; }
.sending-head h2 { margin: 0; font-size: 1.3rem; }
.sending-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.sending-head .btn-ghost { justify-self: start; padding-left: 0; }

/* ---------- The message as it arrives: three chat apps' look, no logos ---------- */
.phone { max-width: 340px; margin: 0 auto; border: 8px solid #1a1c1b; border-radius: 34px; background: #1a1c1b; box-shadow: var(--shadow-lg); overflow: hidden; }
.chat-screen { display: flex; flex-direction: column; height: 520px; border-radius: 26px; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.chat-top { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 12px; }
.chat-top b { display: block; font-size: 15px; line-height: 1.2; }
.chat-top small { display: block; font-size: 12px; opacity: .8; }
.chat-top .icon { width: 20px; height: 20px; }
.chat-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #c8cdd0; color: #fff; }
.chat-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px; }
.chat-day { align-self: center; margin: 2px 0 8px; padding: 3px 10px; border-radius: 8px; font-size: 11.5px; }
.bubble { max-width: 86%; align-self: flex-end; font-size: 14.5px; line-height: 1.38; overflow-wrap: anywhere; }
.bubble-text { white-space: pre-wrap; }
.bubble-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -4px 10px; font-size: 11px; }
.ticks { width: 16px; height: 10px; }
.chat-link { text-decoration: underline; }
.link-card { overflow: hidden; }
.link-card img { display: block; width: 100%; aspect-ratio: 1.91; object-fit: cover; background: #ddd; }
.link-text { display: grid; gap: 2px; padding: 7px 9px; }
.link-text b { font-size: 13.5px; line-height: 1.3; }
.link-text span { font-size: 12.5px; line-height: 1.35; }
.link-text small { font-size: 12px; }
.chat-input { display: flex; align-items: center; gap: 8px; padding: 8px 10px 12px; }
.chat-input span { flex: 1; padding: 9px 14px; border-radius: 22px; font-size: 14px; }
.chat-input i { flex: none; width: 38px; height: 38px; border-radius: 50%; }
/* WhatsApp-style */
.app-whatsapp .chat-top { background: #008069; color: #fff; }
.app-whatsapp .chat-body { background: #efeae2 radial-gradient(#d9d2c5 1px, transparent 1.2px) 0 0 / 18px 18px; }
.app-whatsapp .chat-day { background: #fff; color: #54656f; box-shadow: 0 1px .5px #0b141a21; }
.app-whatsapp .bubble.out { padding: 5px 7px 7px 9px; border-radius: 8px 0 8px 8px; background: #d9fdd3; color: #111b21; box-shadow: 0 1px .5px #0b141a21; }
.app-whatsapp .link-card { margin: 0 -4px 6px -6px; border-radius: 6px; background: #d1f4cc; }
.app-whatsapp .link-text span, .app-whatsapp .link-text small, .app-whatsapp .bubble-meta { color: #667781; }
.app-whatsapp .ticks { color: #53bdeb; }
.app-whatsapp .chat-link { color: #027eb5; }
.app-whatsapp .chat-input { background: #f0f2f5; }
.app-whatsapp .chat-input span { background: #fff; color: #8696a0; }
.app-whatsapp .chat-input i { background: #00a884; }
/* Telegram-style */
.app-telegram .chat-top { background: #fff; color: #000; border-bottom: 1px solid #e7e7e7; justify-content: space-between; text-align: center; }
.app-telegram .chat-top > div { flex: 1; }
.app-telegram .chat-top small { color: #8d8e90; opacity: 1; }
.app-telegram .tg-back { display: inline-flex; align-items: center; color: #3390ec; font-size: 15px; }
.app-telegram .chat-body { background: linear-gradient(160deg, #cfe0b4 0%, #a9c98f 45%, #d9e3a5 100%); }
.app-telegram .chat-day { background: #00000030; color: #fff; }
.app-telegram .bubble.out { padding: 6px 9px 7px 10px; border-radius: 16px 16px 4px 16px; background: #effdde; color: #000; }
.app-telegram .link-card { margin: 6px 0 2px; padding-left: 8px; border-left: 3px solid #4fae4e; border-radius: 3px; }
.app-telegram .link-card img { order: 2; margin-top: 6px; border-radius: 6px; }
.app-telegram .link-card { display: flex; flex-direction: column; }
.app-telegram .link-text { padding: 0; }
.app-telegram .link-text small { order: -1; color: #4fae4e; font-weight: 600; font-size: 13px; }
.app-telegram .link-text span { color: #000; }
.app-telegram .bubble-meta, .app-telegram .ticks { color: #4fae4e; }
.app-telegram .chat-link { color: #168acd; }
.app-telegram .chat-input { background: #fff; border-top: 1px solid #e7e7e7; }
.app-telegram .chat-input span { border: 1px solid #e1e1e1; color: #a2a2a2; }
.app-telegram .chat-input i { background: #3390ec; }
/* Instagram-style */
.app-instagram .chat-top { background: #fff; color: #000; border-bottom: 1px solid #efefef; }
.app-instagram .chat-top small { color: #737373; opacity: 1; }
.app-instagram .chat-body { background: #fff; }
.app-instagram .chat-day { color: #737373; }
.app-instagram .bubble.out { padding: 9px 13px; border-radius: 22px; background: linear-gradient(160deg, #a033ff 0%, #5b51d8 55%, #3797f0 100%); color: #fff; }
.app-instagram .bubble.out .chat-link { color: #fff; }
.app-instagram .bubble.is-card { padding: 0; background: #efefef; color: #000; border-radius: 18px; overflow: hidden; }
.app-instagram .link-text small, .app-instagram .link-text span { color: #737373; }
.app-instagram .seen { align-self: flex-end; margin: 2px 4px 0; color: #737373; font-size: 12px; }
.app-instagram .chat-input { background: #fff; }
.app-instagram .chat-input span { border: 1px solid #dbdbdb; color: #737373; }
.app-instagram .chat-input i { order: -1; background: #3797f0; width: 34px; height: 34px; }
.link-card.is-plain .link-text b { font-size: 13px; }

/* ---------- The horizontal funnel ---------- */
.funnel-svg { display: block; width: 100%; height: auto; overflow: visible; }
.funnel-svg .f-num { fill: var(--ink); font: 700 19px var(--font); font-variant-numeric: lining-nums; }
.funnel-svg .f-share { fill: var(--muted); font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.funnel-svg .f-name { fill: var(--ink-2); font: 600 12.5px var(--font); }
.funnel-svg .f-pill rect { fill: #fffdfa; stroke: #ead9de; stroke-width: 1; }
.funnel-svg .f-pill text { fill: var(--ink); font: 700 11.5px var(--font); font-variant-numeric: tabular-nums; }
.funnel-svg .f-pill.is-drop rect { fill: #fbe9ee; stroke: #c46184; stroke-width: 1.5; }
.funnel-svg .f-pill.is-drop text { fill: #7c2f50; }
.funnel-svg .hit { fill: transparent; }
.funnel-svg .hit:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.f-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.f-note span { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #fbe9ee; border: 1.5px solid #c46184; }

/* =====================================================================================================
   Spring garden. Pastel washes over a soft paper texture, watercolour flowers at the edges (never behind a
   number), pastel tints for tiles and chips with dark ink on them (4.5:1 or better), one deep sage for actions.
   Rounded, soft-pressed surfaces; the artwork is the invitation's own.
   ===================================================================================================== */
:root {
  --bg: #fbf7f2; --surface: #fffdfa; --surface-2: #fdf9f5; --sunken: #f6f0ea;
  --line: #efe5de; --line-strong: #e2d5cc; --grid: #f0e8e1;
  --blush: #fbe8ee; --blush-line: #f3d2dc; --blush-ink: #7d3e55;
  --powder: #e7effb; --powder-line: #d2def2; --powder-ink: #34507d;
  --butter: #fdf3d6; --butter-line: #f1e0ad; --butter-ink: #634910;
  --mint: #e5f3ea; --mint-line: #cbe5d4; --mint-ink: #285c3e;
  --lilac: #efe9f9; --lilac-line: #dcd1f0; --lilac-ink: #523f80;
  --radius: 20px;
  --shadow: 0 1px 2px #6b4a5a0f, 0 6px 22px -8px #6b4a5a1f;
  --shadow-lg: 0 18px 50px -12px #5a3c4a40, 0 2px 6px #5a3c4a14;
}
body { background: radial-gradient(ellipse 55% 38% at 100% 0%, #f8dbe5b3, transparent 72%), radial-gradient(ellipse 50% 40% at 0% 42%, #dfe8f8b3, transparent 72%), radial-gradient(ellipse 48% 36% at 92% 100%, #faefcab3, transparent 72%), var(--bg); background-attachment: fixed; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url('/frontend/assets/pastel-paper.webp') center / 720px; opacity: .32; mix-blend-mode: multiply; }
.card, .list, .stat { border-radius: var(--radius); }
.card { background: #fffdfaf2; }
.btn { border-radius: 14px; transition: background .15s, border-color .15s, transform .2s var(--ease), box-shadow .2s; }
.btn-primary { box-shadow: 0 2px 0 #2b3f31, 0 6px 14px -6px #3c544480; }
.btn-primary:active { box-shadow: 0 1px 0 #2b3f31; transform: translateY(1px); }
.btn-secondary { background: #fffdfa; border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--blush); border-color: var(--blush-line); }

/* Flowers: the sidebar's corner, each page's heading, the headline card. Decorative only. */
.sidebar { background: #fffdfacc; backdrop-filter: blur(8px); overflow: hidden; }
.sidebar::after { content: ''; position: absolute; left: -36px; bottom: -40px; width: 230px; height: 345px; background: url('/frontend/assets/botanical-spray.webp') left bottom / contain no-repeat; opacity: .55; pointer-events: none; }
.sidebar-foot { position: relative; z-index: 1; }
.page-head { position: relative; }
.page-head::before { content: ''; position: absolute; right: -6px; top: -22px; width: 150px; height: 50px; background: url('/frontend/operations/dashboard-flowers.webp') center / contain no-repeat; opacity: .9; pointer-events: none; }
@media (min-width: 720px) { .page-head::before { right: auto; left: calc(min(60ch, 70%) - 40px); top: -26px; width: 170px; height: 57px; } }
.page-head h1 { position: relative; }
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #fffdfa 40%, #fdf0f4); }
.hero::after { content: ''; position: absolute; right: -30px; top: -14px; width: 280px; height: 92px; background: url('/frontend/assets/spring-garland.webp') right top / contain no-repeat; opacity: .5; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.meter { background: #f1e6ea; }
.empty::before { content: ''; display: block; width: 160px; height: 54px; margin: 0 auto 10px; background: url('/frontend/operations/dashboard-flowers.webp') center / contain no-repeat; }
.login { background: radial-gradient(ellipse 60% 40% at 100% 0%, #f8dbe5, transparent 70%), radial-gradient(ellipse 60% 45% at 0% 100%, #dfe8f8, transparent 70%), var(--bg); position: relative; overflow: hidden; }
.login::after { content: ''; position: absolute; left: -60px; bottom: -60px; width: 300px; height: 450px; background: url('/frontend/assets/botanical-spray.webp') left bottom / contain no-repeat; opacity: .5; pointer-events: none; }
.login > * { position: relative; z-index: 1; }
.login-card { background: #fffdfaf2; border-radius: 26px; }

/* Pastel tiles, in turn, with their own ink. */
.stats > .stat:nth-child(4n+1) { background: var(--blush); border-color: var(--blush-line); }
.stats > .stat:nth-child(4n+2) { background: var(--powder); border-color: var(--powder-line); }
.stats > .stat:nth-child(4n+3) { background: var(--butter); border-color: var(--butter-line); }
.stats > .stat:nth-child(4n+4) { background: var(--mint); border-color: var(--mint-line); }
.stats > .stat:nth-child(4n+1) .stat-label, .stats > .stat:nth-child(4n+1) .stat-sub { color: var(--blush-ink); }
.stats > .stat:nth-child(4n+2) .stat-label, .stats > .stat:nth-child(4n+2) .stat-sub { color: var(--powder-ink); }
.stats > .stat:nth-child(4n+3) .stat-label, .stats > .stat:nth-child(4n+3) .stat-sub { color: var(--butter-ink); }
.stats > .stat:nth-child(4n+4) .stat-label, .stats > .stat:nth-child(4n+4) .stat-sub { color: var(--mint-ink); }
.card > .stats > .stat { box-shadow: none; }

/* Chips: soft pastel with their own ink, a dot for the state. */
.chip { background: var(--sunken); color: var(--ink-2); }
.chip.coming { background: var(--mint); color: var(--mint-ink); }
.chip.awaiting { background: var(--butter); color: var(--butter-ink); }
.chip.declined { background: var(--blush); color: var(--blush-ink); }
.chip.plain { background: var(--lilac); color: var(--lilac-ink); }

/* Navigation by phase. */
.side-nav { position: relative; z-index: 1; }
.nav-phase { margin: 16px 12px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-nav button[aria-current="page"] { background: var(--blush); color: var(--blush-ink); }
.side-nav button:hover { background: #fbeff2; }
.tabbar { background: #fffdfaf0; }
.tabbar button[aria-current="page"] { color: var(--blush-ink); }
.tabbar button[aria-current="page"] .icon { background: var(--blush); border-radius: 12px; padding: 3px 10px; width: 44px; height: 28px; }
.phase-tabs { display: flex; align-items: center; gap: 10px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.phase-name { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.phase-links { display: flex; gap: 6px; }
.phase-links button { flex: none; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 99px; background: #fffdfa; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.phase-links button[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (min-width: 960px) { .phase-tabs { display: none !important; } }
.seg { background: #f3ecf0; }

/* The one sentence before the charts. */
.insight { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: -4px 0 16px; padding: 12px 14px; border-radius: 16px; background: #fffdfacc; border: 1px solid var(--blush-line); color: var(--ink); font-size: 15.5px; line-height: 1.45; }
.insight .icon { color: var(--blush-ink); }
.insight span { flex: 1 1 220px; }
.chart-head h3 { font-size: 1.05rem; line-height: 1.3; }

/* Pax: two fields side by side. */
.pax-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pax-pair .field { margin-bottom: 8px; }
.pax-quick { margin-top: 4px; }
.pax-quick .sub-head { margin-top: 18px; }

/* The storyline. */
.story { margin-top: 22px; }
.note-form { display: grid; gap: 8px; margin-bottom: 12px; }
.note-form textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 14px; background: #fffdfa; font: 15px/1.45 var(--font); resize: vertical; }
.note-form .btn { justify-self: end; }
.story-lines { position: relative; display: grid; gap: 0; margin: 0; padding: 0 0 0 4px; list-style: none; }
.story-lines::before { content: ''; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.story-line { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 8px 0; }
.story-line i { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--surface); background: var(--line-strong); box-shadow: 0 0 0 1px var(--line-strong); }
.story-line p { margin: 0; font-size: 15px; color: var(--ink); }
.story-line small { color: var(--muted); font-size: 13px; }
.story-line .btn-link { padding: 0; font-size: 13px; }
.story-kind { font-weight: 700; }
.story-line.k-note i { background: #d9839f; box-shadow: 0 0 0 1px #d9839f; }
.story-line.k-rsvp i { background: var(--series-coming); box-shadow: 0 0 0 1px var(--series-coming); }
.story-line.k-message i { background: var(--series-4); box-shadow: 0 0 0 1px var(--series-4); }
.story-line.k-gift i { background: var(--series-awaiting); box-shadow: 0 0 0 1px var(--series-awaiting); }
.story-line.k-arrival i { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.story-line.k-trouble i { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.story-line.k-note p { padding: 8px 10px; border-radius: 12px; background: var(--blush); }
.couple-accounts { margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .btn-primary:active { transform: none; } }

/* ---------- One seamless canvas ----------
   The paper is laid once across the whole screen (never tiled, so no seams), the washes are wide and soft, and
   every bar (top, search, sidebar, tabs) is the page's own colour, translucent, fading into it rather than ruled
   off with a different tint. */
body { background: radial-gradient(120% 70% at 100% -10%, #f9dfe8 0%, #f9dfe800 55%), radial-gradient(110% 80% at -15% 45%, #e1eaf8 0%, #e1eaf800 55%), radial-gradient(100% 70% at 95% 115%, #fbf1d3 0%, #fbf1d300 55%), #fbf7f2; background-attachment: fixed; }
body::before { background: url('/frontend/assets/pastel-paper.webp') center / cover no-repeat; opacity: .22; filter: blur(.4px); }
.appbar { background: #fbf7f2b8; border-bottom: 0; box-shadow: 0 10px 18px -16px #6b4a5a55; }
.finder { background: linear-gradient(#fbf7f2e6 70%, #fbf7f200); }
.tabbar { background: #fffdfacc; border-top: 0; box-shadow: 0 -10px 22px -18px #6b4a5a66; }
.sidebar { background: #fffdfa73; border-right: 0; box-shadow: 18px 0 30px -30px #6b4a5a66; }
.preview-banner, .offline-banner { border-radius: 0 0 16px 16px; }

/* ---------- Chain of Gratitude ---------- */
.transfer-row { align-items: flex-start; }
.transfer-row .row-title small { margin-left: auto; font-weight: 500; font-size: 13px; }
.match-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.suggestion { display: grid; gap: 1px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--mint-line); border-radius: 14px; background: var(--mint); color: var(--mint-ink); text-align: left; }
.suggestion b { font-size: 14px; color: var(--ink); }
.suggestion span { font-size: 12px; font-variant-numeric: tabular-nums; }
.suggestion:hover { border-color: var(--series-coming); }
.amount-field { display: flex; align-items: center; gap: 6px; flex: none; width: 150px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fffdfa; color: var(--muted); font-size: 14px; }
.amount-field input { width: 100%; min-height: 44px; border: 0; background: none; font: 600 16px var(--font); font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.amount-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px #3c544426; }
.amount-field input.is-saved { color: var(--series-coming); }
@media (max-width: 420px) { .amount-field { width: 128px; } }
/* Segmented labels stay on one line; a long row scrolls sideways instead of wrapping. */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: 1 0 auto; padding: 0 12px; }

/* The personal link, in full: open it or copy it, and see that it copied. */
.link-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin: 0 0 16px; padding: 10px 10px 10px 14px; border: 1px solid var(--powder-line); border-radius: 14px; background: var(--powder); }
.link-label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--powder-ink); }
.link-box a { min-width: 0; overflow-wrap: anywhere; color: var(--powder-ink); font-weight: 600; font-size: 14.5px; text-underline-offset: 3px; }
.link-box .btn { min-height: 40px; padding: 0 12px; }
.link-box .btn.is-done { background: var(--mint); border-color: var(--mint-line); color: var(--mint-ink); }

/* Categories, edited in place on the invitation panel. */
.cat-edit { margin-top: 18px; }
.cat-edit .pills { gap: 6px; }
.cat-edit .pills span { min-height: 38px; padding: 0 12px; font-size: 14px; }
.cat-add { display: flex; gap: 8px; margin-top: 10px; }
.cat-add input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fffdfa; font-size: 16px; }

/* ===== Sides and priorities: validated colours (dataviz validate_palette.js on #fffdfa) =====
   Sides are identity: Christian blue, Monica coral (adjacent CVD ΔE 17.6). "Both" is the two, striped.
   Priority is ordinal: one violet hue, light to dark, P1 darker than P3 (--ordinal passes). */
:root {
  --side-christian: #4a6fb5; --side-monica: #be708f; --side-none: #cfcabe;
  --side-both: repeating-linear-gradient(135deg, #4a6fb5 0 5px, #be708f 5px 10px);
  --prio-0: #3c2a74; --prio-1: #5c44a4; --prio-2: #7d63c6; --prio-3: #a08bdc;
  --serif-display: 'Oakwood Bodoni', Georgia, 'Times New Roman', serif;
}
.prio { min-width: 34px; height: 28px; border-radius: 9px; font-size: .78rem; }
.prio[data-p="0"] { background: var(--prio-0); border-color: var(--prio-0); color: #fff; }
.prio[data-p="1"] { background: var(--prio-1); border-color: var(--prio-1); color: #fff; }
.prio[data-p="2"] { background: var(--prio-2); border-color: var(--prio-2); color: #fff; }
.prio[data-p="3"] { background: var(--prio-3); border-color: var(--prio-3); color: #21173f; }
.prio.none { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted); }
.prio-pick button[data-prio="1"][aria-pressed="true"] { background: var(--prio-1); border-color: var(--prio-1); }
.prio-pick button[data-prio="2"][aria-pressed="true"] { background: var(--prio-2); border-color: var(--prio-2); }
.prio-pick button[data-prio="3"][aria-pressed="true"] { background: var(--prio-3); border-color: var(--prio-3); color: #21173f; }
.prio-pick button[data-prio="3"][aria-pressed="true"] small { color: #3a2d66; }

/* ===== Invitation rows: the name; what it is (category, pax, events ticked by the reply); where it stands ===== */
.inv-row { align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; }
.inv-row .row-check { margin-top: 1px; }
.inv-row .chev { align-self: center; }
.inv-name { display: block; font-size: 16px; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.inv-formal { font-weight: 700; letter-spacing: -.005em; }
.inv-amp { font-family: var(--serif-display); font-style: italic; font-weight: 500; font-size: 17px; color: var(--blush-ink); white-space: nowrap; }
.inv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.fact { display: inline-flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.fact .icon { width: 15px; height: 15px; color: var(--faint); }
.fact b { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.fact .of { margin-left: -4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fact.is-empty { color: var(--muted); font-style: italic; }
.side-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--c); }
.side-dot.is-empty { background: transparent; border: 1.5px dashed var(--faint); }

/* The category: one tag, root first (Keluarga / Teman), then its branch and circle. */
.cat-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-width: 0; height: 24px; padding: 0 9px 0 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fffdfacc; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.cat-chip .icon { width: 14px; height: 14px; flex: none; }
.cat-chip b { font-weight: 700; color: var(--ink); }
.cat-chip .cat-step { overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.cat-chip .cat-step::before { content: '›'; margin-right: 5px; color: var(--faint); }
.cat-chip.is-family { border-color: var(--blush-line); }
.cat-chip.is-family .icon { color: var(--blush-ink); }
.cat-chip.is-friends { border-color: var(--powder-line); }
.cat-chip.is-friends .icon { color: var(--powder-ink); }
.cat-chip.is-loose, .cat-chip.is-none { border-style: dashed; color: var(--muted); }
.cat-chip.is-none { font-style: italic; }

/* Events: one small box each, ticked by the reply. */
.ev-boxes { display: inline-flex; gap: 10px; }
.ev-box { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ev-box i, .ev-key { display: inline-grid; place-items: center; width: 15px; height: 15px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--surface); }
.ev-box .icon, .ev-key .icon { width: 11px; height: 11px; stroke-width: 3; }
.ev-box b { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.ev-box.is-coming i, .ev-key.is-coming { border-color: var(--series-coming); background: var(--series-coming); color: #fff; }
.ev-box.is-arrived i { border-color: var(--brand); background: var(--brand); color: #fff; }
.ev-box.is-declined { color: var(--muted); }
.ev-box.is-declined i { border-color: var(--blush-line); background: var(--blush); color: var(--blush-ink); }

/* Where it stands: one round icon per track. Shape carries the state; colour repeats it. */
.inv-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.tracks { display: inline-flex; gap: 5px; }
.tk { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 26px; height: 26px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--ink-2); }
.tk .icon { width: 14px; height: 14px; stroke-width: 2; }
.tk.has-count { width: auto; padding: 0 8px 0 6px; }
.tk b { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tk.is-dashed { border-style: dashed; border-color: var(--faint); background: transparent; color: var(--faint); }
.tk.is-ring { border-color: var(--ink-2); color: var(--ink); }
.tk.is-sent { border-color: var(--powder-line); background: var(--powder); color: var(--powder-ink); }
.tk.is-done { border-color: var(--mint-line); background: var(--mint); color: var(--mint-ink); }
.tk.is-arrived { border-color: var(--brand); background: var(--brand); color: #fff; }
.tk.is-wait { border-color: var(--butter-line); background: var(--butter); color: var(--butter-ink); }
.tk.is-bad { border-color: var(--blush-ink); background: var(--blush); color: var(--blush-ink); }
.tk.is-std { border-color: var(--lilac-line); background: var(--lilac); color: var(--lilac-ink); }
.tk.is-std-ring { border-color: var(--lilac-ink); color: var(--lilac-ink); }
.tk.is-off { border-color: var(--line); background: transparent; color: var(--faint); opacity: .7; }
.inv-missing { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.inv-missing .icon { width: 14px; height: 14px; flex: none; }
.inv-missing span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-missing.is-blocking { color: var(--butter-ink); }
.inv-missing.is-blocking .icon { color: var(--series-awaiting); }

/* The key, once, above the list. */
.track-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 2px 10px; font-size: 12px; color: var(--muted); }
.track-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.track-legend .tk { width: 22px; height: 22px; }
.track-legend .tk .icon { width: 12px; height: 12px; }
.legend-shapes .shape { display: inline-block; width: 11px; height: 11px; margin-left: 4px; border: 1.5px solid var(--ink-2); border-radius: 50%; }
.legend-shapes .shape.is-dashed { border-style: dashed; border-color: var(--faint); }
.legend-shapes .shape.is-done { border-color: var(--mint-line); background: var(--mint-ink); }
.legend-boxes .ev-key { width: 13px; height: 13px; margin-left: 4px; }
@media (min-width: 900px) {
  .inv-row .row-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 18px; }
  .inv-row .inv-name, .inv-row .inv-meta { grid-column: 1; }
  .inv-row .inv-foot { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; margin-top: 0; }
}

/* ===== "Untuk …": the formal name and the "& …", in the invitation's italic ===== */
.amp-pick .pills { gap: 6px; }
.amp-pick .pills span { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.amp-name { margin-top: 10px; }
.addressed { display: grid; gap: 2px; margin: 2px 0 16px; padding: 12px 14px; border: 1px solid var(--blush-line); border-radius: 14px; background: var(--blush); }
.addressed > span:first-child { font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--blush-ink); }
.addressed-line { font-family: var(--serif-display); font-size: 1.2rem; line-height: 1.35; color: var(--ink); }
.addressed-line small { font-size: .9rem; color: var(--muted); }
.sheet-head .untuk { color: var(--muted); }
.sheet-head #sheet-untuk { font-family: var(--serif-display); font-size: 1.05rem; color: var(--blush-ink); }
.addr-edit { margin: 0 0 18px; }
.addr-edit .btn { margin-top: 10px; }

/* ===== Summary: categories, one card per side (a meter list on one shared scale) ===== */
.kicker { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 4px; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meters { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; list-style: none; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.meter-row:hover { background: var(--surface-2); }
.meter-row:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.meter-row.is-loose { color: var(--muted); cursor: default; }
.meter-name { overflow: hidden; font-size: .9rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.meter-fig { font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-fig small { margin-left: 6px; color: var(--muted); font-size: .78rem; }
.meter-track { grid-column: 1 / -1; display: block; height: 10px; margin-top: 6px; }
.meter-track i { display: block; width: var(--w); min-width: 3px; height: 100%; overflow: hidden; border-radius: 0 4px 4px 0; background: var(--c); }
.meter-track b { display: block; width: var(--d); height: 100%; background: color-mix(in srgb, var(--c), #1b1b1b 45%); }
.meter-row.is-loose .meter-track i { background: var(--series-none); }
.meters-more { margin-top: 6px; }
.cat-note { margin: 10px 2px 0; }

.detail-tabs { flex: none; align-self: stretch; margin: 4px 20px 0; }
.detail-tabs button, .follow-actions button { min-height: 44px; }
.category-tree { min-width: 0; border: 0; margin: 18px 0; padding: 0; }
.category-tree > legend { margin-bottom: 8px; font-weight: 700; }
.category-children { padding-inline-start: 15px; border-inline-start: 2px solid var(--line); }
.route-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.dispatch-list { padding: 0; list-style: none; }
.dispatch-list li, .follow-row { padding: 12px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dispatch-list span, .follow-row small { display: block; color: var(--muted); }
.dispatch-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.follow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; }
#review-batch { margin-block: 8px 14px; }

.inv-row[data-inv-side="christian"] { --row-wash: #eaf3fc; --row-accent: #a9c9ed; }
.inv-row[data-inv-side="monica"] { --row-wash: #fceef3; --row-accent: #e8b9cb; }
.inv-row[data-inv-side="both"] { --row-wash: linear-gradient(100deg, #eaf3fc, #fceef3); --row-accent: #c9bddc; }
.inv-row[data-inv-side] { background: var(--row-wash, var(--surface)); border-inline-start: 3px solid var(--row-accent, transparent); }
button.inv-row[data-inv-side]:hover, button.inv-row[data-inv-side].is-picked { background: var(--row-wash, var(--surface-2)); box-shadow: inset 0 0 0 2px var(--row-accent, var(--line)); }

/* ===== The invitation panel: what they see ===== */
.preview { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; margin: 0 0 18px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.preview-phone { position: relative; width: 132px; height: 262px; overflow: hidden; border: 5px solid var(--ink); border-radius: 22px; background: var(--bg); box-shadow: var(--shadow); }
.preview-phone iframe { position: absolute; top: 0; left: 0; width: 375px; height: 745px; border: 0; transform: scale(.325); transform-origin: 0 0; pointer-events: none; }
.preview-hit { position: absolute; inset: 0; border: 0; background: transparent; cursor: zoom-in; }
.preview-hit:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.preview-side { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.preview-side .kicker { margin: 0; }
.preview-untuk { margin: 0; font-family: var(--serif-display); font-size: 1.12rem; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.preview-untuk small { font-size: .85rem; color: var(--muted); }
.preview-untuk em { color: var(--blush-ink); }
.preview-side .hint { margin: 0; }
.preview-dialog { width: min(420px, 100vw); height: min(860px, 100dvh); max-width: 100vw; max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 22px; background: var(--ink); overflow: hidden; }
.preview-dialog::backdrop { background: #1d26208c; backdrop-filter: blur(3px); }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; color: #fff; }
.preview-bar div { display: grid; min-width: 0; }
.preview-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar small { color: #c9d2cc; font-size: .78rem; }
.preview-bar .icon-btn { color: #fff; }
.preview-dialog iframe { flex: 1; width: 100%; border: 0; border-radius: 16px 16px 0 0; background: var(--bg); }
@media (max-width: 600px) { .preview-dialog { width: 100vw; height: 100dvh; border-radius: 0; } }

/* ===== Delivery: where each track stands, and the one thing to do next ===== */
.delivery-card { display: grid; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.dtrack { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.dtrack:first-child { border-top: 0; }
.dtrack > .tk { width: 32px; height: 32px; }
.dtrack > .tk .icon { width: 16px; height: 16px; }
.dtrack-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.dtrack-head h4 { margin: 0; font-size: .8rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dtrack-state { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0; font-size: .95rem; color: var(--ink); }
.dtrack-state b { font-weight: 700; }
.dtrack-state span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.btn-sm { min-height: 36px; padding: 0 14px; border-radius: 11px; font-size: .86rem; }
.mini-steps { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; margin: 10px 0 0; padding: 0; list-style: none; }
.mini-steps li { position: relative; display: grid; justify-items: center; gap: 4px; font-size: 11px; color: var(--faint); }
.mini-steps li::before { content: ''; position: absolute; top: 4px; right: 50%; width: 100%; height: 2px; background: var(--line-strong); }
.mini-steps li:first-child::before { display: none; }
.mini-steps i { position: relative; z-index: 1; width: 10px; height: 10px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.mini-steps li.is-done { color: var(--ink-2); }
.mini-steps li.is-done::before, .mini-steps li.is-next::before { background: var(--brand); }
.mini-steps li.is-done i { border-color: var(--brand); background: var(--brand); }
.mini-steps li.is-next { color: var(--ink); font-weight: 700; }
.mini-steps li.is-next i { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mini-steps li.is-bad { color: var(--blush-ink); font-weight: 700; }
.mini-steps li.is-bad i { border-color: var(--blush-ink); background: var(--blush); }
.dtrack-add { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); justify-content: flex-start; color: var(--lilac-ink); }
.dtrack-add .icon { width: 16px; height: 16px; }
.route { display: grid; gap: 8px; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.route-line { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .92rem; color: var(--ink); }
.route-line .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }
.route-line small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.route-line i { color: var(--muted); }
.route .btn-link { justify-self: start; }

/* ===== The printed copy's sheet ===== */
.ship-address { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.ship-address p { margin: 0 0 4px; }
.ship-steps { margin: 0 0 16px; padding: 0; border: 0; }
.ship-steps legend { margin-bottom: 8px; font-weight: 700; }
.ship-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ship-tile { position: relative; }
.ship-tile input { position: absolute; inset: 0; opacity: 0; }
.ship-tile span { display: grid; justify-items: center; gap: 4px; min-height: 64px; padding: 10px 4px 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); text-align: center; color: var(--ink-2); }
.ship-tile .icon { width: 20px; height: 20px; }
.ship-tile b { font-size: 11.5px; font-weight: 650; line-height: 1.2; }
.ship-tile input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.ship-tile input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }
.courier-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.courier-quick .filter-chip { padding: 0 12px; }
.courier-quick .filter-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
@media (max-width: 360px) { .ship-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ===== Choosing who gets the Save the Date ===== */
.aud-quick { margin: 0 0 10px; }
.aud-quick span { min-height: 38px; padding: 0 12px; font-size: .86rem; }
.aud-cat { margin: 0 0 10px; }
.aud-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 28px; margin: 0 0 6px; font-size: .86rem; color: var(--muted); }
.aud-list { display: grid; }
.aud-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 2px; border-top: 1px solid var(--line); }
.aud-row input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.aud-main { display: grid; gap: 2px; min-width: 0; }
.aud-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; }
.aud-main .abroad { padding: 0 6px; border-radius: 99px; background: var(--powder); color: var(--powder-ink); font-weight: 700; }

/* Matrimonix · Atelier wordmark, on the sign-in screen. */
.wordmark { margin: 10px 0 2px; font-family: var(--serif-display); font-size: 1.05rem; letter-spacing: .02em; color: var(--muted); }
.wordmark b { font-style: italic; font-weight: 500; color: var(--blush-ink); }

/* ===== The panel header: Edit sits beside Close, the same on every tab ===== */
.sheet-head > .sheet-head-actions { display: flex; flex: none; align-items: center; gap: 6px; }
.head-edit { gap: 6px; }
.head-edit .icon { width: 16px; height: 16px; }

/* ===== Identity, read-only ===== */
.id-facts { display: grid; margin: 0 0 16px; }
.id-facts div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.id-facts dt { font-size: .82rem; color: var(--muted); }
.id-facts dd { margin: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.id-facts .prio { margin-right: 4px; vertical-align: 1px; }
.id-facts .cat-chip { vertical-align: middle; }

/* ===== Delivery: send from, and recording a reply ===== */
.send-from { margin-top: 10px; font-size: .86rem; color: var(--muted); }
.send-from:empty { display: none; }
.send-from label, .send-from { display: flex; align-items: center; gap: 8px; }
.send-from select { min-height: 36px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; }
.reply-events { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; }
.reply-events legend { margin-bottom: 8px; font-weight: 700; }
.reply-event { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.reply-event > span { display: grid; }
.reply-event small, .reply-people small { color: var(--muted); font-size: .8rem; }
.seg label { position: relative; display: inline-flex; }
.seg label input { position: absolute; inset: 0; opacity: 0; }
.seg label span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-weight: 650; font-size: .88rem; cursor: pointer; }
.seg label input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #1f2a241f; }
.seg label input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 1px; }
.reply-people { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.reply-people > span { display: grid; }
.reply-people.is-off { opacity: .45; }
.reply-people .stepper { display: inline-flex; align-items: center; gap: 6px; }
.reply-people output { min-width: 2ch; font-size: 1.25rem; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }

/* ===== Timeline: by day; what happened leads; kind, time and who follow ===== */
.story-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.story-head .btn-link { display: inline-flex; align-items: center; gap: 6px; }
.story-head .btn-link .icon { width: 16px; height: 16px; }
.story-feed { display: grid; gap: 14px; margin-top: 14px; }
.story-day h5 { position: sticky; top: 0; z-index: 1; margin: 0 0 6px; padding: 4px 0; background: var(--surface); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.story-day ol { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
.story-day ol::before { content: ''; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; background: var(--line); }
.story-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.story-ic { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--surface); border-radius: 50%; background: var(--sunken); color: var(--ink-2); }
.story-ic .icon { width: 15px; height: 15px; }
.story-main { min-width: 0; padding-top: 3px; }
.story-what { margin: 0; font-size: .95rem; font-weight: 650; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 3px 0 0; font-size: .78rem; color: var(--muted); }
.story-meta span + span::before { content: '·'; margin-right: 8px; color: var(--faint); }
.story-kind { font-weight: 750; letter-spacing: .02em; color: var(--ink-2); }
.story-meta .btn-link { padding: 0; font-size: .78rem; }
.story-item.k-rsvp .story-ic, .story-item.k-arrival .story-ic { background: var(--mint); color: var(--mint-ink); }
.story-item.k-message .story-ic, .story-item.k-visit .story-ic { background: var(--powder); color: var(--powder-ink); }
.story-item.k-gift .story-ic { background: var(--butter); color: var(--butter-ink); }
.story-item.k-note .story-ic { background: var(--lilac); color: var(--lilac-ink); }
.story-item.k-note .story-what { padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--lilac); font-weight: 500; }
.story-item.k-override .story-ic, .story-item.k-trouble .story-ic { background: var(--blush); color: var(--blush-ink); }
.story-item.k-override .story-what { padding: 8px 12px; border-left: 3px solid var(--blush-ink); border-radius: 4px 12px 12px 4px; background: var(--blush); }
.story-item.k-override .story-kind { color: var(--blush-ink); }

/* ===== Settings · Sender accounts ===== */
.sender-card { display: grid; gap: 8px; margin-bottom: 14px; }
.sender-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sender-head h3 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.02rem; }
.sender-head h3 .icon { width: 18px; height: 18px; color: var(--muted); }
.sender-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sender-row .tk { width: 32px; height: 32px; }
.sender-main { display: grid; flex: 1; min-width: 160px; }
.sender-main small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.sender-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.danger-link { color: var(--danger); }
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; min-width: 200px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.more-menu button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; font-size: .9rem; color: var(--ink); }
.more-menu button:hover { background: var(--sunken); }
.more-menu .danger { color: var(--danger); }
.sender-add { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sender-add input { flex: 1 1 140px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 16px; }
.connect-way { margin-top: 14px; }
.qr-box { display: grid; place-items: center; width: 260px; max-width: 100%; aspect-ratio: 1; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.qr-box img { width: 240px; max-width: 92%; height: auto; image-rendering: pixelated; }
.connect-steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: .9rem; line-height: 1.55; }
.pair-code { margin: 12px 0; font-size: 1.9rem; font-weight: 800; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink); }
.pair-code:empty { display: none; }
#panel-timeline .story { margin-top: 0; }
