/* Court-first editing: compact header, phase row and one swipeable dock. */
.coach-dialog .coach-header{display:flex;align-items:center;flex-wrap:nowrap;gap:3px;min-height:52px;padding:4px max(6px,env(safe-area-inset-right)) 4px max(6px,env(safe-area-inset-left));padding-top:max(4px,env(safe-area-inset-top))}
.coach-dialog .coach-heading{position:absolute;flex:none;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.coach-dialog .coach-header>button{flex:0 0 36px;width:36px;min-width:36px;height:44px;min-height:44px;padding:6px;gap:0;background:transparent;border-color:transparent}
.coach-dialog .coach-header svg{width:22px;height:22px;flex:none}
.coach-dialog #coach-close{width:36px;min-width:36px;font-size:28px}
.coach-dialog #coach-options-open{width:36px;min-height:44px;padding:6px;gap:0}
.coach-dialog #studio-court{flex:1 1 auto;width:auto;min-width:0;max-width:none;min-height:44px;height:44px;padding:5px 7px;white-space:normal;overflow:hidden;font-size:12px;line-height:1.2;text-align:left;justify-content:flex-start;background:#dafa6910;border-color:#dafa6944}
.coach-dialog[data-advanced=false] .coach-workspace{grid-template-rows:minmax(0,1fr) auto auto auto}
.coach-dialog .coach-phase-ribbon{gap:3px;padding:3px 4px;min-width:0;align-items:center}
.coach-dialog .coach-phase-ribbon button{height:44px;min-height:44px;padding:4px;font-size:11px;white-space:nowrap}
.coach-dialog #studio-prev,.coach-dialog #studio-next{flex:0 0 32px;min-width:32px;width:32px}
.coach-dialog #studio-phase-current{flex:1 1 auto;min-width:60px;max-width:130px}
.coach-dialog #studio-quick-add{flex:0 0 54px;width:54px}
.coach-dialog #coach-simple-play{flex:0 0 56px;width:56px;font-size:12px;background:#dafa69;color:#192308;border-color:#dafa69}
.coach-dialog #coach-keep-open{flex:0 0 76px;width:76px;border-color:#526170}
.coach-dialog #coach-keep-open[aria-pressed=true]{background:#dafa6920;border-color:#dafa69;color:#e0ff8c}
.coach-dialog[data-advanced=false] .coach-toolbar,.coach-dialog .coach-toolbar{display:grid;grid-template-columns:26px minmax(0,1fr) 26px;gap:2px;align-items:center;min-width:0;width:100%;padding:0 3px max(2px,env(safe-area-inset-bottom));background:#10151c}
.coach-dialog .coach-toolbar .coach-tools{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:3px;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#637184 #10151c;padding:4px 0;scroll-padding:8px;touch-action:pan-x}
.coach-dialog .coach-toolbar .coach-tools button{display:inline-flex;flex-direction:column;flex:0 0 56px;width:56px;min-width:56px;height:56px;min-height:56px;padding:4px 2px;gap:3px;font-size:11px;line-height:1.1;white-space:nowrap;background:transparent;border-color:transparent}
.coach-dialog .coach-toolbar .coach-tools button[aria-pressed=true]{background:#dafa6918;border-color:#dafa69;color:#dafa69}
.coach-dialog .coach-tools button svg{width:22px;height:22px;flex:none}
.coach-dialog .coach-toolbar>button{width:26px;min-width:0;height:56px;min-height:44px;padding:0;font-size:24px;border-color:transparent;background:transparent;color:#b9c8d4}
.coach-dock-actions{display:contents}
.coach-dock-divider{flex:0 0 1px;height:30px;background:#42515f;margin:0 5px}
.coach-dialog .coach-toolbar .coach-tools .coach-ink-swatch{flex-basis:38px;min-width:38px;width:38px}
.coach-ink-swatch>span{display:block;width:23px;height:23px;border:2px solid #aab9c8;border-radius:50%;box-shadow:0 0 0 3px #10151c}
.coach-dialog .coach-quick-settings{grid-row:4;display:flex;align-items:end;gap:8px;padding:6px 10px max(8px,env(safe-area-inset-bottom));background:#192430;color:#e8f0f7;border-top:1px solid #43515f;min-width:0}
.coach-quick-settings label{font-size:11px;min-width:0;flex:0 0 88px}.coach-quick-settings .dock-text-label{flex:1 1 auto}
.coach-dialog .coach-quick-settings input,.coach-dialog .coach-quick-settings select{min-height:40px;height:40px;padding:6px;font-size:13px}
.coach-dialog #dock-settings-close{width:32px;min-width:32px;min-height:40px;padding:3px;font-size:22px}
.coach-dialog.coach-focus[data-advanced=false] .coach-shell{display:grid;grid-template-rows:auto minmax(0,1fr)}
.coach-dialog.coach-focus[data-advanced=false] .coach-header{position:static;inset:auto;border-radius:0;background:#10151c;padding:4px 6px;z-index:auto}
.coach-dialog.coach-focus[data-advanced=false] #coach-close{display:inline-flex}

/* Secondary panels must wrap actions instead of inheriting the drawing dock's no-wrap rule. */
.coach-dialog .coach-options{min-width:0;overflow-x:hidden;overflow-wrap:anywhere}
.coach-dialog .coach-options .coach-action-row,.coach-dialog .coach-options .coach-menu-actions,.coach-dialog .coach-options .coach-segment{flex-wrap:wrap;gap:8px;min-width:0}
.coach-dialog .coach-options .coach-action-row button,.coach-dialog .coach-options .coach-menu-actions button{flex:1 1 125px;min-width:0;max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere}
.coach-dialog .coach-options .coach-segment button{min-width:0;white-space:normal;flex:1 1 100px}
.coach-options .coach-options-header{min-width:0}.coach-options .coach-options-header h2{min-width:0;overflow-wrap:anywhere}.coach-options .coach-options-header button{flex-shrink:0}
.coach-dialog .coach-options input,.coach-dialog .coach-options select,.coach-dialog .coach-options textarea{min-width:0;max-width:100%}
.coach-dialog .coach-options .studio-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.coach-dialog .coach-options .studio-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.coach-dialog .coach-options .studio-tool-grid button{min-width:0;white-space:normal;min-height:44px}
.coach-dialog .coach-options .coach-mini-results{grid-template-columns:repeat(2,minmax(0,1fr))}
.coach-dialog .coach-options .coach-mini-results button{min-width:0;white-space:normal}
.coach-dialog .coach-options .media-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));min-width:0}
.coach-dialog .coach-options .media-controls>*{min-width:0;max-width:100%;white-space:normal}
.coach-dialog .coach-options .studio-phase-list{min-width:0;max-width:100%}
.coach-dialog .coach-options .studio-phase-list button{max-width:100%;min-width:0}
.coach-dialog .coach-options .practice-block header button{white-space:normal;min-width:0;max-width:100%}
.coach-dialog #studio-keep-controls{white-space:normal;margin:0 0 12px;min-height:44px;width:100%}

/* Original SVG court thumbnails, grouped and searchable in a nearly full-height sheet. */
.coach-dialog .coach-panel-layer #coach-court-picker{display:flex;flex-direction:column;width:100%;max-width:850px;height:calc(100dvh - 28px);max-height:calc(100dvh - 28px);padding:16px;overflow:hidden}
#coach-court-picker .coach-options-header{margin-bottom:12px}
.court-picker-controls{flex:none;min-width:0}.court-picker-controls>label{font-size:13px;display:block;margin-bottom:5px}
.court-picker-controls .coach-segment{margin-top:10px}.court-picker-controls p{font-size:12px;color:#b4c7d8;margin:8px 0}
.court-groups{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:0 2px 16px;scrollbar-width:thin}
.court-group{margin:8px 0 20px}.coach-dialog .court-group h3{font-size:14px;margin:0 0 8px;color:#e3f5b6}
.court-thumbnail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.coach-dialog .court-thumbnail-grid button{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:6px;min-width:0;width:100%;padding:5px;white-space:normal;font-size:11px;line-height:1.25;overflow-wrap:anywhere;min-height:106px;text-align:center;border-radius:10px}
.court-thumbnail{display:block;aspect-ratio:5/3;overflow:hidden;border-radius:5px;background:#324354}.court-thumbnail svg{display:block;width:100%;height:100%}
.coach-dialog .court-thumbnail-grid button[aria-pressed=true]{outline:1px solid #dafa69;outline-offset:-2px}
@media(min-width:1000px){.coach-dialog .coach-header{gap:8px;padding-left:16px;padding-right:16px}.coach-dialog .coach-heading{position:static;width:auto;height:auto;clip-path:none;overflow:visible;flex:0 0 auto}.coach-dialog #studio-court{max-width:280px;margin-right:auto}.coach-dialog .coach-header>button{flex-basis:44px;width:44px}.court-thumbnail-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.court-thumbnail-grid button{font-size:13px!important}.coach-dialog .coach-toolbar .coach-tools button{flex-basis:64px;width:64px}}
@media(max-width:350px){.coach-dialog .coach-header{gap:1px;padding-left:3px;padding-right:3px}.coach-dialog .coach-header>button,.coach-dialog #coach-close,.coach-dialog #coach-options-open{flex-basis:32px;width:32px;min-width:32px}.coach-dialog #coach-keep-open{flex-basis:66px;width:66px;font-size:10px}.coach-dialog .coach-phase-ribbon{gap:2px;padding-left:2px;padding-right:2px}.coach-dialog #studio-prev,.coach-dialog #studio-next{flex-basis:28px;min-width:28px;width:28px}}
@media(orientation:landscape) and (max-height:500px){.coach-dialog .coach-header{min-height:44px;padding-top:0;padding-bottom:0}.coach-dialog .coach-phase-ribbon{padding-top:0;padding-bottom:0}.coach-dialog .coach-phase-ribbon button{height:40px;min-height:40px}.coach-dialog .coach-toolbar .coach-tools button{height:48px;min-height:48px}.coach-dialog .coach-toolbar>button{height:48px}.coach-dialog .coach-quick-settings{padding-top:3px;padding-bottom:3px}.coach-dialog .coach-quick-settings label{display:flex;align-items:center;gap:6px;flex-basis:150px}.coach-dialog .coach-quick-settings .dock-text-label{flex:1 1 auto}.coach-dialog .coach-quick-settings label input{width:auto;flex:1;min-width:0}.coach-dialog .coach-quick-settings label select{width:100px}.coach-dialog .coach-panel-layer #coach-court-picker{height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}.court-thumbnail{max-height:70px}.coach-dialog .court-thumbnail-grid button{min-height:100px}}
@media(prefers-reduced-motion:reduce){#coach-dock-scroll{scroll-behavior:auto}}

/* Both reveal bars remain visible and keyboard reachable when editing chrome rests. */
.coach-dialog #coach-hide-controls{font-size:25px}
.coach-dialog.coach-chrome-hidden[data-advanced=false] .coach-header{min-height:28px;height:28px;padding:0;gap:0}
.coach-dialog.coach-chrome-hidden[data-advanced=false] .coach-header>:not(#coach-reveal-top){display:none!important}
.coach-dialog.coach-chrome-hidden[data-advanced=false] .coach-workspace{grid-template-rows:minmax(0,1fr) auto}
.coach-dialog.coach-chrome-hidden[data-advanced=false] .coach-phase-ribbon,.coach-dialog.coach-chrome-hidden[data-advanced=false] .coach-toolbar,.coach-dialog.coach-chrome-hidden[data-advanced=false] .coach-quick-settings{display:none!important}
.coach-dialog #coach-reveal-top,.coach-dialog #coach-reveal-bottom{width:100%;max-width:none;flex:1 1 auto;height:28px;min-height:28px;padding:0;border:0;border-radius:0;background:#18232f;color:#dafa69;font-size:18px;line-height:1;letter-spacing:4px}
.coach-dialog #coach-reveal-bottom{grid-row:2}
.coach-dialog[data-advanced=true] #coach-hide-controls,.coach-dialog[data-advanced=true] #coach-reveal-top,.coach-dialog[data-advanced=true] #coach-reveal-bottom{display:none!important}

/* Brief notices stay inside the court grid cell, above the phase/playback row. */
.coach-dialog[data-advanced=false] .coach-workspace{position:relative}
.coach-dialog[data-advanced=false] #coach-status{grid-area:1/1/2/2;bottom:8px;width:max-content;max-width:calc(100% - 16px)}
