:root {
  color-scheme: light;
  --fg: #3a291d;
  --fg-muted: #6b5744;
  --bg: #fbf3e8;
  --bg-alt: #f3e3cc;
  --accent: #b5502d;
  --accent-dark: #8f3f22;
  --accent-gold: #c98a3d;
  --link: #295f98;
  --border: #e3cfae;
  --warning-bg: #f7e3b8;
  --warning-fg: #7a4b12;
}

* { box-sizing: border-box; }

input[type="radio"], input[type="checkbox"] {
  accent-color: var(--accent);
}

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  border-top: 6px solid;
  border-image: linear-gradient(90deg, var(--accent), var(--accent-gold)) 1;
}

.page > * { margin-top: 0; }
.page h1 { margin-top: 2rem; }

.event-details {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}

.event-date {
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0;
}

.event-venue {
  margin: 0.25rem 0 0;
  color: var(--fg-muted);
}

.event-deadline {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--accent-dark);
}

.page.wide { max-width: 960px; }
.page.narrow { max-width: 360px; }

h1 {
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  color: var(--accent-dark);
}

h2 {
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  font-size: 1.15rem;
  color: var(--accent-dark);
}

a { color: var(--link); }

.note {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
}

.note.warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.form-errors ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

form { display: flex; flex-direction: column; gap: 1rem; }

fieldset.guest-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--bg-alt) 45%, transparent);
}

fieldset.guest-row legend {
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-dark);
  padding: 0 0.4rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

input, select, textarea, button {
  font: inherit;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 1px;
}

textarea { min-height: 4rem; }

.attending-choice {
  display: flex;
  gap: 1.5rem;
  flex-direction: row;
}

.attending-choice label { flex-direction: row; align-items: center; gap: 0.4rem; }

button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

button[type="submit"]:hover { background: var(--accent-dark); }

.link-button {
  background: none;
  border: none;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.remove-guest { color: var(--accent-dark); align-self: flex-start; }

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  background: var(--bg);
  color: var(--fg);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

dialog h2:first-child { margin-top: 0; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.stat-num { font-size: 1.5rem; font-weight: bold; color: var(--accent-dark); }

table.invite-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

table.invite-table th {
  color: var(--accent-dark);
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
}

table.invite-table th, table.invite-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.5rem;
  vertical-align: top;
}

.guest-status { white-space: nowrap; }
.meal-icon { margin-left: 0.25rem; }

.sent-cell { text-align: center; }
.sent-checkbox { width: 1.1rem; height: 1.1rem; }

.rsvp-link-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.email-cell { white-space: nowrap; }

.copy-icon-btn {
  font-size: 0.85rem;
  line-height: 1;
  vertical-align: middle;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.activity-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.activity-time { color: var(--fg-muted); }

.copy-link-btn { font-size: 0.85rem; }
