body.immersive-lesson {
  margin: 0;
  overflow: hidden;
  background: #152823;
}
.lesson-player {
  --extra-footer: 0px;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #152823;
  color: var(--ink);
}
.player-stage {
  position: relative;
  /* 88% of the width is the 16:9 display. The original bezel and controls
     add 33% of the source image's height (941 / 1672 of its width). */
  width: min(100vw, calc((100dvh - var(--extra-footer)) * 1.469025));
  height: min(calc(68.0724vw + var(--extra-footer)), 100dvh);
  flex: none;
  container-type: inline-size;
}
.player-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Stretch the straight side rails, preserving the illustrated corners,
     speaker and dial rather than stretching the whole image vertically. */
  border: solid transparent;
  border-width: 9.56938cqw 16.74641cqw calc(16.74641cqw + var(--extra-footer));
  border-image: url("/brand-assets/lesson-tv-frame-v2.png") 160 280 280 280
    fill / 1 / 0 stretch;
}
.player-screen {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 6.75359cqw;
  aspect-ratio: 16 / 9;
  border-radius: 4cqw;
  overflow: hidden;
  background: #fffdf4;
}
.player-content {
  height: 100%;
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 3cqw 4cqw;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.player-content h1 {
  font-size: clamp(16px, 2.3cqw, 34px);
  margin: 0 0 1.5cqw;
}
.player-content h2 {
  font-size: clamp(14px, 1.8cqw, 25px);
  margin: 0 0 1cqw;
}
.player-reading {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.6cqw, 24px);
  line-height: 1.6;
}
/* The generated frame has a speaker at the left and a dial at the right.
   Reserve the same safe strip and control slots for every lesson module. */
.player-footer {
  --control-size: clamp(28px, 4cqw, 60px);
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 2.814cqw;
  height: 5.628cqw;
  display: grid;
  grid-template-columns:
    repeat(4, var(--control-size)) minmax(24px, 1fr) minmax(56px, 7cqw)
    var(--control-size) minmax(28px, 0.65fr) repeat(2, var(--control-size));
  align-items: center;
  justify-items: center;
  column-gap: 0.5cqw;
}
.player-controls,
.player-media-controls,
.player-footer .pdf-controls {
  display: contents;
}
.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1cqw;
}
.player-footer [data-player="exit"] {
  grid-column: 1;
}
.player-footer [data-player="back"],
.player-footer [data-pdf="back"] {
  grid-column: 2;
}
.player-footer [data-player="play"] {
  grid-column: 3;
}
.player-footer [data-player="repeat"] {
  grid-column: 4;
}
.player-footer .player-seek {
  grid-column: 5;
}
.player-footer .player-time {
  grid-column: 6;
}
.player-footer [data-player="mute"] {
  grid-column: 7;
}
.player-footer .player-volume {
  grid-column: 8;
}
.player-footer [data-player="next"],
.player-footer [data-player="finish"],
.player-footer [data-pdf="next"] {
  grid-column: 9;
}
.player-footer [data-player="fullscreen"] {
  grid-column: 10;
}
.player-footer .player-counter {
  grid-column: 3 / 9;
}
.player-footer .pdf-position {
  grid-column: 3 / 9;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}
.player-footer button,
.player-footer input,
.player-footer .player-time,
.player-footer .player-counter,
.player-footer .pdf-position {
  grid-row: 1;
}
.player-media-controls[hidden],
.player-counter[hidden],
.player-audio-source,
.player-narration-audio,
.player-material-step audio:not([controls]) {
  display: none;
}
.lesson-player .button {
  border: 0;
  box-shadow: none;
  color: #173d2e;
  background: transparent url("/brand-assets/lesson-button-secondary-v1.png")
    center/100% 100% no-repeat;
  font-weight: 700;
  min-height: 40px;
  padding: 10px 22px;
}
.lesson-player .button.primary {
  background-image: url("/brand-assets/lesson-button-primary-v1.png");
}
.lesson-player .player-icon {
  width: var(--control-size, clamp(28px, 4cqw, 60px));
  height: var(--control-size, clamp(28px, 4cqw, 60px));
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: none;
  font-size: clamp(22px, 2.6cqw, 36px);
  line-height: 1;
}
.lesson-player .button:focus-visible {
  outline: 3px solid #2b6177;
  outline-offset: 2px;
}
.lesson-player .button:active:not(:disabled) {
  transform: translateY(1px);
}
.player-counter,
.pdf-position,
.player-time {
  white-space: nowrap;
  margin: 0;
  color: #254638;
  font-size: clamp(10px, 1.1cqw, 16px);
  font-variant-numeric: tabular-nums;
}
.player-seek {
  min-width: 24px;
  width: 100%;
  accent-color: #285f4a;
  padding: 0;
  min-height: 24px;
}
.player-volume {
  width: 100%;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  accent-color: #285f4a;
}
.player-material-step {
  padding: 0;
}
.player-material-step .lesson-material,
.player-material-step .material-content {
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}
.player-material-step .lesson-material > h3 {
  display: none;
}
.player-content video,
.player-content .material-content img {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  object-fit: contain;
  background: #111c18;
  border-radius: 0;
}
.player-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.player-content audio {
  margin: 20%;
}
.player-pdf {
  height: 100%;
  position: relative;
}
.pdf-sheet {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pdf-sheet canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.player-pdf details {
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  font-size: 12px;
}
.player-pdf details[open] {
  background: #fffdf4;
  max-height: 90%;
  overflow: auto;
  padding: 12px;
}
.pdf-text {
  white-space: pre-wrap;
}
.pdf-error {
  position: absolute;
  top: 15%;
  left: 10%;
  right: 10%;
}
#player-error:empty {
  display: none;
}
#player-error {
  color: #9a3412;
}
.player-material-step #player-error:not(:empty) {
  position: absolute;
  inset: 10%;
  background: #fffdf4;
  padding: 16px;
}
#player-question-form {
  display: grid;
  gap: 1cqw;
}
#player-question-form fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}
#player-question-form legend {
  font-size: clamp(12px, 1.2cqw, 18px);
  margin-bottom: 1cqw;
}
#player-question-form .choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1cqw;
}
#player-question-form .choice {
  padding: 1cqw;
  min-height: 38px;
  font-size: clamp(12px, 1.4cqw, 20px);
  gap: 8px;
}
#player-question-form button {
  justify-self: start;
}
#player-feedback {
  margin-top: 1cqw;
  padding: 1.2cqw;
}
#player-feedback p {
  margin: 6px 0;
  white-space: pre-wrap;
}
.player-finish {
  max-width: 700px;
  margin: auto;
}
.player-finish img {
  width: 90px;
  height: auto;
  float: right;
}
.player-rotate {
  display: none;
}
@media (orientation: portrait) {
  .player-rotate {
    display: block;
    position: absolute;
    top: calc(50% + 34.1vw + var(--extra-footer, 0px) / 2 + 12px);
    left: 24px;
    right: 24px;
    text-align: center;
    color: #dce9de;
    font-size: 14px;
  }
}
@media (max-width: 600px), (max-height: 370px) {
  .lesson-player {
    --extra-footer: 28px;
  }
  .player-footer {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .player-footer [data-player="mute"] {
    grid-column: 5;
  }
  .player-footer [data-player="next"],
  .player-footer [data-player="finish"],
  .player-footer [data-pdf="next"] {
    grid-column: 6;
  }
  .player-footer [data-player="fullscreen"] {
    grid-column: 7;
  }
  .player-footer .player-counter,
  .player-footer .pdf-position {
    grid-column: 3 / 6;
  }
  /* The small sliders sit above their media buttons, without moving navigation. */
  .player-footer .player-seek,
  .player-footer .player-volume {
    position: absolute;
    grid-column: 1 / -1;
    bottom: calc(100% + 12px);
    min-height: 16px;
    height: 16px;
    min-width: 0;
  }
  .player-footer .player-seek {
    left: 28.6%;
    width: 23%;
  }
  .player-footer .player-volume {
    left: 54%;
    width: 17.4%;
  }
  .player-content {
    padding: 2cqw 3cqw;
  }
  .player-material-step {
    padding: 0;
  }
  .player-time {
    display: none;
  }
}
.path-editor-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.path-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.path-editor-heading > div {
  display: flex;
  gap: 8px;
}
.path-editor-add {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.path-editor-step label {
  display: block;
}

body.immersive-lesson #toast {
  display: none;
}
@media (orientation: landscape) and (min-width: 601px) and (max-height: 600px) {
  .player-footer {
    --control-size: clamp(36px, 4cqw, 60px);
  }
}

.lesson-player .button:not(:disabled):hover {
  background: transparent url("/brand-assets/lesson-button-secondary-v1.png")
    center / 100% 100% no-repeat;
}
.lesson-player .button.primary:not(:disabled):hover {
  background-image: url("/brand-assets/lesson-button-primary-v1.png");
}
/* Teacher's card constructor. */
#dialog.lesson-builder-dialog {
  width: min(1080px, 96vw);
  max-width: 1080px;
}
.builder-card {
  background: #f7faf7;
  padding: 22px;
  border: 1px solid #cbdcd1;
}
.builder-card h3,
.builder-question h4 {
  margin: 0;
}
.builder-reorder {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.builder-reorder .button {
  min-width: 42px;
  min-height: 42px;
  padding: 7px 12px;
}
[data-drag] {
  touch-action: none;
  cursor: grab;
  user-select: none;
}
[data-drag]:active {
  cursor: grabbing;
}
.is-dragging {
  outline: 3px solid #47876d;
  box-shadow: 0 4px 18px #24584320;
}
.builder-card > label,
.builder-question > label {
  display: block;
  margin: 14px 0;
}
.rich-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.rich-editor {
  min-height: 170px;
  max-height: 420px;
  overflow: auto;
  background: white;
  border: 1px solid #a9bfb0;
  border-radius: 12px;
  padding: 16px;
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.rich-editor p {
  margin: 0 0 10px;
}
.rich-editor:focus {
  outline: 3px solid #7fbaa1;
  outline-offset: 2px;
}
.builder-question {
  background: white;
  border: 1px solid #d5e0d8;
  border-radius: 14px;
  padding: 18px;
  margin: 18px 0;
}
.builder-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.builder-option > input:first-child {
  flex: none;
  width: 20px;
  height: 20px;
}
.builder-option .option-text {
  flex: 1;
  min-width: 0;
}
.builder-check {
  display: flex !important;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}
.builder-file {
  margin-top: 18px;
}
.builder-file label {
  display: block;
  margin-top: 14px;
}
.builder-file input[type="file"] {
  display: block;
  margin-top: 8px;
  max-width: 100%;
}
.path-editor-add {
  position: static;
  padding: 14px;
  background: #fffdf3;
  border: 1px solid #e4ddc9;
  border-radius: 14px;
  z-index: 2;
}
.lesson-extra-materials {
  margin: 20px 0;
}
.lesson-card-summary {
  line-height: 1.9;
}
@media (max-width: 600px) {
  .builder-card,
  .builder-question {
    padding: 12px;
  }
  .path-editor-add .button {
    flex: 1 1 40%;
  }
  .builder-reorder {
    gap: 4px;
  }
}
.lesson-scenario .scenario-form {
  display: grid;
  gap: 12px;
}
.lesson-scenario .choices {
  display: grid;
  gap: 10px;
}
.lesson-scenario textarea {
  display: block;
  width: 100%;
  min-height: 80px;
}
.lesson-scenario .notice p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lesson-scenario .scenario-reactions .notice {
  margin-bottom: 12px;
}
.lesson-scenario button {
  justify-self: start;
}

/* Narrated image slides share the existing screen and fixed footer controls. */
.player-slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111c18;
}
.presentation-placeholder {
  padding: 5%;
}
.builder-slide {
  padding: 16px;
  margin: 14px 0;
  border: 1px solid #d5e0d8;
  border-radius: 12px;
  background: white;
}
.builder-slide-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.builder-slide-media label {
  display: block;
  margin: 12px 0;
}
.builder-slide-media select,
.builder-slide-media input {
  width: 100%;
  min-width: 0;
}
.builder-slide-preview {
  display: block;
  max-width: 100%;
  width: 300px;
  max-height: 170px;
  object-fit: contain;
}
.builder-slide-preview[hidden] {
  display: none;
}
@media (max-width: 600px) {
  .builder-slide-media {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .builder-slide {
    padding: 12px;
  }
}

.player-slide-deck {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111c18;
}
.player-slide-image:not([src]) {
  visibility: hidden;
}
.player-slide-outgoing {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.player-slide-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #fff;
}
