
: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-bg);color:var(--ink-text);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-text)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--c-759bf0-border);outline-offset:3px}button,input,select{border-radius:8px}button{border:1px solid var(--line-border);background:var(--paper-bg);padding:8px 13px}button:hover{background:var(--c-f4f7fc-bg)}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-text)}.muted{color:var(--muted-text)}.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:var(--c-ffffff-bg);border-right:1px solid var(--line-border);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-bg);border-radius:11px}.brand-mark i{height:6px;background:var(--c-ffffff-bg);border-radius:1px}.school{margin-top:12px;line-height:1.8;font-size:0.75rem;color:var(--muted-text)}.side-label{font-size:0.75rem;color:var(--muted-text);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:var(--c-56627a-text)}.nav-btn svg{width:19px;height:19px;flex:none}.nav-btn.active{background:var(--softblue-bg);color:var(--blue-text);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:var(--c-f1f4f9-bg);color:var(--ink-text);font-weight:650}.group-btn small{font-size:0.75rem}.side-bottom{margin-top:auto;border-top:1px solid var(--line-border);padding-top:16px;font-size:0.75rem;color:var(--muted-text);line-height:1.8}.offline{display:inline-block;padding:2px 7px;border-radius:5px;background:var(--softgreen-bg);color:var(--green-text);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-text);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-text);margin-right:7px;min-width:120px}.clock strong{font-size:1.125rem;color:var(--ink-text);font-weight:650}.toolbar{display:flex;align-items:end;flex-wrap:wrap;gap:14px;background:var(--paper-bg);border:1px solid var(--line-border);border-radius:var(--radius);padding:15px 18px}.field{display:flex;flex-direction:column;gap:5px}.field>span{font-size:0.75rem;color:var(--muted-text)}.field select,.field input{height:40px;border:1px solid var(--c-d3dbe9-border);background:var(--c-ffffff-bg);padding:6px 11px;color:var(--ink-text);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-bg);color:#ffffff}.day-btn.today:not(.active){border:1px solid var(--c-a9bde8-border);color:var(--blue-text);background:var(--softblue-bg)}.day-btn em{font-size:0.75rem;font-style:normal}.day-btn.weekend:not(.active){color:var(--c-747c8d-text)}.banner{border-left:3px solid var(--c-dca64a-border);padding:10px 13px;background:var(--softamber-bg);font-size:0.875rem;color:var(--c-80551c-text);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:var(--c-ffffff-bg);border:1px solid var(--line-border);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-text);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-text)}.panel{background:var(--paper-bg);border:1px solid var(--line-border);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-border)}.panel-head p{font-size:0.8125rem;color:var(--muted-text);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-text);padding:13px 20px;border-bottom:1px solid var(--line-border)}.legend span{display:inline-flex;align-items:center;gap:6px}.swatch{width:10px;height:10px;border-radius:3px;background:var(--softblue-bg);border:1px solid var(--c-adc4f6-border)}.swatch.makeup{background:var(--c-ffd4d9-bg);border-color:var(--c-e7acb4-border)}.swatch.reservation{background:var(--c-f5dfb3-bg);border-color:var(--c-dabc86-border)}.swatch.free{background:var(--softgreen-bg);border-color:var(--c-b3d6c3-border)}.swatch.unknown{background:var(--c-eef0f4-bg);border-color:var(--c-d2d7df-border)}.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);border-bottom:1px solid var(--line-border);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:var(--c-f9fafc-bg);padding:13px 9px;font-weight:600;color:var(--c-3a4963-text);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:var(--c-ffffff-bg);position:sticky;left:0;z-index:1;padding:16px 10px 13px 15px;vertical-align:middle}.schedule tbody td{padding:6px;background:var(--c-ffffff-bg)}.schedule thead th.focus-day{background:var(--c-edf3ff-bg);color:var(--blue-text)}.roomlink{border:0;background:transparent;font-size:0.875rem;font-weight:650;padding:0;text-align:left;color:var(--ink-text);line-height:1.5}.roomlink:hover{color:var(--blue-text);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 var(--c-90b0f4-border);border-radius:6px;padding:9px 9px 8px;background:var(--softblue-bg);color:var(--c-204781-text);margin-bottom:5px;line-height:1.5;overflow-wrap:anywhere;transition:box-shadow .15s}.event:last-child{margin-bottom:0}.event:hover{background:var(--c-e3edff-bg);box-shadow:0 0 0 1px var(--c-9fbced-border)}.event.makeup{background:var(--softred-bg);color:var(--c-922d41-text);border-left-color:var(--c-df8a99-border)}.event.exam,.event.reservation{background:var(--softamber-bg);color:var(--c-885916-text);border-left-color:var(--c-d6ac60-border)}.event.dimmed{opacity:.42}.event.highlight{box-shadow:0 0 0 2px var(--blue-border)}.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:var(--c-eef2f8-bg);font-size:0.75rem;font-weight:500;white-space:nowrap}.tag.red{background:var(--c-fce1e6-bg);color:var(--c-9d2f45-text)}.tag.amber{background:var(--c-f9ecd1-bg);color:var(--c-8a5915-text)}.tag.blue{background:var(--c-e9f0ff-bg);color:var(--blue-text)}.tag.green{background:var(--c-e9f6ee-bg);color:var(--green-text)}.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:var(--c-51816d-text);border-radius:6px;background:var(--c-f6fbf8-bg)}.empty-cell.unknown{color:var(--c-8991a1-text);background:var(--c-f8f9fb-bg)}.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:var(--c-fcfdff-bg);border-top:1px solid var(--line-border);font-size:0.75rem;color:var(--muted-text);line-height:1.8}.empty-state{padding:45px 20px;text-align:center;color:var(--muted-text)}.empty-state strong{display:block;color:var(--ink-text);font-size:1.062rem;margin-bottom:7px}.week-summary{width:100%;border:0;background:var(--c-ffffff-bg);min-height:86px;padding:10px 5px;text-align:left;border-radius:6px}.week-summary:hover{background:var(--c-f3f6fc-bg)}.week-summary strong{font-size:0.875rem;font-weight:600;display:block;margin-bottom:8px}.week-summary.matched{background:var(--c-edf3ff-bg);box-shadow:inset 0 0 0 2px var(--c-94b0e7-border)}.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:var(--c-dceddf-bg);border-radius:2px}.mini-block.busy{background:var(--c-79a0ed-bg)}.mini-block.makeup{background:var(--c-da8c9b-bg)}.mini-block.reservation{background:var(--c-d3ad67-bg)}.mini-block.unknown{background:var(--c-e1e5eb-bg)}.focus-cell{box-shadow:inset 0 2px 0 var(--c-b4c9f5-border)}.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 var(--c-e7dce1-border);border-radius:11px;padding:17px;background:var(--c-ffffff-bg)}.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-text)}.exam-card .exam-time{font-size:1.125rem;color:var(--ink-text);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-border)}.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-bg);color:#ffffff;border-color:var(--blue-border)}.free-form{padding:20px;border-bottom:1px solid var(--line-border);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-bg);border-color:var(--blue-border);color:#ffffff;font-size:0.875rem}.primary:hover{background:var(--c-194abe-bg);color:#ffffff}.quick-times{padding:12px 20px;display:flex;gap:7px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--line-border);font-size:0.75rem;color:var(--muted-text)}.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);border-radius:10px;padding:16px}.room-card.available{border-color:var(--c-bdd9cc-border);background:var(--c-fbfefc-bg)}.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-text);margin-top:5px}.room-card .free-text{font-size:0.875rem;color:var(--green-text)}.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:var(--c-eff7f2-bg);color:var(--c-37765c-text);border-radius:4px;font-variant-numeric:tabular-nums}.conflict-alert{border-left:3px solid var(--c-d9848f-border);padding:10px 14px;margin:16px 20px 0;background:var(--softred-bg);font-size:0.875rem;color:var(--c-983249-text)}.search-summary{font-size:0.8125rem;color:var(--blue-text);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);border-radius:10px;overflow:hidden}.reference-box h3{padding:13px 16px;background:var(--c-f8fafd-bg);border-bottom:1px solid var(--line-border)}.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-border);font-weight:400}.time-table th{font-weight:600;background:var(--c-fbfcff-bg);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-border)}.calendar-table th{background:var(--c-f8fafd-bg);font-weight:600}.calendar-table .current{background:var(--softblue-bg)}.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:var(--c-f4f6fa-bg);padding:14px;border-radius:8px;font-family:inherit;font-size:0.8125rem;line-height:1.9;color:var(--c-485870-text)}.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-text);font-size:0.75rem;margin-top:17px}.page-footer button{border:0;background:transparent;color:var(--muted-text);font-size:0.75rem;padding:0;text-decoration:underline}dialog{border:1px solid var(--line-border);border-radius:16px;padding:0;width:min(710px,calc(100% - 24px));max-height:90vh;box-shadow:0 20px 80px color-mix(in srgb, var(--c-152945-border) 20%, transparent);color:var(--ink-text)}dialog::backdrop{background:color-mix(in srgb, var(--c-17243d-bg) 43.9%, transparent);backdrop-filter:blur(2px)}dialog.wide{width:min(1180px,calc(100% - 24px))}.dialog-head{position:sticky;top:0;background:var(--c-ffffff-bg);z-index:3;display:flex;gap:15px;justify-content:space-between;align-items:center;padding:19px 22px;border-bottom:1px solid var(--line-border)}.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-text)}.detail-grid dd{margin:0;overflow-wrap:anywhere}.dialog-body details{margin-top:15px}.dialog-body summary{cursor:pointer;color:var(--blue-text)}.dialog-body ul{padding-left:20px}.dialog-body iframe{width:100%;height:67vh;border:1px solid var(--line-border)}.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink-bg);color:#ffffff;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:var(--c-fff4df-bg);color:var(--c-80521b-text)}
@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),(max-height:480px) and (orientation:landscape){.layout{display:block}.sidebar{position:static;height:auto;padding:15px 16px 0;overflow:visible;border-right:0;border-bottom:1px solid var(--line-border);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,var(--c-ffffff-bg) 30%,color-mix(in srgb, var(--c-ffffff-bg) 0%, transparent)),linear-gradient(90deg,color-mix(in srgb, var(--c-ffffff-bg) 0%, transparent),var(--c-ffffff-bg) 70%) 100% 0,radial-gradient(farthest-side at 0 50%,color-mix(in srgb, var(--c-243b62-bg) 13.3%, transparent),color-mix(in srgb, var(--c-000000-bg) 0%, transparent)),radial-gradient(farthest-side at 100% 50%,color-mix(in srgb, var(--c-243b62-bg) 13.3%, transparent),color-mix(in srgb, var(--c-000000-bg) 0%, transparent)) 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:var(--c-ffffff-bg);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),(max-height:480px) and (orientation:landscape){
 .schedule-desktop{display:none}.mobile-schedule{display:grid;gap:12px;padding:14px}
 .mobile-room{border:1px solid var(--line-border);border-radius:12px;overflow:hidden;background:var(--c-ffffff-bg);min-width:0}
 .mobile-room-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;background:var(--c-fafbfd-bg)}
 .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-text);font-size:0.875rem;background:var(--c-f7fbf8-bg)}
 .mobile-empty.unknown{color:var(--muted-text);background:var(--c-f8f9fb-bg)}
 .mobile-gaps{border-top:1px solid var(--line-border);font-size:0.8125rem;color:var(--muted-text);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-text)}.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:var(--c-f7fbf8-bg);border-color:var(--c-dbe9e1-border);color:var(--green-text);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-bg);border-color:var(--c-d6e2fa-border);color:var(--c-315a98-text)}
 .mobile-day-button.makeup{background:var(--softred-bg);border-color:var(--c-f0cbd3-border);color:var(--red-text)}
 .mobile-day-button.unknown{background:var(--c-f5f6f8-bg);color:var(--muted-text);border-color:var(--line-border)}
 .mobile-day-button.selected{outline:2px solid var(--blue-border);outline-offset:0}
 .mobile-day-button.matched{box-shadow:inset 0 0 0 2px var(--c-83a3e5-border)}
 .mobile-day-details{border:1px solid var(--line-border);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:var(--c-f9fafc-bg)}
 .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-text)}
 .mobile-day-summary:after{content:'⌄';font-size:1.312rem}.mobile-day-details[open] .mobile-day-summary:after{content:'⌃'}
 .mobile-day-details.selected{border-color:var(--c-adc3ed-border)}.mobile-day-details.selected>summary{background:var(--softblue-bg)}
 .mobile-card-note{font-size:0.75rem;color:var(--muted-text);padding:0 14px 12px}
}
@media(max-width:900px),(max-height:480px) and (orientation:landscape){
 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 var(--c-dbe3ef-border);background:color-mix(in srgb, var(--c-ffffff-bg) 96.1%, transparent);backdrop-filter:blur(12px);box-shadow:0 -3px 16px color-mix(in srgb, var(--c-1b2e49-border) 3.5%, transparent)}
 .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);text-align:left}
 .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-border)}
 .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-text);background:var(--softblue-bg);border-color:var(--c-d4e1f8-border)}
 .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-text);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-border);font-size:0.875rem;color:var(--c-6d572f-text);background:var(--c-fffaf0-bg)}.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-border)}.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-text);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);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-text);margin-top:4px}.duty-person.pending{border-left:3px solid var(--c-d8ae62-border);padding-left:10px}.duty-marker{font-size:1.062rem;color:var(--c-725625-text)}.duty-key{font-size:0.8125rem;color:var(--c-78531b-text);padding:10px 0;border-top:1px solid var(--line-border);line-height:1.8}.duty-away,.duty-class-note{font-size:0.8125rem;color:var(--muted-text);margin-top:8px;line-height:1.8}.duty-class-note{color:var(--c-546786-text)}.duty-course-list{font-size:0.8125rem;margin-top:12px}.duty-course-list summary{cursor:pointer;color:var(--blue-text)}.duty-course-list>div{padding:9px 0;border-bottom:1px solid var(--line-border)}
.duty-brief{margin:15px 0;border:1px solid var(--line-border);border-radius:9px;padding:0 12px}.duty-brief>summary{cursor:pointer;color:var(--blue-text);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-border)}.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);border-radius:10px;overflow:hidden}.duty-week-day>summary{padding:15px;background:var(--c-f6f8fc-bg);cursor:pointer;font-size:1rem;font-weight:600}.duty-week-day>summary span{font-size:0.8125rem;color:var(--muted-text);font-weight:400;margin-left:8px}.duty-rule-details{padding:16px 20px;border-top:1px solid var(--line-border);font-size:0.875rem;color:var(--muted-text)}.duty-rule-details summary{cursor:pointer;color:var(--blue-text)}.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-border);padding:12px;text-align:center;vertical-align:middle}.duty-raw th{background:var(--c-eff3fa-bg)}.duty-source-notes{font-size:0.875rem;margin-top:17px}.duty-source-notes p{margin:8px 0}
@media(max-width:900px),(max-height:480px) and (orientation:landscape){.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:var(--c-ffffff-bg);color:var(--c-444444-text)}}


.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:var(--c-f8fafd-bg)}.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-text)}
#dayDutyBoard{scroll-margin-top:16px}.day-duty-board{border-top:2px solid var(--line-border)}.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);border-radius:11px;overflow:hidden}.day-duty-card>h3{padding:12px 14px;background:var(--c-f2f5fb-bg);font-size:1.062rem;border-bottom:1px solid var(--line-border)}.day-duty-slot{padding:13px 14px;border-bottom:1px solid var(--line-border)}.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-text);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-text)}.day-duty-slot dd{margin:0}.staff-name{display:inline-block;font-weight:650;margin-right:9px}.key-holder{display:inline-block;background:var(--c-fff0c9-bg);color:var(--c-764b08-text);border:1px solid var(--c-e8c57e-border);border-radius:5px;padding:2px 7px;font-weight:600}.duty-transfer{background:var(--c-edf3ff-bg);color:var(--c-2d5899-text);padding:7px 9px;border-radius:5px;font-size:0.8125rem;margin-top:11px}.duty-pending{background:var(--c-fff8e9-bg);color:var(--c-835813-text);padding:7px 9px;border-radius:5px;font-size:0.8125rem;margin-top:11px}.day-duty-caveat{padding:0 18px 17px;color:var(--muted-text);font-size:0.8125rem;line-height:1.8}.day-duty-slot>p.small{margin-top:9px}
@media(max-width:900px),(max-height:480px) and (orientation:landscape){.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-border)}
.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-text);background:var(--c-f9fafc-bg);border-bottom:1px solid var(--line-border)}
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 (min-height:481px) 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),(max-height:480px) and (orientation:landscape){
 .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);border-radius:12px;overflow:hidden;background:var(--c-ffffff-bg);min-width:0}
 .mobile-room-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;background:var(--c-fafbfd-bg)}
 .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-text);font-size:0.875rem;background:var(--c-f7fbf8-bg)}
 .mobile-empty.unknown{color:var(--muted-text);background:var(--c-f8f9fb-bg)}
 .mobile-gaps{border-top:1px solid var(--line-border);font-size:0.8125rem;color:var(--muted-text);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-text)}.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:var(--c-f7fbf8-bg);border-color:var(--c-dbe9e1-border);color:var(--green-text);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-bg);border-color:var(--c-d6e2fa-border);color:var(--c-315a98-text)}
 .mobile-day-button.makeup{background:var(--softred-bg);border-color:var(--c-f0cbd3-border);color:var(--red-text)}
 .mobile-day-button.unknown{background:var(--c-f5f6f8-bg);color:var(--muted-text);border-color:var(--line-border)}
 .mobile-day-button.selected{outline:2px solid var(--blue-border);outline-offset:0}
 .mobile-day-button.matched{box-shadow:inset 0 0 0 2px var(--c-83a3e5-border)}
 .mobile-day-details{border:1px solid var(--line-border);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:var(--c-f9fafc-bg)}
 .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-text)}
 .mobile-day-summary:after{content:'⌄';font-size:1.312rem}.mobile-day-details[open] .mobile-day-summary:after{content:'⌃'}
 .mobile-day-details.selected{border-color:var(--c-adc3ed-border)}.mobile-day-details.selected>summary{background:var(--softblue-bg)}
 .mobile-card-note{font-size:0.75rem;color:var(--muted-text);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-border);background:var(--c-ffffff-bg)}
.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-bg);color:#ffffff;border-color:var(--ink-border)}
.table-scale-controls label{font-size:.8125rem;color:var(--muted-text);margin-right:.25rem}
.table-scale-controls select{width:5.2rem;background:var(--c-ffffff-bg);border:1px solid var(--line-border);padding:.4rem;font-size:1rem;color:var(--ink-text)}
.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) and (min-height:481px){
 .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),(max-height:480px) and (orientation:landscape){
 .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:var(--c-ffffff-bg);border:1px solid var(--line-border);border-radius:18px;box-shadow:0 18px 45px rgba(23,36,61,.08)}.boot-error h1{margin-bottom:12px}.boot-error code{background:var(--c-f4f6fa-bg);padding:.15em .4em;border-radius:5px}.boot-error pre{white-space:pre-wrap;background:var(--c-f6f8fb-bg);padding:14px;border-radius:10px;overflow:auto}
