/* Keep the walkthrough in the available panel height, with navigation in view. */
.workspace-panel-body:has(.workspace-feature[data-feature="interactive"]:not([hidden]) .explanation-player){overflow:hidden}
.workspace-feature[data-feature="interactive"]:has(.explanation-player){height:100%;min-height:0}
.workspace-feature>.explanation:has(.explanation-player){height:100%;min-height:0;padding:8px}
.workspace-panel .primary-learning.explanation-player:not(.hand-player){display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
.workspace-panel .explanation-player:not(.hand-player) .player-header{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px}
.workspace-panel .explanation-player:not(.hand-player) .player-header>div{flex:1;min-width:150px}
.workspace-panel .explanation-player:not(.hand-player) .player-header small{font-size:9px}
.workspace-panel .explanation-player:not(.hand-player) .player-header h3{font-size:14px!important;line-height:1.3;margin:3px 0}
.workspace-panel .explanation-player:not(.hand-player) .player-tabs{margin:0;flex:none}
.workspace-panel .explanation-player:not(.hand-player) .player-tabs button,.workspace-panel .explanation-player:not(.hand-player) .view-question{padding:7px 10px;min-height:32px;font-size:12px}
.workspace-panel .explanation-player:not(.hand-player) .player-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:6px 0 0}
.workspace-panel .explanation-player:not(.hand-player) .player-mode.active{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.workspace-panel .explanation-player:not(.hand-player) .player-mode.player-scroll.active,.workspace-panel .explanation-player:not(.hand-player) .takeaway-mode.active{overflow:auto}
.workspace-panel .explanation-player:not(.hand-player) .mode-intro{flex:none;gap:6px;margin:0;padding:5px 6px;flex-direction:row;align-items:center}
.workspace-panel .explanation-player:not(.hand-player) .mode-intro span{font-size:10px;white-space:nowrap}
.workspace-panel .explanation-player:not(.hand-player) .mode-intro p{font-size:11px!important;line-height:1.4!important;margin:0}
.workspace-panel .interactive-desmos-explanation,.workspace-panel :is(.tangent-visual,.circle-visual-explanation,.parameter-circle-visual,.scale-circle-visual,.cone-visual-explanation){display:flex;flex-direction:column;flex:1;min-height:0;height:auto;padding:8px;margin:0;overflow:hidden}
.workspace-panel :is(.desmos-player-grid,.tangent-visual-grid,.circle-visual-grid,.parameter-circle-grid,.scale-circle-grid,.cone-visual-grid){flex:1;min-height:0;overflow:hidden;gap:8px;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,.8fr)}
.workspace-panel .desmos-player-grid>div:first-child{min-height:0;height:100%;overflow:hidden}
.workspace-panel .controlled-desmos-stage{height:100%;min-height:0}
.workspace-panel :is(.desmos-step-copy,.visual-step-copy){height:100%;min-height:0;max-height:none;overflow:auto;padding:12px;font-size:14px;line-height:1.5}
.workspace-panel .desmos-step-heading b{font-size:13px;line-height:1.35}
.workspace-panel .desmos-step-heading{gap:8px;margin-bottom:10px}
.workspace-panel .desmos-full-entry,.workspace-panel .desmos-current-copy{padding:12px;margin-top:8px}
.workspace-panel .desmos-current-copy p{font-size:14px!important;line-height:1.55!important}
.workspace-panel .desmos-step-nav{flex:none;gap:5px;padding:6px 0;margin:0;flex-wrap:wrap}
.workspace-panel .desmos-step-nav button{width:28px;height:28px;min-height:28px;font-size:12px}
.workspace-panel .desmos-controls{flex:none;min-height:36px;margin:0;padding:0;position:relative}
.workspace-panel .desmos-controls button{min-height:34px;padding:7px 12px;font-size:13px}
.workspace-panel .desmos-controls span{font-size:11px}
@container workspace (min-width:600px){
 .workspace-panel :is(.desmos-player-grid,.tangent-visual-grid,.circle-visual-grid,.parameter-circle-grid,.scale-circle-grid,.cone-visual-grid){grid-template-columns:minmax(0,1.35fr) minmax(260px,.8fr);grid-template-rows:minmax(0,1fr)}
}
@container workspace (max-width:480px){
 .workspace-panel .explanation-player:not(.hand-player) .player-header>div{flex-basis:100%}
 .workspace-panel .explanation-player:not(.hand-player) .mode-intro{flex-direction:column;align-items:flex-start}
}
.workspace-panel:has(.workspace-feature[data-feature="interactive"]:not([hidden])) .workspace-panel-header{min-height:48px;padding:7px 12px}
.workspace-panel:has(.workspace-feature[data-feature="interactive"]:not([hidden])) .workspace-panel-header h2{font-size:14px}
.workspace-panel .hand-player .hand-step{padding:14px 16px;margin-bottom:8px}
.workspace-panel .hand-player .hand-step h4{font-size:16px}
.workspace-panel .hand-player .hand-step>p:not(.hand-step-number){font-size:14px;line-height:1.5}
.workspace-panel .hand-player .hand-equations{font-size:clamp(18px,1.6vw,22px);gap:6px}
.workspace-panel .primary-learning.explanation-player{margin:0!important}
.workspace-panel :is(.tangent-cinema,.circle-cinema,.parameter-circle-cinema,.scale-circle-cinema,.cone-cinema){height:100%!important;min-height:0!important;aspect-ratio:auto;max-height:100%}
.workspace-panel .visual-step-copy h3{font-size:16px!important;line-height:1.35;margin:6px 0}
.workspace-panel .visual-step-copy p{font-size:14px!important;line-height:1.55!important}

@container workspace (max-width:480px){
 .workspace-panel .explanation-player:not(.hand-player) .player-header>div{order:2;min-width:0}
 .workspace-panel .explanation-player:not(.hand-player) .player-tabs{order:1}
 .workspace-panel .explanation-player:not(.hand-player) .player-tabs button,.workspace-panel .explanation-player:not(.hand-player) .view-question{font-size:11px;padding:6px 8px}
 .workspace-panel .desmos-step-nav{gap:3px}
 .workspace-panel .desmos-step-nav button{width:24px;height:24px;min-height:24px;font-size:11px}
 .workspace-panel .desmos-step-copy{padding:9px}
 .workspace-panel .restore-step{padding:6px 9px;min-height:30px;font-size:12px}
}
/* Dense teaching cards avoid unnecessary travel inside the step pane. */
.workspace-panel .desmos-step-heading{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;margin:0 0 6px}
.workspace-panel .desmos-step-heading b{flex:1;min-width:150px;font-size:13px;line-height:1.3}
.workspace-panel .restore-step{flex:none;min-height:30px;padding:6px 9px;font-size:12px;line-height:1.3}
.workspace-panel .desmos-full-entry,.workspace-panel .desmos-current-copy{padding:9px 10px;margin-top:6px;border-radius:10px}
.workspace-panel .desmos-full-entry>span,.workspace-panel .desmos-current-copy>span{font-size:10px;line-height:1.3;letter-spacing:.06em}
.workspace-panel .desmos-full-entry code{margin:6px 0 0;padding:4px 0;font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.workspace-panel .desmos-current-copy p{margin:6px 0 0;font-size:14px!important;line-height:1.45!important}
.workspace-panel .desmos-current-copy .why-line{margin-top:8px;padding-top:8px}
.workspace-panel .desmos-notation{margin-top:6px;padding:8px 10px;border-radius:10px}
.workspace-panel .desmos-notation>div{gap:6px;grid-template-columns:minmax(50px,90px) 16px minmax(0,1fr);padding:0;margin:0 0 5px}
.workspace-panel .desmos-notation>div:last-child{margin-bottom:0}
.workspace-panel .desmos-notation p{margin:0;font-size:12px!important;line-height:1.4!important}
.workspace-panel .desmos-notation code{font-size:12px;padding:3px 5px;line-height:1.4}
.workspace-panel .visual-step-copy{padding:10px}
.workspace-panel .visual-step-copy h3{margin:4px 0;font-size:15px!important}
.workspace-panel .visual-step-copy>p{margin:7px 0;line-height:1.45!important}
.workspace-panel .visual-step-copy>code{padding:8px;margin:6px 0;font-size:13px;line-height:1.4}
@container workspace (min-width:900px){
 .workspace-panel .explanation-player:not(.hand-player) .player-header{flex-wrap:nowrap;padding:6px 8px}
 .workspace-panel .explanation-player:not(.hand-player) .player-header>div{min-width:0}
}
