*{box-sizing:border-box}html{scroll-behavior:smooth}body{font:16px/1.5 Arial,Helvetica,sans-serif;background:#f5f8fa;color:#1c2f3b;margin:0;border-top:3px solid #009bd6}header{background:white;border-bottom:1px solid #dce8ee;padding:13px max(20px,calc((100vw - 1150px)/2));display:flex;justify-content:space-between;align-items:center;gap:20px;box-shadow:0 2px 8px #1730440a}.brand{display:flex;align-items:center;gap:18px;min-width:0}.brand img{width:275px;max-width:56vw;height:auto;display:block}.brand span{border-left:3px solid #afca05;padding-left:16px;color:#254457;font-weight:700}main{max-width:1150px;margin:30px auto;padding:0 20px}.narrow{max-width:460px;background:white;padding:32px;margin:9vh auto;border:1px solid #dce8ee;border-radius:8px;box-shadow:0 12px 30px #17304412}.narrow .brand{margin-bottom:25px}.narrow .brand img{max-width:100%;width:330px}h1{font-size:1.75rem;margin:8px 0 14px;color:#153c50}h2{font-size:1.2rem;color:#153c50;margin-top:0}section{background:white;border:1px solid #dce8ee;border-radius:8px;padding:22px;margin:20px 0;box-shadow:0 3px 12px #17304408}form.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}label{display:block;font-weight:600;margin:10px 0}input,select{font:inherit;display:block;width:100%;padding:10px;border:1px solid #a8bdc7;border-radius:5px;margin-top:5px;background:white;color:#1c2f3b}input:focus,select:focus,button:focus-visible,a:focus-visible{outline:3px solid #afdced;outline-offset:2px}button{background:#007aa9;color:white;border:0;border-radius:5px;padding:11px 17px;font:inherit;font-weight:600;cursor:pointer}button:hover{background:#005d85}.link-button{background:transparent;color:#006c96;text-decoration:underline;padding:7px}.link-button:hover{background:transparent;color:#004d6b}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px;border-bottom:1px solid #dce8ee}th{background:#edf7fb;color:#17475c}.error{color:#a32832}.ok{color:#357016}.muted{color:#536b77}.scroll{overflow:auto}nav{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}nav a{color:#006c96;background:white;border:1px solid #dce8ee;border-radius:5px;padding:8px 12px;text-decoration:none;font-weight:600}nav a:hover{border-color:#009bd6;background:#edf7fb}@media(max-width:650px){header{align-items:flex-start;flex-direction:column}.brand span{font-size:14px}.narrow{margin:25px 16px;padding:24px}main{margin:20px auto}section{padding:16px}}
.calendar-months{display:grid;grid-template-columns:repeat(auto-fit,minmax(265px,1fr));gap:14px}.calendar-month{margin:0;padding:15px}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}.calendar-grid>strong{font-size:.75rem;color:#536b77}.calendar-day{padding:4px 0;min-height:39px;background:#f0f8fb;color:#17475c;border:1px solid #dce8ee;border-radius:4px;font-size:.85rem}.calendar-day small{display:block;font-size:.65rem;line-height:1}.calendar-day:hover{background:#cceaf5}.calendar-off{background:#e9f0b8;color:#304500}.calendar-weekend{background:#eef0f1;color:#536b77}.calendar-day:focus-visible{outline:2px solid #009bd6}

.calendar-legend{display:flex;flex-wrap:wrap;gap:10px 18px;margin:18px 0;font-size:.9rem}.calendar-legend span{display:inline-flex;align-items:center;gap:7px}.calendar-legend i{display:inline-block;width:20px;height:20px;border-radius:4px;border:1px solid #71818b}.legend-holiday{background:#b8e2f4}.legend-state{background:#f6c6c1}.legend-school{background:#d7ec9a}.legend-weekend{background:#e5e9ed}.calendar-grid .calendar-day{position:relative;min-height:48px;padding:3px 0;background:#f0f8fb;color:#17475c;border:1px solid #cbdce4}.calendar-grid .calendar-day.calendar-holiday{background:#b8e2f4;border:2px solid #14769b;color:#123b4c}.calendar-grid .calendar-day.calendar-state{background:#f6c6c1;border:2px solid #b45147;color:#5d201c}.calendar-grid .calendar-day.calendar-school{background:#d7ec9a;border:2px solid #718f27;color:#29440d}.calendar-grid .calendar-day.calendar-weekend{background:#e5e9ed;color:#536b77}.calendar-grid .calendar-day:hover{filter:brightness(.92)}.calendar-marker{position:absolute;top:1px;right:2px;font-size:.55rem;line-height:1;padding:2px;border-radius:2px;background:#ffffffc9}

.app-shell{max-width:1520px;margin:0 auto;display:grid;grid-template-columns:235px minmax(0,1fr);gap:24px;padding:20px}.app-shell main{min-width:0;max-width:none;margin:0;padding:0}.sidebar{position:sticky;top:14px;align-self:start;background:#fff;border:1px solid #dce8ee;border-radius:8px;padding:15px;box-shadow:0 3px 12px #17304408}.sidebar nav{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0}.sidebar nav .nav-heading{font-size:.75rem;text-transform:uppercase;letter-spacing:.07em;color:#5b7280;font-weight:700;padding:13px 10px 5px}.sidebar nav a{display:block;margin:0;padding:8px 10px;border:none;border-radius:5px;background:transparent;text-decoration:none;color:#17475c}.sidebar nav a:hover{background:#edf7fb}.sidebar nav a.active{background:#d9f1fa;color:#004d6b;border-left:4px solid #009bd6;padding-left:6px}.app-shell section:first-of-type{margin-top:20px}@media(max-width:850px){.app-shell{grid-template-columns:1fr;gap:8px;padding:12px}.sidebar{position:static}.sidebar nav{flex-direction:row;flex-wrap:wrap}.sidebar nav .nav-heading{flex-basis:100%;padding-top:4px}.sidebar nav a{font-size:.9rem}.app-shell main{padding:0 4px}}

.edit-link{display:inline-flex;align-items:center;justify-content:center;min-width:38px;min-height:38px;border:1px solid #a8cfdc;border-radius:5px;background:#edf7fb;color:#006c96;font-size:1.4rem;text-decoration:none}.edit-link:hover{background:#d9f1fa}.edit-form{max-width:550px}.edit-form label{margin:15px 0}
.detail-link{display:inline-block;padding:8px 12px;border:1px solid #a8cfdc;border-radius:5px;background:#edf7fb;color:#006c96;text-decoration:none;font-weight:600;white-space:nowrap}.detail-link:hover{background:#d9f1fa}
.lock-form{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.lock-form label{display:flex;align-items:center;gap:10px;margin:0}.lock-form input[type=checkbox]{display:inline-block;width:auto;margin:0}
.tile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:16px;margin:24px 0}.tile{display:flex;flex-direction:column;min-height:178px;padding:23px;background:#fff;border:1px solid #cbdfe9;border-radius:9px;box-shadow:0 3px 12px #17304408;text-decoration:none;color:#1c2f3b;transition:transform .15s,border-color .15s,box-shadow .15s}.tile:hover{transform:translateY(-2px);border-color:#009bd6;box-shadow:0 8px 20px #17304417}.tile-title{display:flex;justify-content:space-between;gap:15px;font-size:1.18rem;font-weight:700;color:#153c50}.tile-title span{color:#009bd6}.tile-description{margin:12px 0 18px;line-height:1.45}.tile-detail{margin-top:auto;color:#006c96;font-size:.9rem;font-weight:700}.records{margin-top:25px}
.preference-toolbar{border:1px solid #dce8ee;border-radius:7px;padding:15px;margin:20px 0}.preference-toolbar legend{font-weight:700;color:#153c50;padding:0 7px}.preference-modes{display:flex;flex-wrap:wrap;gap:8px}.mode-button{background:#f1f6f8;border:1px solid #b6cbd5;color:#17475c}.mode-button:hover{background:#e3f1f6}.mode-button.active{background:#005d85;border-color:#005d85;color:white;box-shadow:0 0 0 2px #b8e2f4}.week-grids{display:grid;gap:20px;margin:20px 0}.week-grid{border:1px solid #dce8ee;border-radius:7px;overflow:hidden}.week-grid h3{margin:0;padding:12px 16px;background:#e8f5fa;color:#153c50}.availability-grid{min-width:685px;table-layout:fixed}.availability-grid th:first-child{width:155px}.availability-grid td{padding:6px;text-align:center}.availability-grid th[scope=row]{font-weight:700;white-space:nowrap}.availability-grid th small{display:block;font-size:.75rem;font-weight:400}.preference-cell{width:100%;min-height:51px;padding:6px 3px;border:1px solid #a8bdc7;color:#17475c;background:#f1f6f8;font-size:.8rem;line-height:1.2}.preference-cell.pref-neutral:hover{background:#dceef5}.preference-cell.pref-blocked{background:#f7d6d3;border-color:#bd665d;color:#65221d}.preference-cell.pref-blocked:hover{background:#efbdb9}.preference-cell.pref-avoid{background:#ffe5bf;border-color:#b98530;color:#573c0c}.preference-cell.pref-avoid:hover{background:#ffd494}.preference-cell.pref-prefer{background:#d9edb7;border-color:#739638;color:#345314}.preference-cell.pref-prefer:hover{background:#c7e59a}.availability-form>button[type=submit]{margin:4px 0 10px}
.class-picker{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:18px 0}.class-picker label{min-width:270px;max-width:440px;flex:1}.planning-grid{min-width:1080px;table-layout:fixed}.planning-grid th:first-child{width:95px}.planning-grid th small{display:block;font-size:.75rem;font-weight:400}.planning-grid td{vertical-align:top;padding:7px}.cell-label{font-size:.75rem;margin:3px 0 7px;color:#536b77}.cell-label select{font-size:.82rem;padding:8px;margin-top:2px}.planning-grid td{background:#fbfdfe}.danger-button{background:#9b3434}.danger-button:hover{background:#7f2626}tfoot th,tfoot td{background:#edf7fb;font-weight:700}
.teacher-plan-grid{min-width:850px;table-layout:fixed}.teacher-plan-grid th:first-child{width:145px}.teacher-plan-grid th small{display:block;font-size:.75rem;font-weight:400}.teacher-plan-grid td{height:86px;vertical-align:top;padding:8px;background:#fbfdfe}.teacher-plan-lesson{display:grid;gap:2px;padding:8px;margin-bottom:5px;background:#e7f5fa;border-left:4px solid #009bd6;border-radius:4px;font-size:.86rem}.teacher-plan-lesson strong{font-size:1rem;color:#153c50}.teacher-plan-lesson small{color:#536b77}.teacher-plan-free{color:#71848e;font-size:.85rem}
.flex-check{display:flex;align-items:center;gap:9px;align-self:center}.flex-check input{display:inline-block;width:18px;height:18px;flex:none;margin:0}
.rule-settings-form{margin-top:20px}.rule-groups{display:grid;gap:20px}.rule-group{--rule-accent:#009bd6;--rule-soft:#f2f9fc;--rule-border:#b8dfed;margin:0;padding:0 18px 18px;overflow:hidden;border-color:var(--rule-border);border-top:5px solid var(--rule-accent);background:var(--rule-soft)}.app-shell .rule-group:first-of-type{margin-top:0}.rule-group--classes{--rule-accent:#9bbd1b;--rule-soft:#f8faef;--rule-border:#d7e4a9}.rule-group-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 -18px 16px;padding:13px 18px;background:#ffffffad;border-bottom:1px solid var(--rule-border);box-shadow:none}.rule-group-heading div{min-width:0}.rule-group-heading span{display:block;margin-bottom:1px;color:#5b7280;font-size:.68rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.rule-group-heading h2{display:inline;margin:0;color:#153c50;font-size:1.3rem}.rule-group-heading p{display:inline;margin:0 0 0 10px;color:#536b77;font-size:.84rem}.rule-group-heading>strong{flex:none;padding:3px 9px;border-radius:14px;background:var(--rule-accent);color:#fff;font-size:.75rem}.rule-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.rule-card{display:flex;min-width:0;min-height:150px;flex-direction:column;padding:14px 15px;border:1px solid var(--rule-border);border-left:4px solid var(--rule-accent);border-radius:7px;background:#fff;box-shadow:0 2px 7px #17304408}.rule-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.rule-card label{margin:0;color:#203c4c;font-size:.94rem;line-height:1.3}.rule-card output{display:inline-flex;width:32px;height:32px;flex:none;align-items:center;justify-content:center;border:2px solid var(--rule-accent);border-radius:50%;background:var(--rule-soft);color:#204556;font-size:1rem;font-weight:700}.rule-card p{margin:5px 0 12px;font-size:.81rem;line-height:1.35}.rule-slider{display:grid;grid-template-columns:16px minmax(120px,280px) 22px;align-items:center;gap:8px;margin-top:auto;color:#60747f;font-size:.72rem}.rule-slider input{width:100%;margin:0;padding:0;border:0;accent-color:var(--rule-accent)}.rule-save-bar{display:flex;align-items:center;gap:14px;margin:16px 0 22px}.rule-save-bar span{color:#536b77;font-size:.85rem}.rule-report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}.rule-report-block{--rule-accent:#009bd6;overflow:hidden;border:1px solid #c8e3ed;border-top:4px solid var(--rule-accent);border-radius:7px;background:#fff}.rule-report-block--classes{--rule-accent:#9bbd1b;border-color:#d7e4a9}.rule-report-block h3{margin:0;padding:10px 13px;background:#f3fafc;color:#153c50;font-size:1rem}.rule-report-block--classes h3{background:#f8faef}.rule-report-block table{font-size:.82rem}.rule-report-block th,.rule-report-block td{padding:7px 9px}.rule-report-block th:last-child,.rule-report-block td:last-child{width:110px;text-align:right}.rule-report-block small{white-space:nowrap}.rule-current{margin-top:22px}@media(max-width:1050px){.rule-group-heading p{display:block;margin:2px 0 0}.rule-report-grid{grid-template-columns:1fr}}@media(max-width:720px){.rule-card-grid{grid-template-columns:1fr}.rule-card{min-height:0}.rule-group-heading{align-items:flex-start}.rule-slider{grid-template-columns:16px minmax(120px,280px) 22px}.rule-save-bar{align-items:flex-start;flex-direction:column}.rule-report-block th:last-child,.rule-report-block td:last-child{width:auto}}

.inline-delete{display:inline-block;margin-left:8px}.inline-delete .danger-button{padding:8px 12px}
dialog{width:min(520px,calc(100vw - 30px));border:1px solid #a8bdc7;border-top:5px solid #009bd6;border-radius:9px;padding:24px;box-shadow:0 18px 50px #17304445}dialog::backdrop{background:#102e3d99}dialog h3{margin:0 0 12px;color:#153c50}dialog button{margin:5px 7px 0 0}progress{width:100%;height:22px;accent-color:#009bd6}
.calculation-panel{border-top:5px solid #009bd6;text-align:center;padding:28px clamp(18px,4vw,48px);background:linear-gradient(180deg,#f4fbfe 0,#fff 45%)}.calculation-panel>p{max-width:800px;margin:12px auto}.calculation-panel h2{font-size:1.45rem}.calculation-form{max-width:530px;margin:24px auto;text-align:left;padding:18px 24px;border:1px solid #cbdfe9;border-radius:8px;background:white}.calculation-form label{margin-top:0}.calculation-form button{display:block;margin:16px auto 4px;padding:13px 22px}.calculation-form button:disabled{background:#a7b9c1;cursor:not-allowed}.calculation-reset{max-width:800px;margin:26px auto 0;padding:22px;text-align:center;border-top:1px solid #dce8ee}.calculation-reset p{margin:0 auto 12px}.calculation-reset .danger-button{background:#fff;color:#9b3434;border:1px solid #9b3434}.calculation-reset .danger-button:hover{background:#fff0f0}.calculation-reset .danger-button:disabled{color:#7a8b95;border-color:#c8d3d8;background:#f2f5f6;cursor:not-allowed}.calculation-panel dialog{text-align:left;background:#fff}
.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-wrap:wrap}.header-actions form{margin:0}.header-calculate{display:inline-block;background:#b42c34;color:#fff;text-decoration:none;border-radius:6px;padding:12px 18px;font-weight:700;white-space:nowrap;box-shadow:0 3px 10px #76202730}.header-calculate:hover{background:#902229}.header-calculate:focus-visible{outline:3px solid #009bd6;outline-offset:3px}.header-back{color:#006c96;font-weight:600}@media(max-width:650px){.header-actions{justify-content:flex-start}.header-calculate{white-space:normal}}
.history-table{min-width:820px}.history-table td{vertical-align:middle}.history-current{display:block;width:max-content;margin-top:5px;padding:2px 7px;background:#e4f3c5;color:#345314;border-radius:4px;font-size:.75rem;font-weight:700}.history-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.history-actions button{font-size:.86rem;padding:7px 9px}.history-actions button:disabled,#history button:disabled{opacity:.55;cursor:not-allowed}.history-actions button:disabled:hover,#history button:disabled:hover{background:#f1f6f8}.history-actions a{white-space:nowrap}
.version-view-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.version-view-tabs a{display:inline-block;padding:9px 14px;border:1px solid #a8cfdc;border-radius:5px;background:#fff;color:#006c96;text-decoration:none;font-weight:700}.version-view-tabs a:hover{background:#edf7fb}.version-view-tabs a.active{background:#d9f1fa;border-color:#009bd6;color:#004d6b}
/* Navigation: visible stages with restrained school colours. */
.app-shell{grid-template-columns:252px minmax(0,1fr)}
.sidebar{max-height:calc(100vh - 28px);overflow-y:auto;padding:12px}
.sidebar nav{--nav-row-height:44px;gap:9px;margin:0}
.sidebar nav a{font-size:.92rem;line-height:1.3;padding:7px 9px}
.sidebar nav .nav-home{display:flex;align-items:center;width:100%;min-height:var(--nav-row-height);padding:10px 12px;background:#f2f9fc;border:1px solid #d2e8f1;font-weight:700}
.sidebar nav .nav-home.active{padding-left:12px;border:1px solid #78c5df;background:#d9f1fa}
.nav-section{padding:8px;border:1px solid #e0e9ed;border-left:3px solid #009bd6;border-radius:7px;background:#f6fbfd}
.nav-section--settings{border-left-color:#9bbd1b;background:#f9fbf2}
.nav-section--planning{border-left-color:#006c96;background:#f1f8fb}
.nav-section--results{border-left-color:#61a882;background:#f4faf6}
.sidebar nav .nav-section .nav-heading{display:block;padding:2px 9px 6px;font-size:.74rem;color:#425c68}
.nav-links{display:flex;flex-direction:column;gap:2px}
.sidebar nav .nav-links a.active{border:0;padding-left:9px;box-shadow:inset 3px 0 #009bd6}
.sidebar nav .nav-section--settings .nav-links a.active{box-shadow:inset 3px 0 #9bbd1b;background:#edf4d7}
.sidebar nav .nav-section--results .nav-links a.active{box-shadow:inset 3px 0 #61a882;background:#e3f3e9}
.sidebar nav .nav-links a.nav-calculate{color:#9b3035;font-weight:700}
.sidebar nav .nav-links a.nav-calculate:hover,.sidebar nav .nav-links a.nav-calculate.active{background:#fcecee;color:#84252b;box-shadow:inset 3px 0 #b42c34}
@media(max-width:850px){.app-shell{grid-template-columns:1fr}.sidebar{max-height:none;overflow:visible}.sidebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.sidebar nav .nav-home{grid-column:1/-1}.sidebar nav .nav-section .nav-heading{padding:2px 9px 6px}}
@media(max-width:560px){.sidebar nav{grid-template-columns:1fr}}
/* Collapsible navigation: native disclosure, usable without JavaScript. */
.sidebar nav details.nav-section{width:100%;padding:0;align-self:start;min-width:0}
.sidebar nav .nav-section>summary.nav-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:calc(var(--nav-row-height) - 2px);margin:0;padding:10px 12px;list-style:none;cursor:pointer;border-radius:6px;font-size:.78rem;line-height:1.3;font-weight:700}
.sidebar nav .nav-section>summary::-webkit-details-marker{display:none}
.sidebar nav .nav-section>summary::marker{content:''}
.sidebar nav .nav-section>summary:hover{background:#e5f3f9}
.sidebar nav .nav-section>summary:focus-visible{outline:3px solid #005d85;outline-offset:-3px}
.sidebar nav .nav-section-current>summary{text-decoration:underline;text-underline-offset:4px}
.nav-section-arrow{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nav-section[open]>summary .nav-section-arrow{transform:rotate(90deg)}
.sidebar nav details.nav-section>.nav-links{padding:0 8px 8px}
.sidebar nav details.nav-section:not([open])>.nav-links{display:none}
/* Startseite: dieselben Arbeitsschritte wie in der Navigation. */
.home-sections{display:grid;gap:18px;margin:24px 0}
.home-section{--home-accent:#009bd6;--home-ink:#006c96;margin:0;padding:20px;border-left:4px solid var(--home-accent);background:#f5fbfe}
.app-shell .home-section:first-of-type{margin-top:0}
.home-section--settings{--home-accent:#9bbd1b;--home-ink:#4a670d;background:#f9fbf2}
.home-section--planning{--home-accent:#006c96;--home-ink:#005476;background:#f1f8fb}
.home-section--results{--home-accent:#61a882;--home-ink:#286d49;background:#f4faf6}
.home-section--account{--home-accent:#7890a0;--home-ink:#405c6a;background:#f6f8fa}
.home-section-heading{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.home-section-heading h2{margin:0;color:#153c50}
.home-section-heading p{margin:0;color:#536b77;font-size:.91rem}
.home-section .tile-grid{grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:12px;margin:0}
.home-section .tile{min-height:145px;padding:17px;border-left:3px solid var(--home-accent);box-shadow:0 2px 8px #17304408}
.home-section .tile:hover{border-color:var(--home-accent);box-shadow:0 5px 15px #17304416}
.home-section .tile-title{font-size:1.06rem}
.home-section .tile-title span,.home-section .tile-detail{color:var(--home-ink)}
.home-section .tile-description{margin:8px 0 12px;font-size:.94rem}
.home-section .tile--calculate{border-left-color:#b42c34}
.home-section .tile--calculate .tile-title,.home-section .tile--calculate .tile-detail{color:#9b3035}
@media(max-width:560px){.home-section{padding:16px}.home-section .tile{min-height:0}}

.nav-section--account{border-left-color:#7890a0;background:#f6f8fa}
.sidebar nav .nav-section--account .nav-links a.active{box-shadow:inset 3px 0 #7890a0;background:#eaf0f3}
.account-form{max-width:490px}.account-form label{margin:14px 0}.account-form button{margin-top:8px}

.planning-status{padding:14px 18px;background:#fff4da;border:1px solid #b59442;border-left:4px solid #997420;border-radius:6px;color:#55420e}.planning-status a{white-space:nowrap}


/* Classroom availability is a hard constraint, independent of teacher wishes. */
.profile-choice{display:flex;align-items:flex-start;gap:10px;margin:10px 0}
.profile-choice input{width:auto;margin-top:5px}
.profile-tools{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}
.time-profile-grid th small{display:block;font-weight:400;white-space:nowrap}
.time-profile-grid thead th:not(:first-child){min-width:96px;text-align:center}.profile-day-name{display:block}.profile-day-toggle{display:block;min-width:66px;margin:5px auto 0;padding:4px 8px;border:1px solid #88bfd3;background:#edf7fb;color:#005d85;font-size:.7rem;line-height:1.2}.profile-day-toggle:hover{background:#d9f1fa}.profile-day-toggle[aria-pressed="true"]{border-color:#89a936;background:#edf5d8;color:#405d08}.profile-day-toggle[aria-pressed="true"]:hover{background:#e2efc2}
.time-profile-grid td{padding:0;min-width:80px}
.time-profile-grid td label{display:flex;align-items:center;justify-content:center;gap:8px;min-height:58px;cursor:pointer;padding:8px}
.time-profile-grid td label:has(input:checked){background:#e5f3df}
.time-profile-grid input{width:20px;height:20px;accent-color:#0079a4}
.time-profile-grid .profile-disabled{background:#edf0f3;color:#63717a}
.time-profile-grid .profile-disabled label{cursor:default}
button:disabled{opacity:.55;cursor:not-allowed}

.teacher-plan-grid .profile-disabled,.planning-grid .profile-disabled{background:#edf0f3}

/* Shared page frame: compact header, clear account actions and release footer. */
body{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.app-shell{width:100%;flex:1;align-content:start}
.app-header{padding:8px max(20px,calc((100vw - 1480px)/2));gap:16px;flex-direction:row;align-items:center;flex-wrap:wrap;box-shadow:0 2px 8px #1730440a}
.app-header .brand{gap:14px;text-decoration:none;flex-shrink:1}
.app-header .brand img{width:200px;max-width:100%;height:auto}
.app-header .brand span{font-size:.95rem;padding-left:13px;border-left-width:2px}
.app-header .header-actions{margin-left:auto;gap:12px;flex-wrap:nowrap;justify-content:flex-end}
.app-header .header-calculate{padding:9px 14px;font-size:.9rem;min-height:40px}
.header-user-actions{display:flex;align-items:center;gap:6px;flex:none}
.header-user-actions form{display:flex;margin:0}
.header-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;padding:0;border:1px solid #d5e4eb;border-radius:7px;background:#f7fbfd;color:#17475c;text-decoration:none;cursor:pointer}
.header-icon svg,.footer-documentation svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.header-icon:hover{background:#e5f3f9;border-color:#79bed5;color:#005b7e}
.header-icon--logout:hover{background:#fceeee;border-color:#dca4a8;color:#9b3035}
.header-icon:focus-visible{outline:3px solid #009bd6;outline-offset:3px}
.app-footer{margin-top:auto;background:#fff;border-top:1px solid #dce8ee;color:#536b77;font-size:.8rem}
.footer-inner{max-width:1520px;margin:0 auto;padding:13px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px 24px;flex-wrap:wrap}
.footer-release{display:flex;flex-wrap:wrap;gap:4px 16px;margin:0}
.footer-release span+span{border-left:1px solid #cbdce4;padding-left:16px}
.footer-documentation{display:inline-flex;align-items:center;gap:7px;color:#006c96;text-decoration:none;min-height:36px}
.footer-documentation svg{width:18px;height:18px}
.footer-documentation:hover{text-decoration:underline;color:#004d6b}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:900px){.app-header .brand span{display:none}}
@media(max-width:650px){
 .app-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:8px 16px}
 .app-header .brand{grid-column:1;grid-row:1}
 .app-header .brand img{width:175px;max-width:100%}
 .app-header .header-actions{display:contents}
 .header-user-actions{grid-column:2;grid-row:1}
 .app-header .header-calculate,.app-header .header-back{grid-column:1/-1;text-align:center;justify-self:stretch}
 .app-header .header-calculate{white-space:normal}
 .footer-inner{padding:11px 16px;gap:5px 16px}
 .footer-release{gap:4px 10px}
 .footer-release span+span{padding-left:10px}
}
@media(max-width:380px){.footer-release{flex-direction:column;gap:1px}.footer-release span+span{border:0;padding-left:0}}
/* A single notice for outstanding edits, without changing individual form layouts. */
.unsaved-notice{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:40;box-sizing:border-box;width:min(480px,calc(100vw - 32px));margin:0;padding:12px 16px;border:1px solid #e0aaaa;border-left:4px solid #a73737;border-radius:8px;background:#fff0f0;color:#792727;box-shadow:0 5px 20px #63252522;font-size:15px;line-height:1.5;overflow-wrap:anywhere;pointer-events:none;}
/* Keep the last controls scrollable above the notice, even before edits exist. */
body:has(.unsaved-notice){padding-bottom:140px;}
html:has(.unsaved-notice){scroll-padding-bottom:140px;}
@media(max-width:480px){.unsaved-notice{right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));width:calc(100vw - 24px);padding:10px 12px;font-size:13px;line-height:1.4;}}
@media print{.unsaved-notice{display:none!important}body:has(.unsaved-notice){padding-bottom:0;}}
.unsaved-notice[hidden]{display:none;}
.unsaved-dialog{box-sizing:border-box;inset:0;margin:auto;width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow-y:auto;background:#fff5f5;color:#632525;border:1px solid #ddb0b0;border-top:5px solid #a73737;padding:26px}
.unsaved-dialog::backdrop{background:#30202588}
.unsaved-dialog h2{margin:0 0 14px;color:#792727;font-size:1.35rem;line-height:1.3}
.unsaved-dialog p{margin:0;line-height:1.6}
.unsaved-dialog-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-top:24px}
.unsaved-dialog-actions button{margin:0;min-height:44px;white-space:normal}
.unsaved-dialog button:focus-visible{outline:3px solid #005d85;outline-offset:3px}
@media(max-width:480px){.unsaved-dialog{padding:20px}.unsaved-dialog-actions{flex-direction:column}.unsaved-dialog-actions button{width:100%}}
.user-presence-summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;margin:12px 0;}
.user-presence-summary p{margin:0;}
.user-presence-badge{display:inline-flex;align-items:center;gap:7px;padding:3px 10px;border-radius:20px;font-size:.875rem;font-weight:600;white-space:nowrap;}
.user-presence-badge::before{content:'';width:8px;height:8px;border-radius:50%;background:currentColor;}
.user-online{color:#286227;background:#e8f3df;}
.user-offline{color:#536573;background:#eef2f4;}
.user-login-time{white-space:nowrap;}

/* Compact row editing for subjects awaiting a complete assignment. */
.open-subjects{min-width:600px;font-size:.875rem;}
.open-subjects th,.open-subjects td{padding:7px 9px;vertical-align:middle;}
.open-subjects th:first-child,.open-subjects td:first-child{white-space:nowrap;}
.open-subjects td:nth-child(2){overflow-wrap:anywhere;}
.open-subject-teacher{width:145px;}
.open-subject-hours{width:115px;}
.open-subjects select{margin:0;padding:6px 8px;min-width:125px;min-height:34px;font-size:inherit;}
.open-subject-actions{display:flex;align-items:center;gap:7px;white-space:nowrap;}
.open-subject-actions form{margin:0;}
.open-subject-actions button,.open-subject-actions .danger-button{padding:6px 9px;min-height:34px;font-size:.875rem;}
.open-subject-actions .edit-link{padding:4px 6px;min-width:30px;min-height:34px;font-size:1rem;line-height:1;}
.detail-edit-table{min-width:1000px;font-size:.875rem;}
.detail-edit-table th,.detail-edit-table td{padding:7px 9px;vertical-align:middle;}
.detail-edit-table select,.detail-edit-table input[type=number]{margin:0;padding:6px 8px;min-height:34px;font-size:inherit;}
.detail-edit-table td:nth-child(1) select{min-width:130px;}
.detail-edit-table td:nth-child(3) select{min-width:105px;}
.detail-edit-table td:nth-child(5) select{min-width:125px;}
.detail-edit-table input[type=number]{min-width:90px;}
.section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:10px;}
.compact-section-link{font-size:.72rem;font-weight:600;white-space:nowrap;color:#006c96;}
.import-order{padding:12px 15px;border-left:4px solid #afca05;background:#f7fae9;border-radius:5px;}
.import-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:16px;align-items:stretch;}
.app-shell .import-grid .import-card{display:flex;flex-direction:column;margin:0;min-width:0;}
.import-card h2{display:flex;align-items:center;gap:9px;}
.import-card h2 span{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:50%;background:#d9f1fa;color:#005d85;font-size:.85rem;}
.import-card--active{border-color:#009bd6;box-shadow:0 0 0 2px #b8e2f4;}
.import-card code{overflow-wrap:anywhere;}
.import-card form{display:grid;gap:8px;margin-top:auto;}
.import-card form label{margin:0;}
.import-card form button{justify-self:start;}
.import-preview{border-top:5px solid #009bd6;}
.import-preview table{min-width:720px;}
.import-preview-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px;}
.import-preview-actions form{margin:0;}
@media(max-width:900px){.import-grid{grid-template-columns:1fr;grid-auto-rows:auto;}}
.open-subjects button:disabled{opacity:.55;cursor:not-allowed;}

/* Klassenplanung: neutraler Einstieg und klarer Kontext nach der Auswahl. */
.class-selection-empty{padding:18px 20px;border:1px dashed #a8cfdc;background:#f7fbfd;}
.class-selection-empty p{margin:0;}
.class-selection-empty p+p{margin-top:5px;}
.selected-class-banner{display:grid;grid-template-columns:auto minmax(180px,auto) minmax(260px,1fr);align-items:center;gap:14px 22px;margin:18px 0 12px;padding:13px 18px;border:1px solid #93cfe3;border-left:6px solid #009bd6;border-radius:7px;background:linear-gradient(100deg,#e5f6fc 0,#f7fcfe 58%,#fff 100%);color:#153c50;}
.selected-class-identity{display:flex;align-items:baseline;gap:10px;white-space:nowrap;}
.selected-class-identity span{font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#006c96;}
.selected-class-identity strong{font-size:1.45rem;color:#004d6b;}
.selected-class-details{display:grid;gap:1px;padding-left:20px;border-left:1px solid #acd7e6;}
.selected-class-details span{font-size:.84rem;color:#536b77;}
.selected-class-banner p{margin:0;text-align:right;font-size:.88rem;color:#3e5966;}
.class-mode-panel{display:flex;align-items:center;justify-content:space-between;gap:12px 24px;margin:14px 0;padding:10px 14px;border:1px solid #cdda91;border-left:5px solid #afca05;border-radius:7px;background:#f8fbe9;}
.class-mode-heading{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.class-mode-heading h2{margin:0;font-size:1rem;color:#294455;}
.class-mode-kicker{font-size:.67rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#55700e;}
.class-mode-status{display:inline-flex;padding:2px 7px;border-radius:12px;font-size:.7rem;font-weight:700;}
.class-mode-status.is-active{background:#dcebb8;color:#405d08;}
.class-mode-status.is-inactive{background:#e9eef1;color:#536573;}
.class-mode-copy p{margin:3px 0 0;font-size:.82rem;color:#526169;}
.class-mode-form{display:flex;align-items:center;gap:9px;flex:none;margin:0;}
.class-mode-form label{display:flex;align-items:center;gap:7px;margin:0;font-size:.88rem;font-weight:700;white-space:nowrap;}
.class-mode-form input[type=checkbox]{display:inline-block;width:18px;height:18px;margin:0;}
.class-mode-form button{padding:7px 11px;font-size:.82rem;white-space:nowrap;}
@media(max-width:1150px){.selected-class-banner{grid-template-columns:1fr auto;}.selected-class-banner p{grid-column:1/-1;text-align:left;}.selected-class-details{padding-left:15px;}.class-mode-panel{align-items:flex-start;flex-direction:column;}.class-mode-form{width:100%;justify-content:space-between;}}
@media(max-width:520px){.selected-class-banner{grid-template-columns:1fr;gap:7px;}.selected-class-details{padding:7px 0 0;border-left:0;border-top:1px solid #acd7e6;}.selected-class-identity{justify-content:space-between;}.class-mode-form{align-items:flex-start;flex-direction:column;}}

/* Clickable explanations, shared by planning settings and calculation controls. */
.control-with-help{display:flex;align-items:flex-start;gap:8px;min-width:0}
.control-with-help label{flex:1;margin:0;min-width:0}
.heading-with-help{display:flex;align-items:center;gap:10px;margin:8px 0 14px}
.heading-with-help h1,.heading-with-help h2{margin:0}
.heading-with-help--center{justify-content:center}
button.planning-help-trigger{display:inline-flex;flex:none;align-items:center;justify-content:center;width:30px;height:30px;min-width:30px;margin:0;padding:0;border:1.5px solid #39758c;border-radius:50%;background:#f1f9fc;color:#175873;font:italic 700 19px/1 Georgia,serif;vertical-align:middle;cursor:pointer}
button.planning-help-trigger:hover{background:#dceff7;border-color:#005d85;color:#004d6b}
button.planning-help-trigger:focus-visible{outline:3px solid #005d85;outline-offset:3px}
button.planning-help-trigger[hidden]{display:none}
.planning-help-dialog{width:min(640px,calc(100vw - 32px));max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain;padding:24px;text-align:left;background:#fff;color:#1c2f3b}
.planning-help-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.planning-help-kicker{font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#536b77}
.planning-help-dialog .planning-help-close{display:inline-flex;align-items:center;gap:10px;margin:0;padding:7px 10px;border:1px solid #b6cbd5;background:#f1f6f8;color:#17475c;font-size:.85rem;white-space:nowrap}
.planning-help-dialog .planning-help-close:hover{background:#e3f1f6}
.planning-help-close span{font-size:1.35rem;line-height:1}
.planning-help-dialog h2{margin:0 0 20px;font-size:1.35rem;line-height:1.3;padding-bottom:16px;border-bottom:1px solid #dce8ee}
.planning-help-dialog h2:focus{outline:none}
.planning-help-dialog h3{margin:20px 0 6px;font-size:1rem;color:#153c50}
.planning-help-dialog p{margin:0;line-height:1.6;font-size:.95rem}
.planning-help-dialog::backdrop{background:#102e3d99}
@media(max-width:480px){.planning-help-dialog{padding:18px}.planning-help-top{align-items:flex-start}.heading-with-help h1{font-size:1.5rem}}
@media print{button.planning-help-trigger,.planning-help-dialog{display:none}}

/* Class metadata is prepared separately from the existing calculation. */
.class-settings-fields{grid-column:1/-1;min-width:0;margin:0 0 16px;padding:18px;border:1px solid #cbdfe9;border-radius:8px}
.class-settings-fields legend{font-weight:700;color:#153c50;padding:0 8px}
.class-settings-basic{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
.class-settings-basic>label{margin:0}
.class-settings-basic p,.class-gap-control p{font-size:.86rem;margin:8px 0}
.class-settings-stage{padding:14px 16px;margin:16px 0;background:#edf7fb;border-left:4px solid #009bd6;border-radius:4px}
.class-settings-stage p{margin:4px 0 0}
.class-settings-pending{padding:10px 14px;background:#fff5dd;color:#694b12;border-radius:5px}
.class-gap-control{padding-top:12px;border-top:1px solid #dce8ee}
.class-settings-fields .class-gap-choice{display:flex;align-items:flex-start;gap:10px;margin:0;font-weight:600}
.class-settings-fields input[type=checkbox]{display:inline-block;width:20px;height:20px;flex:none;margin:2px 0 0;accent-color:#007aa9}
.edit-form:has(.class-settings-fields){max-width:850px}
@media(max-width:650px){.class-settings-basic{grid-template-columns:1fr}.class-settings-fields{padding:14px}}

/* Lehrkraft-Zustimmungen: bewusst von vorhandenen Formularen getrennt. */
.consent-kinds{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.consent-kind{border:1px solid #d6e2ea;border-radius:10px;padding:16px;background:#f8fafc}
.consent-kind h3{margin:0 0 10px}.consent-kind p{line-height:1.5}
.consent-form{max-width:1050px}.consent-form>fieldset{padding:20px;border:1px solid #c9d8e2;border-radius:10px;min-width:0}
.consent-form legend{font-weight:650}.consent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:16px 0}
.consent-grid label{display:flex;flex-direction:column;gap:7px;min-width:0}.consent-grid input,.consent-grid select,.consent-grid textarea{width:100%;box-sizing:border-box}
.consent-form .consent-check{display:inline-flex;align-items:center;gap:8px;margin-right:18px}.consent-check input[type=checkbox]{width:auto}
.consent-days{border:0;padding:10px 0;margin:16px 0}.consent-evidence{grid-column:span 2}.consent-page td{overflow-wrap:anywhere;max-width:340px}
@media(max-width:800px){.consent-kinds,.consent-grid{grid-template-columns:1fr}.consent-evidence{grid-column:auto}.consent-form>fieldset{padding:12px}}

/* Einheitliche Links und Aktionen in den Farben des Schulauftritts. */
main a,main a:visited{color:#006486;text-decoration-color:#a8d4e3;text-underline-offset:3px}
main a:hover{color:#004d6b;text-decoration-color:#009bd6}
main a.school-action,main a.school-action:visited,main a.compact-section-link,main a.compact-section-link:visited{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 13px;border:1px solid #b6d6e2;border-radius:7px;background:#edf7fb;color:#005675;font-weight:600;font-size:.9rem;line-height:1.3;text-decoration:none;vertical-align:middle;box-shadow:0 1px 2px #17304408;transition:background-color .15s,border-color .15s,box-shadow .15s}
main a.school-action:hover,main a.compact-section-link:hover{background:#d9f1fa;border-color:#69b7d3;color:#00465f;box-shadow:0 2px 5px #17304412}
main a.school-action:focus-visible,main a.compact-section-link:focus-visible{outline:3px solid #005d85;outline-offset:3px}
main a.school-action--primary,main a.school-action--primary:visited{background:#007da8;border-color:#007da8;color:#fff}
main a.school-action--primary:hover{background:#00678d;border-color:#00678d;color:#fff}
main a.school-action.edit-link{font-size:1.25rem;padding:5px 10px;min-width:38px}
main a.compact-section-link{font-size:.78rem;min-height:32px;padding:6px 10px}
.school-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:14px 0}
.school-actions--stack{flex-direction:column;align-items:stretch;gap:7px;margin:0}
.records td{vertical-align:middle}.records .school-action{white-space:nowrap}
.consent-kind{display:flex;flex-direction:column;border-top:3px solid #009bd6}
.consent-kind .school-action{align-self:flex-start;margin-top:auto}
.consent-kind p{margin-bottom:20px}
.consent-page .class-planning-stage{padding:15px 18px;border:1px solid #d2e5ed;border-left:4px solid #afca05;border-radius:7px;background:#f6fbfd}
.consent-page .class-planning-stage p{margin-bottom:0}
.consent-form textarea{font:inherit;color:#1c2f3b;padding:10px;border:1px solid #a8bdc7;border-radius:5px}
#zustimmung{scroll-margin-top:20px}
@media(prefers-reduced-motion:reduce){main a.school-action{transition:none}}

/* Read-only planning review; statuses always have text as well as color. */
.audit-notice{padding:15px 18px;border:1px solid #d2e5ed;border-left:4px solid #afca05;border-radius:7px;background:#f6fbfd}.audit-notice p{margin-bottom:0}
.audit-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.audit-summary>div{padding:16px;border:1px solid #d2e5ed;border-radius:8px;background:#f5fbfd}.audit-summary strong{display:block;font-size:1.8rem;color:#153c50}.audit-summary span{display:block}
.audit-table{min-width:880px}.audit-table td{vertical-align:top}.audit-table th:nth-child(1){width:18%}.audit-table th:nth-child(2){width:12%}.audit-table th:nth-child(3){width:12%}.audit-table th:nth-child(4){width:44%}.audit-table th:nth-child(5){width:14%}
.audit-status{display:inline-block;padding:4px 7px;margin-bottom:8px;font-size:.78rem;font-weight:700;border-radius:5px}.audit-status--violation{color:#872934;background:#fbe9eb}.audit-status--unknown{color:#735411;background:#fff3cd}
.audit-table details{margin-top:10px}.audit-table summary{cursor:pointer;color:#005675}.audit-table details p{font-size:.9rem;line-height:1.7}.audit-table .school-actions{margin:0}
@media(max-width:650px){.audit-summary{grid-template-columns:1fr}.audit-summary>div{padding:12px}.audit-summary strong{font-size:1.45rem}}

/* Common objective ranking, 0.11 */
.objective-page{max-width:1250px}.objective-cards{display:grid;gap:16px}.objective-card{border:1px solid #d3e1e6;border-top:3px solid #00a0c3;border-radius:9px;padding:18px;background:#f8fbfc}.objective-card h3{display:inline;font-size:1.08rem}.objective-area{display:block;color:#526c76;text-transform:uppercase;font-size:.75rem;letter-spacing:.06em;margin-bottom:6px}.objective-controls{display:flex;flex-wrap:wrap;align-items:center;gap:16px}.objective-controls label{margin:0}.objective-rank{max-width:80px}.objective-move{display:flex;gap:5px}.objective-weight{flex:1;min-width:170px}.objective-weight input{display:block;width:100%}.objective-weight output{font-weight:700;margin-left:8px}.objective-hard{display:flex;align-items:center;gap:8px}.objective-hard input{width:auto}.objective-effective{border-left:4px solid #b6c900}.objective-effective li{padding:5px 0}.objective-move button{min-width:38px}.objective-card:focus-within{outline:2px solid #0083a5;outline-offset:2px}


/* 0.11.1: gemeinsame Feldhöhe und bündige Formularaktionen. Kleine
   Tabellenfelder, Raster-Schaltflächen und Info-Symbole bleiben eigenständig. */
:root{--form-control-height:2.875rem}
form.grid{grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr))}
form.grid>label,.class-picker>label{margin:0;min-width:0}
form.grid>div{min-width:0}
form.grid+form.grid{margin-top:16px}
.class-picker>label{flex:1 1 270px}
:is(form.grid,.class-picker,.edit-form,.consent-grid,.import-card form,.account-form,.calculation-form) :is(input:not([type]),input[type=text],input[type=number],input[type=date],input[type=time],input[type=email],input[type=password],select:not([multiple])){
    height:var(--form-control-height);min-width:0;max-width:100%;line-height:1.5
}
form.grid>button,.class-picker>button,.import-card form>button{
    min-height:var(--form-control-height);max-width:100%;margin:0;line-height:1.5;padding:10px 17px
}
.import-card input[type=file]{min-height:var(--form-control-height);min-width:0;max-width:100%}
.import-card h2 span{flex-shrink:0}
.import-card h2{margin:0 0 16px}
.import-card>p{margin:0 0 16px}
.consent-grid label{margin:0}

/* Rang, Pfeile und Regler teilen sich eine Kontrollzeile. */
.objective-controls{display:grid;grid-template-columns:64px 92px minmax(140px,1fr) 220px;align-items:end;gap:12px 16px}
.objective-controls>label{min-width:0}
.objective-rank{height:var(--form-control-height)}
.objective-move{height:var(--form-control-height);align-items:center;justify-content:center;gap:6px}
.objective-move button{display:inline-flex;align-items:center;justify-content:center;width:43px;height:var(--form-control-height);padding:0;line-height:1}
.objective-weight{min-width:0}
.objective-weight input[type=range]{height:var(--form-control-height);margin:5px 0 0;padding:0;border:0;background:transparent;accent-color:#007da8;cursor:pointer}
.objective-hard,.objective-controls>span{display:flex;align-items:center;min-height:var(--form-control-height)}
.objective-hard input[type=checkbox]{flex:none;width:18px;height:18px;margin:0;accent-color:#007da8}
@media(max-width:1150px){
    .objective-controls{grid-template-columns:64px 92px minmax(140px,1fr)}
    .objective-hard,.objective-controls>span{grid-column:1/-1;min-height:32px}
}
@media(max-width:520px){
    .objective-weight{grid-column:1/-1}
    .objective-controls{grid-template-columns:64px minmax(92px,1fr)}
    .objective-move{justify-content:flex-start}
    .class-picker>button{width:100%}
}


/* Blockzeiträume: vorbereitende Stammdaten, keine Änderung am A/B-Planer. */
.block-settings{min-width:0;margin:18px 0;padding:18px;border:1px solid #b6d6e2;border-radius:8px;background:#f6fbfd}
.block-settings legend{color:#005675}
.block-settings [hidden]{display:none!important}
.block-stage-note{padding:12px 14px;border-left:4px solid #afca05;background:#f8fbe9;border-radius:5px}
.block-period-row{display:grid;grid-template-columns:92px minmax(0,1fr) minmax(0,1fr) auto;gap:12px;align-items:end;padding:14px;margin:12px 0;border:1px solid #d2e5ed;border-radius:7px;background:#fff}
.block-period-row>strong{align-self:center;color:#153c50}
.block-settings .block-period-row>label{margin:0;min-width:0}
.block-period-row input{height:var(--form-control-height);min-width:0;width:100%}
.block-period-row button,.block-add{min-height:var(--form-control-height)}
.block-period-row button{line-height:1.5;padding:10px 12px}
.block-settings button:disabled{opacity:.5;cursor:not-allowed}
.block-settings>div>p{font-size:.9rem}
@media(max-width:1100px){.block-period-row{grid-template-columns:repeat(2,minmax(0,1fr))}.block-period-row>strong{grid-column:1/-1}.block-period-row>button{grid-column:1/-1;justify-self:start}}
@media(max-width:480px){.block-settings{padding:12px}.block-period-row{grid-template-columns:1fr;padding:12px}.block-add{width:100%}}


/* Schulkalender-Abgleich direkt an der betroffenen Datumszeile. */
.block-period-row .block-date-error{grid-column:1/-1;margin:0;padding:10px 12px;border-left:3px solid #a32832;border-radius:4px;background:#fff0f1;color:#872934;font-size:.9rem;overflow-wrap:anywhere}
.block-period-row input[aria-invalid=true]{border-color:#a32832}

/* Kompakte Navigation für Handy und Tablet, Desktop weiterhin links. */
.nav-toggle,.nav-toggle[hidden]{display:none}
@media(max-width:1100px){
    .app-shell{grid-template-columns:1fr;gap:12px;padding:12px}
    .app-shell .sidebar{position:sticky;top:0;z-index:30;max-height:none;overflow:visible;padding:8px}
    .nav-toggle:not([hidden]){display:flex;align-items:center;gap:10px;width:100%;min-height:46px;margin:0;padding:10px 13px;border:1px solid #b6d6e2;border-radius:6px;background:#edf7fb;color:#005675;text-align:left}
    .nav-toggle:hover{background:#d9f1fa}
    .nav-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;flex:none}
    .nav-toggle-indicator{margin-left:auto;font-size:1.2rem;line-height:1}
    .nav-open .nav-toggle-indicator{transform:rotate(180deg)}
    .sidebar nav{display:grid;grid-template-columns:1fr;gap:9px}
    .sidebar nav .nav-home{grid-column:1/-1}
    .sidebar[data-nav-ready] nav{display:none}
    .sidebar[data-nav-ready].nav-open nav{display:grid;margin-top:10px;max-height:65vh;max-height:65dvh;overflow-y:auto;overscroll-behavior:contain}
    .sidebar nav a{min-height:42px;display:flex;align-items:center}
}
@media(max-width:560px){.sidebar nav,.sidebar[data-nav-ready].nav-open nav{grid-template-columns:1fr}}
@media print{.nav-toggle,.sidebar{display:none!important}.app-shell{display:block}}

/* Class form: distinct, consistent evening section. */
.evening-settings{min-width:0;margin:18px 0;padding:18px;border:1px solid #c6d8b0;border-radius:8px;background:#f8faf2}
.evening-settings legend{color:#496125}
.evening-settings .class-gap-control{margin:0}
@media(max-width:480px){.evening-settings{padding:12px}}

/* Shared label, control and hint rows align class fields even when labels wrap. */
.class-settings-basic{row-gap:8px;}
.class-settings-basic>div{display:grid;grid-row:span 3;grid-template-rows:minmax(30px,auto) auto 1fr;grid-template-rows:subgrid;min-width:0;}
.class-settings-basic>div>.control-with-help{min-height:30px;align-items:center;}
.class-settings-basic>div>:is(input,select){margin:0;height:var(--form-control-height,46px);box-sizing:border-box;min-width:0;max-width:100%;}
.class-settings-basic>div>p{margin:0;}

/* UX basis: preserve school colors; improve primary control readability. */
.plan-empty-state{border-left:4px solid #009bd6;background:#f5fbfe}.audit-incomplete{border-left:4px solid #a56b0a;background:#fff8e8;padding:12px 15px;color:#62440c}.audit-incomplete p{margin:5px 0 0}

/* List search is a local view, independent of input and save forms. */
.list-search-tools[hidden],.list-search-empty[hidden],[data-list-row][hidden],[data-list-total][hidden]{display:none!important}
.list-search-tools{margin:14px 0 18px;padding:14px;border:1px solid #c9e0ea;border-radius:7px;background:#f3f9fc}
.list-search-controls{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.list-search-controls label{flex:1 1 200px;min-width:0;margin:0}
.list-search-controls input,.list-search-controls select{min-height:46px;margin-top:5px}
.list-search-controls button{min-height:46px;white-space:normal}
.list-search-result{margin:10px 0 0;font-size:.9rem;color:#355665;overflow-wrap:anywhere}
.list-search-empty{margin:9px 0 0;font-weight:600}
.objective-controls>label:first-child{max-width:140px;line-height:1.25}
.objective-controls{grid-template-columns:140px 92px minmax(140px,1fr) 220px}
@media(max-width:1150px){.objective-controls{grid-template-columns:140px 92px minmax(140px,1fr)}}
@media(max-width:520px){.objective-controls{grid-template-columns:140px minmax(92px,1fr)}}
@media(max-width:600px){.list-search-controls{display:grid;grid-template-columns:minmax(0,1fr)}.list-search-controls button{width:100%}}

/* UX package 3: table orientation and compact-screen controls. */
.table-scroll{max-width:100%;isolation:isolate;scroll-padding-inline:12px;scroll-padding-inline-start:calc(var(--table-pin-width,0px) + 12px);overscroll-behavior-x:contain}
.table-scroll:focus-visible{outline:3px solid #005d85;outline-offset:3px}
.table-scroll-tools{display:flex;align-items:center;gap:8px;margin:8px 0;color:#355665;font-size:.85rem}
.table-scroll-tools[hidden]{display:none!important}
.table-scroll-tools>span{flex:1;min-width:0}
.table-scroll-tools>button{flex:none;width:44px;min-height:44px;padding:6px;font-size:1.2rem}
.table-scroll-tools>button:disabled{opacity:.45;cursor:default}
.table-pin-first>thead>tr>:first-child:not([colspan]),.table-pin-first>tbody>tr>:first-child:not([colspan]),.table-pin-first>tfoot>tr>:first-child:not([colspan]){position:sticky;left:0;z-index:2;box-shadow:inset -1px 0 #b6cbd5;background:#fff}
.table-pin-first>thead>tr>:first-child:not([colspan]),.table-pin-first>tbody>tr>th:first-child:not([colspan]),.table-pin-first>tfoot>tr>:first-child:not([colspan]){background:#edf7fb}
@media(max-width:1100px){
    .scroll{max-width:100%}
    main :is(button,.school-action,.edit-link){min-height:44px}
    main a.school-action.edit-link{min-width:44px}
    button.planning-help-trigger{width:44px;height:44px;min-width:44px}
    .sidebar nav a{min-height:44px}
    main input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),main select,main textarea{font-size:16px;max-width:100%}
    main input[type=range]{min-height:44px}
    .objective-move{gap:8px}
    .objective-move button{width:44px;min-width:44px}
    .planning-help-top{position:sticky;top:-24px;background:#fff;z-index:2;padding:8px 0;border-bottom:1px solid #dce8ee}
    .planning-help-dialog .planning-help-close{min-height:44px}
    .planning-help-dialog,.unsaved-dialog{position:fixed;inset:auto;left:50%;top:calc(var(--ux-visible-top,0px) + var(--ux-visible-height,100dvh)/2);transform:translate(-50%,-50%);margin:0;max-height:calc(var(--ux-visible-height,100dvh) - 24px);max-width:calc(100vw - 24px);overflow-y:auto;overscroll-behavior:contain}
    .unsaved-notice{bottom:calc(var(--ux-covered-bottom,0px) + 12px + env(safe-area-inset-bottom,0px))}
    main :is(input,select,textarea,button,a){scroll-margin-top:88px;scroll-margin-bottom:140px}
}
@media(max-width:600px){
    .app-shell main{min-width:0}
    .class-picker>label{min-width:0;max-width:100%;flex-basis:100%}
    form.grid{grid-template-columns:minmax(0,1fr)}
    .objective-card{padding:14px}
    .objective-controls{grid-template-columns:minmax(0,1fr) 96px;gap:12px}
    .objective-controls .objective-hard,.objective-weight{grid-column:1/-1;min-width:0}
    .teacher-plan-grid th:first-child,.availability-grid th:first-child{width:110px;white-space:normal}
    .time-profile-grid th:first-child{width:110px}
    .rule-save-bar{align-items:stretch}
    .table-scroll-tools{font-size:.8rem}
}
@media(max-width:480px){.planning-help-top{top:-18px}.planning-help-kicker{font-size:.7rem}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
@media print{.table-scroll-tools{display:none!important}.table-pin-first tr>:first-child{position:static!important;box-shadow:none!important}}

/* One persistent header; measured offsets also cover wrapped labels and zoom. */
@media screen{
 html[data-header-layout="sticky"]{scroll-padding-top:calc(var(--app-header-height,0px) + 12px)}
 html[data-header-layout="sticky"] .app-header{position:sticky;top:0;z-index:50;box-shadow:0 3px 12px #17304422}
 html[data-header-layout] .app-shell .sidebar{top:calc(var(--app-header-height,0px) + 14px);max-height:var(--app-nav-space,calc(100dvh - 100px))}
 html[data-header-layout="static"] .app-shell .sidebar{position:static;max-height:none}
 html[data-header-layout] main :is(input,select,textarea,button,a){scroll-margin-top:12px}
 .app-header .theme-panel{max-height:var(--app-nav-space,70dvh);overflow-y:auto}
}
@media screen and (max-width:1100px){
 .app-header[data-header-nav]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;padding:8px 12px}
 .app-header[data-header-nav] .brand{grid-column:1;grid-row:1;min-width:0}
 .app-header[data-header-nav] .brand span{display:none}
 .app-header[data-header-nav] .brand img{width:175px;max-width:100%}
 .app-header[data-header-nav] .header-actions{display:contents}
 .app-header[data-header-nav] .header-user-actions{grid-column:2;grid-row:1;gap:6px}
 .app-header[data-header-nav] .header-calculate{display:none}
 .app-header[data-header-nav] .header-back{grid-column:1/-1;justify-self:start;text-align:left;font-size:.85rem;overflow-wrap:anywhere}
 .app-header .nav-toggle:not([hidden]){display:flex;width:auto;height:44px;min-height:44px;padding:8px 10px;margin:0;font-size:.9rem}
 .app-header .nav-toggle[aria-expanded="true"] .nav-toggle-indicator{transform:rotate(180deg)}
 .app-shell .sidebar[data-header-nav]{display:none}
 .app-shell .sidebar[data-header-nav].nav-open{display:block;position:fixed;top:calc(var(--app-header-height,0px) + 8px);left:12px;right:12px;z-index:45;width:auto;max-height:var(--app-nav-space,65dvh);overflow-y:auto;overscroll-behavior:contain;box-shadow:0 6px 20px #17304433}
 .sidebar[data-header-nav].nav-open nav{display:grid;margin-top:0;max-height:none;overflow:visible}
 html[data-header-layout="static"] .app-shell .sidebar[data-header-nav].nav-open{position:static;max-height:none;width:100%}
 .app-shell .sidebar:not([data-nav-ready]){position:static;max-height:none}
}
@media screen and (max-width:650px){
 .app-header .nav-toggle:not([hidden]){width:44px;padding:0;justify-content:center;gap:0}
 .app-header .nav-toggle>span{display:none}
 .app-header[data-header-nav] .brand img{width:clamp(72px,calc(100vw - 226px),175px)}
}
@media print{
 .app-header{position:static!important;box-shadow:none}
 .app-header .nav-toggle{display:none!important}
 html{scroll-padding-top:0}
}

/* Course assignment: same controls and school palette as the class editor. */
.course-band-form{display:flex;flex-direction:column;gap:.5rem;min-width:13rem;margin:0}.course-band-form label{margin:0}.course-band-form button{margin:0}.course-band-form small{white-space:normal;max-width:20rem}.course-legacy-table td{vertical-align:top}.course-legacy-table .school-actions{margin-top:.5rem}

/* Plan overview: existing school colors, readable status and navigation. */
.plan-navigation,.plan-week-choice{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;margin:1rem 0}.plan-navigation>span:not(.school-action){font-weight:700}.plan-navigation [aria-disabled="true"]{opacity:.55;cursor:default}.plan-week-choice [aria-current="page"]{border-width:2px;font-weight:700;text-decoration:underline;text-underline-offset:.2em}.plan-overview-table small{display:block;font-weight:400;margin-top:.35rem}.plan-overview-table td{vertical-align:top}.plan-overview-table td:last-child .school-action{margin-bottom:.5rem}.plan-state{display:inline-block;border:1px solid currentColor;border-radius:.4rem;padding:.2rem .45rem;font-weight:700}.plan-state--attention{border-left-width:4px}.plan-coverage h2{font-size:1.15rem}.plan-coverage .school-action{margin:.2rem}
[data-week-view="A"] #woche-B,[data-week-view="B"] #woche-A{display:none}
@media(max-width:600px){.plan-navigation{display:grid;grid-template-columns:1fr auto 1fr;gap:.4rem}.plan-navigation>a:last-child{grid-column:1/-1}.plan-navigation .school-action{min-width:0;padding:.6rem .4rem}.plan-week-choice .school-action{flex:1;justify-content:center}}

/* Small information symbol, unchanged generous button target. */
button.planning-help-trigger{border:0;background:transparent;color:#fff}
button.planning-help-trigger:hover{background:transparent;color:#fff}
button.planning-help-trigger > span{display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;border-radius:50%;background:#007c9e;color:#fff;font:italic 700 15px/1 Georgia,serif}
button.planning-help-trigger:hover > span{background:#005d7a}
.class-create-profile{grid-column:1/-1;min-width:0;margin:12px 0;padding:16px;border:1px solid #a9cfdf;border-radius:8px}
.class-create-profile[hidden]{display:none}
.class-create-profile .profile-cell{display:flex;align-items:center;justify-content:center;min-height:44px;margin:0;cursor:pointer}
.class-create-profile input[type="checkbox"]{width:20px;height:20px;margin:0;accent-color:#007c9e}
.class-create-profile td:has(input:disabled){opacity:.5}
#klassenliste{scroll-margin-top:20px}

.teacher-create-form .teacher-create-basics{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));align-items:end;gap:12px}
.teacher-create-basics>label{margin:0;min-width:0}
.teacher-create-basics input{height:44px}
.teacher-create-wishes{margin:18px 0;border:1px solid #a9cfdf;border-radius:8px;padding:12px;min-width:0}
.teacher-create-wishes>summary{display:flex;align-items:center;gap:12px;width:fit-content;max-width:100%;min-height:44px;padding:10px 16px;list-style:none;border:1px solid #007aa9;border-radius:6px;background:#007aa9;color:#fff;font-weight:700;cursor:pointer}
.teacher-create-wishes>summary::-webkit-details-marker{display:none}
.teacher-create-wishes>summary::before{content:'+';font-size:1.2rem;line-height:1}
.teacher-create-wishes[open]>summary::before{content:'−'}
.teacher-create-wishes>summary:hover{background:#005d85}
.teacher-create-wishes>summary:focus-visible{outline:3px solid #005d85;outline-offset:3px}
.teacher-create-wishes .teacher-wishes-hint{margin:12px 0 0}
.class-create-profile thead th:not(:first-child){text-align:center}
.class-create-profile .profile-day-toggle{min-height:32px}
.class-create-profile .profile-day-toggle[hidden]{display:none}
@media(max-width:1100px),(pointer:coarse){.class-create-profile .profile-day-toggle{min-height:44px}}

.school-confirm-dialog{position:fixed;inset:0;margin:auto;width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow-y:auto;padding:26px;background:#fff;color:#1c2f3b}
.school-confirm-dialog h2{margin:0 0 16px;font-size:1.35rem;line-height:1.3;color:#153c50}
.school-confirm-dialog p{margin:0;line-height:1.6;overflow-wrap:anywhere}
.school-confirm-dialog .school-confirm-note{margin-top:12px;font-size:.9rem}
.school-confirm-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-top:24px}
.school-confirm-actions button{margin:0;min-height:44px;white-space:normal}
.school-confirm-dialog.school-confirm-danger{border-top-color:#a73737}
@media(max-width:1100px){.school-confirm-dialog{inset:auto;left:50%;top:calc(var(--ux-visible-top,0px) + var(--ux-visible-height,100dvh)/2);transform:translate(-50%,-50%);margin:0;max-height:calc(var(--ux-visible-height,100dvh) - 24px);max-width:calc(100vw - 24px);overscroll-behavior:contain}}
@media(max-width:480px){.school-confirm-dialog{padding:20px}.school-confirm-actions{flex-direction:column}.school-confirm-actions button{width:100%}}
@media print{.school-confirm-dialog{display:none}}
/* Unterrichtsketten: Erfassung in vorhandenen Schulfarben. */
.chain-entry>.mode-button,.chain-actions>.mode-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;border-radius:5px;font-weight:600;text-decoration:none}
.chain-introduction{border-left:4px solid #afca05}
.chain-form fieldset{min-width:0;border:1px solid #b6cbd5;border-radius:7px;padding:16px}
.chain-form legend{font-weight:700;padding:0 8px}
.chain-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:end}
.chain-fields label{margin:0;min-width:0}
.chain-fields select,.chain-fields input:not([type=checkbox]){min-height:44px}
.chain-required{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;min-height:44px;border:1px solid #b6cbd5;border-radius:5px;background:#f1f6f8;cursor:pointer}
.chain-required input[type=checkbox]{display:block;flex:none;width:20px;height:20px;padding:0;margin:2px 0 0;accent-color:#007aa9}
.chain-required>span{min-width:0}
.chain-required small{display:block;font-weight:400;margin-top:4px;color:#536b77}
.chain-required:has(input:disabled){cursor:default}
.chain-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px}
.chain-actions button{min-height:44px}
.chain-list{display:grid;gap:16px}
.chain-card{border:1px solid #b6cbd5;border-left:3px solid #009bd6;border-radius:7px;padding:16px;min-width:0;overflow-wrap:anywhere}
.chain-card h3{margin:0 0 10px}
.chain-card ol{padding-left:24px}
.chain-card li+li{margin-top:8px}
@media(max-width:650px){.chain-fields{grid-template-columns:minmax(0,1fr)}.chain-actions>*{flex:1 1 auto}.chain-form fieldset{padding:12px}}
