:root {
  --rose: #B5617A;
  --rose-deep: #8E4459;
  --rose-soft: #F4E3E8;
  --on-rose: #FFFFFF;
  --cream: #FFF7E1;
  --bg: #FBF7F4;
  --card: #FFFFFF;
  --ink: #2E2427;
  --ink-2: #6E6266;
  --ink-3: #A0959A;
  --line: #EEE5E2;
  --good: #3F7D5C;
  --good-soft: #E3F1E8;
  --warn: #A9701A;
  --warn-soft: #FBEFD9;
  --bad: #B23A3A;
  --bad-soft: #F9E1E0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(46, 36, 39, .05), 0 4px 16px rgba(46, 36, 39, .05);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
/* Dark colors: used when the phone is in dark mode (Automatic), or when the couple picks Dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --rose: #D98AA0;
    --rose-deep: #F0B3C4;
    --rose-soft: #3A2830;
    --on-rose: #2A1820;
    --cream: #3A3426;
    --bg: #161214;
    --card: #221C1F;
    --ink: #F4ECEE;
    --ink-2: #BFB2B6;
    --ink-3: #85797D;
    --line: #342B2F;
    --good: #7CC49C;
    --good-soft: #1F3328;
    --warn: #E5B160;
    --warn-soft: #3A2E1A;
    --bad: #F08A84;
    --bad-soft: #3D2120;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --rose: #D98AA0;
  --rose-deep: #F0B3C4;
  --rose-soft: #3A2830;
  --on-rose: #2A1820;
  --cream: #3A3426;
  --bg: #161214;
  --card: #221C1F;
  --ink: #F4ECEE;
  --ink-2: #BFB2B6;
  --ink-3: #85797D;
  --line: #342B2F;
  --good: #7CC49C;
  --good-soft: #1F3328;
  --warn: #E5B160;
  --warn-soft: #3A2E1A;
  --bad: #F08A84;
  --bad-soft: #3D2120;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.4 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--rose); }
h1, h2, h3 { margin: 0; font-weight: 600; }
.serif { font-family: var(--serif); }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  display: flex; align-items: center; gap: 8px; min-height: 52px;
}
.topbar h1 { font: 700 28px/1.15 var(--serif); letter-spacing: -.01em; flex: 1; }
.topbar .back { color: var(--rose); font-weight: 600; display: flex; align-items: center; gap: 2px; font-size: 17px; padding: 6px 6px 6px 0; }
.topbar .act { color: var(--rose); font-weight: 600; font-size: 16px; padding: 6px 2px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--rose); color: var(--on-rose); display: grid; place-items: center; font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgba(181, 97, 122, .35); }

main { padding: 4px 16px calc(96px + var(--safe-bottom)); outline: none; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar .inner { display: flex; width: 100%; max-width: 560px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; color: var(--ink-3); font-size: 10.5px; font-weight: 600; }
.tab svg { width: 25px; height: 25px; }
.tab[aria-current="page"] { color: var(--rose); }

/* ---------- cards & lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.section-label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 22px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.section-label a, .section-label button { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--rose); font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 52px; width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--ink-2); font-size: 14px; margin-top: 1px; }
.row .r { text-align: right; flex-shrink: 0; }
.row .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.chev { color: var(--ink-3); flex-shrink: 0; }
button.row:active, .tap:active { background: var(--rose-soft); }

.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.rose { background: var(--rose-soft); color: var(--rose-deep); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--on-rose); }
.chip .n { opacity: .7; margin-left: 4px; font-weight: 500; }

.seg { display: flex; background: var(--line); border-radius: 10px; padding: 2px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 7px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.search { width: 100%; padding: 10px 14px 10px 36px; border-radius: 12px; border: 0; background: var(--line); margin-bottom: 10px; font-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; }
.search:focus { outline: 2px solid var(--rose); }

/* ---------- home ---------- */
.hero {
  border-radius: 22px; padding: 22px 20px 20px; color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, var(--hero3, #D58BA0) 0%, transparent 60%), linear-gradient(150deg, var(--hero1, #B5617A), var(--hero2, #8E4459));
}
.hero.photo { min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; background-size: cover; background-position: center 30%; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.hero.photo::after { display: none; }

/* personalize */
.swatches { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 0 2px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--ink-3); position: relative; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.swatch-name { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.photo-row { display: flex; align-items: center; gap: 14px; }
.thumb { width: 64px; height: 64px; border-radius: 14px; background: var(--line) center/cover; flex-shrink: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 26px; }
.photo-row .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn svg { flex-shrink: 0; }
.share-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 12px; padding: 10px; border-radius: 12px; background: var(--rose-soft); color: var(--rose-deep); font-weight: 600; font-size: 15px; }
.hero::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%; border: 14px solid rgba(255,247,225,.13); }
.hero .names { font: 600 26px/1.15 var(--serif); }
.hero .date { opacity: .9; font-size: 14.5px; margin-top: 4px; }
.hero .count { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; }
.hero .big { font: 700 56px/1 var(--serif); font-variant-numeric: tabular-nums; }
.hero .unit { font-size: 16px; opacity: .92; }
.hero .place { font-size: 13.5px; opacity: .85; margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.stat .k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stat .v { font: 700 21px/1.2 var(--sans); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stats.three .v { font-size: 18px; }
.stat { min-width: 0; }
.stat .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; margin: 10px 0 6px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.bar .b1 { background: color-mix(in srgb, var(--rose) 35%, transparent); }
.bar .b2 { background: var(--rose); }
.bar.over .b1 { background: color-mix(in srgb, var(--bad) 40%, transparent); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; font-size: 14.5px; font-weight: 500; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert.info { background: var(--rose-soft); color: var(--rose-deep); }
.alert .x { margin-left: auto; font-size: 20px; line-height: 1; opacity: .6; padding: 0 2px; }

.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { width: 84px; height: 84px; flex-shrink: 0; }
.ring text { font: 700 19px var(--sans); fill: var(--ink); }
.meals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meal { background: var(--cream); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.meal b { font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ---------- checklist ---------- */
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); flex-shrink: 0; display: grid; place-items: center; transition: transform .15s; }
.check svg { width: 15px; height: 15px; opacity: 0; }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check.on svg { opacity: 1; }
.check:active { transform: scale(.85); }
.done-row .t { color: var(--ink-3); text-decoration: line-through; font-weight: 500; }
.task-row { padding-left: 12px; }
.task-row .t { white-space: normal; font-weight: 500; }

/* ---------- vendors ---------- */
.vcard { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.vcard:last-child { border-bottom: 0; }
.vtop { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.mini-btn { white-space: nowrap; flex-shrink: 0; font-size: 13.5px; font-weight: 600; color: var(--rose); background: var(--rose-soft); padding: 6px 12px; border-radius: 99px; }
.prog { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.prog > span { display: block; height: 100%; background: var(--good); border-radius: 99px; }

/* ---------- guests ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; background: var(--cream); color: var(--rose-deep); }
.rsvp { min-width: 74px; text-align: center; }
.tables { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.table-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; text-align: left; }
.table-card .num { font: 700 13px var(--sans); color: var(--rose); letter-spacing: .04em; }
.table-card .nm { font-weight: 600; margin: 2px 0 10px; min-height: 2.6em; line-height: 1.3; }
.seats { display: flex; flex-wrap: wrap; gap: 4px; }
.seats i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.seats i.f { background: var(--rose); }
.seats i.o { background: var(--bad); }

/* ---------- day-of ---------- */
.timeline { position: relative; }
.tl { display: flex; gap: 14px; padding: 12px 16px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .time { width: 78px; white-space: nowrap; flex-shrink: 0; font-weight: 700; color: var(--rose); font-variant-numeric: tabular-nums; font-size: 14.5px; padding-top: 1px; }
.call { color: var(--rose); font-weight: 600; text-decoration: none; }

/* ---------- forms ---------- */
.field { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%; border: 0; background: transparent; padding: 2px 0; font-size: 17px; outline: none; border-radius: 0;
}
.field textarea { resize: vertical; min-height: 64px; }
.field select { -webkit-appearance: none; appearance: none; }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.field.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field.toggle .lbl { margin: 0; font-size: 16px; color: var(--ink); font-weight: 500; }
.field:focus-within { background: color-mix(in srgb, var(--cream) 55%, transparent); }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; cursor: pointer; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }
.form-section { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 18px 16px 6px; background: var(--bg); }
.seg-input { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.seg-input label { flex: 1 1 auto; }
.seg-input input { position: absolute; opacity: 0; pointer-events: none; }
.seg-input span { display: block; text-align: center; padding: 8px; border-radius: 10px; background: var(--line); font-weight: 600; font-size: 15px; }
.seg-input input:checked + span { background: var(--rose); color: var(--on-rose); }
.seg-input input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 2px; }

.btn { display: block; width: 100%; padding: 14px; border-radius: 14px; font-weight: 700; font-size: 16px; text-align: center; background: var(--rose); color: var(--on-rose); }
.btn.ghost { background: var(--rose-soft); color: var(--rose-deep); }
.btn.danger { background: transparent; color: var(--bad); }
.btn + .btn { margin-top: 10px; }
.add-row { color: var(--rose); font-weight: 600; justify-content: center; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 12, 15, .38); z-index: 20; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; margin: 0 auto; max-width: 560px;
  background: var(--bg); border-radius: 20px 20px 0 0; max-height: 92vh; display: flex; flex-direction: column;
  animation: up .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
.sheet-head { display: flex; align-items: center; padding: 14px 16px 10px; gap: 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; text-align: center; font-size: 17px; }
.sheet-head button { color: var(--rose); font-weight: 600; font-size: 16px; min-width: 60px; }
.sheet-head button.save { font-weight: 700; text-align: right; }
.sheet-head button.cancel { text-align: left; }
.sheet-body { overflow-y: auto; padding: 0 0 calc(24px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body .card { margin: 14px 16px; }
.grab { width: 38px; height: 5px; border-radius: 9px; background: var(--ink-3); opacity: .4; margin: 8px auto 0; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 14.5px; opacity: 0; transition: .25s; pointer-events: none; z-index: 30; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- welcome ---------- */
.welcome { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-top) + 30px) 24px calc(var(--safe-bottom) + 30px); max-width: 480px; margin: 0 auto; }
.welcome img { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 8px 24px rgba(181, 97, 122, .35); }
.welcome h1 { font: 700 36px/1.1 var(--serif); margin: 24px 0 10px; }
.welcome p { color: var(--ink-2); font-size: 17px; margin: 0 0 28px; }
.welcome ul { list-style: none; padding: 0; margin: 0 0 32px; }
.welcome li { display: flex; gap: 12px; align-items: center; padding: 7px 0; font-weight: 500; }
.welcome li span { width: 34px; height: 34px; border-radius: 10px; background: var(--rose-soft); display: grid; place-items: center; font-size: 17px; }
.brand { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 24px; letter-spacing: .04em; }

.empty { text-align: center; color: var(--ink-2); padding: 28px 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.right { text-align: right; }
.good-t { color: var(--good); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (min-width: 600px) { .tables { grid-template-columns: repeat(3, 1fr); } }

.btn { text-decoration: none; }
.demo-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 11px 14px; margin-bottom: 12px; border-radius: 12px;
  background: var(--rose); color: var(--on-rose); font-size: 14.5px; text-decoration: none; }
.demo-bar b { font-weight: 700; }
.foot-link { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.foot-meta { display: inline-block; margin-top: 6px; letter-spacing: 0; font-size: 12px; }
.welcome .brand .foot-link { display: inline-block; margin-top: 8px; letter-spacing: 0; font-size: 12px; }
@media print {
  .tabbar, .topbar .act, .topbar .round-btn, .no-print { display: none !important; }
  body, .card { background: #fff; box-shadow: none; }
  main { padding-bottom: 0; }
}

/* photo shortcut on the Home countdown card */
.hero-photo-btn { position: absolute; top: 14px; right: 14px; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; text-shadow: none;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-photo-btn.icon { width: 36px; height: 36px; padding: 0; justify-content: center; background: rgba(0, 0, 0, .25); }
.hero-photo-btn:active { transform: scale(.95); }
.hero-photo-btn.inline { position: relative; top: auto; right: auto; display: inline-flex; margin-top: 16px; }
