.schedule-page {
    margin: 30px auto;
    max-width: 1200px;
    padding: 20px;
}

.schedule-page--list {
    max-width: 1000px;
}

.schedule-hero {
    margin-bottom: 24px;
    text-align: center;
}

.schedule-hero p {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0;
}

.schedule-view-toggle {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 210px));
    justify-content: center;
    margin-bottom: 24px;
}

.schedule-view-button,
.schedule-day-button {
    align-items: center;
    background: #222;
    border: 1px solid #444;
    border-radius: 999px;
    color: #aaa;
    cursor: pointer;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    line-height: 1.2;
    min-height: 44px;
    padding: 10px 20px;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}

.schedule-view-button:hover,
.schedule-day-button:hover {
    background: #333;
    color: #fff;
}

.schedule-view-button.active,
.schedule-day-button.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(230, 57, 70, .4);
    color: #fff;
    pointer-events: none;
}

.schedule-calendar-day-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.schedule-day-picker {
    display: none;
}

.schedule-calendar-hint {
    display: none;
}

.schedule-category-filter {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 10px;
    margin: 0 0 20px;
    overflow: clip;
}

.schedule-category-filter summary {
    align-items: center;
    color: #ddd;
    cursor: pointer;
    display: flex;
    font-weight: 800;
    gap: 9px;
    list-style: none;
    min-height: 48px;
    padding: 11px 14px;
}

.schedule-category-filter summary::-webkit-details-marker {
    display: none;
}

.schedule-category-filter summary:hover {
    background: rgba(255, 255, 255, .035);
}

.schedule-category-filter__status {
    color: #aaa;
    font-size: .8rem;
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
}

.schedule-category-filter__chevron {
    color: #999;
    font-size: .8rem;
    transition: transform .2s;
}

.schedule-category-filter[open] .schedule-category-filter__chevron {
    transform: rotate(180deg);
}

.schedule-category-filter__body {
    border-top: 1px solid #3b3b3b;
    padding: 14px 16px 15px;
}

.schedule-category-filter__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-category-filter label {
    align-items: center;
    background: #292929;
    border: 1px solid #555;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    line-height: 1.25;
    min-width: 0;
    padding: 7px 11px;
}

.schedule-category-filter label:hover {
    background: #333;
    border-color: #777;
}

.schedule-category-filter input {
    accent-color: var(--primary);
    flex: 0 0 auto;
    height: 18px;
    margin: 0;
    width: 18px;
}

.schedule-category-filter__footer {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 12px;
}

.schedule-category-filter small {
    color: #999;
    line-height: 1.35;
}

.schedule-category-filter__clear {
    background: transparent;
    border: 0;
    color: #ccc;
    cursor: pointer;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.schedule-category-filter__clear:hover {
    color: #fff;
}

.schedule-category-filter__clear:disabled {
    cursor: default;
    opacity: .45;
}

.schedule-calendar-frame {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

html[data-theme="light"] .schedule-view-button,
html[data-theme="light"] .schedule-day-button {
    background: #eef1f4;
    border-color: #b8c1ca;
    box-shadow: none;
    color: #26313b;
}

html[data-theme="light"] .schedule-view-button:hover,
html[data-theme="light"] .schedule-day-button:hover {
    background: #dfe5ea;
    border-color: #89949f;
    color: #11151a;
}

html[data-theme="light"] .schedule-view-button.active,
html[data-theme="light"] .schedule-day-button.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(230, 57, 70, .25);
    color: #fff;
}

html[data-theme="light"] .schedule-category-filter {
    background: #fff;
    border-color: #cbd2d9;
    color: #26313b;
}

html[data-theme="light"] .schedule-category-filter summary {
    color: #26313b;
}

html[data-theme="light"] .schedule-category-filter summary:hover {
    background: #f7f8fa;
}

html[data-theme="light"] .schedule-category-filter__body {
    border-color: #d7dde3;
}

html[data-theme="light"] .schedule-category-filter label {
    background: #eef1f4;
    border-color: #b8c1ca;
    color: #26313b;
}

html[data-theme="light"] .schedule-category-filter label:hover {
    background: #dfe5ea;
    border-color: #89949f;
}

html[data-theme="light"] .schedule-category-filter__clear {
    color: #46515c;
}

html[data-theme="light"] .schedule-calendar-frame {
    background: #fff;
    border-color: #cbd2d9;
    box-shadow: 0 8px 24px rgba(23, 26, 31, .08);
}

html[data-theme="light"] .schedule-page--list .day-header,
html[data-theme="light"] .schedule-page--list .list-title {
    color: var(--text);
}

html[data-theme="light"] .schedule-page--list .list-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 4px 14px rgba(23, 26, 31, .06);
}

html[data-theme="light"] .schedule-page--list .list-meta,
html[data-theme="light"] .schedule-page--list .list-desc {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .schedule-page {
        margin-bottom: 20px !important;
        margin-top: 16px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 8px !important;
    }

    .schedule-hero {
        margin-bottom: 16px;
    }

    .schedule-hero h1 {
        font-size: clamp(1.65rem, 8vw, 2.15rem);
        margin-bottom: 2px;
    }

    .schedule-hero p {
        font-size: 1rem;
        margin-top: 0;
    }

    .schedule-page .discord-login-prompt {
        font-size: .9rem;
        line-height: 1.4;
        margin-bottom: 16px;
        padding: 10px 12px;
    }

    .schedule-view-toggle {
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 14px;
    }

    .schedule-view-button {
        font-size: .88rem;
        gap: 6px;
        min-width: 0;
        padding: 9px 8px;
    }

    .schedule-calendar-day-buttons {
        display: none;
    }

    .schedule-day-picker {
        align-items: center;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        display: grid;
        gap: 8px;
        grid-template-columns: auto minmax(0, 1fr);
        margin-bottom: 12px;
        padding: 8px 10px;
    }

    .schedule-day-picker label {
        color: var(--text-muted);
        font-size: .84rem;
        font-weight: 800;
        white-space: nowrap;
    }

    .schedule-day-picker select {
        background: var(--surface-muted);
        border: 1px solid var(--border);
        border-radius: 7px;
        color: var(--text);
        font: inherit;
        font-weight: 700;
        min-width: 0;
        padding: 7px 32px 7px 10px;
        width: 100%;
    }

    .schedule-category-filter {
        margin-bottom: 12px;
    }

    .schedule-calendar-hint {
        color: var(--text-subtle);
        display: block;
        font-size: .78rem;
        margin: 0 2px 6px;
        text-align: right;
    }

    .schedule-category-filter summary {
        min-height: 48px;
        padding: 10px 12px;
    }

    .schedule-category-filter__title {
        font-size: .95rem;
    }

    .schedule-category-filter__status {
        font-size: .75rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .schedule-category-filter__body {
        padding: 12px;
    }

    .schedule-category-filter__options {
        display: grid;
        gap: 7px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .schedule-category-filter label {
        border-radius: 8px;
        font-size: .84rem;
        overflow-wrap: anywhere;
        padding: 9px;
        width: 100%;
    }

    .schedule-category-filter__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        margin-top: 10px;
    }

    .schedule-category-filter__clear {
        align-self: stretch;
        background: #292929;
        border: 1px solid #555;
        border-radius: 7px;
        min-height: 42px;
        padding: 8px 10px;
        text-decoration: none;
    }

    html[data-theme="light"] .schedule-category-filter__clear {
        background: #eef1f4;
        border-color: #b8c1ca;
    }

    .schedule-calendar-frame {
        border-radius: 7px;
        padding: 4px;
    }

    .schedule-calendar-frame .fc-header-toolbar {
        gap: 6px;
        margin-bottom: .75em;
    }

    .schedule-calendar-frame .fc-toolbar-title {
        font-size: 1rem !important;
    }

    .schedule-calendar-frame .fc-button {
        min-height: 40px;
        padding: .35em .65em;
    }

    .schedule-page--list .day-header {
        font-size: 1.35rem;
        margin: 26px 0 12px;
        padding-bottom: 7px;
    }

    .schedule-page--list .list-card {
        gap: 8px;
        margin-bottom: 10px;
        padding: 13px 12px;
    }

    .schedule-page--list .list-meta {
        gap: 6px;
    }

    .schedule-page--list .class-category-tags {
        gap: 4px;
    }

    .schedule-page--list .class-category-tag {
        font-size: .7rem;
        padding: 3px 6px;
    }

    .schedule-page--list .discord-subscription-button {
        width: 100%;
    }
}

@media (max-width: 390px) {
    nav {
        padding-left: 12px;
        padding-right: 12px;
    }

    nav .brand > a {
        max-width: calc(100% - 104px);
    }

    .header-controls {
        gap: 6px;
        margin-left: 6px;
    }

    .theme-toggle {
        justify-content: center;
        padding: 5px;
        width: 42px;
    }

    .theme-toggle [data-theme-label] {
        display: none;
    }

    .schedule-view-button {
        font-size: .8rem;
    }

}
