
:root{--bg:#f3f5f9;--paper:#fff;--ink:#17243d;--muted:#5f6c82;--line:#e0e6f0;--blue:#2258d5;--softblue:#eff4ff;--green:#19745b;--softgreen:#edf8f2;--red:#b33448;--softred:#fff0f1;--amber:#8d5915;--softamber:#fff7e7;--radius:14px;--side:216px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:1rem/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}button,input,select{font:inherit}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.4}button,a{touch-action:manipulation}button{color:inherit}a{color:var(--blue)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #759bf0;outline-offset:3px}button,input,select{border-radius:8px}button{border:1px solid var(--line);background:var(--paper);padding:8px 13px}button:hover{background:#f4f7fc}h1,h2,h3,p{margin:0}h1{font-size:1.75rem;letter-spacing:.02em;line-height:1.3}h2{font-size:1.188rem}h3{font-size:1rem}small,.small{font-size:0.8125rem;color:var(--muted)}.muted{color:var(--muted)}.mono{font-variant-numeric:tabular-nums}.hidden,[hidden]{display:none!important}.layout{display:grid;grid-template-columns:var(--side) minmax(0,1fr);min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid var(--line);padding:26px 17px 18px;display:flex;flex-direction:column;gap:22px;overflow:auto}.brand{display:flex;gap:10px;align-items:center;font-weight:750;font-size:1.188rem}.brand-mark{display:grid;grid-template-columns:repeat(2,6px);gap:4px;padding:13px;background:var(--blue);border-radius:11px}.brand-mark i{height:6px;background:#fff;border-radius:1px}.school{margin-top:12px;line-height:1.8;font-size:0.75rem;color:var(--muted)}.side-label{font-size:0.75rem;color:var(--muted);letter-spacing:.12em;margin-bottom:9px}.nav-list{display:grid;gap:5px}.nav-btn{display:flex;align-items:center;gap:11px;width:100%;border:0;text-align:left;padding:11px 12px;font-size:0.875rem;border-radius:9px;color:#56627a}.nav-btn svg{width:19px;height:19px;flex:none}.nav-btn.active{background:var(--softblue);color:var(--blue);font-weight:650}.side-groups{display:grid;gap:4px}.group-btn{text-align:left;background:transparent;border:0;font-size:0.875rem;padding:8px 12px;display:flex;align-items:center;justify-content:space-between}.group-btn.active{background:#f1f4f9;color:var(--ink);font-weight:650}.group-btn small{font-size:0.75rem}.side-bottom{margin-top:auto;border-top:1px solid var(--line);padding-top:16px;font-size:0.75rem;color:var(--muted);line-height:1.8}.offline{display:inline-block;padding:2px 7px;border-radius:5px;background:var(--softgreen);color:var(--green);margin-bottom:6px}.main{min-width:0;padding:27px 30px 32px;max-width:1850px;width:100%;margin:0 auto;align-self:start}.topline{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}.eyebrow{font-size:0.75rem;color:var(--muted);letter-spacing:.08em;margin-bottom:6px}.top-actions{display:flex;gap:8px}.top-actions button{font-size:0.875rem;padding:8px 12px}.clock{text-align:right;font-size:0.8125rem;color:var(--muted);margin-right:7px;min-width:120px}.clock strong{font-size:1.125rem;color:var(--ink);font-weight:650}.toolbar{display:flex;align-items:end;flex-wrap:wrap;gap:14px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:15px 18px}.field{display:flex;flex-direction:column;gap:5px}.field>span{font-size:0.75rem;color:var(--muted)}.field select,.field input{height:40px;border:1px solid #d3dbe9;background:white;padding:6px 11px;color:var(--ink);min-width:0}.week-control{display:flex;align-items:center;gap:5px}.week-control button{height:40px;padding:5px 11px}.week-control select{min-width:205px;max-width:100%}.room-field{flex:1;min-width:155px;max-width:230px}.search-field{margin-left:auto;flex:1;min-width:165px;max-width:270px}.toolbar .today{font-size:0.875rem;height:40px;white-space:nowrap}.weekstrip{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;margin:17px 0}.day-btn{padding:8px 5px;border-color:transparent;background:transparent;display:flex;justify-content:center;align-items:baseline;gap:9px;font-size:0.875rem}.day-btn strong{font-size:1.062rem}.day-btn.active{background:var(--ink);color:#fff}.day-btn.today:not(.active){border:1px solid #a9bde8;color:var(--blue);background:var(--softblue)}.day-btn em{font-size:0.75rem;font-style:normal}.day-btn.weekend:not(.active){color:#747c8d}.banner{border-left:3px solid #dca64a;padding:10px 13px;background:var(--softamber);font-size:0.875rem;color:#80551c;border-radius:0 8px 8px 0;margin-bottom:14px}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin-bottom:18px}.stat{background:white;border:1px solid var(--line);border-radius:12px;padding:15px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px}.stat-label{font-size:0.8125rem;color:var(--muted);line-height:1.65}.stat strong{font-size:1.812rem;font-weight:700;letter-spacing:-.04em;font-variant-numeric:tabular-nums}.stat .accent{color:var(--blue)}.panel{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.panel-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:19px 20px 16px;border-bottom:1px solid var(--line)}.panel-head p{font-size:0.8125rem;color:var(--muted);margin-top:3px}.panel-actions{display:flex;gap:8px;align-items:center;font-size:0.8125rem}.panel-actions button{font-size:0.8125rem}.legend{display:flex;flex-wrap:wrap;gap:14px;align-items:center;font-size:0.75rem;color:var(--muted);padding:13px 20px;border-bottom:1px solid var(--line)}.legend span{display:inline-flex;align-items:center;gap:6px}.swatch{width:10px;height:10px;border-radius:3px;background:var(--softblue);border:1px solid #adc4f6}.swatch.makeup{background:#ffd4d9;border-color:#e7acb4}.swatch.reservation{background:#f5dfb3;border-color:#dabc86}.swatch.free{background:var(--softgreen);border-color:#b3d6c3}.swatch.unknown{background:#eef0f4;border-color:#d2d7df}.table-scroll{width:100%;overflow:auto;overscroll-behavior-x:contain}table{border-collapse:separate;border-spacing:0;width:100%;table-layout:fixed;text-align:left;font-size:0.875rem}table.schedule{min-width:1030px}.schedule th,.schedule td{border-right:1px solid var(--line);border-bottom:1px solid var(--line);vertical-align:top}.schedule th:last-child,.schedule td:last-child{border-right:0}.schedule tr:last-child td,.schedule tr:last-child th{border-bottom:0}.schedule thead th{background:#f9fafc;padding:13px 9px;font-weight:600;color:#3a4963;text-align:center;vertical-align:middle}.schedule thead th:first-child{width:113px;text-align:left;padding-left:16px}.schedule thead th small{display:block;font-size:0.75rem;font-weight:400;white-space:nowrap}.schedule tbody th{width:113px;background:white;position:sticky;left:0;z-index:1;padding:16px 10px 13px 15px;vertical-align:middle}.schedule tbody td{padding:6px;background:#fff}.schedule thead th.focus-day{background:#edf3ff;color:var(--blue)}.roomlink{border:0;background:transparent;font-size:0.875rem;font-weight:650;padding:0;text-align:left;color:var(--ink);line-height:1.5}.roomlink:hover{color:var(--blue);background:transparent}.roomlink small{display:block;font-weight:400;font-size:0.75rem;line-height:1.8}.event{width:100%;display:block;text-align:left;border:0;border-left:3px solid #90b0f4;border-radius:6px;padding:9px 9px 8px;background:var(--softblue);color:#204781;margin-bottom:5px;line-height:1.5;overflow-wrap:anywhere;transition:box-shadow .15s}.event:last-child{margin-bottom:0}.event:hover{background:#e3edff;box-shadow:0 0 0 1px #9fbced}.event.makeup{background:var(--softred);color:#922d41;border-left-color:#df8a99}.event.exam,.event.reservation{background:var(--softamber);color:#885916;border-left-color:#d6ac60}.event.dimmed{opacity:.42}.event.highlight{box-shadow:0 0 0 2px var(--blue)}.event .event-title{font-size:0.875rem;font-weight:600;display:block}.event .event-time{display:block;font-size:0.75rem;font-weight:500;white-space:nowrap;margin-top:4px;font-variant-numeric:tabular-nums}.event .event-meta{display:block;font-size:0.75rem;margin-top:2px;opacity:.85;line-height:1.45}.tag{display:inline-block;padding:1px 6px;border-radius:5px;background:#eef2f8;font-size:0.75rem;font-weight:500;white-space:nowrap}.tag.red{background:#fce1e6;color:#9d2f45}.tag.amber{background:#f9ecd1;color:#8a5915}.tag.blue{background:#e9f0ff;color:var(--blue)}.tag.green{background:#e9f6ee;color:var(--green)}.empty-cell{display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:73px;height:100%;gap:2px;font-size:0.8125rem;color:#51816d;border-radius:6px;background:#f6fbf8}.empty-cell.unknown{color:#8991a1;background:#f8f9fb}.slot-label{font-weight:650;font-size:0.875rem}.slot-label small{display:block;font-size:0.75rem;font-weight:400;white-space:nowrap;margin-top:4px}.footnote{padding:13px 19px;background:#fcfdff;border-top:1px solid var(--line);font-size:0.75rem;color:var(--muted);line-height:1.8}.empty-state{padding:45px 20px;text-align:center;color:var(--muted)}.empty-state strong{display:block;color:var(--ink);font-size:1.062rem;margin-bottom:7px}.week-summary{width:100%;border:0;background:#fff;min-height:86px;padding:10px 5px;text-align:left;border-radius:6px}.week-summary:hover{background:#f3f6fc}.week-summary strong{font-size:0.875rem;font-weight:600;display:block;margin-bottom:8px}.week-summary.matched{background:#edf3ff;box-shadow:inset 0 0 0 2px #94b0e7}.week-summary small{font-size:0.75rem;display:block;margin-top:5px}.mini-blocks{display:grid;grid-template-columns:repeat(6,1fr);gap:3px;max-width:135px}.mini-block{height:6px;background:#dceddf;border-radius:2px}.mini-block.busy{background:#79a0ed}.mini-block.makeup{background:#da8c9b}.mini-block.reservation{background:#d3ad67}.mini-block.unknown{background:#e1e5eb}.focus-cell{box-shadow:inset 0 2px 0 #b4c9f5}.section-space{margin-top:17px}.list-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:18px}.exam-card{border:1px solid #e7dce1;border-radius:11px;padding:17px;background:#fff}.exam-card .exam-top{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:9px}.exam-card h3{font-size:1.062rem;margin-bottom:9px}.exam-card p{font-size:0.875rem;margin:5px 0;color:var(--muted)}.exam-card .exam-time{font-size:1.125rem;color:var(--ink);font-weight:650;font-variant-numeric:tabular-nums}.exam-card button{font-size:0.8125rem;margin-top:11px}.exam-card.past{border-color:var(--line)}.switch-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.seg-btn{font-size:0.8125rem;padding:6px 11px}.seg-btn.active{background:var(--blue);color:#fff;border-color:var(--blue)}.free-form{padding:20px;border-bottom:1px solid var(--line);display:flex;align-items:end;gap:13px;flex-wrap:wrap}.free-form .field{flex:1;min-width:130px;max-width:210px}.primary{background:var(--blue);border-color:var(--blue);color:#fff;font-size:0.875rem}.primary:hover{background:#194abe;color:white}.quick-times{padding:12px 20px;display:flex;gap:7px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--line);font-size:0.75rem;color:var(--muted)}.quick-times button{padding:4px 9px;font-size:0.75rem}.availability{display:grid;grid-template-columns:repeat(auto-fit,minmax(265px,1fr));gap:13px;padding:18px}.room-card{border:1px solid var(--line);border-radius:10px;padding:16px}.room-card.available{border-color:#bdd9cc;background:#fbfefc}.room-card-head{display:flex;align-items:start;justify-content:space-between;gap:8px;margin-bottom:12px}.room-card h3{font-size:1.062rem}.room-card p{font-size:0.8125rem;color:var(--muted);margin-top:5px}.room-card .free-text{font-size:0.875rem;color:var(--green)}.room-card button{font-size:0.8125rem;margin-top:11px}.ranges{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.range{font-size:0.75rem;padding:2px 6px;background:#eff7f2;color:#37765c;border-radius:4px;font-variant-numeric:tabular-nums}.conflict-alert{border-left:3px solid #d9848f;padding:10px 14px;margin:16px 20px 0;background:var(--softred);font-size:0.875rem;color:#983249}.search-summary{font-size:0.8125rem;color:var(--blue);padding:0 2px 13px}.reference-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px;padding:18px}.reference-box{border:1px solid var(--line);border-radius:10px;overflow:hidden}.reference-box h3{padding:13px 16px;background:#f8fafd;border-bottom:1px solid var(--line)}.reference-box .content{padding:15px 16px;font-size:0.875rem}.reference-box p+p{margin-top:10px}.reference-box ol,.reference-box ul{padding-left:20px;margin:4px 0}.reference-box li{margin:8px 0}.time-table{table-layout:auto;font-size:0.875rem}.time-table th,.time-table td{padding:9px 14px;border-bottom:1px solid var(--line);font-weight:400}.time-table th{font-weight:600;background:#fbfcff;white-space:nowrap}.source-buttons{display:flex;gap:8px;flex-wrap:wrap;padding:17px 20px}.source-buttons button{font-size:0.875rem}.calendar-table{table-layout:auto;font-size:0.875rem}.calendar-table td,.calendar-table th{padding:8px 12px;border-bottom:1px solid var(--line)}.calendar-table th{background:#f8fafd;font-weight:600}.calendar-table .current{background:var(--softblue)}.calendar-table button{font-size:0.8125rem;padding:3px 8px}.source-image{display:block;max-width:100%;height:auto;margin:10px auto}.source-text{white-space:pre-wrap;word-break:break-word;background:#f4f6fa;padding:14px;border-radius:8px;font-family:inherit;font-size:0.8125rem;line-height:1.9;color:#485870}.help-list{font-size:0.875rem;padding-left:20px;line-height:1.85}.help-list li{margin-bottom:9px}.page-footer{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:0.75rem;margin-top:17px}.page-footer button{border:0;background:transparent;color:var(--muted);font-size:0.75rem;padding:0;text-decoration:underline}dialog{border:1px solid var(--line);border-radius:16px;padding:0;width:min(710px,calc(100% - 24px));max-height:90vh;box-shadow:0 20px 80px #15294533;color:var(--ink)}dialog::backdrop{background:#17243d70;backdrop-filter:blur(2px)}dialog.wide{width:min(1180px,calc(100% - 24px))}.dialog-head{position:sticky;top:0;background:#fff;z-index:3;display:flex;gap:15px;justify-content:space-between;align-items:center;padding:19px 22px;border-bottom:1px solid var(--line)}.dialog-head h2{font-size:1.188rem}.dialog-head button{padding:3px 10px;font-size:1.438rem}.dialog-body{padding:22px;font-size:0.875rem;line-height:1.8}.dialog-body .event{margin:8px 0}.detail-grid{display:grid;grid-template-columns:90px 1fr;gap:12px 17px;margin:17px 0}.detail-grid dt{color:var(--muted)}.detail-grid dd{margin:0;overflow-wrap:anywhere}.dialog-body details{margin-top:15px}.dialog-body summary{cursor:pointer;color:var(--blue)}.dialog-body ul{padding-left:20px}.dialog-body iframe{width:100%;height:67vh;border:1px solid var(--line)}.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 17px;border-radius:9px;font-size:0.875rem;z-index:10;max-width:calc(100vw - 30px)}.mobile-scope{display:none}noscript{display:block;padding:20px;background:#fff4df;color:#80521b}
@media(min-width:1500px){table.schedule{min-width:1110px}.event{padding:11px}.event .event-title{font-size:0.9375rem}.schedule tbody td{padding:8px}.main{padding:32px 38px}}
@media(max-width:1120px){:root{--side:180px}.sidebar{padding-left:12px;padding-right:12px}.main{padding:23px 20px}.stat{padding:13px}.stat strong{font-size:1.562rem}.clock{display:none}.topline{gap:10px}.toolbar{gap:11px}.search-field{max-width:none}.weekstrip{gap:3px}.day-btn{gap:6px}.reference-grid{grid-template-columns:1fr}}
@media(max-width:900px){.layout{display:block}.sidebar{position:static;height:auto;padding:15px 16px 0;overflow:visible;border-right:0;border-bottom:1px solid var(--line);gap:12px}.brand{font-size:1.125rem}.brand-mark{padding:10px}.school,.side-scope,.side-bottom{display:none}.nav-list{display:flex;gap:3px;overflow:auto;white-space:nowrap;padding-bottom:0}.nav-btn{display:block;width:auto;flex:none;padding:10px 9px;font-size:0.875rem;border-radius:8px 8px 0 0}.nav-btn svg{display:none}.main{padding:20px 14px}.topline{margin-bottom:17px;align-items:start}h1{font-size:1.438rem}.eyebrow{font-size:0.6875rem;letter-spacing:0}.top-actions{gap:5px}.top-actions button{font-size:0.75rem;padding:7px 9px}.toolbar{padding:13px;gap:10px}.field{min-width:0}.week-field{width:100%;flex:1 0 100%}.week-control select{flex:1;min-width:0;width:100%}.room-field{flex:1;max-width:none;min-width:0}.search-field{flex:1 0 100%;margin:0;min-width:0;max-width:none}.toolbar>.today{height:40px}.mobile-scope{display:flex;flex:1 0 100%;max-width:none}.day-btn{padding:8px 1px;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:0.75rem}.day-btn strong{font-size:1rem}.day-btn em{font-size:0.6875rem}.weekstrip{margin:13px 0;gap:2px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:13px}.stat{padding:10px 13px}.stat-label{font-size:0.75rem}.stat strong{font-size:1.562rem}.panel-head{padding:16px 14px}.panel-head h2{font-size:1.062rem}.legend{padding:11px 14px;gap:10px}.panel-head p{font-size:0.75rem}.list-grid{grid-template-columns:1fr;padding:13px}.reference-grid{padding:13px;gap:13px}.free-form{padding:15px}.free-form .field{min-width:110px;max-width:none}.availability{padding:13px;grid-template-columns:1fr}.dialog-body{padding:16px}.dialog-head{padding:15px 16px}.detail-grid{grid-template-columns:75px 1fr;gap:10px}.footnote{padding:11px 14px}.banner{font-size:0.8125rem}.page-footer{font-size:0.6875rem}.source-buttons{padding:14px}.quick-times{padding:10px 14px}.table-scroll{background:linear-gradient(90deg,#fff 30%,#fff0),linear-gradient(90deg,#fff0,#fff 70%) 100% 0,radial-gradient(farthest-side at 0 50%,#243b6222,#0000),radial-gradient(farthest-side at 100% 50%,#243b6222,#0000) 100% 0;background-repeat:no-repeat;background-size:25px 100%,25px 100%,9px 100%,9px 100%;background-attachment:local,local,scroll,scroll}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media print{@page{size:A4 landscape;margin:10mm}body{background:white;font-size:0.6875rem}.layout{display:block}.sidebar,.top-actions,.toolbar,.weekstrip,.banner,.stats,.panel-actions,.legend,.page-footer,.free-form,.quick-times,.source-buttons,.search-summary{display:none!important}.main{padding:0;max-width:none}.topline{margin-bottom:10px}h1{font-size:1.25rem}.eyebrow{font-size:0.6875rem}.table-scroll{overflow:visible}.panel{border-radius:0}.panel-head{padding:10px}.schedule{min-width:0!important;font-size:0.6875rem}.schedule th,.schedule td{padding:3px!important}.schedule thead th:first-child{width:75px}.schedule tbody th{position:static;width:75px}.event{padding:4px;border-left-width:2px;break-inside:avoid}.event .event-title{font-size:0.6875rem}.event .event-time,.event .event-meta,.slot-label small{font-size:0.5625rem}.roomlink,.slot-label{font-size:0.6875rem}.empty-cell{min-height:30px;font-size:0.625rem}.list-grid{grid-template-columns:repeat(2,1fr)}.event,.tag,.empty-cell{-webkit-print-color-adjust:exact;print-color-adjust:exact}.footnote{font-size:0.5625rem}.week-summary{min-height:50px}.week-summary strong{font-size:0.6875rem}.week-summary small{font-size:0.5625rem}dialog{display:none!important}}

/* Mobile layouts use the same events and interval calculations as desktop. */
.filter-fields{display:contents}.mobile-filter-toggle,.mobile-schedule{display:none}
@media(max-width:900px){
 .schedule-desktop{display:none}.mobile-schedule{display:grid;gap:12px;padding:14px}
 .mobile-room{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:white;min-width:0}
 .mobile-room-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;background:#fafbfd}
 .mobile-room-header .roomlink{min-height:44px;font-size:1rem;display:flex;flex-direction:column;justify-content:center}
 .mobile-room-header .roomlink small{font-size:0.75rem}.mobile-room-header .tag{flex:none}
 .mobile-agenda{padding:12px}.mobile-agenda .event{padding:12px;margin-bottom:8px;border-left-width:4px}
 .mobile-agenda .event-title{font-size:1rem}.mobile-agenda .event-time{font-size:0.875rem;margin-top:6px}
 .mobile-agenda .event-meta{font-size:0.8125rem;line-height:1.7}.mobile-agenda .event .small{font-size:0.8125rem}
 .mobile-empty{padding:12px 14px;color:var(--green);font-size:0.875rem;background:#f7fbf8}
 .mobile-empty.unknown{color:var(--muted);background:#f8f9fb}
 .mobile-gaps{border-top:1px solid var(--line);font-size:0.8125rem;color:var(--muted);padding:0 14px}
 .mobile-gaps summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;list-style:none}
 .mobile-gaps summary:before{content:'+';font-size:1.125rem;color:var(--green)}.mobile-gaps[open] summary:before{content:'−'}
 .mobile-gaps .ranges{margin:0 0 13px}.mobile-gaps .range{font-size:0.875rem;padding:3px 7px}
 .mobile-week-days{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:12px}
 .mobile-day-button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:83px;padding:8px 3px;background:#f7fbf8;border-color:#dbe9e1;color:var(--green);font-size:0.8125rem}
 .mobile-day-button strong{font-size:0.875rem}.mobile-day-button small{color:inherit;font-size:0.75rem;opacity:.9}
 .mobile-day-button.busy{background:var(--softblue);border-color:#d6e2fa;color:#315a98}
 .mobile-day-button.makeup{background:var(--softred);border-color:#f0cbd3;color:var(--red)}
 .mobile-day-button.unknown{background:#f5f6f8;color:var(--muted);border-color:var(--line)}
 .mobile-day-button.selected{outline:2px solid var(--blue);outline-offset:0}
 .mobile-day-button.matched{box-shadow:inset 0 0 0 2px #83a3e5}
 .mobile-day-details{border:1px solid var(--line);border-radius:11px;overflow:hidden}
 .mobile-day-details>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none;padding:14px;min-height:66px;background:#f9fafc}
 .mobile-day-details>summary::-webkit-details-marker,.mobile-gaps>summary::-webkit-details-marker{display:none}
 .mobile-day-details>summary strong{font-size:1rem}.mobile-day-details>summary small{display:block;font-size:0.8125rem}
 .mobile-day-summary{display:flex;align-items:center;gap:9px;font-size:0.875rem;color:var(--muted)}
 .mobile-day-summary:after{content:'⌄';font-size:1.312rem}.mobile-day-details[open] .mobile-day-summary:after{content:'⌃'}
 .mobile-day-details.selected{border-color:#adc3ed}.mobile-day-details.selected>summary{background:var(--softblue)}
 .mobile-card-note{font-size:0.75rem;color:var(--muted);padding:0 14px 12px}
}
@media(max-width:900px){
 body{padding-bottom:env(safe-area-inset-bottom);-webkit-text-size-adjust:100%}
 .sidebar{padding:calc(12px + env(safe-area-inset-top)) 16px 12px;display:block}.brand{font-size:1.062rem}.brand-mark{padding:8px}
 .nav-list{position:fixed;left:0;right:0;bottom:0;z-index:6;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;overflow:visible;padding:5px 6px calc(5px + env(safe-area-inset-bottom));border-top:1px solid #dbe3ef;background:#fffffff5;backdrop-filter:blur(12px);box-shadow:0 -3px 16px #1b2e4909}
 .nav-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-height:54px;font-size:0.75rem;padding:6px 1px;border-radius:9px;white-space:normal;line-height:1.3;text-align:center}
 .nav-btn svg{display:block;width:20px;height:20px}.main{padding:17px 12px calc(92px + env(safe-area-inset-bottom))}
 .topline{gap:8px;align-items:center;margin-bottom:14px}h1{font-size:1.438rem}.eyebrow{font-size:0.75rem;letter-spacing:0}
 .top-actions button{font-size:0.8125rem;min-height:44px;padding:8px;white-space:nowrap}.top-actions{flex:none}
 .toolbar{padding:12px;display:block}.week-field{width:100%}.week-field>span:first-child{font-size:0.8125rem;margin-bottom:2px}
 .week-control{width:100%;gap:7px}.week-control button{height:44px;min-width:40px;font-size:1.438rem;padding:0 8px}
 .week-control select{height:44px;min-width:0;font-size:1rem;padding:6px 8px;width:0;flex:1}
 .mobile-filter-toggle{display:flex;align-items:center;gap:8px;justify-content:space-between;width:100%;min-height:44px;font-size:0.875rem;padding:8px 2px 0;border:0;background:transparent;color:var(--muted);text-align:left}
 #filterSummary{font-size:0.75rem;flex:1;text-align:right;color:var(--blue);overflow-wrap:anywhere}
 .filter-fields{display:none}.toolbar.filters-open .filter-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:13px;padding-top:12px;border-top:1px solid var(--line)}
 .filter-fields .field{width:100%;max-width:none;min-width:0;margin:0}.filter-fields .mobile-scope{display:flex;grid-column:1}
 .filter-fields input,.filter-fields select{font-size:1rem;height:44px;width:100%;min-width:0}
 .filter-fields .field>span{font-size:0.8125rem}.filter-fields .search-field{grid-column:1 / -1;grid-row:2}
 .filter-fields>.today{grid-column:1 / -1;min-height:44px;font-size:0.875rem;color:var(--blue);background:var(--softblue);border-color:#d4e1f8}
 .day-btn{min-height:56px;justify-content:center}.day-btn span{font-size:0.75rem;white-space:normal;line-height:1.25;max-width:100%}.day-btn strong{font-size:1rem}
 .stats{gap:8px}.stat{padding:11px 12px;min-width:0}.stat strong{font-size:1.562rem;white-space:nowrap}.stat-label small{font-size:0.75rem}
 .panel-head{padding:14px 13px;gap:12px}.panel-head p{font-size:0.8125rem}.panel-actions{flex-wrap:wrap}
 .panel-actions button,.source-buttons button,.room-card button,.exam-card button,.switch-row button{min-height:44px;font-size:0.875rem}
 .legend{font-size:0.75rem;gap:9px;padding:11px 13px}.legend>span:last-child{display:none}
 .mobile-schedule{padding:11px;gap:11px}.footnote{font-size:0.75rem;overflow-wrap:anywhere}
 .free-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px}
 .free-form .field{min-width:0;max-width:none;width:100%}.free-form .field:first-child{grid-column:1 / -1}
 .free-form .field>span{font-size:0.8125rem}.free-form input{height:44px;font-size:1rem;width:100%;min-width:0;max-width:100%;padding:6px 8px}
 .free-form button{min-height:44px}.quick-times{gap:7px}.quick-times button{min-height:44px;font-size:0.8125rem;padding:8px 10px}
 .availability{grid-template-columns:minmax(0,1fr)}.room-card,.exam-card{min-width:0;padding:14px}
 .room-card .event-title{font-size:1rem}.room-card .event-time{font-size:0.875rem}.room-card .event{padding:11px}
 .room-card p,.exam-card p{font-size:0.875rem}.room-card .range{font-size:0.8125rem}.room-card .event-meta{font-size:0.8125rem}
 .source-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:13px}
 .source-buttons button{font-size:0.875rem;padding:8px;overflow-wrap:anywhere}
 .reference-grid{padding:11px}.reference-box .content{padding:13px;font-size:0.9375rem}.time-table th,.time-table td{font-size:0.875rem;padding:9px}
 .time-table td:nth-child(2){white-space:nowrap}.time-table td:last-child{font-size:0.75rem}.detail-grid{font-size:0.9375rem}
 dialog{width:calc(100% - 16px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);margin:auto;border-radius:14px;overscroll-behavior:contain}
 dialog.wide{width:calc(100% - 16px)}.dialog-head{padding:12px 14px}.dialog-head h2{font-size:1.125rem}
 .dialog-head button{min-width:44px;min-height:44px}.dialog-body{font-size:0.9375rem;padding:15px;overflow-wrap:anywhere}
 .dialog-body .switch-row button{flex:1;min-width:120px}.dialog-body .range{font-size:0.875rem;padding:4px 7px}
 .dialog-body summary{min-height:44px;padding:8px 0}.dialog-body iframe{height:58vh;height:58dvh}
 .toast{bottom:calc(83px + env(safe-area-inset-bottom));font-size:0.875rem;width:max-content;max-width:calc(100% - 24px)}
 .page-footer{font-size:0.75rem}.page-footer button{font-size:0.8125rem;min-height:44px}
}
@media(max-width:370px){.topline{flex-wrap:wrap}.top-actions{margin-left:auto}.mobile-week-days{gap:5px;padding:9px}.mobile-day-button{font-size:0.75rem}.stats{grid-template-columns:1fr 1fr}.stat{padding:9px}.stat strong{font-size:1.438rem}.stat-label{font-size:0.75rem}.day-btn span{font-size:0.6875rem}}
@media print{.mobile-schedule,.mobile-filter-toggle,.filter-fields{display:none!important}.schedule-desktop{display:block!important}.main{padding:0}.nav-list{display:none!important}}


.nav-mobile-label{display:none}.room-label-stack{min-width:0}.duty-link{display:block;font-size:0.75rem;color:var(--blue);padding:5px 0;border:0;background:transparent;white-space:nowrap;margin-top:4px}.duty-link:hover{background:transparent;text-decoration:underline}
.duty-notice{padding:15px 20px;border-bottom:1px solid var(--line);font-size:0.875rem;color:#6d572f;background:#fffaf0}.duty-notice p+p{margin-top:6px}
.duty-toolbar{display:flex;align-items:end;flex-wrap:wrap;gap:14px;padding:17px 20px;border-bottom:1px solid var(--line)}.duty-toolbar .field select{min-width:145px}.duty-toolbar>p{flex:1;min-width:190px}
.duty-date-heading{padding:17px 20px 0;font-size:1.062rem;font-weight:650}.duty-shift{padding:18px 20px}.duty-shift>h3{font-size:1.062rem;margin-bottom:13px}.duty-shift>h3 span{margin-left:7px;color:var(--muted);font-weight:400;font-variant-numeric:tabular-nums}
.duty-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:13px}.duty-card{border:1px solid var(--line);border-radius:11px;padding:16px;min-width:0}.duty-card>h3{font-size:1.062rem;margin-bottom:13px}.duty-person{font-size:0.9375rem;line-height:1.9;margin-bottom:10px}.duty-person p{font-size:0.8125rem;line-height:1.7;color:var(--muted);margin-top:4px}.duty-person.pending{border-left:3px solid #d8ae62;padding-left:10px}.duty-marker{font-size:1.062rem;color:#725625}.duty-key{font-size:0.8125rem;color:#78531b;padding:10px 0;border-top:1px solid var(--line);line-height:1.8}.duty-away,.duty-class-note{font-size:0.8125rem;color:var(--muted);margin-top:8px;line-height:1.8}.duty-class-note{color:#546786}.duty-course-list{font-size:0.8125rem;margin-top:12px}.duty-course-list summary{cursor:pointer;color:var(--blue)}.duty-course-list>div{padding:9px 0;border-bottom:1px solid var(--line)}
.duty-brief{margin:15px 0;border:1px solid var(--line);border-radius:9px;padding:0 12px}.duty-brief>summary{cursor:pointer;color:var(--blue);font-size:0.875rem;min-height:44px;padding:10px 0}.duty-brief-shift{margin:13px 0;padding-top:12px;border-top:1px solid var(--line)}.duty-brief-shift>strong,.duty-brief-shift>h3{display:block;margin-bottom:9px}.duty-brief .duty-people{margin-top:8px}.duty-brief>p{margin-bottom:10px}
.duty-week-list{padding:16px 20px}.duty-week-day{margin-bottom:12px;border:1px solid var(--line);border-radius:10px;overflow:hidden}.duty-week-day>summary{padding:15px;background:#f6f8fc;cursor:pointer;font-size:1rem;font-weight:600}.duty-week-day>summary span{font-size:0.8125rem;color:var(--muted);font-weight:400;margin-left:8px}.duty-rule-details{padding:16px 20px;border-top:1px solid var(--line);font-size:0.875rem;color:var(--muted)}.duty-rule-details summary{cursor:pointer;color:var(--blue)}.duty-rule-details li{margin:9px 0}.duty-raw{table-layout:auto;min-width:570px;font-size:0.875rem}.duty-raw td,.duty-raw th{border:1px solid var(--line);padding:12px;text-align:center;vertical-align:middle}.duty-raw th{background:#eff3fa}.duty-source-notes{font-size:0.875rem;margin-top:17px}.duty-source-notes p{margin:8px 0}
@media(max-width:900px){.nav-list{grid-template-columns:repeat(6,minmax(0,1fr))}.nav-desktop-label{display:none}.nav-mobile-label{display:block}.duty-link{min-height:44px;font-size:0.8125rem;margin:0;padding:7px 0}.duty-grid{grid-template-columns:minmax(0,1fr)}.duty-notice{padding:13px;font-size:0.8125rem}.duty-toolbar{padding:13px;gap:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.duty-toolbar>.switch-row{grid-column:1 / -1}.duty-toolbar>.switch-row button{flex:1;min-height:44px;font-size:0.875rem}.duty-toolbar .field{min-width:0}.duty-toolbar .field select{min-width:0;width:100%;height:44px;font-size:1rem}.duty-toolbar>p{grid-column:1 / -1;min-width:0}.duty-shift{padding:15px 13px}.duty-card{padding:14px}.duty-date-heading{padding:14px 13px 0;font-size:1rem}.duty-week-list{padding:13px}.duty-week-day>summary{font-size:0.9375rem;padding:14px}.duty-week-day>summary span{display:block;margin:5px 0 0 16px}.duty-person{font-size:1rem}.duty-key,.duty-away,.duty-class-note{font-size:0.875rem}.duty-brief .duty-key{font-size:0.8125rem}.duty-rule-details{padding:13px}.duty-course-list summary{min-height:44px;padding:8px 0}.duty-brief>summary{font-size:0.875rem}.mobile-room-header .room-label-stack{flex:1}.mobile-room-header .roomlink{min-height:40px}.duty-raw{font-size:0.875rem}}
@media print{.duty-link,.duty-toolbar,.duty-rule-details,.duty-brief{display:none!important}.duty-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.duty-card{break-inside:avoid}.duty-card,.duty-person,.duty-notice{font-size:0.6875rem}.duty-shift{padding:12px}.duty-person p,.duty-key,.duty-away,.duty-class-note{font-size:0.625rem}.duty-notice{background:white;color:#444}}


.time-first thead th:not(:first-child){text-align:left;padding:12px}.time-first thead th:first-child{width:130px;position:sticky;left:0;z-index:3}.time-first tbody th{width:130px;background:#f8fafd}.time-first .slot-label{font-size:0.875rem;white-space:nowrap}.time-first thead .roomlink{font-size:1rem}.time-first .duty-link{font-size:0.75rem;padding:2px 0}.time-first td{min-height:95px}.time-first .empty-cell{min-height:90px}.time-first .roomlink small{font-size:0.8125rem;color:var(--muted)}
#dayDutyBoard{scroll-margin-top:16px}.day-duty-board{border-top:2px solid var(--line)}.day-duty-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;padding:18px}.day-duty-card{border:1px solid var(--line);border-radius:11px;overflow:hidden}.day-duty-card>h3{padding:12px 14px;background:#f2f5fb;font-size:1.062rem;border-bottom:1px solid var(--line)}.day-duty-slot{padding:13px 14px;border-bottom:1px solid var(--line)}.day-duty-slot:last-child{border-bottom:0}.day-duty-time{font-size:0.875rem;font-weight:650;margin-bottom:10px}.day-duty-time span{font-size:0.8125rem;font-weight:400;color:var(--muted);margin-left:5px}.day-duty-slot dl{display:grid;grid-template-columns:34px minmax(0,1fr);gap:9px;margin:0;font-size:0.875rem}.day-duty-slot dt{color:var(--muted)}.day-duty-slot dd{margin:0}.staff-name{display:inline-block;font-weight:650;margin-right:9px}.key-holder{display:inline-block;background:#fff0c9;color:#764b08;border:1px solid #e8c57e;border-radius:5px;padding:2px 7px;font-weight:600}.duty-transfer{background:#edf3ff;color:#2d5899;padding:7px 9px;border-radius:5px;font-size:0.8125rem;margin-top:11px}.duty-pending{background:#fff8e9;color:#835813;padding:7px 9px;border-radius:5px;font-size:0.8125rem;margin-top:11px}.day-duty-caveat{padding:0 18px 17px;color:var(--muted);font-size:0.8125rem;line-height:1.8}.day-duty-slot>p.small{margin-top:9px}
@media(max-width:900px){.day-duty-grid{grid-template-columns:minmax(0,1fr);padding:12px}.day-duty-slot dl{font-size:0.9375rem}.day-duty-card>h3{font-size:1.062rem}.day-duty-board .panel-head button{min-height:44px;font-size:0.875rem}.day-duty-caveat{padding:0 13px 15px}.duty-transfer,.duty-pending{font-size:0.875rem}}
@media print{.time-first{min-width:0!important}.time-first thead th:first-child,.time-first tbody th{width:85px;position:static}.day-duty-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.day-duty-card{break-inside:avoid}.day-duty-slot dl{font-size:0.6875rem}.day-duty-time{font-size:0.75rem}.day-duty-caveat{font-size:0.625rem}.time-first .empty-cell{min-height:35px}}


/* Reflow and zoom: keep overflow inside data tables, never on the page. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.main,.panel,.panel-head>div,.topline>div,.field,.stat-label,.dialog-head h2{min-width:0}
.panel-head,.topline,.panel-actions,.top-actions,.room-card-head,.exam-top{flex-wrap:wrap}
.panel-actions{max-width:100%}
.panel-actions button,.source-buttons button,.tag{white-space:normal;overflow-wrap:anywhere}
.topline h1,.panel-head h2,.duty-card h3,.day-duty-card h3{overflow-wrap:anywhere}
.field select,.field input,.week-control button,.toolbar .today{height:auto;min-height:2.75rem}
.week-control select{min-width:0;flex:1;width:100%}
.week-field{flex:0 1 21rem;min-width:0}
.week-control{min-width:0}
.field input,.field select{font-size:1rem;max-width:100%}
.toolbar{gap:12px}.toolbar .search-field{min-width:min(100%,11rem)}
.stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{flex-wrap:wrap;align-content:center}.stat strong{line-height:1.2}
.availability{grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr))}
.duty-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr))}
.day-duty-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr))}
.day-duty-card,.day-duty-slot dd,.duty-card,.reference-box,.room-card{min-width:0;overflow-wrap:anywhere}
.day-duty-time span,.duty-shift>h3 span{display:inline-block;margin-left:0}
.duty-toolbar .field{flex:1 1 10rem;min-width:0}.duty-toolbar .field select{min-width:0;width:100%}
.table-scroll{max-width:100%}
.schedule-desktop{max-height:70vh;max-height:70dvh;scrollbar-gutter:stable}
.schedule thead th{position:sticky;top:0;z-index:2}
.schedule thead th:first-child{left:0;z-index:4}
.schedule tbody th{z-index:1;box-shadow:1px 0 var(--line)}
.time-first thead th:first-child,.time-first tbody th{width:8rem}
.time-first .slot-label,.event .event-time,.slot-label small{white-space:normal}
.time-first thead th:not(:first-child){padding:10px}
.time-first thead .roomlink{font-size:.9375rem}
.time-first tbody td{padding:6px}.time-first .event{padding:8px}
.table-hint{padding:8px 20px;font-size:.8125rem;color:var(--muted);background:#f9fafc;border-bottom:1px solid var(--line)}
dialog{max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);overflow:auto}
.dialog-head{align-items:flex-start}.dialog-head button{flex:none;min-width:44px;min-height:44px}
.detail-grid{grid-template-columns:minmax(0,5.5rem) minmax(0,1fr)}
@media(min-width:901px) and (max-width:1200px){
 .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .main{padding:20px 16px}.sidebar{padding:20px 12px}
}
@media(max-width:900px){
 .week-field{width:100%;min-width:0}.week-control select{width:0}
 .topline{align-items:flex-start}.top-actions{margin-left:auto;max-width:100%}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .nav-list{gap:2px;padding-inline:6px}
 .nav-btn{font-size:.75rem;min-width:0;overflow-wrap:anywhere}
 .main{padding-bottom:calc(112px + env(safe-area-inset-bottom))}
 .toast{bottom:calc(98px + env(safe-area-inset-bottom))}
 .mobile-room-header,.mobile-day-details>summary{flex-wrap:wrap}
 .mobile-room-header .tag{flex-shrink:1}
 .duty-toolbar .field{min-width:0}.duty-grid,.day-duty-grid{grid-template-columns:minmax(0,1fr)}
 .duty-toolbar select,.filter-fields select,.filter-fields input,.free-form input{height:auto;min-height:2.75rem}
 .table-hint{display:none}.source-buttons{grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr))}
 .calendar-table td,.calendar-table th{padding:8px 6px;font-size:.8125rem;overflow-wrap:anywhere}
 .calendar-table button{min-height:44px}
 .time-table{table-layout:fixed}.time-table th{white-space:normal}
 .time-table td:nth-child(2){white-space:normal}
}
@media(max-width:400px){
 .topline{display:block}.top-actions{margin-top:10px;justify-content:flex-end}
 .mobile-week-days{grid-template-columns:repeat(3,minmax(0,1fr))}
 .panel-actions{width:100%}.panel-actions button{flex:1 1 6rem}
 .duty-toolbar{grid-template-columns:minmax(0,1fr)}
 .toolbar.filters-open .filter-fields{grid-template-columns:minmax(0,1fr)}
 .filter-fields .search-field{grid-row:auto}
 .dialog-body .switch-row button{min-width:0;flex:1 1 100%}
 .detail-grid{grid-template-columns:minmax(0,1fr);gap:3px}.detail-grid dd{margin-bottom:10px}
}
@media print{
 .schedule-desktop{max-height:none;overflow:visible;scrollbar-gutter:auto}
 .schedule thead th,.schedule tbody th{position:static;box-shadow:none}
 .table-hint{display:none}.stats{display:none}.main{padding:0}
 .time-first thead th:first-child,.time-first tbody th{width:70px}
 .time-first .event{padding:3px}.time-first thead .roomlink{font-size:10px}
}

/* The timetable is a two-axis working surface on phones and computers. */

 .mobile-schedule{display:grid;gap:12px;padding:14px}
 .mobile-room{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:white;min-width:0}
 .mobile-room-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;background:#fafbfd}
 .mobile-room-header .roomlink{min-height:44px;font-size:1rem;display:flex;flex-direction:column;justify-content:center}
 .mobile-room-header .roomlink small{font-size:0.75rem}.mobile-room-header .tag{flex:none}
 .mobile-agenda{padding:12px}.mobile-agenda .event{padding:12px;margin-bottom:8px;border-left-width:4px}
 .mobile-agenda .event-title{font-size:1rem}.mobile-agenda .event-time{font-size:0.875rem;margin-top:6px}
 .mobile-agenda .event-meta{font-size:0.8125rem;line-height:1.7}.mobile-agenda .event .small{font-size:0.8125rem}
 .mobile-empty{padding:12px 14px;color:var(--green);font-size:0.875rem;background:#f7fbf8}
 .mobile-empty.unknown{color:var(--muted);background:#f8f9fb}
 .mobile-gaps{border-top:1px solid var(--line);font-size:0.8125rem;color:var(--muted);padding:0 14px}
 .mobile-gaps summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;list-style:none}
 .mobile-gaps summary:before{content:'+';font-size:1.125rem;color:var(--green)}.mobile-gaps[open] summary:before{content:'−'}
 .mobile-gaps .ranges{margin:0 0 13px}.mobile-gaps .range{font-size:0.875rem;padding:3px 7px}
 .mobile-week-days{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:12px}
 .mobile-day-button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:83px;padding:8px 3px;background:#f7fbf8;border-color:#dbe9e1;color:var(--green);font-size:0.8125rem}
 .mobile-day-button strong{font-size:0.875rem}.mobile-day-button small{color:inherit;font-size:0.75rem;opacity:.9}
 .mobile-day-button.busy{background:var(--softblue);border-color:#d6e2fa;color:#315a98}
 .mobile-day-button.makeup{background:var(--softred);border-color:#f0cbd3;color:var(--red)}
 .mobile-day-button.unknown{background:#f5f6f8;color:var(--muted);border-color:var(--line)}
 .mobile-day-button.selected{outline:2px solid var(--blue);outline-offset:0}
 .mobile-day-button.matched{box-shadow:inset 0 0 0 2px #83a3e5}
 .mobile-day-details{border:1px solid var(--line);border-radius:11px;overflow:hidden}
 .mobile-day-details>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none;padding:14px;min-height:66px;background:#f9fafc}
 .mobile-day-details>summary::-webkit-details-marker,.mobile-gaps>summary::-webkit-details-marker{display:none}
 .mobile-day-details>summary strong{font-size:1rem}.mobile-day-details>summary small{display:block;font-size:0.8125rem}
 .mobile-day-summary{display:flex;align-items:center;gap:9px;font-size:0.875rem;color:var(--muted)}
 .mobile-day-summary:after{content:'⌄';font-size:1.312rem}.mobile-day-details[open] .mobile-day-summary:after{content:'⌃'}
 .mobile-day-details.selected{border-color:#adc3ed}.mobile-day-details.selected>summary{background:var(--softblue)}
 .mobile-card-note{font-size:0.75rem;color:var(--muted);padding:0 14px 12px}

.schedule-panel{--table-scale:1}
.schedule-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.65rem 1rem;padding:.75rem 1rem;border-bottom:1px solid var(--line);background:#fff}
.schedule-layout-switch,.table-scale-controls{display:flex;align-items:center;gap:.35rem;min-width:0}
.schedule-tools button,.schedule-tools select{min-height:2.75rem;font-size:.875rem}
.schedule-layout-switch button{padding:.5rem .8rem}
.schedule-layout-switch button[aria-pressed="true"]{background:var(--ink);color:white;border-color:var(--ink)}
.table-scale-controls label{font-size:.8125rem;color:var(--muted);margin-right:.25rem}
.table-scale-controls select{width:5.2rem;background:white;border:1px solid var(--line);padding:.4rem;font-size:1rem;color:var(--ink)}
.table-scale-controls button{min-width:2.75rem;padding:.35rem;font-size:1.2rem;line-height:1}
.schedule-panel .mobile-schedule{display:none}
.schedule-panel[data-schedule-layout="table"] .schedule-desktop{display:block}
.schedule-panel[data-schedule-layout="cards"] .mobile-schedule{display:grid}
.schedule-panel[data-schedule-layout="cards"] .schedule-desktop,
.schedule-panel[data-schedule-layout="cards"] .table-hint,
.schedule-panel[data-schedule-layout="cards"] .table-scale-controls{display:none}
.schedule-panel .table-hint{display:block;font-size:.8125rem;padding:.5rem 1rem}
.schedule-panel .schedule-desktop{overflow:auto;max-height:72vh;max-height:72dvh;scrollbar-gutter:stable;isolation:isolate;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y pinch-zoom}
/* All table typography and geometry share one font-relative scale. No
   transform or CSS zoom: sticky cells and hit targets use actual layout sizes. */
.schedule-panel table.schedule{font-size:calc(.875rem * var(--table-scale));width:100%;min-width:var(--table-width,80.8em);line-height:1.5}
.schedule-panel table.schedule thead th{font-size:1em;padding:.75em .65em;position:sticky;top:0;z-index:2}
.schedule-panel table.schedule thead th:first-child,
.schedule-panel table.schedule tbody th{width:8em;padding:.8em .65em;left:0}
.schedule-panel table.schedule thead th:first-child{z-index:4}
.schedule-panel table.schedule tbody th{position:sticky;z-index:1}
.schedule-panel .schedule tbody td{padding:.4em}
.schedule-panel .schedule .event{font-size:1em;padding:.65em .6em;margin-bottom:.35em;border-left-width:.22em;border-radius:.45em;line-height:1.5}
.schedule-panel .schedule .event:last-child{margin-bottom:0}
.schedule-panel .schedule .event-title{font-size:1em}
.schedule-panel .schedule .event-time{font-size:.86em;margin-top:.3em;white-space:normal}
.schedule-panel .schedule .event-meta{font-size:.86em;margin-top:.2em}
.schedule-panel .schedule .roomlink{font-size:1.07em;line-height:1.5}
.schedule-panel .schedule .roomlink small{font-size:.85em;line-height:1.7}
.schedule-panel .schedule .duty-link{font-size:.86em;min-height:0;margin-top:.2em;padding:.3em 0}
.schedule-panel .schedule .slot-label{font-size:1em;white-space:normal}
.schedule-panel .schedule .slot-label small,
.schedule-panel .schedule thead th small{font-size:.86em;margin-top:.3em;white-space:normal}
.schedule-panel .schedule .small,.schedule-panel .schedule .tag{font-size:.86em}
.schedule-panel .schedule .tag{padding:.1em .4em;border-radius:.35em}
.schedule-panel .schedule .empty-cell{font-size:.93em;min-height:6em;gap:.15em;border-radius:.4em}
.schedule-panel .schedule .week-summary{font-size:1em;min-height:6em;padding:.7em .4em;border-radius:.4em}
.schedule-panel .schedule .week-summary strong{font-size:1em;margin-bottom:.5em}
.schedule-panel .schedule .week-summary small{font-size:.86em;margin-top:.35em}
.schedule-panel .schedule .mini-blocks{gap:.22em;max-width:9.6em}
.schedule-panel .schedule .mini-block{height:.43em;border-radius:.14em}
@media(min-width:901px){
 .schedule-panel[data-schedule-layout="cards"] .mobile-schedule{grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr));align-items:start}
}
@media(max-width:900px){
 .schedule-tools{padding:.65rem .75rem;gap:.5rem}
 .table-scale-controls{margin-left:auto}
 .schedule-panel .schedule-desktop{max-height:68vh;max-height:68dvh}
 .schedule-panel .table-hint{padding:.5rem .75rem;line-height:1.6}
 .stat-label small,.stat-label br{display:none}.stat{padding:.6rem .75rem}
 .schedule-panel .panel-head{padding:.75rem}.schedule-panel .legend{padding:.6rem .75rem}
}
@media(max-width:380px){
 .schedule-layout-switch{width:100%}.schedule-layout-switch button{flex:1}
 .table-scale-controls{justify-content:flex-end;width:100%}
}
@media print{
 .schedule-tools,.schedule-panel .table-hint,.schedule-panel .mobile-schedule{display:none!important}
 .schedule-panel .schedule-desktop{display:block!important;max-height:none;overflow:visible}
 .schedule-panel table.schedule{font-size:10px;min-width:0!important}
 .schedule-panel table.schedule thead th,.schedule-panel table.schedule tbody th{position:static}
 .schedule-panel table.schedule thead th:first-child,.schedule-panel table.schedule tbody th{width:7em}
 .schedule-panel .schedule .event{padding:.3em}.schedule-panel .schedule .empty-cell{min-height:3em}
}


/* Cloudflare D1 boot error */
.boot-error{max-width:760px;margin:10vh auto;padding:28px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 18px 45px rgba(23,36,61,.08)}.boot-error h1{margin-bottom:12px}.boot-error code{background:#f4f6fa;padding:.15em .4em;border-radius:5px}.boot-error pre{white-space:pre-wrap;background:#f6f8fb;padding:14px;border-radius:10px;overflow:auto}
