:root {
    --bg: #f2e8dc;
    --panel: rgba(255, 251, 245, 0.9);
    --panel-strong: #fffdf9;
    --text: #2b251f;
    --muted: #726659;
    --line: rgba(43, 37, 31, 0.12);
    --accent: #7f3f2f;
    --accent-dark: #5f3023;
    --danger: #8f2222;
    --shadow: 0 20px 60px rgba(76, 59, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    background:
        radial-gradient(circle at top left, rgba(181, 145, 108, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(127, 63, 47, 0.08), transparent 24%),
        linear-gradient(180deg, #fbf4ea 0%, #efe2d2 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img,
video {
    max-width: 100%;
    display: block;
}

input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.center-panel,
.panel,
.stat-card,
.empty-card,
.table-card,
.media-card {
    background: var(--panel);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.center-panel {
    width: min(720px, 100%);
    margin: 8vh auto 0;
    padding: 2.25rem;
}

.center-panel.narrow {
    width: min(520px, 100%);
}

.eyebrow {
    margin: 0 0 0.7rem;
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

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

h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 0.95;
    margin-bottom: 1rem;
}

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

.small {
    font-size: 0.9rem;
}

.stack-form,
.upload-card,
.quick-form,
.filter-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.upload-card {
    padding: 1.5rem;
    border-radius: 22px;
    border: 1px dashed var(--line);
    background: rgba(255, 255, 255, 0.65);
}

.quick-form {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
    margin-bottom: 1.25rem;
}

.filter-form {
    grid-template-columns: 1.1fr 0.9fr 1.6fr auto;
    align-items: end;
    margin-bottom: 1.25rem;
}

.filter-form-compact {
    grid-template-columns: 1fr 1.6fr auto;
}

.button,
.ghost-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    padding: 0.85rem 1.4rem;
    font-size: 0.95rem;
}

.button {
    background: var(--accent);
    color: #fff;
}

.button-small {
    padding: 0.7rem 1.1rem;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
}

.danger-button {
    background: #fff2f2;
    color: var(--danger);
    border: 1px solid rgba(143, 34, 34, 0.15);
}

.dashboard-header,
.panel-title,
.header-actions,
.table-actions,
.media-actions {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.event-switcher,
.stats-grid,
.table-grid,
.media-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.event-switcher {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.event-pill {
    padding: 1rem 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--line);
    text-align: center;
}

.event-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card,
.table-card,
.media-card,
.empty-card,
.panel {
    padding: 1.4rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    margin: 0.4rem 0;
}

.stat-card small {
    display: block;
}

.table-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.media-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.media-preview {
    overflow: hidden;
    border-radius: 18px;
    background: #ece4d6;
    aspect-ratio: 1 / 1;
    margin-bottom: 1rem;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-meta {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.messages {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.message {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.message.success {
    border-color: rgba(64, 130, 61, 0.2);
}

.message.error {
    border-color: rgba(143, 34, 34, 0.2);
}

.break {
    word-break: break-all;
}

.upload-mobile-shell {
    min-height: calc(100vh - 2rem);
    display: grid;
    align-content: start;
    gap: 1.1rem;
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 0.5rem 0 2rem;
}

.wedding-landing-shell {
    width: min(100%, 560px);
    margin: 0 auto;
    display: grid;
    gap: 1.1rem;
}

.wedding-hero-card {
    position: relative;
    overflow: hidden;
    padding: 0.85rem 0.2rem 0.2rem;
    display: grid;
    gap: 0.55rem;
    text-align: center;
}

.wedding-hero-card h1 {
    font-size: clamp(2.8rem, 12vw, 5rem);
    line-height: 0.88;
    letter-spacing: -0.045em;
    margin-bottom: 0;
    display: grid;
    justify-items: center;
}

.hero-title-part {
    display: block;
}

.hero-title-part.ampersand {
    line-height: 0.65;
    transform: translateY(0.12em);
}

.wedding-date {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    font-style: italic;
    color: #6f6256;
    margin-bottom: 0.35rem;
}

.wedding-photo-frame {
    position: relative;
    border-radius: 34px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: linear-gradient(180deg, #ede1d2 0%, #d7c0ac 100%);
    box-shadow: 0 28px 80px rgba(76, 59, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.wedding-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
    filter: saturate(0.88) contrast(0.98) brightness(1.02);
    transform-origin: center;
    animation: slow-breath 10.5s ease-in-out infinite;
}

.wedding-photo-fallback {
    display: grid;
    place-items: center;
    color: rgba(29, 27, 24, 0.68);
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.45), transparent 35%),
        linear-gradient(180deg, #f1e4d5 0%, #dcbda3 100%);
}

.wedding-photo-glow {
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(180deg, transparent 0%, rgba(29, 27, 24, 0.18) 100%);
    pointer-events: none;
}

.wedding-upload-card {
    margin-top: 0.3rem;
    background: rgba(255, 250, 244, 0.88);
}

.upload-mobile-copy {
    display: grid;
    gap: 0.45rem;
}

.upload-mobile-copy h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.upload-mobile-header {
    padding: 1rem 0.2rem 0;
}

.upload-mobile-header h1 {
    font-size: clamp(2.3rem, 9vw, 4.2rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.upload-mobile-card {
    background: rgba(255, 253, 249, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 32px;
    box-shadow: 0 30px 70px rgba(76, 59, 42, 0.16);
    padding: 1.2rem;
    display: grid;
    gap: 1rem;
}

.upload-dropzone {
    position: relative;
    min-height: 320px;
    border-radius: 28px;
    padding: 1.5rem;
    border: 1.5px dashed rgba(127, 63, 47, 0.26);
    background:
        radial-gradient(circle at top, rgba(127, 63, 47, 0.1), transparent 36%),
        linear-gradient(180deg, #fffaf4 0%, #f5e7d7 100%);
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    gap: 0.8rem;
}

.upload-dropzone-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: #fff;
    background: linear-gradient(180deg, #b88f72 0%, #8a4a38 100%);
    box-shadow: 0 18px 40px rgba(127, 63, 47, 0.28);
}

.upload-hidden-input {
    display: none;
}

.upload-hidden-input input {
    display: none;
}

.upload-mobile-actions {
    display: grid;
    gap: 0.75rem;
}

.upload-large-button {
    min-height: 58px;
    font-size: 1rem;
}

.upload-progress-card {
    padding: 1rem;
    border-radius: 24px;
    background: #f7efe4;
    border: 1px solid rgba(29, 27, 24, 0.08);
    display: grid;
    gap: 0.8rem;
}

.upload-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.upload-progress-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(29, 27, 24, 0.08);
    overflow: hidden;
}

.upload-progress-bar-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b88f72 0%, #8a4a38 100%);
    transition: width 0.2s ease;
}

.upload-result {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    font-size: 0.95rem;
}

.upload-result.is-success {
    background: #edf8ef;
    border: 1px solid rgba(64, 130, 61, 0.18);
}

.upload-result.is-error {
    background: #fff1f1;
    border: 1px solid rgba(143, 34, 34, 0.15);
}

.thanks-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.thanks-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(29, 27, 24, 0.48);
    backdrop-filter: blur(10px);
}

.thanks-modal-card {
    position: relative;
    width: min(calc(100% - 1.5rem), 420px);
    margin: min(18vh, 120px) auto 0;
    background: #fff9f1;
    border-radius: 28px;
    padding: 1.4rem 1.2rem 1.2rem;
    box-shadow: 0 28px 90px rgba(29, 27, 24, 0.24);
    display: grid;
    gap: 0.8rem;
    text-align: center;
}

.thanks-modal-card h2 {
    font-size: 2rem;
    line-height: 0.95;
    margin-bottom: 0;
}

.thanks-modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.9rem;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(29, 27, 24, 0.07);
    font-size: 1.5rem;
    cursor: pointer;
}

.is-hidden {
    display: none;
}

@keyframes slow-breath {
    0% {
        transform: scale(1.04);
        filter: saturate(0.88) contrast(0.98) brightness(1.02) blur(0px);
    }
    50% {
        transform: scale(1.11);
        filter: saturate(0.9) contrast(0.98) brightness(1.03) blur(0.45px);
    }
    100% {
        transform: scale(1.04);
        filter: saturate(0.88) contrast(0.98) brightness(1.02) blur(0px);
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 1rem, 100%);
        padding-top: 0.75rem;
    }

    .center-panel,
    .panel,
    .stat-card,
    .empty-card,
    .table-card,
    .media-card {
        border-radius: 20px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .upload-mobile-shell {
        width: 100%;
    }

    .wedding-landing-shell {
        width: 100%;
    }

    .upload-mobile-card {
        border-radius: 28px;
        padding: 1rem;
    }

    .upload-dropzone {
        min-height: 290px;
    }

    .thanks-modal-card {
        margin-top: 18vh;
    }
}
