:root {
    --navy: #24425c;
    --navy-dark: #173044;
    --paper: #ffffff;
    --background: #f2f5f6;
    --border: #cbd5db;
    --text: #1e2930;
    --muted: #607078;
    --success-bg: #e8f4eb;
    --success-text: #1f6036;
    --error-bg: #fbecec;
    --error-text: #8a2929;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 16px/1.5 Arial, sans-serif; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--navy); color: #fff; padding: 20px 0; }
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; }
.header-brand-block { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; min-width: 0; }
.brand { color: #fff; font-size: 1.6rem; font-weight: 700; text-decoration: none; }
.header-content p { margin: 0; color: #dbe6ec; }
.header-active-plan { margin-left: auto; color: #dbe6ec; font-size: .9rem; line-height: 1.2; text-align: right; }
.site-nav { background: var(--navy-dark); }
.site-nav a { display: inline-block; padding: 12px 15px; color: #fff; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: #41647a; }
main { padding: 28px 0 38px; }
h1, h2 { color: var(--navy-dark); line-height: 1.2; }
h1 { margin: 0 0 10px; font-size: 1.55rem; font-weight: 700; }
.page-title-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; }
.page-title-heading { min-width: 0; }
.page-title-row h1 { display: flex; align-items: center; gap: 4px; margin: 0; }
.page-title-context { margin: 2px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.25; }
.page-title-context--fullscreen { display: none; }
.page-title-row h1 .app-tooltip-icon { align-self: center; margin-left: 2px; }
.panel { margin: 20px 0; padding: 22px; background: var(--paper); border: 1px solid var(--border); border-radius: 4px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { padding: 18px; background: var(--paper); border: 1px solid var(--border); border-radius: 4px; }
.stat strong { display: block; color: var(--navy); font-size: 2rem; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr); align-items: center; gap: 28px; padding: clamp(28px, 5vw, 60px); border-radius: 12px; background: linear-gradient(125deg, #fff, #e8f1f4); border: 1px solid var(--border); }
.home-hero h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.home-hero p { max-width: 56ch; }
.home-hero .button { display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; vertical-align: middle; }
.home-hero-mark { display: grid; gap: 9px; transform: rotate(-4deg); }
.home-hero-mark span { display: block; padding: 11px 16px; border-left: 5px solid #d79a56; border-radius: 5px; background: #fff; box-shadow: 0 4px 15px rgb(36 66 92 / .08); font-weight: 700; }
.home-hero-mark span:nth-child(2) { margin-left: 18px; border-color: #6e9b86; }
.home-hero-mark span:nth-child(3) { margin-left: 36px; border-color: #6381a6; }
.home-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.home-features article { padding: 18px 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 8px; }
.home-features h2 { margin: 0 0 6px; font-size: 1.1rem; }
.home-features p { margin: 0; color: var(--muted); }
@media (max-width: 680px) { .home-hero { grid-template-columns: 1fr; } .home-hero-mark { display: none; } .home-features { grid-template-columns: 1fr; } }
.auth-panel { width: min(100%, 520px); margin: 20px auto; }
.auth-panel .auth-form { display: grid; gap: 14px; }
.auth-panel .auth-form > label { min-width: 0; margin: 0; }
.auth-panel .auth-form > button { justify-self: start; margin-top: 4px; }
.auth-panel .auth-links { margin-bottom: 0; font-size: .9rem; }
@media (max-width: 520px) { .auth-panel { padding: 18px; } }
.message { margin: 0 0 20px; padding: 13px 16px; border-radius: 4px; }
.message.success { background: var(--success-bg); color: var(--success-text); border: 1px solid #b7ddc0; }
.message.error, .errors { background: var(--error-bg); color: var(--error-text); border: 1px solid #e5bbbb; }
.message.school-import-room-conflicts { background: #fff8e7; color: #634610; border: 1px solid #e7c883; margin: 10px 0; padding: 9px 12px; }
.errors { padding: 12px 16px; }
.errors ul { margin: 0; }
.plan-conflict-details { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .875rem; line-height: 1.35; }
.plan-conflict-details li + li { margin-top: .18rem; }
#teacher-plan-conflicts .message { margin-bottom: 12px; padding: 6px 9px; font-size: .82rem; }
#teacher-plan-conflicts .message > p { margin: 0 0 1px; line-height: 1.2; }
#teacher-plan-conflicts .plan-conflict-details { margin-top: 1px; line-height: 1.2; }
#teacher-plan-conflicts .plan-conflict-details li + li { margin-top: 1px; }
form .form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
label { display: block; font-weight: 700; }
input, select { width: 100%; margin-top: 5px; padding: 9px; border: 1px solid #9eafb9; border-radius: 3px; font: inherit; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 0.88rem; font-weight: 400; }
.subject-color-field { position: relative; min-width: 0; }
.subject-color-label { margin: 0; }
.subject-color-control { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 6px; margin-top: 3px; }
.subject-color-preview { flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid #9eafb9; border-radius: 3px; background: var(--subject-color-preview); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
button.subject-color-preview { min-height: 28px; margin: 0; padding: 0; color: transparent; cursor: pointer; }
button.subject-color-preview:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.subject-color-reset { width: auto; margin: 0; padding: 2px 0; border: 0; background: transparent; color: var(--navy); font-size: .78rem; text-decoration: underline; }
.subject-color-reset:disabled { opacity: .58; cursor: default; }
.subject-color-palette { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; width: max-content; padding: 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--paper); box-shadow: 0 5px 14px rgb(23 48 68 / .2); }
.subject-color-palette[hidden] { display: none !important; }
.subject-color-swatch-grid { display: grid; grid-template-columns: repeat(5, 30px); gap: 6px; }
.subject-color-palette-footer { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--border); text-align: left; }
.subject-color-swatch { width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--subject-color); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18); }
.subject-color-swatch:hover { filter: brightness(.92); }
.subject-color-swatch[aria-pressed="true"] { border-color: var(--navy-dark); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--navy); }
.subject-color-swatch:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
@media (max-width: 760px) { .admin-compact-page .subject-color-preview { flex-basis: 32px; width: 32px; height: 32px; } }
.checkbox { display: flex; align-items: center; gap: 8px; padding-top: 30px; }
.checkbox input { width: auto; margin: 0; }
.form-state-row { margin-top: 16px; }
.form-state-row .checkbox { padding-top: 0; }
.after-school-groups-page .form-state-row { margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 9px; border: 1px solid var(--navy); border-radius: 3px; background: var(--navy); color: #fff; font: inherit; font-size: .875rem; line-height: 1.2; text-decoration: none; cursor: pointer; }
button.secondary, .button.secondary { background: #fff; color: var(--navy); }
button.danger { background: #8a2929; border-color: #8a2929; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #e8eef1; color: var(--navy-dark); }
.muted { color: var(--muted); }
.status-inactive { color: #7c3a10; }
.inline-form { display: inline; }
.compact-plan-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.compact-plan-filter label { min-width: 240px; font-size: 0.9rem; }
.compact-plan-filter select { padding: 6px 8px; }
.compact-plan-filter button { padding: 6px 10px; }
.save-status { min-height: 1.5em; color: var(--success-text); font-weight: 700; }
.error-text { color: var(--error-text); }
.warning-text { color: #7c3a10; }
.app-tooltip { position: fixed; z-index: 2000; box-sizing: border-box; max-width: min(340px, calc(100vw - 16px)); padding: 6px 8px; border: 1px solid #52636c; border-radius: 4px; background: #27343a; box-shadow: 0 3px 10px rgb(22 38 45 / 0.25); color: #fff; font-size: 0.76rem; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; pointer-events: none; white-space: pre-line; }
.app-tooltip[hidden] { display: none !important; }
.app-tooltip--info { border-color: #5f8fb8; background: #eaf3fb; color: #1f537d; }
.app-tooltip--success { border-color: #669d74; background: #edf8ef; color: #275c35; }
.app-tooltip--warning { border-color: #d79a56; background: #fff5e8; color: #82501d; }
.app-tooltip--error { border-color: #c77878; background: #fff0f0; color: var(--error-text); }
.info-tooltip-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--navy); font: inherit; font-size: 0.82rem; line-height: 1; vertical-align: middle; }
.info-tooltip-button:hover { background: #e4eff2; color: var(--navy-dark); }
.info-tooltip-button:focus { outline: 2px solid var(--navy); outline-offset: 2px; }
/* Kompaktowy plan graficzny */
.graphic-plan-title-row,.graphic-plan-controls,.graphic-plan-switches,.graphic-plan-days,.graphic-density,.graphic-plan-class-filters,.graphic-plan-legend{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.graphic-plan-title-row{justify-content:space-between}.graphic-plan-controls{justify-content:space-between;padding:10px 12px}.graphic-plan-controls form{display:flex;align-items:end;gap:8px}.graphic-plan-controls label{margin:0}.graphic-plan-controls select{min-width:180px}.graphic-plan-controls a[aria-current="page"],.graphic-density button[aria-pressed="true"]{background:var(--navy);color:#fff}.graphic-plan-class-filters{margin-left:auto;justify-content:flex-end}.graphic-plan-shell{padding:0;overflow:hidden}.graphic-plan-scroll{overflow:auto;max-height:calc(100vh - 235px);overscroll-behavior:contain}.graphic-plan-grid{border-collapse:separate;border-spacing:0;min-width:100%;width:100%;table-layout:fixed}.graphic-plan-grid th,.graphic-plan-grid td{border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.graphic-plan-grid thead th{position:sticky;top:0;z-index:4;background:#eaf1f4;min-width:86px;max-width:86px;padding:7px 4px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.graphic-plan-grid .graphic-plan-time-head{left:0;z-index:6;min-width:68px;max-width:68px}.graphic-plan-time{position:sticky;left:0;z-index:3;background:#f5f8fa;min-width:68px;max-width:68px;text-align:center;padding:4px}.graphic-plan-time strong,.graphic-plan-time small{display:block}.graphic-plan-time strong{font-size:16px}.graphic-plan-time small{font-size:10px;white-space:nowrap}.graphic-plan-cell{width:86px;min-width:86px;max-width:86px;height:auto;padding:2px;vertical-align:top;background:#fff}.graphic-plan-cell.has-overlap{background:#fff7ed}.graphic-lesson{position:relative;display:block;min-height:58px;margin:0 0 2px;padding:4px 4px 3px;border:1px solid color-mix(in srgb,var(--graphic-subject) 72%,#64748b);border-left:4px solid var(--graphic-subject);border-radius:5px;background:color-mix(in srgb,var(--graphic-subject) 22%,#fff);color:#172033;text-decoration:none;overflow:hidden}.graphic-lesson:hover{transform:translateY(-1px);box-shadow:0 3px 8px rgba(15,23,42,.18);text-decoration:none}.graphic-lesson strong,.graphic-lesson span,.graphic-lesson small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.graphic-lesson strong{font-size:11px;line-height:1.15}.graphic-lesson span{font-size:10px;line-height:1.2}.graphic-lesson small{font-size:9px;color:#475569}.graphic-lesson.is-conflict{border:2px solid #dc2626;border-left-width:5px}.graphic-lesson b{position:absolute;right:2px;top:1px;color:#b91c1c}.graphic-plan-shell[data-density="comfortable"] .graphic-plan-grid thead th,.graphic-plan-shell[data-density="comfortable"] .graphic-plan-cell{min-width:125px;max-width:125px;width:125px}.graphic-plan-shell[data-density="comfortable"] .graphic-plan-cell{height:auto;padding:4px}.graphic-plan-shell[data-density="comfortable"] .graphic-lesson{min-height:76px;padding:7px}.graphic-plan-shell[data-density="comfortable"] .graphic-lesson strong{font-size:13px}.graphic-plan-shell[data-density="comfortable"] .graphic-lesson span{font-size:12px}.graphic-lesson small{font-size:9px;color:#475569}.graphic-plan-shell[data-density="comfortable"] .graphic-lesson small{font-size:11px}.graphic-plan-legend{padding:8px 12px;margin:0;font-size:12px}.graphic-plan-conflict-key{color:#b91c1c}.graphic-plan-shell:fullscreen{background:#fff;padding:10px}.graphic-plan-shell:fullscreen .graphic-plan-scroll{max-height:calc(100vh - 50px)}
@media(max-width:760px){.graphic-plan-title-row{align-items:flex-start}.graphic-plan-controls{display:block}.graphic-plan-controls>*{margin-bottom:8px}.graphic-plan-scroll{max-height:calc(100vh - 285px)}.graphic-plan-grid thead th,.graphic-plan-cell{min-width:78px!important;max-width:78px!important;width:78px!important}}
@media print{.graphic-plan-title-row button,.graphic-plan-controls,.graphic-plan-legend{display:none!important}.graphic-plan-scroll{overflow:visible;max-height:none}.graphic-plan-grid{transform-origin:top left;font-size:8px}.graphic-plan-grid thead th,.graphic-plan-cell{position:static;min-width:55px!important;max-width:55px!important;width:55px!important}.graphic-plan-time,.graphic-plan-time-head{position:static!important}.graphic-lesson{min-height:38px;padding:2px}.graphic-lesson strong{font-size:8px}.graphic-lesson span,.graphic-lesson small{font-size:7px}}
/* Trzy zwarte grupy sterowania Planu graficznego. */
.graphic-plan-controls { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 7px 12px; }
.graphic-plan-control-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-width: 0; padding: 6px 0; }
.graphic-plan-control-row + .graphic-plan-control-row { border-top: 1px solid color-mix(in srgb, var(--border) 76%, transparent); }
.graphic-plan-control-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.graphic-plan-control-caption { color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.graphic-plan-plan-picker { margin-left: auto; }
.graphic-plan-controls .graphic-plan-plan-picker { display: flex; align-items: end; gap: 6px; }
.graphic-plan-controls .graphic-plan-plan-picker label { display: flex; align-items: center; gap: 5px; }
.graphic-plan-controls .graphic-plan-plan-picker select { min-width: 150px; }
.graphic-plan-control-row--layout .graphic-plan-class-filters { margin-left: auto; }
.graphic-plan-wide-divider { align-self: stretch; width: 1px; min-height: 20px; margin: 0 2px; background: var(--border); }
@media(max-width:760px) { .graphic-plan-controls { display: flex; } .graphic-plan-control-row { align-items: flex-start; } .graphic-plan-plan-picker, .graphic-plan-control-row--layout .graphic-plan-class-filters { margin-left: 0; } .graphic-plan-controls > * { margin-bottom: 0; } .graphic-plan-controls .graphic-plan-plan-picker label { align-items: flex-start; flex-direction: column; gap: 3px; } .graphic-plan-controls .graphic-plan-plan-picker select { min-width: min(180px, 100%); } }
/* Plan graficzny: opcjonalne wykorzystanie szerokości okna bez zmiany domyślnego układu. */
body.graphic-plan-wide-view main.container { width: calc(100% - clamp(32px, 3vw, 48px)); max-width: none; }
/* Na dużym monitorze trzy główne plany wykorzystują szerokość okna.
   Pełny ekran pozostaje osobną, uruchamianą przez użytkownika opcją. */
@media (min-width: 1440px) {
    body:has(.after-school-plan-page) main.container,
    body:has(.school-plan-fullscreen-shell) main.container {
        width: calc(100% - clamp(32px, 3vw, 48px));
        max-width: none;
    }
}
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-shell,
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-lesson-editor,
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-lesson-editor .lesson-entry-form-panel { width: 100%; max-width: none; }
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-grid { min-width: 100%; width: 100%; }
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-grid thead th,
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-cell { width: auto; min-width: 86px; max-width: none; }
.graphic-plan-page.graphic-plan-wide-view .graphic-plan-grid .graphic-plan-time-head { width: 68px; min-width: 68px; max-width: 68px; }
.graphic-plan-time .graphic-plan-time-range { line-height: 1.1; white-space: normal; }
.graphic-plan-time .graphic-plan-time-range span { display: block; }
.graphic-plan-cell-entry-layout { width: 100%; min-width: 0; max-width: 100%; container-type: inline-size; }
.graphic-plan-cell-entries { display: grid; gap: 2px; width: 100%; min-width: 0; max-width: 100%; }
.graphic-plan-cell .graphic-lesson { width: 100%; min-width: 0; max-width: 100%; min-height: 0; margin: 0; padding: 3px 3px 2px; overflow: visible; }
.graphic-plan-cell .graphic-lesson strong,
.graphic-plan-cell .graphic-lesson span,
.graphic-plan-cell .graphic-lesson small { min-width: 0; max-width: 100%; }
.graphic-plan-shell[data-density="comfortable"] .graphic-plan-cell .graphic-lesson { min-height: 0; padding: 5px; }
.graphic-plan-grid--classes .graphic-plan-cell-entries--parallel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.graphic-plan-cell-entries--parallel .graphic-lesson { min-width: 0; }
.graphic-plan-page:fullscreen,
.graphic-plan-page.graphic-plan-focus-mode { position: fixed; inset: 0; z-index: 100; width: auto; height: 100vh; margin: 0; padding: 12px; overflow: auto; background: var(--background); }
.graphic-plan-page:fullscreen > .page-title-row,
.graphic-plan-page.graphic-plan-focus-mode > .page-title-row,
.after-school-plan-page:fullscreen > .page-title-row,
.after-school-plan-page.after-school-plan-focus-mode > .page-title-row { position: sticky; top: 0; z-index: 20; margin-bottom: 8px; padding: 3px 0 5px; background: var(--background); }
.graphic-plan-page:fullscreen .graphic-plan-shell,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-shell { margin-right: 0; margin-left: 0; }
.graphic-plan-page:fullscreen .graphic-plan-time .graphic-plan-time-range,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-time .graphic-plan-time-range { white-space: nowrap; }
.graphic-plan-page:fullscreen .graphic-plan-time .graphic-plan-time-range span,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-time .graphic-plan-time-range span { display: inline; }
.graphic-plan-page:fullscreen .graphic-plan-grid--classes,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-grid--classes { min-width: 100%; width: 100%; }
.graphic-plan-page:fullscreen .graphic-plan-grid--classes thead th:not(.graphic-plan-time-head),
.graphic-plan-page:fullscreen .graphic-plan-grid--classes .graphic-plan-cell,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-grid--classes thead th:not(.graphic-plan-time-head),
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-grid--classes .graphic-plan-cell { width: auto; min-width: 120px; max-width: none; }
.graphic-plan-page:fullscreen .graphic-plan-scroll,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-scroll { max-height: none; overflow-x: auto; overflow-y: visible; overscroll-behavior: auto; }
.graphic-plan-page:fullscreen .graphic-plan-shell,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-shell { overflow: visible; }
.graphic-plan-page .graphic-density[hidden] { display: none !important; }
.graphic-plan-page:fullscreen .graphic-density,
.graphic-plan-page.graphic-plan-focus-mode .graphic-density { display: none !important; }
.graphic-plan-week-shell { display: flex; flex-direction: column; gap: 16px; }
.graphic-plan-week-shell .graphic-plan-weekday-section { min-width: 0; }
.graphic-plan-week-shell .graphic-plan-weekday-section > h2 { margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #f2f6f8; font-size: 1rem; }
.graphic-plan-week-shell .graphic-plan-scroll { border: 1px solid var(--border); }
.graphic-after-school-weekday-heading { margin: 14px 0 6px; font-size: .9rem; }
.day-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.plan-weekday-options { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.plan-weekday-options legend { width: auto; }
.plan-weekday-options .checkbox { padding-top: 0; }
.plan-weekday-options .checkbox { padding-top: 0; margin: 0; }
.school-plan-panel { padding: 0; overflow: hidden; }
.school-plan-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 14px 14px 3px; }
.school-plan-panel h2 { margin: 0; }
.school-plan-day-heading, .school-plan-view-controls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.school-plan-day-nav { display: inline-flex; align-items: center; min-height: 22px; padding: 1px 3px; color: var(--navy); font-size: 0.76rem; line-height: 1; text-decoration: none; }
.school-plan-day-nav:hover, .school-plan-day-nav:focus { background: #e8eef1; outline: 1px solid var(--navy); }
.plan-fullscreen-button,
.school-plan-fullscreen-button { min-height: 24px; margin: 0; padding: 3px 6px; font-size: 0.76rem; line-height: 1.1; white-space: nowrap; }
.after-school-plan-page:fullscreen, .after-school-plan-page.after-school-plan-focus-mode { position: fixed; inset: 0; z-index: 100; box-sizing: border-box; width: auto; height: 100vh; margin: 0; padding: 10px; overflow: auto; background: var(--background); }
.after-school-plan-page:fullscreen .after-school-grid-wrap, .after-school-plan-page.after-school-plan-focus-mode .after-school-grid-wrap { max-height: calc(100vh - 260px); }
.school-plan-panel .save-status { display: none; min-height: 0; margin: 0; }
.school-plan-panel .save-status:not(:empty) { display: block; margin: 0 14px 4px; }
.school-plan-wrap { max-height: 70vh; overflow: auto; }
.school-plan-panel:fullscreen, .school-plan-panel.school-plan-focus-mode { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; width: auto; height: 100vh; margin: 0; border-radius: 0; background: var(--paper); }
.school-plan-panel:fullscreen .school-plan-wrap, .school-plan-panel.school-plan-focus-mode .school-plan-wrap { flex: 1 1 auto; max-height: none; overflow: auto; }
.school-plan-fullscreen-shell:fullscreen, .school-plan-fullscreen-shell.school-plan-focus-mode { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; width: auto; height: 100vh; margin: 0; padding: 6px; overflow: hidden; background: var(--paper); }
.school-plan-fullscreen-shell:fullscreen .school-plan-action-bar, .school-plan-fullscreen-shell.school-plan-focus-mode .school-plan-action-bar, .school-plan-fullscreen-shell:fullscreen .school-derived-duty-block-section, .school-plan-fullscreen-shell.school-plan-focus-mode .school-derived-duty-block-section, .school-plan-fullscreen-shell:fullscreen .school-duty-automation-section, .school-plan-fullscreen-shell.school-plan-focus-mode .school-duty-automation-section { flex: 0 0 auto; margin: 0 0 5px; }
.school-plan-fullscreen-shell:fullscreen .school-plan-panel, .school-plan-fullscreen-shell.school-plan-focus-mode .school-plan-panel { display: flex; flex: 1 1 auto; min-height: 0; margin: 0; flex-direction: column; }
.school-plan-fullscreen-shell:fullscreen .school-plan-wrap, .school-plan-fullscreen-shell.school-plan-focus-mode .school-plan-wrap { flex: 1 1 auto; max-height: none; overflow: auto; }
.school-plan-week-host { min-height: 0; }
.school-plan-panel:fullscreen .school-plan-week-host, .school-plan-panel.school-plan-focus-mode .school-plan-week-host, .school-plan-fullscreen-shell:fullscreen .school-plan-week-host, .school-plan-fullscreen-shell.school-plan-focus-mode .school-plan-week-host { flex: 1 1 auto; min-height: 0; overflow: auto; }
.school-plan-panel.school-plan-week-view .school-plan-wrap, .school-plan-fullscreen-shell.school-plan-week-view .school-plan-wrap { flex: none; max-height: none; overflow: auto; }
.school-plan-weekday-section { margin: 0; padding: 0; }
.school-plan-weekday-section > h3 { margin: 0; padding: 5px 8px; border-top: 1px solid #b9c7ce; border-bottom: 1px solid #b9c7ce; background: #edf2f4; color: var(--navy-dark); font-size: 0.8rem; line-height: 1.2; }
.school-plan-week-host:not(:has([data-school-plan-weekday-extra])) .school-plan-weekday-section > h3 { display: none; }
.school-plan-common-scroll { position: sticky; bottom: 0; z-index: 14; box-sizing: border-box; height: 24px; min-height: 24px; margin: 0; padding: 0; overflow-x: auto; overflow-y: hidden; border: 0; border-top: 1px solid #78909c; background: #e8eef1; line-height: 0; scrollbar-color: #567584 #f7fafb; scrollbar-width: auto; }
.school-plan-common-scroll > div { height: 1px; }
.school-plan-common-scroll::-webkit-scrollbar { height: 18px; }
.school-plan-common-scroll::-webkit-scrollbar-track { background: #f7fafb; }
.school-plan-common-scroll::-webkit-scrollbar-thumb { min-width: 44px; border: 3px solid #f7fafb; border-radius: 9px; background: #567584; }
.school-plan-common-scroll-fixed .school-plan-common-scroll { position: fixed; bottom: 0; z-index: 110; box-shadow: 0 -2px 7px rgba(25, 51, 68, 0.16); }
.school-plan-common-horizontal-scroll .school-plan-week-host { padding-bottom: 0; }
.school-plan-common-horizontal-scroll .school-plan-wrap { scrollbar-width: none; }
.school-plan-common-horizontal-scroll .school-plan-wrap::-webkit-scrollbar { height: 0; }
.school-plan-common-scroll-fixed .school-plan-wrap { scroll-padding-bottom: 24px; }
.school-plan-fullscreen-shell.school-plan-common-scroll-fixed .school-plan-week-host { box-sizing: border-box; padding-bottom: 24px; }
.duty-preview-panel { padding: 0; overflow: hidden; }
.duty-preview-selector-panel { padding: 8px 10px; }
.duty-preview-plan-select { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 0.78rem; white-space: nowrap; }
.duty-preview-plan-select select { min-height: 24px; max-width: 280px; margin: 0; padding: 3px 6px; font-size: 0.76rem; }
.duty-preview-scroll-shell { position: relative; }
.duty-preview-scroll-shell.school-plan-common-horizontal-scroll .duty-preview-scroll-target { scrollbar-width: none; }
.duty-preview-scroll-shell.school-plan-common-horizontal-scroll .duty-preview-scroll-target::-webkit-scrollbar { height: 0; }
.duty-preview-table { width: max-content; min-width: 100%; }
.duty-preview-table th, .duty-preview-table td { min-width: 108px; padding: 5px 6px; font-size: 0.78rem; line-height: 1.2; text-align: center; vertical-align: middle; white-space: nowrap; }
.duty-preview-table thead th { background: #e8eef1; }
.duty-preview-table .duty-preview-time-header, .duty-preview-table .duty-preview-time-cell { position: sticky; left: 0; min-width: 205px; width: 205px; text-align: left; }
.duty-preview-table .duty-preview-time-header { z-index: 4; background: #e8eef1; }
.duty-preview-table .duty-preview-time-cell { z-index: 2; background: var(--paper); font-weight: 700; }
.duty-preview-table .duty-preview-location-header { font-size: 0.76rem; }
.duty-preview-table .duty-preview-weekday-row th { padding: 5px 7px; border-top: 1px solid #b9c7ce; border-bottom: 1px solid #b9c7ce; background: #f1f5f6; color: var(--navy); font-size: 0.8rem; font-weight: 700; text-align: left; }
.duty-preview-cell { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.duty-preview-missing, .duty-preview-conflict { color: var(--error-text); font-weight: 700; }
.duty-preview-missing { text-decoration: underline dotted; text-underline-offset: 2px; }
.duty-preview-additional { color: #7c5a1d; }
.duty-preview-additional.duty-preview-conflict { color: var(--error-text); }
.duty-preview-table-tools { display: block; margin: 8px 0; }
.duty-preview-plan-meta { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.25; }
.duty-preview-print-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.duty-preview-print-button { min-height: 26px; margin: 0; padding: 3px 7px; font-size: 0.76rem; line-height: 1.1; white-space: nowrap; }
.duty-preview-print-hint { color: var(--muted); font-size: 0.72rem; line-height: 1.2; }
.duty-preview-print-staffing-alerts { display: none; }
.duty-preview-changes-toggle { display: block; margin: 5px 0 0; font-size: 0.78rem; font-weight: 400; }
.duty-preview-changes-toggle input { width: auto; margin: 0 5px 0 0; }
.duty-preview-show-changes .duty-preview-changed-cell { background: #e2f0ff; }
.duty-change-marker { display: none; align-items: center; justify-content: center; width: 1.2em; height: 1.2em; margin-left: 2px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 0.78em; font-weight: 700; line-height: 1; vertical-align: middle; }
.duty-change-marker.duty-change-marker-added { background: #0f766e; }
.duty-preview-show-changes .duty-change-marker { display: inline-flex; }
.duty-summary-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin: 8px 0; }
.duty-summary-print-actions { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.duty-summary-print-title { display: none; }
.duty-preview-table .duty-preview-time-header, .duty-preview-table .duty-preview-time-cell { min-width: 116px; width: 116px; }
.duty-preview-table .duty-preview-time-cell { white-space: nowrap; }
.duty-preview-table .duty-preview-location-header { min-width: 96px; width: 112px; max-width: 132px; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.duty-preview-table thead th + th, .duty-preview-table tbody tr:not(.duty-preview-weekday-row) td { border-left: 1px solid #dbe3e7; }
@media print {
    @page { size: A4 landscape; margin: 7mm; }
    body { background: #fff; color: #111; font-size: 9pt; }
    .site-header, .site-nav, .site-footer, .duty-preview-selector-panel, .duty-preview-table-tools, .school-plan-common-scroll { display: none !important; }
    .duty-summary-print-actions { display: none !important; }
    .duty-preview-page-title, .duty-preview-print-hint { display: none !important; }
    main.container { width: auto; margin: 0; padding: 0; }
    .duty-preview-panel, .duty-preview-scroll-shell, .duty-preview-scroll-target { display: block; max-height: none !important; padding: 0; overflow: visible !important; border: 0; box-shadow: none; }
    .duty-preview-staffing-alerts { display: none !important; }
    .duty-preview-print-staffing-alerts { display: none !important; }
    body.duty-preview-print-changes-mode.duty-preview-print-alerts-mode .duty-preview-print-staffing-alerts { display: block !important; margin: 0 0 3mm; padding: 2mm 3mm; border: 1px solid #999; color: #111; font-size: 7pt; line-height: 1.15; }
    body.duty-preview-print-changes-mode.duty-preview-print-alerts-mode .duty-preview-print-staffing-alerts ul { margin: 1mm 0 0; padding-left: 5mm; }
    .duty-preview-table { width: 100% !important; min-width: 0; table-layout: fixed; border-collapse: collapse; }
    .duty-preview-table thead { display: table-header-group; }
    .duty-preview-table tbody.duty-preview-day-group { break-inside: avoid-page; page-break-inside: avoid; }
    .duty-preview-table tr { break-inside: avoid; page-break-inside: avoid; }
    .duty-preview-table th, .duty-preview-table td { min-width: 0; padding: 2px 3px; font-size: 7.1pt; line-height: 1.1; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
    .duty-preview-table .duty-preview-time-header, .duty-preview-table .duty-preview-time-cell { position: static; min-width: 0; width: 11%; white-space: nowrap; }
    .duty-preview-table .duty-preview-location-header { min-width: 0; width: auto; max-width: none; white-space: normal; }
    .duty-preview-table .duty-preview-weekday-row th { padding: 2px 3px; background: #e6e6e6 !important; color: #111 !important; }
    .duty-preview-cell { max-width: none; overflow: visible; text-overflow: clip; }
    .duty-preview-missing, .duty-preview-conflict { color: #111 !important; background: transparent !important; font-weight: inherit !important; text-decoration: none !important; }
    .duty-preview-additional { color: #333 !important; }
    .duty-preview-print-changes-mode .duty-preview-changed-cell { background: #e2f0ff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .duty-preview-print-changes-mode .duty-change-marker { display: inline-flex !important; background: #2563eb !important; color: #fff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .duty-preview-print-changes-mode .duty-change-marker.duty-change-marker-added { background: #0f766e !important; }
    body.duty-preview-print-changes-mode.duty-preview-print-alerts-mode .duty-preview-missing, body.duty-preview-print-changes-mode.duty-preview-print-alerts-mode .duty-preview-conflict { background: #e0e0e0 !important; font-weight: 700 !important; text-decoration: underline solid !important; text-underline-offset: 1px; }
    .duty-summary-page { font-size: 9pt; }
    .duty-summary-page > h1, .duty-summary-selector-panel, .duty-summary-table-tools { display: none !important; }
    .duty-summary-page { font-size: 8pt; }
    .duty-summary-page .duty-summary-table-panel { display: block; margin: 0; padding: 0; overflow: visible; border: 0; box-shadow: none; }
    .duty-summary-print-title { display: block; margin: 0 0 3mm; color: #111; font-size: 10pt; font-weight: 700; line-height: 1.15; }
    .duty-summary-table-panel .table-wrap { display: block; overflow: visible !important; }
    .duty-summary-table { width: 100% !important; min-width: 0; table-layout: fixed; border: 1px solid #aebbc1; border-collapse: collapse; font-size: 7.6pt; }
    .duty-summary-table thead { display: table-header-group; }
    .duty-summary-table tr { break-inside: avoid; page-break-inside: avoid; }
    .duty-summary-table th, .duty-summary-table td { min-width: 0; padding: 1.5px 2.5px; border: 1px solid #c5d0d5; line-height: 1.12; }
    .duty-summary-table thead th { background: #e8edef !important; color: #111 !important; font-size: 7.1pt; }
    .duty-summary-table tbody th { width: 37%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .duty-summary-table .duty-summary-number { min-width: 0; width: 8%; }
    .duty-summary-table .duty-summary-day-number { min-width: 0; width: calc(31% / var(--duty-summary-print-day-count)); }
    .duty-summary-table .duty-summary-lessons-number { min-width: 0; width: 8%; }
    .duty-summary-sort-link { color: #111; text-decoration: none; }
    .duty-summary-sort-indicator { display: none; }
    .duty-summary-limit-exceeded { color: #111 !important; }
}
.duty-summary-page { font-size: 0.8125rem; }
.duty-summary-page h1 { margin: 0 0 8px; font-size: 1.35rem; }
.duty-summary-page .panel { margin: 8px 0; padding: 9px 10px; }
.duty-summary-selector-panel { display: inline-block; }
.duty-summary-plan-select { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 0.78rem; white-space: nowrap; }
.duty-summary-plan-select select { min-height: 28px; max-width: 280px; margin: 0; padding: 4px 6px; font-size: 0.8rem; }
.duty-summary-page .duty-summary-table-panel {
    display: block;
    max-width: 100%;
    margin: 8px 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.duty-summary-page .duty-summary-table-panel > .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.duty-summary-table { width: 100%; min-width: 330px; font-size: 0.8rem; }
.duty-summary-table th, .duty-summary-table td { padding: 5px 7px; line-height: 1.2; }
.duty-summary-table thead th { font-size: 0.76rem; }
.duty-summary-table tbody th,
.duty-summary-table tbody td {
    padding: 4px 7px;
    vertical-align: middle;
}
.duty-summary-table tbody th {
    background: transparent;
    white-space: nowrap;
}
.duty-summary-table tbody tr + tr > th,
.duty-summary-table tbody tr + tr > td { border-top: 1px solid #dbe4e8; }
.duty-summary-table tbody tr:nth-child(even) > th,
.duty-summary-table tbody tr:nth-child(even) > td { background: #fbfcfd; }
.duty-summary-table tbody tr:hover > th,
.duty-summary-table tbody tr:hover > td { background: #f2f7f9; }
.duty-summary-number { min-width: 5.5rem; text-align: right; white-space: nowrap; }
.duty-summary-day-number { min-width: 3.5rem; }
.duty-summary-lessons-number { min-width: 4.3rem; }
.duty-summary-weekly-target { margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; white-space: nowrap; cursor: help; }
.duty-summary-weekly-target:focus-visible { outline: 2px solid var(--focus-ring, #2563eb); outline-offset: 2px; border-radius: 2px; }
.duty-summary-sort-link { color: inherit; text-decoration: none; }
.duty-summary-sort-link:hover, .duty-summary-sort-link:focus { color: var(--navy); text-decoration: none; }
.duty-summary-sort-indicator { color: var(--muted); font-size: 0.82em; font-weight: 400; }
.duty-summary-limit-exceeded { color: var(--error-text); font-weight: 700; }
@media (max-width: 760px) { .duty-summary-page .panel { padding: 8px; } .duty-summary-page .duty-summary-table-panel { padding: 0; } .duty-summary-plan-select { align-items: flex-start; flex-direction: column; white-space: normal; } .duty-summary-plan-select select { min-height: 32px; max-width: 100%; } .duty-summary-table { min-width: 300px; } .duty-summary-table th, .duty-summary-table td { padding: 5px 6px; } .duty-summary-table tbody th, .duty-summary-table tbody td { padding: 4px 6px; } }
@media (max-width: 760px) { .duty-preview-table .duty-preview-time-header, .duty-preview-table .duty-preview-time-cell { min-width: 104px; width: 104px; } .duty-preview-table .duty-preview-location-header { min-width: 88px; width: 96px; } .duty-preview-table th, .duty-preview-table td { min-width: 92px; padding: 5px; } }
.school-plan-teacher-rows-mode .school-plan-table { display: none; }
.school-plan-teacher-rows-mode .school-plan-weekday-section { display: none; }
.school-plan-teacher-row-layout { display: none; box-sizing: border-box; width: 100%; min-width: 100%; }
.school-plan-teacher-rows-mode .school-plan-teacher-row-layout { display: block; }
.school-plan-teacher-rows-mode.school-plan-common-horizontal-scroll .school-plan-week-host { scrollbar-width: none; }
.school-plan-teacher-rows-mode.school-plan-common-horizontal-scroll .school-plan-week-host::-webkit-scrollbar { height: 0; }
.school-plan-teacher-rows-table { width: max-content; min-width: 100%; border-collapse: collapse; }
.school-plan-teacher-rows-table th, .school-plan-teacher-rows-table td { min-width: 52px; padding: 4px 5px; border-bottom: 1px solid #cbd5db; text-align: center; vertical-align: middle; }
.school-plan-teacher-rows-table thead th { position: sticky; top: 0; z-index: 3; background: #e8eef1; font-size: 0.7rem; line-height: 1.1; white-space: nowrap; }
.school-plan-teacher-rows-table .school-plan-teacher-row-name { position: sticky; left: 0; z-index: 4; min-width: 172px; padding: 5px 6px; border-right: 1px solid #aebbc1; background: var(--paper); text-align: left; white-space: nowrap; }
.school-plan-teacher-rows-table thead .school-plan-teacher-row-name { z-index: 5; background: #e8eef1; }
.school-plan-teacher-rows-table .school-plan-teacher-row-weekday th { min-width: 0; padding: 4px 7px; border-top: 1px solid #b9c7ce; border-bottom: 1px solid #b9c7ce; background: #edf2f4; color: var(--navy-dark); text-align: left; }
.school-plan-teacher-row-weekday-name { display: inline-block; font-size: 0.78rem; font-weight: 600; line-height: 1.2; }
.school-plan-teacher-row-weekday .school-plan-teacher-row-day-missing { display: inline-flex; flex-wrap: wrap; gap: 3px 5px; align-items: center; margin: 0 0 0 7px; vertical-align: middle; }
.school-plan-teacher-row-weekday .school-plan-preview-missing { display: inline-flex; width: auto; max-width: 100%; margin: 0; }
.school-plan-teacher-rows-table .school-plan-employee-name { display: inline-block; font-size: 0.72rem; font-weight: 600; }
.school-plan-table .school-plan-header-actions, .school-plan-teacher-rows-table .school-plan-header-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 5px auto 0; writing-mode: initial; transform: none; }
.school-plan-teacher-rows-table .school-plan-teacher-row-name .school-plan-header-actions { display: inline-flex; flex-wrap: nowrap; margin: 0 0 0 4px; vertical-align: middle; }
.school-plan-table .school-plan-header-action, .school-plan-teacher-rows-table .school-plan-header-action { display: inline-flex; align-items: center; justify-content: center; width: 20px; min-width: 20px; height: 20px; padding: 0; border: 1px solid #8a2929; border-radius: 3px; background: #fff; color: #8a2929; font-size: 0.73rem; line-height: 1; writing-mode: initial; transform: none; }
.school-plan-teacher-rows-table .plan-cell-controls, .school-plan-teacher-rows-table .school-plan-duty-content { margin: 0; }
.school-plan-teacher-rows-table [data-school-plan-cell] { box-sizing: border-box; width: auto; min-width: 0; max-width: 100%; margin: 0; padding: 1px 2px; font-size: 0.75rem; line-height: 1.2; }
.school-plan-teacher-rows-table [data-school-plan-cell][data-cell-type="lesson"][data-inline-plan-select-open] { width: 46px; }
.school-plan-teacher-rows-table [data-school-plan-cell][data-cell-type="duty"][data-inline-plan-select-open] { width: 24px; }
@media (max-width: 560px) { .school-plan-teacher-rows-table .school-plan-teacher-row-name { min-width: 150px; padding: 4px; } .school-plan-teacher-rows-table th, .school-plan-teacher-rows-table td { min-width: 46px; padding: 3px 4px; } }
.school-plan-table { width: max-content; min-width: 100%; }
.school-plan-table th, .school-plan-table td { min-width: 56px; padding: 8px 7px; text-align: center; vertical-align: middle; }
.school-plan-table .school-plan-time-header, .school-plan-table .school-plan-time-cell { position: sticky; left: 0; min-width: 230px; width: 230px; text-align: left; white-space: nowrap; }
.school-plan-table .school-plan-time-header { top: 0; z-index: 4; background: #e8eef1; }
.school-plan-table .school-plan-time-cell { z-index: 2; background: var(--paper); }
.school-plan-table thead th { position: sticky; top: 0; z-index: 3; height: 178px; padding: 7px 5px; vertical-align: bottom; }
.school-plan-table .school-plan-employee-header { width: 56px; }
.school-plan-table .school-plan-employee-name { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 600; writing-mode: vertical-rl; transform: rotate(180deg); }
.school-plan-table .school-plan-header-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 5px auto 0; writing-mode: initial; transform: none; }
.school-plan-table .school-plan-header-action { display: inline-flex; align-items: center; justify-content: center; width: 20px; min-width: 20px; height: 20px; padding: 0; border: 1px solid #8a2929; border-radius: 3px; background: #fff; color: #8a2929; font-size: 0.73rem; line-height: 1; writing-mode: initial; transform: none; }
.school-plan-table .school-plan-header-actions .school-plan-bulk-confirmation { display: inline-flex; align-items: center; gap: 2px; }
.school-plan-table .school-plan-header-actions .school-plan-bulk-confirmation button { height: 20px; padding: 0 3px; font-size: 0.68rem; line-height: 1; writing-mode: initial; transform: none; white-space: nowrap; }
.school-plan-selector-panel { padding: 8px 10px; }
.school-plan-selector-panel h2 { margin: 0 0 5px; font-size: 0.92rem; }
.school-plan-selector-row, .school-plan-day-links, .school-plan-action-row, .school-duty-automation-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.school-plan-day-links { margin: 0; }
.school-plan-day-links .button { min-height: 24px; padding: 3px 6px; font-size: 0.76rem; line-height: 1.1; }
.school-plan-day-links .button[aria-current="page"] { background: #dce8ed; border-color: #78909c; color: var(--navy); }
.school-plan-plan-select { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 0.78rem; white-space: nowrap; }
.school-plan-plan-select select { min-height: 24px; max-width: 240px; margin: 0; padding: 3px 6px; font-size: 0.76rem; }
.school-plan-action-bar { padding: 6px 8px; border-color: #e5bbbb; }
.school-plan-action-button, .school-plan-bulk-confirmation > button { min-height: 24px; margin: 0; padding: 3px 6px; font-size: 0.76rem; line-height: 1.1; white-space: nowrap; }
.school-plan-version-section { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; margin: 4px 0 6px; padding: 5px 7px; border: 1px solid #aab9c1; border-radius: 3px; background: #f8fbfc; }
.school-plan-version-form { display: flex; flex: 1 1 480px; flex-wrap: nowrap; align-items: flex-end; gap: 4px 6px; min-width: 0; margin: 0; }
.school-plan-version-form input { box-sizing: border-box; flex: 1 1 auto; min-width: 0; min-height: 24px; margin: 0; padding: 3px 6px; font-size: 0.76rem; }
.school-plan-version-actions { display: inline-flex; flex: 0 0 auto; flex-wrap: nowrap; align-self: flex-end; align-items: flex-end; gap: 4px; white-space: nowrap; }
.school-plan-version-actions .school-plan-action-button { flex: 0 0 auto; }
.school-plan-version-status { display: none; flex-basis: 100%; margin: 0; color: var(--muted); font-size: 0.74rem; line-height: 1.2; }
.school-plan-version-status:not(:empty) { display: block; }
.school-plan-bulk-confirmation { display: inline-flex; align-items: center; gap: 4px; }
.school-plan-bulk-question { color: var(--muted); font-size: 0.74rem; line-height: 1.1; }
.school-plan-bulk-note { max-width: 330px; color: var(--muted); font-size: 0.7rem; line-height: 1.15; }
.school-plan-header-action-neutral { border-color: #9eafb9; color: var(--navy); }
.teacher-plan-selector-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.teacher-plan-selector-form label { min-width: 0; }
.teacher-plan-selector-form select { width: 100%; }
.teacher-plan-action-bar { margin: 10px 0; padding: 7px 9px; border-color: #e5bbbb; }
.teacher-plan-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.teacher-plan-action-row > .teacher-plan-action-button,
.teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 9px; border: 1px solid #c77878; border-radius: 3px; background: #fff7f7; color: var(--error-text); line-height: 1.2; text-decoration: none; }
.teacher-plan-action-row > .teacher-plan-action-button:hover,
.teacher-plan-action-row > .teacher-plan-action-button:focus-visible,
.teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:hover,
.teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:focus-visible { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-plan-action-row .school-plan-bulk-confirmation { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px; border: 1px solid #e1b0b0; border-radius: 4px; background: #fff7f7; }
.teacher-plan-action-button, .teacher-plan-action-bar .school-plan-bulk-confirmation > button { min-height: 24px; margin: 0; padding: 3px 6px; font-size: 0.76rem; line-height: 1.1; white-space: nowrap; }
.teacher-derived-duty-block-section, .school-derived-duty-block-section { margin: 4px 0 6px; padding: 5px 7px; border: 1px solid #aab9c1; border-radius: 3px; background: #f8fbfc; }
.teacher-derived-duty-block-content, .school-derived-duty-block-content { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.teacher-derived-duty-block-section p, .school-derived-duty-block-section p { margin: 0; color: var(--muted); font-size: 0.74rem; line-height: 1.2; }
.teacher-derived-duty-block-section .school-plan-bulk-confirmation > button, .school-derived-duty-block-section .school-plan-bulk-confirmation > button { min-height: 24px; margin: 0; padding: 3px 6px; font-size: 0.76rem; line-height: 1.1; white-space: nowrap; }
.school-duty-automation-section { min-width: 0; max-width: 100%; margin: 8px 0; padding: 7px 9px; border-color: #9eafb9; box-sizing: border-box; }
.school-duty-automation-section h2 { margin: 0 0 5px; font-size: 0.9rem; }
.school-duty-automation-preferences { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; margin: 0 0 5px; }
.school-duty-automation-preference { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 0.75rem; line-height: 1.15; white-space: nowrap; }
.school-duty-automation-preference input { width: 13px; height: 13px; margin: 0; }
.school-duty-automation-help { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.25; }
.school-duty-automation-panel { min-width: 0; max-width: 100%; margin-top: 5px; font-size: 0.78rem; overflow-wrap: anywhere; }
.school-duty-automation-status, .teacher-derived-duty-block-status { display: none; min-width: 0; max-width: 100%; margin: 4px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
.school-duty-automation-status:not(:empty), .teacher-derived-duty-block-status:not(:empty) { display: block; }
.school-duty-automation-panel p, .school-duty-automation-panel ul, .school-duty-automation-panel li { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.school-duty-automation-panel p { margin: 4px 0; }
.school-duty-automation-panel ul { margin: 4px 0; padding-left: 18px; color: var(--error-text); }
.school-duty-automation-warning-toggle { max-width: 100%; margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 520px) {
    .school-plan-version-form { flex-basis: 100%; flex-wrap: wrap; }
    .school-plan-version-form input { flex-basis: 100%; }
    .school-plan-version-actions { width: 100%; }
}
.employee-minutes-value { display: block; }
.employee-limits-summary { display: block; margin-top: 2px; color: var(--muted); font-size: 0.72rem; line-height: 1.25; white-space: nowrap; }
.employee-duty-summary { display: block; white-space: nowrap; }
.employee-list-table .employee-duty-limit-exceeded, .teacher-plan-grid-panel .teacher-plan-duty-limit-exceeded { color: var(--error-text); font-weight: 700; }
.school-plan-table .school-plan-time-cell span { color: var(--muted); font-weight: 400; }
.school-plan-table th, .school-plan-table td { min-width: 50px; padding: 5px 5px; font-size: 0.86rem; }
.school-plan-table .school-plan-time-header, .school-plan-table .school-plan-time-cell { min-width: 190px; width: 190px; padding-right: 3px; font-size: 0.84rem; }
.school-plan-table thead .school-plan-employee-header + .school-plan-employee-header, .school-plan-table tbody td + td { border-left: 1px solid #d6dfe4; }
.school-plan-table thead th { height: 164px; padding: 5px 4px; }
.school-plan-table .school-plan-display { min-width: 25px; height: 22px; padding: 0 4px; font-size: 0.78rem; }
.school-plan-table .school-plan-lesson-with-class { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 28px; height: auto; padding: 2px 4px; gap: 1px; font-size: 0.69rem; line-height: 1.05; text-align: center; white-space: nowrap; }
.school-plan-lesson-class-code, .school-plan-lesson-room-code { display: block; }
.school-plan-table .school-plan-display.school-plan-add-button { width: 22px; min-width: 22px; }
.school-plan-table .duty-block-button { width: 20px; min-width: 20px; height: 20px; font-size: 0.73rem; }
.school-plan-table .school-plan-room-option-occupied, .teacher-plan-table .school-plan-room-option-occupied { color: var(--error-text); background: #fbecec; }
.school-plan-table .school-plan-room-option-preferred:not(.school-plan-room-option-occupied),
.teacher-plan-table option.school-plan-room-option-preferred:not(.school-plan-room-option-occupied),
.teacher-plan-table .plan-choice-option.school-plan-room-option-preferred:not(.plan-choice-option-full) { color: #275c35; background: #eef8ef; }
.school-plan-break-row th, .school-plan-break-row td, .teacher-plan-break-row td { padding-top: 5px; padding-bottom: 5px; background: #f4f7f8; color: var(--muted); font-size: 0.92rem; }
.school-plan-break-row .school-plan-time-cell { background: #f4f7f8; }
.school-plan-table .school-plan-break-row th, .school-plan-table .school-plan-break-row td { padding-top: 3px; padding-bottom: 3px; font-size: 0.78rem; line-height: 1.2; }
.teacher-plan-lesson-row td:first-child, .teacher-plan-break-row td:first-child { min-width: 230px; white-space: nowrap; }
.teacher-plan-table select, .school-plan-table [data-school-plan-cell] { min-width: 0; margin-top: 0; padding: 4px 6px; font-size: 0.88rem; line-height: 1.25; }
.teacher-plan-table .plan-grid-choice.plan-choice-inline-select-open { width: 52px; max-width: 52px; }
.teacher-plan-table [data-lesson-cell][data-inline-plan-select-open], .teacher-plan-table [data-duty-cell][data-inline-plan-select-open], .school-plan-table [data-school-plan-cell][data-inline-plan-select-open] { box-sizing: border-box; min-width: 0; max-width: 100%; height: 24px; margin: 0; padding: 1px 2px; font-size: 0.75rem; }
.teacher-plan-table [data-lesson-cell][data-inline-plan-select-open], .teacher-plan-table [data-duty-cell][data-inline-plan-select-open] { width: 52px; }
.school-plan-table [data-school-plan-cell][data-cell-type="lesson"][data-inline-plan-select-open] { width: 46px; }
.school-plan-table [data-school-plan-cell][data-cell-type="duty"][data-inline-plan-select-open] { width: 24px; }
.plan-cell-conflict { background: #fbecec !important; color: var(--error-text) !important; }
.school-plan-editable-cell { padding: 3px !important; }
.school-plan-display { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 28px; height: 24px; padding: 0 5px; border: 1px solid #9eafb9; border-radius: 3px; background: #fff; color: inherit; font: inherit; font-size: 0.82rem; line-height: 1; cursor: pointer; }
.school-plan-display:hover, .school-plan-display:focus { background: #dce8ed; outline: 1px solid var(--navy); }
.school-plan-display.school-plan-add-button { width: 24px; min-width: 24px; padding: 0; }
.school-plan-display.school-plan-add-button:hover, .school-plan-display.school-plan-add-button:focus { background: #e8eef1; }
.school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-room-assigned, .teacher-plan-table td:not(.plan-cell-conflict) .teacher-plan-room-assigned { border-color: #669d74; background: #f1f8f2; color: #275c35; }
.school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-room-assigned, .school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-display.school-plan-room-assigned { border-left: 4px solid var(--lesson-subject-color, #669d74); }
.school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-room-assigned:hover, .school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-room-assigned:focus, .teacher-plan-table td:not(.plan-cell-conflict) .teacher-plan-room-assigned:hover, .teacher-plan-table td:not(.plan-cell-conflict) .teacher-plan-room-assigned:focus { background: #f6fbf7; outline-color: #467d53; }
.school-plan-table .school-plan-editable-cell.plan-cell-conflict .school-plan-room-assigned, .teacher-plan-table td.plan-cell-conflict .teacher-plan-room-assigned { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-duty-assigned, .teacher-plan-table td:not(.plan-cell-conflict) .teacher-plan-duty-assigned { border-color: #5f8fb8; background: #f1f7fc; color: #1f5d91; }
.school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-duty-assigned:hover, .school-plan-table .school-plan-editable-cell:not(.plan-cell-conflict) .school-plan-duty-assigned:focus, .teacher-plan-table td:not(.plan-cell-conflict) .teacher-plan-duty-assigned:hover, .teacher-plan-table td:not(.plan-cell-conflict) .teacher-plan-duty-assigned:focus { background: #e5f1fa; outline-color: #4378a6; }
.school-plan-table .school-plan-editable-cell.plan-cell-conflict .school-plan-duty-assigned, .teacher-plan-table td.plan-cell-conflict .teacher-plan-duty-assigned { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.plan-cell-controls { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.school-plan-duty-content { gap: 4px; }
.school-plan-duty-content .school-plan-display { width: auto; min-width: 24px; }
.school-plan-preview-duty, .school-plan-preview-missing { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 4px; border: 1px dashed #607f8e; border-radius: 3px; background: #f4f8fa; color: var(--navy); font-size: 0.78rem; line-height: 1; white-space: nowrap; }
.school-plan-preview-forced, .school-plan-preview-missing { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.school-plan-table .school-plan-preview-missing-list { display: flex; flex-wrap: wrap; gap: 3px 5px; align-items: center; margin-top: 2px; white-space: normal; }
.school-plan-table .school-plan-preview-missing { display: inline-flex; width: auto; max-width: 100%; margin-top: 0; overflow: hidden; text-overflow: ellipsis; }
.duty-block-control { position: relative; display: inline-block; margin-left: 0; vertical-align: middle; }
.duty-block-button { width: 21px; min-width: 21px; height: 21px; padding: 0; border: 1px solid #9eafb9; border-radius: 3px; background: #fff; color: var(--navy); font-size: 0.78rem; line-height: 1; }
.duty-block-button:hover, .duty-block-button:focus { background: #e8eef1; outline: 1px solid var(--navy); }
.school-plan-table .duty-block-button-blocked, .teacher-plan-table .duty-block-button-blocked, .school-plan-teacher-rows-table .duty-block-button-blocked, .school-plan-table .plan-cell-conflict .duty-block-button-blocked, .teacher-plan-table .plan-cell-conflict .duty-block-button-blocked, .school-plan-teacher-rows-table .plan-cell-conflict .duty-block-button-blocked { border: 1px solid var(--error-text); background: #fbecec; color: var(--error-text); font-weight: 700; }
.duty-block-panel { position: absolute; z-index: 12; top: calc(100% + 3px); right: 0; box-sizing: border-box; width: 230px; max-width: calc(100vw - 24px); min-width: 0; padding: 8px; border: 1px solid #78909c; border-radius: 3px; background: #fff; box-shadow: 0 3px 10px rgba(25, 51, 68, 0.2); text-align: left; color: var(--text); }
.duty-block-panel *, .duty-block-panel *::before, .duty-block-panel *::after { box-sizing: border-box; }
.duty-block-panel label { display: block; min-width: 0; font-size: 0.8rem; }
.duty-block-panel input { display: block; width: 100%; max-width: 100%; min-width: 0; margin: 2px 0 0; padding: 5px 6px; font-size: 0.85rem; }
.duty-block-actions { display: flex; flex-wrap: wrap; min-width: 0; gap: 5px; align-items: center; margin-top: 6px; }
.duty-block-actions button { padding: 5px 7px; font-size: 0.8rem; white-space: nowrap; }
.plan-grid-choice { display: inline-block; vertical-align: middle; }
.plan-grid-choice .plan-grid-trigger { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 28px; height: 24px; padding: 0 5px; border: 1px solid #9eafb9; border-radius: 3px; background: #fff; font-size: 0.82rem; line-height: 1; text-align: center; overflow: visible; }
.plan-grid-choice .plan-grid-add-button { width: 24px; min-width: 24px; padding: 0; }
.teacher-plan-table .plan-choice-menu { min-width: 220px; }
.teacher-duty-block-form { padding-top: 14px; padding-bottom: 14px; }
.teacher-duty-block-form h2 { margin: 0 0 4px; font-size: 1.05rem; }
.teacher-duty-block-form .muted { margin: 0 0 8px; font-size: 0.84rem; }
.teacher-duty-block-options { display: flex; flex-wrap: wrap; gap: 5px 10px; min-width: 0; margin: 7px 0; padding: 6px 8px; border: 1px solid var(--border); }
.teacher-duty-block-options legend { padding: 0 3px; color: var(--navy-dark); font-size: 0.78rem; font-weight: 700; }
.teacher-duty-block-options .checkbox { display: inline-flex; align-items: center; gap: 4px; padding: 0; font-size: 0.78rem; font-weight: 400; white-space: nowrap; }
.teacher-duty-block-options .checkbox input { width: auto; margin: 0; }
.teacher-duty-block-options .teacher-duty-block-select-all, .duty-block-break-options .duty-block-select-all { font-weight: 700; }
.teacher-duty-block-bottom-row { display: flex; flex-wrap: wrap; align-items: end; gap: 7px 10px; }
.teacher-duty-block-bottom-row label { min-width: 0; flex: 1 1 220px; font-size: 0.78rem; }
.teacher-duty-block-bottom-row input { min-height: 28px; margin-top: 2px; padding: 4px 6px; font-size: 0.82rem; }
.teacher-duty-block-bottom-row button { min-height: 28px; padding: 4px 8px; font-size: 0.82rem; }
.teacher-plan-grid-panel { margin-top: 8px; padding-top: 10px; }
.teacher-plan-grid-panel > h2 { margin: 0 0 3px; font-size: 1rem; }
.teacher-plan-grid-panel > .teacher-plan-duty-summary { margin: 0 0 3px; color: var(--muted); font-size: 0.78rem; line-height: 1.25; }
.teacher-plan-grid-panel > .save-status { margin: 0 0 4px; }
.duty-block-current-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); align-items: start; gap: 8px 10px; font-size: 0.8rem; }
.duty-block-day-group { margin: 0; }
.duty-block-day-group h3 { margin: 0 0 3px; font-size: 0.84rem; }
.duty-block-day-rows { display: grid; gap: 2px; }
.duty-block-current-row { display: grid; gap: 2px; padding: 2px 0 4px; border-bottom: 1px solid #e4eaed; }
.duty-block-current-break { white-space: nowrap; }
.duty-block-current-actions { display: flex; align-items: baseline; justify-content: space-between; gap: 5px 8px; min-width: 0; }
.duty-block-current-reason { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.duty-block-delete-form { margin: 0; }
.duty-block-delete-link { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--error-text); font: inherit; text-decoration: none; }
.duty-block-delete-link:hover, .duty-block-delete-link:focus { color: #8d1c1c; background: transparent; outline: 1px solid var(--error-text); }
.plan-choice { position: relative; }
.plan-choice-trigger { width: 100%; min-width: 0; padding: 4px 6px; border: 1px solid #9eafb9; background: #fff; color: inherit; font: inherit; line-height: 1.25; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-choice-trigger:hover, .plan-choice-trigger:focus { background: #dce8ed; outline: 1px solid var(--navy); }
.plan-choice-menu { position: absolute; z-index: 10; top: calc(100% + 2px); left: 0; min-width: 230px; max-width: 360px; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid #78909c; border-radius: 3px; background: #fff; box-shadow: 0 3px 10px rgba(25, 51, 68, 0.2); }
.plan-choice-option { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 2px; background: transparent; color: var(--text); font: inherit; font-size: 0.88rem; text-align: left; white-space: nowrap; }
.plan-choice-option:hover, .plan-choice-option:focus { background: #dce8ed; outline: 1px solid var(--navy); }
.plan-choice-option-full { color: var(--error-text); background: #fbecec; }
.plan-choice-option-full:hover, .plan-choice-option-full:focus { background: #f4dada; }
.school-plan-mobile-note { display: none; color: var(--muted); }
.site-footer { padding: 22px 0; color: var(--muted); border-top: 1px solid var(--border); }
.site-footer .footer-content { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.site-footer .footer-author { color: var(--muted); font-size: 0.8em; opacity: 0.8; }
@media (max-width: 760px) { .header-content, form .form-grid, .grid { display: block; } .header-content p { margin-top: 4px; } .grid > *, form .form-grid > * { margin-bottom: 14px; } .site-nav a { padding-left: 9px; padding-right: 9px; } .school-plan-mobile-note { display: block; } }

@media (max-width: 760px) {
    .teacher-duty-block-form .teacher-duty-block-bottom-row { align-items: stretch; }
    .teacher-duty-block-bottom-row button { min-height: 32px; }
    .teacher-plan-selector-form { grid-template-columns: 1fr; gap: 10px; }
    .duty-block-current-list { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

.admin-compact-page { font-size: 0.8125rem; }

.plan-compact-page { font-size: 0.8125rem; }
.plan-compact-page > .panel { margin: 8px 0; padding: 10px 12px; }
.plan-compact-page h2 { margin: 0 0 7px; font-size: 1rem; }
.plan-compact-page p { margin: 5px 0; line-height: 1.3; }
.plan-compact-page .form-grid { gap: 7px 10px; }
.plan-compact-page .plan-settings-panel form .form-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 220px)); }
.plan-compact-page .plan-settings-panel .form-grid label { max-width: 220px; }
.plan-compact-page label, .plan-compact-page legend { font-size: 0.76rem; }
.plan-compact-page input:not([type="hidden"]), .plan-compact-page select { width: 100%; max-width: 220px; min-height: 28px; padding: 4px 6px; font-size: 0.8rem; }
.plan-compact-page input[type="checkbox"] { width: auto; max-width: none; min-height: 0; padding: 0; }
.plan-compact-page button, .plan-compact-page .button { min-height: 28px; padding: 4px 8px; font-size: 0.78rem; }
.plan-compact-page .plan-weekday-options { margin: 7px 0; padding: 6px 8px; }
.plan-compact-page .actions { gap: 5px; margin: 7px 0 0; }
.plan-compact-page .grid { gap: 7px; }
.plan-compact-page .stat { min-width: 0; padding: 7px; font-size: 0.76rem; }
.plan-compact-page .stat strong { margin-bottom: 1px; font-size: 1.05rem; }
.plan-compact-page .table-wrap { margin-top: 6px; }
.plan-compact-page table th, .plan-compact-page table td { padding: 4px 6px; font-size: 0.76rem; line-height: 1.25; }
@media (max-width: 760px) { .plan-compact-page form .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; } .plan-compact-page .form-grid > * { margin-bottom: 0; } .plan-compact-page input:not([type="hidden"]), .plan-compact-page select, .plan-compact-page button, .plan-compact-page .button { min-height: 32px; } }
.admin-compact-page .class-page-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; margin-bottom: 8px; }
.admin-compact-page .class-page-heading h1 { margin: 0; }
.admin-compact-page h2 { margin: 0 0 8px; font-size: 1.05rem; }
.admin-compact-page .panel { margin: 10px 0; padding: 12px; }
.admin-compact-page .class-groups-section { margin: 18px 0 12px; scroll-margin-top: 12px; }
.admin-compact-page .class-groups-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
.admin-compact-page .class-groups-heading h2 { margin: 0; }
.admin-compact-page .class-groups-heading .muted { margin: 0; }
.admin-compact-page .class-groups-description { margin: 2px 0 8px; }
.admin-compact-page .class-groups-table-wrap { margin-top: 12px; }
.admin-compact-page .class-groups-section form[hidden] { display: none !important; }
.admin-compact-page .message, .admin-compact-page .errors { font-size: 1rem; }
.admin-compact-page form .form-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 8px 10px; }
.admin-compact-page label { font-size: 0.78rem; }
.admin-compact-page input, .admin-compact-page select { min-height: 28px; margin-top: 3px; padding: 4px 6px; font-size: 0.8rem; line-height: 1.2; }
.admin-compact-page .class-form-layout { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.admin-compact-page .class-form-row { display: grid; align-items: end; gap: 8px 10px; min-width: 0; }
.admin-compact-page .class-form-row--basic, .admin-compact-page .class-form-row--schedule { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-compact-page .class-form-row--teachers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-compact-page .class-form-field { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.admin-compact-page .class-form-field > label { min-width: 0; margin: 0; }
.admin-compact-page .control-with-info { display: flex; align-items: center; gap: 6px; min-width: 0; }
.admin-compact-page .control-with-info > input, .admin-compact-page .control-with-info > select { flex: 1 1 auto; width: auto; min-width: 0; }
.admin-compact-page button.info-tooltip-button { display: inline-flex; flex: 0 0 18px; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 3px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--navy); font-size: 0.78rem; line-height: 1; box-shadow: none; }
.admin-compact-page button.info-tooltip-button:hover { border: 0; border-radius: 50%; background: #e4eff2; color: var(--navy-dark); box-shadow: none; }
.admin-compact-page button.info-tooltip-button:focus { border: 0; border-radius: 50%; background: transparent; color: var(--navy-dark); outline: 2px solid var(--navy); outline-offset: 2px; box-shadow: none; }
.admin-compact-page .class-form-row--checks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding-top: 7px; }
.admin-compact-page .class-checkbox-control { display: inline-flex; align-items: center; gap: 4px; min-width: 0; margin: 0; }
.admin-compact-page .class-form-row--checks .checkbox { display: inline-flex; align-items: center; gap: 5px; min-width: 0; margin: 0; padding: 0; white-space: nowrap; }
.admin-compact-page .class-form-row--checks .checkbox input { flex: 0 0 auto; width: auto; min-height: 0; margin: 0; }
.admin-compact-page .class-form-row--checks .info-tooltip-button { margin-top: 0; }
.admin-compact-page .checkbox { gap: 5px; padding-top: 19px; font-size: 0.78rem; }
.admin-compact-page .checkbox input { min-height: 0; }
.admin-compact-page .field-hint { margin-top: 2px; font-size: 0.72rem; }
.admin-compact-page .actions { gap: 6px; margin-top: 10px; }
.admin-compact-page button, .admin-compact-page .button { min-height: 28px; padding: 4px 7px; font-size: 0.78rem; line-height: 1.15; }
.admin-compact-page table { font-size: 0.78rem; line-height: 1.2; }
.admin-compact-page th, .admin-compact-page td { padding: 5px 6px; }
.admin-compact-page th { font-size: 0.75rem; }
.admin-compact-page td a { font-size: 0.76rem; }
.admin-compact-page .inline-form button { min-height: 28px; padding: 3px 5px; font-size: 0.73rem; }
.admin-compact-page .admin-table-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.admin-compact-page .admin-table-actions .inline-form { display: inline-flex; margin: 0; }
.admin-compact-page .admin-table-actions .row-delete-question { font-size: 0.73rem; white-space: nowrap; }
.admin-compact-page .admin-table-actions a { color: var(--navy); text-decoration: none; }
.admin-compact-page .admin-table-actions { gap: 0; }
.admin-compact-page .admin-table-actions > * + *::before { display: inline-block; margin: 0 0.38rem; color: var(--muted); content: "·"; text-decoration: none; }
.admin-compact-page .admin-table-actions .inline-form { align-items: center; }
.admin-table-actions button,
.admin-compact-page .admin-table-actions .row-action { min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; color: var(--navy); font: inherit; font-size: 0.76rem; line-height: inherit; text-decoration: none; }
.admin-table-actions button:hover,
.admin-table-actions button:focus,
.admin-table-actions .row-action:hover,
.admin-compact-page .admin-table-actions .row-action:focus { background: transparent; color: var(--navy-dark); outline: 1px solid currentColor; }
.admin-table-actions .row-action-warning,
.admin-compact-page .admin-table-actions button.danger { color: var(--error-text); }
.admin-table-actions .row-action-positive { color: #28633c; }
.admin-compact-page .sortable-controls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: max-content; }
.admin-compact-page .sortable-step { min-height: 24px; margin: 0; padding: 2px 5px; border: 1px solid #b6c6cc; border-radius: 3px; background: #fff; color: var(--navy); font-size: 0.7rem; line-height: 1; }
.admin-compact-page .sortable-step:hover, .admin-compact-page .sortable-step:focus { background: #e4eff2; outline: 1px solid var(--navy); }
.admin-compact-page .sortable-step:disabled { border-color: #d8dfdf; background: #f4f6f5; color: #8b9699; cursor: not-allowed; outline: 0; }
.admin-compact-page .employee-limit-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 8px; }
.admin-compact-page .employee-limit-fields label { min-width: 0; }
.admin-compact-page .employee-page-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.admin-compact-page .employee-page-heading h1 { margin-bottom: 0; }
.admin-compact-page .employee-page-heading a { color: var(--navy); font-size: 0.78rem; text-decoration: none; }
.admin-compact-page .employee-duty-defaults-link { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 7px; border: 1px solid #91a9b5; border-radius: 3px; background: #f5f9fa; color: var(--navy-dark); font-weight: 700; text-decoration: none; }
.admin-compact-page .employee-duty-defaults-link:hover, .admin-compact-page .employee-duty-defaults-link:focus { background: #e4eff2; outline: 1px solid var(--navy); text-decoration: none; }
.admin-compact-page .employee-list-table { width: 100%; min-width: 980px; table-layout: auto; }
.admin-compact-page .employee-list-table tbody tr:nth-child(even) > th,
.admin-compact-page .employee-list-table tbody tr:nth-child(even) > td { background:#f7fafb; }
.admin-compact-page .employee-list-table tbody tr + tr > th,
.admin-compact-page .employee-list-table tbody tr + tr > td { border-top:1px solid #cbd9df; }
.admin-compact-page .employee-list-table tbody tr:hover > th,
.admin-compact-page .employee-list-table tbody tr:hover > td { background:#eef5f7; }
.admin-compact-page .employee-list-table .employee-name { min-width: 140px; }
.admin-compact-page .employee-list-table .employee-name > span { font-weight:600; }
.admin-compact-page .employee-list-table .employee-subjects { min-width: 190px; max-width: 280px; }
.admin-compact-page form.after-school-group-form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.after-school-group-class-picker { grid-column:1 / -1; max-width:680px; min-width:0; }
.after-school-group-class-picker summary { min-height:32px; padding:6px 9px; border:1px solid #aebfc7; border-radius:4px; background:#fff; cursor:pointer; font-weight:600; }
.after-school-group-class-picker[open] summary { border-bottom-right-radius:0; border-bottom-left-radius:0; }
.after-school-group-class-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 12px; max-height:280px; padding:8px 9px; overflow-y:auto; border:1px solid #aebfc7; border-top:0; border-bottom-right-radius:4px; border-bottom-left-radius:4px; background:#fff; }
.after-school-group-class-options label { display:flex; align-items:center; min-height:34px; gap:7px; margin:0; font-weight:400; }
.after-school-group-class-options .after-school-group-class-heading { grid-column:1 / -1; margin-top:5px; color:var(--muted); font-size:.74rem; font-weight:600; }
.after-school-group-class-options input[type="checkbox"] { flex:0 0 auto; width:17px; min-width:17px; height:17px; min-height:17px; margin:0; padding:0; }
.after-school-group-class-list { display:grid; gap:2px; }
.after-school-group-status-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:#a2aeb4; vertical-align:middle; }
.after-school-group-status-dot--active { background:#26824d; }
@media (max-width:760px) { .admin-compact-page form.after-school-group-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .after-school-group-class-options { grid-template-columns:minmax(0,1fr); } }
@media (max-width:560px) { .admin-compact-page form.after-school-group-form-grid { grid-template-columns:minmax(0,1fr); } }
.admin-compact-page .employee-subject-list { display:grid; gap:2px; }
.admin-compact-page .employee-subject-list-row { display:block; overflow-wrap:anywhere; }
.admin-compact-page .employee-subject-list-name { font-weight:600; }
.admin-compact-page .employee-subject-list-room { color:var(--muted); }
.admin-compact-page .employee-list-table .employee-status { width: 48px; min-width: 48px; padding-right: 4px; padding-left: 4px; text-align: center; white-space: nowrap; }
.admin-compact-page .employee-list-table .employee-duty-limits { min-width: 190px; }
.admin-compact-page .employee-list-table .employee-limits-summary { white-space: normal; }
.admin-compact-page .employee-list-table .employee-role-hours { min-width: 176px; max-width:240px; vertical-align:middle; }
.employee-role-hours-list { display:grid; gap:4px; min-width:0; }
.employee-role-hours-row { display:block; min-width:0; font-size:.82rem; font-weight:400; line-height:1.25; overflow-wrap:anywhere; }
.employee-role-hours-target { color:var(--muted); white-space:nowrap; }
.admin-compact-page .employee-list-table .employee-actions { min-width: 205px; padding-left: 4px; white-space: nowrap; }
.admin-compact-page .employee-list-table .employee-actions .admin-table-actions { width: max-content; flex-wrap: nowrap; gap: 0; }
.admin-compact-page .employee-list-table .employee-actions .row-action-separator { margin-right: .22rem; margin-left: .22rem; }
.admin-compact-page .employee-status-dot { display: inline-block; width: 11px; height: 11px; border: 1px solid rgba(23, 48, 68, .28); border-radius: 50%; vertical-align: middle; }
.admin-compact-page .employee-status-dot--active { background: #3f9a5f; box-shadow: 0 0 0 2px #e5f4e9; }
.admin-compact-page .employee-status-dot--inactive { background: #9aa7ad; box-shadow: 0 0 0 2px #eef1f2; }
.admin-compact-page .class-status { width: 48px; min-width: 48px; padding-right: 4px; padding-left: 4px; text-align: center; white-space: nowrap; }
.admin-compact-page .class-status-dot { display: inline-block; width: 11px; height: 11px; border: 1px solid rgba(23, 48, 68, .28); border-radius: 50%; vertical-align: middle; }
.admin-compact-page .class-status-dot--active { background: #3f9a5f; box-shadow: 0 0 0 2px #e5f4e9; }
.admin-compact-page .class-status-dot--inactive { background: #9aa7ad; box-shadow: 0 0 0 2px #eef1f2; }
.admin-compact-page .employee-action-link { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--navy); font: inherit; font-size: 0.76rem; line-height: inherit; text-decoration: none; }
.admin-compact-page .employee-action-link:hover, .admin-compact-page .employee-action-link:focus { background: transparent; color: var(--navy-dark); outline: 1px solid var(--navy); }
.admin-compact-page .employee-support-teacher-description { color: var(--muted); font-size: 0.72rem; font-weight: 400; line-height: 1.2; }
.admin-compact-page .compact-plan-filter { gap: 6px; margin-bottom: 8px; }
.admin-compact-page .compact-plan-filter label { min-width: 190px; font-size: 0.78rem; }
.admin-compact-page .compact-plan-filter select { padding: 4px 6px; }
.admin-compact-page .employee-list-filter { align-items: flex-end; }
.admin-compact-page .employee-list-filter > .admin-action { margin: 0 0 4px; }
#employee-list-filters { scroll-margin-top: 1rem; }
.admin-compact-page .plan-weekday-options { gap: 6px 10px; padding: 8px; }
.admin-compact-page .plan-weekday-options .checkbox { padding-top: 0; }
.admin-compact-page .duty-location-break-options { margin: 8px 0 0; padding: 7px 8px; }
.admin-compact-page .duty-location-break-options .checkbox { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 0.76rem; font-weight: 400; white-space: nowrap; }
.admin-compact-page .duty-location-break-options .checkbox input { width: auto; min-height: 0; margin: 0; }
.admin-compact-page .duty-location-break-select-all { font-weight: 700 !important; }
.admin-compact-page .duty-locations-table .duty-location-break-column { width: 5.5rem; max-width: 5.5rem; padding-left: 4px; padding-right: 4px; text-align: center; white-space: nowrap; }
.admin-compact-page .duty-location-break-status { display: inline-block; min-width: 3.6rem; padding: 1px 4px; border: 1px solid transparent; border-radius: 3px; font-size: 0.73rem; line-height: 1.2; text-align: center; }
.admin-compact-page .duty-location-break-status-full { color: var(--muted); background: #f4f6f5; border-color: #d8dfdb; }
.admin-compact-page .duty-location-break-status-partial { color: #365f69; background: #edf6f7; border-color: #b8d4d8; }
.admin-compact-page .duty-location-break-status-none { color: #76581d; background: #fff8e7; border-color: #dfcf9d; }
.admin-compact-page .duty-block-delete-link { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--error-text); font: inherit; text-decoration: none; }
.admin-compact-page .duty-block-delete-link:hover, .admin-compact-page .duty-block-delete-link:focus { color: #8d1c1c; background: transparent; outline: 1px solid var(--error-text); }
.admin-compact-page .sortable-list-status { min-height: 0; margin: 0 0 4px; color: var(--muted); font-size: 0.76rem; }
.admin-compact-page .sortable-list-status:empty { display: none; }
.admin-compact-page .sortable-list-status-error { color: var(--error-text); }
.admin-compact-page .sortable-handle { min-height: 24px; margin: 0; padding: 2px 5px; border: 1px solid #91a9b5; border-radius: 3px; background: #f8fbfc; color: var(--navy); font-size: 0.7rem; line-height: 1; cursor: grab; white-space: nowrap; }
.admin-compact-page .sortable-handle:hover, .admin-compact-page .sortable-handle:focus { background: #e4eff2; outline: 1px solid var(--navy); }
.admin-compact-page .sortable-handle:active { cursor: grabbing; }
.admin-compact-page .zone-preference-add-form { margin: 0 0 8px; }
.admin-compact-page .zone-preference-add-control { min-width: 0; }
.admin-compact-page .zone-preference-add-control > label { display: block; margin: 0; }
.admin-compact-page .zone-preference-add-row { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 3px; }
.admin-compact-page .zone-preference-add-row select { flex: 1 1 auto; min-width: 0; width: auto; margin-top: 0; }
.admin-compact-page .zone-preference-add-row button { flex: 0 0 auto; margin: 0; }
.admin-compact-page .zone-preference-table .zone-preference-sortable-handle { display: inline-flex; align-items: center; justify-content: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; margin: 0; padding: 0; color: var(--navy); }
.admin-compact-page .zone-preference-sortable-handle svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.admin-compact-page .sortable-row-dragging { opacity: 0.55; }
.admin-compact-page .sortable-row-drop-target > td { box-shadow: inset 0 2px 0 var(--navy); }
.lesson-periods-compact-page .panel { margin: 7px 0; padding: 9px 10px; }
.lesson-periods-compact-page h1 { margin: 0 0 7px; font-size: 1.35rem; }
.lesson-periods-compact-page h2 { margin-bottom: 5px; font-size: 0.95rem; }
.lesson-periods-compact-page .form-grid { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 6px 8px; }
.lesson-periods-compact-page input[type="time"] { width: 100%; max-width: 108px; }
.lesson-periods-compact-page input[type="number"] { width: 76px; }
.lesson-periods-compact-page .actions { margin-top: 7px; }
.duty-block-grid-wrap { margin-top: 0; }
.admin-compact-page .duty-block-grid { min-width: 620px; font-size: 0.73rem; }
.admin-compact-page .duty-block-grid th, .admin-compact-page .duty-block-grid td { padding: 4px 5px; vertical-align: middle; }
.admin-compact-page .duty-block-grid tbody th { white-space: nowrap; font-weight: 400; }
.admin-compact-page .duty-block-grid td { min-width: 78px; text-align: center; }
.admin-compact-page .duty-block-grid .duty-block-button { display: inline-flex; align-items: center; justify-content: center; width: 19px; min-width: 19px; height: 19px; margin-right: 3px; font-size: 0.7rem; }
.admin-compact-page .duty-block-grid .duty-block-delete-form { display: inline; margin: 0; }
.duty-history-page .duty-history-plan-form { margin: 0 0 8px; }
.duty-history-page .history-table { min-width: 820px; }
.duty-history-page .history-table th, .duty-history-page .history-table td { vertical-align: top; }
.duty-history-page .history-table td:first-child, .duty-history-page .history-table td:nth-child(2) { white-space: nowrap; }
.duty-history-page .history-entry-list { margin: 4px 0 0; padding-left: 16px; }
.duty-history-page .history-entry-list > li { margin: 2px 0; }
.duty-history-page .history-entry-list details { display: inline-block; margin-left: 4px; }
.duty-history-page .history-entry-list pre { max-width: 440px; max-height: 240px; overflow: auto; padding: 5px; background: #f5f7f7; font-size: 0.7rem; white-space: pre-wrap; }
.duty-history-page .history-restore-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; min-width: 180px; }
.duty-history-page .history-restore-confirm form { margin: 0; }
.plan-saved-versions-page .plan-saved-versions-plan-form { margin: 0 0 8px; }
.plan-saved-versions-page .plan-saved-versions-note { margin: 0 0 6px; color: var(--muted); font-size: 0.78rem; }
.plan-saved-versions-page .plan-saved-versions-table { min-width: 650px; }
.plan-saved-versions-page .plan-saved-versions-table th, .plan-saved-versions-page .plan-saved-versions-table td { vertical-align: top; }
.plan-saved-versions-page .plan-saved-versions-table td:first-child, .plan-saved-versions-page .plan-saved-versions-table td:nth-child(2) { white-space: nowrap; }
.plan-saved-version-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; min-width: 180px; }
.plan-saved-version-actions form { margin: 0; }
.plan-saved-version-confirm { flex-basis: 100%; color: var(--muted); font-size: 0.74rem; line-height: 1.2; }

/* Edycja dyżurów: osobny, zwarty widok przeciągania bez zmian w Planie szkoły. */
.duty-edit-page { font-size: 0.82rem; }
.duty-block-panel.teacher-plan-floating-panel { position: fixed; z-index: 2100; top: 0; left: 0; right: auto; max-width: none; overflow-y: auto; }
.plan-choice-menu.teacher-plan-floating-menu { position: fixed; z-index: 2100; top: 0; left: 0; max-width: none; }
.after-school-hours-page { font-size: 0.84rem; }
.after-school-hours-page > h1 { margin-bottom: 6px; }
.after-school-selector, .after-school-hours-form { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 10px; margin: 7px 0; padding: 7px 9px; }
.after-school-selector label, .after-school-hours-form label { display: grid; min-width: 0; gap: 2px; font-size: 0.76rem; }
.after-school-selector select, .after-school-hours-form input, .after-school-hours-form button { min-height: 28px; margin: 0; padding: 3px 5px; font-size: 0.8rem; }
.after-school-base-hours { display: inline-block; margin: 7px 0; padding: 7px 9px; }
.after-school-base-hours h2 { margin: 0 0 4px; font-size: 0.84rem; }
.after-school-base-hours table { font-size: 0.78rem; }
.after-school-base-hours th, .after-school-base-hours td { padding: 2px 6px; white-space: nowrap; }
.after-school-note { margin: 4px 0 7px; color: var(--muted); font-size: 0.77rem; }
.after-school-table-wrap { margin: 0; }
.after-school-table { min-width: 760px; font-size: 0.74rem; }
.after-school-table th, .after-school-table td { padding: 3px 4px; vertical-align: top; text-align: center; }
.after-school-table thead th { background: #edf4f6; }
.after-school-table tbody > tr > th { width: 92px; white-space: nowrap; background: #f8fbfc; }
.after-school-entry { margin: 0 0 2px; border: 1px solid #a7bac2; border-radius: 3px; background: #f9fbfc; text-align: left; }
.after-school-entry summary { padding: 2px 4px; cursor: pointer; font-size: 0.72rem; }
.after-school-entry-form, .after-school-entry > form { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px; }
.after-school-entry select, .after-school-entry input, .after-school-entry button, .after-school-add button { min-height: 23px; margin: 0; padding: 2px 4px; font-size: 0.68rem; }
.after-school-add { display: inline-block; }
.after-school-add button { min-width: 24px; color: var(--error-text); border-color: #c77878; background: #fff7f7; }
.teacher-after-school-section { margin: 8px 0; padding: 8px 10px; font-size: 0.82rem; }
.teacher-after-school-section > h2 { margin: 0 0 3px; font-size: 0.92rem; }
.teacher-after-school-section .after-school-note { margin: 0 0 5px; }
.teacher-after-school-section .save-status:empty { display: none; }
.after-school-editor-grid { margin: 0; }
.after-school-grid-table { min-width: 680px; }
.after-school-grid-table th, .after-school-grid-table td { height: 32px; padding: 3px 4px; vertical-align: middle; text-align: center; }
.after-school-grid-cell { position: relative; min-width: 76px; }
.after-school-grid-slots { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); align-items: stretch; justify-items: center; width: 100%; height: 24px; min-height: 0; }
.after-school-chip { position: relative; display: flex; grid-column: 1; grid-row: 1 / -1; align-items: center; justify-content: center; justify-self: center; gap: 1px; width: fit-content; min-width: 0; min-height: 0; height: 100%; padding: 1px 2px 1px 4px; border: 1px solid #90a8b4; border-radius: 3px; background: #f9fbfc; box-sizing: border-box; overflow: visible; }
.after-school-chip-30 { grid-column: 1; grid-row: 1; justify-self: center; width: fit-content; min-width: 44px; max-width: 100%; min-height: 0; padding: 0 1px; gap: 0; font-size: 0.55rem; overflow: visible; }
.after-school-chip-30-second { grid-row: 2; }
.after-school-chip-30 .after-school-chip-main { min-height: 0; font-size: inherit; }
.after-school-chip-main { min-width: 0; min-height: 18px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.72rem; line-height: 1; cursor: grab; touch-action: pan-y; }
.after-school-chip-main:hover, .after-school-chip-main:focus { background: transparent; color: var(--navy-dark); outline: 0; box-shadow: none; }
.after-school-chip-main:active { cursor: grabbing; }
.after-school-add { display: inline-flex; align-items: center; justify-content: center; width: 24px; min-width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 1px solid #90a8b4; border-radius: 3px; background: #f9fbfc; color: var(--text); font: inherit; font-size: 0.95rem; line-height: 1; cursor: pointer; }
.after-school-add:hover, .after-school-add:focus { border-color: var(--navy); background: #e5eff2; outline: 1px solid var(--navy); }
.after-school-add.after-school-add-conflict { border-color: #c77878; background: #fff7f7; color: var(--error-text); }
.after-school-add.after-school-add-conflict:hover, .after-school-add.after-school-add-conflict:focus { border-color: var(--error-text); background: #fbecec; outline-color: var(--error-text); }
.after-school-chip-dragging { opacity: 0.5; user-select: none; }
.after-school-drag-preview { position: fixed; z-index: 1000; display: inline-flex; align-items: center; min-height: 22px; padding: 1px 5px; border: 1px solid #608592; border-radius: 3px; background: #f9fbfc; box-shadow: 0 2px 7px rgb(20 50 60 / 0.22); color: var(--text); font-size: 0.72rem; line-height: 1; pointer-events: none; user-select: none; white-space: nowrap; }
.after-school-target-valid { background: #f4fff7; }
.after-school-target-invalid { background: #fff8f8; }
.after-school-target-warning { background: #fffaf0; }
.after-school-target-over { box-shadow: inset 0 0 0 2px #23714f; }
.after-school-target-invalid.after-school-target-over { box-shadow: inset 0 0 0 2px var(--error-text); }
.after-school-target-warning.after-school-target-over { box-shadow: inset 0 0 0 2px #b87820; }
.after-school-drop-marker { position: absolute; z-index: 5; inset: 3px; display: flex; align-items: center; justify-content: center; border: 1px dashed currentColor; border-radius: 3px; box-sizing: border-box; font-size: 0.62rem; font-weight: 600; line-height: 1; pointer-events: none; }
.after-school-drop-marker-timed { top: var(--after-school-drop-top); right: 3px; bottom: auto; left: 3px; height: var(--after-school-drop-height); }
.after-school-drop-marker-valid { background: rgb(230 247 236 / 0.9); color: #1f5b43; }
.after-school-drop-marker-invalid { background: rgb(255 241 241 / 0.92); color: var(--error-text); }
.after-school-drop-marker-warning { background: rgb(255 246 226 / 0.92); color: #8a5a13; }
.after-school-target-over .after-school-drop-marker { border-style: solid; border-width: 2px; font-weight: 700; }
[data-after-school-board][data-dragging="1"] .after-school-drop-marker { pointer-events: auto; cursor: copy; }
.after-school-grid-wrap[data-dragging="1"] .after-school-grid-cell { overflow: visible; }
.after-school-grid-wrap[data-dragging="1"] .after-school-drop-marker { z-index: 12; min-height: 0; padding: 0; }
.after-school-drop-marker.after-school-target-over { border-style: solid; border-width: 2px; font-weight: 700; }
.after-school-menu { position: fixed; z-index: 2100; top: 0; left: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; width: max-content; max-width: min(224px, calc(100vw - 24px)); max-height: min(340px, calc(100vh - 24px)); overflow-y: auto; padding: 4px; border: 1px solid #78909c; border-radius: 3px; background: #fff; box-shadow: 0 3px 10px rgb(25 51 68 / 0.22); color: var(--text); font-size: 0.66rem; line-height: 1.15; text-align: center; white-space: normal; }
.after-school-menu button { min-height: 20px; margin: 0; padding: 2px 5px; border-color: #aebec5; background: #fff; color: var(--text); font: inherit; line-height: 1.1; text-align: left; white-space: nowrap; }
.after-school-menu-label { padding: 1px 3px 0; color: #4b5d66; font-size: 0.62rem; font-weight: 700; text-align: left; }
.after-school-menu-empty { padding: 3px; color: var(--muted); text-align: left; }
.after-school-menu-room-current { border-color: #d79a56 !important; background: #fff2e2 !important; font-weight: 700; }
.after-school-menu button:hover, .after-school-menu button:focus { border-color: var(--navy); background: #e5eff2; color: var(--text); outline: 0; box-shadow: none; }
.after-school-menu [data-after-school-menu-action="delete"] { border-color: #c77878; background: #fff7f7; color: var(--error-text); font-weight: 700; }
.after-school-menu [data-after-school-menu-action="delete"]:hover, .after-school-menu [data-after-school-menu-action="delete"]:focus { border-color: var(--error-text); background: #fbecec; color: #8d1c1c; }
.after-school-menu [data-after-school-menu-action="split"] { border-color: #d59a56; background: #fff2e2; color: #8a5118; font-weight: 700; }
.after-school-menu [data-after-school-menu-action="split"]:hover, .after-school-menu [data-after-school-menu-action="split"]:focus { border-color: #b96f29; background: #ffe6c7; color: #6f3f10; }
.after-school-menu .after-school-menu-room-after-school { color: #8a5118; }
.after-school-menu .after-school-menu-room-after-school:hover, .after-school-menu .after-school-menu-room-after-school:focus { background: #fff2e2; color: #6f3f10; }
.after-school-menu .after-school-menu-room-lesson { color: #275c35; }
.after-school-menu .after-school-menu-room-lesson:hover, .after-school-menu .after-school-menu-room-lesson:focus { background: #eef8ef; color: #1e4f2a; }
.after-school-menu .after-school-menu-room-current { background: #fff2e2 !important; }
.teacher-plan-table .plan-grid-choice .plan-grid-trigger, .teacher-plan-table .duty-block-button, .teacher-after-school-section .after-school-add, .teacher-after-school-section .after-school-chip:not(.after-school-chip-30) { box-sizing: border-box; min-height: 24px; height: 24px; line-height: 1; }
.teacher-plan-table .plan-grid-choice .plan-grid-trigger:not(.plan-grid-add-button), .teacher-plan-table .duty-block-button, .teacher-after-school-section .after-school-chip, .teacher-after-school-section .after-school-reference-chip { width: var(--teacher-plan-chip-width); min-width: var(--teacher-plan-chip-width); max-width: var(--teacher-plan-chip-width); }
.teacher-after-school-section .after-school-chip { justify-self: center; border-color: #d79a56; background: #fff5e8; color: #8a5118; }
.teacher-after-school-section .after-school-chip-main { color: #8a5118; }
.teacher-after-school-section .after-school-chip-conflict { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-after-school-section .after-school-chip-conflict .after-school-chip-main { color: var(--error-text); }
.teacher-after-school-section .after-school-reference-chip { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 24px; margin: 0; padding: 1px 5px; border: 1px solid #9eafb9; border-radius: 3px; background: #f8fbfc; color: var(--navy); font: inherit; font-size: 0.76rem; line-height: 1; vertical-align: middle; }
.teacher-after-school-section .after-school-reference-lesson { border-color: #669d74; background: #f1f8f2; color: #275c35; }
.teacher-after-school-section .after-school-reference-duty { border-color: #5f8fb8; background: #f1f7fc; color: #1f5d91; }

/* Plan nauczyciela: jedna oś rzeczywistego czasu, bez wewnętrznego przewijania pionowego. */
.teacher-timeline-panel { --teacher-plan-chip-width: 40px; }
.teacher-timeline-panel .teacher-timeline-after-school-note { margin: 2px 0 4px; color: var(--muted); font-size: 0.76rem; line-height: 1.25; }
.teacher-timeline-panel .save-status:empty { display: none; }
.teacher-timeline-scroll { overflow-x: auto; overflow-y: visible; margin: 0; padding-bottom: 2px; }
.teacher-timeline-board { display: grid; grid-template-columns: 78px repeat(var(--teacher-timeline-day-count), minmax(118px, 1fr)); grid-template-rows: auto var(--teacher-timeline-height); min-width: max-content; border: 1px solid #d2dde0; background: #fff; }
.teacher-timeline-header { position: sticky; top: 0; z-index: 8; min-width: 118px; padding: 4px 5px; border-left: 1px solid #dbe4e6; border-bottom: 1px solid #cbd8dc; background: #edf4f6; color: var(--navy-dark); font-size: 0.76rem; font-weight: 700; text-align: center; }
.teacher-timeline-time-header { position: sticky; left: 0; z-index: 10; min-width: 78px; border-left: 0; text-align: left; }
.teacher-timeline-time-axis { position: sticky; left: 0; z-index: 6; grid-row: 2; height: var(--teacher-timeline-height); min-width: 78px; border-right: 1px solid #cbd8dc; background: #f8fbfc; }
.teacher-timeline-time-marker { position: absolute; top: var(--teacher-timeline-top); right: 0; left: 0; height: 1px; color: transparent; font-size: 0.68rem; line-height: 1; transform: translateY(-1px); }
.teacher-timeline-time-marker-hour { color: var(--muted); }
.teacher-timeline-time-marker-hour { padding-right: 5px; text-align: right; }
.teacher-timeline-day { position: relative; grid-row: 2; min-width: 118px; height: var(--teacher-timeline-height); overflow: visible; border-left: 1px solid #dbe4e6; background: #fff; }
.teacher-timeline-day::before { display: none; }
.teacher-timeline-break-band { position: absolute; z-index: 1; top: var(--teacher-timeline-top); right: 0; left: 0; height: var(--teacher-timeline-height); background: rgb(225 229 230 / 0.56); pointer-events: none; }
.teacher-timeline-item { position: absolute; z-index: 3; top: var(--teacher-timeline-top); left: 50%; display: flex; align-items: center; justify-content: center; width: var(--teacher-plan-chip-width); height: var(--teacher-timeline-height); min-height: 0; transform: translateX(-50%); }
.teacher-timeline-item .plan-choice, .teacher-timeline-item .plan-cell-controls { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 2px; max-width: 100%; }
.teacher-timeline-item .plan-choice-menu { z-index: 25; min-width: 220px; }
.teacher-timeline-item .plan-grid-choice .plan-grid-trigger, .teacher-timeline-item .duty-block-button { box-sizing: border-box; width: var(--teacher-plan-chip-width); min-width: var(--teacher-plan-chip-width); max-width: var(--teacher-plan-chip-width); height: 24px; min-height: 24px; line-height: 1; }
.teacher-timeline-item .plan-grid-choice .plan-grid-trigger.plan-grid-add-button { width: 24px; min-width: 24px; max-width: 24px; }
.teacher-timeline-item:not(.plan-cell-conflict) .teacher-plan-room-assigned { border-color: #669d74; background: #f1f8f2; color: #275c35; }
.teacher-timeline-item:not(.plan-cell-conflict) .teacher-plan-duty-assigned { border-color: #5f8fb8; background: #f1f7fc; color: #1f5d91; }
.teacher-timeline-item.plan-cell-conflict .teacher-plan-room-assigned, .teacher-timeline-item.plan-cell-conflict .teacher-plan-duty-assigned { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-timeline-item .duty-block-button-blocked { border: 1px solid var(--error-text); background: #fbecec; color: var(--error-text); font-weight: 700; }
.teacher-timeline-item.teacher-timeline-add-origin { display: none; }
.teacher-timeline-add-group { position: absolute; z-index: 7; top: var(--teacher-timeline-add-top); left: 50%; display: flex; align-items: center; justify-content: center; gap: 3px; max-width: calc(100% - 6px); min-width: 0; transform: translateX(-50%); white-space: nowrap; }
.teacher-timeline-add-group .teacher-timeline-add-control, .teacher-timeline-add-group .duty-block-control { position: relative; display: inline-flex; flex: 0 1 auto; min-width: 0; }
.teacher-timeline-add-group .plan-choice-menu, .teacher-timeline-add-group .duty-block-panel { z-index: 30; }
.teacher-timeline-add-group .plan-grid-trigger.plan-grid-add-button, .teacher-timeline-add-group .after-school-add { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0 5px; font-size: 0.68rem; line-height: 1; white-space: nowrap; }
.teacher-timeline-add-group .duty-block-button { box-sizing: border-box; width: 24px; min-width: 24px; height: 24px; min-height: 24px; margin: 0; line-height: 1; }
.teacher-timeline-add-group .plan-grid-trigger.plan-grid-add-button::after, .teacher-timeline-add-group .after-school-add::after { margin-left: 3px; font-size: inherit; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="lesson"] .plan-grid-trigger { border-color: #d79a56; background: transparent; color: #8a5118; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="lesson"] .plan-grid-trigger:hover,
.teacher-timeline-add-group [data-teacher-timeline-add-type="lesson"] .plan-grid-trigger:focus-visible { border-color: #c8873f; background: #fff5e8; color: #744412; outline: 0; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="lesson"] .plan-grid-trigger::after { content: 'Dodaj lekcję'; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="after-school"] { border-color: #d79a56; background: transparent; color: #8a5118; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="after-school"]:hover,
.teacher-timeline-add-group [data-teacher-timeline-add-type="after-school"]:focus-visible { border-color: #c8873f; background: #fff5e8; color: #744412; outline: 0; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="after-school"]::after { content: 'Dodaj świetlicę'; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="duty"] .plan-grid-trigger { border-color: #d79a56; background: transparent; color: #8a5118; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="duty"] .plan-grid-trigger:hover,
.teacher-timeline-add-group [data-teacher-timeline-add-type="duty"] .plan-grid-trigger:focus-visible { border-color: #c8873f; background: #fff5e8; color: #744412; outline: 0; }
.teacher-timeline-add-group [data-teacher-timeline-add-type="duty"] .plan-grid-trigger::after { content: 'Dodaj dyżur'; }
.teacher-timeline-add-group [data-teacher-timeline-add-compact="1"] .plan-grid-trigger.plan-grid-add-button, .teacher-timeline-add-group-compact .plan-grid-trigger.plan-grid-add-button, .teacher-timeline-add-group-compact .after-school-add { width: 24px; max-width: 24px; padding: 0; }
.teacher-timeline-add-group [data-teacher-timeline-add-compact="1"] .plan-grid-trigger::after, .teacher-timeline-add-group-compact .plan-grid-trigger::after, .teacher-timeline-add-group-compact .after-school-add::after { display: none; }
.teacher-timeline-after-school-target { position: absolute; z-index: 4; top: var(--teacher-timeline-top); right: 0; left: 0; height: var(--teacher-timeline-height); pointer-events: none; }
.teacher-timeline-after-school-target > .after-school-add, .teacher-timeline-after-school-target > .after-school-chip { position: absolute; top: 50%; left: 50%; pointer-events: auto; transform: translate(-50%, -50%); }
.teacher-timeline-panel .teacher-timeline-after-school-target > .teacher-timeline-after-school-chip { top: var(--teacher-timeline-entry-top); box-sizing: border-box; height: var(--teacher-timeline-entry-height); min-height: 0; max-height: var(--teacher-timeline-entry-height); margin: 0; transform: translate(-50%, 0); }
.teacher-timeline-panel .after-school-chip { display: inline-flex; align-items: center; justify-content: space-between; box-sizing: border-box; width: var(--teacher-plan-chip-width); min-width: var(--teacher-plan-chip-width); max-width: var(--teacher-plan-chip-width); min-height: 24px; margin: 0; padding: 1px 2px 1px 4px; border: 1px solid #d79a56; border-radius: 3px; background: #fff5e8; color: #8a5118; overflow: visible; }
.teacher-timeline-panel .teacher-timeline-after-school-chip.after-school-chip-30 { min-height: 0; padding: 0 1px; font-size: 0.55rem; line-height: 1; }
.teacher-timeline-panel .after-school-chip-main { color: #8a5118; }
.teacher-timeline-panel .after-school-chip-main { min-height: 0; font-size: inherit; }
.teacher-timeline-panel .after-school-add { width: 24px; min-width: 24px; height: 24px; min-height: 24px; color: var(--text); }
.teacher-timeline-panel .after-school-chip-conflict { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-timeline-panel .after-school-chip-conflict .after-school-chip-main { color: var(--error-text); }
.teacher-timeline-panel[data-dragging="1"] .teacher-timeline-after-school-target { pointer-events: auto; }
.teacher-timeline-panel[data-dragging="1"] .teacher-timeline-after-school-target > .after-school-chip, .teacher-timeline-panel[data-dragging="1"] .teacher-timeline-after-school-target > .after-school-add { pointer-events: auto; }
.teacher-timeline-panel .after-school-drop-marker { inset: 3px; font-size: 0.62rem; }
.teacher-timeline-panel .after-school-drop-marker-timed { top: var(--after-school-drop-top); right: 3px; bottom: auto; left: 3px; height: var(--after-school-drop-height); }

/* Plan nauczyciela: wspólne osie godzin i zwarta grupa dwóch kolumn dla dnia. */
.teacher-day-plan-scroll { box-sizing: border-box; width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 0; }
.teacher-day-plan-layout { box-sizing: border-box; display: flex; align-items: stretch; width: 100%; min-width: max-content; }
.teacher-plan-shared-axis { box-sizing: border-box; flex: 0 0 88px; width: 88px; min-width: 88px; border: 1px solid #d2dde0; background: #fff; }
.teacher-plan-shared-axis + .teacher-day-plan-groups, .teacher-day-plan-groups + .teacher-plan-shared-axis { border-left: 0; }
.teacher-plan-shared-axis > h3, .teacher-day-plan-group > h3 { box-sizing: border-box; display: flex; align-items: center; justify-content: center; height: 38px; margin: 0; padding: 4px 1px; border-bottom: 1px solid #cbd8dc; background: #edf4f6; color: var(--navy-dark); font-size: 0.8rem; font-weight: 700; line-height: 1.1; text-align: center; }
.teacher-plan-shared-axis > h3 { padding: 1px; font-size: 0.66rem; line-height: 1.05; }
.teacher-plan-shared-axis-subhead { box-sizing: border-box; min-height: 24px; border-bottom: 1px solid #dbe4e6; background: #f8fbfc; }
.teacher-plan-shared-axis-list { position: relative; box-sizing: border-box; min-width: 0; min-height: 0; height: var(--teacher-day-plan-timeline-height); overflow: visible; }
.teacher-plan-shared-axis-row { position: absolute; top: var(--teacher-day-plan-top); right: 0; left: 0; box-sizing: border-box; display: flex; align-items: center; justify-content: center; height: var(--teacher-day-plan-height); min-height: 0; padding: 0 1px; border: 0; color: var(--muted); font-size: 0.67rem; line-height: 1.1; text-align: center; white-space: nowrap; }
.teacher-plan-shared-lesson-axis .teacher-plan-shared-axis-row-lesson { flex-direction: row; gap: 3px; }
.teacher-plan-shared-axis-lesson-number { color: var(--navy-dark); font-size: .72rem; font-weight: 700; line-height: 1; }
.teacher-plan-shared-axis-time { display: inline; white-space: nowrap; }
.teacher-plan-shared-axis-row-break { background: transparent; }
.teacher-plan-shared-after-school-axis .teacher-plan-shared-axis-row { justify-content: center; padding: 0 1px; text-align: center; }
.teacher-day-plan-groups { display: flex; flex: 1 1 auto; align-items: stretch; min-width: max-content; }
.teacher-day-plan-group { display: grid; flex: 1 1 0; grid-template-columns: minmax(68px, 1fr) minmax(68px, 1fr); align-items: stretch; min-width: 136px; overflow: visible; border-top: 1px solid #d2dde0; border-right: 1px solid #d2dde0; border-bottom: 1px solid #d2dde0; background: #fff; }
.teacher-day-plan-group:first-child { border-left: 1px solid #d2dde0; }
.teacher-day-plan-group > h3 { grid-column: 1 / -1; }
.teacher-day-plan-column { display: flex; min-width: 0; flex-direction: column; }
.teacher-day-plan-group .teacher-day-plan-column + .teacher-day-plan-column { border-left: 1px solid #edf1f2; }
.teacher-day-plan-column > h4 { box-sizing: border-box; min-height: 24px; margin: 0; padding: 3px 1px; border-bottom: 1px solid #dbe4e6; background: #f8fbfc; color: var(--muted); font-size: 0.7rem; font-weight: 700; text-align: center; }
.teacher-day-lesson-list, .teacher-day-after-school-list { position: relative; box-sizing: border-box; min-width: 0; height: var(--teacher-day-plan-timeline-height); overflow: visible; }
.teacher-day-plan-after-school .teacher-day-after-school-list, .teacher-plan-shared-after-school-axis .teacher-plan-shared-axis-list { display: block; min-height: 0; flex: 0 0 auto; }
.teacher-day-lesson-row { position: absolute; top: var(--teacher-day-plan-top); right: 0; left: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; height: var(--teacher-day-plan-height); min-height: 0; overflow: visible; border: 0; }
.teacher-day-lesson-row-lesson, .teacher-day-lesson-row-break { background: transparent; }
/* Konflikt sali dotyczy oznaczenia lekcji, nie całego odcinka czasu. */
.teacher-day-plan-lessons .teacher-day-lesson-row-lesson.plan-cell-conflict { background: transparent !important; color: var(--text) !important; }
.teacher-day-row-controls { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; }
.teacher-day-row-controls .plan-choice, .teacher-day-row-controls .duty-block-control { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.teacher-day-row-controls .plan-choice-menu { z-index: 35; min-width: 220px; }
.teacher-day-plan-lessons .plan-grid-trigger, .teacher-day-plan-lessons .duty-block-button { box-sizing: border-box; width: var(--teacher-plan-chip-width); min-width: var(--teacher-plan-chip-width); max-width: var(--teacher-plan-chip-width); height: 24px; min-height: 24px; margin: 0; line-height: 1; }
.teacher-day-plan-lessons .teacher-day-lesson-row-lesson .plan-choice:has(.plan-grid-trigger:not(.plan-grid-add-button)) { width: calc(100% - 8px); height: 100%; }
.teacher-day-plan-lessons .teacher-day-lesson-row-lesson .plan-grid-trigger:not(.plan-grid-add-button) { box-sizing: border-box; width: 100%; min-width: 100%; max-width: 100%; height: 100%; min-height: 0; max-height: 100%; }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .plan-choice:has(.teacher-plan-duty-assigned) { width: calc(100% - 8px); }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .teacher-plan-duty-assigned { width: 100%; min-width: 100%; max-width: 100%; }
.teacher-day-plan-lessons .plan-grid-trigger.plan-grid-add-button { width: 24px; min-width: 24px; max-width: 24px; background: transparent; }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .teacher-plan-duty-assigned,
.teacher-day-plan-lessons .teacher-day-lesson-row-break .plan-grid-trigger.plan-grid-add-button,
.teacher-day-plan-lessons .teacher-day-lesson-row-break .duty-block-button { box-sizing: border-box; height: 100%; min-height: 0; max-height: none; margin: 0; padding: 0; font-size: min(0.68rem, calc(var(--teacher-day-plan-height) - 1px)); line-height: 1; }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .plan-choice,
.teacher-day-plan-lessons .teacher-day-lesson-row-break .duty-block-control { height: 100%; }
.teacher-day-plan-lessons .teacher-day-lesson-row-break [data-duty-cell][data-inline-plan-select-open] { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0 1px; border-color: #5f8fb8; color: #1f5d91; font-size: min(0.68rem, calc(var(--teacher-day-plan-height) - 1px)); line-height: 1; }
.teacher-day-plan-lessons .teacher-day-lesson-row-lesson .plan-grid-trigger.plan-grid-add-button { border-color: #669d74; color: #275c35; }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .plan-grid-trigger.plan-grid-add-button { border-color: #5f8fb8; color: #1f5d91; }
.teacher-day-plan-lessons .teacher-plan-room-assigned { border-color: #669d74; background: #f1f8f2; color: #275c35; }
.teacher-day-plan-lessons .teacher-plan-duty-assigned { border-color: #5f8fb8; background: #f1f7fc; color: #1f5d91; }
.teacher-day-plan-lessons .plan-cell-conflict .teacher-plan-room-assigned, .teacher-day-plan-lessons .plan-cell-conflict .teacher-plan-duty-assigned { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-central-lesson-controls { flex-direction: column; gap: 2px; padding: 2px 4px; }
.teacher-legacy-lesson { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; max-width: 100%; padding: 2px 3px; border: 1px solid #9aa8ad; border-left: 4px solid #6f7e84; border-radius: 3px; background: #f5f7f8; color: #32434a; }
.teacher-legacy-lesson-label { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--muted); font-size: .62rem; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.teacher-legacy-lesson .plan-choice { flex: 1 1 auto; min-width: 0; }
.teacher-legacy-lesson .plan-grid-trigger { width: auto; min-width: 34px; max-width: 100%; height: 20px; min-height: 20px; padding: 1px 4px; border-color: #9aa8ad; background: #fff; color: #32434a; font-size: .65rem; }
.teacher-legacy-lesson-delete { flex: 0 0 auto; margin: 0; }
.teacher-legacy-lesson-remove { min-width: 0; min-height: 20px; margin: 0; padding: 1px 4px; border-color: #be7373; background: transparent; color: #8d3030; font-size: .62rem; line-height: 1; }
.teacher-legacy-lesson-remove:hover, .teacher-legacy-lesson-remove:focus-visible { border-color: #9f5353; background: #fbecec; color: #742020; }
.teacher-central-lesson {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 2px 3px;
    border: 1px solid #669d74;
    border-left: 4px solid var(--lesson-subject-color, #669d74);
    border-radius: 3px;
    background: #f1f8f2;
    color: #275c35;
    text-align: center;
    text-decoration: none;
    overflow: hidden;
}
.teacher-central-lesson:hover, .teacher-central-lesson:focus-visible { background: #f6fbf7; text-decoration: none; }
.teacher-central-lesson strong, .teacher-central-lesson span, .teacher-central-lesson small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.teacher-central-lesson strong { font-size: .7rem; }
.teacher-central-lesson span { font-size: .62rem; }
.teacher-central-lesson small { color: #52636c; font-size: .58rem; }
.teacher-central-lesson.is-conflict { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-central-lesson-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border: 1px solid #d79a56;
    border-radius: 3px;
    background: transparent;
    color: #8a5118;
    font-weight: 700;
    text-decoration: none;
}
.teacher-central-lesson-add:hover, .teacher-central-lesson-add:focus-visible { border-color:#c8873f; background:#fff5e8; color:#744412; outline:0; text-decoration:none; }
.teacher-day-plan-lessons .duty-block-button:not(.duty-block-button-blocked),
.teacher-timeline-add-group .duty-block-button:not(.duty-block-button-blocked) { width: 24px; min-width: 24px; max-width: 24px; border: 1px solid #c77878; background: transparent; color: #8d2c2c; }
.teacher-day-plan-lessons .duty-block-button:not(.duty-block-button-blocked):hover,
.teacher-day-plan-lessons .duty-block-button:not(.duty-block-button-blocked):focus-visible,
.teacher-timeline-add-group .duty-block-button:not(.duty-block-button-blocked):hover,
.teacher-timeline-add-group .duty-block-button:not(.duty-block-button-blocked):focus-visible { border-color: #ad5757; background: #fbecec; color: #772020; outline: 0; }
.teacher-day-plan-lessons .plan-grid-trigger.plan-grid-add-button { border:1px solid #d79a56; background:transparent; color:#8a5118; }
.teacher-day-plan-lessons .plan-grid-trigger.plan-grid-add-button:hover,
.teacher-day-plan-lessons .plan-grid-trigger.plan-grid-add-button:focus-visible { border-color:#c8873f; background:#fff5e8; color:#744412; outline:0; }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .duty-block-control:has(.duty-block-button-blocked) { width: calc(100% - 8px); }
.teacher-day-plan-lessons .teacher-day-lesson-row-break .duty-block-button-blocked { width: 100%; min-width: 100%; max-width: 100%; border: 1px solid var(--error-text); background: #fbecec; color: var(--error-text); font-weight: 700; }
.teacher-day-plan-lessons .plan-cell-conflict .duty-block-button-blocked { border: 1px solid var(--error-text); background: #fbecec; color: var(--error-text); font-weight: 700; }
.teacher-day-after-school-slot { position: absolute; top: var(--teacher-day-plan-top); right: 0; left: 0; box-sizing: border-box; height: var(--teacher-day-plan-height); min-height: 0; overflow: visible; border: 0; }
.teacher-day-after-school-controls { position: relative; display: block; box-sizing: border-box; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; }
.teacher-day-plan-after-school .after-school-chip { position: absolute; top: var(--teacher-day-plan-entry-top); left: 4px; right: auto; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: calc(100% - 8px); height: var(--teacher-day-plan-entry-height); min-width: 0; min-height: 0; max-width: none; max-height: var(--teacher-day-plan-entry-height); margin: 0; padding: 0; transform: none; border-color: #d79a56; background: #fff5e8; color: #8a5118; }
.teacher-day-plan-after-school .after-school-chip--parallel { width: calc(50% - 6px); }
.teacher-day-plan-after-school .after-school-chip--parallel.after-school-chip--individual { left: 4px; }
.teacher-day-plan-after-school .after-school-chip--parallel.after-school-chip--group { right: 4px; left: auto; }
.teacher-day-plan-after-school .after-school-chip.after-school-menu-open { z-index: 45; }
.teacher-day-plan-after-school .after-school-menu { pointer-events: auto; }
.teacher-day-plan-after-school .after-school-chip-main { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; color: #8a5118; font-size: 0.82rem; line-height: 1; text-align: center; }
.teacher-day-plan-after-school .after-school-chip-30 { height: var(--teacher-day-plan-entry-height); min-height: 0; max-height: var(--teacher-day-plan-entry-height); padding: 0; font-size: 0.82rem; line-height: 1; }
.teacher-day-plan-after-school .after-school-chip-conflict { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.teacher-day-plan-after-school .after-school-chip-conflict .after-school-chip-main { color: var(--error-text); }
.teacher-day-plan-after-school .after-school-group-chip { border-color: #6b5aa6; background: #f1eeff; }
.teacher-day-plan-after-school .after-school-group-chip .after-school-chip-main { cursor: pointer; color: #44357b; text-decoration: none; }
.teacher-day-plan-after-school .after-school-group-chip .after-school-chip-main:hover, .teacher-day-plan-after-school .after-school-group-chip .after-school-chip-main:focus-visible { color: #2f2459; text-decoration: underline; }
.teacher-day-plan-after-school .after-school-add { position: absolute; top: 50%; left: 50%; box-sizing: border-box; width: 24px; min-width: 24px; max-width: 24px; padding: 0; transform: translate(-50%, -50%); border:1px solid #d79a56; background:transparent; color:#8a5118; font-size:0.95rem; }
.teacher-day-plan-after-school .after-school-add:hover,
.teacher-day-plan-after-school .after-school-add:focus-visible { border-color:#c8873f; background:#fff5e8; color:#744412; outline:0; }
.teacher-day-plan-after-school .after-school-add::after { display: none; }
.teacher-plan-table [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button,
.teacher-timeline-panel [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button,
.teacher-day-plan-lessons [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button,
.teacher-central-lesson-add { border:1px solid #669d74; background:transparent; color:#275c35; outline:0; box-shadow:none; }
.teacher-plan-table [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button:hover,
.teacher-plan-table [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button:focus-visible,
.teacher-timeline-panel [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button:hover,
.teacher-timeline-panel [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button:focus-visible,
.teacher-day-plan-lessons [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button:hover,
.teacher-day-plan-lessons [data-plan-choice]:has([data-lesson-cell]) .plan-grid-add-button:focus-visible,
.teacher-central-lesson-add:hover,
.teacher-central-lesson-add:focus-visible { border:1px solid #50845e; background:#f1f8f2; color:#1f4f2c; outline:0; box-shadow:none; }
.teacher-plan-table [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button,
.teacher-timeline-panel [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button,
.teacher-day-plan-lessons [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button { border:1px solid #5f8fb8; background:transparent; color:#1f5d91; outline:0; box-shadow:none; }
.teacher-plan-table [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button:hover,
.teacher-plan-table [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button:focus-visible,
.teacher-timeline-panel [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button:hover,
.teacher-timeline-panel [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button:focus-visible,
.teacher-day-plan-lessons [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button:hover,
.teacher-day-plan-lessons [data-plan-choice]:has([data-duty-cell]) .plan-grid-add-button:focus-visible { border:1px solid #4378a6; background:#f1f7fc; color:#174d79; outline:0; box-shadow:none; }
.teacher-plan-table .after-school-add,
.teacher-timeline-panel .after-school-add,
.teacher-day-plan-after-school .after-school-add { border:1px solid #d79a56; background:transparent; color:#8a5118; outline:0; box-shadow:none; }
.teacher-plan-table .after-school-add:hover,
.teacher-plan-table .after-school-add:focus-visible,
.teacher-timeline-panel .after-school-add:hover,
.teacher-timeline-panel .after-school-add:focus-visible,
.teacher-day-plan-after-school .after-school-add:hover,
.teacher-day-plan-after-school .after-school-add:focus-visible { border:1px solid #c8873f; background:#fff5e8; color:#744412; outline:0; box-shadow:none; }
.teacher-plan-table .duty-block-button:not(.duty-block-button-blocked),
.teacher-timeline-panel .duty-block-button:not(.duty-block-button-blocked),
.teacher-day-plan-lessons .duty-block-button:not(.duty-block-button-blocked) { border:1px solid #c77878; background:transparent; color:#8d2c2c; outline:0; box-shadow:none; }
.teacher-plan-table .duty-block-button:not(.duty-block-button-blocked):hover,
.teacher-plan-table .duty-block-button:not(.duty-block-button-blocked):focus-visible,
.teacher-timeline-panel .duty-block-button:not(.duty-block-button-blocked):hover,
.teacher-timeline-panel .duty-block-button:not(.duty-block-button-blocked):focus-visible,
.teacher-day-plan-lessons .duty-block-button:not(.duty-block-button-blocked):hover,
.teacher-day-plan-lessons .duty-block-button:not(.duty-block-button-blocked):focus-visible { border:1px solid #ad5757; background:#fbecec; color:#772020; outline:0; box-shadow:none; }
.teacher-plan-table .duty-block-button-blocked,
.teacher-timeline-panel .duty-block-button-blocked,
.teacher-day-plan-lessons .duty-block-button-blocked,
.teacher-plan-table .duty-block-button-blocked:hover,
.teacher-plan-table .duty-block-button-blocked:focus-visible,
.teacher-timeline-panel .duty-block-button-blocked:hover,
.teacher-timeline-panel .duty-block-button-blocked:focus-visible,
.teacher-day-plan-lessons .duty-block-button-blocked:hover,
.teacher-day-plan-lessons .duty-block-button-blocked:focus-visible { border:1px solid var(--error-text); background:#fbecec; color:var(--error-text); outline:0; box-shadow:none; }
.teacher-day-plan-after-school .after-school-target-valid { background: #f4fff7; }
.teacher-day-plan-after-school .after-school-target-invalid { background: #fff8f8; }
.teacher-day-plan-after-school .after-school-target-split { background: transparent; }
.teacher-day-plan-after-school .after-school-drop-marker { inset: 2px; }
.teacher-day-plan-after-school .after-school-drop-marker-timed { top: var(--after-school-drop-top); right: 2px; bottom: auto; left: 2px; height: var(--after-school-drop-height); }
.teacher-day-plan-after-school .after-school-drop-marker-half-hour { z-index: 6; border-width: 2px; font-size: 0.66rem; }
.teacher-day-after-school-empty { margin: 0; padding: 6px; color: var(--muted); font-size: 0.7rem; text-align: center; }
.after-school-group-entry-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.after-school-group-picker { margin: 8px 0; }
.after-school-group-picker label { display: inline-grid; gap: 3px; max-width: 360px; font-size: .82rem; font-weight: 700; }
.after-school-group-picker .after-school-individual-toggle { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-weight: 400; }
.after-school-batch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; font-size: .78rem; }
.after-school-batch-actions[hidden] { display: none !important; }
.after-school-batch-actions__open, .after-school-batch-actions__closed { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.after-school-batch-actions__open[hidden], .after-school-batch-actions__closed[hidden] { display: none !important; }
.after-school-entry-selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font-size: .78rem; }
.after-school-entry-selection-actions > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.after-school-entry-selection-actions > span[hidden] { display: none !important; }
.after-school-entry-selection-actions > form { display: inline-flex; margin: 0; padding: 0; }
.after-school-entry-selection-actions > button[hidden], .after-school-entry-selection-actions > form[hidden] { display: none !important; }
.after-school-entry-selection-actions .after-school-entry-delete-all { min-height: 28px; margin: 0; padding: 4px 7px; font-size: .78rem; }
.after-school-entry-selection-actions .after-school-entry-delete-all[disabled] { opacity: .55; }
.after-school-entry-selection-actions .after-school-drag-preview-summary { display: inline-flex; flex: 1 1 160px; align-items: center; min-width: 0; max-width: 360px; height: 28px; padding: 0 2px; overflow: hidden; color: var(--error-text); font-size: .75rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.after-school-entry-selection-actions .after-school-drag-preview-summary:not(.is-visible) { visibility: hidden; }
.after-school-drag-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 7px; color: var(--muted); font-size: .72rem; line-height: 1.2; }
.after-school-drag-legend-item { display: inline-flex; align-items: center; gap: 4px; min-height: 18px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: left; white-space: nowrap; }
button.after-school-drag-legend-item { cursor: help; }
button.after-school-drag-legend-item:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }
.after-school-drag-legend-swatch { display: inline-block; flex: 0 0 14px; width: 14px; height: 8px; border: 1px solid currentColor; border-radius: 2px; box-sizing: border-box; }
.after-school-drag-legend-swatch--valid { background: rgb(230 247 236 / 0.9); color: #1f5b43; }
.after-school-drag-legend-swatch--invalid { background: rgb(255 241 241 / 0.92); color: var(--error-text); }
.after-school-drag-legend-swatch--warning { background: rgb(255 246 226 / 0.92); color: #8a5a13; }
.after-school-entry-error-list { margin: 4px 0 0; padding-left: 18px; }
.after-school-entry-error-list li + li { margin-top: 2px; }
.after-school-batch-form-note { margin: 6px 0; color: var(--muted); font-size: .8rem; }
.after-school-batch-term-field:disabled { opacity: 1; color: var(--muted); background: var(--surface-alt, #f6f7fa); cursor: not-allowed; }
.after-school-group-entry-form [data-after-school-room-select][aria-invalid="true"] { border-color: #d98a8a; background: #fff8f8; box-shadow: 0 0 0 1px rgba(181, 62, 62, .12); }
.after-school-room-required-message { display: block; margin-top: 3px; color: var(--error-text); font-size: .74rem; font-weight: 400; line-height: 1.2; }
.after-school-room-required-message[hidden] { display: none !important; }
.after-school-entry-single-fields, .after-school-entry-batch-fields { display: contents; }
.after-school-entry-single-fields[hidden], .after-school-entry-batch-fields[hidden] { display: none !important; }
.after-school-grid-panel { margin: 8px 0 14px; }
.after-school-grid-status-region { display: grid; gap: 4px; min-height: 0; margin: 0; pointer-events: none; }
.after-school-grid-status, .after-school-form-status { display: flex; align-items: center; box-sizing: border-box; min-height: 0; margin: 0; padding: 4px 7px; overflow: visible; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--text); font-size: .75rem; line-height: 1.3; white-space: pre-line; }
.after-school-grid-status { display: none; width: fit-content; max-width: min(100%, 620px); pointer-events: none; }
.after-school-grid-status:not(.is-visible), .after-school-form-status[hidden] { display: none !important; margin: 0; padding: 0; border: 0; background: transparent; }
.after-school-grid-status.is-visible { display: flex; }
.after-school-grid-status.is-error, .after-school-form-status.is-error { border-color: #d98a8a; background: #fff1f1; color: var(--error-text); }
.after-school-grid-status--preview { z-index: 1; pointer-events: none; }
@media (max-width: 640px) {
    .after-school-entry-selection-actions .after-school-drag-preview-summary { position: absolute; width: 1px; height: 1px; min-width: 0; max-width: none; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; visibility: visible; }
}
.after-school-grid-wrap { position: relative; margin: 0; }
.after-school-week-grid { --after-school-grid-row-height: 56px; width: 100%; border-collapse: collapse; font-size: .78rem; }
.after-school-week-grid th, .after-school-week-grid td { min-width: 112px; padding: 4px; border: 1px solid var(--border); vertical-align: top; text-align: center; }
/* Jeden podstawowy przedział ma zawsze jeden zwarty obszar roboczy.
   Komórka przekazuje segmentom wysokość po odjęciu własnego paddingu,
   dzięki czemu dwa wpisy 30-minutowe nie mogą rozepchnąć wiersza. */
.after-school-week-grid tbody tr { height: var(--after-school-grid-row-height); }
.after-school-week-grid .after-school-grid-cell { position: relative; height: var(--after-school-grid-row-height); padding: 3px; box-sizing: border-box; }
.after-school-grid-segments { display: grid; align-items: stretch; width: 100%; height: calc(var(--after-school-grid-row-height) - 8px); min-height: 0; overflow: hidden; row-gap: 1px; }
.after-school-grid-segment { display: flex; min-height: 0; min-width: 0; padding: 0; overflow: hidden; }
.after-school-grid-segment > .after-school-grid-entry,
.after-school-grid-segment > .after-school-grid-empty-segment { box-sizing: border-box; flex: 1 1 auto; align-self: stretch; min-width: 0; min-height: 0; max-height: 100%; height: 100%; margin: 0; }
.after-school-grid-segment > .after-school-grid-entry { grid-auto-rows: minmax(0, auto); gap: 1px; padding: 2px 3px; overflow: hidden; }
.after-school-grid-empty-segment { position: relative; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-width: 0; min-height: 0; cursor: pointer; }
.after-school-grid-segment > .after-school-grid-empty-segment .after-school-grid-add { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 0; height: 100%; min-height: 0; margin: 0; padding: 0; }
.after-school-grid-segment > .after-school-grid-entry > strong,
.after-school-grid-segment > .after-school-grid-entry > span { min-width: 0; min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.after-school-grid-empty-segment.is-selected,
.after-school-grid-empty-segment.is-batch-selected { background: #e8f0f3; box-shadow: inset 0 0 0 2px #80aabd; }
.after-school-grid-empty-segment.is-batch-selectable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.after-school-week-grid .after-school-grid-cell.is-closed,
.after-school-grid-segment.is-closed { background: #f1f3f4; }
/* W tabeli świetlicy dokładny zakres oznacza marker, nie pełne tło
   komórki. Dzięki temu 60 min nad dwiema połówkami nie „wylewa się”
   optycznie na następną komórkę będącą osobnym początkiem celu. */
.after-school-week-grid .after-school-target-valid,
.after-school-week-grid .after-school-target-invalid,
.after-school-week-grid .after-school-target-warning { background: transparent; }
.after-school-grid-wrap[data-dragging="1"] .after-school-grid-add { visibility: hidden; }
.after-school-grid-wrap[data-after-school-entry-selection-mode="1"] .after-school-grid-add { visibility: hidden; }
.after-school-week-grid thead th, .after-school-week-grid tbody th { background: var(--surface-alt, #f6f7fa); font-weight: 700; }
.after-school-week-grid--all-groups { table-layout: fixed; }
.after-school-week-grid--all-groups th, .after-school-week-grid--all-groups td { min-width: 64px; padding: 3px; }
.after-school-grid-group-code { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; font-weight: 700; }
.after-school-week-grid--all-groups .after-school-grid-entry { min-width: 0; padding: 3px; font-size: .68rem; }
.after-school-week-grid--all-groups .after-school-grid-entry strong, .after-school-week-grid--all-groups .after-school-grid-entry span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; }
.after-school-week-grid--all-groups .after-school-grid-add { min-width: 28px; min-height: 30px; font-size: 1.16rem; }
.after-school-grid-add { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; color: var(--primary); font-size: 1.35rem; font-weight: 700; line-height: 1; text-decoration: none; }
.after-school-grid-add--closed { color: #6c757d; }
.after-school-grid-add--closed:hover, .after-school-grid-add--closed:focus-visible { background: #e2e6e9; color: #44505a; }
.after-school-grid-entry { display: grid; gap: 2px; padding: 4px; border: 1px solid #d79a56; border-left: 4px solid #d79a56; border-radius: 3px; background: #fff5e8; color: #7a4815; text-decoration: none; line-height: 1.15; }
.after-school-grid-entry[style*="--after-school-group-color"] { border-left-color: var(--after-school-group-color); }
.teacher-group-after-school-entry, .after-school-group-chip { border-left: 4px solid #d79a56; }
.teacher-group-after-school-entry[style*="--after-school-group-color"], .after-school-group-chip[style*="--after-school-group-color"] { border-left-color: var(--after-school-group-color); }
.graphic-lesson.after-school-graphic-entry { --graphic-subject: #d79a56; border-color: #d79a56; border-left-width: 4px; background: #fff5e8; color: #7a4815; }
.graphic-lesson.after-school-graphic-entry[style*="--after-school-group-color"] { border-left-color: var(--after-school-group-color); }
.after-school-graphic-group-header { box-shadow: inset 0 3px 0 var(--after-school-group-color); }
.after-school-week-grid button.after-school-grid-entry { width: 100%; margin: 0; font: inherit; text-align: center; cursor: grab; }
.after-school-grid-segment > button.after-school-grid-entry { min-height: 0; }
.after-school-week-grid button.after-school-grid-entry:active { cursor: grabbing; }
.after-school-grid-entry:not(.is-conflict):hover, .after-school-grid-entry:not(.is-conflict):focus-visible, .after-school-grid-entry:not(.is-conflict).is-selected { border-color: #b8762d; border-left-color: var(--after-school-group-color, #d79a56); background: #fff9f0; color: #663b11; }
.after-school-grid-entry.is-selected { outline: 2px solid var(--navy); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(79, 124, 134, 0.2); }
.graphic-lesson[aria-current="true"] { outline: 2px solid var(--navy); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(79, 124, 134, 0.2); }
.graphic-lesson:not(.is-conflict):hover { transform: none; box-shadow: none; background: color-mix(in srgb, var(--graphic-subject) 16%, #fff); }
.graphic-lesson.after-school-graphic-entry:not(.is-conflict):hover { background: #fff9f0; }
.after-school-group-color-swatch { display: inline-block; width: 11px; height: 11px; margin: 0 5px 0 0; border: 1px solid rgb(0 0 0 / .2); border-radius: 50%; background: var(--after-school-group-color); vertical-align: -1px; }
.after-school-grid-entry.is-delete-selected { outline: 2px solid var(--error-text); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(180, 65, 65, .16); }
.after-school-grid-entry span { font-size: .7rem; }
.after-school-grid-entry .after-school-grid-entry-short-line,
.after-school-grid-entry .after-school-grid-educator,
.after-school-grid-entry .after-school-grid-room { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.after-school-grid-entry .after-school-grid-entry-short-line { font-size: .64rem; line-height: 1.05; }
.after-school-grid-entry .after-school-grid-room { color: inherit; font-weight: 700; }
.after-school-grid-cell--individual { min-width: 92px; }
.after-school-grid-cell--individual .after-school-grid-entry { margin-bottom: 3px; }
.after-school-grid-entry--individual { border-color: #8796b8; background: #f0f3fb; color: #31456d; }
.after-school-grid-entry--individual:hover, .after-school-grid-entry--individual:focus-visible { border-color: #657bab; background: #e5ebf8; color: #24395f; }
.after-school-grid-entry--pending, .after-school-grid-entry--pending:hover { border-style: dashed; border-color: #bf843f; border-left-color: #bf843f; background: #fffaf1; color: #7a4815; cursor: default; }
.after-school-entry-source-label { display: grid; gap: 3px; align-content: start; font-size: .82rem; }
.after-school-entry-source-label span { min-height: 34px; display: flex; align-items: center; color: var(--muted, #667085); }
.after-school-conflict-edit-link { display: inline-block; margin-top: 4px; font-weight: 700; }
.after-school-planned-count { margin: 8px 0 4px; font-size: .84rem; }
.after-school-entry-duration { margin: 8px 0 3px; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.after-school-entry-duration[hidden] { display: none !important; }
.after-school-capacity-warning { margin: 4px 0; }
.after-school-entry-group-composition { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; margin: 8px 0 3px; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.after-school-entry-group-composition[hidden] { display: none !important; }
.after-school-entry-group-composition > strong { color: inherit; }
.after-school-entry-group-composition > span { display: inline-flex; flex-wrap: wrap; gap: 2px 7px; }
.after-school-entry-group-member:not(:last-child)::after { content: '·'; margin-left: 7px; }
.after-school-group-members { grid-column: 1 / -1; }
.after-school-group-members h3 { margin: 0 0 3px; font-size: .95rem; }
.after-school-group-members > .muted { margin: 0 0 8px; font-size: .8rem; }
.after-school-group-member-list { display: grid; gap: 7px; margin-bottom: 8px; }
.after-school-group-member-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(120px, .55fr) auto; gap: 8px; align-items: end; }
.after-school-group-member-row label { min-width: 0; }
.after-school-group-member-remove { align-self: end; margin-bottom: 7px; }
.after-school-group-class-list { display: grid; gap: 2px; }
.after-school-group-total-line { display: inline-flex; align-items: center; gap: 4px; width: max-content; max-width: 100%; margin-top: 2px; white-space: nowrap; }
.after-school-group-total-line > strong { font-size: .82rem; }
.after-school-group-capacity-error { color: var(--error-text); font-size: .77rem; }
.after-school-entry-educators { margin: 10px 0; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: 5px; }
.after-school-entry-educators legend { padding: 0 4px; font-size: .82rem; font-weight: 700; }
.after-school-entry-educator-list { display: grid; gap: 7px; width: 100%; max-width: 600px; }
.after-school-entry-educator-row { display: grid; grid-template-columns: minmax(0, 520px) auto; gap: 8px; align-items: end; }
.after-school-entry-educator-row label { min-width: 0; }
.after-school-educator-add { margin-top: 8px; }
.after-school-educator-remove { min-height: 28px; margin: 0; padding: 4px 7px; border: 0; background: transparent; color: var(--error-text); font: inherit; font-size: .78rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.after-school-educator-remove:hover { color: #8f2929; }
.after-school-educator-remove:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.after-school-plan-table td { vertical-align: top; }
.after-school-educator-line { display: block; margin-bottom: 2px; }
.teacher-group-after-school-entries { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin: 7px 0; }
.teacher-group-after-school-entries h3 { width: 100%; margin: 0; font-size: .8rem; }
.teacher-group-after-school-entry { display: inline-flex; flex-direction: column; padding: 3px 5px; border: 1px solid #d79a56; border-radius: 3px; background: #fff5e8; color: #8a5118; font-size: .75rem; line-height: 1.15; text-decoration: none; }
.teacher-group-after-school-entry:hover, .teacher-group-after-school-entry:focus-visible { color: #744412; border-color: #c8873f; background: #fff0df; }
.school-plan-group-after-school { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.school-plan-group-after-school h3 { margin: 0 0 6px; font-size: .82rem; }
.school-plan-after-school-help { margin: 0 0 5px; font-size: .72rem; }
.school-plan-after-school-grid-wrap { margin-bottom: 7px; }
.school-plan-after-school-grid { table-layout: fixed; font-size: .68rem; }
.school-plan-after-school-grid th, .school-plan-after-school-grid td { min-width: 104px; }
.school-plan-after-school-grid > thead th:not(:first-child) { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-plan-after-school-grid .after-school-grid-cell { position: relative; min-height: 44px; }
.school-plan-after-school-grid .school-plan-after-school-entry { min-height: 38px; padding: 3px; font-size: .64rem; }
.school-plan-after-school-grid .school-plan-after-school-entry strong,
.school-plan-after-school-grid .school-plan-after-school-entry span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-plan-group-after-school-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 5px; }
.school-plan-group-after-school-employee { min-width: 0; padding: 4px 5px; border: 1px solid #ead5b8; background: #fffaf3; font-size: .72rem; }
.school-plan-group-after-school-employee > strong, .school-plan-group-after-school-employee > a:not(.school-plan-group-after-school-add) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-plan-group-after-school-employee > a:not(.school-plan-group-after-school-add) { color: #8a5118; text-decoration: none; }
.school-plan-group-after-school-employee > button[data-after-school-drag-source] { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: #8a5118; font: inherit; line-height: inherit; text-align: left; cursor: pointer; }
.school-plan-group-after-school-employee > button[data-after-school-drag-source]:hover, .school-plan-group-after-school-employee > button[data-after-school-drag-source]:focus-visible { color: #663b11; text-decoration: underline; }
.school-plan-group-after-school-add { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 3px; border: 1px solid #d79a56; border-radius: 3px; color: #8a5118; text-decoration: none; }
@media (max-width: 900px) { .after-school-group-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .after-school-group-member-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .after-school-week-grid th, .after-school-week-grid td { min-width: 96px; } .school-plan-after-school-grid th, .school-plan-after-school-grid td { min-width: 88px; } }
@media (max-width: 640px) { .after-school-group-entry-grid, .after-school-group-member-row, .after-school-entry-educator-row { grid-template-columns: minmax(0, 1fr); } .after-school-group-member-remove { justify-self: start; margin-bottom: 0; } .after-school-educator-remove { justify-self: start; } .after-school-week-grid th, .after-school-week-grid td { min-width: 84px; padding: 3px; } .school-plan-after-school-grid th, .school-plan-after-school-grid td { min-width: 78px; } }
@media (max-width: 640px) { .teacher-plan-shared-axis { flex-basis: 84px; width: 84px; min-width: 84px; } .teacher-day-plan-group { grid-template-columns: minmax(64px, 1fr) minmax(64px, 1fr); min-width: 128px; } }
@media (max-width: 640px) { .teacher-timeline-board { grid-template-columns: 70px repeat(var(--teacher-timeline-day-count), minmax(108px, 1fr)); } .teacher-timeline-time-axis, .teacher-timeline-time-header { min-width: 70px; } .teacher-timeline-header, .teacher-timeline-day { min-width: 108px; } }
@media (max-width: 640px) { .after-school-hours-form label { flex: 1 1 120px; } .after-school-hours-form button { flex-basis: 100%; } }
.duty-edit-page > h1 { margin-bottom: 6px; }
.duty-edit-selector-panel, .duty-edit-table-panel { margin: 8px 0; padding: 9px 10px; }
.duty-edit-selector-panel label { display: inline-grid; gap: 3px; font-size: 0.78rem; }
.duty-edit-selector-panel select { min-height: 28px; padding: 4px 6px; font-size: 0.82rem; }
.duty-edit-teacher-selectors { display: grid; grid-template-columns: repeat(3, minmax(0, 320px)); align-items: start; gap: 10px 24px; max-width: 100%; }
.duty-edit-selector-panel .duty-edit-teacher-selector { display: grid; min-width: 0; gap: 5px; }
.duty-edit-teacher-selector .duty-edit-availability-select { min-width: 0; margin-top: 0; }
.duty-edit-zone-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #dbe4e8; }
.duty-edit-zone-tool { display: inline-flex; align-items: center; gap: 5px; }
.duty-edit-zone-tool label { display: inline-flex; grid-template-columns: none; align-items: center; gap: 5px; margin: 0; color: var(--text); font-size: 0.74rem; cursor: pointer; }
.duty-edit-zone-tool input { flex: 0 0 auto; width: auto; margin: 0; }
.duty-edit-zone-tools-status { flex-basis: 100%; min-height: 1em; margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.2; }
.duty-edit-zone-tools-status:empty { display: none; }
.duty-edit-version-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 3px 8px; margin: 5px 0; }
.duty-edit-version-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 5px; margin: 0; font-size: 0.78rem; line-height: 1.2; white-space: nowrap; }
.duty-edit-version-toggle input { flex: 0 0 auto; width: auto; margin: 0; }
.duty-edit-version-row .app-tooltip-icon { margin-left: -3px; }
/* Różnice wersji są odrębnym, tylko-obrysowym stanem. Dzięki temu nie
   zastępują kolorów A/B, dostępnych miejsc ani rzeczywistych konfliktów. */
.duty-edit-page:not(.duty-edit-show-version-changes) .duty-preview-changed-cell { background: transparent; outline: 0; }
.duty-edit-page:not(.duty-edit-show-version-changes) .duty-change-marker,
.duty-edit-page:not(.duty-edit-show-version-changes) .duty-edit-removed-change { display: none; }
.duty-edit-page.duty-edit-show-version-changes .duty-preview-changed-cell { background: transparent; outline: 1px dashed #5b7e93; outline-offset: -2px; }
.duty-edit-page.duty-edit-show-version-changes .duty-change-marker { display: inline-flex; }
.duty-edit-page.duty-edit-show-version-changes .duty-edit-removed-change { display: inline-flex; }
.duty-edit-availability-select { pointer-events: auto; }
.duty-edit-availability-select[data-duty-edit-availability-input].duty-edit-filter-select-active { border-color: #2563eb; background: #e2f0ff; }
.duty-edit-availability-select[data-duty-edit-comparison-input].duty-edit-filter-select-active { border-color: #7c3aed; background: #f2eaff; }
.duty-edit-availability-select[data-duty-edit-comparison-c-input].duty-edit-filter-select-active { border-color: #b7791f; background: #fff6df; }
.duty-edit-chip-assigned.duty-edit-filter-teacher-a:not(.duty-edit-chip-conflict) { border-color: #2563eb; background: #e2f0ff; }
.duty-edit-chip-assigned.duty-edit-filter-teacher-b:not(.duty-edit-chip-conflict) { border-color: #7c3aed; background: #f2eaff; }
.duty-edit-chip-assigned.duty-edit-filter-teacher-c:not(.duty-edit-chip-conflict) { border-color: #b7791f; background: #fff6df; }
.duty-edit-show-outside-zones .duty-edit-chip-assigned:has([data-duty-edit-outside-zone="1"]),
.duty-edit-show-outside-zones [data-duty-edit-outside-zone="1"] { border-color: #c7771f; background: #fff4df; color: #7a4711; box-shadow: inset 0 0 0 1px #efc98f; }
.duty-edit-chip-assigned.duty-edit-zone-fix-candidate { border-color: #2f7d65; background: #eaf8f1; box-shadow: inset 0 0 0 1px #8dc8b3; }
.duty-edit-chip-assigned.duty-edit-pair-swap-candidate { border-color: #6451aa; background: #f0edff; box-shadow: inset 0 0 0 1px #b6ace6; }
.duty-edit-zone-fix-candidate.duty-edit-pair-swap-candidate { border-color: #306f83; background: #e9f5f8; box-shadow: inset 0 0 0 1px #91c3cf; }
.duty-edit-swap-mode-active .duty-edit-drop-placeholder.duty-edit-slot-drop-valid { border-color: #6451aa; background: #f0edff; color: #49388a; }
.duty-edit-table td.duty-edit-availability-cell { background: #eef8f2; box-shadow: inset 0 0 0 1px #a9d6ba; }
.duty-edit-availability-status { min-height: 0; margin: 0; color: var(--muted); font-size: 0.74rem; line-height: 1.2; }
.duty-edit-availability-status:empty { display: none; }
.duty-edit-availability-status.duty-edit-availability-status-active { color: #2f6751; font-weight: 700; }
.duty-edit-removed-change { display: none; align-items: center; gap: 2px; margin-top: 2px; color: #0f766e; font-size: 0.68rem; }
.duty-preview-show-changes .duty-edit-removed-change { display: inline-flex; }
.duty-edit-add-with-marker { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.duty-edit-instruction { margin: 5px 0; color: var(--muted); font-size: 0.82rem; }
.duty-edit-page .save-status:empty { display: none; }
.duty-staffing-alerts { margin: 6px 0; padding: 5px 7px; border: 1px solid #d9a0a0; border-radius: 4px; background: #fff7f7; color: #823535; font-size: 0.76rem; line-height: 1.3; }
.duty-staffing-alerts details { margin: 0; }
.duty-staffing-alerts summary { cursor: pointer; font-weight: 600; }
.duty-staffing-alerts ul { margin: 3px 0 0; padding-left: 16px; }
.duty-preview-staffing-alerts { max-width: 100%; }
.duty-edit-table-wrap { margin: 0; }
.duty-edit-table { min-width: 720px; font-size: 0.74rem; }
.duty-edit-table th, .duty-edit-table td { position: relative; padding: 3px 4px; vertical-align: middle; text-align: center; }
.duty-edit-table thead th { position: sticky; top: 0; z-index: 2; min-width: 92px; background: #edf4f6; white-space: normal; overflow-wrap: anywhere; }
.duty-edit-table thead th:first-child, .duty-edit-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 3; min-width: 92px; background: #f8fbfc; text-align: left; white-space: nowrap; }
.duty-edit-table thead th:first-child { z-index: 4; background: #edf4f6; }
.duty-edit-day-row th { padding: 3px 5px; border-top: 1px solid #c9d8de; border-bottom: 1px solid #d9e3e7; background: #f1f6f7; color: var(--navy-dark); font-size: 0.8rem; text-align: left; }
.duty-edit-slots { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-width: 58px; }
.duty-edit-overstaffed-cell { background: #fff8f8; }
.duty-edit-overstaffed-group { padding: 3px; border: 1px solid #d98a8a; border-radius: 4px; background: #fff1f1; }
.duty-edit-chip { display: inline-flex; align-items: center; gap: 1px; max-width: 100%; box-sizing: border-box; }
.duty-edit-chip-assigned { min-height: 20px; padding: 1px 2px 1px 4px; border: 1px solid #90a8b4; border-radius: 3px; background: #f9fbfc; }
.duty-edit-chip-conflict { border-color: var(--error-text); background: #fbecec; }
.duty-edit-chip-overstaffed { border-color: #c77878; background: #fff7f7; }
.duty-edit-drag-preview { position: fixed; z-index: 1000; display: inline-flex; align-items: center; min-height: 20px; max-width: min(180px, calc(100vw - 24px)); padding: 1px 5px; box-sizing: border-box; overflow: hidden; border: 1px solid #608592; border-radius: 3px; background: #f9fbfc; box-shadow: 0 2px 7px rgb(20 50 60 / 0.22); color: var(--text); font-size: 0.72rem; line-height: 1.1; pointer-events: none; user-select: none; white-space: nowrap; text-overflow: ellipsis; }
.duty-edit-slot { min-width: 52px; min-height: 22px; padding: 2px 4px; border: 1px solid #90a8b4; border-radius: 3px; background: #f9fbfc; color: var(--text); font: inherit; font-size: 0.72rem; line-height: 1.1; cursor: grab; white-space: nowrap; }
.duty-edit-chip-assigned .duty-edit-slot { min-width: 0; min-height: 18px; padding: 0; border: 0; border-radius: 0; background: transparent; outline: 0; outline-offset: 0; box-shadow: none; }
.duty-edit-slot[data-duty-edit-drag-source] { touch-action: manipulation; }
.duty-edit-slot:hover, .duty-edit-slot:focus { border-color: var(--navy); background: #e5eff2; outline: 1px solid var(--navy); }
.duty-edit-chip-assigned:hover, .duty-edit-chip-assigned:focus-within { border-color: var(--navy); background: #e5eff2; }
.duty-edit-chip-assigned .duty-edit-slot:hover, .duty-edit-chip-assigned .duty-edit-slot:focus { border: 0; background: transparent; outline: 0; box-shadow: none; }
.duty-edit-slot:active { cursor: grabbing; }
.duty-edit-slot-empty { color: var(--muted); background: #fff; cursor: default; }
.duty-edit-slot-empty:hover, .duty-edit-slot-empty:focus { background: #f5f8f9; }
.duty-edit-missing-slot { min-width: 32px; min-height: 20px; padding: 1px 4px; border: 1px dashed #c77878; border-radius: 3px; background: #fff7f7; color: var(--error-text); font: inherit; font-size: 0.68rem; line-height: 1; cursor: pointer; }
.duty-edit-missing-slot.duty-edit-slot-drop-valid { border-style: solid; border-color: #558c76; background: #eef8f1; color: #2f6751; }
.duty-edit-drop-source-hidden { display: none !important; }
.duty-edit-drop-placeholder { position: absolute; z-index: 6; top: 50%; right: 0; left: 0; display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 19px; margin: 0; padding: 1px 4px; box-sizing: border-box; transform: translateY(-50%); border: 1px dashed #558c76; border-radius: 3px; background: #e6f7ec; color: #1f5b43; font: inherit; font-size: 0.64rem; font-weight: 600; line-height: 1; cursor: copy; }
.duty-edit-drop-placeholder.duty-edit-slot-drop-occupied { border-color: #90a8b4; background: #f4f8f9; color: #526b75; }
.duty-edit-drop-placeholder.duty-edit-slot-drop-over {
    border: 2px solid #23714f;
    background: #d9f3e3;
    box-shadow: 0 2px 6px rgb(35 113 79 / 28%), inset 0 0 0 1px #8acda7;
    color: #174d35;
    font-weight: 700;
}
.duty-edit-drop-placeholder.duty-edit-slot-drop-invalid { border-color: var(--error-text); background: #fff1f1; color: var(--error-text); cursor: not-allowed; }
.duty-edit-drop-placeholder.duty-edit-slot-drop-invalid::after { content: none; }
.duty-edit-slot-conflict { border-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.duty-edit-slot-drop-over {
    border-color: #2f6751;
    background: #f4fff7;
    box-shadow: 0 1px 4px rgb(47 103 81 / 22%), inset 0 0 0 1px #83bea0;
    color: #1f5b43;
}
.duty-edit-slot-drop-invalid { border-color: var(--error-text); background: #fff1f1; color: var(--error-text); }
.duty-edit-slot-drop-valid { border-color: #558c76; background: #eef8f1; box-shadow: inset 0 0 0 1px #a8d3b8; }
.duty-edit-slot-drop-occupied { border-color: #90a8b4; background: #f4f8f9; }
.duty-edit-chip-assigned .duty-edit-slot-drop-invalid { background: #fff1f1; color: var(--error-text); }
.duty-edit-chip-assigned:has(.duty-edit-slot-dragging) { border-color: var(--navy); background: #e5eff2; opacity: 0.55; }
.duty-edit-chip-assigned:has(.duty-edit-slot-drop-over) {
    border-color: #2f6751;
    background: #f4fff7;
    box-shadow: 0 1px 4px rgb(47 103 81 / 22%), inset 0 0 0 1px #83bea0;
}
.duty-edit-chip-assigned:has(.duty-edit-slot-drop-invalid) { border-color: var(--error-text); background: #fff1f1; color: var(--error-text); }
.duty-edit-chip-assigned:has(.duty-edit-slot-drop-valid) { border-color: #558c76; background: #eef8f1; box-shadow: inset 0 0 0 1px #a8d3b8; }
.duty-edit-chip-assigned:has(.duty-edit-slot-drop-occupied) { border-color: #90a8b4; background: #f4f8f9; }
.duty-edit-chip-assigned .duty-edit-slot-drop-over, .duty-edit-chip-assigned .duty-edit-slot-drop-invalid, .duty-edit-chip-assigned .duty-edit-slot-drop-valid, .duty-edit-chip-assigned .duty-edit-slot-drop-occupied { border: 0; background: transparent; box-shadow: none; }
.duty-edit-chip-assigned .duty-edit-slot-drop-over {
    border: 1px dashed #2f6751;
    background: #f4fff7;
    box-shadow: 0 1px 4px rgb(47 103 81 / 22%), inset 0 0 0 1px #83bea0;
    color: #1f5b43;
    font-weight: 700;
}
.duty-edit-slot, .duty-edit-add { position: relative; }
.duty-edit-slot-drop-invalid::after, .duty-edit-add.duty-edit-slot-drop-invalid::after { position: absolute; z-index: 7; top: calc(100% + 2px); left: 50%; display: block; width: max-content; max-width: 150px; margin: 0; padding: 1px 2px; transform: translateX(-50%); border-radius: 2px; background: #fff7f7; color: var(--error-text); content: attr(data-duty-edit-invalid-label); font-size: 0.58rem; font-weight: 700; line-height: 1; pointer-events: none; }
.duty-edit-chip-assigned .duty-edit-slot-dragging { opacity: 1; }
.duty-edit-slot-drag-ready, .duty-edit-slot-dragging { user-select: none; }
.duty-edit-slot-drag-ready { outline: 2px solid rgb(36 66 92 / 0.38); outline-offset: 1px; }
.duty-edit-slot-dragging { opacity: 0.55; }
.duty-edit-outside-coverage { color: var(--muted); background: #fafafa; }
.duty-edit-add { width: 22px; min-width: 22px; height: 22px; min-height: 22px; padding: 0; border: 1px solid #c77878; border-radius: 3px; background: #fff7f7; color: var(--error-text); font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer; }
.duty-edit-add:hover, .duty-edit-add:focus { border-color: var(--error-text); background: #fbecec; outline: 1px solid var(--error-text); }
.duty-edit-add-panel { position: fixed; z-index: 30; display: flex; flex-direction: column; width: min(260px, calc(100vw - 16px)); max-height: calc(100vh - 16px); box-sizing: border-box; padding: 6px; border: 1px solid #90a8b4; border-radius: 4px; background: #fff; box-shadow: 0 3px 12px rgb(20 50 60 / 0.2); }
.duty-edit-add-search { width: 100%; min-height: 25px; box-sizing: border-box; margin: 0 0 5px; padding: 3px 5px; font-size: 0.74rem; }
.duty-edit-add-status { margin: 0 0 5px; padding: 3px 5px; border: 1px solid #d8a5a5; border-radius: 3px; background: #fff7f7; color: var(--error-text); font-size: 0.68rem; line-height: 1.25; }
.duty-edit-add-options { min-height: 0; max-height: 180px; overflow-y: auto; }
.duty-edit-add-option { display: block; width: 100%; min-height: 24px; padding: 3px 5px; border: 0; border-bottom: 1px solid #edf1f2; background: #fff; color: var(--text); font: inherit; font-size: 0.73rem; line-height: 1.15; text-align: left; }
.duty-edit-add-option:hover, .duty-edit-add-option:focus { background: #e5eff2; outline: 1px solid var(--navy); }
.duty-edit-add-option[disabled] { background: #fff5f5; color: var(--error-text); cursor: not-allowed; opacity: 1; }
.duty-edit-add-option-confirmable-conflict { background: #fff5f5; color: var(--error-text); cursor: pointer; pointer-events: auto; }
.duty-edit-add-option-confirmable-conflict:hover, .duty-edit-add-option-confirmable-conflict:focus { background: #fbecec; outline-color: var(--error-text); }
.duty-edit-add-option-reason { display: block; margin-top: 1px; font-size: 0.62rem; }
.duty-edit-remove { min-width: 13px; min-height: 16px; padding: 0 2px; border: 0; border-radius: 2px; background: transparent; color: var(--error-text); font: inherit; font-size: 0.76rem; line-height: 1; cursor: pointer; }
.duty-edit-remove:hover, .duty-edit-remove:focus { background: transparent; color: #8f3131; outline: 0; box-shadow: none; }
.duty-edit-remove-confirmation { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 0.68rem; }
.duty-edit-remove-confirmation button { min-height: 20px; padding: 1px 4px; font: inherit; }
.app-stale-view-toast { position: fixed; z-index: 2200; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); bottom: auto; left: auto; display: flex; align-items: center; gap: 9px; box-sizing: border-box; width: min(360px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 7px 8px 7px 10px; border: 1px solid #d5b46f; border-radius: 5px; background: #fff9e9; box-shadow: 0 4px 16px rgb(45 57 68 / .18); color: #654c13; font-size: .77rem; line-height: 1.25; }
.app-stale-view-toast[hidden] { display: none; }
.app-stale-view-toast__message { min-width: 0; flex: 1 1 auto; }
.app-stale-view-toast__actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.app-stale-view-toast .secondary { min-height: 25px; padding: 3px 6px; font-size: .73rem; }
.app-stale-view-toast__close { display: inline-grid; width: 23px; min-width: 23px; height: 23px; min-height: 23px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font-size: 1.05rem; line-height: 1; place-items: center; }
.app-stale-view-toast__close:hover, .app-stale-view-toast__close:focus-visible { background: rgb(101 76 19 / .12); }
@media (max-width: 560px) { .app-stale-view-toast { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: min(360px, calc(100vw - 24px)); max-width: calc(100vw - 24px); } }

@media (max-width: 900px) {
    .duty-edit-teacher-selectors { grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: none; }
    .admin-compact-page .class-form-row--basic,
    .admin-compact-page .class-form-row--teachers,
    .admin-compact-page .class-form-row--schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .admin-compact-page .class-form-row--basic,
    .admin-compact-page .class-form-row--teachers,
    .admin-compact-page .class-form-row--schedule { grid-template-columns: minmax(0, 1fr); }
    .admin-compact-page .employee-list-filter label { flex: 1 1 100%; min-width: 0; }
    .admin-compact-page .employee-list-filter > .admin-action { margin-bottom: 0; }
}

@media (max-width: 760px) {
    .duty-edit-version-toggle { font-size: 0.72rem; }
    .duty-edit-slot { min-height: 32px; }
    .duty-edit-table { font-size: 0.8rem; }
}

@media (max-width: 760px) {
    .admin-compact-page { font-size: 0.84rem; }
    .admin-compact-page .panel { padding: 10px; }
    .admin-compact-page form .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
    .admin-compact-page input, .admin-compact-page select, .admin-compact-page button, .admin-compact-page .button { min-height: 32px; }
    .admin-compact-page .inline-form button { min-height: 32px; }
    .admin-compact-page th, .admin-compact-page td { padding: 5px; }
    .admin-compact-page .employee-limit-fields { grid-template-columns: 1fr; }
    .admin-compact-page .employee-list-table .employee-actions { min-width: 205px; white-space: nowrap; }
    .admin-compact-page .employee-list-table .employee-actions .admin-table-actions { flex-wrap: nowrap; }
    .admin-compact-page .sortable-handle { min-height: 28px; }
}
/* Główne menu Planera szkolnego. */
.site-nav-inner { display: flex; align-items: stretch; gap: 2px; position: relative; }
.site-nav-start, .site-nav-group-toggle { min-height: 46px; }
.site-nav-start { display: inline-flex !important; align-items: center; }
.site-nav-group { position: relative; }
.site-nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    height: 100%;
    margin: 0;
    padding: 12px 15px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    white-space: nowrap;
}
.site-nav-group-toggle:hover,
.site-nav-group-toggle:focus-visible,
.site-nav-group.is-active > .site-nav-group-toggle,
.site-nav-group.is-open > .site-nav-group-toggle { background: #41647a; }
.site-nav-group-toggle:focus-visible,
.site-nav a:focus-visible { outline: 3px solid #f5c451; outline-offset: -3px; }
.site-nav-group-toggle span { transition: transform 0.15s ease; }
.site-nav-group.is-open > .site-nav-group-toggle span { transform: rotate(180deg); }
.site-nav-dropdown {
    display: none;
    position: absolute;
    z-index: 50;
    top: 100%;
    left: 0;
    min-width: 245px;
    padding: 5px;
    border: 1px solid #41647a;
    border-radius: 0 0 4px 4px;
    background: var(--navy-dark);
    box-shadow: 0 8px 18px rgba(10, 25, 36, 0.28);
}
.site-nav-group.is-open > .site-nav-dropdown { display: block; }
.site-nav-dropdown a { display: block; width: 100%; padding: 9px 11px; border-radius: 2px; white-space: nowrap; }
.site-nav-group.is-active > .site-nav-group-toggle { box-shadow: inset 0 -3px #f5c451; }
.site-nav-logout { display: flex; align-items: stretch; margin: 0 0 0 auto; }
.site-nav-logout button { min-height: 46px; margin: 0; padding: 12px 15px; border: 0; border-radius: 0; background: transparent; color: #fff; font: inherit; white-space: nowrap; }
.site-nav-logout button:hover, .site-nav-logout button:focus-visible { background: #41647a; }
.site-nav-logout button:focus-visible { outline: 3px solid #f5c451; outline-offset: -3px; }

/* Etap 1C — zwarty, klasocentryczny widok przydziałów. */
.assignment-class-selector form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.assignment-class-selector label { min-width: 220px; }
.assignment-summary { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(145px, 210px)) auto; align-items: center; gap: 14px; }
.assignment-summary h2, .assignment-summary p { margin: 0 0 4px; }
.assignment-summary-stat { padding: 9px 11px; border: 1px solid var(--border); border-radius: 3px; background: #f7f9fa; }
.assignment-summary-stat span { display: block; color: var(--muted); }
.assignment-summary-stat strong { display: block; margin-top: 2px; color: var(--navy); font-size: 1.35rem; }
.assignment-summary-actions { text-align: right; }
.assignment-options { margin: 14px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: 4px; }
.assignment-options legend { padding: 0 5px; color: var(--navy-dark); font-weight: 700; }
.assignment-options > .muted { margin: 0 0 8px; }
.assignment-option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.assignment-option { padding: 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--paper); }
.assignment-option-choice, .assignment-room-option { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.assignment-option-choice input, .assignment-room-option input { width: auto; margin: 0; }
.assignment-option select { margin-top: 6px; padding: 5px 7px; }
.assignment-option small { display: block; margin-top: 4px; color: var(--muted); }
.assignment-option .assignment-suggestion { color: var(--success-text); font-weight: 700; }
.assignment-room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 7px 12px; }
.assignment-room-option { padding: 5px 7px; border: 1px solid var(--border); border-radius: 3px; }
.assignment-missing { color: var(--error-text); font-weight: 700; }
.teaching-assignment-table { min-width: 1050px; }
.teaching-assignment-table small { color: var(--muted); }

@media (max-width: 760px) {
    .site-nav-inner { width: 100%; flex-direction: column; gap: 0; padding: 5px 0; }
    .site-nav-logout { width: 100%; margin: 0; }
    .site-nav-logout button { width: 100%; min-height: 42px; justify-content: flex-start; padding: 9px 16px; }
    .site-nav-start, .site-nav-group-toggle { width: 100%; min-height: 42px; }
    .site-nav-start { padding: 9px 16px; }
    .site-nav-group-toggle { padding: 9px 16px; text-align: left; }
    .site-nav-dropdown {
        position: static;
        min-width: 0;
        padding: 3px 8px 7px 18px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #10293b;
    }
    .site-nav-dropdown a { padding: 9px 10px; white-space: normal; }
    .site-nav-group.is-active > .site-nav-group-toggle { box-shadow: inset 4px 0 #f5c451; }
    .assignment-class-selector form { align-items: stretch; }
    .assignment-class-selector label, .assignment-class-selector button { width: 100%; }
    .assignment-summary { grid-template-columns: 1fr 1fr; }
    .assignment-summary > div:first-child, .assignment-summary-actions { grid-column: 1 / -1; }
    .assignment-summary-actions { text-align: left; }
}


/* Etap 2A — centralna Edycja lekcji. */
.lesson-editor-selector form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.lesson-editor-selector label { min-width: min(340px, 100%); }
.lesson-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.lesson-editor-heading h2, .lesson-editor-heading p { margin: 0; }
.lesson-editor-heading p { margin-top: 3px; color: var(--muted); }
.lesson-editor-grid-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 4px; scrollbar-gutter: stable; }
.lesson-editor-grid-wrap:focus-visible { outline: 3px solid #5f8fb8; outline-offset: 2px; }
.lesson-editor-grid { width: 100%; min-width: 890px; margin: 0; table-layout: fixed; }
.lesson-editor-grid .lesson-editor-time-column { width: 74px; }
.lesson-editor-grid th, .lesson-editor-grid td { border: 1px solid var(--border); }
.lesson-editor-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--navy-dark); color: #fff; text-align: center; }
.lesson-editor-grid thead th:first-child { padding-right: 2px; padding-left: 2px; font-size: .7rem; }
.lesson-editor-grid tbody th { width: 74px; padding: 5px 2px; background: #f2f5f6; text-align: center; vertical-align: top; }
.lesson-editor-grid tbody th small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.74rem; font-weight: 600; line-height: 1.12; white-space: nowrap; }
.lesson-editor-grid tbody th small span { display: inline; }
.lesson-editor-cell { min-width: 145px; padding: 4px; vertical-align: top; background: var(--paper); }
.lesson-editor-cell--selected-new { position: relative; background: #f1f7fa; box-shadow: inset 0 0 0 2px #5f8fb8; }
.lesson-cell-entries { min-width: 0; }
.lesson-cell-entries--parallel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.lesson-tile { display: block; margin-bottom: 6px; padding: 7px; border: 1px solid color-mix(in srgb, var(--lesson-color) 55%, var(--border)); border-left: 5px solid var(--lesson-color); border-radius: 4px; background: color-mix(in srgb, var(--lesson-color) 10%, var(--paper)); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.lesson-cell-entries .lesson-tile:last-child { margin-bottom: 0; }
.lesson-cell-entries + .lesson-cell-add { margin-top: 4px; }
.lesson-cell-entries--parallel .lesson-tile { min-width: 0; margin: 0; padding: 5px; border-left-width: 3px; }
.lesson-cell-entries--parallel .lesson-tile strong { font-size: .76rem; line-height: 1.18; }
.lesson-cell-entries--parallel .lesson-tile span { font-size: .7rem; line-height: 1.16; }
.lesson-cell-entries--parallel .lesson-tile b,
.lesson-cell-entries--parallel .lesson-tile-inline-fix { font-size: .67rem; }
.lesson-tile:hover, .lesson-tile:focus-within { border-color: var(--lesson-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lesson-color) 28%, transparent); }
.lesson-tile-main { display: block; color: inherit; font-weight: inherit; text-decoration: none; }
.lesson-tile strong, .lesson-tile span, .lesson-tile b { display: block; }
.lesson-tile span { margin-top: 2px; font-size: 0.76rem; line-height: 1.25; }
.lesson-tile b { margin-top: 5px; font-size: 0.72rem; }
.lesson-tile--conflict { border-color: #b74848; border-left-color: #b74848; background: #fff0f0; }
.lesson-tile--conflict b { color: var(--error-text); }
.lesson-tile--warning { border-color: #d69a43; border-left-color: #d69a43; background: #fff7e8; }
.lesson-tile--warning b { color: #80521c; }
.lesson-tile.lesson-tile--selected,
.lesson-tile.lesson-tile--selected:hover,
.lesson-tile.lesson-tile--selected:focus-within { outline: 2px solid var(--navy); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(79, 124, 134, 0.2); }
.lesson-tile--selected::after { content: 'Edytujesz'; display: inline-block; margin-top: 5px; padding: 1px 5px; border-radius: 3px; background: var(--navy); color: #fff; font-size: 0.66rem; font-weight: 700; line-height: 1.35; letter-spacing: 0.02em; }
.lesson-cell-add { display: flex; width: 100%; box-sizing: border-box; align-items: center; justify-content: center; gap: 4px; padding: 4px 5px; border-radius: 3px; color: var(--navy); font-size: 0.75rem; font-weight: 700; text-align: center; text-decoration: none; }
.lesson-cell-add:hover, .lesson-cell-add:focus-visible { background: #e8f0f3; }
.lesson-cell-add--empty { min-height: 0; margin: 0; padding-top: 10px; padding-bottom: 10px; }
.lesson-cell-add--gap { border: 1px solid #d79a56; background: #fff5e8; color: #82501d; }
.lesson-cell-add--gap:hover, .lesson-cell-add--gap:focus-visible { border-color: #b97932; background: #ffe7c5; color: #633b13; }
.lesson-cell-add--selected,
.lesson-cell-add--selected:hover,
.lesson-cell-add--selected:focus-visible { border-color: #80aabd; background: #dcecf3; color: #234f61; box-shadow: inset 0 0 0 1px #80aabd; }
.lesson-entry-form-panel { scroll-margin-top: 12px; }
.graphic-plan-cell--selected { background: #e4f1f6; box-shadow: inset 0 0 0 2px #4c8094; }
.graphic-plan-lesson-editor { margin-top: 14px; scroll-margin-top: 12px; }
.admin-compact-page .lesson-entry-form-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; }
.admin-compact-page .lesson-entry-form-heading > h2 { flex: 1 1 auto; min-width: 0; }
.admin-compact-page .lesson-editor-context-link { margin: 0; font-size: .78rem; white-space: nowrap; }
@media (max-width: 560px) { .admin-compact-page .lesson-entry-form-heading { align-items: flex-start; } .admin-compact-page .lesson-entry-form-heading > h2 { flex-basis: 100%; } }
.lesson-entry-core-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lesson-entry-core-fields label { min-width: 0; }
.lesson-entry-class-choice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.lesson-entry-class-choice label { min-width: 0; }
.lesson-entry-options { margin: 14px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: 4px; }
.lesson-entry-options legend { padding: 0 5px; color: var(--navy-dark); font-weight: 700; }
.lesson-entry-options--targets { margin-top: 8px; padding: 4px 9px 5px; }
.lesson-entry-options--targets legend { padding: 0 4px; line-height: 1.1; }
.lesson-entry-options--targets .lesson-entry-targets { gap: 1px 10px; }
.lesson-entry-options--targets .lesson-entry-targets .checkbox { min-height: 22px; margin: 0; padding: 0; line-height: 1.15; }
.lesson-entry-options > .muted { margin: 0 0 8px; }
.lesson-entry-targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 7px 12px; }
.lesson-entry-targets .checkbox, .lesson-entry-teacher .checkbox, .lesson-force-confirm .checkbox { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lesson-entry-targets input, .lesson-entry-teacher input, .lesson-force-confirm input { width: auto; margin: 0; }
.lesson-quick-groups { margin-top: 10px; padding: 10px 12px; border: 1px solid #8eb4c2; border-radius: 4px; background: #f2f8fa; }
.lesson-quick-groups > strong { color: var(--navy-dark); }
.lesson-quick-groups > .field-hint { margin: 3px 0 9px; }
.lesson-quick-groups-grid { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(80px, .42fr) minmax(160px, 1fr) minmax(80px, .42fr); gap: 8px; }
.lesson-quick-groups-grid label { min-width: 0; }
.lesson-quick-groups-actions { margin-top: 9px; align-items: center; }
.lesson-quick-groups-actions a { font-size: .78rem; }
.lesson-inactive-groups-hint { margin-top: 9px; padding: 8px 10px; border: 1px solid #d79a56; border-radius: 3px; background: #fff5e8; color: #82501d; }
.lesson-entry-teachers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.lesson-entry-teacher { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr); align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 3px; }
.lesson-entry-teacher select { padding: 5px 7px; }
.lesson-entry-teacher select:disabled { opacity: 0.58; }
.lesson-conflict-box, .lesson-warning-box { margin: 10px 0; padding: 10px 12px; border: 1px solid; border-radius: 4px; }
.lesson-conflict-box { border-color: #c77878; background: #fff0f0; color: var(--error-text); }
.lesson-warning-box { border-color: #d79a56; background: #fff5e8; color: #82501d; }
.lesson-conflict-box ul, .lesson-warning-box ul { margin: 6px 0 0; padding-left: 20px; }
.lesson-force-confirm { margin-top: 14px; padding: 10px 12px; border: 2px solid #b74848; border-radius: 4px; background: #fff7f7; }
.lesson-force-confirm small { display: block; margin-top: 5px; color: var(--error-text); }
.lesson-archive-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.lesson-assignment-inline-editor { margin: 10px 0 14px; border: 1px solid #d79a56; border-radius: 4px; background: #fffaf1; scroll-margin-top: 12px; }
.lesson-assignment-inline-editor > summary { padding: 10px 12px; color: #70470d; font-weight: 700; cursor: pointer; }
.lesson-assignment-inline-content { padding: 0 12px 12px; }
.lesson-assignment-inline-content > .field-hint { margin-top: 0; }
.lesson-assignment-inline-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lesson-assignment-inline-grid label { min-width: 0; }

@media (max-width: 980px) {
    .lesson-entry-core-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lesson-entry-class-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lesson-assignment-inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lesson-quick-groups-grid { grid-template-columns: minmax(160px, 1fr) minmax(80px, .42fr); }
}

@media (max-width: 620px) {
    .lesson-assignment-inline-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .lesson-editor-selector form { align-items: stretch; }
    .lesson-editor-selector label, .lesson-editor-selector button { width: 100%; }
    .lesson-editor-heading { align-items: stretch; flex-direction: column; }
    .lesson-editor-heading .button { text-align: center; }
    .lesson-editor-grid { min-width: 820px; }
    .lesson-entry-core-fields { grid-template-columns: minmax(0, 1fr); }
    .lesson-entry-class-choice { grid-template-columns: minmax(0, 1fr); }
    .lesson-quick-groups-grid { grid-template-columns: minmax(0, 1fr); }
    .lesson-entry-targets, .lesson-entry-teachers { grid-template-columns: minmax(0, 1fr); }
    .lesson-entry-teacher { grid-template-columns: minmax(0, 1fr); }
}
/* Spójne linki i zwarte działania w tabelach administracyjnych. */
a:link,
a:visited,
a:hover,
a:focus,
a:active { text-decoration: none; }
main a:not(.button):not(.lesson-tile):not(.lesson-tile-main):not(.lesson-tile-inline-fix):not(.lesson-cell-add) { color: var(--navy); font-weight: 600; transition: color 140ms ease, background-color 140ms ease; }
main a:not(.button):not(.lesson-tile):not(.lesson-tile-main):not(.lesson-tile-inline-fix):not(.lesson-cell-add):hover { color: var(--navy-dark); background: #eaf2f4; }
a:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.duty-summary-sort-link:hover,
.duty-summary-sort-link:focus { text-decoration: none; }

.admin-table-actions a,
.admin-compact-page .employee-action-link,
.admin-compact-page .employee-page-heading a { color: var(--navy); font-weight: 600; text-decoration: none; transition: color 140ms ease, background-color 140ms ease; }
.admin-table-actions button,
.admin-table-actions .row-action,
.admin-compact-page table .text-action,
.admin-compact-page table .duty-block-delete-link { min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--navy); font: inherit; font-size: 0.76rem; font-weight: 600; line-height: inherit; text-decoration: none; cursor: pointer; transition: color 140ms ease, background-color 140ms ease; }
.admin-table-actions a:hover,
.admin-table-actions a:focus,
.admin-table-actions button:hover,
.admin-table-actions button:focus,
.admin-table-actions .row-action:hover,
.admin-table-actions .row-action:focus,
.admin-compact-page table .text-action:hover,
.admin-compact-page table .text-action:focus,
.admin-compact-page table .duty-block-delete-link:hover,
.admin-compact-page table .duty-block-delete-link:focus { background: #eaf2f4; color: var(--navy-dark); outline: 1px solid currentColor; }
.admin-table-actions .row-action-warning,
.admin-table-actions button.danger,
.admin-compact-page table .text-action.danger,
.admin-compact-page table .duty-block-delete-link { color: var(--error-text); }
.admin-table-actions .row-action-positive { color: #28633c; }

/* Formularz klasy: ikony informacyjne są częścią wiersza etykiety. */
.admin-compact-page .class-form-label { display: inline-flex; align-items: center; align-self: flex-start; gap: 4px; min-width: 0; margin: 0; line-height: 1.2; }
.admin-compact-page .class-form-label > label { min-width: 0; margin: 0; }
.admin-compact-page .class-form-field > input,
.admin-compact-page .class-form-field > select { width: 100%; min-width: 0; box-sizing: border-box; }
.admin-compact-page .class-education-stage { margin:.35rem 0 0; color:var(--muted); font-size:.72rem; line-height:1.3; }
.admin-compact-page .class-list-education-stage { display:block; margin-top:2px; color:var(--muted); font-size:.72rem; line-height:1.25; }
.admin-compact-page .class-form-field .info-tooltip-button,
.admin-compact-page .class-form-row--checks .info-tooltip-button { display: inline-flex; flex: 0 0 18px; align-items: center; justify-content: center; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--navy); font: inherit; font-size: 0.78rem; line-height: 1; box-shadow: none; }
.admin-compact-page .class-form-field .info-tooltip-button:hover,
.admin-compact-page .class-form-field .info-tooltip-button:focus,
.admin-compact-page .class-form-row--checks .info-tooltip-button:hover,
.admin-compact-page .class-form-row--checks .info-tooltip-button:focus { border: 0; border-radius: 50%; background: #e4eff2; color: var(--navy-dark); outline: 2px solid var(--navy); outline-offset: 2px; box-shadow: none; }
.admin-compact-page .class-form-row--checks { flex-wrap: wrap; gap: 6px 18px; }
.admin-compact-page .class-checkbox-control,
.admin-compact-page .class-form-row--checks .checkbox { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; margin: 0; padding: 0; white-space: nowrap; }
.admin-compact-page .class-checkbox-control .checkbox { flex: 0 0 auto; }

/* Wąskie, dostępne uchwyty kolejności dla klas i przedmiotów. */
.admin-compact-page .sortable-order-column { width: 1%; padding-right: 4px; padding-left: 4px; white-space: nowrap; text-align: center; }
.admin-compact-page table[data-sortable-type="classes"] .sortable-controls { display: inline-flex; flex-wrap: nowrap; min-width: 0; }
.admin-compact-page table[data-sortable-type="classes"] .sortable-handle,
.admin-compact-page .subjects-table .sortable-handle { display: inline-flex; flex: 0 0 24px; align-items: center; justify-content: center; width: 24px; min-width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 1px solid #91a9b5; border-radius: 3px; background: #f8fbfc; color: var(--navy); font-size: 0.9rem; line-height: 1; cursor: grab; touch-action: manipulation; }
.admin-compact-page table[data-sortable-type="classes"] .sortable-handle:hover,
.admin-compact-page table[data-sortable-type="classes"] .sortable-handle:focus,
.admin-compact-page .subjects-table .sortable-handle:hover,
.admin-compact-page .subjects-table .sortable-handle:focus { background: #e4eff2; outline: 2px solid var(--navy); outline-offset: 1px; }
.admin-compact-page .sortable-row-keyboard-moving > td { box-shadow: inset 0 2px 0 var(--navy), inset 0 -2px 0 var(--navy); }
.admin-compact-page .sortable-order-note { margin-bottom: 4px; font-size: 0.76rem; }

@media (max-width: 760px) {
    .admin-table-actions button,
    .admin-table-actions .row-action,
    .admin-compact-page table .text-action,
    .admin-compact-page table .duty-block-delete-link { min-height: 0; padding: 0; }
    .admin-compact-page .class-form-field .info-tooltip-button,
    .admin-compact-page .class-form-row--checks .info-tooltip-button { width: 18px; min-width: 18px; height: 18px; min-height: 18px; padding: 0; }
    .admin-compact-page .class-form-row--checks { flex-wrap: wrap; gap: 6px 12px; }
}
/* Korekta wspólnych interakcji: tooltipy, akcje tekstowe i menu mobilne. */
button.info-tooltip-button,
button.info-tooltip-button:hover,
button.info-tooltip-button:active,
button.info-tooltip-button:focus { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--navy); line-height: 1; text-decoration: none; transform: none; outline: 0; }
button.info-tooltip-button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

main .admin-table-actions a:not(.button):not(.lesson-tile):not(.lesson-cell-add),
main .admin-table-actions button,
main .admin-table-actions .row-action,
main .employee-action-link,
main table .text-action,
main table .action-link,
main .plan-saved-version-actions .row-action,
main .lesson-archive-form .row-action { display: inline; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--navy); font: inherit; font-size: 0.76rem; font-weight: 600; line-height: inherit; text-decoration: none; transform: none; cursor: pointer; }
main .admin-table-actions a:not(.button):not(.lesson-tile):not(.lesson-cell-add):hover,
main .admin-table-actions a:not(.button):not(.lesson-tile):not(.lesson-cell-add):active,
main .admin-table-actions a:not(.button):not(.lesson-tile):not(.lesson-cell-add):focus,
main .admin-table-actions button:hover,
main .admin-table-actions button:active,
main .admin-table-actions button:focus,
main .admin-table-actions .row-action:hover,
main .admin-table-actions .row-action:active,
main .admin-table-actions .row-action:focus,
main .employee-action-link:hover,
main .employee-action-link:active,
main .employee-action-link:focus,
main table .text-action:hover,
main table .text-action:active,
main table .text-action:focus,
main table .action-link:hover,
main table .action-link:active,
main table .action-link:focus,
main .plan-saved-version-actions .row-action:hover,
main .plan-saved-version-actions .row-action:active,
main .plan-saved-version-actions .row-action:focus,
main .lesson-archive-form .row-action:hover,
main .lesson-archive-form .row-action:active,
main .lesson-archive-form .row-action:focus { border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--navy-dark); outline: 0; text-decoration: none; transform: none; }
main .admin-table-actions a:not(.button):not(.lesson-tile):not(.lesson-cell-add):focus-visible,
main .admin-table-actions button:focus-visible,
main .employee-action-link:focus-visible,
main table .text-action:focus-visible,
main table .action-link:focus-visible,
main .plan-saved-version-actions .row-action:focus-visible,
main .lesson-archive-form .row-action:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
main .row-action--danger,
main .row-action-warning,
main .action-danger,
main .admin-table-actions form[data-confirm] button,
main .admin-table-actions button.danger,
main table .text-action.danger { color: var(--error-text); }
main .row-action--danger:hover,
main .row-action--danger:active,
main .row-action-warning:hover,
main .row-action-warning:active,
main .action-danger:hover,
main .action-danger:active,
main .admin-table-actions form[data-confirm] button:hover,
main .admin-table-actions form[data-confirm] button:active,
main .admin-table-actions button.danger:hover,
main .admin-table-actions button.danger:active,
main table .text-action.danger:hover,
main table .text-action.danger:active { color: #691d1d; }
main .row-action--success,
main .row-action-positive { color: #28633c; }
main .row-action--success:hover,
main .row-action--success:active,
main .row-action-positive:hover,
main .row-action-positive:active { color: #174c2a; }
main .row-action--muted { color: var(--muted); }
main .row-action--muted:hover,
main .row-action--muted:active { color: #3e515a; }
.admin-table-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0; }
.admin-table-actions .inline-form { display: inline-flex; align-items: center; margin: 0; }
.admin-table-actions > * + *::before { content: none; }
.row-action-separator { display: inline-block; margin: 0 0.38rem; color: var(--muted); font-weight: 400; pointer-events: none; user-select: none; }

.admin-compact-page .subjects-table tbody td,
.admin-compact-page table[data-sortable-type="classes"] tbody td { vertical-align: middle; }
.admin-compact-page .subjects-table .admin-table-actions,
.admin-compact-page table[data-sortable-type="classes"] .admin-table-actions { align-items: center; }

.site-nav-mobile-bar { display: none; }
@media (max-width: 760px) {
    .site-nav-mobile-bar { display: block; padding: 5px 0; }
    .site-nav-mobile-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; margin: 0; padding: 9px 16px; border: 0; border-radius: 0; background: transparent; color: #fff; font: inherit; text-align: left; }
    .site-nav-mobile-toggle:hover,
    .site-nav-mobile-toggle:active,
    .site-nav-mobile-toggle:focus { background: #41647a; outline: 0; }
    .site-nav-mobile-toggle:focus-visible { outline: 3px solid #f5c451; outline-offset: -3px; }
    .site-nav-inner { display: none; }
    .site-nav.is-mobile-open .site-nav-inner { display: flex; }
    .site-nav.is-mobile-open .site-nav-mobile-toggle { background: #41647a; }
}
/* Wyższa specyficzność dla reguł zwartych widoków i telefonów. */
.admin-compact-page button.info-tooltip-button,
.admin-compact-page button.info-tooltip-button:hover,
.admin-compact-page button.info-tooltip-button:active,
.admin-compact-page button.info-tooltip-button:focus,
.admin-compact-page .class-form-field button.info-tooltip-button,
.admin-compact-page .class-form-field button.info-tooltip-button:hover,
.admin-compact-page .class-form-field button.info-tooltip-button:active,
.admin-compact-page .class-form-field button.info-tooltip-button:focus,
.admin-compact-page .class-form-row--checks button.info-tooltip-button,
.admin-compact-page .class-form-row--checks button.info-tooltip-button:hover,
.admin-compact-page .class-form-row--checks button.info-tooltip-button:active,
.admin-compact-page .class-form-row--checks button.info-tooltip-button:focus { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--navy); line-height: 1; text-decoration: none; transform: none; outline: 0; }
.admin-compact-page button.info-tooltip-button:focus-visible,
.admin-compact-page .class-form-field button.info-tooltip-button:focus-visible,
.admin-compact-page .class-form-row--checks button.info-tooltip-button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.admin-compact-page .admin-table-actions > * + *::before,
.admin-table-actions > * + *::before { display: none; content: none; }
.admin-compact-page .employee-action-link:hover,
.admin-compact-page .employee-action-link:active,
.admin-compact-page .employee-action-link:focus,
.admin-compact-page .duty-block-delete-link:hover,
.admin-compact-page .duty-block-delete-link:active,
.admin-compact-page .duty-block-delete-link:focus { border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0; text-decoration: none; transform: none; }
@media (max-width: 760px) {
    .admin-compact-page .admin-table-actions .inline-form button,
    .admin-compact-page .admin-table-actions button { min-height: 0; padding: 0; }
}
/* Wspólny, semantyczny system tekstowych akcji administracyjnych. */
main .admin-action,
main .admin-action:hover,
main .admin-action:active,
main .admin-action:focus {
    display: inline;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: inherit;
    text-decoration: none;
    transform: none;
    cursor: pointer;
    outline: 0;
}
main .admin-action--primary { color: var(--navy); }
main .admin-action--success { color: #28633c; }
main .admin-action--danger { color: var(--error-text); }
main .admin-action--muted { color: var(--muted); }
main .admin-action--primary:hover,
main .admin-action--primary:active { color: var(--navy-dark); }
main .admin-action--success:hover,
main .admin-action--success:active { color: #174c2a; }
main .admin-action--danger:hover,
main .admin-action--danger:active { color: #691d1d; }
main .admin-action--muted:hover,
main .admin-action--muted:active { color: #3e515a; }
main .admin-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
@media (max-width: 760px) {
    main .admin-action { min-height: 0; padding: 0; }
}
/* Stabilne wyrównanie wspólnych akcji tabel administracyjnych. */
main .admin-table-actions,
main .admin-compact-page .admin-table-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    vertical-align: middle;
}
main .admin-table-actions .inline-form,
main .admin-compact-page .admin-table-actions .inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    vertical-align: middle;
}
main .admin-table-actions .admin-action,
main .admin-table-actions .admin-action:hover,
main .admin-table-actions .admin-action:active,
main .admin-table-actions .admin-action:focus,
main .admin-compact-page .admin-table-actions .admin-action,
main .admin-compact-page .admin-table-actions .admin-action:hover,
main .admin-compact-page .admin-table-actions .admin-action:active,
main .admin-compact-page .admin-table-actions .admin-action:focus {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transform: none;
    vertical-align: middle;
}
main .admin-table-actions .admin-action--primary { color: var(--navy); }
main .admin-table-actions .admin-action--success { color: #28633c; }
main .admin-table-actions .admin-action--danger { color: var(--error-text); }
main .admin-table-actions .admin-action--muted { color: var(--muted); }
main .admin-table-actions .admin-action--primary:hover,
main .admin-table-actions .admin-action--primary:active { color: var(--navy-dark); }
main .admin-table-actions .admin-action--success:hover,
main .admin-table-actions .admin-action--success:active { color: #174c2a; }
main .admin-table-actions .admin-action--danger:hover,
main .admin-table-actions .admin-action--danger:active { color: #691d1d; }
main .admin-table-actions .admin-action--muted:hover,
main .admin-table-actions .admin-action--muted:active { color: #3e515a; }
main .admin-table-actions .admin-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
main .admin-table-actions .row-action-separator {
    display: inline-flex;
    align-items: center;
    margin: 0 0.38rem;
    padding: 0;
    color: var(--muted);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.2;
    transform: none;
    vertical-align: middle;
}
/* Etap 1C: formularz przydziałów — stałe sekcje, bez automatycznego układu pól. */
.teaching-assignment-form {
    display: grid;
    gap: 1rem;
}
.assignment-form-section {
    display: grid;
    gap: .75rem;
    min-width: 0;
}
.assignment-form-section > h3 {
    margin: 0;
    font-size: 1rem;
}
.assignment-form-grid {
    display: grid;
    gap: .8rem;
    min-width: 0;
}
.assignment-form-grid--basic,
.assignment-form-grid--rules,
.assignment-form-grid--rooms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.assignment-form-grid--teachers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}
.assignment-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.assignment-summary-plan-name { font-size: 1rem !important; line-height: 1.25; }
.assignment-summary-actions { margin: -.25rem 0 1rem; text-align: left; }
.assignment-active-top { justify-self: start; }
.lesson-entry-teacher-selects { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.8rem; align-items:end; }
.lesson-entry-teacher-selects label { min-width:0; }
.lesson-entry-teacher-selects select { width:100%; min-width:0; }
.graphic-plan-add { display:flex; align-items:center; justify-content:center; width:100%; min-height:34px; border-radius:5px; color:#78909c; font-size:1.35rem; font-weight:700; text-decoration:none; opacity:.5; }
.graphic-plan-add:hover,.graphic-plan-add:focus-visible { background:#eaf1f4; color:var(--navy); opacity:1; text-decoration:none; }
.graphic-plan-grid--teachers thead th:not(.graphic-plan-time-head),
.graphic-plan-grid--teachers .graphic-plan-cell {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
}
.graphic-plan-grid--teachers thead th:not(.graphic-plan-time-head) {
    height: 138px;
    padding: 5px 3px;
    vertical-align: bottom;
    overflow: visible;
    text-overflow: clip;
}
.graphic-plan-teacher-name {
    display: inline-block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--navy-dark);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.05;
    white-space: nowrap;
}
.graphic-plan-shell[data-density="comfortable"] .graphic-plan-grid--teachers thead th:not(.graphic-plan-time-head),
.graphic-plan-shell[data-density="comfortable"] .graphic-plan-grid--teachers .graphic-plan-cell {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
}
.assignment-rooms-section { grid-template-columns:repeat(3,minmax(0,1fr)); }
.assignment-rooms-section > h3,.assignment-rooms-section > .message { grid-column:1/-1; }
.assignment-rooms-section .assignment-primary-room-row,.assignment-rooms-section .assignment-form-grid--rooms { display:contents; }
.assignment-rooms-section .assignment-room-add { grid-column:1/-1; order:99; justify-self:start; }
.assignment-form-field {
    display: grid;
    gap: .35rem;
    min-width: 0;
    font-weight: 600;
}
.assignment-form-field > select,
.assignment-form-field > input {
    width: 100%;
    min-width: 0;
}
.assignment-form-label {
    display: inline-flex;
    align-items: center;
    align-self: start;
    gap: .35rem;
    min-width: 0;
}
.assignment-form-label > label {
    margin: 0;
}
.assignment-form-checkbox {
    align-self: end;
    min-height: 2.7rem;
    display: inline-flex;
    align-items: center;
    font-weight: 400;
}
.teaching-assignment-form .message {
    margin: 0;
}
@media (max-width: 900px) {
    .assignment-form-grid--basic,
    .assignment-form-grid--rules,
    .assignment-form-grid--teachers,
    .assignment-form-grid--rooms {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .assignment-form-grid--basic,
    .assignment-form-grid--rules,
    .assignment-form-grid--teachers,
    .assignment-form-grid--rooms {
        grid-template-columns: minmax(0, 1fr);
    }
    .assignment-form-checkbox {
        min-height: auto;
    }
    .assignment-summary,.lesson-entry-teacher-selects,.assignment-rooms-section { grid-template-columns:minmax(0,1fr); }
}
/* Korekta przydziałów: stopniowe pola sal i opcjonalne reguły. */
.assignment-rules-disclosure {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--paper);
}
.assignment-rules-disclosure > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .2rem .75rem;
    align-items: center;
    padding: .75rem .9rem;
    cursor: pointer;
    list-style: none;
}
.assignment-rules-disclosure > summary::-webkit-details-marker { display: none; }
.assignment-rules-disclosure > summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 6px;
}
.assignment-rules-summary {
    grid-column: 1;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 400;
}
.assignment-rules-chevron {
    grid-column: 2;
    grid-row: 1 / span 2;
    transition: transform .15s ease;
}
.assignment-rules-disclosure[open] .assignment-rules-chevron { transform: rotate(180deg); }
.assignment-rules-content {
    padding: 0 .9rem .9rem;
}
.assignment-primary-room-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: end;
    min-width: 0;
}
.assignment-primary-room-row .assignment-form-field { min-width: 0; }
.assignment-room-control {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}
.assignment-room-control select {
    flex: 1 1 auto;
    min-width: 0;
}
.assignment-room-add,
.assignment-room-remove {
    appearance: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    white-space: nowrap;
}
.assignment-room-add:hover,
.assignment-room-add:active,
.assignment-room-remove:hover,
.assignment-room-remove:active {
    transform: none;
    background: transparent;
}
.assignment-activity-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .8rem 1rem;
}
.assignment-activity-row .actions {
    margin: 0;
}
.assignment-extra-room[hidden],
.assignment-room-add[hidden] { display: none !important; }
@media (max-width: 560px) {
    .assignment-primary-room-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }
    .assignment-room-add { justify-self: start; }
    .assignment-room-control { align-items: flex-start; }
}
/* Zwarta belka reguł i pojedyncza szerokość Sali głównej. */
.assignment-rules-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    min-height: 38px;
    padding: .5rem .75rem;
}
.assignment-rules-title {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}
.assignment-rules-info {
    display: inline-flex;
    flex: 0 0 18px;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--navy);
    font-size: .82rem;
    line-height: 1;
    text-align: center;
    cursor: help;
}
.assignment-rules-info:hover { background: #e4eff2; color: var(--navy-dark); }
.assignment-rules-info:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.assignment-rules-chevron {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    margin: 0 3px 2px 0;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    color: var(--navy);
    transform: rotate(45deg);
    transition: transform .15s ease;
}
.assignment-rules-disclosure[open] .assignment-rules-chevron { transform: rotate(225deg); }
.assignment-primary-room-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.assignment-primary-room-row .assignment-room-add {
    align-self: end;
    justify-self: start;
}
@media (max-width: 900px) {
    .assignment-primary-room-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .assignment-primary-room-row { grid-template-columns: minmax(0, 1fr); }
}
.assignment-rooms-section { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.8rem; }
.assignment-rooms-section > h3,.assignment-rooms-section > .message { grid-column:1/-1; }
.assignment-rooms-section .assignment-primary-room-row,.assignment-rooms-section .assignment-form-grid--rooms { display:contents; }
.assignment-rooms-section .assignment-room-add { grid-column:1/-1; order:99; justify-self:start; }
@media(max-width:900px){.assignment-rooms-section{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:560px){.assignment-rooms-section{grid-template-columns:minmax(0,1fr);}}
/* Nauczane przedmioty pracownika: progresywne pola bez sztucznego limitu. */
.employee-subjects-section { display: grid; gap: .7rem; margin-top: 1rem; }
.employee-subjects-heading h3 { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-size: 1rem; }
.employee-subject-primary-row,.employee-subject-extra { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem; align-items:end; }
.employee-subject-field { position:relative; display:grid; gap:.35rem; min-width:0; padding-bottom:1.1rem; font-weight:600; }
.employee-subject-field select { width: 100%; min-width: 0; }
.employee-subject-realization { position:absolute; bottom:0; left:0; display:block; margin:0; color:var(--muted); font-size:.76rem; font-weight:500; line-height:1; white-space:nowrap; }
.employee-subject-realization[hidden] { display:none !important; }
.employee-subject-realization-summary { width:max-content; max-width:100%; margin:0; padding:4px 7px; border:1px solid #dbe4e8; border-radius:4px; background:#f7fafb; color:#40515c; font-size:.78rem; line-height:1.25; }
.employee-subject-realization-summary.is-under { border-color:#e8d19b; background:#fff9ec; color:#76581f; }
.employee-subject-realization-summary.is-over { border-color:#e6c4c4; background:#fff5f5; color:#814343; }
.employee-subject-unspecified { margin:-.2rem 0 0; color:var(--muted); font-size:.76rem; line-height:1.25; }
.employee-subject-add { align-self: end; justify-self: start; white-space: nowrap; }
.employee-subject-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:.45rem; }
.employee-subject-extra .employee-subject-field--subject { grid-column:1; }
.employee-subject-extra .employee-subject-field--room { grid-column:2; }
.employee-subject-extra .employee-subject-remove { grid-column:3; align-self:end; justify-self:start; margin-bottom:1.1rem; }
.employee-subject-add, .employee-subject-remove { appearance: none; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; transform: none; text-decoration: none; }
.employee-subject-add:hover, .employee-subject-add:active, .employee-subject-remove:hover, .employee-subject-remove:active { background: transparent; box-shadow: none; transform: none; }
@media (max-width: 900px) { .employee-subject-primary-row,.employee-subject-extra { grid-template-columns:repeat(2,minmax(0,1fr)); } .employee-subject-extra .employee-subject-field--subject { grid-column:1; } .employee-subject-extra .employee-subject-field--room { grid-column:2; } .employee-subject-extra .employee-subject-remove { grid-column:2; justify-self:end; } }
@media (max-width: 560px) { .employee-subject-primary-row,.employee-subject-extra { grid-template-columns:minmax(0,1fr); } .employee-subject-extra .employee-subject-field--subject,.employee-subject-extra .employee-subject-field--room,.employee-subject-extra .employee-subject-remove { grid-column:1; } .employee-subject-extra .employee-subject-remove { justify-self:end; margin-bottom:0; } .employee-subject-add { justify-self:start; } }
/* Pracownicy: role są zwarte, ale pozostają pełnoprawnymi kontrolkami formularza. */
.admin-compact-page .employee-form-row--identity { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 10px; }
.admin-compact-page .employee-form-row--identity > label { min-width:0; }
.employee-roles-field { position:relative; display:grid; grid-column:1 / -1; width:100%; gap:.35rem; min-width:0; }
.employee-roles-label { display:inline-flex; align-items:center; gap:.35rem; font-weight:600; }
.employee-role-control { display:flex; align-items:center; min-height:34px; gap:.35rem; padding:.35rem .45rem; border:1px solid #aebfc7; border-radius:4px; background:#fff; cursor:pointer; }
.employee-role-control:focus-within { border-color:var(--navy); }
.employee-role-trigger { display:inline-flex; flex:0 0 30px; align-items:center; justify-content:center; width:30px; min-height:28px; margin:0; padding:0; border:0; border-radius:3px; background:transparent; color:var(--text); cursor:pointer; box-shadow:none; }
.employee-role-trigger:focus-visible { outline:2px solid var(--navy); outline-offset:2px; }
.employee-role-control > span:first-child { display:flex; flex:1 1 auto; flex-wrap:wrap; align-items:center; gap:.25rem; min-width:0; }
.employee-role-placeholder { color:var(--muted); }
.employee-role-chevron { flex:0 0 auto; width:8px; height:8px; margin:0 3px 4px 0; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
.employee-role-trigger[aria-expanded="true"] .employee-role-chevron { margin-top:4px; margin-bottom:0; transform:rotate(225deg); }
.employee-role-badges { display:inline-flex; flex-wrap:wrap; gap:.25rem; margin-top:2px; }
.employee-role-badge { display:inline-flex; align-items:center; max-width:100%; gap:.16rem; margin:0; padding:2px 6px; border:0; border-radius:999px; background:#e4eff2; color:var(--navy-dark); font:inherit; font-size:.72rem; font-weight:600; line-height:1.25; box-shadow:none; }
button.employee-role-badge { cursor:pointer; }
button.employee-role-badge:hover,button.employee-role-badge:focus-visible { background:#d5e6ea; color:var(--navy-dark); box-shadow:none; transform:none; }
.employee-role-menu { position:absolute; z-index:50; top:100%; left:0; width:100%; box-sizing:border-box; display:flex; flex-direction:column; max-height:280px; margin-top:3px; overflow:hidden; border:1px solid #aebfc7; border-radius:4px; background:#fff; box-shadow:0 6px 18px rgba(20,45,55,.16); }
.employee-role-menu[hidden] { display:none !important; }
.employee-role-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); flex:1 1 auto; min-height:0; padding:.35rem; overflow-y:auto; overflow-x:hidden; }
.employee-role-option { display:flex; align-items:center; min-height:36px; gap:.45rem; padding:.3rem .35rem; font-weight:400; }
.employee-role-option input[type="checkbox"] { flex:0 0 auto; width:17px; min-width:17px; height:17px; min-height:17px; margin:0; padding:0; accent-color:var(--navy); }
.employee-role-option:hover { background:#edf4f5; }
.employee-role-menu-footer { flex:0 0 auto; padding:.35rem; border-top:1px solid #d8e0e5; background:#f8fbfc; }
.employee-role-custom-toggle { margin:0; }
.employee-role-custom-toggle[hidden] { display:none !important; }
.employee-role-custom-editor { display:grid; width:100%; box-sizing:border-box; gap:.35rem; font-weight:600; }
.employee-role-custom-editor[hidden] { display:none !important; }
.employee-role-custom-editor label { display:grid; gap:.3rem; }
.employee-role-custom-editor input { width:100%; min-width:0; box-sizing:border-box; }
.employee-role-custom-cancel { justify-self:start; }
.employee-role-targets { display:grid; grid-column:1 / -1; width:100%; gap:.45rem; margin-top:.7rem; }
.employee-role-targets[hidden] { display:none !important; }
.employee-role-targets h3 { display:inline-flex; align-items:center; gap:.35rem; margin:0; font-size:1rem; }
.employee-role-target-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 10px; }
.employee-role-target-grid label { display:grid; min-width:0; gap:.3rem; font-weight:600; }
.employee-role-target-grid input { min-width:0; }
.employee-role-target-control { display:block; min-width:0; }
.employee-role-target-control input { width:100%; box-sizing:border-box; }
.employee-duty-section { display:grid; gap:.7rem; margin-top:1rem; padding-top:.85rem; border-top:1px solid #d8e0e5; }
.employee-duty-heading { display:flex; flex-direction:column; align-items:flex-start; gap:.25rem; }
.employee-duty-heading h3 { margin:0; font-size:1rem; }
.employee-duty-heading .checkbox { display:inline-flex; align-items:center; gap:.3rem; margin:0; padding:0; }
.employee-duty-details { display:grid; gap:.7rem; transition:opacity .15s ease; }
.employee-duty-section.is-disabled .employee-duty-details { opacity:.52; }
.employee-duty-section.is-disabled .employee-duty-details :disabled { cursor:not-allowed; }
.employee-duty-row--first { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 10px; }
.employee-duty-row--limits { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 10px; }
.employee-duty-row--first label,.employee-duty-row--limits label { min-width:0; }
.employee-role-more { margin:0; padding:2px 6px; border-radius:999px; background:#e4eff2; color:var(--navy-dark); font-size:.72rem; font-weight:600; }
@media (max-width: 900px) { .admin-compact-page .employee-form-row--identity { grid-template-columns:repeat(2,minmax(0,1fr)); } .employee-role-target-grid,.employee-duty-row--limits { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .admin-compact-page .employee-form-row--identity,.employee-role-target-grid,.employee-duty-row--first,.employee-duty-row--limits { grid-template-columns:minmax(0,1fr); } .employee-role-options { grid-template-columns:minmax(0,1fr); } }
/* Import przydziałów: nierozwiązane mapowania pozostają zwarte i czytelne. */
.import-mapping-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.import-mapping-grid > label { min-width: 0; }
.import-mapping-grid select { width: 100%; }
.import-mapping-actions { margin: 0 0 10px; }
@media (max-width: 900px) { .import-mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .import-mapping-grid { grid-template-columns: minmax(0, 1fr); } }
/* Szybkie przydziały: arkusz do wprowadzania wielu pozycji naraz. */
.quick-assignment-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.quick-assignment-heading h2 { margin-bottom:.25rem; }
.quick-assignment-heading p { margin:0; }
#dodaj-przydzialy { scroll-margin-top:12px; }
.quick-assignment-class-form { display:flex; align-items:end; gap:.5rem; margin-top:.5rem; }
.quick-assignment-class-form label { min-width:190px; margin:0; }
.quick-assignment-class-form select { min-width:120px; }
.quick-assignment-existing-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.quick-assignment-existing-heading h2 { margin:0; }
.quick-assignment-table-wrap { max-height:62vh; border:1px solid #d8e0e5; border-radius:8px; }
.quick-assignment-table { min-width:940px; width:100%; margin:0; table-layout:fixed; }
.quick-assignment-table thead { position:sticky; top:0; z-index:2; }
.quick-assignment-table th { white-space:nowrap; }
.quick-assignment-table td { padding:.35rem; vertical-align:middle; }
.quick-assignment-table select,
.quick-assignment-table input { width:100%; min-width:0; margin:0; padding:.5rem .45rem; font-size:.9rem; }
.quick-assignment-table th:nth-child(1), .quick-assignment-table td:nth-child(1) { width:120px; }
.quick-assignment-table th:nth-child(2), .quick-assignment-table td:nth-child(2) { width:155px; }
.quick-assignment-table th:nth-child(3), .quick-assignment-table td:nth-child(3) { width:58px; }
.quick-assignment-table th:nth-child(4), .quick-assignment-table td:nth-child(4),
.quick-assignment-table th:nth-child(5), .quick-assignment-table td:nth-child(5) { width:190px; }
.quick-assignment-table th:nth-child(6), .quick-assignment-table td:nth-child(6) { width:135px; }
.quick-assignment-table th:nth-child(7), .quick-assignment-table td:nth-child(7) { width:74px; text-align:center; }
.quick-assignment-class-group th { padding:.45rem .65rem; border-top:2px solid #b8cbd1; background:#eaf2f4; color:var(--navy-dark); text-align:left; }
.quick-week-plan-section .quick-assignment-existing-heading p { margin:.2rem 0 0; }
.quick-week-plan-shell { padding:0; overflow:hidden; }
.quick-week-plan-shell .graphic-plan-scroll { max-height:70vh; }
.quick-week-plan-grid { width:100%; min-width:720px; }
.quick-week-plan-grid thead th:not(.graphic-plan-time-head),
.quick-week-plan-grid .graphic-plan-cell { width:auto; min-width:125px; max-width:none; }
.quick-week-plan-grid .graphic-plan-cell { height:66px; }
.quick-week-plan-grid .graphic-lesson { min-height:58px; }
.quick-assignment-row-actions { display:inline-flex; align-items:center; justify-content:center; gap:.25rem; }
.quick-assignment-edit,
.quick-assignment-remove { appearance:none; width:30px; height:30px; margin:0; padding:0; border:0; border-radius:50%; background:transparent; color:#a22; font-size:1.35rem; line-height:1; box-shadow:none; }
.quick-assignment-edit { display:inline-grid; place-items:center; color:#245f70; font-size:1.05rem; text-decoration:none; }
.quick-assignment-edit[hidden] { display:none !important; }
.quick-assignment-edit:hover,
.quick-assignment-edit:active { background:#e4eff2; color:#173f4a; transform:none; box-shadow:none; }
.quick-assignment-remove:hover,
.quick-assignment-remove:active { background:#fce8e8; color:#761515; transform:none; box-shadow:none; }
.quick-assignment-actions { justify-content:space-between; align-items:center; }
@media (max-width:700px) {
    .quick-assignment-heading { display:grid; }
    .quick-assignment-heading .button { justify-self:start; }
    .quick-assignment-existing-heading { align-items:stretch; flex-direction:column; }
    .quick-assignment-existing-heading .button { align-self:flex-start; }
    .quick-week-plan-grid { min-width:680px; }
}

/* Akcje kasowania w planie nauczyciela pozostają osobnymi, czytelnymi przyciskami. */
main .teacher-plan-action-row > .teacher-plan-action-button,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button,
main .teacher-plan-action-row > .teacher-plan-action-button:hover,
main .teacher-plan-action-row > .teacher-plan-action-button:active,
main .teacher-plan-action-row > .teacher-plan-action-button:focus,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:hover,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:active,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:focus { display:inline-flex; align-items:center; min-height:30px; padding:5px 9px; border:1px solid #c77878; border-radius:3px; background:#fff7f7; box-shadow:none; color:var(--error-text); font-size:.76rem; font-weight:600; line-height:1.2; text-decoration:none; transform:none; }
main .teacher-plan-action-row > .teacher-plan-action-button:hover,
main .teacher-plan-action-row > .teacher-plan-action-button:active,
main .teacher-plan-action-row > .teacher-plan-action-button:focus-visible,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:hover,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:active,
main .teacher-plan-action-row .school-plan-bulk-confirmation > .teacher-plan-action-button:focus-visible { border-color:var(--error-text); background:#fbecec; color:#691d1d; }

/* Bezpośrednia korekta ustawień przydziału z ostrzeżenia planu lekcji. */
main a.button.lesson-assignment-fix-link { border: 1px solid #d39a39; background: #fff4d6; box-shadow: none; color: #70470d; font-weight: 700; text-decoration: none; transform: none; }
main a.button.lesson-assignment-fix-link:hover,
main a.button.lesson-assignment-fix-link:focus-visible { border-color: #aa6d10; background: #ffe7a6; color: #553300; box-shadow: 0 0 0 2px rgba(211, 154, 57, .22); transform: none; }
main a.button.lesson-assignment-fix-link { display: inline-flex; min-height: 0; margin-left: 6px; padding: 3px 7px; font-size: .72rem; line-height: 1.2; vertical-align: middle; }
main a.lesson-tile-inline-fix { display: inline-block; margin-top: 3px; padding: 0; border: 0; background: transparent; box-shadow: none; color: #80521c; font-size: .72rem; font-weight: 700; line-height: 1.2; text-decoration: none; }
main a.lesson-tile-inline-fix:hover,
main a.lesson-tile-inline-fix:focus-visible { background: transparent; box-shadow: none; color: #553300; text-decoration: underline; }

/* Tablety i urządzenia dotykowe: klik ma pierwszeństwo przed podpowiedzią i efektem hover. */
html { -webkit-text-size-adjust: 100%; }
a[href], button, input, select, textarea, summary, [role="button"], [role="menuitem"] { touch-action: manipulation; }
.table-wrap, .graphic-plan-scroll, .school-plan-wrap, .lesson-editor-grid-wrap, .teacher-timeline-scroll, .duty-edit-table-wrap { -webkit-overflow-scrolling: touch; }
.auth-admin-page .auth-user-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; max-width: none; }
.auth-admin-page .auth-user-form > label { min-width: 0; margin: 0; }
.auth-admin-page .auth-user-form > fieldset,
.auth-admin-page .auth-user-form > button { grid-column: 1 / -1; }
.auth-admin-page .auth-user-permissions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin-top: 4px; }
.auth-admin-page .auth-user-permissions > label,
.auth-admin-page .auth-user-active-option { display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin: 0; line-height: 1.25; }
.auth-admin-page .auth-user-permissions > label { align-items: center; }
.auth-admin-page .auth-user-permissions .app-tooltip-icon { margin-left: 1px; }
.auth-admin-page .auth-user-permissions input[type="checkbox"],
.auth-admin-page .auth-user-active-option input[type="checkbox"] { flex: 0 0 auto; width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; }
.auth-admin-page .auth-user-permission-summary,
.auth-admin-page .auth-user-status { display: block; font-size: .78rem; line-height: 1.35; }
.auth-admin-page .auth-user-status { font-weight: 700; }
.auth-admin-page .auth-user-status.is-active { color: #28633c; }
.auth-admin-page .auth-user-status.is-inactive { color: var(--muted); }
.auth-admin-page .auth-user-permission-summary { margin-top: 3px; color: var(--muted); }
.auth-admin-page .auth-user-edit-row[hidden] { display: none !important; }
.auth-admin-page .auth-user-edit-row > td { padding: 10px; background: #f4f8fa; }
.auth-admin-page .auth-user-edit-form { display: grid; gap: 10px; max-width: 980px; }
.auth-admin-page .auth-user-edit-fields { display: grid; grid-template-columns: minmax(220px, 420px) auto; align-items: end; gap: 10px 16px; }
.auth-admin-page .auth-user-edit-fields > label { margin: 0; }
.auth-admin-page .auth-user-edit-actions { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .auth-admin-page .auth-user-form, .auth-admin-page .auth-user-permissions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { body.graphic-plan-wide-view main.container { width: calc(100% - 32px); } .auth-admin-page .auth-user-form, .auth-admin-page .auth-user-permissions, .auth-admin-page .auth-user-edit-fields { grid-template-columns: minmax(0, 1fr); } .auth-admin-page .auth-user-edit-fields { align-items: start; } }
.graphic-plan-cell.is-empty { padding: 0; vertical-align: middle; }
.graphic-plan-cell.is-empty .graphic-plan-add { min-height: 34px; border-radius: 0; opacity: .72; touch-action: manipulation; -webkit-tap-highlight-color: rgba(36, 66, 92, .18); user-select: none; -webkit-user-select: none; }
.graphic-plan-shell[data-density="comfortable"] .graphic-plan-cell.is-empty { padding: 0; }
.graphic-plan-shell[data-density="comfortable"] .graphic-plan-cell.is-empty .graphic-plan-add { min-height: 34px; }
.graphic-lesson, .lesson-tile-main, .lesson-cell-add, .teacher-central-lesson, .teacher-central-lesson-add { touch-action: manipulation; }
.admin-compact-page .sortable-handle, [data-sortable-handle] { touch-action: manipulation; }
/* The delay is handled in app.js. Before it expires the browser retains
   normal scroll and pinch-zoom; only an activated drag consumes movement. */
.admin-compact-page .sortable-handle, [data-sortable-handle],
.duty-edit-slot[data-duty-edit-drag-source], [data-after-school-drag-source] {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

@media (hover: none), (pointer: coarse) {
    .graphic-plan-cell.is-empty .graphic-plan-add { color: #587180; opacity: .9; }
    .graphic-plan-cell.is-empty .graphic-plan-add:hover { background: transparent; color: #587180; }
    .graphic-plan-cell.is-empty .graphic-plan-add:active { background: #dce8ed; color: var(--navy-dark); }
    .graphic-lesson:hover { transform: none; box-shadow: none; }
    .graphic-lesson:active { box-shadow: 0 0 0 2px rgba(36, 66, 92, .22); }
    .admin-compact-page .sortable-handle, [data-sortable-handle] { min-width: 34px; min-height: 34px; }
    .duty-edit-slot[data-duty-edit-drag-source] { min-height: 30px; padding-top: 5px; padding-bottom: 5px; }
    .site-nav-group-toggle, .site-nav-dropdown a { min-height: 42px; }
}

/* Wspólne, małe ikony uruchamiające globalny tooltip: informacja, ostrzeżenie i błąd. */
.app-tooltip-icon,
.admin-compact-page button.app-tooltip-icon,
.admin-compact-page button.app-tooltip-icon:hover,
.admin-compact-page button.app-tooltip-icon:active,
.admin-compact-page button.app-tooltip-icon:focus { display: inline-flex; flex: 0 0 18px; align-items: center; justify-content: center; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--navy); font: inherit; line-height: 1; text-decoration: none; transform: none; }
.app-tooltip-icon:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.app-tooltip-icon--info { border-radius: 50%; font-size: .8rem; }
.app-tooltip-icon--warning { position: relative; overflow: visible; border-radius: 0; color: #c57b1d; font-size: 0; }
.app-tooltip-icon--warning::before { display: block; width: 13px; height: 13px; content: ''; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22' preserveAspectRatio='xMidYMid meet' fill='none' stroke='%23c57b1d' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 21 19H3Z'/%3E%3Cpath d='M12 7.35v4.5'/%3E%3Cpath d='M12 15h.01' stroke-width='1.55'/%3E%3C/svg%3E") center / 13px 13px no-repeat; }
.app-tooltip-icon--warning > span { display: none; }
.app-tooltip-icon--error { border: 1.35px solid var(--error-text); border-radius: 50%; color: var(--error-text); font-size: .76rem; font-weight: 800; }
.admin-compact-page .after-school-group-total-line button.app-tooltip-icon--warning { transform: translateY(-1px); }

.app-confirmation-dialog { z-index: 2100; box-sizing: border-box; width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: var(--radius, 6px); opacity: 1; color: var(--text); background: var(--paper, #fff); box-shadow: 0 18px 52px rgba(0, 0, 0, .28); }
.app-confirmation-dialog::backdrop { background: rgba(17, 32, 46, .48); }
.app-confirmation-dialog__content { display: grid; gap: 12px; margin: 0; padding: 20px; }
.app-confirmation-dialog__content h2, .app-confirmation-dialog__content p { margin: 0; }
.app-confirmation-dialog__content p { white-space: pre-line; }
.app-confirmation-dialog__content .actions { justify-content: flex-end; margin-top: 4px; }

/* Wspólny kontekst aktywnego Planu pracy oraz nagłówki planów. */
.graphic-plan-title-row,
.after-school-plan-title-row { align-items: center; }
.graphic-plan-page:fullscreen .page-title-context--fullscreen,
.graphic-plan-page.graphic-plan-focus-mode .page-title-context--fullscreen,
.after-school-plan-page:fullscreen .page-title-context--fullscreen,
.after-school-plan-page.after-school-plan-focus-mode .page-title-context--fullscreen { display: block; }
.graphic-plan-page:fullscreen .graphic-plan-control-row--view .graphic-plan-class-filters,
.graphic-plan-page.graphic-plan-focus-mode .graphic-plan-control-row--view .graphic-plan-class-filters { margin-left: auto; }

/* Plan szkoły: wpis lekcji jest jednym, źródłowo jednoznacznym blokiem.
   Tekst nigdy nie może ustalać szerokości kolumny nauczyciela. */
.school-plan-table { table-layout: fixed; }
.school-plan-table .school-plan-lesson-cell { padding: 3px !important; }
.school-plan-lesson-stack { display: grid; gap: 3px; min-width: 0; }
.school-plan-table a.school-plan-lesson-entry {
    display: grid;
    gap: 1px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 3px 4px;
    overflow: hidden;
    border: 1px solid #669d74;
    border-left: 4px solid var(--lesson-subject-color, #669d74);
    border-radius: 3px;
    background: #f1f8f2;
    color: #275c35;
    font-size: .69rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
}
.school-plan-table a.school-plan-lesson-entry > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.school-plan-table a.school-plan-lesson-entry:hover,
.school-plan-table a.school-plan-lesson-entry:focus-visible { background: #f6fbf7; color: #275c35; outline-color: #467d53; }
.school-plan-table a.school-plan-lesson-entry.is-conflict { border-color: var(--error-text); border-left-color: var(--error-text); background: #fbecec; color: var(--error-text); }
.school-plan-table .school-plan-empty-lesson { color: var(--muted); }

@media (max-width: 760px) {
    .header-content { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px 12px; }
    .header-brand-block { flex-basis: 100%; gap: 3px 12px; }
    .header-content .header-brand-block p { margin: 0; }
    .header-active-plan { flex-basis: 100%; margin-left: 0; text-align: left; }
}
