:root {
  --bg: #f7f2ea;
  --card: #fffdf9;
  --ink: #2b2420;
  --muted: #7a6d62;
  --line: #e6dccd;
  --gold: #a8803f;
  --gold-soft: #f1e6d1;
  --accent: #6d4c41;
  --focus: #1d5fbf;
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1714;
    --card: #25201c;
    --ink: #f3ece3;
    --muted: #b9ab9c;
    --line: #3b332c;
    --gold: #d4ae6a;
    --gold-soft: #3a2f22;
    --accent: #e4c9a0;
    --focus: #8cb8ff;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

[hidden] { display: none !important; }

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}

.masthead { text-align: center; position: relative; padding: 2.5rem 0 1.25rem; }

.lang {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: .35rem .9rem;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

[dir="rtl"] .kicker { letter-spacing: 0; font-size: .95rem; }

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 8vw, 2.75rem);
  line-height: 1.15;
  margin: .4rem 0 .6rem;
  color: var(--accent);
}

.flourish { display: flex; align-items: center; justify-content: center; gap: .75rem; color: var(--gold); }
.flourish span { height: 1px; width: 4rem; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 10px 30px -18px rgb(80 50 20 / .35);
}

.card-title { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 1rem; text-align: center; }

.stack { display: flex; flex-direction: column; gap: .4rem; }

label { font-weight: 600; font-size: .95rem; }

.row { display: flex; gap: .5rem; }

input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.1rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}

input[dir="ltr"] { text-align: start; }
[dir="rtl"] input[type="tel"] { text-align: end; }

button { font: inherit; cursor: pointer; }

.primary {
  border: 0;
  border-radius: 12px;
  padding: .8rem 1.4rem;
  background: var(--accent);
  color: var(--card);
  font-weight: 600;
}

.secondary {
  margin-top: 1.25rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .8rem;
  background: transparent;
  color: var(--ink);
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h2:focus { outline: none; }

.or {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0 1rem;
  color: var(--muted);
  font-size: .9rem;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.message { min-height: 1.5em; margin: .75rem 0 0; color: var(--muted); text-align: center; }

.hits, .guests { list-style: none; margin: 0; padding: 0; }

.hit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: start;
  background: transparent;
  color: inherit;
  border: 0;
  border-top: 1px solid var(--line);
  padding: .8rem .25rem;
}
.hits li:first-child .hit { border-top: 0; }

.hit-text { display: flex; flex-direction: column; min-width: 0; }
.hit-name { font-weight: 600; }
.hit-sub, .guest-sub { color: var(--muted); font-size: .9rem; }

.badge {
  flex-shrink: 0;
  background: var(--gold-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}

.table-card { text-align: center; }

.table-number {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 16vw, 4.5rem);
  line-height: 1.1;
  margin: .25rem 0;
  color: var(--accent);
}

.seats { color: var(--muted); margin: 0 0 1.25rem; }

.guests { text-align: start; }
.guests li {
  display: flex;
  flex-direction: column;
  padding: .7rem .9rem;
  border-top: 1px solid var(--line);
}
.guests li:first-child { border-top: 0; }
.guests li.mine { background: var(--gold-soft); border-radius: 12px; border-top-color: transparent; }
.guests li.mine + li { border-top-color: transparent; }
.guest-name { font-weight: 600; }
.you {
  display: inline-block;
  margin-inline-start: .35rem;
  padding: 0 .5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--card);
  font-size: .75rem;
  font-weight: 600;
  vertical-align: middle;
}

.foot { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 2rem; font-family: var(--serif); font-style: italic; }

/* Invite page (invite.html) */
.stack-lg { display: flex; flex-direction: column; gap: 1.1rem; }
.hint { margin: 0; color: var(--muted); font-size: .9rem; }
.center { text-align: center; margin-bottom: 1rem; }
.message.error { color: var(--danger, #a3302a); margin: 0; }
select {
  font: inherit;
  font-size: 1.1rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}
.choices { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.choices legend { font-weight: 600; font-size: .95rem; margin-bottom: .5rem; padding: 0; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 1.05rem;
}
.choice input:checked + span { border-color: var(--accent); background: var(--gold-soft); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid #1d5fbf; outline-offset: 2px; }
#form-card .primary { width: 100%; padding: 1rem; font-size: 1.05rem; }

.message:empty { display: none; }

/* Credit line under every guest page (story 407): small and quiet, never competing with the couple. */
.credit { text-align: center; color: var(--muted); font-size: .8rem; margin: 1.5rem 0 0; line-height: 1.8; }
.credit a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; padding: .25rem 0; }
.credit a:hover, .credit a:focus-visible { color: var(--accent); }

.plan-link { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.all-tables { margin-top: 1rem; }
#all-tables-2 { margin-bottom: 0.75rem; }

/* Invitation card (story 412): full width under the couple's names. */
.card-figure { margin: 0 0 1.25rem; }
.card-figure img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 10px 30px rgba(60, 40, 20, .12); background: #fff; }
.note { margin: 0 0 1.25rem; padding: .85rem 1rem; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold-soft); color: var(--ink); text-align: center; font-weight: 600; }

/* Changing an answer goes through the couple (story 416). */
.call-text { margin: 1rem 0 0.5rem; color: var(--muted); }
