/* Layout: an invitation suite. A mocha "front" card with a champagne-gold inner line opens
   every page; blush stationery cards follow. One committed light look on every phone. */
:root {
  --blush: #f6e4e1;
  --card: #fbf2f0;
  --card-deep: #efd3ce;
  --mocha: #3b2a26;
  --mocha-2: #5c403a;
  --on-mocha: #f3e6dd;
  --rose: #d9a6a1;
  --rose-deep: #96564f;
  --muted: #7a5a52;
  --gold: #c9a46b;
  --line: #e6cfca;
  --ok: #3d6a4c;
  --ok-soft: #e2ede3;
  --warn: #855419;
  --warn-soft: #f6e6cd;
  --bad: #a2362e;
  --bad-soft: #f6dad6;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-script: "Pinyon Script", "Snell Roundhand", cursive;
  --font-body: "Jost", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blush);
  color: var(--mocha);
  font: 16px/1.55 var(--font-body);
  padding-block: max(16px, env(safe-area-inset-top)) 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 620px; margin: 0 auto; display: grid; gap: 16px; }
.wrap.wide { max-width: 860px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(34px, 9vw, 48px); }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0; }
a { color: var(--rose-deep); }
em { font-family: var(--font-display); font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.pre { white-space: pre-wrap; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }

/* The mocha front */
.cover {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--mocha); color: var(--on-mocha);
  border-radius: 24px; padding: 40px 26px 34px; display: grid; gap: 10px;
}
.cover::before {
  content: ""; position: absolute; inset: 9px; border: 1px solid rgba(201, 164, 107, 0.75);
  border-radius: 17px; pointer-events: none;
}
.cover::after {
  content: ""; position: absolute; top: -56px; right: -56px; width: 190px; height: 190px;
  border-radius: 50%; background: var(--mocha-2); z-index: -1;
}
.cover .eyebrow { color: var(--rose); }
.cover h1 { font-weight: 500; font-size: clamp(46px, 13vw, 66px); line-height: 0.95; letter-spacing: -0.01em; }
.cover h1 em { color: var(--rose); font-weight: 500; }
.cover .tagline { font-family: var(--font-display); font-style: italic; font-size: 20px; color: #e8cfc4; }
.cover .when { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-mocha); padding-top: 6px; }
.cover-sm { padding: 26px 22px 22px; }
.cover-sm h1 { font-size: clamp(34px, 9vw, 46px); }
.cover-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.monogram {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-script); font-size: 23px; line-height: 1; color: var(--on-mocha);
}
.cover a, .cover .ghost { color: var(--rose); }
.signoff { text-align: center; display: grid; gap: 4px; padding-top: 6px; }
.signoff .script { font-family: var(--font-script); font-size: 30px; color: var(--rose-deep); line-height: 1.2; }

/* Stationery cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 14px; min-width: 0;
}
.card.flat { background: transparent; }
.card.deep { background: var(--card-deep); border-color: transparent; }
.card h2 { font-size: 24px; }
.rule { height: 1px; background: var(--gold); width: 56px; }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; padding-top: 3px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Forms */
label { display: grid; gap: 6px; font-weight: 500; font-size: 15px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 14px; }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], select, textarea {
  font: inherit; color: var(--mocha); background: #fffaf9; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 84px; }
::placeholder { color: #b9a19b; font-style: italic; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(217, 166, 161, 0.45); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.check input { width: 20px; height: 20px; accent-color: var(--mocha); flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.money { position: relative; }
.money input { padding-left: 26px; }
.money::before { content: "$"; position: absolute; left: 13px; bottom: 12px; color: var(--muted); font-weight: 400; }

/* Buttons: pills with a little letterspacing, like stationery */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 999px; padding: 12px 20px; border: 1px solid var(--mocha);
  background: transparent; color: var(--mocha); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; line-height: 1.2;
}
button:hover, .btn:hover { background: rgba(59, 42, 38, 0.06); }
button:focus-visible, .btn:focus-visible, input:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: default; }
.primary { background: var(--mocha); border-color: var(--mocha); color: var(--blush); }
.primary:hover { background: var(--mocha-2); }
.ghost { background: transparent; border-color: transparent; color: var(--rose-deep); padding-left: 8px; padding-right: 8px; }
.ghost:hover { background: transparent; text-decoration: underline; }
.danger { color: var(--bad); border-color: var(--bad); }
.danger.armed { background: var(--bad); color: #fff; }
.small-btn { min-height: 36px; padding: 7px 14px; font-size: 12px; }
.block { width: 100%; }

/* Segmented choices */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg button { padding: 11px 6px; min-width: 0; font-size: 12px; }
.seg button[aria-pressed="true"] { background: var(--mocha); color: var(--blush); }
.seg button[data-v="maybe"][aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--mocha); }
.seg button[data-v="no"][aria-pressed="true"] { background: var(--card-deep); border-color: var(--muted); color: var(--mocha); }

/* Chips and notices */
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--card-deep); color: var(--mocha); white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--mocha); color: var(--blush); }
.cover .chip { background: rgba(243, 230, 221, 0.14); color: var(--on-mocha); }
.notice { padding: 12px 16px; border-radius: 14px; background: var(--card-deep); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice em { font-size: 1.1em; }

/* Date options */
.option { border: 1px solid var(--line); background: #fffaf9; border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.option .when { font-family: var(--font-display); font-size: 20px; font-weight: 600; }

/* Pay handles */
.handle { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--blush); border-radius: 12px; flex-wrap: wrap; }
.handle b { font-weight: 500; overflow-wrap: anywhere; }
.amount { font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: lining-nums; }

/* Thumbnails */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card-deep); max-width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 5px; right: 5px; min-height: 28px; padding: 3px 10px; font-size: 10px; background: rgba(59, 42, 38, 0.8); color: var(--blush); border: 0; }
.uploading { opacity: 0.6; }

/* Toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(20px, env(safe-area-inset-bottom));
  background: var(--mocha); color: var(--blush); padding: 12px 20px; border-radius: 999px; font-size: 14px;
  z-index: 20; max-width: calc(100vw - 32px); text-align: center;
}
.toast.bad { background: var(--bad); color: #fff; }

/* Host: tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs button { flex: none; min-height: 38px; padding: 8px 15px; font-size: 11px; }
.tabs button[aria-selected="true"] { background: var(--mocha); color: var(--blush); }

/* Host: event list */
.event-link { text-align: left; display: grid; gap: 6px; padding: 18px 20px; width: 100%; color: inherit; text-decoration: none; }
.event-link:hover { border-color: var(--gold); }
.event-link h2 em { color: var(--rose-deep); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }

/* Host: guest rows */
.guest { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.guest:first-child { border-top: 0; padding-top: 0; }
.guest > .spread > b { font-family: var(--font-display); font-size: 21px; font-weight: 600; }

/* Host: tally bars */
.tally { display: grid; gap: 4px; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .y { background: var(--mocha); }
.bar .m { background: var(--rose); }

/* Host: arrival timeline */
.timeline { display: grid; gap: 6px; }
.tl-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr; gap: 10px; align-items: center; font-size: 14px; }
.tl-track { position: relative; height: 14px; background: var(--line); border-radius: 999px; }
.tl-fill { position: absolute; top: 0; bottom: 0; background: var(--mocha); border-radius: 999px; }
.tl-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-left: calc(min(120px, 30%) + 10px); }

/* Host: storage meter */
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gold); }
.meter.full i { background: var(--bad); }

/* Host: checklist */
.todo { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.todo:first-child { border-top: 0; }
.todo input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--mocha); }
.todo.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo .due { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.todo.overdue .due { color: var(--bad); font-weight: 500; }
.msg { font-size: 15px; min-height: 92px; }

/* Welcome page: calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h2 { text-align: center; flex: 1; }
.cal-head button { min-height: 40px; min-width: 40px; padding: 6px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-dow { font-size: 11px; letter-spacing: 0.16em; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1; max-height: 48px; width: 100%; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 14px; color: var(--mocha-2); font-variant-numeric: lining-nums tabular-nums;
  padding: 0; min-height: 0; letter-spacing: 0; text-transform: none; border: 1.5px solid transparent; justify-self: center;
}
button.cal-day { cursor: pointer; font-weight: 500; }
.cal-day.up { background: var(--rose); color: var(--mocha); }
.cal-day.was { border-color: var(--mocha-2); background: transparent; }
.cal-day.today { text-decoration: underline; text-underline-offset: 3px; color: var(--rose-deep); font-weight: 500; }
.cal-day[aria-pressed="true"] { outline: 2px solid var(--mocha); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend .up { background: var(--rose); }
.legend .was { border: 1.5px solid var(--mocha-2); }

/* Welcome page: event rows */
.event-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.event-row:first-of-type { border-top: 0; padding-top: 0; }
.event-row .name { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.15; }
.event-row .name em { color: var(--rose-deep); }
.event-row a.go { white-space: nowrap; font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-decoration: none; }
.event-row a.go:hover { text-decoration: underline; }

/* Front page menu */
.menu { padding: 6px 20px; gap: 0; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.menu-row:first-child { border-top: 0; }
.menu-title { font-family: var(--font-display); font-size: 23px; font-weight: 600; line-height: 1.1; }
.menu-arrow { color: var(--rose-deep); font-size: 20px; flex: none; }
.menu-row:hover .menu-title { color: var(--rose-deep); }

/* Stars */
.stars { display: flex; gap: 4px; }
.stars button { min-height: 44px; min-width: 44px; padding: 0; border: 0; font-size: 28px; letter-spacing: 0; color: var(--line); background: transparent; }
.stars button.on { color: var(--gold); }
.stars-text { color: var(--gold); letter-spacing: 0.1em; }

/* Steps (Add to Home Screen) */
.steps { margin: 0; padding-left: 22px; display: grid; gap: 4px; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise 0.25s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
}
@media (max-width: 420px) {
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .card { padding: 18px 16px; }
  .cover { padding: 36px 22px 30px; }
}
