
/* ==========================================================
   STABILE DROPDOWN-BASIS
   Das Modulmenü bleibt als echtes Untermenü am Auswahlfeld
   verankert. Änderungen innerhalb der Tabelle können seine
   Position dadurch nicht beeinflussen.
   ========================================================== */
html {
    scrollbar-gutter: stable;
}

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

.stundenplan-toolbar {
    position: relative;
}

.modul-select,
.ansichten-select {
    position: relative;
    flex: 0 0 auto;
}

/* ==========================================================
   NEUES SEMESTER – SAUBERE STUNDENPLAN-ANSICHT
   ========================================================== */

.semester-page {
    --bg: #222;
    --panel: #2d2d2d;
    --panel-2: #333;
    --grid: rgba(255, 255, 255, 0.13);
    --grid-strong: rgba(255, 255, 255, 0.26);
    --text: #f4f4f4;
    --muted: #b9b9b9;
    --p: #9ecbff;
    --v: #a9e7b8;
    --u: #f4d77d;
    --s: #c9b5f7;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.semester-main {
    width: min(1800px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 60px;
}

.semester-back {
    z-index: 20;
}

.semester-header {
    text-align: center;
    margin: 0 auto 30px;
}

.semester-kicker {
    color: #cfcfcf;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.semester-page h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1.1;
}

/* ==========================================================
   COUNTDOWN
   ========================================================== */

.semester-timer {
    width: min(820px, 100%);
    margin: 0 auto 34px;
    padding: 22px 26px 24px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.timer-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 13px;
}

.countdown-value {
    display: block;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.2;
}

.countdown-value span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1;
}

.countdown-value small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.countdown-value.begonnen {
    display: block;
    font-size: 24px;
}

.timer-date {
    margin-top: 11px;
    color: #d2d2d2;
    font-size: 13px;
    font-weight: 700;
}

/* ==========================================================
   EXCEL-STATUS – NUR EINE KLEINE ZEILE
   ========================================================== */

.excel-status-line {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 32px;
    color: #9fcca9;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.excel-status-line.success {
    color: #a9dfb1;
}

.excel-status-line.warning {
    color: #e5cd86;
}

/* ==========================================================
   WOCHENPLAN
   ========================================================== */

.stundenplan-bereich {
    width: 100%;
    margin: 0 auto;
}

.plan-heading {
    text-align: center;
    margin: 0 0 20px;
}

.plan-heading h2 {
    margin: 0;
    font-size: clamp(23px, 3vw, 31px);
    line-height: 1.2;
}



/* ==========================================================
   MODUL-FILTER – MEHRFACH AUSWAHL (MAX. 6)
   ========================================================== */

.modul-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px auto 28px;
}

.modul-filter > label {
    color: #d9d9d9;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.modul-select {
    position: relative;
    width: 320px;
}

.modul-filter-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px 9px 14px;
    border: 1px solid #5b5b5b;
    border-radius: 10px;
    background: #2f2f2f;
    color: #f3f3f3;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 2px rgba(0,0,0,0.18);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.modul-filter-button:hover,
.modul-filter-button.offen {
    border-color: #777;
    background: #343434;
}

.modul-filter-button:focus-visible {
    outline: none;
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

.modul-filter-chevron {
    flex: 0 0 auto;
    color: #bdbdbd;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-2px);
    transition: transform 0.15s ease;
}

.modul-filter-button.offen .modul-filter-chevron {
    transform: rotate(180deg) translateY(2px);
}

.modul-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    width: 100%;
    max-height: min(390px, calc(100vh - 150px));
    overflow: hidden;
    border: 1px solid #5b5b5b;
    border-radius: 12px;
    background: #2b2b2b;
    box-shadow: 0 18px 35px rgba(0,0,0,0.35);
}

.modul-filter-options {
    max-height: min(310px, calc(100vh - 205px));
    overflow-y: auto;
    padding: 7px;
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
}

.modul-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #ededed;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    user-select: none;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.modul-option:hover {
    background: rgba(255,255,255,0.06);
}

.modul-option.deaktiviert {
    color: #777;
    cursor: default;
}

.modul-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.modul-check {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1px solid #777;
    border-radius: 5px;
    background: #222;
}

.modul-option input:checked + .modul-check {
    border-color: #9fcca9;
    background: #9fcca9;
}

.modul-option input:checked + .modul-check::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #1e2a20;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.modul-option input:focus-visible + .modul-check {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.07);
}

.modul-option-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modul-option-empty {
    padding: 12px 10px;
    color: #929292;
    font-size: 12px;
    text-align: center;
}

.modul-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px 9px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: #272727;
}

#modul-filter-count {
    color: #9b9b9b;
    font-size: 10px;
    font-weight: 700;
}

.modul-filter-reset {
    border: 0;
    background: transparent;
    color: #cfcfcf;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.modul-filter-reset:hover:not(:disabled) {
    color: #ffffff;
}

.modul-filter-reset:disabled {
    color: #5f5f5f;
    cursor: default;
}

.kurskarte[hidden] {
    display: none !important;
}

/* ==========================================================
   MOBILE TOUCH-ZOOM
   ========================================================== */

.stundenplan-zoom-target {
    position: relative;
    display: block;
    width: 100%;
    transform-origin: top left;
}

/* ==========================================================
   TABELLENRAHMEN
   ========================================================== */

.tabelle-container {
    position: relative;
    overflow: auto;
    max-height: 74vh;
    border: 1px solid var(--grid-strong);
    border-radius: 14px;
    background: #1d1d1d;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
    -webkit-overflow-scrolling: touch;
}

.stundenplan {
    width: 100%;
    min-width: 1390px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    text-align: left;
}

.stundenplan col.zeitspalte {
    width: 150px;
}

.stundenplan th,
.stundenplan td {
    border-right: 1px solid var(--grid);
    border-bottom: 1px solid var(--grid);
}

.stundenplan thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 15px 14px;
    background: #3a3a3a;
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

.stundenplan thead th:first-child {
    width: 150px;
    min-width: 150px;
    left: 0;
    z-index: 10;
    background: #333;
}

.stundenplan tbody th.uhrzeit {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 150px;
    min-width: 150px;
    padding: 14px 12px;
    background: #2a2a2a;
    color: #e0e0e0;
    text-align: center;
    vertical-align: top;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.stundenplan tbody td {
    min-width: 240px;
    height: 112px;
    padding: 8px;
    vertical-align: top;
    background: #303030;
}

.stundenplan tbody tr:nth-child(even) td {
    background: #2d2d2d;
}

.stundenplan tbody tr:hover td,
.stundenplan tbody tr:hover th.uhrzeit {
    background: #393939;
}

.stundenplan tbody tr:last-child td,
.stundenplan tbody tr:last-child th {
    border-bottom: 0;
}

.stundenplan thead th:last-child,
.stundenplan td:last-child {
    border-right: 0;
}

.stundenplan td.leer {
    background: #282828 !important;
}

/* ==========================================================
   KURSKARTEN
   ========================================================== */

.typ-p { color: var(--p); }
.typ-v { color: var(--v); }
.typ-u { color: var(--u); }
.typ-s { color: var(--s); }
.typ-default { color: #d0d0d0; }

.kurskarte {
    margin-bottom: 8px;
    padding: 10px 11px 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid currentColor;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: #ddd;
    transition: background 0.15s ease, transform 0.15s ease;
}

.kurskarte:last-child {
    margin-bottom: 0;
}

.kurskarte:hover {
    background: rgba(255, 255, 255, 0.065);
    transform: translateY(-1px);
}

.kurs-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.kurs-code {
    color: currentColor;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.kurs-typ {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
}

/* Die Farbe wird vom Kurstyp auf den Badge übertragen. */
.kurskarte.typ-p .kurs-typ {
    background: var(--p);
    color: #15202b;
}

.kurskarte.typ-v .kurs-typ {
    background: var(--v);
    color: #152018;
}

.kurskarte.typ-u .kurs-typ {
    background: var(--u);
    color: #302a15;
}

.kurskarte.typ-s .kurs-typ {
    background: var(--s);
    color: #251f33;
}

.kurskarte.typ-default .kurs-typ {
    background: #d0d0d0;
    color: #242424;
}

.kurs-name {
    color: #f0f0f0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.kurs-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 9px;
    margin-top: 7px;
    color: #aaa;
    font-size: 10px;
    font-weight: 700;
}

.kurs-gruppe,
.kurs-raum {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 18px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.055);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1024px) {
    .stundenplan-zoom-target {
        width: max-content;
    }

    .semester-page {
        touch-action: pan-x pan-y pinch-zoom;
    }

    .tabelle-container {
        touch-action: pan-x pan-y;
    }

    .touch-zoom-hinweis {
        display: block;
        margin: -2px 4px 10px;
        color: #8f8f8f;
        font-size: 10px;
        text-align: right;
        letter-spacing: 0.01em;
    }
}

@media (max-width: 900px) {
    .semester-main {
        width: min(100% - 24px, 1800px);
        padding-top: 72px;
    }

    .semester-back {
        top: 17px !important;
        left: 12px !important;
    }

    .tabelle-container {
        max-height: 70vh;
    }
}

@media (max-width: 600px) {
    .semester-main {
        width: calc(100% - 16px);
        padding-bottom: 34px;
    }

    .semester-header {
        margin-bottom: 22px;
    }

    .semester-kicker {
        font-size: 10px;
    }

    .semester-page h1 {
        font-size: 34px;
    }

    .semester-timer {
        margin-bottom: 24px;
        padding: 18px 12px 20px;
        border-radius: 12px;
    }

    .countdown-value {
        gap: 7px;
    }

    .countdown-value span {
        padding: 10px 5px;
        font-size: 20px;
    }

    .countdown-value small {
        font-size: 8px;
    }

    .excel-status-line {
        margin-bottom: 24px;
        font-size: 11px;
    }

    .plan-heading {
        margin-bottom: 12px;
    }

    .modul-filter {
        gap: 9px;
        margin: 10px auto 22px;
    }

    .modul-filter label {
        font-size: 11px;
    }

    .modul-select {
        width: min(320px, calc(100vw - 86px));
    }

    .modul-filter-button {
        min-height: 38px;
        padding: 8px 11px 8px 12px;
        font-size: 12px;
        border-radius: 9px;
    }

    .modul-filter-menu {
        top: calc(100% + 7px);
    }

    .plan-heading h2 {
        font-size: 22px;
    }

    .tabelle-container {
        border-radius: 10px;
        max-height: 68vh;
    }

    .stundenplan {
        width: auto;
        min-width: 1320px;
    }

    .stundenplan thead th {
        padding: 12px 10px;
        font-size: 12px;
    }

    .stundenplan thead th:first-child,
    .stundenplan tbody th.uhrzeit {
        width: 130px;
        min-width: 130px;
    }

    .stundenplan tbody th.uhrzeit {
        padding: 12px 9px;
        font-size: 12px;
    }

    .stundenplan tbody td {
        min-width: 238px;
        height: 100px;
        padding: 7px;
    }

    .kurskarte {
        padding: 9px 9px 9px 10px;
    }

    .kurs-name {
        font-size: 12px;
    }
}

/* ==========================================================
   GESPEICHERTE ANSICHTEN
   ========================================================== */

.stundenplan-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px auto 28px;
}

.stundenplan-toolbar .modul-filter {
    margin: 0;
}

.ansichten-select {
    position: relative;
    width: 230px;
}

.ansichten-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    width: 100%;
    min-height: 40px;
    padding: 9px 11px 9px 13px;
    border: 1px solid #5b5b5b;
    border-radius: 10px;
    background: #2f2f2f;
    color: #f3f3f3;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 2px rgba(0,0,0,0.18);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ansichten-button:hover,
.ansichten-button.offen {
    border-color: #777;
    background: #343434;
}

.ansichten-button:focus-visible {
    outline: none;
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

.ansichten-count {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #454545;
    color: #cfcfcf;
    font-size: 10px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
}

.ansichten-chevron {
    color: #bdbdbd;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
    transition: transform 0.15s ease;
}

.ansichten-button.offen .ansichten-chevron {
    transform: rotate(180deg) translateY(1px);
}

.ansichten-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    width: 330px;
    overflow: hidden;
    border: 1px solid #5b5b5b;
    border-radius: 12px;
    background: #2b2b2b;
    box-shadow: 0 18px 35px rgba(0,0,0,0.35);
}

.ansichten-menu-head {
    padding: 11px 13px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: #272727;
}

.ansichten-menu-head strong {
    display: block;
    color: #ededed;
    font-size: 12px;
    font-weight: 800;
}

.ansichten-menu-head span {
    display: block;
    margin-top: 3px;
    color: #909090;
    font-size: 10px;
}

.ansichten-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 7px;
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
}

.ansicht-item {
    display: flex;
    align-items: stretch;
    gap: 4px;
}

.ansicht-laden {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #ededed;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ansicht-laden:hover {
    background: rgba(255,255,255,0.06);
}

.ansicht-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #3a3a3a;
    color: #a9e7b8;
    font-size: 12px;
    font-weight: 900;
    line-height: 22px;
    text-align: center;
}

.ansicht-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ansicht-info strong {
    overflow: hidden;
    color: #f2f2f2;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ansicht-info small {
    margin-top: 2px;
    color: #8f8f8f;
    font-size: 9px;
    white-space: nowrap;
}

.ansicht-loeschen {
    flex: 0 0 28px;
    width: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #777;
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
}

.ansicht-loeschen:hover {
    background: rgba(255,255,255,0.05);
    color: #d0d0d0;
}

.ansichten-empty {
    padding: 18px 12px;
    color: #898989;
    font-size: 11px;
    text-align: center;
}

.ansichten-menu-footer {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: #272727;
}

.ansicht-speichern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #505050;
    border-radius: 8px;
    background: #333;
    color: #dfdfdf;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ansicht-speichern:hover:not(:disabled) {
    border-color: #6a6a6a;
    background: #3a3a3a;
}

.ansicht-speichern:disabled {
    color: #666;
    border-color: #414141;
    background: #2c2c2c;
    cursor: default;
}

@media (max-width: 700px) {
    .stundenplan-toolbar {
        align-items: stretch;
        gap: 8px;
        margin: 8px auto 20px;
    }

    .stundenplan-toolbar .modul-filter {
        flex: 1 1 auto;
        width: auto;
    }

    .ansichten-select {
        width: 205px;
    }

    .ansichten-menu {
        right: -2px;
        width: min(330px, calc(100vw - 24px));
    }
}

@media (max-width: 520px) {
    .stundenplan-toolbar {
        flex-direction: column;
        align-items: center;
    }

    .stundenplan-toolbar .modul-filter,
    .ansichten-select {
        width: min(100%, 340px);
    }

    .ansichten-menu {
        left: 0;
        right: auto;
    }
}

/* ==========================================================
   FILTER-STABILITÄT AUF TABLET & HANDY
   Verhindert horizontales Verschieben beim Öffnen/Auswählen.
   ========================================================== */

.semester-page,
.semester-page .semester-main {
    max-width: 100%;
}

@media (max-width: 1024px) {
    .semester-page {
        overflow-x: hidden;
    }

    .stundenplan-toolbar {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .stundenplan-toolbar .modul-filter,
    .stundenplan-toolbar .ansichten-select {
        width: min(100%, 360px);
        max-width: 100%;
    }

    .stundenplan-toolbar .modul-filter {
        display: flex;
        align-items: center;
    }

    .stundenplan-toolbar .modul-select {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    .stundenplan-toolbar .modul-filter-button,
    .stundenplan-toolbar .ansichten-button {
        width: 100%;
    }

    .modul-filter-menu {
        left: 0;
        right: auto;
        width: 100%;
        max-width: 100%;
    }

    .ansichten-menu {
        left: 0;
        right: auto;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .stundenplan-toolbar {
        margin: 10px auto 22px;
        padding: 0 2px;
    }

    .stundenplan-toolbar .modul-filter,
    .stundenplan-toolbar .ansichten-select {
        width: min(100%, 360px);
    }

    .stundenplan-toolbar .modul-filter > label {
        font-size: 11px;
    }
}


/* ==========================================================
   MODUL-AUSWAHLMENÜ – STABILES NATIVE DROPDOWN
   Das Menü bleibt als normales position:absolute-Untermenü
   direkt am Modul-Button verankert. Änderungen an der Tabelle,
   an Scrollpositionen oder an der Auswahl verändern seine Lage
   nicht. Es bleibt geöffnet, bis der Button erneut geklickt oder
   außerhalb geklickt wird.
   ========================================================== */
.modul-select {
    position: relative;
}

#modul-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    z-index: 1000;
    width: 320px;
    max-width: min(320px, calc(100vw - 24px));
    margin: 0;
    transform: none;
    overflow: hidden;
    box-sizing: border-box;
    contain: layout paint;
}

#modul-filter-options {
    max-height: min(310px, calc(100vh - 245px));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
}

#modul-filter-options .modul-option {
    display: flex;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    color: #ededed;
    font-family: inherit;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
}

#modul-filter-options .modul-option[aria-pressed="true"] {
    background: rgba(255,255,255,0.06);
}

#modul-filter-options .modul-option[aria-pressed="true"] .modul-check {
    border-color: #9fcca9;
    background: #9fcca9;
}

#modul-filter-options .modul-option[aria-pressed="true"] .modul-check::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #1e2a20;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

@media (max-width: 1024px) {
    #modul-filter-menu {
        width: 100%;
        max-width: 100%;
    }
}


/* PDF Export Button */
.pdf-export-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 170px;
    height: 40px;
    padding: 9px 14px;
    white-space: nowrap;
}

.stundenplan-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.pdf-export-button {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid #5b5b5b;
    border-radius: 10px;
    background: #2f2f2f;
    color: #f3f3f3;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    white-space: nowrap;
}

.pdf-export-button:hover {
    background: #343434;
    border-color: #777;
}
