/* Integrated learning workspace. Teaching typography/topology remain in player.css. */
.player-shell { isolation:isolate; position:relative; }
.player-shell::before { content:""; position:absolute; inset:0 0 auto; height:26.25rem; background:url('../app/environment.svg') center bottom/cover no-repeat; opacity:.08; pointer-events:none; z-index:-1; mask-image:linear-gradient(#000 0%,#000 78%,transparent 100%); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
.shell-header { position:relative; max-width:90rem; margin:auto; min-height:3.5rem; padding:.25rem max(1rem,env(safe-area-inset-right)) .25rem max(1rem,env(safe-area-inset-left)); gap:1rem; font-size:.9375rem; }
.shell-header>* { min-width:0; max-width:100%; }
.course-back { display:inline-flex; align-items:center; min-height:2.75rem; flex-shrink:0; text-decoration:none; }
.course-identity { flex:1; }
.course-identity .eyebrow { font-size:.6875rem; line-height:1.4; margin:0; overflow-wrap:anywhere; }
.course-identity h1 { font-size:1.125rem; line-height:1.4; margin:0; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; overflow:hidden; overflow-wrap:anywhere; }
#materials { flex-shrink:0; }
#materials summary { display:flex; align-items:center; min-height:2.75rem; padding:.25rem .5rem; color:var(--color-action); cursor:pointer; }
.material-body { position:absolute; z-index:5; top:100%; right:1rem; width:min(30rem,calc(100vw - 2rem)); max-height:75dvh; overflow:auto; background:var(--color-surface); border:1px solid var(--color-border-control); border-radius:8px; padding:1rem; overflow-wrap:anywhere; box-shadow:0 8px 20px #24332f12; }
.material-body p { margin:0 0 .75rem; line-height:1.6; }.full-title { font-weight:600; }
.material-body a,.material-body button { display:inline-flex; min-height:2.75rem; align-items:center; }
.material-body .lesson-picker { display:grid; margin-top:.75rem; }
.material-help { color:var(--color-secondary); font-size:.875rem; }
main#player { max-width:90rem; padding:.75rem max(1rem,env(safe-area-inset-right)) max(1rem,env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left)); }
.whiteboard-frame { position:relative; background:var(--color-surface); border:1px solid var(--color-border-quiet); border-radius:8px; }
.board-heading { position:absolute; top:.5rem; right:.75rem; z-index:2; }
#follow { min-height:2.75rem; padding:.375rem .75rem; background:var(--color-surface); border-color:var(--color-border-quiet); font-size:.9375rem; box-shadow:none; }
#viewport { height:clamp(30rem,calc(100dvh - 15rem),42.5rem); min-height:0; max-height:none; margin:0; border:0; border-radius:8px 8px 0 0; }
.controls { display:flex; align-items:center; gap:.75rem; margin:0; padding:.1875rem .75rem; min-height:3.25rem; border-top:1px solid var(--color-border-quiet); }
.controls #status.player-problem { position:static; width:auto; height:auto; margin:0; clip-path:none; white-space:normal; flex-basis:100%; color:var(--color-error-text); font-size:.875rem; }.controls:has(.player-problem) { flex-wrap:wrap; }
.play-control { display:inline-flex; justify-content:center; align-items:center; flex:0 0 2.75rem; min-width:2.75rem; min-height:2.75rem; padding:0; border:0; background:transparent; font-size:1.125rem; color:var(--color-action); }
.play-control:hover { background:var(--color-soft); }.play-control:disabled { opacity:.5; }
.timeline { flex:1; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,max-content); gap:.75rem; min-width:0; }
.timeline input { appearance:none; -webkit-appearance:none; width:100%; height:2.75rem; min-width:0; margin:0; padding:0; background:transparent; cursor:pointer; }
.timeline input::-webkit-slider-runnable-track { height:5px; border-radius:3px; background:var(--color-border-control); }
.timeline input::-moz-range-track { height:5px; border-radius:3px; background:var(--color-border-control); }
.timeline input::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:18px; height:18px; margin-top:-6.5px; border-radius:50%; background:var(--color-action); border:2px solid var(--color-surface); }
.timeline input::-moz-range-thumb { width:14px; height:14px; border-radius:50%; background:var(--color-action); border:2px solid var(--color-surface); }
.timeline input:disabled { opacity:.5; cursor:wait; }
.timeline output { align-self:center; font-size:.875rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.lesson-end { padding:1rem 0; }.lesson-end h2 { margin:0 0 .5rem; font-size:1.125rem; }.end-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem .75rem; }
.end-actions a,.end-actions button,.tertiary { display:inline-flex; min-height:2.75rem; align-items:center; justify-content:center; font-size:.9375rem; padding:.375rem .75rem; border-radius:6px; text-decoration:none; }
.end-actions .primary { border:1px solid var(--color-action); background:var(--color-action); color:var(--color-on-action); }
.end-actions .primary:visited,.end-actions .primary:hover,.end-actions .primary:focus-visible { color:var(--color-on-action); }.end-actions .primary:hover { background:var(--color-action-hover); }
.end-actions .secondary { background:var(--color-surface); border:1px solid var(--color-border-control); }.tertiary { border:1px solid transparent; background:transparent; color:var(--color-action); }
.skip-link { position:absolute; left:-10000px; top:0; }.skip-link:focus { left:1rem; top:.5rem; padding:.75rem; max-width:calc(100% - 2rem); background:var(--color-surface); z-index:10; }
@media (orientation:portrait) and (min-width:48rem) and (max-width:74.999rem) { #viewport { height:66dvh; } }
@media(max-width:47.999rem) {
 .shell-header { gap:.5rem; flex-wrap:wrap; padding-inline:max(.75rem,env(safe-area-inset-left)) max(.75rem,env(safe-area-inset-right)); }
 .course-back { font-size:.875rem; }.course-identity { flex-basis:calc(100% - 8rem); order:2; }.course-identity h1 { font-size:1.375rem; -webkit-line-clamp:2; }.course-identity .eyebrow { font-size:.625rem; }
 #materials { margin-left:auto; }main#player { padding:.5rem max(.75rem,env(safe-area-inset-right)) max(.75rem,env(safe-area-inset-bottom)) max(.75rem,env(safe-area-inset-left)); }
 #viewport { height:65dvh; }.controls { padding:.1875rem .375rem; gap:.375rem; }.timeline { gap:.5rem; }.timeline output { font-size:.75rem; }
}
/* Compact landscape uses the remaining screen as a board, with integrated controls. */
@media(orientation:landscape) and (max-height:599px) {
 .shell-header { flex-wrap:nowrap; min-height:2.75rem; padding-block:0; gap:.5rem; }.course-identity { order:0; flex-basis:auto; }.course-identity h1 { -webkit-line-clamp:1; font-size:1rem; }.course-identity .eyebrow { font-size:.625rem; }
 main#player { padding-top:.25rem; padding-bottom:.25rem; }#viewport { height:calc(100dvh - 7rem); }
 .controls { min-height:3rem; padding-block:0; }.timeline output { font-size:.75rem; }
}
@media(max-width:24rem) { .timeline { grid-template-columns:minmax(0,1fr); gap:0; }.timeline output { font-size:.75rem; text-align:right; }.controls { align-items:center; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }
@media(forced-colors:active) { .player-shell::before { display:none; }.controls,.whiteboard-frame,.material-body { background:Canvas; color:CanvasText; border-color:ButtonText; }.timeline input { appearance:auto; } }
@media print { .player-shell::before { display:none; } }

/* Entry action belongs to the controls, in normal flow above the timeline. */
.entry-playback { display:flex; justify-content:center; background:var(--color-soft); }
.entry-playback:has(#entry-start:not([hidden])) { padding:.5rem .75rem; border-top:1px solid var(--color-border-quiet); }
.entry-playback #entry-start { font-size:1.125rem; border:1px solid var(--color-action); }
#entry-start { min-height:2.75rem; padding:.65rem 1.5rem; background:var(--color-action,#285e57); color:white; border-radius:.5rem; font:inherit; font-weight:600; }
#entry-start[hidden] { display:none; }

/* Long Text is a sibling renderer, with the same teaching viewport allocation. */
#long-text-slot { height:clamp(24rem,65dvh,48rem); border:1px solid var(--color-border-control); border-radius:8px; overflow:hidden; background:var(--color-surface); }
.long-text-frame { display:block; width:100%; height:100%; border:0; }
.runtime-problem { padding:1rem; border:1px solid var(--color-border-control); background:var(--color-error-surface); line-height:1.6; }
.runtime-problem button,.runtime-problem a { margin-right:1rem; }

/* The long-text child owns its title bar; review controls must not cover it. */
#workspace[data-renderer="long_text"] .board-heading { position:static; display:flex; justify-content:space-between; align-items:center; min-height:3.5rem; padding:.375rem .75rem; }
#workspace[data-renderer="long_text"] #follow-label { position:static; width:auto; height:auto; margin:0; clip-path:none; overflow:visible; white-space:normal; }

/* Use available portrait space for authored comparisons without scaling text. */
@media (max-width:47.999rem) and (orientation:portrait) {
 .teaching-source-v031 #viewport { height:68dvh; }
}
@media (max-width:47.999rem) and (min-height:741px) and (orientation:portrait) {
 .teaching-source-v031 #long-text-slot { max-height:calc(100dvh - 16rem - env(safe-area-inset-bottom)); }
}

/* Short portrait uses remaining screen space. Only navigation is compacted;
   authored teaching sizes and full comparison contents remain unchanged. */
@media (max-width:47.999rem) and (max-height:740px) and (orientation:portrait) {
 .teaching-source-v031 .shell-header { min-height:44px; height:44px; flex-wrap:nowrap; padding-block:0; gap:.25rem; }
 .teaching-source-v031 .course-identity { order:0; flex-basis:auto; overflow:hidden; }
 .teaching-source-v031 .course-identity .eyebrow { display:none; }
 .teaching-source-v031 .course-identity h1 { font-size:1rem; -webkit-line-clamp:1; }
 .teaching-source-v031 .course-back,.teaching-source-v031 #materials summary { min-height:44px; padding-block:0; }
 .teaching-source-v031 main#player { padding-top:0; padding-bottom:env(safe-area-inset-bottom); padding-inline:max(.25rem,env(safe-area-inset-left)) max(.25rem,env(safe-area-inset-right)); }
 .teaching-source-v031 #viewport { height:calc(100dvh - 90px - env(safe-area-inset-bottom)); }
 .teaching-source-v031 .controls { height:44px; min-height:44px; padding-block:0; }
 .teaching-source-v031 .play-control,.teaching-source-v031 .timeline input { height:44px; min-height:44px; min-width:44px; }
}

/* Narrow narrated boards need room for two full argument chains and their
   following comparison prompt. Reuse the existing 20px evidence token and
   zones; do not change text, reveal state, follow semantics, or old v0.1 boards. */
@container (max-width:559px) {
 #workspace[data-renderer="whiteboard"] #board { padding:1rem; }
 #workspace[data-renderer="whiteboard"] #zones.two-columns { gap:1rem; }
 #workspace[data-renderer="whiteboard"] #zones.two-columns :is(.zone-left,.zone-right,.zone-lower) .node--branch {
  font-size:var(--type-evidence); line-height:1.5; padding-inline:.5rem;
 }
}
