/* ==========================================================================
   Vow & Ledger — Wedding Planner
   Design tokens → base → layout → components → views → print
   ========================================================================== */

:root,
[data-theme="ivory"] {
  --paper: #f6f1e9;
  --paper-2: #efe8dc;
  --card: #fffdf9;
  --ink: #2a2420;
  --ink-2: #5d534b;
  --ink-3: #7c7168;
  --line: #e2d8ca;
  --line-2: #d3c6b4;
  --accent: #8a6a3b;          /* brass */
  --accent-ink: #6f5329;
  --accent-soft: #f1e6d3;
  --on-accent: #fffdf9;
  --rose: #a5675c;
  --rose-soft: #f4e2dd;
  --sage: #5f6f55;
  --sage-soft: #e3e8dc;
  --danger: #a3392f;
  --danger-soft: #f6dfdb;
  --shadow: 0 1px 2px rgba(42, 36, 32, .05), 0 8px 24px -12px rgba(42, 36, 32, .18);
  --shadow-lg: 0 24px 60px -20px rgba(42, 36, 32, .35);
  color-scheme: light;
}

[data-theme="sage"] {
  --paper: #f1f2ec;
  --paper-2: #e6e9df;
  --card: #fcfdf9;
  --ink: #232821;
  --ink-2: #4f584b;
  --ink-3: #6d7668;
  --line: #d9ddd0;
  --line-2: #c6ccbb;
  --accent: #56694c;
  --accent-ink: #3f5036;
  --accent-soft: #e1e8d9;
  --rose: #9b6a52;
  --rose-soft: #f1e3da;
  --sage: #56694c;
  --sage-soft: #e1e8d9;
}

[data-theme="blush"] {
  --paper: #f8efec;
  --paper-2: #f1e3df;
  --card: #fffcfb;
  --ink: #2e2223;
  --ink-2: #624e4f;
  --ink-3: #82696a;
  --line: #ead6d2;
  --line-2: #dcc0bb;
  --accent: #9c5a55;
  --accent-ink: #7d433f;
  --accent-soft: #f5e0dc;
  --rose: #9c5a55;
  --rose-soft: #f5e0dc;
}

[data-theme="midnight"] {
  --paper: #16171c;
  --paper-2: #1d1f25;
  --card: #22242b;
  --ink: #f2ece2;
  --ink-2: #c9c0b3;
  --ink-3: #a1988c;
  --line: #33353d;
  --line-2: #42454e;
  --accent: #d2b07a;
  --accent-ink: #e2c595;
  --accent-soft: #3a3226;
  --on-accent: #1a1712;
  --rose: #d69a8f;
  --rose-soft: #3b2a28;
  --sage: #a9bb98;
  --sage-soft: #2a3127;
  --danger: #ec8a80;
  --danger-soft: #3d2523;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

:root {
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --sidebar: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.eyebrow {
  font: 500 11.5px/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted { color: var(--ink-3); }
.num { font-variant-numeric: lining-nums tabular-nums; }
.stat-value, .countdown-num, .pill-stat b, .table-disc, .vendor-money b, .tl-time, .ring span { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Layout ---------- */
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: var(--paper);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--accent);
  display: grid; place-items: center;
  font: italic 500 17px/1 var(--serif);
  color: var(--accent-ink);
  letter-spacing: .02em;
}
.brand-name { font: 500 21px/1.05 var(--serif); }
.brand-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; min-height: 44px;
  border-radius: 10px;
  color: var(--ink-2); text-decoration: none;
  font-size: 15px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav a[aria-current="page"] .ico { color: var(--accent); }
.nav-sep { height: 1px; background: var(--line); margin: 12px 10px; }
.nav .badge { margin-left: auto; }

.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); transition: background .2s; }
.save-dot.busy { background: var(--accent); }

.main { margin-left: var(--sidebar); padding: 40px clamp(20px, 4vw, 56px) 80px; max-width: calc(1180px + var(--sidebar)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(34px, 4.4vw, 46px); }
.page-head .lede { color: var(--ink-2); margin-top: 8px; max-width: 60ch; font-size: 15px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bottom-nav { display: none; }

/* ---------- Components ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2 { font-size: 24px; }
.card-head a, .link-btn {
  font-size: 13.5px; color: var(--accent-ink); text-decoration: none;
  background: none; border: 0; padding: 6px 2px; display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover, .card-head a:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px; font-weight: 500; letter-spacing: .01em;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
[data-theme="midnight"] .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.icon { width: 44px; padding: 0; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: .02em;
  background: var(--paper-2); color: var(--ink-2);
  white-space: nowrap;
}
.badge.yes, .badge.booked, .badge.ok { background: var(--sage-soft); color: var(--sage); }
.badge.no, .badge.late { background: var(--danger-soft); color: var(--danger); }
.badge.wait { background: var(--accent-soft); color: var(--accent-ink); }
.badge.rose { background: var(--rose-soft); color: var(--rose); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }

.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }

.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.stat-btn { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
a.stat:hover, .stat-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-value { font: 500 38px/1 var(--serif); }
.stat-value small { font: 400 15px var(--sans); color: var(--ink-3); margin-left: 4px; }
.stat-foot { font-size: 13px; color: var(--ink-3); }

.meter { height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s var(--ease); }
.meter.over > span { background: var(--danger); }
.meter.sage > span { background: var(--sage); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }
.search:focus-within { border-color: var(--accent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--paper-2); border-radius: 999px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; border-radius: 999px;
  min-height: 36px; padding: 0 14px; font-size: 13.5px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.empty {
  text-align: center; padding: 48px 20px; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty h3 { font-size: 26px; color: var(--ink); }
.empty p { max-width: 42ch; }

.tip {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 14px; margin-bottom: 18px;
}
.tip .ico { margin-top: 2px; }
.tip button { margin-left: auto; }

/* Checkbox */
.check {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; flex: none; margin: 0;
  border: 1.5px solid var(--line-2); border-radius: 50%;
  background: var(--card); cursor: pointer;
  display: grid; place-items: center;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.check::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
  transform: rotate(-45deg) scale(0); transition: transform .18s var(--ease);
}
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after { transform: rotate(-45deg) scale(1); }
.check-hit { display: grid; place-items: center; width: 44px; height: 44px; margin: -11px; flex: none; cursor: pointer; }

/* Rows / lists */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 22px; min-height: 60px;
  border-top: 1px solid var(--line);
}
.list .row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15.5px; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.done .row-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.row-click { background: none; border: 0; padding: 0; text-align: left; width: 100%; }
.row-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.row:hover .row-actions, .row:focus-within .row-actions { opacity: 1; }

/* Phase groups */
.phase { margin-bottom: 18px; }
.phase-head {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 18px 22px 12px;
}
.phase-head h2 { font-size: 25px; }
.phase-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; align-items: center; }
.phase-meter { width: 90px; }

/* Table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; font: 500 11.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data tr:first-child td { border-top: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--paper); }
table.data .r { text-align: right; }
table.data tfoot td { border-top: 1px solid var(--line-2); font-weight: 500; padding: 14px 16px; }
.cell-btn { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; }
.cell-btn:hover { color: var(--accent-ink); }

/* Dashboard hero */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(20px, 3vw, 40px); align-items: center;
  margin-bottom: 18px;
}
.monogram {
  width: clamp(84px, 9vw, 112px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--accent); position: relative;
  display: grid; place-items: center;
  font: italic 500 clamp(28px, 3.2vw, 38px)/1 var(--serif); color: var(--accent-ink);
}
.monogram::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid var(--line-2); }
.hero h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 400; }
.hero h1 em { font-style: italic; color: var(--accent-ink); padding: 0 .12em; }
.hero-meta { margin-top: 10px; color: var(--ink-2); display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 14.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.countdown { text-align: center; padding-left: clamp(16px, 3vw, 36px); border-left: 1px solid var(--line); }
.countdown-num { font: 400 clamp(54px, 7vw, 84px)/.9 var(--serif); }
.countdown .eyebrow { margin-top: 10px; display: block; }

/* Ring */
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--paper-2) 0);
  display: grid; place-items: center; }
.ring::before { content: ""; grid-area: 1/1; width: 52px; height: 52px; border-radius: 50%; background: var(--card); }
.ring span { grid-area: 1/1; font: 500 15px var(--sans); position: relative; }

/* Budget */
.cat-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) 220px; gap: 16px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); }
.cat-row:first-child { border-top: 0; }
.cat-name { font-size: 15.5px; }
.cat-sub { font-size: 12.5px; color: var(--ink-3); }
.cat-nums { text-align: right; font-size: 14px; white-space: nowrap; }
.split-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--paper-2); }
.split-bar span { height: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Guests */
.guest-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-stat { padding: 12px 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); min-width: 112px; }
.pill-stat b { display: block; font: 500 28px/1 var(--serif); }
.pill-stat span { font-size: 12.5px; color: var(--ink-3); }
.rsvp-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.rsvp-seg button { border: 0; background: transparent; min-height: 34px; min-width: 40px; padding: 0 10px; font-size: 12.5px; color: var(--ink-3); }
.rsvp-seg button + button { border-left: 1px solid var(--line); }
.rsvp-seg button[aria-pressed="true"][data-v="yes"] { background: var(--sage-soft); color: var(--sage); font-weight: 500; }
.rsvp-seg button[aria-pressed="true"][data-v="no"] { background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.rsvp-seg button[aria-pressed="true"][data-v="pending"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }

/* Seating */
.seat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.pool { position: sticky; top: 20px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.pool-list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; min-height: 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font-size: 14px; cursor: grab; user-select: none; text-align: left; width: 100%;
  transition: border-color .15s, background .15s, transform .15s;
}
.chip:hover { border-color: var(--line-2); }
.chip.selected { border-color: var(--accent); background: var(--accent-soft); }
.chip.dragging { opacity: .45; }
.chip .plus { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.table-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, box-shadow .15s; }
.table-card.drop { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.table-card.full .table-cap { color: var(--danger); }
.table-top { display: flex; align-items: center; gap: 14px; }
.table-disc {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  border: 1px solid var(--accent); display: grid; place-items: center;
  font: 500 20px var(--serif); color: var(--accent-ink); background: var(--accent-soft);
}
.table-name { font: 500 21px/1.1 var(--serif); }
.table-cap { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.seat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.seat-list li { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--paper); }
.seat-list li button { margin-left: auto; border: 0; background: none; width: 30px; height: 30px; border-radius: 6px; color: var(--ink-3); display: grid; place-items: center; }
.seat-list li button:hover { background: var(--paper-2); color: var(--danger); }
.seat-assign { border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px; text-align: center; font-size: 13px; color: var(--ink-3); background: none; width: 100%; min-height: 44px; }
.seat-assign.armed { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* Vendors */
.vendor-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.vendor-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vendor-name { font: 500 23px/1.1 var(--serif); }
.vendor-links { display: flex; gap: 6px; flex-wrap: wrap; }
.vendor-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; padding: 6px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); min-height: 34px; }
.vendor-links a:hover { background: var(--paper-2); color: var(--ink); }
.vendor-money { display: flex; gap: 18px; font-size: 13.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.vendor-money b { display: block; font: 500 19px var(--serif); color: var(--ink); }

/* Timeline */
.tl { list-style: none; margin: 0; padding: 8px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 118px; top: 22px; bottom: 22px; width: 1px; background: var(--line-2); }
.tl li { display: grid; grid-template-columns: 96px 44px minmax(0, 1fr) auto; align-items: start; padding: 12px 22px 12px 0; }
.tl-time { text-align: right; font: 500 20px/1.2 var(--serif); padding-top: 1px; }
.tl-dot { justify-self: center; width: 11px; height: 11px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); margin-top: 7px; position: relative; z-index: 1; }
.tl-title { font-size: 15.5px; font-weight: 500; }
.tl-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* Settings */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.theme-opt {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--card);
  display: flex; flex-direction: column; gap: 10px; text-align: left; min-height: 44px;
}
.theme-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-swatch { height: 46px; border-radius: 8px; display: flex; overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.theme-swatch i { flex: 1; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.setting-row:first-child { border-top: 0; }
.setting-row h3 { font: 500 15.5px var(--sans); }
.setting-row p { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; max-width: 56ch; }

/* ---------- Forms & dialog ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); color: var(--ink);
  font-size: 16px; /* prevents iOS zoom */
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.inline { flex-direction: row; align-items: center; gap: 12px; min-height: 46px; }
.field input.check { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; box-shadow: none; flex: none; }
.field.inline label { order: 2; font-weight: 400; font-size: 15px; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.money { position: relative; }
.money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 15px; pointer-events: none; }
.money input { padding-left: 34px; }

dialog.sheet {
  border: 0; padding: 0; margin: auto;
  width: min(620px, calc(100vw - 24px)); max-height: min(88dvh, 860px);
  border-radius: var(--r-lg); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: rise .28s var(--ease); }
dialog.sheet::backdrop { background: rgba(28, 22, 18, .42); backdrop-filter: blur(3px); animation: fade .2s ease; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; gap: 12px; }
.sheet-head h2 { font-size: 30px; }
.sheet-body { padding: 14px 24px 8px; overflow: auto; }
.sheet-foot { display: flex; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line); margin-top: 8px; flex-wrap: wrap; }
.sheet-foot .spacer { flex: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 100;
  display: flex; gap: 14px; align-items: center; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--accent-soft); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

/* ---------- Onboarding ---------- */
.welcome {
  min-height: 100dvh; display: grid; place-items: center; padding: 32px 18px;
  background:
    radial-gradient(90% 60% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--paper);
}
.welcome-card { width: min(560px, 100%); padding: clamp(28px, 5vw, 48px); text-align: center; }
.welcome-card .monogram { margin: 0 auto 22px; width: 92px; }
.welcome-card h1 { font-size: clamp(36px, 6vw, 50px); font-weight: 400; }
.welcome-card .lede { color: var(--ink-2); margin: 12px auto 28px; max-width: 40ch; }
.welcome-card form { text-align: left; display: flex; flex-direction: column; gap: 16px; }
.steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 26px; }
.steps i { width: 28px; height: 3px; border-radius: 9px; background: var(--line); transition: background .3s; }
.steps i.on { background: var(--accent); }
.welcome-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }
.privacy-note { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-3); margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: calc(22px + env(safe-area-inset-top, 0px)) 16px calc(96px + var(--safe-b)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 6px calc(6px + var(--safe-b));
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; border: 0; background: none; text-decoration: none;
    color: var(--ink-3); font-size: 11px; letter-spacing: .02em; border-radius: 12px;
  }
  .bottom-nav [aria-current="page"] { color: var(--accent-ink); }
  .bottom-nav [aria-current="page"] .ico { stroke-width: 2; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto 1fr; }
  .countdown { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; display: flex; align-items: baseline; justify-content: center; gap: 12px; }
  .countdown .eyebrow { margin: 0; }
  .seat-layout { grid-template-columns: 1fr; }
  .pool { position: static; max-height: 300px; }
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-nums { min-width: 0; }
  .cat-row .meter-col { grid-column: 1 / -1; order: 3; }
  .form-grid { grid-template-columns: 1fr; }
  .tl::before { left: 86px; }
  .tl li { grid-template-columns: 68px 36px minmax(0, 1fr) auto; padding-right: 12px; }
  .tl-time { font-size: 17px; }
  .row { padding: 12px 16px; }
  .card-head { padding: 16px 16px 0; }
  .phase-head { padding: 16px 16px 10px; }
  .hide-sm { display: none !important; }
  .head-actions .btn.ghost { display: none; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
  .guest-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .pill-stat { min-width: 0; }
  .toolbar .seg { max-width: 100%; }
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; }
  .sheet-foot { padding-bottom: calc(18px + var(--safe-b)); }
  .row-actions { opacity: 1; }
}
@media (max-width: 520px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 30px; }
  .hero { padding: 22px; gap: 16px; }
  .monogram { width: 68px; font-size: 24px; }
  .page-head h1 { font-size: 34px; }
  .phase-meter { display: none; }
  .phase-head h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* More sheet (mobile) */
.more-list { display: flex; flex-direction: column; gap: 4px; }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 14px 10px; min-height: 52px; border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 16px; }
.more-list a:hover { background: var(--paper); }
.more-list a .ico:last-child { margin-left: auto; color: var(--ink-3); }

/* ---------- Print ---------- */
.print-head { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  :root, [data-theme] { --paper: #fff; --card: #fff; --shadow: none; --shadow-lg: none; --ink: #1d1916; --ink-3: #6b625a; --line: #ddd4c8; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .bottom-nav, .head-actions, .toolbar, .row-actions, .tip, .toast, .no-print, .seat-assign, .seat-list li button { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .phase { break-inside: auto; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 18px; font: italic 500 14pt var(--serif); }
  .pool { display: none; }
  .seat-layout { grid-template-columns: 1fr; }
  .tables { grid-template-columns: repeat(3, 1fr); }
  a { text-decoration: none; color: inherit; }
  .hero { break-inside: avoid; }
}

@media print {
  .print-section + .print-section { break-before: page; }
}

/* Seating: tap guest, then tap table */
.seat-banner {
  position: sticky; top: 12px; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 16px; padding: 10px 10px 10px 20px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 14.5px; box-shadow: var(--shadow-lg);
  animation: rise .25s var(--ease);
}
.seat-banner b { font-weight: 500; }
.seat-banner button { border: 1px solid rgba(255,255,255,.3); background: transparent; color: inherit; border-radius: 999px; min-height: 36px; padding: 0 16px; flex: none; }
.table-card.armed { cursor: pointer; border-style: dashed; border-color: var(--accent); }
.table-card.armed:hover, .table-card.armed:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft); background: color-mix(in srgb, var(--accent-soft) 35%, var(--card)); }
.seat-hint { margin: auto 0 0; font-size: 13px; color: var(--ink-3); text-align: center; min-height: 18px; }
.table-card.armed .seat-hint { color: var(--accent-ink); font-weight: 500; }
.seat-name { flex: 1; min-width: 0; background: none; border: 0; padding: 4px 0; text-align: left; font: inherit; color: inherit; }
.seat-list li.selected { background: var(--accent-soft); outline: 1px solid var(--accent); }
.rsvp-seg button { min-width: 48px; }

/* Modern (lining) figures everywhere: in Cormorant a "1" otherwise looks like an "I".
   !important because every `font:` shorthand resets font-feature-settings. */
*, *::before, *::after { font-feature-settings: "lnum" 1 !important; }
.seat-list li .seat-name { display: block; width: auto; height: auto; margin: 0; padding: 4px 0; border-radius: 6px; color: var(--ink); text-align: left; }
.seat-list li .seat-name:hover { background: none; color: var(--accent-ink); }

/* ---------- Invitations ---------- */
.inv-step { margin-bottom: 18px; }
.inv-step .card-head { align-items: flex-end; }
.inv-sub { font: 500 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 12px; }
.inv-sub:first-child { margin-top: 4px; }
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tpl-opt { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); text-align: left; transition: border-color .15s, box-shadow .15s; }
.tpl-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-name { font: 500 19px var(--serif); }
.tpl-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.tpl-thumb { position: relative; height: 92px; border-radius: 10px; background: var(--paper-2); overflow: hidden; margin-bottom: 4px; }
.tpl-thumb i, .tpl-thumb b, .tpl-thumb s { position: absolute; display: block; }
.tpl-classic i { inset: 0; background: linear-gradient(160deg, #b8a080, #5b4a3c); }
.tpl-classic b { left: 25%; right: 25%; bottom: 18px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.9); }
.tpl-classic s { left: 35%; right: 35%; bottom: 9px; height: 3px; border-radius: 4px; background: rgba(255,255,255,.7); }
.tpl-editorial i { right: 0; top: 0; bottom: 0; width: 48%; background: linear-gradient(160deg, #b8a080, #5b4a3c); }
.tpl-editorial b { left: 10%; top: 30%; width: 30%; height: 8px; border-radius: 4px; background: var(--ink); opacity: .75; box-shadow: 0 14px 0 var(--ink); }
.tpl-editorial s { left: 10%; bottom: 18px; width: 22%; height: 3px; background: var(--accent); }
.tpl-garden i { left: 50%; top: 10px; width: 40px; height: 56px; transform: translateX(-50%); border-radius: 20px 20px 4px 4px; background: linear-gradient(160deg, #b8a080, #5b4a3c); outline: 1px solid var(--accent); outline-offset: 2px; }
.tpl-garden b { left: 30%; right: 30%; bottom: 12px; height: 6px; border-radius: 4px; background: var(--ink); opacity: .7; }
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); padding: 4px; background: var(--card); }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.photo-tile { position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.is-cover { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover-badge { position: absolute; left: 8px; bottom: 8px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; letter-spacing: .06em; padding: 4px 9px; border-radius: 99px; }
.tile-btn { position: absolute; right: 6px; top: 6px; min-width: 34px; height: 34px; border-radius: 99px; border: 0; background: rgba(20,16,12,.55); color: #fff; display: grid; place-items: center; font-size: 12px; padding: 0 8px; }
.tile-btn.left { left: 6px; right: auto; }
.tile-btn:hover { background: rgba(20,16,12,.8); }
.photo-add { aspect-ratio: 4 / 5; border: 1.5px dashed var(--line-2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); font-size: 14px; cursor: pointer; transition: border-color .15s, color .15s; }
.photo-add:hover, .photo-add:focus-within { border-color: var(--accent); color: var(--accent-ink); }
.inv-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; font-size: 14.5px; }
.inv-dl dt { color: var(--ink-3); } .inv-dl dd { margin: 0; }
.inv-row-end { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sm-icon { width: 40px; min-height: 40px; }
.inv-send-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--card); border-radius: 0 0 var(--r) var(--r); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.inv-msg { font: italic 400 19px/1.45 var(--serif); color: var(--ink-2); margin: 6px 0 2px; }
dialog.sheet.wide { width: min(980px, calc(100vw - 24px)); }
.inv-frame { display: block; width: 100%; height: 76dvh; border: 0; background: var(--paper); }
.inv-frame.email { height: 62dvh; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 860px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-opt { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tpl-thumb { width: 92px; height: 70px; margin: 0 8px 0 0; flex: none; }
  .tpl-desc { flex-basis: 100%; }
  .inv-send-bar { bottom: calc(66px + var(--safe-b)); }
  .inv-list .row { flex-wrap: wrap; }
  .inv-row-end { width: 100%; padding-left: 40px; justify-content: flex-start; }
  dialog.sheet.wide { width: 100vw; }
}
a.btn { text-decoration: none; color: var(--ink); }
a.btn.primary { color: var(--paper); }
.inv-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin: -8px 0 18px; max-width: 80ch; }
.inv-privacy .ico { margin-top: 2px; }
