/* Material first. Tool panels only occupy space while in use. */
[data-module-workspace] [hidden] { display: none !important; }
[data-module-workspace] { --board-width: 36%; }
.module-workspace-page, .module-workspace-page.is-focus-mode { width: min(100%, 1920px); min-height: 0; align-content: start; }
.module-workspace-page .module-workspace-header,
.module-workspace-page.is-focus-mode .module-workspace-header {
  padding: 14px 18px; gap: 12px 24px; border-radius: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.module-workspace-page .module-workspace-title,
.module-workspace-page.is-focus-mode .module-workspace-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.module-workspace-page .module-workspace-title h1,
.module-workspace-page.is-focus-mode .module-workspace-title h1 { font-size: clamp(1.25rem, 2vw, 1.8rem); margin: 0; flex: 1 1 280px; }
.module-workspace-page .module-sibling-nav { flex-basis: 100%; margin: 0; gap: 8px; }
.module-workspace-page .module-panel-meta { margin: 0; }
.workspace-objective { flex-basis: 100%; font-size: .875rem; }
.workspace-objective summary { cursor: pointer; font-weight: 700; }
.workspace-objective p { margin: 8px 0 0; }
.module-workspace-page .module-workspace-actions { gap: 6px; max-width: 360px; }
.module-workspace-page .workspace-action-group { padding: 0; box-shadow: none; background: transparent; }
.module-workspace-page .workspace-action-group > .eyebrow { display: none; }
.module-workspace-page .workspace-resource-action,
.module-workspace-page .module-sibling-link,
.module-workspace-page .back-link { min-height: 40px; padding: 8px 12px; font-size: .875rem; box-shadow: none; }
.classroom-toolstrip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel, #fff); }
.classroom-toolstrip-modes { display: flex; flex: 1; gap: 6px; }
.classroom-toolstrip .whiteboard-tool { min-height: 42px; font-size: .875rem; box-shadow: none; }
.classroom-toolstrip .is-active { background: #e5f7de; outline: 2px solid #b4d9a7; }
.classroom-view-switch { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ct-soft, #f1edf9); }
.workspace-compact-hint { display: none; margin: 0; font-size: .875rem; padding: 8px 12px; background: #fff; border-radius: 10px; }
/* One environment around the lesson, not a new stretched image in each panel. */
.module-workspace-page[data-ct-theme]:not([data-ct-theme="classic"]) {
  padding: 12px; border-radius: 20px;
  background-color: var(--ct-stage);
  background-image: var(--ct-art, none);
  background-position: center; background-size: cover; background-repeat: no-repeat;
}
.module-workspace-page[data-ct-theme]:not([data-ct-theme="classic"]) .classroom-toolstrip {
  background: var(--ct-stage); border-color: var(--ct-line); color: var(--ct-ink);
}
.module-workspace-page[data-ct-theme]:not([data-ct-theme="classic"]) .classroom-toolstrip .is-active {
  background: var(--ct-soft); color: var(--ct-accent); outline-color: var(--ct-accent);
}
.module-workspace-page[data-ct-theme]:not([data-ct-theme="classic"]) .teaching-mode-content {
  background-color: var(--ct-stage); background-image: none !important;
}
.board-width-control { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.board-width-control input { width: 90px; }
.module-workspace-page .module-workspace-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 14px; align-items: start; }
.module-workspace-page[data-teaching-layout="split"] .module-workspace-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, var(--board-width)); }
.module-workspace-page .material-workspace-panel { min-height: 0; }
.module-workspace-page .shared-teaching-workspace { min-height: 0; }
.module-workspace-page .shared-teaching-header { justify-content: flex-start; flex-wrap: wrap; padding: 8px; gap: 6px; }
.module-workspace-page .shared-teaching-header .teaching-mode-tabs { flex: 1 1 160px; width: auto; }
.module-workspace-page .teaching-present-button { display: none; }
.module-workspace-page .student-text-display,
.module-workspace-page .whiteboard-canvas-shell canvas { min-height: 160px; height: var(--fitted-board-height, clamp(320px, 48dvh, 640px)); }
.module-workspace-page .class-presentation-fullscreen { display: none; }
.module-workspace-page .class-presentation:fullscreen .class-presentation-fullscreen { display: inline-flex; }
.module-workspace-page .class-presentation-stage { aspect-ratio: auto; height: var(--fitted-stage-height, clamp(250px, calc(100dvh - 310px), 900px)); }
.module-workspace-page .video-viewer iframe { aspect-ratio: auto; height: var(--fitted-media-height, auto); }
.module-workspace-page .class-presentation-stage img { position: absolute; inset: 0; max-height: none; object-fit: contain; }
.module-workspace-page:fullscreen { padding: 12px; overflow: auto; background: #f7f7fc; }
.module-workspace-page:fullscreen .module-workspace-header { display: none; }
.module-workspace-page:fullscreen .class-presentation-stage { height: var(--fitted-stage-height, calc(100dvh - 170px)); }
@media (max-width: 1000px) {
  .module-workspace-page .module-workspace-header { grid-template-columns: 1fr; }
  .module-workspace-page .module-workspace-actions { max-width: none; display: flex; flex-wrap: wrap; }
  .board-width-control { display: none !important; }
  [data-board-only] { display: none; }
  .module-workspace-page[data-teaching-layout="split"] .module-workspace-layout { grid-template-columns: minmax(0, 1fr); }
  .module-workspace-page[data-teaching-layout="split"]:not([data-workspace-selection="material"]) .material-workspace-panel { display: none; }
  .module-workspace-page[data-teaching-layout="split"][data-workspace-selection="material"] .shared-teaching-workspace { display: none; }
  .module-workspace-page[data-teaching-layout="split"] .workspace-compact-hint { display: block; }
  .module-workspace-page .class-presentation-stage { height: var(--fitted-stage-height, auto); aspect-ratio: 16 / 9; }
}

/* Clean classroom surface. Notes baked into slide images remain part of them. */
[data-presentation-tools] { display: none; }
.module-workspace-page.is-student-presenting {
  position: fixed; inset: 0; z-index: 10000; margin: 0; width: 100%; max-width: none;
  height: 100dvh; padding: 12px; overflow: auto; gap: 10px;
  overscroll-behavior: contain;
  background: var(--surface, #f7f7fc); border-radius: 0;
}
.module-workspace-page[data-ct-theme]:not([data-ct-theme="classic"]).is-student-presenting {
  background-color: var(--ct-stage); background-image: var(--ct-art, none);
  background-position: center; background-size: cover; background-repeat: no-repeat; border-radius: 0;
}
.module-workspace-page.is-student-presenting > .module-workspace-header,
.module-workspace-page.is-student-presenting > .assignment-panel,
.module-workspace-page.is-student-presenting > .trial-extension-panel,
.module-workspace-page.is-student-presenting .board-width-control { display: none !important; }
.module-workspace-page.is-student-presenting:not(.show-presentation-tools) .media-controls,
.module-workspace-page.is-student-presenting:not(.show-presentation-tools) .text-display-toolbar,
.module-workspace-page.is-student-presenting:not(.show-presentation-tools) .whiteboard-toolbar,
.module-workspace-page.is-student-presenting:not(.show-presentation-tools) .media-image-toolrail { display: none; }
.module-workspace-page.is-student-presenting [data-presentation-tools] { display: inline-flex; }
.module-workspace-page.is-student-presenting [data-student-presentation] { background: #e0f7d3; border-color: #8cae7d; }
.module-workspace-page.is-student-presenting .classroom-toolstrip { border-radius: 12px; padding: 8px; box-shadow: none; }
.module-workspace-page.is-student-presenting .material-workspace-panel { display: flex; flex-direction: column; }
.module-workspace-page.is-student-presenting .material-viewer { min-height: 0; padding: 8px; }
.module-workspace-page.is-student-presenting .shared-teaching-workspace { max-height: calc(100dvh - 100px); overflow: auto; }
.module-workspace-page.is-student-presenting .student-text-display,
.module-workspace-page.is-student-presenting .whiteboard-canvas-shell canvas { min-height: 160px; height: var(--fitted-board-height, calc(100dvh - 210px)); }
@media (max-width: 1000px) {
  .module-workspace-page.is-student-presenting[data-teaching-layout="split"]:not([data-workspace-selection="material"]) .material-workspace-panel { display: none; }
}
@media (max-width: 600px) {
  .module-workspace-page.is-student-presenting { padding: 6px; }
  .module-workspace-page.is-student-presenting .classroom-toolstrip { gap: 6px; }
  .module-workspace-page.is-student-presenting .classroom-toolstrip-modes { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .module-workspace-page .module-workspace-header { padding: 12px; }
  .classroom-toolstrip { padding: 8px; }
  .classroom-toolstrip > [data-workspace-fullscreen] { margin-left: auto; }
  .module-workspace-page .module-sibling-nav { flex-wrap: wrap; }
}

/* Linear levels: one quiet line says where the class sits (back to the block,
   position in it), and moving on to the next class waits under the class. */
.lesson-context {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  margin: 0 0 4px; font: 600 .8125rem/1.4 Inter, system-ui, sans-serif; color: #6b6480;
}
.lesson-context a {
  color: var(--lesson-accent, #4a3168); font-weight: 800; text-decoration: none; border-radius: 6px;
}
.lesson-context a:hover { text-decoration: underline; }
.lesson-context a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.module-workspace-page > .lesson-context, .teens-page > .lesson-context { margin: 0 4px 10px; }
.lesson-next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px;
  margin: 16px 22px 0; font: 600 .875rem/1.4 Inter, system-ui, sans-serif; color: #6b6480;
}
.lesson-next a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px;
  border: 1px solid #d9d0ea; border-radius: 999px; background: #fff;
  color: var(--lesson-accent, #4a3168); font-weight: 800; text-decoration: none;
}
.lesson-next a:hover { background: #f7f3fc; }
.lesson-next a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.patatas-adventure-workspace { --lesson-accent: #087989; }
.cebollitas-adventure-workspace { --lesson-accent: #5b3f99; }
.tl-root :is(.lesson-context, .lesson-next) { --lesson-accent: var(--tl-accent); }
.module-workspace-page.is-student-presenting > :is(.lesson-context, .lesson-next),
.module-workspace-page:fullscreen > :is(.lesson-context, .lesson-next) { display: none !important; }
@media (max-width: 700px) { .lesson-next { justify-content: flex-start; margin: 14px 10px 0; } }
