:root {
  --bg: #f6f3ec;
  --ink: #22302a;
  --muted: #56615a;
  --accent: #46663a;
  --line: #d9d3c4;
  --paper: #fbfaf6;
  --error: #9b2c1f;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sh-accent: #46663a;
  --sh-muted: #56615a;
  --sh-radius: 6px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 36rem; margin: 0 auto; padding: 0 20px; }

/* Invitation */
.invite { padding-top: 64px; padding-bottom: 40px; text-align: center; }
.sprig { width: 64px; height: 64px; color: var(--accent); margin: 0 auto 20px; display: block; }
.eyebrow {
  font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px;
}
h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.5rem, 9vw, 3.75rem); line-height: 1.05;
  margin: 0 0 20px; letter-spacing: -0.01em;
}
h1 em { font-style: italic; font-weight: 500; white-space: nowrap; }
h1, h2, .details dd, .stats dd { font-variant-numeric: lining-nums; }
.lede { font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; margin: 0 auto; max-width: 30rem; }

.details {
  margin: 40px 0 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; gap: 16px; text-align: center;
}
.details div { display: grid; gap: 2px; }
.details dt { font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.details dd { margin: 0; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }

@media (min-width: 640px) {
  .invite { padding-top: 96px; padding-bottom: 48px; }
  .details { grid-template-columns: repeat(3, 1fr); }
  .details div + div { border-left: 1px solid var(--line); }
}

.note { margin: 32px 0 0; color: var(--muted); text-align: center; }

/* Form */
.rsvp { padding-top: 24px; padding-bottom: 64px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 28px 20px; }
@media (min-width: 640px) { .card { padding: 40px; } }
h2 { font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1.15; margin: 0 0 6px; }
.card > p.sub { margin: 0 0 28px; color: var(--muted); }

.field { margin: 0 0 24px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; margin: 0 0 8px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); }
.req { color: var(--muted); font-weight: 400; }
input[type=text], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #838b83; border-radius: 6px; padding: 10px 12px; min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
.hint { font-size: 0.875rem; color: var(--muted); margin: 6px 0 0; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice label {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 0;
  min-height: 52px; padding: 10px 14px; border: 1px solid #838b83; border-radius: 6px;
  background: #fff; font-weight: 500; cursor: pointer;
}
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.choice label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #f1f4ec; }
.choice label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.field[hidden] { display: none; }

.actions { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
button.primary {
  font: inherit; font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 6px; min-height: 52px; padding: 12px 24px; cursor: pointer; width: 100%;
}
button.primary:hover { background: #3a5630; }
button.primary[disabled] { opacity: 0.7; cursor: progress; }
@media (min-width: 640px) { button.primary { width: auto; align-self: flex-start; } }

.status { min-height: 1.6em; margin: 0; }
.status.error { color: var(--error); }
.status a { color: var(--error); }

.done { text-align: center; padding: 16px 0; }
.done h2 { margin-bottom: 12px; }
.done p { margin: 0 0 20px; }
button.link {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 10px 4px;
  min-height: 44px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

#sh-auth { margin: 0 0 24px; font-size: 0.875rem !important; line-height: 1.5 !important; }
#sh-auth:empty { display: none; }

footer { padding-top: 32px; padding-bottom: 48px; text-align: center; color: var(--muted); font-size: 0.875rem; }
footer a { color: var(--muted); display: inline-block; padding: 12px 8px; }

/* Admin */
.admin-head { padding-top: 48px; padding-bottom: 24px; }
.admin-head h1 { font-size: clamp(2.25rem, 7vw, 3rem); margin-bottom: 8px; }
.admin-head p { margin: 0; color: var(--muted); }
.wide { max-width: 60rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 40px; padding: 0; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stats dt { font-size: 0.8125rem; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-family: var(--serif); font-size: 2.5rem; font-weight: 600; line-height: 1; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.list-head h2 { margin: 0; font-size: 1.6rem; }
.list-head p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
th, td { text-align: left; padding: 12px 16px; vertical-align: top; }
thead th { font-size: 0.8125rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid var(--line); }
td.num { font-variant-numeric: tabular-nums; }
td.when { white-space: nowrap; }
.pill { justify-self: start; white-space: nowrap; display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: 0.875rem; border: 1px solid currentColor; }
.pill.yes { color: var(--accent); }
.pill.no { color: var(--muted); }

@media (max-width: 639px) {
  table, tbody, tr, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table { border: 0; background: none; }
  tbody tr { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 0; margin: 0 0 12px; }
  tbody tr + tr td { border-top: 0; }
  td { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; padding: 6px 16px; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 0.875rem; }
}

.state-msg { padding: 32px 20px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: 10px; }
.state-msg.error { color: var(--error); border-style: solid; }

/* Your reply (index.html) */
#your-reply { padding-bottom: 32px; }
#your-reply h2 { font-size: 1.5rem; margin: 0 0 16px; }
.replies { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.replies li { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.more { display: flex; justify-content: center; margin: 24px 0 0; }
button.secondary {
  font: inherit; font-weight: 600; color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 6px; min-height: 48px; padding: 10px 24px; cursor: pointer;
}
button.secondary:hover { background: #eef1e8; }
button.secondary[disabled] { opacity: 0.6; cursor: progress; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
