/* Compact layouts are screen-only. The desktop and print layouts retain their structure. */
#compact-app-menu,#compact-drawer-backdrop,.compact-days,.compact-inbox{display:none}
.compact-fold,.compact-fold-content{display:contents}
.compact-fold>summary{display:none}
@media screen and (max-width:1199px), screen and (any-pointer:coarse) and (max-width:1366px){
 html{height:100%;overflow:hidden}body,body.viewer-mode{height:100dvh;min-width:0;display:flex;flex-direction:column;overflow:hidden}
 body .appbar,body.viewer-mode .appbar{height:auto;min-height:58px;padding:7px 12px;gap:10px;flex-wrap:nowrap;flex-shrink:0}
 body .appbar .brand-logo{width:65px;height:36px;flex-shrink:0}body .appbar .season{display:none}
 body .appbar-actions,body.viewer-mode .appbar-actions{min-width:0;flex:1;gap:6px;flex-wrap:nowrap;margin-left:auto;justify-content:flex-end}
 body .appbar>#account-admin{display:none!important}
 body .appbar-actions #print,body .appbar-actions #full,body .appbar-actions #account-admin,body .appbar-actions #save-status{display:none!important}
 body #cloud-account{margin:0;max-width:180px;overflow:hidden;text-overflow:ellipsis;min-height:44px;font-size:13px;padding:8px 12px}
 body #compact-app-menu{display:block;min-height:44px;padding:8px 12px;font-size:13px}
 body .app-navigation,body.viewer-mode .app-navigation:has([data-screen=personal]:not([hidden])){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));height:auto;min-height:0;padding:5px 10px;gap:4px;flex-shrink:0;overflow:visible}
 body .app-navigation button,body.viewer-mode .app-navigation button,body.viewer-mode .app-navigation [data-screen=personal]{width:100%;min-width:0;min-height:44px;padding:8px 3px;margin:0!important;font-size:12px;white-space:normal;border:1px solid #354048;border-radius:6px;line-height:1.25}
 body .app-navigation button[aria-current=page]{border-color:#e46a77;background:#57272f;color:white}
 #mode-label{display:none}
 body.viewer-mode .viewer,body.viewer-mode .viewer:has(.season-dashboard){flex:1;min-height:0;height:auto;overflow:auto;overscroll-behavior-y:contain;padding:14px 12px max(24px,env(safe-area-inset-bottom));gap:12px}
 .viewer-heading h1{overflow-wrap:anywhere}.viewer-mode .viewer-heading{gap:9px}.viewer-mode .week-room-legend{font-size:12px;padding:9px 10px;gap:7px 12px}
 .viewer-mode .mobile-week-days{margin-bottom:12px;top:-14px}.mobile-day-heading{margin-bottom:8px}.mobile-location{margin-top:12px}
 .mobile-day-view{min-width:0}.mobile-lesson-card,.mobile-event-card{touch-action:pan-y}
 .compact-fold{display:block;min-width:0}.compact-fold>summary{display:list-item;cursor:pointer;list-style-position:inside;min-height:44px;padding:12px;border:1px solid #42545c;border-radius:7px;color:#e7f2f5;background:#1d2d33;font-size:13px;line-height:1.4}
 .compact-fold:not([open])>.compact-fold-content{display:none}.compact-fold[open]>.compact-fold-content{display:flex;gap:8px;flex-wrap:wrap;padding:10px 0}
 .compact-menu-dialog{width:min(400px,calc(100vw - 24px));padding:18px;background:#162329;color:white;border:1px solid #46616c;border-radius:12px}
 .compact-menu-dialog h2{color:white;margin:0;font-size:20px}.compact-menu-dialog>button{display:block;width:100%;margin-top:10px;min-height:48px;text-align:left;color:white;background:#243b43;border:1px solid #536b75;font-size:15px}.compact-save-status{color:#c1d4db;font-size:13px;line-height:1.5}
 /* Touch-friendly sheets: close and save stay reachable, forms avoid iOS focus zoom. */
 body dialog,body.viewer-mode dialog{box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:16px;overflow:auto;overscroll-behavior:contain;scroll-padding:70px 0 90px}
 body dialog .dialog-top{position:sticky;top:-16px;z-index:5;padding:9px 0;background:inherit;min-height:48px;gap:10px}
 body dialog>.dialog-top{background:#162329}body dialog .dialog-top button{min-width:44px;min-height:44px;font-size:22px}
 body #lesson-dialog>.dialog-top{background:white}body #lesson-dialog .dialog-actions{background:white}body #lesson-dialog .dialog-top button{color:#343434}
 body dialog input:not([type=checkbox]):not([type=radio]),body dialog textarea,body dialog select,body #lesson-panel-program .curriculum-field textarea{font-size:16px!important;max-width:100%;min-width:0;box-sizing:border-box}
 body dialog input:not([type=checkbox]):not([type=radio]),body dialog select{min-height:44px}
 body dialog button,body dialog summary{min-height:44px;touch-action:manipulation}
 body dialog .dialog-actions,body dialog .agenda-form>.agenda-actions{position:sticky;bottom:-16px;z-index:4;margin-bottom:-16px;padding:12px 0 max(12px,env(safe-area-inset-bottom));background:#162329;border-top:1px solid #3c555e;display:flex;flex-wrap:wrap;gap:8px}
 body dialog .dialog-actions button,body dialog .agenda-actions button{flex:1 1 120px;font-size:14px;white-space:normal}
 body dialog label,body dialog p{line-height:1.5}body dialog .form-pair{min-width:0}body dialog fieldset{min-width:0}
 body .agenda-dialog p,body .agenda-dialog .agenda-shares p,body .agenda-dialog .agenda-links p{color:#bfd2d9}
 .agenda-dialog .agenda-range-grid button{padding:3px 0;min-width:0;min-height:44px;font-size:14px}
 .agenda-follow-choice{min-height:48px}.agenda-follow-actions{bottom:-16px}.agenda-follow-choice input,.agenda-checkbox input{min-width:22px;height:22px}
 /* Personal agenda opens on the selected day; a week list is available on demand. */
 .personal-view .agenda-heading h1{font-size:23px;margin:0}.personal-view .agenda-heading p{margin:5px 0;font-size:13px}
 .personal-view .agenda-controls{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:12px 0}.agenda-controls>.compact-fold{grid-column:1/-1}
 .personal-view .agenda-controls>.compact-fold>.compact-fold-content>button{flex:1 1 140px}
 .personal-view>.agenda-inbox{display:none}.personal-view .compact-inbox{display:block}
 .personal-view .agenda-dates{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 0}
 .personal-view .agenda-dates input{grid-column:1/-1;width:100%;min-width:0;min-height:44px;font-size:16px}
 .personal-view .agenda-dates button{padding:8px 3px;min-height:44px;font-size:12px}
 .personal-view .agenda-key{margin:4px 0;font-size:12px;gap:8px 14px}
 .personal-view>.compact-fold{margin:8px 0}.personal-view>.compact-fold>summary{min-height:36px;padding:8px 10px;font-size:12px}
 .compact-days{display:block;margin:12px 0 8px;flex-shrink:0;min-width:0}
 .compact-day-buttons{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
 .compact-day-buttons button,.personal-view .compact-day-buttons button{position:relative;min-width:0;min-height:58px;padding:5px 0 9px;display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid #435a64;border-radius:7px;background:#1b2c33;color:#c7d8df}
 .compact-day-buttons span{font-size:11px}.compact-day-buttons strong{font-size:17px}.compact-day-buttons button[aria-pressed=true]{color:white;background:#8c2e3b;border-color:#f48391}
 .compact-has-items{width:4px;height:4px;border-radius:50%;background:currentColor;position:absolute;bottom:4px}
 .compact-week-toggle{margin-top:7px;font-size:12px!important;min-height:44px}
 .personal-view .agenda-days{display:block;margin:10px 0}.agenda-day[data-compact-selected=false]{display:none}.agenda-day{margin-bottom:12px;padding:13px}.agenda-day h2{font-size:17px}
 .personal-view .agenda-card strong{font-size:15px}.personal-view .agenda-card time,.personal-view .agenda-card small{font-size:13px}.personal-view .agenda-card{padding:12px;gap:7px}
 .buldo-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px}.buldo-controls label{min-width:0;font-size:14px}.buldo-controls select{display:block;width:100%;min-width:0;min-height:44px;font-size:16px;margin:6px 0 0}.buldo-check{min-height:44px}.buldo-controls .buldo-check input{width:22px;height:22px;min-width:22px}
 .buldo-list{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}.buldo-details{font-size:14px;line-height:1.6}.buldo-card h3{font-size:18px}.buldo-card time{font-size:14px}.buldo-tags span{font-size:11px}.buldo-card a{display:inline-flex;align-items:center;min-height:44px;font-size:13px}.competition-jury{min-height:44px;padding:10px 16px;font-size:14px}.buldo-header p,.buldo-legend,.competition-jury-notice{font-size:13px;line-height:1.5}
 /* Planner: a full-width working day, with its existing clickable cells. */
 body.editor-mode .workspace,body.studio-week-mode:has(#planner-drawer:not([hidden])) .workspace,body.school-mode:has(#planner-drawer:not([hidden])) .workspace{display:flex;flex:1;min-height:0;height:auto;overflow:auto;padding:12px 10px 28px;gap:12px}
 body.editor-mode .board-workspace{flex:none;min-height:0;overflow:visible;gap:12px}
 .editor-mode .publication-toolbar{flex-wrap:wrap;padding:10px;gap:8px}.publication-toolbar>div{flex-basis:100%}.publication-toolbar button{min-height:44px;font-size:12px}.publication-toolbar .compact-fold{width:100%;order:3}.publication-toolbar .compact-fold-content button{flex:1 1 125px}
 body.editor-mode .board-topbar{display:flex;flex-wrap:wrap;gap:10px}.board-topbar .board-heading{flex:1}.board-topbar #locations button{min-height:44px;font-size:14px;padding:8px 16px}
 body.editor-mode .board-actions{width:100%;display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}.board-actions>button{min-height:44px!important;font-size:13px!important}.board-actions>.compact-fold{flex:1}.board-actions .compact-fold-content{flex-direction:column}.board-actions .compact-fold-content>*{min-height:44px!important;font-size:14px!important;width:100%!important}
 body.editor-mode .week-context{flex-wrap:wrap;gap:8px;padding:10px;font-size:13px;justify-content:flex-start}.week-context button,.week-context input{min-height:44px;font-size:14px!important}.week-context label{display:flex;gap:8px;align-items:center;min-width:0}.week-context input{min-width:0;width:150px}.week-context .special-legend{display:none}
 body.editor-mode .stage{height:auto;min-height:0;flex:none;padding:10px;overflow:visible}
 body.editor-mode .stage-caption{display:flex!important;height:auto;flex-basis:auto;min-height:0;flex-wrap:wrap;gap:10px;margin-bottom:8px}
 .stage-caption .board-identity{order:-1;width:100%;text-align:left}.board-identity h2{font-size:20px}.board-identity p{font-size:13px}
 .stage-caption #room-buttons{width:100%;justify-content:flex-start;gap:6px}.stage-caption .room-button{min-height:40px;font-size:12px;padding:7px}
 .studio-week-mode #week-placement-time{font-size:13px}.studio-week-mode #week-start{min-height:44px;width:100px;font-size:16px}
 body.studio-week-mode #planning-board{display:block;flex:none;padding:0;overflow:visible}.studio-week-mode .plan-day[data-compact-selected=false]{display:none}
 .studio-week-mode .plan-day{min-height:0;height:auto}.studio-week-mode .plan-day-title{height:auto;min-height:44px;padding:10px}.studio-week-mode .plan-day-title h3{font-size:16px}
 .studio-week-mode .plan-day-grid{display:grid;grid-template-rows:repeat(var(--plan-rows),52px);height:auto;flex:none;gap:3px;padding:3px 5px}
 .studio-week-mode .plan-row,.studio-week-mode .plan-room-heads{grid-template-columns:40px repeat(var(--plan-rooms),minmax(0,1fr));gap:3px}.studio-week-mode .plan-time{font-size:11px}.studio-week-mode .plan-room-heads{height:40px;padding:0 5px}.studio-week-mode .plan-room-heads span{font-size:13px}
 .studio-week-mode .plan-code{font-size:14px!important}.studio-week-mode .lesson-number{font-size:11px!important}.plan-more{min-height:44px;font-size:13px}.plan-slot .slot-mark{font-size:17px}
 body .plan-lesson,body .planner-pool-card,body .floor-lesson,body .lesson,body .draft-card{touch-action:pan-y}
 .studio-week-mode #week-events{display:block;max-height:none;padding:4px 0}.studio-week-mode #week-events .event-day[data-compact-selected=false]{display:none}.event-day-title{font-size:12px}.event-day .school-event-chip strong{font-size:15px}
 body.editor-mode #planner-drawer{top:0!important;bottom:0;width:min(420px,92vw);height:100dvh;z-index:45;box-shadow:-20px 0 60px #0008}
 #planner-drawer header button{min-width:44px;min-height:44px}#planner-drawer nav button{min-height:44px;font-size:14px}#planner-drawer input{min-height:44px;font-size:16px}#planner-drawer button{min-height:44px}.pool-name,.course-summary .summary-name{font-size:13px!important}#planner-drawer .drawer-create{flex-wrap:wrap}#planner-drawer .drawer-create button{flex:1 1 40%;font-size:13px}
 body.editor-mode:has(#planner-drawer:not([hidden])) #compact-drawer-backdrop{display:block;position:fixed;inset:0;z-index:41;border:0;border-radius:0;background:#0009;margin:0;padding:0}
 .school-mode .dance-floors{display:grid;grid-template-columns:1fr;gap:12px}.school-mode #planning-board{display:block}.school-mode .floor-day-plan{display:flex;flex-direction:column;height:auto;max-height:none}.school-mode .floor-day-plan>button{min-height:60px;max-height:none}.school-mode .wood-floor{overflow:visible;height:auto}.school-mode .studio-week button{min-height:48px}.school-mode .studio-timeline{overflow:auto}
}
@media screen and (min-width:701px) and (max-width:1199px),screen and (min-width:701px) and (any-pointer:coarse) and (max-width:1366px){
 body .app-navigation{grid-template-columns:repeat(6,minmax(0,1fr))!important}.viewer-mode .viewer-heading{display:grid;grid-template-columns:1fr 1fr;align-items:center}.viewer-mode .viewer-controls{grid-template-columns:repeat(3,1fr)}.viewer-mode .week-room-legend{grid-column:1/-1;grid-template-columns:repeat(4,1fr)}
 .mobile-day-view{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.mobile-week-days,.mobile-day-heading,.mobile-events,.mobile-holiday,.mobile-day-view>.mobile-empty{grid-column:1/-1}.mobile-location{min-width:0}.viewer-mode .season-heading{display:flex}.viewer-mode .season-dashboard{max-width:850px;width:100%;align-self:center}.viewer-mode .season-week-cells button{min-height:85px}
 .personal-view .agenda-day[data-compact-selected=true]{display:grid;grid-template-columns:1fr 1fr;gap:12px}.personal-view .agenda-day h2,.personal-view .agenda-empty{grid-column:1/-1}.personal-view .agenda-card{margin:0}.personal-view .agenda-controls{grid-template-columns:1fr 1fr 1fr}.agenda-controls>.compact-fold{grid-column:auto}
}
@media screen and (max-width:600px){
 .buldo-controls{grid-template-columns:1fr}.buldo-list{grid-template-columns:minmax(0,1fr)}.buldo-controls label{width:100%}.buldo-card{padding:14px}.buldo-card-head{flex-wrap:wrap}.buldo-tags{justify-content:flex-start}.competition-jury{width:100%}
 body dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:14px}body dialog .form-pair{grid-template-columns:minmax(0,1fr)}body dialog .dialog-top{top:-14px}body dialog .dialog-actions,body dialog .agenda-form>.agenda-actions{bottom:-14px;margin-bottom:-14px}
 .agenda-range-calendar{padding:6px}.agenda-range-months{gap:12px}.agenda-range-grid{gap:1px}.agenda-follow-day>summary>span{float:none;display:block;margin-top:4px}.agenda-follow-location-heading{flex-wrap:wrap}
 .curriculum-number-strip{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.curriculum-number-strip button{padding:5px 0;font-size:14px}.dance-group{display:block}.dance-choices button{padding:8px 10px;font-size:13px}.curriculum-navigation strong{font-size:13px}
 body #lesson-dialog.lesson-card-dialog{padding:10px}
 body #lesson-dialog.lesson-card-dialog>.dialog-top{top:-10px;padding:0;min-height:44px}
 body #lesson-dialog .lesson-card-tabs{grid-template-columns:repeat(4,minmax(0,1fr));margin:8px 0;gap:4px}
 body #lesson-dialog .lesson-card-tabs button{min-height:44px;padding:6px 3px;text-align:center;justify-content:center;align-content:center}
 body #lesson-dialog .lesson-card-tabs button strong{font-size:11px;line-height:1.2}
 body #lesson-dialog .lesson-card-tabs button span{display:none}
 body #lesson-dialog #lesson-panel-program{padding:8px}
 body #lesson-panel-program .curriculum-compact-form .curriculum-field{line-height:1.2}
 body #lesson-panel-program .curriculum-compact-form .curriculum-field textarea{min-height:36px;line-height:1.25;padding:6px 8px}
 #season-months{grid-template-columns:1fr}.agenda-time-fields{gap:8px}.agenda-form .agenda-links,.agenda-form .agenda-shares{padding:10px}
}
@media print{.compact-days,#compact-app-menu,#compact-drawer-backdrop,.compact-fold>summary{display:none!important}.compact-fold,.compact-fold-content{display:contents!important}}
