/* Screen-only presentation. Timetable data and PDF rendering are unchanged. */
:root,html[data-theme="classic"],html[data-theme="light"]{
  --page:#f3f5fc;--paper:#fff;--wash:#edf1fc;--wash-2:#f8faff;
  --text:#192746;--text-soft:#526481;--hdr-bg:#4057b5;--hdr-bg-2:#526bc4;
  --hdr-fg:#fff;--hdr-fg-2:#f0f4ff;--rule:#dce3f2;--rule-soft:#e8edf6;
  --focus:#485ed2;--pale:#e9edff;--r:12px;
  --rail-bg:#192747;--rail-fg:#d6dff5;--rail-strong:#fff;--rail-dim:#a3b4d9;
  --rail-line:#ffffff1c;--rail-hover:#ffffff0e;--rail-active:#ffffff18;--rail-mark:#a3b4ff;--rail-btn:#ffffff12;
  --leaf:#147554;--leaf-bg:#e9f8f1;--leaf-text:#176246;--leaf-line:#bce6d2;
  --amber:#94600f;--amber-bg:#fff5df;--amber-text:#79500f;--amber-line:#efdaa7;
}
html[data-theme="dark"]{--page:#10182b;--paper:#19243b;--wash:#23314c;--wash-2:#1d2942;--text:#edf2ff;--text-soft:#b3c0db;--hdr-bg:#4259ab;--hdr-bg-2:#344b8c;--focus:#9dadff;--r:12px;--rule:#35435f;--rule-soft:#2c3b56}
body{font-size:15px;line-height:1.55;background:radial-gradient(ellipse at top right,#728cff16,transparent 50%),var(--page)}
.shell{grid-template-columns:252px minmax(0,1fr)}
.rail{background:linear-gradient(165deg,#203458,#17233f 75%);box-shadow:4px 0 24px #152b4910}
html[data-theme="light"] .rail{border:0}
.crest{padding:28px 22px 20px}.crest .sch{font-size:18px;line-height:1.4}.crest .sub{font-size:12px;color:#c1cff0;letter-spacing:.08em;text-transform:uppercase;margin-top:8px}.crest .hm{font-size:12px;line-height:1.65;margin-top:15px;padding-top:12px}
.nav{padding:8px 12px}.nav b{font-size:10px;letter-spacing:.13em;text-transform:uppercase;padding:20px 12px 7px}.nav button{min-height:46px;padding:10px 12px;margin:3px 0;border-radius:10px;border-left:0;font-size:14px;transition:background .15s}.nav button.on{background:linear-gradient(100deg,#5268cb,#4455a4);box-shadow:0 5px 16px #071b352a;color:#fff}.nav .ic{width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:#ffffff12;font-size:17px}
.railfoot{padding:16px}.railfoot button,html[data-theme="light"] .railfoot button{color:#e4ebff;border-color:#ffffff26;min-height:36px}.cloudbadge{font-size:12px;padding:10px;color:#ccd8f0;border-radius:9px}.cloudbadge.warn{color:#ffe3a0}.cloudbadge.on{color:#a7f3d0}
.pane{min-width:0;width:100%;max-width:1800px;padding:34px 32px 72px;margin:0 auto}.phead{padding:2px 0 20px;margin-bottom:4px}.phead h1{font-size:clamp(24px,2.1vw,32px);font-weight:750;letter-spacing:-.035em;line-height:1.25}.phead .note{font-size:14px;max-width:1050px;line-height:1.7;margin-top:10px}
.card{border-radius:16px;box-shadow:0 4px 20px #233e6b06;margin-bottom:22px;min-width:0}.card>h2{padding:18px 20px;font-size:16px;flex-wrap:wrap;gap:10px}.card>h2 .hint{font-size:12px;padding:3px 9px;background:var(--wash);border-radius:20px}.card .body{padding:20px}.card>.tw{border-radius:0 0 15px 15px}.card>.tw:first-child{border-radius:15px}
.btn{min-height:42px;padding:9px 16px;font-weight:600;border-radius:10px;transition:background .15s,box-shadow .15s}.btn.pri{background:linear-gradient(120deg,#4f65ce,#3c52b1);border-color:#445bbf;box-shadow:0 3px 9px #4057b522;color:#fff}.btn.sm{min-height:36px;padding:6px 11px}.btn:hover{box-shadow:0 3px 10px #1e3c6714}.bar{gap:10px;margin:0 0 20px}.bar .seg{margin:3px 0}.seg{border-radius:10px;padding:3px;gap:3px}.seg button{min-height:36px;border:0;border-radius:7px}.seg button.on{background:#4057b5;color:#fff}
select,input[type=text],input[type=number],input[type=date],textarea{min-height:42px;border-radius:9px;padding:9px 11px;font-size:14px}label.fld{font-size:13px;gap:7px}input[type=checkbox]{accent-color:#4b61c7;width:17px;height:17px;vertical-align:middle}.pill label{min-height:40px;padding:8px 12px}.rowflex{gap:14px}
.tw{max-width:100%;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#b0bfdc var(--wash)}.pane table{font-size:13px}.pane th,.pane td{padding:11px 12px}.pane thead th{font-size:12px;letter-spacing:.015em}.pane thead th.t2{top:40px;font-size:11px}.pane .grid td.slot{height:70px;min-width:130px;padding:9px 6px}.pane .grid td.slot .s{font-size:13px}.pane .grid td.slot .t{font-size:12px;line-height:1.45;margin-top:4px}.pane .grid td.cls{position:sticky;left:0;z-index:3;box-shadow:2px 0 5px #2233560c;color:var(--focus);min-width:80px}.pane .grid td.slot.locked::after{width:7px;height:7px;top:6px;right:6px}.pane .grid td.slot .daytag{font-size:10px}.teacher-order-note{padding:15px 20px;font-size:13px}.drag-handle{min-width:32px;min-height:32px;border-radius:8px;color:var(--focus)}.teacher-group{padding:4px 9px;color:var(--focus);background:var(--pale);border-color:transparent}
.stats{gap:14px;border:0;background:none;overflow:visible;margin-bottom:22px}.stat{background:var(--paper);border:1px solid var(--rule);border-top:4px solid #6175d5;border-radius:14px;padding:18px 20px;box-shadow:0 4px 15px #233e6b06}.stat:nth-child(3n+2){border-top-color:#21a389}.stat:nth-child(3n){border-top-color:#d99836}.stat:last-child{border-right:1px solid var(--rule)}.stat .k{font-size:13px}.stat .v{font-size:32px;font-weight:750;margin-top:6px}.chip{padding:4px 10px;border-radius:20px;font-size:12px}.banner{padding:15px 18px;border-radius:12px;line-height:1.7}
.scrim{background:#0c193c88;backdrop-filter:blur(4px)}.dlg{border-radius:18px;max-height:90dvh}.dlg h3{font-size:19px;padding:21px 24px}.dlg .body{padding:22px 24px}.dlg .foot{padding:16px 24px;background:var(--wash-2)}.toast{max-width:calc(100vw - 28px);text-align:center;box-shadow:0 8px 30px #14243f30;bottom:24px}.cloudhero{padding:8px}.cloudhero h2{font-size:24px}.cloudhero p{font-size:15px}.cloudsave{grid-template-columns:minmax(0,1fr) auto auto}.cloudactions{gap:8px}.pdf-preview-head{color:#192746;border-radius:9px}.pdf-preview-shell{border-radius:12px}.pdf-preview-frame{border-radius:6px}.steps li{padding-bottom:22px}.steps li::before{background:#e8edff;color:#3c52b1}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.dayedit th{color:var(--text)}
html[data-theme="light"] .railfoot button:hover{background:#ffffff20}
@media(max-width:1100px){.shell{grid-template-columns:218px minmax(0,1fr)}.pane{padding:26px 20px 60px}.crest{padding:22px 16px}.nav{padding:8px}.cloudsave{grid-template-columns:1fr}.cloudsave .btn{width:100%}}
@media(max-width:860px){
  .shell{display:block}.rail{position:relative;height:auto;width:100%;display:block}.crest{padding:16px 18px 12px}.crest .sch{font-size:17px}.crest .sub{margin-top:3px;font-size:10px}.crest .hm{display:none}
  .nav{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:7px;padding:8px 12px 13px;scrollbar-width:thin}.nav b{display:none}.nav button{width:auto;flex:0 0 auto;white-space:nowrap;font-size:13px;min-height:44px;margin:0;padding:8px 12px;background:#ffffff0a}.nav .ic{width:22px;height:22px;font-size:14px}.railfoot{display:flex;align-items:center;gap:10px;padding:8px 14px}.cloudbadge{flex:1;font-size:11px;padding:7px}.themepick{flex:0 0 150px}.railfoot button{min-height:34px}
  .pane{padding:24px 16px 48px;max-width:100%}.phead{padding-bottom:16px}.phead .note{font-size:13px}.card>h2,.card .body{padding:16px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat{padding:15px}.stat .v{font-size:28px}.card .tw table{min-width:620px}.card .tw .grid{min-width:1200px}.bar{gap:8px}.bar>.spacer{display:none}.bar>.small{flex-basis:100%}.btn,.btn.sm{min-height:44px}.seg button{min-height:40px;padding:8px 11px}.teacher-order-note{padding:14px 16px}.rowflex>*{max-width:100%}.rowflex>.fld{flex:1 1 200px}.scrim{padding:10px}.dlg .body{padding:18px}.dlg h3{padding:18px}.dlg .foot{padding:14px}.dayedit{display:block;overflow-x:auto}.pdf-preview-frame{min-height:460px;height:70vh}select,input[type=text],input[type=number],input[type=date],textarea{font-size:16px}.cloudhero{padding:0}.cloudhero h2{font-size:21px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}

/* Compact timetable workspace. This stylesheet is screen-only, not PDF CSS. */
.screen-tools{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:12px;height:50px;padding:5px 16px;background:var(--paper);border-bottom:1px solid var(--rule);box-shadow:0 2px 12px #19274608}
.screen-tools .btn{min-height:36px;padding:6px 12px;white-space:nowrap}.screen-brand{font-size:13px;font-weight:750;color:var(--text-soft)}
.screen-tools [hidden],.rail[hidden]{display:none!important}.screen-tools #fitStatus{font-size:11px}
.shell{min-height:calc(100dvh - 50px)}.rail{top:50px;height:calc(100dvh - 50px)}
body.menu-hidden .shell{grid-template-columns:minmax(0,1fr)}
.pane.timetable-fit{--tt-font:12px;padding:10px 12px 12px;max-width:none}
.timetable-fit .phead{padding:0;margin:0 0 6px}.timetable-fit .phead h1{font-size:20px;line-height:1.2;letter-spacing:-.02em}.timetable-fit .phead .note{font-size:11px;line-height:1.35;margin-top:3px;max-width:none}
.timetable-fit .bar{margin:5px 0 8px;gap:7px}.timetable-fit .bar .btn,.timetable-fit .seg button{font-size:11px;min-height:30px;padding:5px 9px}.timetable-fit .bar .small{font-size:10px}.timetable-fit .seg{padding:2px}.timetable-fit .card{margin-bottom:0;border-radius:10px}.timetable-fit .card>.tw{border-radius:9px}
.pane.timetable-fit table.grid{table-layout:fixed;min-width:0;width:100%;font-size:var(--tt-font);line-height:1.1}
.pane.timetable-fit .grid td,.pane.timetable-fit .grid th{font-size:1em;padding:.22em .3em;min-width:0;height:auto;white-space:normal;overflow-wrap:anywhere}
.pane.timetable-fit .grid thead th{position:static;font-size:.92em;letter-spacing:0;font-weight:700;line-height:1.15}
.pane.timetable-fit .grid thead th.t2{font-size:.86em;font-weight:500}
.pane.timetable-fit .grid th:first-child{width:5%}.pane.timetable-fit .grid th:nth-child(2){width:10%}
.pane.timetable-fit[data-view="tw"] .grid th:first-child{width:13%}.pane.timetable-fit[data-view="tw"] .grid th:nth-child(2){width:6%}
.pane.timetable-fit[data-view="tw"] .grid th:last-child{width:10%}.pane.timetable-fit[data-view="tw"] .grid th:nth-last-child(2){width:4%}
.pane.timetable-fit .grid th.brkh{width:2%}
.pane.timetable-fit .grid td.cls{position:static;font-size:1em;box-shadow:none}
.pane.timetable-fit .grid td.slot .s{font-size:1em;line-height:1.08;font-weight:750}
.pane.timetable-fit .grid td.slot .t{font-size:.94em;line-height:1.08;margin-top:.1em;color:var(--text-soft)}
.pane.timetable-fit .grid .small{font-size:.85em;line-height:1.1}
.pane.timetable-fit .grid td.slot .dayline{display:flex;justify-content:center;align-items:baseline;flex-wrap:wrap;gap:0 .3em;padding:.06em 0;line-height:1.05}
.pane.timetable-fit .grid td.slot .dayline .t{flex-basis:100%}
.pane.timetable-fit .grid td.slot .daytag{display:block;font-size:.92em;line-height:1.05;letter-spacing:0}
.pane.timetable-fit .grid td.slot .daytag::after{content:':' }
.shared-teacher-label{display:none}
.pane.timetable-fit .grid td.slot .split-stack{display:block}
.pane.timetable-fit .grid td.slot .shared-teacher .t{display:none}
.pane.timetable-fit .grid td.slot .shared-teacher-label{display:block;font-size:.94em;line-height:1.08;margin-top:.08em;color:var(--text-soft)}
.pane.timetable-fit .grid td.slot.locked::after{width:4px;height:4px;top:2px;right:2px}
@media(max-width:860px){
  .rail{top:auto;height:auto}.screen-tools{padding:5px 10px;gap:8px}.screen-brand{display:none}.screen-tools #fitStatus{max-width:38vw;font-size:10px;line-height:1.2}
  .pane.timetable-fit{padding:10px 8px}.timetable-fit .bar{flex-wrap:wrap}.timetable-fit .bar>.small{flex-basis:100%}
}
