/* Colors and fonts are set per theme in themes.js. These are the Classic defaults. */
:root {
  --bg: #FBF5F8; --surface: #FFFFFF; --ink: #2A1530; --muted: #6E5A72;
  --accent: #B3175A; --accent-ink: #FFFFFF; --soft: #F3DCE6; --line: #E6D3DD;
  --display: Georgia, serif; --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="disco"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pre { white-space: pre-line; }
.hint { color: var(--muted); font-size: 15px; }
.error { color: #C0262D; font-size: 15px; min-height: 0; }
.error:empty { display: none; }
:root[data-theme="disco"] .error { color: #FF8A8A; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 16px; padding: 12px 22px; border-radius: 999px; cursor: pointer;
  min-height: 48px; transition: transform .08s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 40px; padding: 7px 16px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn.danger { background: #C0262D; border-color: #C0262D; color: #fff; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: #C0262D; margin-right: auto; padding-left: 4px; }
:root[data-theme="disco"] .btn.danger-ghost { color: #FF8A8A; }
.link {
  appearance: none; background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.danger-text { color: #C0262D; }
:root[data-theme="disco"] .danger-text { color: #FF8A8A; }
.edit-btn {
  appearance: none; background: var(--soft); color: var(--ink); border: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; white-space: nowrap; min-height: 34px;
}
.icon-btn { appearance: none; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 6px; }

/* ---------- Simple screens (sign-in, code, lists) ---------- */
.screen { max-width: 460px; margin: 0 auto; padding: 56px 20px 40px; display: grid; gap: 18px; }
.screen h1 { font-size: clamp(34px, 9vw, 44px); }
.brand { font-family: var(--display); font-size: 18px; color: var(--accent); }
.lead { font-size: 18px; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 15px; }
input, textarea, select {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; min-height: 48px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trip-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.trip-pick {
  width: 100%; text-align: left; display: grid; gap: 2px; padding: 16px 18px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.trip-pick-name { font-family: var(--display); font-size: 22px; }

/* ---------- Trip page ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 720px; margin: 0 auto; padding: 10px 20px;
}
.topbar .brand { font-size: 16px; white-space: nowrap; }
.topbar .link { white-space: nowrap; }
.topbar-right { display: flex; gap: 18px; margin-left: auto; }
@media (max-width: 440px) { .topbar.busy > .brand { display: none; } }

/* The invitation: the one bold thing on the page. Bottom edge is a ticket perforation. */
.invite {
  max-width: 720px; margin: 4px auto 0; padding: 40px 24px 52px; text-align: center;
  background: var(--accent); color: var(--accent-ink);
  display: grid; gap: 12px; justify-items: center;
  -webkit-mask: radial-gradient(circle 9px at 50% 100%, #0000 98%, #000) 50% 0 / 26px 100% repeat-x;
          mask: radial-gradient(circle 9px at 50% 100%, #0000 98%, #000) 50% 0 / 26px 100% repeat-x;
}
@media (min-width: 760px) { .invite { border-radius: 22px 22px 0 0; } }
.ornament { letter-spacing: .4em; opacity: .8; font-size: 18px; }
.trip-name { font-size: clamp(42px, 12vw, 76px); line-height: 1.02; max-width: 14ch; text-wrap: balance; overflow-wrap: anywhere; }
.trip-name.placeholder { opacity: .6; }
.honoree { font-family: var(--display); font-size: 22px; }
.when { font-weight: 600; font-size: 17px; }
.countdown {
  font-size: 14px; font-weight: 700; padding: 4px 14px; border-radius: 999px;
  border: 1.5px solid currentColor;
}
.welcome { max-width: 46ch; font-size: 17px; opacity: .95; white-space: pre-line; }
.invite .edit-btn { background: var(--accent-ink); color: var(--accent); margin-top: 6px; }

.trip { max-width: 720px; margin: 0 auto; padding: 8px 20px 64px; display: grid; gap: 40px; }
.block { display: grid; gap: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.block > .section-head h2 { font-size: clamp(28px, 7vw, 36px); }
.empty { color: var(--muted); font-style: italic; }

/* Setup checklist (organizer only) */
.setup {
  background: var(--surface); border: 2px dashed var(--accent); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 10px; margin-top: 8px;
}
.setup.complete { border-style: solid; border-color: var(--line); }
.setup h2 { font-size: 26px; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.steps li {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.steps li > .btn { grid-column: 2; justify-self: start; margin-top: 6px; }
@media (min-width: 560px) {
  .steps li { grid-template-columns: 34px 1fr auto; }
  .steps li > .btn { grid-column: 3; margin-top: 0; }
}
.step-mark {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 15px;
}
.steps li.done .step-mark { background: var(--accent); color: var(--accent-ink); }
.step-text { display: grid; }
.steps li.done .step-text strong { color: var(--muted); }
.preview-note {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between;
  background: var(--soft); padding: 12px 16px; border-radius: var(--radius); font-weight: 600; margin-top: 8px;
}

/* The plan */
.day { display: grid; gap: 4px; }
.day h3 { font-size: 21px; color: var(--accent); padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.events { list-style: none; margin: 0; padding: 0; }
.event {
  display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.event-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; padding-top: 2px; color: var(--muted); }
.event-body { display: grid; gap: 2px; }
.event-body strong { font-size: 18px; }
.event-place { color: var(--muted); }
.event-notes { white-space: pre-line; font-size: 16px; margin-top: 4px; }

/* Stay */
.stay { display: grid; gap: 8px; padding-left: 16px; border-left: 4px solid var(--accent); }
.stay-name { font-family: var(--display); font-size: 24px; }

/* Who's coming */
.names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.names li { background: var(--soft); padding: 6px 14px; border-radius: 999px; font-weight: 500; }

/* Good to know */
.cards { display: grid; gap: 12px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border-top: 4px solid var(--accent); border-radius: 4px 4px var(--radius) var(--radius); padding: 16px 18px; display: grid; gap: 8px; align-content: start; }
.card h3 { font-size: 21px; }

.foot { border-top: 1px solid var(--line); padding-top: 20px; color: var(--muted); }

/* ---------- Sheets (pop-up forms) ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--bg); color: var(--ink);
  width: 100%; max-width: 560px; max-height: 92vh; border-radius: 20px 20px 0 0;
  margin: auto auto 0; overflow: auto;
}
@media (min-width: 620px) { dialog.sheet { margin: auto; border-radius: 20px; } }
dialog.sheet::backdrop { background: rgba(20, 10, 25, .5); }
.sheet-head {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 8px;
}
.sheet-head h2 { font-size: 26px; }
.sheet-body { padding: 4px 20px 24px; display: grid; gap: 14px; }
.sheet-body ul:not(.names):not(.guest-rows) { margin: 0; padding-left: 20px; }

.add-guest { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) { .add-guest { grid-template-columns: 1fr 1.3fr auto; } }
.bulk summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; padding: 4px 0; }
.bulk[open] summary { margin-bottom: 10px; }
.guest-rows { list-style: none; margin: 0; padding: 0; }
.guest-rows li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.guest-who { display: grid; min-width: 0; }
.guest-who .hint { overflow-wrap: anywhere; }
.status { font-size: 13px; font-weight: 700; color: var(--muted); }
.status.sent { color: var(--accent); }
.guest-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600;
  z-index: 1000; max-width: calc(100% - 32px); text-align: center; transition: opacity .4s;
}
.toast.out { opacity: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
