/* Enterprise Risk needs the whole desktop workspace during its guided tasks. */
@media(min-width:761px){
 body{--guide-desktop-left:122px}
 body.nav-pinned{--guide-desktop-left:294px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) main{padding-right:34px;padding-bottom:380px;transition:none}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) #enterprise-dashboard .analytics-grid{grid-template-columns:minmax(0,1fr)}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach{top:auto;bottom:18px;left:var(--guide-desktop-left);right:34px;width:auto;max-height:360px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach.open{display:grid;grid-template-columns:minmax(0,1fr) 150px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-head{grid-column:1/-1;padding:12px 16px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-body{min-width:0;max-height:220px;overflow:auto;padding:12px 16px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-tasks{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-tasks button{align-items:start;min-width:0}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-actions{flex-direction:column;justify-content:center;border-top:0;border-left:1px solid #e0e8ef}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-target{scroll-margin-bottom:360px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach.minimized{left:auto;width:310px;display:block}
}
@media(min-width:761px) and (max-width:1050px){
 body{--guide-desktop-left:108px}
 body.nav-pinned{--guide-desktop-left:280px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) main{padding-right:20px}
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach{right:20px}
}
/* Geometry follows scrolling immediately; interpolating it makes borders drift. */
.guide-highlight-overlay{transition:none;animation:none;box-shadow:none}
@media(prefers-reduced-motion:reduce){.guide-highlight-overlay{animation:none}}
/* Finger-sized controls and a bottom guide on tablets and phones. */
@media(max-width:1200px){
 .coach-controls{display:flex;gap:4px;flex-shrink:0}
 .coach-controls button{display:grid;place-items:center;min-width:44px;min-height:44px;padding:0}
 body.guide-docked main{padding-right:20px;transition:none}
 body:has(.guide-coach.open) main{padding-bottom:calc(var(--guide-coach-height,320px) + 40px)}
 .guide-coach.open,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach.open{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;left:8px;right:8px;top:auto;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-height:52vh;max-height:52dvh;overflow:hidden}
 .coach-head{padding:8px 12px;align-items:center;min-width:0;gap:6px}
 .coach-head>div:first-child{min-width:0}
 .coach-head strong{overflow-wrap:anywhere}
 .coach-body,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-body{min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;padding:10px 12px}
 .coach-body>p{display:none}
 .coach-tasks{grid-template-columns:minmax(0,1fr)}
 .coach-tasks button{min-width:0;grid-template-columns:30px minmax(0,1fr);min-height:64px}
 .coach-tasks strong,.coach-tasks small{overflow-wrap:anywhere}
 .coach-tasks strong{font-size:.84rem;line-height:1.35}
 .coach-tasks small{font-size:.75rem;line-height:1.45}
 .coach-actions,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-actions{flex-direction:row;border-left:0;border-top:1px solid #e0e8ef;padding:8px 10px}
 .coach-actions button{min-height:44px;font-size:.78rem;white-space:normal}
 .guide-target{scroll-margin-top:12px!important;scroll-margin-bottom:calc(var(--guide-coach-height,320px) + 24px)!important}
 .guide-coach.minimized.open,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach.minimized.open{display:block;width:auto;left:8px;right:8px}
 .guide-coach.minimized .coach-body,.guide-coach.minimized .coach-actions{display:none}
}
@media(min-width:761px) and (max-width:1200px){
 .guide-coach.open,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach.open{left:var(--guide-desktop-left,108px);right:20px}
 .coach-tasks,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .coach-tasks{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
}
@media(max-width:1200px) and (max-height:500px){
 .guide-coach.open,
 body.guide-docked:has(#analytics-view.active #enterprise-dashboard.active) .guide-coach.open{max-height:62vh;max-height:62dvh}
 .coach-head{padding-top:2px;padding-bottom:2px}
}
@media(max-width:1200px){
 .tour-dialog{display:grid;grid-template-rows:auto minmax(0,1fr) auto;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow:hidden}
 .tour-content{min-height:0;overflow:auto;overscroll-behavior:contain}
 .tour-actions{position:relative;bottom:auto}
 #tour-close{width:44px;height:44px;z-index:1}
 .tour-actions button{min-height:44px}
}
/* Keep every task available across rotation; phones show the current task. */
@media(max-width:760px){.guide-coach .coach-tasks button:not(.active){display:none}}
