:root {
    color-scheme: light;
    --ink: #202326;
    --muted: #667077;
    --subtle: #87929a;
    --line: #d9e0e2;
    --paper: #fbfcfb;
    --panel: #ffffff;
    --soft: #eef5f1;
    --soft-blue: #eef4f7;
    --accent: #a3475b;
    --accent-dark: #7f2d40;
    --accent-2: #1f746b;
    --accent-2-dark: #18564f;
    --gold: #b48335;
    --danger: #b43f3f;
    --success: #2d735a;
    --warning: #9a6a1c;
    --shadow: 0 18px 44px rgba(28, 38, 42, .09);
    --shadow-soft: 0 8px 24px rgba(28, 38, 42, .07);
    --radius: 8px;
    --container: min(1180px, calc(100% - 40px));
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(20px, 5vw, 64px);
    background: rgba(251, 252, 251, .94);
    border-bottom: 1px solid var(--line);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}

.site-footer {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    color: var(--muted);
    font-size: .94rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.18rem;
    font-weight: 700;
    text-decoration: none;
}

.brand::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 8px 0 0 -2px var(--accent-2);
}

nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius);
    padding: 0 10px;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

nav a:hover {
    background: var(--soft-blue);
    color: var(--ink);
}

main {
    min-height: calc(100vh - 150px);
}

.hero,
.dashboard-head,
.feature-band,
.editor-grid,
.admin-grid,
.wedding-page > section,
.not-found,
.stats-grid,
.admin-tabs,
.table-section,
.guest-head,
.guest-grid {
    width: var(--container);
    margin-inline: auto;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: clamp(28px, 5vw, 56px);
    align-items: center;
    padding: clamp(52px, 8vw, 92px) 0 54px;
}

.hero h1,
.wedding-hero h1 {
    max-width: 900px;
}

.eyebrow,
.panel-label {
    margin: 0 0 12px;
    color: var(--accent-2);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0 0 16px;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.06;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2.6rem, 7vw, 5.5rem);
}

h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

p {
    margin: 0 0 14px;
}

.lede {
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.muted {
    color: var(--muted);
}

.actions,
.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.button,
button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    padding: 0 18px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(163, 71, 91, .18);
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button:hover,
button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 12px 24px rgba(163, 71, 91, .24);
    transform: translateY(-1px);
}

.button.small {
    min-height: 36px;
    padding: 0 12px;
    font-size: .88rem;
}

.button.ghost {
    background: #fff;
    color: var(--accent-dark);
    box-shadow: none;
}

.button.ghost:hover {
    background: #fff4f6;
}

.button.danger {
    border-color: var(--danger);
    background: var(--danger);
    box-shadow: none;
}

.button.danger:hover {
    background: #8f2e2e;
    border-color: #8f2e2e;
}

.preview-panel,
.form-card,
.editor,
.rsvp-panel,
.rsvp-section,
.guest-panel,
.guest-card,
.stats-grid article,
.access-form {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.preview-panel {
    position: relative;
    overflow: hidden;
    padding: 28px;
}

.preview-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--gold));
}

.preview-panel strong {
    display: block;
    margin-bottom: 20px;
    font-size: 1.24rem;
    overflow-wrap: anywhere;
}

.mini-grid,
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.mini-grid span,
.toggle,
.check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft-blue);
    padding: 10px 12px;
    color: var(--ink);
    font-weight: 800;
}

.feature-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 18px 0 78px;
}

.feature-band article {
    border-top: 3px solid var(--accent-2);
    padding: 18px 4px 0;
}

.feature-band article:nth-child(2) {
    border-color: var(--accent);
}

.feature-band article:nth-child(3) {
    border-color: var(--gold);
}

.auth-layout {
    display: grid;
    place-items: start center;
    padding: 56px 20px 72px;
    background: linear-gradient(180deg, var(--soft-blue), var(--paper));
}

.form-card {
    width: min(540px, 100%);
    padding: 28px;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: .94rem;
    font-weight: 900;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 12px 13px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 4px rgba(31, 116, 107, .12);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-2);
}

.flash {
    width: var(--container);
    margin: 16px auto 0;
    border: 1px solid #b8dfcf;
    border-radius: var(--radius);
    background: #e9f7f1;
    color: #225a48;
    padding: 12px 14px;
    font-weight: 800;
}

.flash.error {
    border-color: #efc7c7;
    background: #fff0f0;
    color: var(--danger);
}

.dashboard,
.guest-dashboard {
    padding: 34px 0 72px;
}

.dashboard-head,
.guest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-head h1,
.guest-head h1 {
    font-size: clamp(2rem, 5vw, 3.9rem);
}

.editor-grid,
.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
}

.editor,
.rsvp-panel {
    padding: 24px;
}

.editor h2 + .two-col,
.editor h2 + .three-col {
    margin-top: 6px;
}

.two-col,
.three-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.url-prefix {
    display: block;
    color: var(--accent-2);
    font-size: .9rem;
}

.rsvp-panel {
    align-self: start;
    display: grid;
    gap: 14px;
}

.rsvp-card {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.rsvp-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.admin-console {
    background: linear-gradient(180deg, #f5f8f7 0, #fbfcfb 42%, #f7f3f5 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stats-grid article {
    position: relative;
    padding: 18px;
    overflow: hidden;
}

.stats-grid article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent-2);
}

.stats-grid article:nth-child(2)::before {
    background: var(--success);
}

.stats-grid article:nth-child(3)::before {
    background: var(--danger);
}

.stats-grid article:nth-child(4)::before {
    background: var(--warning);
}

.stats-grid article:nth-child(5)::before {
    background: var(--accent);
}

.stats-grid strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1;
}

.stats-grid span {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 900;
}

.admin-tabs {
    position: sticky;
    top: 69px;
    z-index: 10;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 18px;
    background: rgba(245, 248, 247, .95);
    backdrop-filter: blur(14px);
}

.admin-tabs a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 9px 12px;
    color: var(--muted);
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(28, 38, 42, .05);
}

.admin-tabs a:hover {
    border-color: var(--accent-2);
    color: var(--accent-2-dark);
}

.admin-grid {
    margin-bottom: 24px;
}

.toggle-grid.wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-section {
    margin-bottom: 24px;
}

.table-section > h2 {
    margin-top: 6px;
}

.guest-list,
.stack-list,
.photo-admin-grid {
    display: grid;
    gap: 14px;
}

.guest-card {
    padding: 18px;
}

.guest-card-head,
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.guest-card-head {
    margin-bottom: 14px;
}

.guest-card-head strong {
    font-size: 1.05rem;
}

.guest-card-head span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 900;
}

.status {
    border-radius: 999px;
    background: #eef1f2;
    color: var(--muted);
    padding: 5px 10px;
    font-size: .8rem;
    font-weight: 900;
}

.status.yes {
    background: #e3f4ee;
    color: #245a4d;
}

.status.no {
    background: #f8e8e8;
    color: #873030;
}

.list-row {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.list-row span {
    color: var(--muted);
}

.list-row strong {
    color: var(--accent-2-dark);
}

.photo-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-admin-card {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.photo-admin-card img,
.photo-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: var(--soft-blue);
    object-fit: cover;
}

.photo-admin-card span {
    color: var(--muted);
    font-weight: 800;
}

.wedding-page {
    --wedding-accent: var(--accent);
    min-height: calc(100vh - 82px);
    background:
        linear-gradient(180deg, rgba(251, 252, 251, .88), rgba(251, 252, 251, 1)),
        url('/myweddingbuddy.png') center 20px / min(340px, 58vw) no-repeat;
    padding-bottom: 72px;
}

.access-hero {
    display: grid;
    justify-items: center;
}

.access-form {
    width: min(430px, 100%);
    margin-top: 22px;
    padding: 22px;
}

.theme-garden {
    --wedding-accent: var(--accent-2);
}

.theme-modern {
    --wedding-accent: #3d5276;
}

.wedding-hero {
    text-align: center;
    padding: clamp(76px, 12vw, 118px) 0 48px;
}

.wedding-hero h1 {
    margin-left: auto;
    margin-right: auto;
}

.wedding-page h2 {
    color: var(--wedding-accent);
}

.wedding-page > section:not(.wedding-hero) {
    border-top: 1px solid var(--line);
    padding: 28px 0;
}

.rsvp-section {
    margin-top: 22px !important;
    padding: 24px !important;
}

.not-found {
    padding: 72px 0;
}

.guest-dashboard {
    background:
        linear-gradient(180deg, #eef5f1 0, #fbfcfb 52%, #f6f1f3 100%);
}

.guest-head {
    margin-bottom: 24px;
}

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

.guest-panel {
    padding: 22px;
}

.guest-panel h2 {
    color: var(--accent-2-dark);
}

.wide-panel {
    grid-column: 1 / -1;
}

.timeline-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 14px;
    border-top: 1px solid var(--line);
    padding: 12px 0;
}

.timeline-row strong {
    color: var(--accent-2-dark);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.photo-grid figure {
    margin: 0;
}

.photo-grid figcaption {
    margin-top: 6px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 800;
}

@media (max-width: 980px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-tabs {
        top: 65px;
    }
}

@media (max-width: 820px) {
    :root {
        --container: min(100% - 28px, 1180px);
    }

    .site-header,
    .site-footer,
    .dashboard-head,
    .guest-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .feature-band,
    .editor-grid,
    .admin-grid,
    .two-col,
    .three-col,
    .guest-grid,
    .stats-grid,
    .photo-grid,
    .photo-admin-grid,
    .toggle-grid.wide {
        grid-template-columns: 1fr;
    }

    .guest-card-head,
    .list-row {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        width: 100%;
        justify-content: space-between;
    }

    .admin-tabs {
        top: 116px;
    }
}

@media (max-width: 520px) {
    .site-header,
    .site-footer {
        padding-inline: 14px;
    }

    nav {
        gap: 4px;
    }

    nav a {
        padding-inline: 8px;
        font-size: .9rem;
    }

    .mini-grid,
    .toggle-grid {
        grid-template-columns: 1fr;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .button,
    button {
        width: 100%;
    }
}
