:root {
	--ink: #161616;
	--bg: #f7f5f1;
	--panel: #fffdf9;
	--line: #ddd6cb;
	--muted: #666;
	--accent: #8d6a28;
	--ok: #275c34;
	--err: #8a2f2f;
	--sans: "Outfit", system-ui, sans-serif;
	--serif: "Cormorant Garamond", Georgia, serif;
}

* {
	box-sizing: border-box;
}

html {
	font-size: 112.5%; /* 18px base for readability */
}

body {
	margin: 0;
	font-family: var(--sans);
	background: var(--bg);
	color: var(--ink);
	line-height: 1.45;
}

a {
	color: inherit;
}

.wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 1.5rem;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.topbar h1 {
	font-family: var(--serif);
	font-weight: 500;
	font-size: 2rem;
	margin: 0;
}

.nav {
	display: flex;
	gap: 1rem;
	font-size: 0.9rem;
}

.nav a {
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.nav a:hover {
	border-bottom-color: var(--ink);
}

.flash {
	padding: 0.8rem 1rem;
	margin-bottom: 1rem;
	border: 1px solid var(--line);
	background: var(--panel);
	white-space: normal;
	line-height: 1.45;
}

.flash-ok {
	border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
	color: var(--ok);
}

.flash-err {
	border-color: color-mix(in srgb, var(--err) 35%, var(--line));
	color: var(--err);
}

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.stat {
	background: var(--panel);
	border: 1px solid var(--line);
	padding: 0.9rem;
}

.stat .n {
	font-family: var(--serif);
	font-size: 1.8rem;
	display: block;
}

.stat .l {
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	padding: 1.25rem;
	margin-bottom: 1.25rem;
}

.panel h2 {
	margin: 0 0 0.85rem;
	font-size: 1rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
}

.panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.85rem;
}

.panel-header h2 {
	margin: 0;
}

button.sort-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	cursor: pointer;
}

button.sort-btn:hover,
button.sort-btn.is-active {
	color: var(--ink);
	background: transparent;
}

button.sort-btn .sort-ind {
	font-size: 0.75rem;
	letter-spacing: 0;
	min-width: 0.7rem;
	line-height: 1;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 1rem;
}

button,
.btn {
	appearance: none;
	border: 1px solid var(--ink);
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.65rem 0.9rem;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}

button:hover,
.btn:hover {
	background: var(--ink);
	color: #fff;
}

button.primary,
.btn.primary {
	background: var(--ink);
	color: #fff;
}

button.primary:hover,
.btn.primary:hover {
	background: var(--accent);
	border-color: var(--accent);
}

button.danger:hover {
	background: var(--err);
	border-color: var(--err);
}

label {
	display: block;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0.75rem 0 0.35rem;
}

input,
select,
textarea {
	width: 100%;
	border: 1px solid var(--line);
	background: #fff;
	padding: 0.65rem 0.75rem;
	font: inherit;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
}

@media (min-width: 700px) {
	.form-row.two {
		grid-template-columns: 1fr 1fr;
	}

	.form-row.three {
		grid-template-columns: 2fr 2fr 1fr;
	}
}

.table-wrap {
	width: 100%;
	overflow-x: auto;
}

#guest-table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 0.92rem;
}

#guest-table col.col-guest {
	width: auto;
}

#guest-table col.col-size {
	width: 4.5rem;
}

#guest-table col.col-rsvp {
	width: 8.5rem;
}

#guest-table col.col-invite {
	width: 6.5rem;
}

#guest-table col.col-actions {
	width: 8.5rem;
}

#guest-table th,
#guest-table td {
	text-align: left;
	padding: 0.85rem 0.75rem;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

#guest-table th {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 600;
	padding-top: 0.35rem;
	padding-bottom: 0.65rem;
}

#guest-table td.col-guest {
	padding-left: 0;
}

#guest-table th:first-child {
	padding-left: 0;
}

#guest-table td.col-actions,
#guest-table th:last-child {
	padding-right: 0;
	text-align: right;
}

#guest-table .guest-name {
	font-weight: 600;
	line-height: 1.3;
}

#guest-table .guest-email,
#guest-table .guest-notes {
	color: var(--muted);
	font-size: 0.84rem;
	line-height: 1.35;
	margin-top: 0.15rem;
	overflow-wrap: anywhere;
}

#guest-table tr.no-email {
	background: color-mix(in srgb, var(--accent) 12%, transparent);
}

#guest-table tr.no-email td {
	border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

#guest-table .no-email-label {
	color: var(--accent);
	font-weight: 500;
}

button.icon-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

button.icon-btn:disabled:hover {
	color: var(--ink);
	background: transparent;
}

#guest-table .guest-notes {
	font-style: italic;
}

#guest-table .guest-dietary {
	font-style: normal;
	color: var(--accent);
}

.guest-rsvp-fields {
	margin-top: 0.75rem;
}

.guest-attending-wrap {
	margin-top: 0.75rem;
}

#guest-table .col-size {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.rsvp-text {
	font-size: 0.9rem;
	white-space: nowrap;
}

.rsvp-text.attending {
	color: var(--ok);
}

.rsvp-text.unable {
	color: var(--err);
}

.rsvp-text.maybe {
	color: var(--accent);
}

.invite-pending,
.cell-empty {
	color: var(--muted);
}

.invite-status {
	font-size: 0.9rem;
}

.invite-sent {
	color: var(--ink);
}

.invite-delivered {
	color: var(--ok);
	font-weight: 500;
}

.invite-delayed {
	color: var(--accent);
}

.invite-bounced,
.invite-failed,
.invite-complained,
.invite-suppressed {
	color: var(--err);
	font-weight: 600;
}

#guest-table tr[data-delivery="bounced"],
#guest-table tr[data-delivery="failed"],
#guest-table tr[data-delivery="complained"],
#guest-table tr[data-delivery="suppressed"] {
	background: color-mix(in srgb, var(--err) 8%, transparent);
}

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

.muted {
	color: var(--muted);
	font-size: 0.88rem;
}

table:not(#guest-table) {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

table:not(#guest-table) th,
table:not(#guest-table) td {
	text-align: left;
	padding: 0.65rem 0.4rem;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}

table:not(#guest-table) th {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 600;
}

.login {
	min-height: 100svh;
	display: grid;
	place-items: center;
	padding: 1.5rem;
}

.login-card {
	width: min(100%, 24rem);
	background: var(--panel);
	border: 1px solid var(--line);
	padding: 2rem 1.5rem;
	text-align: center;
}

.login-card h1 {
	font-family: var(--serif);
	font-weight: 500;
	margin: 0 0 0.5rem;
}

.row-actions {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.1rem;
}

.row-actions form {
	display: contents;
}

button.icon-btn,
a.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.85rem;
	height: 1.85rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	text-decoration: none;
	letter-spacing: 0;
	text-transform: none;
	font-size: 0;
	line-height: 0;
	flex: 0 0 auto;
}

button.icon-btn svg,
a.icon-btn svg {
	width: 1.1rem;
	height: 1.1rem;
	display: block;
}

button.icon-btn:hover,
a.icon-btn:hover {
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 10%, transparent);
	border: 0;
}

button.icon-btn.danger {
	color: var(--err);
}

button.icon-btn.danger:hover {
	color: var(--err);
	background: color-mix(in srgb, var(--err) 10%, transparent);
	border: 0;
}

button.icon-btn:focus-visible,
a.icon-btn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.help {
	font-size: 0.88rem;
	color: var(--muted);
	margin: 0 0 1rem;
}

.edit-dialog {
	width: 80vw;
	height: 80vh;
	max-width: 80vw;
	max-height: 80vh;
	border: 1px solid var(--line);
	padding: 1.25rem;
	background: var(--panel);
	color: var(--ink);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
	overflow: auto;
}

.edit-dialog::backdrop {
	background: rgba(20, 18, 14, 0.45);
}

.edit-dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.edit-dialog-header h2 {
	margin: 0;
	font-size: 1rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
}

.edit-dialog form {
	margin: 0;
}

.edit-dialog textarea {
	width: 100%;
	min-height: 9rem;
	resize: vertical;
	border: 1px solid var(--line);
	background: #fff;
	padding: 0.75rem 0.85rem;
	font: inherit;
	line-height: 1.45;
}

.party-size {
	margin: 0.75rem 0 0;
	padding: 0;
	border: 0;
}

.party-size legend {
	display: block;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0 0 0.35rem;
	padding: 0;
}

.party-size-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.party-size-option {
	position: relative;
	margin: 0;
	cursor: pointer;
	width: fit-content;
}

.party-size-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.party-size-option span {
	display: inline-block;
	border: 1px solid var(--ink);
	padding: 0.65rem 0.9rem;
	text-align: center;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	transition:
		background 140ms ease,
		color 140ms ease;
}

.party-size-option:hover span {
	background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.party-size-option input:checked + span {
	background: var(--ink);
	color: #fff;
}

.party-size-option input:focus-visible + span {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}








