/* Full-window planning desk. Fit the timetable by default; detailed cards remain available. */
.s51-output-status{position:relative;margin:0;padding:72px 32px;width:100%;height:100%;background:#f5f8fb;color:#19324e;font-family:"Segoe UI",sans-serif}
.s51-output-status>.s47-output-close{position:absolute;right:20px;top:20px}
.s51-output-status button{padding:10px 16px;border:1px solid #c0d1e0;border-radius:6px;background:white;color:#19324e;cursor:pointer}
.s51-simple-workspace{--studio-ink:#19324e;--studio-muted:#65788c;--studio-line:#dce5ee;position:fixed;inset:0;padding:0!important;z-index:13000;background:#f4f7fa;font-family:Inter,"Segoe UI",sans-serif}
.s51-simple-workspace,.s51-simple-workspace *{box-sizing:border-box}
.s51-simple-workspace .s51-modal{width:100%;height:100dvh;max-width:none;max-height:100dvh;border:0;border-radius:0}
.s51-simple-workspace .s51-header{align-items:center;min-height:64px;padding:9px 22px;background:#102a43!important;border-bottom:3px solid #25b5a3!important;flex-shrink:0}
.s51-simple-workspace .s51-header h2{margin:0;font:650 20px/1.3 Inter,"Segoe UI",sans-serif;color:#fff;letter-spacing:-.4px}
.s51-simple-workspace .s51-studio-eyebrow{display:block;color:#79d8c9;font-size:9px;letter-spacing:1.8px;margin-bottom:3px}
.s51-simple-workspace .s51-studio-subtitle{display:block!important;margin:3px 0 0!important;color:#c6d6e5!important;font-size:11px}
.s51-simple-workspace .s51-header p:not(.s51-studio-subtitle){display:none}
.s51-simple-workspace .s51-close{width:36px;height:36px;background:#ffffff10;border:1px solid #ffffff35;border-radius:9px;color:#fff}
.s51-simple-workspace .s51-tabs{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;overflow:visible;padding:12px 20px;gap:18px;background:#fff;border-bottom:1px solid var(--studio-line)}
.s51-primary-resources{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;max-width:850px;flex:1}
.s51-simple-workspace .s51-primary-resources>button{height:58px;min-height:58px;display:flex;align-items:center;gap:10px;text-align:left;padding:8px 14px;border:1px solid #dce5ee;border-radius:10px;background:#fff;color:var(--studio-ink);cursor:pointer}
.s51-simple-workspace .s51-primary-resources>button:hover{border-color:#4e9b9b;background:#f0fafa}
.s51-primary-resources button>span:last-child{display:flex;flex-direction:column;gap:4px}
.s51-primary-resources b{font-size:14px;line-height:1.2}
.s51-primary-resources small{font-size:10px;color:#718398;line-height:1.2;font-weight:400}
.s51-resource-icon{width:30px;height:32px;display:grid;place-items:center;border-radius:7px;font-size:21px;background:#edf3f8;color:#35637e;flex:none}
.s51-workspace-actions{display:flex;align-items:center;gap:8px;flex:none}
.s51-simple-workspace .s51-workspace-actions button{font:600 12px Inter,"Segoe UI",sans-serif;cursor:pointer}
.s51-simple-workspace .s51-create-primary{height:40px;padding:0 18px;border:0;border-radius:8px;background:#0d7d72;color:white}
.s51-studio-menu{position:relative;font-size:12px;color:#36516b}
.s51-studio-menu summary{list-style:none;border:1px solid var(--studio-line);padding:12px;border-radius:8px;cursor:pointer}
.s51-studio-menu summary::-webkit-details-marker{display:none}
.s51-studio-menu>div{position:absolute;right:0;top:calc(100% + 6px);z-index:30;display:grid;min-width:240px;padding:8px;background:#fff;border:1px solid var(--studio-line);border-radius:10px;box-shadow:0 16px 44px #132b4b25}
.s51-studio-menu button{height:auto!important;padding:10px 12px;text-align:left;border:0;border-radius:5px;background:#fff;color:#29445f}
.s51-studio-menu button:hover{background:#edf5f7}
.s51-studio-menu hr{border:0;border-top:1px solid var(--studio-line);width:100%;margin:4px 0}
.s51-simple-workspace .s51-overview.s51-full-matrix{display:flex;flex:1;min-height:0;flex-direction:column;padding:12px 18px 8px;gap:10px;background:#f5f8fb;overflow:hidden}
.s51-simple-workspace .s51-matrix-toolbar{gap:10px}
.s51-simple-workspace .s51-matrix-toolbar-top{gap:14px}
.s51-simple-workspace .s51-overview-mode{display:flex;background:#e7edf3;border-radius:8px;padding:3px}
.s51-simple-workspace .s51-overview-mode button{border:0;border-radius:6px;height:34px;padding:0 12px;font-size:12px;color:#5a6e81;background:transparent;white-space:nowrap}
.s51-simple-workspace .s51-overview-mode button.active{background:white;color:#153f59;box-shadow:0 1px 4px #15315115}
.s51-simple-workspace .s51-matrix-file{gap:8px;font-size:11px;max-width:720px}
.s51-simple-workspace .s51-matrix-file>span{white-space:nowrap;flex:none}
.s51-simple-workspace .s51-matrix-file select,.s51-simple-workspace .s51-matrix-search input{height:38px;border:1px solid #d7e2ec;border-radius:8px;font:500 12px Inter,"Segoe UI",sans-serif}
.s51-simple-workspace .s51-matrix-search{margin-left:auto}
.s51-simple-workspace .s51-matrix-search input{width:190px}
.s51-day-jumps{display:flex;gap:4px;flex-wrap:wrap}
.s51-day-jumps button,.s51-active-course{padding:7px 12px;border:1px solid transparent;border-radius:6px;background:transparent;color:#61758b;font:600 11px Inter,"Segoe UI",sans-serif;cursor:pointer}
.s51-day-jumps button:hover,.s51-day-jumps button.active{background:#e1eef0;color:#125f66;border-color:#c9dfe2}
.s51-active-course{background:#e4ecf5;color:#214766}
.s51-simple-workspace .s51-matrix-summary{display:flex;gap:7px}
.s51-simple-workspace .s51-matrix-summary>span,.s51-simple-workspace .s51-matrix-summary>button{display:flex;align-items:center;gap:5px;padding:7px 10px;border:1px solid #dde5ed;border-radius:7px;background:white;color:#68798d;font:500 11px Inter,"Segoe UI",sans-serif;white-space:nowrap}
.s51-simple-workspace .s51-matrix-summary>button{cursor:pointer}
.s51-simple-workspace .s51-matrix-summary>button:hover{border-color:#a7b9cb}
.s51-simple-workspace .s51-matrix-summary .is-complete{background:#eefaf5;border-color:#c4e9da;color:#18745c}
.s51-simple-workspace .s51-matrix-summary b{font-size:12px;color:inherit}
.s51-simple-workspace .s51-matrix-workspace{padding:0;gap:12px}
.s51-simple-workspace .s51-matrix-scroll{flex:1;min-width:0;overflow:auto;overscroll-behavior:contain;border:1px solid #d6e2ed;border-radius:9px;background:#fff;scrollbar-color:#9badbf #ecf1f6;scrollbar-width:auto}
.s51-simple-workspace .s51-program-matrix{border-collapse:separate;border-spacing:0}
.s51-simple-workspace .s51-program-matrix thead{position:sticky;top:0;z-index:5}
.s51-simple-workspace .s51-matrix-day{height:32px;background:#e9f0f7;color:#36526f;font-size:12px;letter-spacing:.4px;border-right:2px solid #b8cbdc}
.s51-simple-workspace .s51-matrix-period{height:35px;background:#f5f8fb;color:#4c6580;border-right:1px solid #dce5ef}
.s51-simple-workspace .s51-matrix-period b{font-size:11px}
.s51-simple-workspace .s51-matrix-period small{font-size:9px;margin-top:2px}
.s51-simple-workspace .s51-matrix-corner,.s51-simple-workspace .s51-matrix-entity{position:sticky;left:0;z-index:4;width:184px;background:#f3f7fb;border-right:2px solid #c0d1e0}
.s51-simple-workspace .s51-matrix-corner{z-index:6;font-size:10px;color:#42617f}
.s51-simple-workspace .s51-matrix-entity button{height:auto;min-height:62px;padding:8px 12px;text-align:left;white-space:normal}
.s51-simple-workspace .s51-matrix-entity strong{display:block;color:#1b3a57;font-size:12px;line-height:1.4;white-space:normal;text-overflow:clip;overflow:visible}
.s51-simple-workspace .s51-matrix-entity small{display:block;margin-top:4px;font-size:10px;color:#6d8195}
.s51-simple-workspace .s51-matrix-entity [data-overview-info-id]{position:absolute;right:5px;bottom:6px;width:auto;height:22px;min-height:22px;padding:3px 5px;border:0;border-radius:4px;background:#e7eff6;color:#456783;font-size:9px;font-weight:500;cursor:pointer}
.s51-simple-workspace .s51-matrix-entity:has([aria-pressed=true]){background:#dbf2ec;box-shadow:inset 4px 0 #13947d}
.s51-simple-workspace .s51-fit-overview .s51-matrix-entity [data-overview-info-id]{bottom:3px;font-size:8px;min-height:20px;height:20px}
.s51-simple-workspace .s51-fit-overview .s51-matrix-entity [data-overview-entity-id]{padding-right:55px}
.s51-simple-workspace .s51-matrix-row>td{padding:3px;height:70px;border-color:#e0e8f0}
.s51-simple-workspace .s51-matrix-lesson{display:flex;flex-direction:column;justify-content:center;gap:5px;width:100%;height:62px!important;min-height:62px;max-height:none;padding:5px 7px;border:0!important;border-radius:5px;background:var(--matrix-course)!important;color:var(--matrix-course-text)!important;box-shadow:inset 0 0 0 1px #00000014;cursor:pointer;text-align:left}
.s51-simple-workspace .s51-matrix-lesson b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;text-overflow:clip;font-size:12px;line-height:15px;font-weight:750;color:var(--matrix-course-text)!important}
.s51-simple-workspace .s51-matrix-lesson small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;line-height:13px;opacity:.95;color:var(--matrix-course-text)!important}
.s51-simple-workspace .s51-matrix-lesson:hover{filter:brightness(1.06);outline:2px solid #0f172a;outline-offset:-2px}
.s51-simple-workspace .s51-matrix-lesson.selected{outline:3px solid #111827!important;outline-offset:-3px;box-shadow:inset 0 0 0 5px #fff!important}
.s51-simple-workspace .s51-matrix-lesson.locked:after{top:2px;right:2px;background:#102a43;color:white;box-shadow:0 0 0 1px #fff;border-radius:2px;padding:2px;font-size:8px}
.s51-simple-workspace .s51-matrix-empty button{height:62px;color:#b4c2d0}
.s51-simple-workspace .s51-matrix-empty.available{background:#d6f5e9}
.s51-simple-workspace .s51-matrix-empty.available button{color:#08735b;font-size:22px;font-weight:700}
.s51-simple-workspace .s51-matrix-empty.blocked{background:repeating-linear-gradient(135deg,#fafafa 0 6px,#eceff3 6px 8px)}
.s51-simple-workspace .s51-matrix-group{z-index:2;right:3px;bottom:3px;font-size:10px}
.s51-simple-workspace .s51-matrix-dock{background:transparent;border:0;padding:0;min-height:32px;color:#718398;gap:10px}
.s51-simple-workspace .s51-matrix-dock>span{font-size:11px;line-height:1.4}
.s51-simple-workspace .s51-matrix-dock button{font-size:11px;border-radius:7px;min-height:32px;white-space:nowrap}
.s51-row-count{font-size:11px;white-space:nowrap}
.s51-simple-workspace .s51-fit-overview .s51-matrix-corner,.s51-simple-workspace .s51-fit-overview .s51-matrix-entity{width:140px}
.s51-simple-workspace .s51-fit-overview .s51-matrix-row>td{padding:1px;height:37px}
.s51-simple-workspace .s51-fit-overview .s51-matrix-lesson,.s51-simple-workspace .s51-fit-overview .s51-matrix-empty button{height:32px!important;min-height:32px;padding:2px}
.s51-simple-workspace .s51-fit-overview .s51-matrix-lesson b{font-size:9px;line-height:12px;overflow-wrap:anywhere;-webkit-line-clamp:2;text-align:center}
.s51-simple-workspace .s51-fit-overview .s51-matrix-lesson small,.s51-simple-workspace .s51-fit-overview .s51-matrix-period small{display:none}
.s51-simple-workspace .s51-fit-overview .s51-matrix-entity button{min-height:33px;padding:3px 6px}
.s51-simple-workspace .s51-fit-overview .s51-matrix-entity strong{font-size:10px}
.s51-simple-workspace .s51-fit-overview .s51-matrix-entity small{display:none}
.s51-simple-workspace .s51-fit-overview .s51-matrix-period b{font-size:8px;white-space:normal}
.s51-simple-workspace .s51-matrix-pool{position:relative;order:2;inset:auto;flex:0 0 270px;width:270px;max-height:100%;display:flex;flex-direction:column;overflow:auto;box-shadow:none;border:1px solid #e4dcc9;border-top:3px solid #e3aa42;border-radius:9px;background:#fff}
.s51-simple-workspace #s51-matrix-pool-toggle{position:sticky;top:0;z-index:2;flex-shrink:0;display:flex;justify-content:space-between;width:100%;border:0;border-radius:0;background:#fffaf0;padding:14px 12px;color:#825817;font-size:12px;text-align:left}
.s51-pool-scope{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #e9edf2;background:#f7fbfa}
.s51-pool-scope strong{font-size:13px;color:#1c685f;overflow-wrap:anywhere}
.s51-pool-scope button{border:1px solid #ccdfd9;border-radius:5px;padding:5px 7px;background:white;color:#52746b;font-size:10px;white-space:nowrap;cursor:pointer}
.s51-simple-workspace .s51-matrix-pool .s51-pool-empty{padding:24px 16px;font-size:13px;line-height:1.6;color:#527568}
.s51-simple-workspace .s51-matrix-pool .s637-unplaced-pool{margin:0;max-height:none;overflow:visible;border:0}
.s51-simple-workspace .s51-matrix-pool .s637-unplaced-chips{display:grid;grid-template-columns:1fr;max-height:none;padding:10px;gap:9px;overflow:visible}
.s51-simple-workspace .s51-matrix-pool .s637-unplaced-chip{width:100%;min-height:95px;padding:12px;text-align:left;align-items:flex-start;border:1px solid #e4e9ef;border-left:3px solid #dda33a;border-radius:8px;background:#fff}
.s51-simple-workspace .s51-matrix-pool .s637-unplaced-chip.selected{background:#effaf7;border-color:#17a48b}
.s51-simple-workspace .s637-unplaced-chip span{display:flex;justify-content:space-between;gap:8px;width:100%;font-size:12px;color:#244059}
.s51-simple-workspace .s637-unplaced-chip span b{font-size:11px;color:#956117}
.s51-simple-workspace .s637-unplaced-chip em{font-style:normal;font-size:11px;color:#826133;white-space:normal}
.s51-simple-workspace .s51-matrix-pool .s637-unplaced-pool>footer{display:flex;flex-direction:column;padding:10px;gap:8px}
.s51-simple-workspace .s51-matrix-pool footer button{font-size:11px;white-space:normal}
.s51-simple-workspace button:focus-visible,.s51-simple-workspace summary:focus-visible{outline:3px solid #309db5;outline-offset:2px}
.s51-task-backdrop{position:absolute;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:24px;background:#0f263e80;backdrop-filter:blur(3px)}
.s51-task-popup{display:flex;flex-direction:column;width:min(1100px,96vw);max-height:calc(100dvh - 48px);min-height:0;overflow:hidden;background:#fff;border:1px solid #dbe5ef;border-radius:16px;box-shadow:0 28px 90px #081d4150;color:#233e59}
.s51-task-popup>header{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:17px 24px;border-bottom:1px solid #e1e9f0;background:#f8fafc}
.s51-task-popup>header small{font-size:9px;letter-spacing:1.5px;color:#788a9e}
.s51-task-popup>header h3{font-size:21px;margin:3px 0 0}
.s51-task-popup>header button{width:36px;height:36px;border:0;border-radius:8px;background:#e9f0f5;color:#4c6880;font-size:25px;cursor:pointer}
.s51-task-content{padding:20px;overflow:auto;min-height:0;overscroll-behavior:contain}
.s51-task-popup>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 24px;border-top:1px solid #e1e9f0;flex-shrink:0}
.s51-task-popup>footer span{font-size:11px;color:#708296}
.s51-task-popup>footer button{padding:9px 15px;border:0;border-radius:7px;background:#163955;color:white;cursor:pointer;font-weight:600}
.s51-directory-popup{width:min(1200px,96vw);height:min(880px,calc(100dvh - 48px))}
.s51-directory-popup .s51-task-content{padding:0;display:flex;flex:1;flex-direction:column;overflow:hidden}
.s51-directory-tabs{display:flex;gap:5px;flex-shrink:0;padding:10px 24px;border-bottom:1px solid #e1e9f0;background:#fff}
.s51-directory-tabs button{display:flex;align-items:center;gap:8px;min-height:36px;padding:8px 16px;background:#fff;border:1px solid transparent;border-radius:7px;color:#62778b;font:600 13px Inter,"Segoe UI",sans-serif;cursor:pointer}
.s51-directory-tabs button[aria-pressed=true]{background:#e9f6f3;border-color:#b4dfd4;color:#126e63}
.s51-directory-tabs small{font-size:10px;font-weight:400}
.s51-directory-layout{display:grid;grid-template-columns:248px minmax(0,1fr);flex:1;min-height:0}
.s51-directory-list{display:flex;flex-direction:column;padding:18px 12px 0;border-right:1px solid #e1e9f0;background:#f7f9fc;min-height:0}
.s51-directory-list label{display:flex;flex-direction:column;gap:6px;padding:0 4px 10px;font-size:11px;color:#6d8296}
.s51-directory-list input{width:100%;height:38px;padding:0 11px;background:#fff;border:1px solid #d7e2ed;border-radius:7px;font:12px Inter,"Segoe UI",sans-serif;color:#284862}
.s51-directory-add{margin:0 4px 14px;min-height:35px;border:1px dashed #9fb6c8;border-radius:6px;color:#43657d;background:transparent;font-size:12px;cursor:pointer}
.s51-directory-items{flex:1;min-height:0;overflow:auto;padding:0 4px 16px;scrollbar-width:thin}
.s51-directory-record>[data-directory-item]{display:flex;flex-direction:column;gap:7px;width:100%;padding:12px;margin-bottom:5px;border:1px solid transparent;border-radius:8px;background:transparent;text-align:left;color:#25415d;cursor:pointer}
.s51-directory-record>[data-directory-item][aria-pressed=true]{background:#fff;border-color:#a9d5cc;box-shadow:0 2px 6px #14365108}
.s51-directory-record>[data-directory-item]:hover{background:#edf3f8}
.s51-directory-record>[data-directory-item] span{display:flex;align-items:center;gap:8px}
.s51-directory-items b{font-size:13px;line-height:1.4}
.s51-directory-items small{font-size:11px;color:#73869a}
.s51-directory-items em{display:inline-block;margin-left:5px;padding:2px 4px;color:#966213;font-style:normal;background:#fff3d9;border-radius:3px;font-size:10px}
.s51-directory-items [hidden]{display:none!important}
.s51-directory-items i,.s51-directory-course i{display:block;width:12px;height:12px;flex:none;border-radius:4px;background:var(--matrix-course);box-shadow:inset 0 0 0 1px #00000016}
.s51-directory-detail{overflow:auto;padding:24px;min-width:0;scrollbar-width:thin}
.s51-directory-detail-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}
.s51-directory-detail-head small{font-size:9px;letter-spacing:1.4px;color:#8a9aab}
.s51-directory-detail-head h4{font-size:24px;line-height:1.3;margin:6px 0 0;color:#1b3652;overflow-wrap:anywhere}
.s51-directory-detail button{cursor:pointer;font-family:Inter,"Segoe UI",sans-serif}
.s51-directory-detail-head button,.s51-directory-table td>button:not(.s51-text-link){border:1px solid #d6e2ec;border-radius:7px;padding:8px 11px;background:white;color:#4a6d88;font-size:11px}
.s51-directory-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:22px}
.s51-directory-stats>div{padding:15px 16px;border:1px solid #dde7ef;border-radius:9px;background:#f8fbfd}
.s51-directory-stats span{display:block;font-size:11px;color:#718598;margin-bottom:10px}
.s51-directory-stats b{font-size:29px;line-height:1;color:#1a4562;font-weight:650}
.s51-directory-stats small{font-size:12px;font-weight:400}
.s51-directory-stats .has-remaining{background:#fffbf1;border-color:#f0dfb7}
.s51-directory-stats .has-remaining b{color:#a56c11}
.s51-directory-actions{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 20px}
.s51-directory-actions>div{display:flex;gap:3px;padding:3px;border-radius:7px;background:#f0f4f8}
.s51-directory-actions button{padding:8px 12px;border:0;border-radius:5px;color:#708599;background:transparent;font-size:12px}
.s51-directory-actions [aria-pressed=true]{background:#fff;color:#234d67;box-shadow:0 1px 4px #16395110}
.s51-directory-actions>button{background:#0c7e71;color:#fff;white-space:nowrap}
.s51-teacher-classes{margin:0 0 22px}
.s51-teacher-classes h5{margin:0 0 10px;font-size:13px;color:#37556f}
.s51-teacher-classes>div{display:flex;gap:8px;flex-wrap:wrap}
.s51-teacher-classes button{display:flex;align-items:center;gap:14px;padding:10px 13px;border:1px solid #d7e6ed;border-radius:7px;background:#f5fafc;color:#4b6a82;font-size:12px}
.s51-teacher-classes b{color:#153e59;font-size:12px}
.s51-directory-table-wrap{overflow:auto;border:1px solid #e0e8ef;border-radius:9px}
.s51-directory-table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}
.s51-directory-table th{padding:11px 12px;background:#f7f9fc;font-size:10px;color:#7b8da0;font-weight:600;white-space:nowrap;border-bottom:1px solid #e0e8ef}
.s51-directory-table td{padding:13px 12px;border-bottom:1px solid #edf1f5;color:#36546e;white-space:nowrap}
.s51-directory-table tr:last-child td{border-bottom:0}
.s51-directory-course{display:flex;align-items:center;gap:10px;white-space:normal;min-width:145px}
.s51-directory-course b{display:block;font-size:12px;line-height:1.4;color:#24445f}
.s51-directory-course small{display:block;font-size:10px;color:#8091a2;margin-top:5px;line-height:1.4}
.s51-directory-table .has-remaining{color:#aa6f0d;font-weight:700}
.s51-text-link{padding:0;border:0;background:transparent;color:#216c80;font-weight:650}
.s51-directory-footnote,.s51-directory-note{font-size:11px;line-height:1.7;color:#8090a1;margin:16px 0 0}
.s51-directory-note{padding:10px 14px;background:#f0f7fa;border-radius:7px;color:#547489;margin:0 0 18px}
.s51-directory-empty{text-align:center;padding:40px 20px!important;white-space:normal!important;font-size:13px;line-height:1.7;color:#7c8fa1}
.s51-directory-empty h4{font-size:20px;margin-top:25px;color:#36536c}
.s51-directory-empty button{border:0;border-radius:7px;background:#0c7e71;color:#fff;padding:12px 18px;cursor:pointer}
.s51-directory-week{overflow:auto;border:1px solid #dce6ef;border-radius:8px}
.s51-directory-week table{width:100%;min-width:600px;table-layout:fixed;border-collapse:collapse}
.s51-directory-week th{background:#f5f8fb;color:#55728a;font-size:10px;font-weight:600;padding:9px 4px;border-bottom:1px solid #dce6ef}
.s51-directory-week th:first-child{width:78px}
.s51-directory-week th small{display:block;font-size:8px;font-weight:400;margin-top:4px}
.s51-directory-week td{height:62px;padding:3px;border:1px solid #e6edf4;text-align:center}
.s51-directory-week button{display:flex;flex-direction:column;justify-content:center;gap:5px;width:100%;min-height:54px;height:auto;padding:6px;border:0;border-radius:4px;background:var(--matrix-course);color:var(--matrix-course-text);text-align:left}
.s51-directory-week b{font-size:11px;line-height:1.3;overflow-wrap:anywhere}
.s51-directory-week small{font-size:9px;line-height:1.3}
.s51-free-slot,.s51-off-slot{font-size:10px;color:#a1b2c1}
.s51-sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.s51-child-tool{z-index:15000!important;background:#10223980!important;padding:22px!important;backdrop-filter:blur(2px)}
.s51-child-tool>section,.s51-child-tool>div:first-child{max-height:calc(100dvh - 44px)!important;border-radius:12px!important}
/* Reuse the validated record form inside a single compact dialog. */
.s51-studio-record-form{align-items:center!important;justify-content:center!important;padding:22px!important}
.s51-studio-record-form .s49-academic-drawer{width:min(820px,95vw)!important;height:auto!important;max-height:calc(100dvh - 44px)!important;overflow:auto!important;border-radius:14px!important;background:#fff!important}
.s51-studio-record-form .s49-academic-drawer> :not(.s49-academic-body){display:none!important}
.s51-studio-record-form .s49-academic-body{display:block!important;padding:0!important;overflow:visible!important;height:auto!important;max-height:none!important}
.s51-studio-record-form .s49-list{display:none!important}
.s49-academic-overlay.s51-studio-record-form .s49-form-panel{display:block!important;position:static!important;inset:auto!important;transform:none!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;border:0!important;box-shadow:none!important;padding:24px!important;overflow:visible!important;contain:none!important}
.s51-studio-record-form .right-panel-header{position:relative!important;padding-right:45px!important}
.s49-academic-overlay.s51-studio-record-form .s49-form-panel>.right-panel-header{background:#163955!important;border-radius:8px!important;margin:0 0 18px!important;padding:18px 20px!important}
.s51-studio-record-form #s49-advanced-assignment{padding:9px 12px;border:1px solid #d4e0eb;border-radius:6px;background:#f4f8fb;color:#36536c;cursor:pointer;font-size:11px}
.s51-studio-record-form .s49-form-modal-close{position:absolute!important;right:0;top:0;cursor:pointer}
.s51-studio-record-form .s49-item-form{font-size:13px!important}
.s51-studio-record-form .s49-item-form input,.s51-studio-record-form .s49-item-form select{min-height:38px!important;font-size:13px!important}
.s51-studio-record-form .s49-form-actions{position:sticky;bottom:-24px;padding:16px 0!important;background:#fff;z-index:2}
.s51-generation-busy{display:inline-flex!important;font-size:11px!important;color:#a2ebd7!important;margin-top:4px;letter-spacing:0!important}
.s51-task-popup .s51-simple-create{margin:0 auto;border:0;padding:8px 10px}
.s51-task-popup .s51-simple-create>h3{display:none}
@media(max-width:1200px){.s51-simple-workspace .s51-tabs{padding:10px 14px;gap:10px}.s51-simple-workspace .s51-primary-resources>button{padding:8px 10px;gap:6px}.s51-primary-resources small{display:none}.s51-simple-workspace .s51-overview.s51-full-matrix{padding:10px}.s51-directory-layout{grid-template-columns:215px minmax(0,1fr)}.s51-directory-detail{padding:20px}.s51-simple-workspace .s51-matrix-pool{width:245px;flex-basis:245px}}
@media(max-width:800px){.s51-simple-workspace .s51-header{padding:10px 14px;min-height:58px}.s51-simple-workspace .s51-header h2{font-size:16px}.s51-simple-workspace .s51-tabs{align-items:stretch;flex-direction:column;gap:8px;padding:8px}.s51-primary-resources{max-width:none;gap:5px}.s51-simple-workspace .s51-primary-resources>button{height:44px;min-height:44px;justify-content:center;padding:6px}.s51-primary-resources b{font-size:12px}.s51-resource-icon{display:none}.s51-workspace-actions{justify-content:flex-end}.s51-simple-workspace .s51-create-primary{height:32px}.s51-studio-menu summary{padding:8px}.s51-simple-workspace .s51-matrix-toolbar-top{flex-wrap:wrap;gap:7px}.s51-simple-workspace .s51-matrix-file{min-width:180px}.s51-simple-workspace .s51-matrix-search{width:100%}.s51-simple-workspace .s51-matrix-search input{width:100%}.s51-simple-workspace .s51-matrix-summary{margin-left:0}.s51-simple-workspace .s51-matrix-dock{flex-wrap:wrap}.s51-simple-workspace .s51-matrix-dock>span{flex-basis:100%}.s51-task-backdrop{padding:8px}.s51-directory-popup{width:100%;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}.s51-directory-layout{grid-template-columns:170px minmax(0,1fr)}.s51-directory-detail{padding:14px}.s51-directory-stats{gap:6px}.s51-directory-stats>div{padding:10px}.s51-directory-stats b{font-size:23px}.s51-directory-stats span{font-size:10px}.s51-directory-tabs{padding:8px;gap:1px}.s51-directory-tabs button{padding:8px 10px}.s51-directory-tabs small{display:none}.s51-directory-actions{align-items:stretch;flex-direction:column}.s51-simple-workspace .s51-matrix-pool{position:absolute;right:0;top:0;bottom:0;width:245px;z-index:10;box-shadow:-8px 0 25px #18365425}}
@media(max-width:540px){.s51-directory-layout{grid-template-columns:1fr;overflow:auto}.s51-directory-list{max-height:210px;border-right:0;border-bottom:1px solid #e1e9f0;padding:10px;flex-shrink:0}.s51-directory-list label{padding:0 0 8px}.s51-directory-add{margin-bottom:6px}.s51-directory-items{display:flex;gap:5px;overflow:auto;min-height:72px}.s51-directory-record>[data-directory-item]{flex:0 0 145px;margin:0;padding:8px}.s51-directory-detail{overflow:visible}.s51-directory-popup>footer{padding:10px}.s51-directory-popup>footer span{display:none}.s51-day-jumps button{padding:5px 7px;font-size:10px}}
/* Fit both axes to the available desk; ResizeObserver supplies the row height. */
.s51-screen-fit .s51-header{min-height:48px;padding:6px 18px}
.s51-screen-fit .s51-header h2{font-size:17px}
.s51-screen-fit .s51-studio-eyebrow{display:none!important}
.s51-screen-fit .s51-studio-subtitle{font-size:10px}
.s51-screen-fit .s51-tabs{padding:6px 14px;gap:12px}
.s51-screen-fit .s51-primary-resources{max-width:720px}
.s51-screen-fit .s51-primary-resources>button{height:40px;min-height:40px;padding:5px 10px;gap:8px}
.s51-screen-fit .s51-primary-resources small{display:none}
.s51-screen-fit .s51-resource-icon{height:26px;width:26px;font-size:18px}
.s51-screen-fit .s51-overview.s51-full-matrix{padding:7px 12px 6px;gap:6px}
.s51-screen-fit .s51-matrix-toolbar{gap:4px}
.s51-screen-fit .s51-matrix-dock{gap:8px}
.s51-screen-fit .s51-matrix-dock>span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#36566e}
.s51-screen-fit .s51-fit-overview .s51-matrix-day{height:26px!important;padding:3px;font-size:11px}
.s51-screen-fit .s51-fit-overview .s51-matrix-day.s51-active-day{background:#c8eee6;color:#126557;box-shadow:inset 0 -3px #168875}
.s51-screen-fit .s51-fit-overview .s51-matrix-period{height:20px!important;top:26px;padding:1px}
.s51-screen-fit .s51-fit-overview .s51-matrix-period b{font-size:8px;line-height:12px;white-space:nowrap;overflow:hidden;display:block}
.s51-screen-fit .s51-fit-overview .s51-matrix-row{height:var(--matrix-fit-row,24px)}
.s51-screen-fit .s51-fit-overview .s51-matrix-row>td{height:var(--matrix-fit-row,24px)!important;padding:1px}
.s51-screen-fit .s51-fit-overview .s51-matrix-lesson,.s51-screen-fit .s51-fit-overview .s51-matrix-empty button{height:calc(var(--matrix-fit-row,24px) - 3px)!important;min-height:0;padding:0 1px;border-radius:3px;gap:0;overflow:hidden}
.s51-screen-fit .s51-fit-overview .s51-matrix-lesson b{font-size:var(--matrix-fit-font,10px);line-height:1.05;white-space:nowrap;display:block;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
.s51-screen-fit .s51-fit-overview .s51-matrix-entity{height:var(--matrix-fit-row,24px);padding:0}
.s51-screen-fit .s51-fit-overview .s51-matrix-entity [data-overview-entity-id]{height:calc(var(--matrix-fit-row,24px) - 1px);min-height:0;padding:0 6px;display:flex;align-items:center;width:100%;overflow:hidden}
.s51-screen-fit .s51-fit-overview .s51-matrix-entity strong{font-size:var(--matrix-fit-font,10px);line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.s51-screen-fit .s51-fit-overview .s51-matrix-entity [data-overview-info-id]{display:none;top:1px;bottom:auto;height:calc(var(--matrix-fit-row,24px) - 3px);min-height:0;padding:0 4px}
.s51-screen-fit .s51-fit-overview .s51-matrix-entity:hover [data-overview-info-id],.s51-screen-fit .s51-fit-overview .s51-matrix-entity:focus-within [data-overview-info-id]{display:block}
.s51-screen-fit .s51-fit-overview .s51-matrix-entity [data-overview-info-id]:focus-visible{display:block}
.s51-screen-fit .s51-short-rows .s51-matrix-lesson.locked:after{font-size:6px;padding:0;top:1px;right:0;pointer-events:none}
.s51-screen-fit .s51-short-rows .s51-matrix-group{font-size:7px!important;width:9px;min-width:0;height:9px;min-height:0;line-height:9px;padding:0!important;bottom:0;right:0}
.s51-simple-workspace .s51-matrix-lesson[draggable=true],.s51-simple-workspace .s637-unplaced-chip[draggable=true]{cursor:grab}
.s51-simple-workspace.s51-dragging .s51-matrix-lesson,.s51-simple-workspace.s51-dragging .s51-matrix-empty button{cursor:grabbing}
.s51-simple-workspace .s51-drag-source{opacity:.45}
.s51-simple-workspace .s51-drag-valid{background:#c0f1d7!important;box-shadow:inset 0 0 0 1px #198559!important;color:#126039!important}
.s51-simple-workspace .s51-drag-target{outline:3px solid #13764b!important;outline-offset:-3px;background:#83e9b4!important;filter:brightness(1.08)}
.s51-simple-workspace .s51-drag-blocked{outline:3px solid #bd2634!important;outline-offset:-3px;box-shadow:inset 0 0 0 5px #fff!important}
.s51-drag-image{position:fixed;left:-10000px;top:0;max-width:400px;padding:12px 18px;border:2px solid #168875;border-radius:8px;background:#fff;color:#173d52;font:600 14px Segoe UI,sans-serif;box-shadow:0 6px 18px #15354c40;pointer-events:none}

.s51-simple-workspace .s51-tab-content{overflow:hidden!important;scrollbar-gutter:auto}
.s51-screen-fit .s51-full-matrix>.s51-effect{display:flex;align-items:center;gap:12px;padding:7px 12px;min-height:44px;max-height:70px}
.s51-screen-fit .s51-effect>div:first-child{flex:1;min-width:0}
.s51-screen-fit .s51-effect .s637-effect-actions{display:flex;flex-direction:row;align-items:center;flex:none;gap:7px}
.s51-screen-fit .s51-effect .s637-effect-actions button{min-height:30px;padding:6px 10px;white-space:nowrap}

/* Resource windows use the whole desk, with one scrollable list per pane. */
.s51-task-backdrop.s51-directory-backdrop{position:fixed;padding:0;background:#fff;backdrop-filter:none}
.s51-directory-backdrop .s51-directory-popup{width:100%;height:100dvh;max-width:none;max-height:100dvh;border:0;border-radius:0;box-shadow:none}
.s51-directory-popup>header{padding:9px 20px;min-height:52px;background:#102a43;border-bottom:2px solid #25b5a3;color:#fff}
.s51-directory-popup>header small{display:none}
.s51-directory-popup>header h3{font-size:20px;line-height:1.25;margin:0;color:#fff}
.s51-directory-popup>header button{width:32px;height:32px;background:#ffffff18;color:#fff;border:1px solid #ffffff30}
.s51-directory-popup>footer{padding:7px 20px;min-height:45px}
.s51-directory-popup>footer button{padding:7px 14px}
.s51-directory-popup .s51-directory-tabs{padding:6px 20px;gap:6px}
.s51-directory-popup .s51-directory-tabs button{min-height:32px;padding:6px 14px}
.s51-directory-popup .s51-directory-layout{grid-template-columns:clamp(205px,18vw,285px) minmax(0,1fr);overflow:hidden}
.s51-directory-popup .s51-directory-list{padding:12px 10px 0;min-width:0}
.s51-directory-popup .s51-directory-list label{padding-bottom:8px;gap:5px}
.s51-directory-popup .s51-directory-list input{height:34px}
.s51-directory-popup .s51-directory-add{margin-bottom:9px;min-height:32px}
.s51-directory-popup .s51-directory-record>[data-directory-item]{padding:9px 10px;gap:5px;margin-bottom:3px}
.s51-directory-popup .s51-directory-detail{display:flex;flex-direction:column;gap:10px;min-height:0;padding:14px 20px 8px;overflow:hidden}
.s51-directory-popup .s51-directory-detail>*{flex-shrink:0}
.s51-directory-popup .s51-directory-detail-head{margin:0;min-height:38px;gap:10px}
.s51-directory-popup .s51-directory-detail-head small{display:none}
.s51-directory-popup .s51-directory-detail-head h4{font-size:23px;line-height:1.25;margin:0}
.s51-directory-popup .s51-directory-stats{margin:0;gap:10px}
.s51-directory-popup .s51-directory-stats>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px}
.s51-directory-popup .s51-directory-stats span{font-size:11px;line-height:1.3;margin:0}
.s51-directory-popup .s51-directory-stats b{font-size:25px;white-space:nowrap}
.s51-directory-popup .s51-directory-actions{margin:0;min-height:35px}
.s51-directory-popup .s51-directory-actions button{padding:6px 11px}
.s51-directory-popup .s51-teacher-classes{display:flex;gap:10px;align-items:flex-start;margin:0;max-height:74px;overflow:auto;scrollbar-width:thin}
.s51-directory-popup .s51-teacher-classes h5{flex:none;font-size:11px;margin:9px 0}
.s51-directory-popup .s51-teacher-classes>div{gap:5px}
.s51-directory-popup .s51-teacher-classes button{gap:9px;padding:6px 9px;font-size:11px}
.s51-directory-popup .s51-teacher-classes b{font-size:11px;white-space:nowrap}
.s51-directory-popup .s51-directory-table-wrap,.s51-directory-popup .s51-directory-week{flex:1 1 0;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
.s51-directory-popup .s51-directory-table th{position:sticky;top:0;z-index:1;padding:8px 10px}
.s51-directory-popup .s51-directory-table td{padding:5px 10px}
.s51-directory-popup .s51-directory-table td>button:not(.s51-text-link){padding:6px 9px}
.s51-directory-popup .s51-directory-table .s51-text-link{white-space:normal;text-align:left}
.s51-directory-popup .s51-directory-course small{margin-top:2px}
.s51-directory-popup .s51-directory-footnote{margin:0;font-size:10px;line-height:1.4}
.s51-directory-popup .s51-directory-note{padding:6px 10px;margin:0;line-height:1.4}
.s51-directory-popup .s51-directory-week table{height:100%}
.s51-directory-popup .s51-directory-week th{padding:5px 4px}
.s51-directory-popup .s51-directory-week th small{margin-top:2px}
.s51-directory-popup .s51-directory-week td{height:1px;padding:2px}
.s51-directory-popup .s51-directory-week button{min-height:0;padding:4px 6px;gap:2px}
.s51-directory-popup .s51-directory-week b{line-height:1.15}
.s51-directory-popup .s51-directory-week small{line-height:1.15}
@media(max-height:700px) and (min-width:801px){
  .s51-directory-popup .s51-directory-detail{gap:7px;padding-top:9px}
  .s51-directory-popup .s51-directory-stats>div{padding:7px 12px}
  .s51-directory-popup .s51-directory-table td{padding:3px 10px}
  .s51-directory-popup .s51-directory-detail-head h4{font-size:20px}
  .s51-directory-popup .s51-directory-week th{padding:3px}
  .s51-directory-popup .s51-directory-week td{padding:1px}
  .s51-directory-popup .s51-directory-week button{padding:2px 4px;gap:1px}
  .s51-directory-popup .s51-directory-week b{font-size:10px;line-height:1.1}
  .s51-directory-popup .s51-directory-week small{font-size:9px;line-height:1.1}
}
@media(max-width:800px){
  .s51-directory-popup .s51-directory-layout{grid-template-columns:170px minmax(0,1fr)}
  .s51-directory-popup .s51-directory-detail{padding:10px;gap:8px}
  .s51-directory-popup .s51-directory-stats>div{flex-direction:column;align-items:flex-start;padding:8px;gap:5px}
  .s51-directory-popup .s51-teacher-classes{flex-direction:column;gap:3px;max-height:88px}
  .s51-directory-popup .s51-teacher-classes h5{margin:0}
}
@media(max-width:540px){
  .s51-directory-popup .s51-directory-layout{grid-template-columns:1fr;grid-template-rows:185px minmax(0,1fr)}
  .s51-directory-popup .s51-directory-list{max-height:none;padding:8px}
  .s51-directory-popup .s51-directory-list label{flex-direction:row;align-items:center}
  .s51-directory-popup .s51-directory-list input{min-width:0}
  .s51-directory-popup .s51-directory-add{min-height:28px;margin:0 0 5px}
  .s51-directory-popup .s51-directory-items{min-height:0;padding-bottom:5px}
  .s51-directory-popup .s51-directory-detail-head h4{font-size:18px}
  .s51-directory-popup .s51-directory-footnote{display:none}
}

/* Weekly board: contiguous lesson cells, distinct day boundaries, readable codes. */
.s51-simple-workspace.s51-screen-fit .s51-header{min-height:42px;padding:5px 12px}
.s51-simple-workspace.s51-screen-fit .s51-header h2{font-size:15px}
.s51-simple-workspace.s51-screen-fit .s51-tabs{padding:5px 10px;gap:10px}
.s51-simple-workspace.s51-screen-fit .s51-primary-resources{max-width:640px;gap:5px}
.s51-simple-workspace.s51-screen-fit .s51-primary-resources>button{height:34px;min-height:34px;padding:4px 10px;border-radius:5px}
.s51-simple-workspace.s51-screen-fit .s51-primary-resources b{font-size:12px}
.s51-simple-workspace.s51-screen-fit .s51-overview.s51-full-matrix{padding:5px 8px;gap:4px}
.s51-simple-workspace.s51-screen-fit .s51-matrix-file select,.s51-simple-workspace.s51-screen-fit .s51-matrix-search input{height:30px}
.s51-simple-workspace.s51-screen-fit .s51-overview-mode button{height:28px;font-size:11px}
.s51-simple-workspace.s51-screen-fit .s51-matrix-toolbar{gap:2px}
.s51-simple-workspace.s51-screen-fit .s51-matrix-scroll{border-radius:3px}
.s51-simple-workspace.s51-screen-fit .s51-matrix-corner,.s51-simple-workspace.s51-screen-fit .s51-matrix-entity{width:110px}
.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-row>td{padding:0!important;border-color:#ffffff90}
.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-lesson,.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-empty button{height:calc(var(--matrix-fit-row,24px) - 1px)!important;border-radius:0;box-shadow:none}
.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-lesson{container-type:inline-size}
.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-lesson b{
  display:block;
  -webkit-line-clamp:unset;
  white-space:nowrap;
  overflow-wrap:normal;
  text-overflow:ellipsis;
  font-family:ui-monospace,Consolas,monospace;
  font-size:clamp(7px,50cqi,var(--matrix-fit-font,10px));
  line-height:1.15;
}
.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-entity [data-overview-entity-id]{padding-right:4px}
.s51-simple-workspace.s51-screen-fit .s51-matrix-period[data-day-first],.s51-simple-workspace.s51-screen-fit td[data-day-first]{border-left:2px solid #7891a5}
.s51-simple-workspace.s51-screen-fit .s51-matrix-dock{min-height:28px}
.s51-simple-workspace.s51-screen-fit .s51-matrix-dock button{padding:5px 10px;min-height:28px}
.s47-output-overlay.s51-child-tool{padding:0!important}
.s47-output-overlay.s51-child-tool>section,.s47-output-overlay.s51-child-tool>div:first-child{max-height:100dvh!important;border-radius:0!important}

/* Academic records use the viewport, with school settings out of the class list. */
.s49-academic-overlay.s49-records-workspace{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;padding:0!important;overflow:hidden!important}
.s49-records-workspace .s49-academic-drawer{display:flex!important;flex-direction:column!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;max-width:none!important;margin:0!important;border-radius:0!important;overflow:hidden!important}
.s49-records-workspace .s49-academic-drawer>header{flex:none!important;min-height:54px!important;padding:8px 16px!important}
.s49-records-workspace .s49-academic-drawer>header h2{font-size:18px!important;margin:0!important}
.s49-records-workspace .s49-academic-drawer>header>div>span,.s49-records-workspace .etp-workspace-toggle{display:none!important}
.s49-records-workspace .s49-tab-context{flex:none;padding:6px 16px!important;min-height:0!important}
.s49-records-workspace .s49-tab-context h2{font-size:16px!important;margin:0!important}
.s49-records-workspace .s49-tab-context p,.s49-records-workspace .s49-tab-context span,.s49-records-workspace .s49-list-guidance{display:none!important}
.s49-records-workspace .s49-stage-filter{flex:none;padding:4px 16px!important;min-height:0!important;gap:8px!important}
.s49-records-workspace .s49-stage-filter nav{padding:2px!important}
.s49-records-workspace .s49-stage-filter button{padding:7px 12px!important;min-height:28px!important}
.s49-records-workspace .s49-tabs{position:relative!important;top:auto!important;flex:none;min-height:36px!important;padding:2px 16px!important}
.s49-records-workspace .s49-academic-body{display:flex!important;flex:1!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:hidden!important;padding:8px 16px!important}
.s49-records-workspace .s49-list{display:flex!important;flex-direction:column!important;flex:1!important;min-height:0!important;width:100%!important;max-height:none!important;overflow:hidden!important}
.s49-records-workspace .s49-list-header{flex:none!important;display:flex!important;align-items:center!important;justify-content:space-between!important;padding:4px 0 8px!important;gap:8px!important}
.s49-records-workspace .s49-list-header>div>strong,.s49-records-workspace .s49-list-header>div>span,.s49-records-workspace #s49-toggle-form-panel{display:none!important}
.s49-records-workspace .s49-list-tools{display:flex!important;align-items:center;flex-wrap:wrap;gap:8px!important}
.s49-records-workspace .s49-resource-list{flex:1!important;min-height:0!important;overflow:auto!important}
/* Legacy teacher-card rules set overflow:visible. Keep the list as the scroll
   container inside the fixed records window, including after tab changes. */
.s49-academic-overlay.s49-records-workspace .s49-resource-list.s49-teacher-table{flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;align-content:start!important;overscroll-behavior:contain;touch-action:pan-y;scrollbar-gutter:stable}
.s49-records-workspace.s49-class-board .s49-resource-list{display:grid!important;grid-template-columns:repeat(var(--class-columns,4),minmax(0,1fr))!important;grid-template-rows:repeat(var(--class-rows,5),minmax(0,1fr))!important;align-content:stretch!important;gap:6px!important;overflow:hidden!important}
.s49-records-workspace.s49-class-board .s49-resource-row{display:grid!important;grid-template-columns:18px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) auto!important;align-items:center!important;min-height:0!important;height:100%!important;padding:5px 8px!important;gap:2px 5px!important;border-radius:6px!important;overflow:hidden!important}
.s49-records-workspace.s49-class-board .s49-resource-main{min-width:0!important;min-height:0!important;overflow:hidden!important}
.s49-records-workspace.s49-class-board .s49-resource-main>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px!important}
.s49-records-workspace.s49-class-board .s49-class-title{font-size:14px!important;padding:0!important;min-height:0!important;line-height:18px!important}
.s49-records-workspace.s49-class-board .s49-resource-kicker,.s49-records-workspace.s49-class-board .s49-resource-status{display:none!important}
.s49-records-workspace.s49-class-board .s49-resource-actions{grid-column:1/-1;display:flex!important;justify-content:flex-end!important;gap:4px!important;flex-wrap:nowrap!important}
.s49-records-workspace.s49-class-board .s49-resource-actions button{height:24px!important;min-height:24px!important;min-width:24px!important;font-size:9px!important;padding:3px 6px!important}
.s49-records-workspace .s49-academic-drawer>footer{flex:none!important;min-height:26px!important;padding:5px 16px!important}
.s49-school-settings{position:relative;flex:none;border-bottom:1px solid #dce5ee;background:#f5f8fb;color:#19324e}
.s49-school-settings>summary{padding:8px 16px;font:600 12px "Segoe UI",sans-serif;cursor:pointer}
.s49-school-settings[open]>.s49-school-profile{position:absolute;right:12px;top:100%;z-index:50;width:min(1000px,calc(100vw - 24px));max-height:calc(100dvh - 130px);overflow:auto;padding:16px!important;background:white;box-shadow:0 12px 40px #19324e44;border:1px solid #dce5ee;border-radius:8px}

.s49-academic-overlay.s49-records-workspace .s49-tab-context{display:none!important}
.s49-academic-overlay.s49-records-workspace .s49-list{padding:0!important;margin:0!important}
.s49-academic-overlay.s49-records-workspace .s49-list-header{min-height:40px!important;padding:0 0 6px!important;margin:0!important}
.s49-academic-overlay.s49-records-workspace .s49-resource-list{padding:0!important;margin:0!important}
.s49-records-workspace.s49-class-board .s49-resource-main{display:block!important;align-self:start!important}
.s49-records-workspace.s49-class-board .s49-class-title{display:inline!important;vertical-align:middle!important}
.s49-records-workspace.s49-class-board .s49-class-total-hours{display:inline-flex!important;margin:0 0 0 4px!important;padding:1px 4px!important;vertical-align:middle!important}
.s49-records-workspace.s49-class-board .s49-class-total-hours small{display:none!important}
.s49-records-workspace.s49-class-board .s49-resource-main>span:last-child{display:block!important;margin-top:2px!important}
.s49-records-workspace.s49-class-board .s49-resource-row{grid-template-rows:minmax(0,1fr) 24px!important}
.s49-records-workspace.s49-class-board .s49-resource-actions button{flex:none!important;white-space:nowrap!important;padding:2px 4px!important}
.s49-records-workspace.s49-class-board .s49-resource-actions{justify-content:flex-start!important}
/* Courses share the full-window records popup; every course remains actionable. */
.s49-course-board-heading{display:flex;align-items:baseline;gap:10px;color:#163953}
.s49-course-board-heading strong{font-size:18px}.s49-course-board-heading span{font-size:11px;color:#647891}
.s49-records-workspace.s49-course-board .s49-resource-list{display:grid!important;grid-template-columns:repeat(var(--class-columns,5),minmax(0,1fr))!important;grid-template-rows:repeat(var(--class-rows,5),minmax(64px,1fr))!important;gap:6px!important;align-content:stretch!important;overflow:auto!important}
.s49-records-workspace.s49-course-board .s49-resource-row{position:relative;display:grid!important;grid-template-columns:16px minmax(0,1fr)!important;align-items:start!important;gap:5px!important;min-height:64px!important;height:100%!important;padding:6px 8px 28px!important;border-radius:8px!important;overflow:visible!important}
.s49-records-workspace.s49-course-board .s49-select-item{width:14px!important;height:14px!important;margin:2px 0!important}
.s49-records-workspace.s49-course-board .s49-resource-main{display:block!important;min-width:0!important}
.s49-records-workspace.s49-course-board .s49-course-name{display:block!important;font-size:12px!important;line-height:14px!important;white-space:normal!important;overflow-wrap:anywhere!important;color:#173952}
.s49-records-workspace.s49-course-board .s49-course-code{display:inline!important;font-size:10px!important;line-height:12px!important;color:#697a92}
.s49-records-workspace.s49-course-board .s49-resource-main>span:last-child{position:absolute;bottom:4px;left:8px;max-width:calc(100% - 86px);font-size:10px!important}
.s49-records-workspace.s49-course-board .s49-course-room{display:none!important}
.s49-records-workspace.s49-course-board .s49-course-hours-edit{min-height:22px!important;height:22px!important;padding:2px 5px!important;font-size:10px!important;line-height:16px!important;border-radius:5px!important}
.s49-records-workspace.s49-course-board .s49-resource-status{position:absolute;right:4px;top:3px!important;width:5px!important;min-width:0!important;padding:0!important;gap:0!important}
.s49-records-workspace.s49-course-board .s49-resource-status span{display:none!important}
.s49-records-workspace.s49-course-board .s49-resource-status i{width:5px!important;height:5px!important}
.s49-records-workspace.s49-course-board .s49-resource-actions{position:absolute;right:5px;bottom:4px;display:flex!important;gap:3px!important;flex-wrap:nowrap!important;opacity:1!important;pointer-events:auto!important}
.s49-records-workspace.s49-course-board .s49-resource-actions button{width:22px!important;min-width:22px!important;height:22px!important;min-height:22px!important;padding:2px!important;font-size:12px!important;border-radius:5px!important}
.s49-records-workspace.s49-course-board .s49-resource-row.archived{border-style:dashed!important}
.s49-records-workspace.s49-course-board .s49-resource-row.archived .s49-course-name{text-decoration:line-through}
.s49-records-workspace.s49-course-board .s49-resource-list.s49-board-overflow{grid-template-rows:none!important;grid-auto-rows:minmax(90px,max-content)!important;align-content:start!important;overscroll-behavior:contain}
.s49-records-workspace.s49-course-board .s49-course-hours-editor{display:inline-flex!important;gap:2px!important;align-items:center!important;padding:0!important;height:22px!important}
.s49-records-workspace.s49-course-board .s49-course-hours-editor input{width:44px!important;min-height:22px!important;height:22px!important;padding:1px 3px!important;font-size:11px!important}
.s49-records-workspace.s49-course-board .s49-course-hours-editor button{width:22px!important;min-width:22px!important;min-height:22px!important;height:22px!important;padding:1px!important}
/* Class-focused assignment workspace. */
.s49-academic-overlay.s49-records-workspace.s49-distribution-board .s49-resource-list{display:block!important;overflow:hidden!important;background:transparent!important}
.s49-distribution-workspace{display:grid;grid-template-columns:210px minmax(0,1fr);gap:16px;height:100%;min-height:0;color:#233c50;font-family:"Segoe UI",sans-serif}
.s49-distribution-sidebar{display:flex;flex-direction:column;min-height:0;border:1px solid #dce5ea;border-radius:12px;background:#f5f8fa;overflow:hidden}
.s49-distribution-sidebar>header{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid #e0e8ee;font-size:13px}
.s49-distribution-sidebar>header span{font-size:11px;color:#738595}
.s49-distribution-sidebar>nav{display:flex;flex-direction:column;gap:4px;min-height:0;overflow:auto;padding:6px;overscroll-behavior:contain}
.s49-academic-overlay .s49-distribution-class{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;flex:none!important;min-height:46px!important;padding:6px 9px!important;text-align:left!important;border:1px solid transparent!important;border-radius:8px!important;background:transparent!important;color:#466075!important;box-shadow:none!important;white-space:normal!important}
.s49-distribution-class>span{min-width:0}.s49-distribution-class strong{display:block;font-size:12px;line-height:15px}.s49-distribution-class small{display:block;font-size:10px;font-weight:400;line-height:14px;color:#748797}.s49-distribution-class>b{font-size:17px;line-height:18px;text-align:right;flex:none}
.s49-academic-overlay .s49-distribution-class:hover{background:#eaf0f3!important}
.s49-academic-overlay .s49-distribution-class.is-selected{background:#fff!important;border-color:#90cfc6!important;color:#086b66!important;box-shadow:0 2px 6px #1739520a!important}
.s49-distribution-detail{display:flex;flex-direction:column;min-height:0;min-width:0;border:1px solid #dce5ea;border-radius:12px;background:#fff;overflow:hidden;box-shadow:0 3px 14px #17395205}
.s49-distribution-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;flex:none;padding:12px 20px;border-bottom:1px solid #e4ebef;background:linear-gradient(110deg,#fff,#f4faf9)}
.s49-distribution-summary>div>small{font-size:9px;letter-spacing:1.8px;font-weight:700;color:#728996}.s49-distribution-summary h3{margin:3px 0!important;font-size:24px!important;line-height:28px!important;color:#183b4d}.s49-distribution-summary p{margin:0;font-size:11px;color:#738595}
.s49-distribution-metrics{display:flex;gap:22px;flex:none}.s49-distribution-metrics>span{font-size:10px;color:#607d88}.s49-distribution-metrics b{display:block;font-size:23px;font-weight:650;line-height:29px;color:#174859}.s49-distribution-metrics .has-missing,.s49-distribution-metrics .has-missing b{color:#b07816}
.s49-distribution-table-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.s49-distribution-table{border-collapse:separate;border-spacing:0;width:100%;font-size:12px;text-align:left}
.s49-distribution-table th{position:sticky;top:0;z-index:1;padding:10px 12px;background:#f7f9fb;border-bottom:1px solid #e0e8ef;font-size:10px;white-space:nowrap;letter-spacing:.3px;font-weight:650;color:#687f90}
.s49-distribution-table td{padding:4px 12px;border-bottom:1px solid #edf1f4;line-height:17px;vertical-align:middle;color:#476075}
.s49-distribution-table td:first-child,.s49-distribution-table th:first-child{width:32px;padding-right:0}
.s49-distribution-table input[type=checkbox]{width:14px!important;height:14px!important;margin:0;accent-color:#0c8378}
.s49-distribution-table td:nth-child(2){width:30%}.s49-distribution-table td:nth-child(2)>strong{display:block;font-size:12px;font-weight:600;color:#233d52}.s49-distribution-table td:nth-child(2)>small{display:block;color:#8a9aa6;font-size:9px;line-height:12px}
.s49-distribution-table tr:hover td{background:#f6fbfa}.s49-distribution-table tr.is-missing td{background:#fffaf0}
.s49-distribution-hours{white-space:nowrap;font-size:13px;color:#2b5b69}.s49-distribution-hours small{font-size:10px;font-weight:400}
.s49-distribution-status{display:inline-flex;white-space:nowrap;border-radius:5px;padding:2px 6px;font-size:10px;background:#edf7f2;color:#398263}.s49-distribution-status.is-warning{background:#fff0d0;color:#9a6412}
.s49-distribution-actions{display:flex;align-items:center;gap:4px;white-space:nowrap}
.s49-academic-overlay .s49-distribution-actions button{min-width:26px!important;height:28px!important;min-height:28px!important;padding:4px 7px!important;background:white!important;color:#527080!important;border:1px solid #dce5eb!important;border-radius:6px!important;box-shadow:none!important;font-size:10px!important;line-height:16px!important}
.s49-academic-overlay .s49-distribution-actions button:hover{border-color:#5caf9f!important;color:#116f64!important;background:#f2faf7!important}.s49-academic-overlay .s49-distribution-actions button.danger{color:#b76a6a!important}.s49-distribution-actions button:disabled{opacity:.4;cursor:not-allowed}
.s49-distribution-detail>footer{display:flex;justify-content:space-between;gap:12px;flex:none;padding:9px 16px;font-size:10px;color:#80919d;border-top:1px solid #e6edf1;background:#fbfcfd}
.s49-distribution-empty{padding:28px;text-align:center;color:#7b8e9d;font-size:12px}.s49-distribution-empty p{margin:8px 0}
.s49-distribution-board .s49-assignment-quick-filters{display:flex;gap:3px;padding:3px;background:#edf2f5;border:1px solid #e1e8ed;border-radius:8px}
.s49-academic-overlay.s49-distribution-board [data-assignment-filter]{min-height:30px!important;padding:5px 10px!important;font-size:11px!important;border:0!important;border-radius:5px!important;background:transparent!important;color:#687f90!important;box-shadow:none!important}
.s49-academic-overlay.s49-distribution-board [data-assignment-filter].active{background:white!important;color:#14766a!important;box-shadow:0 1px 4px #233c5010!important}
.s49-academic-overlay.s49-distribution-board #s49-new-record{background:#087c72!important;border-color:#087c72!important;color:#fff!important;box-shadow:none!important;border-radius:7px!important}
.s49-distribution-board .s49-search{max-width:300px}.s49-distribution-board .s49-search input{width:100%!important}
.s49-distribution-class:focus-visible,.s49-distribution-actions button:focus-visible{outline:2px solid #158a7d;outline-offset:2px}
@media(max-width:1400px){.s49-distribution-workspace{grid-template-columns:170px minmax(0,1fr);gap:10px}.s49-distribution-summary{padding:12px 15px}.s49-distribution-table td,.s49-distribution-table th{padding:6px 8px}.s49-distribution-table td:nth-child(2){width:27%}.s49-distribution-table td:nth-child(2)>strong{font-size:11px}.s49-distribution-table{font-size:11px}.s49-distribution-metrics{gap:16px}.s49-distribution-board .s49-search{max-width:220px}}
@media(max-width:900px){.s49-distribution-workspace{grid-template-columns:140px minmax(0,1fr)}.s49-distribution-summary{align-items:flex-start;flex-direction:column;gap:8px}.s49-distribution-metrics b{display:inline;font-size:17px}.s49-distribution-table{min-width:650px}.s49-distribution-detail>footer span:last-child{display:none}}

/* Remaining-hour counts are actions, not passive badges. */
.s51-directory-record{position:relative;margin-bottom:5px}
.s51-directory-record>[data-directory-item]{min-height:72px!important;padding-bottom:28px!important}
.s51-directory-record>[data-directory-item]>small{position:absolute;bottom:10px;left:12px}
.s51-directory-remaining-badge{position:absolute!important;right:9px;bottom:8px;z-index:1;min-height:24px!important;padding:3px 6px!important;font-size:10px!important;border:1px solid #edce8f!important;border-radius:5px!important;background:#fff4d9!important;color:#8f5910!important;cursor:pointer}
.s51-directory-remaining-stat{display:flex!important;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:0!important;margin:0!important;text-align:left;border:0!important;background:transparent!important;cursor:pointer}
.s51-directory-remaining-stat>small{display:block;margin-top:0;color:#91631c;font-size:10px}
.s51-directory-remaining-badge:hover,.s51-directory-remaining-stat:hover{filter:brightness(.96)}
.s49-academic-overlay.s49-records-workspace .s49-teacher-cell.actions{opacity:1!important;pointer-events:auto!important}
.s49-academic-overlay.s49-records-workspace .s49-teacher-cell.actions button:not(:disabled){opacity:1!important;pointer-events:auto!important;background:#fff!important;color:#244a66!important;border:1px solid #cbd9e5!important;border-radius:6px!important}
@media(max-width:540px){.s51-directory-record{flex:0 0 180px;margin:0}.s51-directory-record>[data-directory-item]{width:100%!important;height:100%}}

/* Compact, explicit feedback for daily timetable edits. */
.s51-simple-workspace .s51-effect{flex:none;align-items:center;gap:12px;max-height:none;overflow:visible}
.s51-simple-workspace.s51-screen-fit .s51-full-matrix>.s51-effect{max-height:none;overflow:visible}
.s51-simple-workspace .s51-effect>div:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
.s51-simple-workspace .s51-effect .s637-effect-actions{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;flex:none;gap:8px}
.s51-simple-workspace .s51-effect strong{font-size:14px;line-height:1.4}
.s51-simple-workspace .s51-effect span{font-size:12px;line-height:1.5}
.s51-simple-workspace .s51-effect .s51-pending-save{display:block;margin-top:4px;color:#7c3b10;font-size:12px;line-height:1.5;font-weight:600}
.s51-simple-workspace .s637-effect-actions button{min-height:44px;padding:10px 14px;font-size:13px;white-space:nowrap}
.s51-simple-workspace .s637-effect-actions button:focus-visible{outline:3px solid #2563eb;outline-offset:2px}
.s51-simple-workspace .s637-effect-actions button:disabled{opacity:.6;cursor:wait}
.s51-simple-workspace .s51-summary-scope{color:#475569;font-size:12px;white-space:nowrap}
.s51-simple-workspace .s51-pool-scope{flex-wrap:wrap}
.s51-simple-workspace .s51-pool-scope button{min-height:44px;font-size:12px;color:#254a43;padding:8px}
@media(max-width:700px){.s51-simple-workspace .s51-effect{align-items:stretch;flex-direction:column}.s51-simple-workspace .s637-effect-actions{display:flex;flex-wrap:wrap}.s51-simple-workspace .s637-effect-actions button{flex:1}}
/* Full-window desk: scale controls with the viewport, without limiting the canvas width. */
.s51-simple-workspace.s51-screen-fit .s51-header{min-height:54px}
.s51-simple-workspace.s51-screen-fit .s51-header h2{font-size:18px}
.s51-simple-workspace{width:100%;height:100vh;height:100dvh;max-width:none;overflow:hidden}
.s51-simple-workspace .s51-modal{display:flex;flex-direction:column;min-height:0;width:100%;height:100%;max-width:none;max-height:none}
.s51-simple-workspace .s51-body,.s51-simple-workspace .s51-main,.s51-simple-workspace .s51-tab-content{min-width:0;min-height:0}
.s51-simple-workspace.s51-screen-fit .s51-primary-resources{max-width:none}
.s51-simple-workspace.s51-screen-fit .s51-primary-resources>button{min-height:44px;height:44px}
.s51-simple-workspace .s51-header .s51-close{width:44px;height:44px;flex:none}
.s51-simple-workspace .s51-workspace-actions{flex-wrap:wrap;justify-content:flex-end}
.s51-simple-workspace .s51-workspace-actions>.s51-create-primary,.s51-simple-workspace .s51-studio-menu>summary{min-height:44px;height:auto;display:flex;align-items:center}
.s51-simple-workspace .s51-studio-menu>summary{gap:6px}
.s51-simple-workspace .s51-matrix-summary{align-items:center;flex-wrap:wrap}
.s51-simple-workspace .s51-matrix-file{flex:1;max-width:none}
.s51-simple-workspace .s51-matrix-file select{flex:1;max-width:none;width:100%}
.s51-simple-workspace .s51-matrix-pool{flex-basis:clamp(280px,21vw,360px);width:clamp(280px,21vw,360px)}
.s51-simple-workspace .s51-fit-overview .s51-matrix-period b{font-size:10px}
.s51-simple-workspace .s51-matrix-dock{flex-wrap:wrap}
.s51-simple-workspace.s51-screen-fit .s51-matrix-dock button{min-height:40px;font-size:12px}
@media(min-height:850px) and (min-width:1100px){.s51-simple-workspace.s51-screen-fit .s51-header{min-height:62px}.s51-simple-workspace.s51-screen-fit .s51-header h2{font-size:22px}.s51-simple-workspace.s51-screen-fit .s51-primary-resources>button{height:50px}.s51-simple-workspace.s51-screen-fit .s51-primary-resources b{font-size:15px}.s51-simple-workspace.s51-screen-fit .s51-matrix-file select,.s51-simple-workspace.s51-screen-fit .s51-matrix-search input{height:44px;font-size:14px}.s51-simple-workspace .s51-matrix-summary>button,.s51-simple-workspace .s51-matrix-summary>span{min-height:40px;font-size:13px}}
@media(max-width:1100px){.s51-simple-workspace .s51-tabs{flex-direction:row;flex-wrap:wrap;gap:8px}.s51-simple-workspace .s51-primary-resources{min-width:0;flex-basis:100%}.s51-simple-workspace .s51-workspace-actions{width:100%}.s51-simple-workspace .s51-matrix-pool{position:absolute;right:0;top:0;bottom:0;z-index:10;width:min(320px,85vw);flex-basis:auto}}
@media(max-width:540px){.s51-simple-workspace .s51-workspace-actions{justify-content:space-between;gap:6px}.s51-simple-workspace .s51-workspace-actions>.s51-create-primary,.s51-simple-workspace .s51-workspace-actions>.s51-output-shortcut{padding:8px 10px}.s51-simple-workspace .s51-studio-menu summary{padding:8px}.s51-simple-workspace .s51-matrix-file{min-width:0}.s51-simple-workspace .s51-matrix-summary{gap:4px}}

.s51-simple-workspace .s51-matrix-toolbar-top {
  flex-wrap: wrap;
  gap: 8px;
}
.s51-simple-workspace .s51-matrix-search {
  margin-left: 0;
}
.s51-simple-workspace .s51-course-search {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #23445e;
}
.s51-simple-workspace .s51-course-search span {
  white-space: nowrap;
}
.s51-simple-workspace .s51-course-search input {
  width: clamp(136px, 13vw, 235px);
  min-width: 0;
}
.s51-simple-workspace.s51-screen-fit .s51-course-search input {
  height: 44px;
}
.s51-course-filter-notice {
  margin: 4px 0;
  font-size: 13px;
  color: #3d566c;
}
.s51-matrix-row .s51-matrix-filtered {
  background: #e8edf3;
}
.s51-readable-view .s51-matrix-entity strong,
.s51-directory-record > [data-directory-item] b,
.s51-directory-detail-head h4 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.s51-matrix-entity [data-teacher-program] strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.s51-matrix-entity [data-teacher-program]:hover {
  background: #e4f1f3;
}
.program-ciktilari-page .s51-output-back,
.s51-teacher-print {
  flex: none;
  width: auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #d0dce7;
  border-radius: 7px;
  background: #fff;
  color: #18354f;
  font: 600 13px/1.2 "Segoe UI", sans-serif;
  cursor: pointer;
}
.s51-output-status > .s51-output-back {
  position: absolute;
  top: 16px;
  left: 32px;
}
.program-ciktilari-page .s51-teacher-output > header {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 62px !important;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 16px !important;
}
.s51-teacher-output > header > div {
  flex: 1;
  min-width: 0;
}
#s51-teacher-output-title {
  font: 650 20px/1.25 "Segoe UI", sans-serif;
  color: #18354f !important;
}
.s51-teacher-output > header p {
  overflow-wrap: anywhere;
  color: #476077 !important;
}
.s51-teacher-print {
  border-color: #10736b;
  background: #10736b;
  color: #fff;
}
.program-ciktilari-page .s51-teacher-output .s47-output-preview {
  flex: 1;
  height: auto !important;
  max-height: none !important;
}
.program-ciktilari-page .s51-teacher-output .s47-paper-stage {
  width: max(100%, 620px) !important;
  padding: 16px !important;
}
.program-ciktilari-page .s51-teacher-output .s47-paper {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto;
  margin: 0 auto !important;
  --s611-row-screen: 43px !important;
}
.s51-teacher-output .s47-paper.s611-single-page .s611-paper-header {
  min-height: 60px;
}
.s51-teacher-output .s47-paper.s611-single-page .s611-paper-school-logo {
  height: 51px;
}
.s51-teacher-output .s47-paper.s611-single-page .s611-paper-mark {
  width: 44px;
  height: 44px;
}
.s51-print-frame {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 297mm;
  height: 210mm;
  border: 0;
}
@media (max-width: 800px) {
  .s51-simple-workspace .s51-matrix-search {
    width: auto;
    min-width: 0;
    flex: 1 1 155px;
  }
  .s51-simple-workspace .s51-matrix-search input {
    width: 100%;
  }
}
@media (max-width: 540px) {
  .s51-simple-workspace .s51-matrix-file {
    flex-basis: 100%;
  }
  .s51-simple-workspace .s51-course-search {
    flex-basis: 190px;
  }
  .program-ciktilari-page .s51-teacher-output > header {
    gap: 8px;
    padding-inline: 8px !important;
  }
  #s51-teacher-output-title {
    font-size: 16px;
  }
  .s51-teacher-output > header button {
    padding-inline: 9px;
  }
}

.s51-simple-workspace .s51-matrix-scroll { container-type: inline-size; }
.s51-simple-workspace .s51-matrix-period .s51-period-label {
  display: flex;
  justify-content: center;
  gap: 3px;
  line-height: 1.1;
  color: #253d55;
}
.s51-simple-workspace.s51-screen-fit .s51-fit-overview .s51-matrix-period {
  height: 25px !important;
}
.s51-simple-workspace .s51-fit-overview .s51-matrix-period .s51-period-label {
  display: grid;
  gap: 1px;
  font-size: 10px;
  white-space: nowrap;
}
.s51-fit-overview .s51-period-word { font-size: 9px; }
@container (max-width: 1090px) {
  .s51-fit-overview .s51-period-word { display: none; }
}
.s51-lunch-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 3px 8px;
  background: #fffaec;
  border: 1px solid #ecd7a0;
  border-radius: 5px;
  font-size: 11px;
  color: #633b0d;
}
.s51-lunch-strip button {
  border: 1px solid #d7af56;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  padding: 4px 8px;
  min-height: 26px;
  font-weight: 700;
}
.s51-lunch-strip button:hover { background: #fff0c7; }
.s51-lunch-strip span { line-height: 1.3; }
.s51-simple-workspace .s51-program-matrix :is(.s51-lunch-heading, .s51-fixed-lunch) {
  background: #fff0c7;
  color: #633b0d;
  text-align: center;
}
.s51-simple-workspace .s51-program-matrix .s51-fixed-lunch {
  box-shadow: inset 0 0 0 1px #dcb65f;
  cursor: default;
}
.s51-simple-workspace .s51-program-matrix .s51-fixed-lunch b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}
.s51-simple-workspace .s51-program-matrix .s51-fixed-lunch small {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}
.s51-simple-workspace .s51-fit-overview .s51-fixed-lunch b {
  font-size: 9px;
}
.s51-simple-workspace .s51-fit-overview .s51-fixed-lunch small {
  display: none;
}
.s51-fit-overview .s51-lunch-pair span {
  display: block;
  line-height: 1.1;
}
.s51-simple-workspace .s51-program-matrix .s51-lunch-unused {
  background: #f5f8fb;
}
@container (max-width: 1090px) {
  .s51-simple-workspace .s51-fit-overview .s51-fixed-lunch b {
    font-size: 8px;
  }
}
.s51-simple-workspace .s51-program-matrix td[data-lunch-conflict] {
  box-shadow: inset 0 0 0 2px #bd7b18;
}
.s51-simple-workspace .s51-program-matrix .s51-lunch-blocked {
  background: #fff0c7;
  color: #633b0d;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
}
.s48-lunch-description { margin: 0 0 8px; color: #4c5e71; font-size: 13px; line-height: 1.5; }
.s48-lunch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.s48-lunch-actions button {
  min-height: 40px;
  border: 1px solid #bfd0dd;
  border-radius: 6px;
  background: #fff;
  color: #16364d;
  padding: 6px 12px;
  font-weight: 700;
}
.s48-lunch-actions [data-lunch-preset] { background: #0b665c; border-color: #0b665c; color: #fff; }
.s48-lunch-actions button:disabled { opacity: .6; }
.s48-lunch-members { margin-top: 8px; font-size: 12px; color: #40566a; }
.s48-lunch-members p { margin: 5px 0 0; }
.s48-lunch-times > label, .s48-lunch-times input, .s48-lunch-times select { min-width: 0; }
.s47-paper.s611-single-page .s47-schedule-table :is(.s51-output-lunch :is(th,td), .s51-output-lunch-cell) {
  background: #fff5d6 !important;
  color: #633b0d;
  font-weight: 700;
}
.s47-paper.s611-single-page .s47-schedule-table .s51-output-lunch :is(th,td) {
  height: 25px !important;
  max-height: 25px !important;
}

/* Daily editing uses a stable save bar and a readable week for the chosen class. */
.s51-simple-workspace.s51-screen-fit .s51-primary-resources [data-studio-resource="ROOM"] small { display: block !important; font-size: 10px; line-height: 1.2; }
.s51-simple-workspace .s51-overview-filters:not([hidden]) {
  display: flex;
  gap: 12px;
  align-items: end;
  padding: 8px 0;
}
.s51-simple-workspace .s51-overview-filters[hidden] { display: none; }
.s51-simple-workspace .s51-overview-filters .s51-matrix-search {
  margin: 0;
  display: grid;
  gap: 4px;
  flex: 1;
}
.s51-simple-workspace .s51-overview-filters input { width: 100%; }
.s51-simple-workspace .s51-matrix-toolbar-bottom { justify-content: flex-end; }
.s51-simple-workspace .s51-matrix-toolbar-top > #s51-toggle-filters { flex: none; }
.s51-simple-workspace :is(.s51-focused-week > header, .s51-daily-save, .s51-selected-lesson) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  color: var(--studio-ink);
  background: #fff;
  border: 1px solid var(--studio-line);
  border-radius: 6px;
  padding: 7px 10px;
}
.s51-simple-workspace :is(.s51-focused-week > header, .s51-daily-save, .s51-selected-lesson) button,
.s51-simple-workspace :is(#s51-toggle-filters, #s51-clear-filters) {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #b9cbd9;
  border-radius: 5px;
  background: #fff;
  color: var(--studio-ink);
  font: 600 12px/1.3 Inter, "Segoe UI", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.s51-simple-workspace :is(.s51-focused-week > header, .s51-daily-save, .s51-selected-lesson) button:disabled {
  cursor: default;
  color: #607080;
  background: #edf2f6;
}
.s51-simple-workspace .s51-daily-save > span,
.s51-simple-workspace .s51-selected-lesson > div { flex: 1; min-width: 0; }
.s51-simple-workspace :is(.s51-daily-save, .s51-selected-lesson) :is(strong, b, span, small) { line-height: 1.4; }
.s51-simple-workspace .s51-daily-save b,
.s51-simple-workspace .s51-selected-lesson strong { display: block; font-size: 13px; }
.s51-simple-workspace .s51-daily-save small,
.s51-simple-workspace .s51-selected-lesson > div > span { display: block; color: #40566a; font-size: 12px; }
.s51-simple-workspace .s51-daily-save.is-pending { border-color: #bb7a11; }
.s51-simple-workspace .s51-daily-save button.primary:not(:disabled) {
  background: #087f76;
  border-color: #087f76;
  color: #fff;
  min-width: 90px;
}
.s51-simple-workspace .s51-selected-lesson { border-left: 3px solid #087f76; padding: 4px 8px; }
.s51-simple-workspace .s51-focused-week {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.s51-simple-workspace .s51-focused-week > header { flex-wrap: wrap; }
.s51-simple-workspace .s51-focused-week > header label {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 180px;
  font-size: 12px;
}
.s51-simple-workspace .s51-focused-week select {
  width: 100%;
  min-width: 0;
  height: 38px;
  font: 600 13px Inter, "Segoe UI", sans-serif;
  color: var(--studio-ink);
  background: #fff;
  border: 1px solid #b9cbd9;
  border-radius: 5px;
  padding: 5px 8px;
}
.s51-simple-workspace .s51-focused-grid { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.s51-simple-workspace .s51-focused-grid .s51-schedule-grid {
  height: 100%;
  min-width: 0 !important;
  grid-template-columns: 86px repeat(var(--s51-focus-day-count, 5), minmax(0, 1fr)) !important;
  grid-template-rows: 30px repeat(var(--s51-focus-row-count, 9), minmax(0, 1fr));
  background: #fff;
}
.s51-simple-workspace .s51-focused-grid :is(.s51-grid-cell, .s51-grid-period) {
  min-height: 0 !important;
  padding: 3px 6px;
  min-width: 0;
  gap: 2px;
  border-left-width: 0;
}
.s51-simple-workspace .s51-focused-grid .s51-grid-cell { position: relative; text-align: left; }
.s51-simple-workspace .s51-focused-grid .s51-grid-cell strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  background: var(--matrix-course);
  color: var(--matrix-course-text);
}
.s51-simple-workspace .s51-focused-grid .s51-grid-cell span { display: block; margin: 0; font-size: 11px; line-height: 1.1; color: #29445f; }
.s51-simple-workspace .s51-focused-grid .s51-grid-cell small { display: none; }
.s51-simple-workspace .s51-focused-grid .s51-grid-cell > b { position: absolute; right: 3px; bottom: 2px; font-size: 10px; }
.s51-simple-workspace .s51-focused-grid .s51-grid-cell.selected { outline: 3px solid #173e75; outline-offset: -3px; }
.s51-simple-workspace .s51-focused-grid .s51-focus-lunch { color: #70450c; background: #fff1cd; }
.s51-simple-workspace .s51-focus-parallel { display: flex; min-width: 0; min-height: 0; }
.s51-simple-workspace .s51-focus-parallel > button { flex: 1; min-width: 0; }
.s51-simple-workspace .s51-focus-load { font-size: 12px; white-space: nowrap; }
.s51-simple-workspace .s51-focused-view .s51-matrix-toolbar-bottom,
.s51-simple-workspace .s51-focused-view .s51-lunch-strip { display: none; }
.s51-simple-workspace .s51-focused-grid :is(.s51-grid-day, .s51-grid-period) strong { font-size: 12px; }
.s51-simple-workspace .s51-focused-grid .s51-grid-day { padding: 4px 6px; }
.s51-simple-workspace .s51-focused-grid .s51-grid-period { display: flex; flex-direction: column; justify-content: center; }
.s51-simple-workspace .s51-focused-grid .s51-grid-period :is(strong, small) { margin: 0; line-height: 1.2; }
@media (max-height: 800px) and (min-width: 801px) {
  .s51-simple-workspace .s51-focused-grid .s51-grid-cell { padding: 2px 4px; }
  .s51-simple-workspace .s51-focused-grid .s51-grid-cell strong { font-size: 12px; line-height: 1.1; padding: 1px 3px; }
  .s51-simple-workspace .s51-focused-grid .s51-grid-period small { font-size: 10px; }
  .s51-simple-workspace .s51-focused-week > header { padding: 4px 8px; }
}
.s51-simple-workspace :is(button, select, input):focus-visible { outline: 3px solid #2d63b4; outline-offset: 2px; }
@media (max-width: 800px) {
  .s51-simple-workspace .s51-selected-lesson { flex-wrap: wrap; }
  .s51-simple-workspace .s51-selected-lesson > div { flex-basis: 100%; }
  .s51-simple-workspace .s51-focused-grid .s51-schedule-grid { min-width: 660px !important; }
  .s51-simple-workspace .s51-daily-save small { display: none; }
}
html[data-etp-theme="dark"] .s51-simple-workspace :is(.s51-focused-week > header, .s51-selected-lesson, .s51-daily-save, .s51-focused-week select, #s51-toggle-filters, #s51-clear-filters) {
  background: var(--etp-mode-surface);
  color: var(--etp-mode-text);
  border-color: var(--etp-mode-border);
}
html[data-etp-theme="dark"] .s51-simple-workspace :is(.s51-focused-week > header, .s51-selected-lesson, .s51-daily-save) button {
  background: var(--etp-mode-raised);
  color: var(--etp-mode-text);
  border-color: var(--etp-mode-border);
}
html[data-etp-theme="dark"] .s51-simple-workspace :is(.s51-daily-save small, .s51-selected-lesson > div > span, .s51-focused-grid .s51-grid-cell span) { color: var(--etp-mode-muted); }
html[data-etp-theme="dark"] .s51-simple-workspace .s51-focused-grid :is(.s51-schedule-grid, .s51-grid-cell, .s51-grid-day, .s51-grid-period) { background: var(--etp-mode-surface); color: var(--etp-mode-text); border-color: var(--etp-mode-border); }
html[data-etp-theme="dark"] .s51-simple-workspace .s51-focused-grid .s51-focus-lunch { background: #493a22; color: #ffe0a3; }
html[data-etp-theme="dark"] .s51-simple-workspace .s51-daily-save.is-pending { border-color: #d69b34; }
