html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #efe7d5;
    color: #f8f2e8;
    font-family: "Source Sans 3", "Helvetica Neue", sans-serif;
}

body.auth-pending {
    visibility: hidden;
}

a {
    color: inherit;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 132px 0 72px;
}

.page-home .page-shell {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.background-stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-width: 100vw;
    z-index: 0;
    overflow: hidden;
}

.background-layer,
.background-overlay {
    position: absolute;
    inset: 0;
}

.background-layer {
    background-color: #4f1f17;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1.2s ease, transform 6s ease;
}

.background-layer.is-visible {
    opacity: 1;
    transform: scale(1);
}

.background-overlay {
    background:
        linear-gradient(180deg, rgba(36, 15, 12, 0.25), rgba(36, 15, 12, 0.78)),
        linear-gradient(90deg, rgba(15, 7, 5, 0.6), rgba(15, 7, 5, 0.12));
}

.login-page {
    overflow-x: hidden;
}

.login-preview {
    position: relative;
    z-index: 1;
    width: 100vw;
    min-width: 100vw;
    min-height: 100vh;
    filter: blur(16px);
    transform: scale(1.03);
    pointer-events: none;
}

.login-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(12, 5, 4, 0.2);
}

.preview-shell {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
}

.preview-hero,
.preview-panel {
    max-width: 1040px;
}

.preview-card {
    background: rgba(255, 247, 234, 0.96);
}

.navbar-preview {
    position: fixed;
}

.login-stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-width: 100vw;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-modal {
    width: min(540px, 100%);
    background: rgba(255, 252, 245, 0.78);
    box-shadow: 0 32px 100px rgba(15, 7, 5, 0.34);
    backdrop-filter: blur(16px);
}

.login-title {
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    line-height: 0.98;
    color: #5a3428;
}

.hero {
    max-width: 720px;
    padding: 28px 0 64px;
}

.hero-card {
    max-width: 100%;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    background: rgba(26, 11, 9, 0.34);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
}

.eyebrow {
    margin: 0 0 16px;
    color: #f7c36e;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dark-eyebrow,
.dark {
    color: #5a3428;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    line-height: 0.95;
}

h1 {
    font-size: clamp(3.3rem, 7vw, 6.4rem);
    text-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #5a3428;
}

h3 {
    font-size: 1.5rem;
    color: #5a3428;
}

.lead {
    max-width: 620px;
    margin: 24px 0 0;
    font-size: 1.2rem;
    line-height: 1.65;
}

.build-notice {
    margin: 0 0 18px;
    padding: 16px 20px;
    border: 3px solid #f7c36e;
    background: rgba(0, 0, 0, 0.24);
    color: #f7c36e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.5rem, 5.5vw, 5.4rem);
    font-weight: 700;
    line-height: 0.95;
    text-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.build-notice__icon {
    flex: 0 0 auto;
    font-family: "Source Sans 3", sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.build-notice > span:not(.build-notice__icon) {
    text-align: center;
}

.page-inner {
    color: #2a1913;
    background:
        radial-gradient(circle at top, rgba(183, 40, 39, 0.18), transparent 34%),
        linear-gradient(180deg, #f3ebdc 0%, #e7ddc7 100%);
}

.page-header {
    margin-bottom: 28px;
    padding-top: 24px;
}

.panel {
    padding: 28px;
    border: 1px solid rgba(90, 52, 40, 0.15);
    border-radius: 20px;
    background: rgba(255, 252, 245, 0.92);
    box-shadow: 0 24px 60px rgba(69, 38, 28, 0.12);
}

.intro-panel {
    margin-top: 24px;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
}

.events-table th,
.events-table td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(90, 52, 40, 0.12);
    text-align: left;
}

.events-table th {
    font-size: 0.95rem;
    color: #6d4334;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.events-table tr:last-child td {
    border-bottom: 0;
}

.panel-copy {
    margin: 12px 0 22px;
    color: #5a3428;
    line-height: 1.6;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.tab-button {
    padding: 12px 18px;
    border: 1px solid rgba(90, 52, 40, 0.12);
    border-radius: 999px;
    background: #fff7ea;
    color: #5a3428;
    font: inherit;
    font-weight: 700;
}

.tab-button.active {
    background: linear-gradient(135deg, #bb3227, #d88d2f);
    color: #fff9f1;
    border-color: transparent;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(216, 141, 47, 0.18);
    color: #7b4a1f;
    font-size: 0.85rem;
    font-weight: 700;
}

.type-pill--narren {
    background: rgba(187, 50, 39, 0.12);
    color: #9d2d24;
}

.type-pill--board {
    background: rgba(90, 52, 40, 0.12);
    color: #5a3428;
}

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

.admin-users-panel {
    margin-top: 20px;
}

.admin-user-list {
    display: grid;
    gap: 16px;
}

.admin-card {
    padding: 20px;
    border-radius: 18px;
    background: #fff7ea;
    border: 1px solid rgba(90, 52, 40, 0.12);
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-subline {
    margin: 8px 0 0;
    color: #6d4334;
    font-weight: 600;
}

.admin-group-wrap,
.group-option-list {
    display: grid;
    gap: 10px;
}

.group-fieldset {
    margin: 0;
    padding: 14px 16px 16px;
    border: 1px solid rgba(90, 52, 40, 0.12);
    border-radius: 16px;
}

.group-fieldset legend {
    padding: 0 6px;
    color: #6d4334;
    font-weight: 700;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #5a3428;
    font-weight: 600;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.admin-badge {
    background: rgba(90, 52, 40, 0.9);
}

.status-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(45, 107, 60, 0.12);
    color: #2d6b3c;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-chip--warn {
    background: rgba(216, 141, 47, 0.18);
    color: #8c5c16;
}

.login-message.is-error {
    color: #bb3227;
}

.login-message.is-success {
    color: #2d6b3c;
}

.login-form {
    display: grid;
    gap: 18px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.password-change-box {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(90, 52, 40, 0.12);
}

.login-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: #5a3428;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(90, 52, 40, 0.2);
    border-radius: 12px;
    font: inherit;
    background: #fffdf9;
}

input:focus {
    outline: 2px solid rgba(187, 50, 39, 0.25);
    border-color: #bb3227;
}

button,
.button-link {
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #bb3227, #d88d2f);
    color: #fff7ef;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.secondary-button {
    background: #5a3428;
}

.login-message {
    min-height: 1.4em;
    margin: 0;
    font-weight: 600;
    color: #bb3227;
}

.is-hidden {
    display: none;
}

.member-panel {
    margin-top: 20px;
}

.info-panel {
    margin-top: 20px;
}

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

.member-header--hero {
    align-items: flex-start;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.badge {
    margin: 0;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff9f1;
    font-weight: 700;
}

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

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

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

.quick-link {
    display: block;
    padding: 22px;
    border-radius: 18px;
    background: #fff7ea;
    border: 1px solid rgba(90, 52, 40, 0.12);
    text-decoration: none;
    color: #2a1913;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(69, 38, 28, 0.12);
}

.quick-link h3 {
    margin-top: 8px;
}

.quick-link p:last-child {
    margin: 12px 0 0;
    line-height: 1.6;
}

.small-footer-link {
    margin: 20px 0 0;
    text-align: right;
}

.footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.small-footer-link--center {
    text-align: center;
}

.small-footer-link a {
    color: #6d4334;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(109, 67, 52, 0.25);
}

.small-footer-link a:hover {
    color: #bb3227;
    border-bottom-color: rgba(187, 50, 39, 0.45);
}

.small-footer-link a[aria-current="page"] {
    color: #6d4334;
    border-bottom-color: transparent;
    cursor: default;
}

.security-note {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 247, 234, 0.78);
    border: 1px solid rgba(90, 52, 40, 0.12);
    color: #5a3428;
    line-height: 1.6;
}

.link-kicker {
    margin: 0;
    color: #bb3227;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.member-card {
    padding: 20px;
    border-radius: 18px;
    background: #fff7ea;
    border: 1px solid rgba(90, 52, 40, 0.12);
}

.member-card p {
    margin: 12px 0 0;
    line-height: 1.6;
}

.navbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(22, 11, 9, 0.92), rgba(22, 11, 9, 0.58) 60%, rgba(22, 11, 9, 0)),
        transparent;
    backdrop-filter: blur(10px);
}

.page-inner .navbar {
    background:
        linear-gradient(180deg, rgba(243, 235, 220, 0.96), rgba(243, 235, 220, 0.82) 60%, rgba(243, 235, 220, 0)),
        transparent;
}

.navbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff9f1;
    text-decoration: none;
    font-weight: 700;
}

.nav-logout {
    min-width: 180px;
    padding: 14px 18px;
}

.page-inner .navbar a {
    border-color: rgba(90, 52, 40, 0.15);
    background: rgba(255, 250, 242, 0.9);
    color: #5a3428;
}

.navbar a.active {
    background: linear-gradient(135deg, #bb3227, #d88d2f);
    border-color: transparent;
    color: #fff9f1;
}

.folder-grid {
    display: grid;
    gap: 18px;
}

.folder-card {
    border: 1px solid rgba(90, 52, 40, 0.12);
    border-radius: 18px;
    background: #fff7ea;
    overflow: hidden;
}

.folder-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    cursor: pointer;
    list-style: none;
}

.folder-card summary::-webkit-details-marker {
    display: none;
}

.folder-card[open] summary {
    border-bottom: 1px solid rgba(90, 52, 40, 0.12);
}

.folder-card .panel-copy {
    margin: 0;
    padding: 18px 20px 0;
}

.folder-meta {
    white-space: nowrap;
    color: #6d4334;
    font-weight: 700;
}

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

.thumb-card {
    margin: 0;
    min-height: 140px;
    padding: 16px;
    display: flex;
    align-items: flex-end;
    border-radius: 16px;
    color: #fffdf8;
    font-weight: 700;
    background: linear-gradient(135deg, #824126, #d88d2f);
}

.thumb-card span {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 7, 5, 0.36);
}

.thumb-card--gold {
    background: linear-gradient(135deg, #b45b12, #d8a83a);
}

.thumb-card--ember {
    background: linear-gradient(135deg, #7d1f1f, #ca5f39);
}

.thumb-card--forest {
    background: linear-gradient(135deg, #35553d, #6f9258);
}

.thumb-card--berry {
    background: linear-gradient(135deg, #6f244b, #bf4d67);
}

.placeholder-note {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(187, 50, 39, 0.08);
    color: #6d4334;
    font-weight: 600;
}

.meta-list {
    display: grid;
    gap: 16px;
    margin: 0;
}

.meta-list div {
    padding: 18px;
    border: 1px solid rgba(90, 52, 40, 0.12);
    border-radius: 16px;
    background: #fff7ea;
}

.meta-list dt {
    margin-bottom: 8px;
    color: #6d4334;
    font-weight: 700;
}

.meta-list dd {
    margin: 0;
    color: #2a1913;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .events-table {
        display: block;
        overflow-x: auto;
    }

    .member-grid {
        grid-template-columns: 1fr;
    }

    .quick-grid,
    .area-grid,
    .thumb-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .small-footer-link {
        text-align: left;
    }

    .footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 28px, 1000px);
        padding: 126px 0 48px;
    }

    .hero {
        padding-bottom: 24px;
    }

    h1 {
        font-size: clamp(2.8rem, 12vw, 4.2rem);
    }

    .lead {
        font-size: 1.05rem;
    }

    .panel {
        padding: 22px;
        border-radius: 18px;
    }

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

    .navbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px;
    }

    .navbar a {
        min-width: 0;
        flex: 1 1 calc(50% - 10px);
        padding: 12px 14px;
    }

    .hero-card {
        padding: 24px;
    }

    .login-stage {
        align-items: flex-end;
        padding: 18px;
    }

    .login-modal {
        padding: 22px;
    }

    .login-preview {
        filter: blur(12px);
    }

    .page-actions {
        justify-content: flex-start;
    }

    .badge,
    button,
    .button-link {
        width: 100%;
    }

    .events-table,
    .events-table tbody,
    .events-table tr,
    .events-table td {
        display: block;
        width: 100%;
    }

    .events-table thead {
        display: none;
    }

    .events-table tr {
        margin-bottom: 14px;
        padding: 16px;
        border-radius: 16px;
        background: #fff7ea;
        border: 1px solid rgba(90, 52, 40, 0.12);
    }

    .events-table td {
        padding: 8px 0;
        border: 0;
    }

    .events-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: #6d4334;
        font-size: 0.82rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .folder-card summary {
        align-items: flex-start;
        flex-direction: column;
    }
}
