:root {
    color-scheme: light;
    --ink: #2b2527;
    --muted: #74686c;
    --paper: #fffaf4;
    --rose: #b85f72;
    --rose-dark: #8d3f54;
    --sage: #52786f;
    --sage-deep: #24483f;
    --gold: #c99a3d;
    --line: rgba(43, 37, 39, 0.14);
    --shadow: 0 24px 70px rgba(43, 37, 39, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 16% 8%, rgba(184, 95, 114, 0.16), transparent 28rem),
        linear-gradient(135deg, #fffaf4 0%, #f8efe9 42%, #e8f0eb 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.guest-page {
    overflow: hidden;
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.68fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    min-height: min(760px, 92vh);
    padding: clamp(36px, 7vw, 92px);
    isolation: isolate;
}

.hero::after {
    position: absolute;
    inset: auto -8% -20% 42%;
    z-index: -1;
    height: 58%;
    content: "";
    background: linear-gradient(135deg, rgba(82, 120, 111, 0.2), rgba(201, 154, 61, 0.16));
    border-radius: 999px 0 0 0;
    transform: rotate(-3deg);
}

.hero__copy {
    max-width: 760px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 14px;
    color: var(--rose-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 12ch;
    margin-bottom: 24px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 7.4rem;
    font-weight: 500;
    line-height: 0.88;
}

h2 {
    margin-bottom: 24px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.2rem;
    font-weight: 500;
    line-height: 1;
}

h3 {
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.hero__meta span {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(255, 250, 244, 0.72);
    color: var(--sage-deep);
    font-weight: 700;
    backdrop-filter: blur(18px);
}

.hero__lead {
    max-width: 660px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1.6;
}

.hero__invitation {
    max-width: 620px;
    margin-bottom: 12px;
    color: var(--sage-deep);
    font-size: 1.34rem;
    font-weight: 800;
    line-height: 1.35;
}

.hero__actions,
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.rsvp.is-closed input,
.rsvp.is-closed button {
    cursor: not-allowed;
}

.button--primary {
    background: var(--rose);
    color: #fff;
    box-shadow: 0 14px 32px rgba(184, 95, 114, 0.28);
}

.button--primary:hover {
    background: var(--rose-dark);
}

.button--ghost {
    border-color: rgba(141, 63, 84, 0.28);
    background: rgba(255, 250, 244, 0.66);
    color: var(--rose-dark);
}

.button--quiet {
    border-color: rgba(36, 72, 63, 0.2);
    background: rgba(255, 255, 255, 0.4);
    color: var(--sage-deep);
}

.button--danger {
    border-color: rgba(141, 63, 84, 0.28);
    background: rgba(255, 250, 244, 0.7);
    color: var(--rose-dark);
}

.button--small {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.hero__art {
    position: relative;
    min-height: 420px;
}

.hero__art img {
    width: min(100%, 520px);
    height: auto;
    filter: drop-shadow(0 36px 60px rgba(43, 37, 39, 0.16));
}

.info-band {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    border-block: 1px solid var(--line);
    background: var(--line);
}

.info-band article,
.stats article {
    min-width: 0;
    padding: clamp(16px, 1.7vw, 28px);
    background: rgba(255, 250, 244, 0.82);
}

.info-band span,
.stats span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.info-band strong,
.stats strong {
    display: block;
    color: var(--sage-deep);
    font-size: clamp(0.9rem, 0.92vw, 1.08rem);
    line-height: 1.25;
}

.info-action {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.info-action strong {
    text-decoration: underline;
    text-decoration-color: rgba(36, 72, 63, 0.28);
    text-underline-offset: 4px;
}

.info-action:hover strong {
    color: var(--rose-dark);
    text-decoration-color: rgba(141, 63, 84, 0.5);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
    gap: clamp(28px, 5vw, 72px);
    padding: clamp(42px, 7vw, 92px);
}

.program,
.rsvp,
.admin-login,
.guest-panel,
.settings-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 244, 0.84);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.program {
    padding: clamp(28px, 4vw, 48px);
}

.wishes {
    margin-top: 34px;
    border-top: 1px solid var(--line);
    padding-top: 28px;
}

.wishes h2 {
    margin-bottom: 18px;
    font-size: 2.4rem;
}

.wishes ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
    color: var(--sage-deep);
    font-weight: 700;
    line-height: 1.5;
}

.timeline {
    display: grid;
    gap: 0;
}

.timeline__item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 18px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.timeline__item time {
    color: var(--gold);
    font-weight: 900;
}

.timeline__item p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.rsvp,
.admin-login {
    align-self: start;
    padding: clamp(24px, 4vw, 38px);
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--sage-deep);
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(43, 37, 39, 0.18);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--rose);
}

.checkbox-line--compact {
    min-height: 34px;
    color: var(--ink);
    font-weight: 700;
}

.form-section {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.car-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.car-fields label {
    margin-bottom: 0;
}

input,
select {
    min-height: 48px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(184, 95, 114, 0.14);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: var(--rose-dark);
    box-shadow: 0 0 0 4px rgba(141, 63, 84, 0.16);
}

.rsvp .button,
.admin-login .button {
    width: 100%;
}

.participant-fields {
    display: grid;
    gap: 14px;
    margin: 4px 0 18px;
}

.participant-fields:empty {
    display: none;
}

.participant-fields label {
    margin-bottom: 0;
}

.participant-fields__title {
    margin: 0;
    color: var(--rose-dark);
    font-size: 0.86rem;
    font-weight: 900;
    text-transform: uppercase;
}

.participant-fields input[readonly] {
    background: rgba(82, 120, 111, 0.08);
    color: var(--muted);
}

.participant-card {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(43, 37, 39, 0.12);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.48);
}

.participant-card label {
    margin-bottom: 0;
}

.participant-type {
    display: grid;
    gap: 8px;
    border: 0;
    margin: 0;
    padding: 0;
}

.participant-type legend {
    color: var(--sage-deep);
    font-weight: 800;
}

.segmented-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.segmented-options label {
    display: grid;
    margin-bottom: 0;
    cursor: pointer;
}

.segmented-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-options span {
    min-height: 42px;
    border: 1px solid rgba(36, 72, 63, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--sage-deep);
    font-weight: 900;
    text-align: center;
}

.segmented-options input:checked + span {
    border-color: var(--sage-deep);
    background: var(--sage-deep);
    color: #fff;
}

.field-caption {
    margin: 0;
    color: var(--sage-deep);
    font-weight: 800;
}

.alcohol-choice-group {
    display: grid;
    gap: 10px;
}

.alcohol-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.form-message {
    min-height: 24px;
    margin: 16px 0 0;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.4;
}

.form-message[data-type="success"] {
    color: var(--sage);
}

.form-message[data-type="error"] {
    color: var(--rose-dark);
}

.admin-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f7fbf8 0%, #fff8f1 54%, #f7e8eb 100%);
}

.admin-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 60px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.admin-header h1 {
    margin: 0;
    font-size: 4rem;
}

.admin-login {
    width: min(420px, 100%);
}

.admin-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    background: rgba(255, 250, 244, 0.74);
    box-shadow: 0 14px 36px rgba(43, 37, 39, 0.08);
}

.admin-tabs__button {
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: transparent;
    color: var(--sage-deep);
    font-weight: 900;
    cursor: pointer;
}

.admin-tabs__button.is-active {
    background: var(--sage-deep);
    color: #fff;
}

.guest-panel,
.settings-panel {
    padding: clamp(18px, 3vw, 30px);
}

.settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.settings-head h2,
.program-editor h3 {
    margin-bottom: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-grid label {
    margin-bottom: 0;
}

.settings-grid__wide {
    grid-column: 1 / -1;
}

.program-editor {
    margin-top: 30px;
    border-top: 1px solid var(--line);
    padding-top: 26px;
}

.program-editor__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.program-editor__rows {
    display: grid;
    gap: 12px;
}

.program-row {
    display: grid;
    grid-template-columns: 128px minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid rgba(43, 37, 39, 0.12);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.52);
}

.program-row label {
    margin-bottom: 0;
}

.wish-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid rgba(43, 37, 39, 0.12);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.52);
}

.wish-row label {
    margin-bottom: 0;
}

.program-row__remove {
    min-height: 48px;
    border: 1px solid rgba(141, 63, 84, 0.24);
    border-radius: 8px;
    padding: 10px 14px;
    background: rgba(255, 250, 244, 0.7);
    color: var(--rose-dark);
    font-weight: 900;
    cursor: pointer;
}

.settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 26px;
}

.saved-at {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(43, 37, 39, 0.34);
    backdrop-filter: blur(8px);
}

.modal__panel {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}

.modal__panel--wide {
    width: min(720px, 100%);
}

.modal__panel h2 {
    margin-bottom: 12px;
    font-size: 2.4rem;
}

.modal__text {
    margin-bottom: 22px;
    color: var(--muted);
    line-height: 1.55;
}

.modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.stats article {
    box-shadow: none;
}

.stats strong {
    font-size: 2rem;
}

.admin-insights {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1fr) minmax(280px, 1fr);
    gap: 18px;
    margin: 22px 0;
}

.insight-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: rgba(255, 250, 244, 0.86);
}

.insight-card h2 {
    margin-bottom: 16px;
    font-family: inherit;
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.2;
}

.insight-card .section-kicker {
    margin-bottom: 8px;
}

.split-chart {
    display: grid;
    gap: 14px;
}

.split-chart__bar {
    display: flex;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(36, 72, 63, 0.08);
}

.split-chart__adult {
    background: var(--sage-deep);
}

.split-chart__child {
    background: var(--rose);
}

.insight-totals {
    display: grid;
    gap: 10px;
}

.insight-totals span,
.insight-list li {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--sage-deep);
    font-weight: 700;
}

.insight-totals strong,
.insight-list strong {
    color: var(--ink);
    font-size: 1.08rem;
}

.insight-totals--boxed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.insight-totals--boxed span {
    border: 1px solid rgba(43, 37, 39, 0.1);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.55);
}

.insight-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
}

.insight-dot--adult {
    background: var(--sage-deep);
}

.insight-dot--child {
    background: var(--rose);
}

.insight-list {
    display: grid;
    max-height: 240px;
    gap: 0;
    margin: 0;
    overflow-y: auto;
    padding: 0;
    list-style: none;
}

.insight-list li {
    align-items: flex-start;
    border-top: 1px solid rgba(43, 37, 39, 0.1);
    padding: 10px 0;
}

.insight-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.car-insight-list li {
    align-items: flex-start;
}

.insight-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.table-toolbar {
    justify-content: space-between;
    margin: 22px 0;
}

.table-toolbar input {
    width: min(420px, 100%);
}

.table-toolbar__actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(43, 37, 39, 0.1);
    text-align: left;
}

th {
    background: rgba(82, 120, 111, 0.1);
    color: var(--sage-deep);
    font-size: 0.82rem;
    text-transform: uppercase;
}

td {
    color: var(--ink);
}

.participant-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
}

.participant-list li {
    display: grid;
    gap: 2px;
}

.participant-list span,
.car-summary span {
    color: var(--muted);
    font-size: 0.9rem;
}

.car-summary {
    display: grid;
    gap: 2px;
}

.empty-row {
    color: var(--muted);
    text-align: center;
}

.guest-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 18px;
}

.guest-editor-grid__wide {
    grid-column: 1 / -1;
}

[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .hero,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-bottom: 36px;
    }

    .hero__art {
        min-height: 260px;
        order: -1;
    }

    .hero__art img {
        max-width: 360px;
    }

    h1 {
        font-size: 5rem;
    }

    h2 {
        font-size: 2.7rem;
    }

    .program-row {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .admin-insights {
        grid-template-columns: 1fr;
    }

    .program-row__wide,
    .program-row__remove,
    .wish-row {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .hero,
    .content-grid {
        padding-inline: 20px;
    }

    .info-band,
    .stats {
        grid-template-columns: 1fr;
    }

    .timeline__item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-tabs,
    .settings-head,
    .program-editor__head,
    .settings-footer,
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .admin-tabs__button {
        width: 100%;
    }

    .settings-grid,
    .guest-editor-grid,
    .program-row,
    .wish-row {
        grid-template-columns: 1fr;
    }

    .insight-totals--boxed {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .hero__lead {
        font-size: 1.08rem;
    }

    .admin-header h1 {
        font-size: 3rem;
    }

    .saved-at {
        text-align: left;
    }
}
