:root {
    --shell-ink: #112028;
    --shell-muted: #5f6f79;
    --shell-paper: #f4efe6;
    --shell-panel: rgba(255, 255, 255, 0.92);
    --shell-accent: #d7622d;
    --shell-accent-soft: rgba(215, 98, 45, 0.16);
    --shell-night: #13343f;
    --shell-night-2: #235565;
    --shell-border: rgba(17, 32, 40, 0.08);
    --shell-shadow: 0 24px 70px rgba(17, 32, 40, 0.14);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 212, 179, 0.65), transparent 32%),
        radial-gradient(circle at top right, rgba(110, 180, 192, 0.24), transparent 26%),
        linear-gradient(180deg, #f7f4ed 0%, #efe7dc 100%);
    color: var(--shell-ink);
}

.shell-nav {
    background: linear-gradient(135deg, rgba(19, 52, 63, 0.96), rgba(35, 85, 101, 0.92));
    backdrop-filter: blur(14px);
}

.shell-nav-toggler {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.shell-nav-toggler:hover,
.shell-nav-toggler:focus {
    background: rgba(255, 255, 255, 0.14);
}

.shell-nav-toggler:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.32);
    outline-offset: 2px;
}

.shell-nav-toggler-label {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.06em;
}

.hero-shell {
    background:
        radial-gradient(circle at top right, rgba(255, 188, 145, 0.35), transparent 28%),
        linear-gradient(135deg, var(--shell-night), var(--shell-night-2));
    position: relative;
    overflow: hidden;
}

body.public-theme .hero-shell::before {
    content: '';
    position: absolute;
    top: -1.25rem;
    right: min(28vw, 23rem);
    width: min(24rem, 34vw);
    aspect-ratio: 1 / 1;
    background: url('../img/hero-church-calendar-mark.svg') center center / contain no-repeat;
    opacity: 0.16;
    pointer-events: none;
}

.hero-shell::after {
    content: '';
    position: absolute;
    inset: auto -6rem -6rem auto;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-shell-admin {
    background:
        radial-gradient(circle at bottom left, rgba(255, 188, 145, 0.24), transparent 30%),
        linear-gradient(135deg, #102b34, #294955);
}

.hero-shell .container {
    position: relative;
    z-index: 1;
}

.hero-title-block {
    max-width: 42rem;
}

.hero-title-main {
    font-size: clamp(2.2rem, 5vw, 4.3rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-title-sub {
    font-size: clamp(1rem, 2vw, 1.35rem);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-title-tags {
    display: inline-block;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow,
.calendar-label,
.stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
}

.calendar-label,
.stat-label {
    color: var(--shell-muted);
}

.stat-card,
.calendar-card,
.sidebar-card,
.auth-card,
.panel-card {
    background: var(--shell-panel);
    border: 1px solid var(--shell-border);
    border-radius: 1.75rem;
    box-shadow: var(--shell-shadow);
}

.stat-card {
    padding: 1.75rem;
    color: white;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
}

.stat-value {
    font-size: clamp(2.6rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1;
}

.stat-caption {
    color: rgba(255, 255, 255, 0.74);
}

.stat-card .stat-label {
    color: rgba(255, 244, 230, 0.92);
}

.calendar-card,
.sidebar-card,
.auth-card,
.panel-card {
    padding: 1.5rem;
}

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

.calendar-nav-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
    align-items: center;
}

.calendar-nav-controls .btn {
    white-space: nowrap;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.weekday-cell {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--shell-muted);
    padding-bottom: 0.35rem;
}

.days {
    gap: 0.55rem;
}

.day-cell {
    min-height: 10.5rem;
    min-width: 0;
    overflow: hidden;
    padding: 0.85rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(17, 32, 40, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.day-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(17, 32, 40, 0.08);
}

.day-cell-muted {
    opacity: 0.45;
}

.day-cell-today {
    border-color: rgba(215, 98, 45, 0.55);
    background: linear-gradient(180deg, rgba(255, 243, 235, 0.98), rgba(255, 255, 255, 0.92));
}

.day-number-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.day-number {
    font-weight: 700;
}

.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.event-pill {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 0.9rem;
    font-size: 0.77rem;
    line-height: 1.35;
    background: rgba(19, 52, 63, 0.08);
    color: var(--shell-ink);
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.event-list li,
.event-pill span,
.event-pill strong {
    min-width: 0;
}

.event-pill-button {
    border: 0;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.event-pill-button:hover,
.event-pill-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(17, 32, 40, 0.08);
    background: rgba(19, 52, 63, 0.13);
}

.event-pill-button:focus-visible,
.upcoming-item-button:focus-visible {
    outline: 2px solid rgba(215, 98, 45, 0.55);
    outline-offset: 2px;
}

.event-pill strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.84rem;
}

.event-pill-congregation {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--shell-muted);
}

.event-pill-time {
    display: block;
    margin-top: 0.18rem;
}

.event-pill-featured {
    background: var(--shell-accent-soft);
}

.empty-day {
    margin-top: auto;
    font-size: 0.8rem;
    color: #93a0a7;
}

.upcoming-stack {
    display: grid;
    gap: 1rem;
}

.upcoming-stack.compact {
    gap: 0.85rem;
}

.upcoming-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 1rem;
    align-items: start;
    padding: 0.9rem;
    border-radius: 1.1rem;
    background: rgba(17, 32, 40, 0.03);
}

.upcoming-item-no-image {
    grid-template-columns: 1fr;
}

.upcoming-item-button {
    width: 100%;
    border: 0;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.upcoming-item-button:hover,
.upcoming-item-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(17, 32, 40, 0.08);
    background: rgba(17, 32, 40, 0.06);
}

.upcoming-thumb {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.archive-month-stack {
    display: grid;
    gap: 1.5rem;
}

.archive-month-header {
    margin-bottom: 1.1rem;
}

.archive-event-link {
    text-decoration: none;
    color: inherit;
}

.auth-shell {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.auth-card {
    padding: 2rem;
}

.admin-login-note {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(17, 32, 40, 0.04);
    border: 1px solid rgba(17, 32, 40, 0.08);
    color: var(--shell-ink);
}

.admin-login-note-title {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--shell-muted);
    margin-bottom: 0.45rem;
}

.panel-card {
    height: 100%;
}

.event-modal-content {
    border: 0;
    border-radius: 1.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 245, 238, 0.98));
}

.event-modal-image-wrap {
    margin-bottom: 1.25rem;
}

.event-modal-invitation-link-wrap {
    margin-bottom: 1.25rem;
}

.event-modal-image {
    width: 100%;
    max-height: 22rem;
    object-fit: contain;
    background: rgba(17, 32, 40, 0.04);
    border-radius: 1.25rem;
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.invitation-file-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(17, 32, 40, 0.06);
    border: 1px solid rgba(17, 32, 40, 0.12);
    color: var(--shell-ink);
    font-weight: 700;
    text-decoration: none;
}

.invitation-file-link:hover,
.invitation-file-link:focus-visible {
    background: rgba(17, 32, 40, 0.1);
    color: var(--shell-ink);
}

.event-modal-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.event-modal-meta-label {
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--shell-muted);
    font-weight: 700;
}

.event-modal-meta-value,
.event-modal-description {
    color: var(--shell-ink);
}

.event-modal-description,
.event-modal-schedule-lines {
    white-space: pre-line;
}

.event-modal-schedule-lines {
    color: var(--shell-ink);
}

.event-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.event-detail-image-wrap {
    border-radius: 1.35rem;
    overflow: hidden;
    background: rgba(17, 32, 40, 0.04);
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.event-detail-image {
    width: 100%;
    max-height: 36rem;
    object-fit: contain;
    display: block;
}

.share-link-panel {
    display: grid;
    gap: 0.85rem;
}

.custom-schedule-builder {
    display: grid;
    gap: 0.9rem;
}

.custom-schedule-row {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(17, 32, 40, 0.04);
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.custom-schedule-date {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--shell-ink);
}

.custom-schedule-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-datepicker {
    position: relative;
}

.admin-datepicker .form-control {
    padding-right: 2.75rem;
    cursor: pointer;
}

.admin-datepicker .datepicker-toggle-button {
    color: var(--shell-muted);
}

.admin-datepicker .datepicker-toggle-button:hover,
.admin-datepicker .datepicker-toggle-button:focus {
    color: var(--shell-ink);
}

.admin-datepicker .datepicker-toggle-button::before {
    content: '\1F4C5';
    font-size: 1rem;
    line-height: 1;
}

.admin-datepicker .datepicker-toggle-icon {
    display: none;
}

.datepicker-dropdown-container,
.datepicker-modal-container {
    transform-origin: top center;
}

.datepicker-dropdown-container {
    transform: scale(1.08);
}

.datepicker-modal-container {
    transform: scale(1.04);
}

.admin-tabs-shell {
    display: grid;
    gap: 1.25rem;
}

.admin-access-actions:first-child,
.admin-tabs-shell:first-child {
    margin-top: 4.75rem;
}

.admin-success-banner {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(35, 120, 74, 0.18);
    background: linear-gradient(135deg, rgba(233, 251, 240, 0.98), rgba(215, 244, 224, 0.98));
    box-shadow: 0 20px 40px rgba(35, 120, 74, 0.12);
    scroll-margin-top: 8rem;
}

.admin-success-banner:focus {
    outline: 2px solid rgba(35, 120, 74, 0.28);
    outline-offset: 2px;
}

.admin-success-banner-label {
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #2c6d49;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.admin-success-banner-message {
    font-size: 1rem;
    font-weight: 700;
    color: #173b27;
}

.admin-tab-nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 32, 40, 0.08);
    box-shadow: 0 14px 30px rgba(17, 32, 40, 0.08);
    backdrop-filter: blur(10px);
}

.admin-tab-button {
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.25rem;
    background: transparent;
    color: var(--shell-muted);
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-tab-button:hover,
.admin-tab-button:focus-visible {
    color: var(--shell-ink);
    background: rgba(19, 52, 63, 0.06);
}

.admin-tab-button:focus-visible {
    outline: 2px solid rgba(215, 98, 45, 0.45);
    outline-offset: 2px;
}

.admin-tab-button.is-active {
    color: white;
    background: linear-gradient(135deg, var(--shell-night), var(--shell-night-2));
    box-shadow: 0 10px 24px rgba(17, 32, 40, 0.18);
}

.admin-tab-pane[hidden] {
    display: none !important;
}

.draft-summary-list {
    display: grid;
    gap: 0.9rem;
}

.draft-summary-item {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(17, 32, 40, 0.04);
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.draft-summary-label {
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--shell-muted);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.draft-summary-value {
    color: var(--shell-ink);
}

.draft-image-preview {
    margin-top: 1rem;
    padding: 0.95rem;
    border-radius: 1rem;
    background: rgba(17, 32, 40, 0.04);
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.draft-image-preview-img {
    width: 100%;
    max-height: 18rem;
    object-fit: contain;
    border-radius: 0.9rem;
    background: rgba(17, 32, 40, 0.04);
}

.existing-image-card {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(17, 32, 40, 0.04);
    border: 1px solid rgba(17, 32, 40, 0.08);
}

.existing-image-preview {
    width: 100%;
    max-height: 16rem;
    object-fit: contain;
    border-radius: 1rem;
    background: rgba(17, 32, 40, 0.04);
}

.form-helper {
    font-size: 0.82rem;
    color: var(--shell-muted);
    margin-top: 0.35rem;
}

.admin-access-main {
    padding-bottom: 7rem !important;
}

.admin-access-page .panel-card {
    height: auto;
}

code {
    color: #8a3f18;
}

footer {
    margin-top: 3rem;
}

@media (max-width: 991.98px) {
    body.public-theme .hero-shell::before {
        width: min(18rem, 34vw);
        top: -0.1rem;
        right: 12rem;
        opacity: 0.14;
    }

    .day-cell {
        min-height: 8.75rem;
    }
}

@media (max-width: 767.98px) {
    body.public-theme .hero-shell::before {
        top: 0.9rem;
        right: -1.35rem;
        width: 14rem;
        opacity: 0.1;
    }

    .calendar-card,
    .sidebar-card,
    .auth-card,
    .panel-card {
        border-radius: 1.25rem;
        padding: 1.15rem;
    }

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

    .calendar-nav-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .calendar-grid.days {
        gap: 0.4rem;
    }

    .day-cell {
        min-height: 7.6rem;
        padding: 0.65rem;
        border-radius: 0.95rem;
        overflow: hidden;
    }

    .event-pill {
        padding: 0.38rem 0.42rem;
        font-size: 0.66rem;
        line-height: 1.2;
        overflow: hidden;
    }

    .event-list {
        gap: 0.3rem;
    }

    .event-pill span,
    .event-pill strong,
    .empty-day {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .event-pill strong {
        margin-top: 0.1rem;
        font-size: 0.72rem;
    }

    .empty-day {
        font-size: 0.68rem;
    }

    .upcoming-item {
        grid-template-columns: 72px 1fr;
        gap: 0.8rem;
    }

    .upcoming-item-no-image {
        grid-template-columns: 1fr;
    }

    .upcoming-thumb {
        width: 72px;
        height: 72px;
    }

    .event-modal-meta {
        grid-template-columns: 1fr;
    }

    .event-modal-actions {
        flex-direction: column;
    }

    .custom-schedule-inputs {
        grid-template-columns: 1fr;
    }

    .admin-tab-nav {
        width: 100%;
        border-radius: 1.25rem;
    }

    .admin-tab-button {
        flex: 1 1 100%;
        text-align: center;
    }
}
