/* Shared KNOMAD teaching-face shell. Lesson renderers own content; this file owns place. */

.planning-canvas--lesson,
[data-teaching-content] {
  --teaching-face-board: #132529;
  --teaching-face-board-soft: #1c716d;
  --teaching-face-paper: #f3ead7;
  --teaching-face-paper-strong: #fff7e8;
  --teaching-face-paper-muted: #e5dcc9;
  --teaching-face-ink: #173235;
  --teaching-face-muted: #687875;
  --teaching-face-coral: #ef725a;
  --teaching-face-stroke-quiet: rgba(23, 50, 53, 0.22);
  --teaching-face-stroke-current: #ef725a;
  --teaching-face-stroke-earned: #1c716d;
  --teaching-face-step-1: 5px;
  --teaching-face-step-2: 8px;
  --teaching-face-step-3: 13px;
  --teaching-face-step-4: 21px;
  --teaching-face-step-5: 34px;
  --teaching-face-reading-measure: 60ch;
  --teaching-face-prompt-measure: 72ch;
}

.planning-canvas--lesson { overflow: hidden; cursor: default; }

/* Shared type roles also serve continuous readers and enlarged teaching objects.
 * Content roots establish their own context; descendants resolve cqw against it. */
.teaching-face__center,
[data-teaching-content] {
  --teaching-face-stage-heading: clamp(18px, 1.25cqw, 24px);
  --teaching-face-stage-body: clamp(15px, 1.08cqw, 18px);
  --teaching-face-stage-support: clamp(13px, 0.96cqw, 15px);
  --teaching-face-stage-action: clamp(10px, 0.68cqw, 11px);
  --teaching-face-prompt-heading: clamp(24px, 3.4cqw, 32px);
  --teaching-face-prompt-body: clamp(18px, 2.45cqw, 22px);
  --teaching-face-prompt-action: clamp(12px, 1.5cqw, 14px);
}

[data-teaching-content] { container-type: inline-size; }

.planning-canvas--lesson .planning-canvas__paper {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 48%, rgba(48, 130, 119, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) 0 0 / 22px 22px,
    var(--teaching-face-board);
}

.planning-canvas--lesson .planning-room-header,
.planning-canvas--lesson .planning-canvas__watermark,
.planning-canvas--lesson .planning-canvas__paper::before,
.planning-canvas--lesson .planning-canvas__paper::after {
  display: none;
}

.planning-canvas__content-layer[data-curriculum-lesson-open='true'] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.planning-canvas__content-layer[data-curriculum-lesson-open='true']
  > [data-curriculum-surface-isolated='true'] {
  display: none !important;
}

.planning-canvas__content-layer[data-curriculum-lesson-open='true'] > #planningGoals {
  grid-column: 1 / -1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.teaching-face {
  box-sizing: border-box;
  container-name: teaching-face;
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: var(--teaching-face-step-2) var(--teaching-face-step-3);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e9eee7;
  box-shadow: none;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
}

.teaching-face__header {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr) auto;
  gap: 4px var(--teaching-face-step-3);
  min-height: 50px;
  padding: 0 0 var(--teaching-face-step-2);
}

.teaching-face__identity,
.teaching-face__question {
  display: grid;
  align-content: start;
  gap: 2px;
}

.teaching-face__identity { grid-area: 1 / 1; }

.teaching-face__question {
  grid-area: 1 / 2;
  padding-left: var(--teaching-face-step-3);
  border-left: 2px solid var(--teaching-face-coral);
}

.teaching-face__identity span,
.teaching-face__question span,
.teaching-face__phase,
.teaching-face__progress,
.teaching-face__checkpoint-beat,
.teaching-face__checkpoint-status,
.teaching-face__presentation-label,
.teaching-face__footer {
  color: #9eb4ad;
  font-size: clamp(9px, 0.68cqw, 11px);
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.teaching-face__identity strong {
  color: var(--teaching-face-paper);
  font-size: clamp(13px, 1.15cqw, 18px);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.teaching-face__question strong {
  color: var(--teaching-face-paper);
  font: 700 clamp(11px, 1cqw, 15px)/1.15 Georgia, 'Times New Roman', serif;
}

.teaching-face__controls {
  grid-area: 1 / 3;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--teaching-face-step-1);
  justify-content: flex-end;
}

.teaching-face__controls .i01-lesson__action,
.teaching-face__controls button {
  min-height: 34px;
  padding: 5px var(--teaching-face-step-2);
  border-color: rgba(233, 238, 231, 0.32);
  background: rgba(3, 11, 12, 0.24);
  color: #e9eee7;
  font-size: clamp(9px, 0.68cqw, 11px);
}

.teaching-face__phase {
  grid-area: 2 / 1;
  justify-self: start;
  min-width: 100px;
  padding: 5px var(--teaching-face-step-2);
  border: 1px solid rgba(239, 114, 90, 0.68);
  background: rgba(3, 11, 12, 0.25);
  color: #f8d9c6;
  text-align: center;
}

.teaching-face__progress {
  grid-area: 2 / 2 / 2 / 4;
  align-self: center;
  justify-self: end;
  margin: 0;
  white-space: nowrap;
}

.teaching-face__map {
  position: relative;
  align-self: center;
  justify-self: center;
  width: auto;
  max-width: 100%;
  height: min(100%, 886px);
  aspect-ratio: 13 / 8;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 50%, rgba(48, 130, 119, 0.17), transparent 31%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 22px 22px,
    var(--teaching-face-board);
}

.teaching-face__route {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.teaching-face__route--trail,
.teaching-face__route--bench { display: none; }

.teaching-face__route-entry,
.teaching-face__route-segment,
.teaching-face__route-progress-segment {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.teaching-face__route-entry {
  stroke: var(--teaching-face-coral);
  stroke-width: 3;
  stroke-linecap: round;
}

.teaching-face__route-segment {
  stroke: rgba(239, 114, 90, 0.66);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 1 9;
}

.teaching-face__route marker path {
  fill: var(--teaching-face-coral);
  stroke: none;
}

.teaching-face__route-segment[data-state='current'] {
  stroke: #ff9a7d;
  stroke-width: 3.2;
  stroke-dasharray: 2 7;
}

.teaching-face__route-segment[data-state='completed'] { opacity: 0.34; }
.teaching-face__route-segment[data-state='future'] { opacity: 0.48; }

.teaching-face__route-progress-segment {
  stroke: #ff9a7d;
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  opacity: 0;
}

.teaching-face__route-progress-segment[data-state='completed'] {
  stroke-dashoffset: 0;
  opacity: 0.94;
}

.teaching-face__route-progress-segment.is-advancing {
  animation: teaching-face-route-advance 620ms cubic-bezier(0.3, 0.75, 0.35, 1) both;
}

.teaching-face__route-origin circle,
.teaching-face__route-destination circle {
  fill: var(--teaching-face-board);
  stroke: var(--teaching-face-coral);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.teaching-face__route-origin path {
  fill: none;
  stroke: var(--teaching-face-coral);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.teaching-face__route-destination circle:last-child {
  fill: var(--teaching-face-coral);
  stroke: none;
}

.teaching-face__route-destination[data-state='reached'] circle:first-child {
  fill: rgba(239, 114, 90, 0.28);
  stroke-width: 5;
}

@keyframes teaching-face-route-advance {
  from { stroke-dashoffset: 1; opacity: 0.94; }
  to { stroke-dashoffset: 0; opacity: 0.94; }
}

.teaching-face__checkpoints {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 3fr 10fr 3fr;
  gap: var(--teaching-face-step-1) var(--teaching-face-step-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.teaching-face__checkpoint {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.teaching-face__checkpoint:nth-child(1) { grid-area: 1 / 1; }
.teaching-face__checkpoint:nth-child(2) { grid-area: 1 / 2; }
.teaching-face__checkpoint:nth-child(3) { grid-area: 1 / 3; }
.teaching-face__checkpoint:nth-child(4) { grid-area: 2 / 3; justify-content: flex-end; }
.teaching-face__checkpoint:nth-child(5) { grid-area: 3 / 3; }
.teaching-face__checkpoint:nth-child(6) { grid-area: 3 / 2; }
.teaching-face__checkpoint:nth-child(7) { grid-area: 3 / 1; }
.teaching-face__checkpoint:nth-child(8) { grid-area: 2 / 1; justify-content: flex-start; }

.teaching-face__checkpoint-button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--teaching-face-step-2);
  align-items: center;
  width: min(18cqw, 220px);
  min-height: clamp(48px, 5.2cqw, 68px);
  padding: var(--teaching-face-step-2);
  border: 1px solid var(--teaching-face-stroke-quiet);
  border-radius: 2px;
  background: #e7ddc9;
  color: var(--teaching-face-ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.teaching-face__checkpoint:nth-child(4) .teaching-face__checkpoint-button,
.teaching-face__checkpoint:nth-child(8) .teaching-face__checkpoint-button {
  width: min(15.5cqw, 188px);
}

.teaching-face__checkpoint-button::after {
  position: absolute;
  top: -4px;
  right: 10px;
  width: var(--teaching-face-step-5);
  height: 7px;
  background: rgba(210, 183, 124, 0.58);
  content: '';
  transform: rotate(2deg);
}

.teaching-face__checkpoint-button:disabled { cursor: default; opacity: 1; }

.teaching-face__checkpoint[data-state='current'] .teaching-face__checkpoint-button {
  border: 2px solid var(--teaching-face-stroke-current);
  background: var(--teaching-face-paper-strong);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(239, 114, 90, 0.16), 0 10px 24px rgba(0, 0, 0, 0.34);
}

.teaching-face__checkpoint[data-state='completed'] .teaching-face__checkpoint-button { background: #d6e0ce; }
.teaching-face__checkpoint[data-state='upcoming'] .teaching-face__checkpoint-button { opacity: 0.78; }

.teaching-face__checkpoint[data-state='current'] .teaching-face__checkpoint-button:hover,
.teaching-face__checkpoint[data-state='current'] .teaching-face__checkpoint-button:focus-visible {
  outline: 3px solid rgba(239, 114, 90, 0.45);
  outline-offset: 2px;
}

.teaching-face__checkpoint-number {
  display: grid;
  width: clamp(24px, 2.4cqw, 30px);
  height: clamp(24px, 2.4cqw, 30px);
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: clamp(9px, 0.75cqw, 11px);
  font-weight: 800;
}

.teaching-face__checkpoint[data-state='current'] .teaching-face__checkpoint-number {
  border-color: var(--teaching-face-coral);
  background: var(--teaching-face-coral);
  color: var(--teaching-face-paper-strong);
}

.teaching-face__checkpoint-number[data-token-state='earned'] {
  border-color: var(--teaching-face-board-soft);
  background: var(--teaching-face-board-soft);
  color: var(--teaching-face-paper-strong);
  font-size: clamp(12px, 1.3cqw, 17px);
}

.teaching-face__checkpoint-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.teaching-face__checkpoint-beat { color: var(--teaching-face-muted); font-size: clamp(9px, 0.58cqw, 11px); }

.teaching-face__checkpoint-heading {
  display: block;
  overflow: visible;
  font-size: clamp(10px, 0.84cqw, 12px);
  font-weight: 800;
  line-height: 1.15;
}

.teaching-face__checkpoint-status {
  justify-self: end;
  color: var(--teaching-face-board-soft);
  font-size: clamp(9px, 0.62cqw, 11px);
  white-space: nowrap;
}

.teaching-face__center {
  /*
   * Type belongs to the Active Lesson Container, so its fluid step must be
   * large enough to respond inside the container's real 600-900px range.
   * The former ~1cqw steps never escaped their minimums here; a 1920px
   * viewport therefore rendered the same 15-18px lesson as a compact frame.
   */
  container-name: teaching-center;
  container-type: inline-size;
  position: absolute;
  z-index: 3;
  top: 18.75%;
  left: 19.23%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: 61.54%;
  height: 62.5%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--teaching-face-stroke-quiet);
  border-radius: 8px;
  background: var(--teaching-face-paper-strong);
  color: var(--teaching-face-ink);
  box-shadow: 0 0 0 2px rgba(24, 78, 75, 0.48), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.teaching-face__center:focus-visible {
  outline: 3px solid rgba(239, 114, 90, 0.72);
  outline-offset: 8px;
}

.teaching-face__center-header {
  display: grid;
  grid-template-columns: minmax(138px, 0.78fr) minmax(150px, 1.22fr);
  gap: var(--teaching-face-step-2);
  align-items: center;
  min-height: clamp(42px, 4.6cqw, 60px);
  padding: var(--teaching-face-step-2) var(--teaching-face-step-3);
  border-bottom: 1px solid rgba(23, 50, 53, 0.22);
  background: var(--teaching-face-paper-muted);
}

.teaching-face__center-title {
  padding-left: var(--teaching-face-step-2);
  border-left: 2px solid var(--teaching-face-coral);
  font: 800 clamp(9px, 0.9cqw, 12px)/1.2 ui-monospace, Consolas, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.teaching-face__presentation-switcher {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--teaching-face-step-2);
  align-items: center;
  padding: var(--teaching-face-step-1) var(--teaching-face-step-2);
  border-bottom: 1px solid rgba(23, 50, 53, 0.16);
  background: #eee5d3;
}

.teaching-face__presentation-label {
  color: var(--teaching-face-board-soft);
  white-space: nowrap;
}

.teaching-face__presentation-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--teaching-face-step-1);
}

.teaching-face__presentation-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--teaching-face-step-1);
  align-items: center;
  min-width: 0;
  min-height: 36px;
  padding: 3px var(--teaching-face-step-1);
  border: 1px solid var(--teaching-face-stroke-quiet);
  border-radius: 2px;
  background: transparent;
  color: var(--teaching-face-ink);
  cursor: pointer;
  text-align: left;
}

.teaching-face__presentation-option[aria-selected='true'] {
  border: 2px solid var(--teaching-face-stroke-current);
  background: var(--teaching-face-board);
  color: var(--teaching-face-paper-strong);
  box-shadow: inset 0 -3px 0 var(--teaching-face-coral);
}

.teaching-face__presentation-option:hover:not(:disabled),
.teaching-face__presentation-option:focus-visible:not(:disabled) {
  outline: 2px solid rgba(239, 114, 90, 0.42);
  outline-offset: 1px;
}

.teaching-face__mode-copy { display: grid; min-width: 0; gap: 1px; }
.teaching-face__mode-copy strong { font-size: clamp(9px, 0.62cqw, 11px); line-height: 1.08; }
.teaching-face__mode-copy span { color: #6b7c78; font-size: clamp(9px, 0.58cqw, 10px); line-height: 1.05; letter-spacing: 0.04em; text-transform: uppercase; }
.teaching-face__presentation-option[aria-selected='true'] .teaching-face__mode-copy span { color: #b7c7c1; }

.teaching-face__mode-shape,
.teaching-face__journey-shape {
  position: relative;
  display: block;
  flex: 0 0 auto;
  color: currentColor;
}

.teaching-face__mode-shape { width: 20px; height: 20px; }

.teaching-face__mode-shape--orbit {
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px currentColor;
}

.teaching-face__mode-shape--orbit::after {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--teaching-face-coral);
  content: '';
}

.teaching-face__mode-shape--trail::before {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 9px;
  border-left: 2px dotted currentColor;
  content: '';
}

.teaching-face__mode-shape--trail::after {
  position: absolute;
  right: 5px;
  bottom: 1px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--teaching-face-coral);
  border-bottom: 2px solid var(--teaching-face-coral);
  content: '';
  transform: rotate(45deg);
}

.teaching-face__mode-shape--bench::before {
  position: absolute;
  right: 1px;
  bottom: 5px;
  left: 1px;
  height: 3px;
  background: currentColor;
  box-shadow: 3px 4px 0 -1px currentColor, 14px 4px 0 -1px currentColor;
  content: '';
}

.teaching-face__mode-shape--bench::after {
  position: absolute;
  top: 5px;
  left: 2px;
  width: 4px;
  height: 4px;
  border: 1px solid var(--teaching-face-coral);
  box-shadow: 6px 0 0 var(--teaching-face-coral), 12px 0 0 currentColor;
  content: '';
}

.teaching-face__journey {
  display: grid;
  grid-template-columns: repeat(3, 12px);
  gap: 4px;
  align-items: center;
  padding: var(--teaching-face-step-1);
  border: 1px solid rgba(23, 50, 53, 0.22);
}

.teaching-face__journey-shape {
  width: 9px;
  height: 9px;
  border: 1px solid var(--teaching-face-muted);
  opacity: 0.35;
}

.teaching-face__journey-shape--orbit { border-radius: 50%; }
.teaching-face__journey-shape--trail { transform: rotate(45deg); }
.teaching-face__journey-shape--bench { width: 11px; height: 6px; margin-top: 3px; }

.teaching-face__journey-shape--bench::before,
.teaching-face__journey-shape--bench::after {
  position: absolute;
  bottom: -4px;
  width: 1px;
  height: 3px;
  background: currentColor;
  content: '';
}

.teaching-face__journey-shape--bench::before { left: 2px; }
.teaching-face__journey-shape--bench::after { right: 2px; }

.teaching-face__journey-shape[data-visited='true'] {
  border-color: var(--teaching-face-coral);
  background: var(--teaching-face-coral);
  color: var(--teaching-face-coral);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(239, 114, 90, 0.14);
}

.teaching-face__presentation-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.teaching-face__stage,
.teaching-face__review {
  grid-row: 4;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.teaching-face__stage > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

/* Continuous explanatory content is a reading flow, not a seventh assessed
 * composition. It keeps the same stage track and the shared reading measure. */
.teaching-face__stage[data-teaching-flow='reading'] {
  display: block;
  padding: var(--teaching-face-step-4);
  overflow: auto;
  font-size: var(--teaching-face-prompt-body);
  line-height: 1.4;
}

.teaching-face__stage[data-teaching-flow='reading'] > * {
  max-width: var(--teaching-face-reading-measure);
  margin-inline: auto;
}

.teaching-face__stage[data-teaching-flow='reading'] > section > :is(h1, h2) {
  font-size: var(--teaching-face-prompt-heading);
  line-height: 1.16;
}

/*
 * Sparse teaching is a two-part composition, not a compact stack floating in
 * an empty panel. The 5:3 rows give the subject and its consequence distinct
 * places while keeping the occupied cluster inside the doctrine's 45-80%
 * active-stage band. Lesson renderers declare the composition; the shared
 * shell owns its proportions in every teaching form.
 */
.teaching-face__stage[data-teaching-stage-composition='prompt-action'] {
  --teaching-face-stage-action: var(--teaching-face-prompt-action);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: minmax(min-content, 2fr) minmax(min-content, 1fr);
  gap: 0;
  width: 100%;
  padding: var(--teaching-face-step-4);
  align-content: stretch;
  align-items: center;
  justify-content: stretch;
  justify-items: center;
}

.teaching-face__stage[data-teaching-stage-composition='prompt-action'] > :first-child,
.teaching-face__stage[data-teaching-stage-composition='prompt-action'] > :last-child {
  align-self: safe center;
}

.teaching-face__stage[data-teaching-stage-composition='prompt-action'] > :first-child {
  width: min(100%, var(--teaching-face-prompt-measure));
  font-size: var(--teaching-face-prompt-body);
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='prompt-action'] > :first-child > :is(h1, h2, h3) {
  margin-bottom: 0;
  font-size: var(--teaching-face-prompt-heading);
  line-height: 1.1;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='prompt-action'] > :first-child > p {
  font-size: inherit;
  line-height: 1.18;
}

.teaching-face__stage[data-teaching-stage-composition='prompt-action'] > :last-child {
  min-height: clamp(44px, 3.3cqw, 54px);
  padding: var(--teaching-face-step-2) var(--teaching-face-step-4);
  font-size: var(--teaching-face-prompt-action);
}

/*
 * Semantic teaching compositions keep related material in one bounded cluster.
 * The lesson supplies roles; this shared owner supplies proportions. This keeps
 * a wide teaching form from turning one relationship into disconnected islands.
 */
.teaching-face .teaching-face__stage:is(
  [data-teaching-stage-composition='case-decision'],
  [data-teaching-stage-composition='evidence-action'],
  [data-teaching-stage-composition='model-decision'],
  [data-teaching-stage-composition='paired-cases'],
  [data-teaching-stage-composition='receipt-action']
) {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  padding: 3px clamp(16px, 4cqw, 55px);
  column-gap: clamp(13px, 1.8cqw, 26px);
  row-gap: var(--teaching-face-step-2);
  align-content: safe center;
  align-items: safe center;
  justify-content: stretch;
  justify-items: stretch;
}

.teaching-face .teaching-face__stage [data-teaching-role='teaching'],
.teaching-face .teaching-face__stage [data-teaching-role='evidence'],
.teaching-face .teaching-face__stage [data-teaching-role='decision'],
.teaching-face .teaching-face__stage [data-teaching-role='feedback'],
.teaching-face .teaching-face__stage [data-teaching-role='receipt'],
.teaching-face .teaching-face__stage [data-teaching-role='receipt-detail'] {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}

.teaching-face .teaching-face__stage [data-teaching-role='teaching'] {
  max-width: var(--teaching-face-reading-measure);
  text-align: left;
}

/* Long explanations retain their related object at the same reading origin.
 * The renderer declares content density; the shared owner supplies alignment. */
.teaching-face .teaching-face__stage[data-teaching-overflow='extended']:not([data-teaching-stage-composition='prompt-action']) {
  align-content: start;
  align-items: start;
}
.teaching-face .teaching-face__stage[data-teaching-overflow='extended']:not([data-teaching-stage-composition='prompt-action']) > [data-teaching-role] {
  align-self: start;
}

.teaching-face .teaching-face__stage [data-teaching-role='teaching'] > :is(h1, h2, h3) {
  margin-bottom: var(--teaching-face-step-2);
  font-size: var(--teaching-face-stage-heading);
  line-height: 1.16;
}

.teaching-face .teaching-face__stage [data-teaching-role='teaching'] > p {
  max-width: var(--teaching-face-reading-measure);
  font-size: var(--teaching-face-stage-body);
  line-height: 1.4;
}

.teaching-face .teaching-face__stage [data-teaching-role='evidence'] > p,
.teaching-face .teaching-face__stage [data-teaching-role='feedback'] {
  font-size: var(--teaching-face-stage-support);
  line-height: 1.34;
}

.teaching-face .teaching-face__stage [data-teaching-role='receipt-detail'] {
  font-size: var(--teaching-face-stage-support);
  line-height: 1.34;
}

.teaching-face .teaching-face__stage [data-teaching-role='evidence'],
.teaching-face .teaching-face__stage [data-teaching-role='feedback'] {
  padding: var(--teaching-face-step-3);
}

.teaching-face .teaching-face__stage [data-teaching-role='decision'] {
  display: grid;
  gap: var(--teaching-face-step-2);
  padding: var(--teaching-face-step-2) var(--teaching-face-step-3);
}

.teaching-face .teaching-face__stage [data-teaching-role='decision'] > legend {
  max-width: 66ch;
  padding-inline: var(--teaching-face-step-1);
  font-size: var(--teaching-face-stage-support);
  line-height: 1.25;
}

.teaching-face .teaching-face__stage [data-teaching-role='decision'] > label {
  min-height: clamp(32px, 2.7cqw, 42px);
  padding: var(--teaching-face-step-1) var(--teaching-face-step-2);
  font-size: var(--teaching-face-stage-support);
  line-height: 1.2;
}

.teaching-face .teaching-face__stage > [data-teaching-role='action'] {
  min-height: clamp(46px, 3.6cqw, 54px);
  padding: var(--teaching-face-step-2) var(--teaching-face-step-4);
  justify-self: center;
  font-size: var(--teaching-face-stage-action);
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='case-decision'] {
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  grid-template-rows: auto auto;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='case-decision'] > [data-teaching-role='teaching'] {
  grid-area: 1 / 1 / 3 / 2;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='case-decision'] > [data-teaching-role='evidence'] {
  grid-area: 1 / 2;
  align-self: end;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='case-decision'] > [data-teaching-role='decision'] {
  grid-area: 2 / 2;
  align-self: start;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='evidence-action'] {
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  grid-template-rows: auto auto;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='evidence-action'] > [data-teaching-role='teaching'] {
  grid-area: 1 / 1;
  align-self: end;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='evidence-action'] > [data-teaching-role='action'] {
  grid-area: 2 / 1;
  align-self: start;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='evidence-action'] > [data-teaching-role='evidence'] {
  grid-area: 1 / 2 / 3 / 3;
  align-self: center;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='model-decision'] {
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  grid-template-rows: auto auto;
  padding-block: 0;
  row-gap: var(--teaching-face-step-1);
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='model-decision'] > [data-teaching-role='teaching'] { grid-area: 1 / 1; }
.teaching-face .teaching-face__stage[data-teaching-stage-composition='model-decision'] > [data-teaching-role='feedback'] { grid-area: 2 / 1; }
.teaching-face .teaching-face__stage[data-teaching-stage-composition='model-decision'] > [data-teaching-role='decision'] { grid-area: 1 / 2; }
.teaching-face .teaching-face__stage[data-teaching-stage-composition='model-decision'] > [data-teaching-role='action'] { grid-area: 2 / 2; }

.teaching-face .teaching-face__stage[data-teaching-stage-composition='paired-cases'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  padding-block: 0;
  row-gap: 3px;
  align-items: stretch;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='paired-cases'] > :is(
  [data-teaching-role='teaching'],
  [data-teaching-role='feedback']
) {
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='paired-cases'] > [data-teaching-role='evidence'] {
  display: grid;
  padding: var(--teaching-face-step-1);
  align-content: start;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='paired-cases'] [data-teaching-role='decision'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px var(--teaching-face-step-1);
  align-self: end;
  margin-top: 3px;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='paired-cases'] [data-teaching-role='decision'] > legend {
  grid-column: 1 / -1;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='receipt-action'] {
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  grid-template-rows: auto auto auto;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='receipt-action'] > [data-teaching-role='teaching'] {
  grid-area: 1 / 1 / 4 / 2;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='receipt-action'] > [data-teaching-role='receipt'] {
  grid-area: 1 / 2;
  padding: var(--teaching-face-step-4) var(--teaching-face-step-4);
  padding-block: 22px;
  justify-self: center;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='receipt-action'] > [data-teaching-role='receipt-detail'] {
  grid-area: 2 / 2;
  text-align: center;
}

.teaching-face .teaching-face__stage[data-teaching-stage-composition='receipt-action'] > [data-teaching-role='action'] {
  grid-area: 3 / 2;
}

@container teaching-center (max-width: 600px) {
  .teaching-face .teaching-face__stage:is(
    [data-teaching-stage-composition='case-decision'],
    [data-teaching-stage-composition='evidence-action'],
    [data-teaching-stage-composition='model-decision'],
    [data-teaching-stage-composition='paired-cases'],
    [data-teaching-stage-composition='receipt-action']
  ) {
    padding: 3px var(--teaching-face-step-3);
    column-gap: var(--teaching-face-step-3);
    row-gap: 3px;
  }

  .teaching-face .teaching-face__stage:is(
    [data-teaching-stage-composition='case-decision'],
    [data-teaching-stage-composition='evidence-action'],
    [data-teaching-stage-composition='model-decision'],
    [data-teaching-stage-composition='receipt-action']
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teaching-face .teaching-face__stage[data-teaching-stage-composition='model-decision'] {
    row-gap: 0;
  }

  .teaching-face .teaching-face__stage [data-teaching-role='teaching'] > :is(h1, h2, h3) {
    margin-bottom: var(--teaching-face-step-1);
  }

  .teaching-face .teaching-face__stage [data-teaching-role='evidence'],
  .teaching-face .teaching-face__stage [data-teaching-role='feedback'] {
    padding: var(--teaching-face-step-1);
  }

  .teaching-face .teaching-face__stage [data-teaching-role='decision'] {
    gap: var(--teaching-face-step-1);
    padding: 3px var(--teaching-face-step-2);
  }

  .teaching-face .teaching-face__stage [data-teaching-role='decision'] > label {
    min-height: 28px;
    padding: 3px var(--teaching-face-step-1);
  }

  .teaching-face .teaching-face__stage > [data-teaching-role='action'] {
    min-height: 44px;
  }
}

.teaching-face__footer {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr minmax(0, 1fr) auto;
  gap: var(--teaching-face-step-3);
  min-height: 22px;
  align-items: center;
}

.teaching-face[data-teaching-form='case-trail'] .teaching-face__route--orbit { display: none; }
.teaching-face[data-teaching-form='case-trail'] .teaching-face__route--trail { display: block; }

.teaching-face[data-teaching-form='case-trail'] .teaching-face__center {
  top: 16.75%;
  left: 3%;
  width: 65.5%;
  height: 66.5%;
}

.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoints {
  top: 4%;
  right: 2.5%;
  bottom: 4%;
  left: 72%;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: var(--teaching-face-step-1);
}

.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint:nth-child(n) {
  grid-area: auto;
  justify-content: stretch;
}

.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-button {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 2px var(--teaching-face-step-2);
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 4px var(--teaching-face-step-2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-button::after { display: none; }
.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-number {
  grid-row: 1 / 3;
  width: 23px;
  height: 23px;
}
.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-copy { grid-area: 1 / 2; }
.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-status { grid-area: 2 / 2; }
.teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-heading { font-size: clamp(10px, 0.72cqw, 12px); }

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__route--orbit,
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__route--trail { display: none; }
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__route--bench { display: block; }

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__map {
  background:
    linear-gradient(to bottom, transparent 74%, rgba(239, 114, 90, 0.07) 74%, rgba(239, 114, 90, 0.07) 95%, transparent 95%),
    radial-gradient(circle at 50% 36%, rgba(48, 130, 119, 0.18), transparent 33%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 22px 22px,
    var(--teaching-face-board);
}

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__center {
  top: 4%;
  left: 6%;
  width: 88%;
  height: 66%;
}

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoints {
  top: 76%;
  right: 3%;
  bottom: 5%;
  left: 3%;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: 1fr;
  gap: var(--teaching-face-step-2);
}

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint:nth-child(n) {
  grid-area: auto;
  justify-content: stretch;
}

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-button {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: center;
  width: 100%;
  height: 100%;
  max-height: 112px;
  min-height: 0;
  padding: var(--teaching-face-step-1);
  border-bottom: 1px solid var(--teaching-face-stroke-quiet);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
}

.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-button::after { display: none; }
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint[data-state='current'] .teaching-face__checkpoint-button { transform: translateY(-5px); }
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-number {
  position: absolute;
  top: var(--teaching-face-step-1);
  left: var(--teaching-face-step-1);
  width: 25px;
  height: 25px;
}
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-copy { gap: 2px; }
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-beat {
  min-height: 25px;
  padding-left: 30px;
  font-size: clamp(9px, 0.5cqw, 10px);
}
.teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-heading { font-size: clamp(10px, 0.64cqw, 11px); }

/*
 * A short desktop must spend its available width on the lesson, not preserve
 * an aspect ratio by shrinking the entire map. The form geometry remains
 * percentage-based, so widening this canvas enlarges the dossier and keeps
 * the checkpoint relationships intact.
 */
@media (min-width: 901px) and (max-height: 760px) {
  .teaching-face__map {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .teaching-face__center {
    top: 6%;
    left: 17%;
    width: 66%;
    height: 88%;
  }

  .teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__center {
    /* Keep the reviewable checkpoint row, which starts at 76%, unobstructed. */
    height: 70%;
  }

  .teaching-face__center-header {
    box-sizing: border-box;
    min-height: 44px;
    padding: 4px var(--teaching-face-step-2);
  }

  .teaching-face__presentation-switcher {
    box-sizing: border-box;
    min-height: 36px;
    padding: 3px var(--teaching-face-step-2);
  }

  .teaching-face__presentation-option {
    min-height: 28px;
  }

  .teaching-face__mode-copy strong {
    font-size: 9px;
    white-space: nowrap;
  }

  .teaching-face__mode-copy span {
    display: none;
  }

  .teaching-face[data-teaching-form='fibonacci-dossier'] .i01-lesson__clue--one,
  .teaching-face[data-teaching-form='fibonacci-dossier'] .i01-lesson__clue--two {
    top: 6%;
  }

  .teaching-face[data-teaching-form='fibonacci-dossier'] .i01-lesson__clue--three {
    bottom: 6%;
  }
}

@media (max-height: 620px), (max-width: 1000px) {
  .planning-canvas--lesson,
  .planning-canvas--lesson .planning-canvas__paper,
  .planning-canvas__content-layer[data-curriculum-lesson-open='true'],
  .planning-canvas__content-layer[data-curriculum-lesson-open='true'] > #planningGoals {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .teaching-face {
    width: 100%;
    height: auto;
    min-height: 760px;
    overflow: visible;
  }

  .teaching-face__header { grid-template-columns: 1fr auto; }
  .teaching-face__identity,
  .teaching-face__question,
  .teaching-face__controls,
  .teaching-face__phase,
  .teaching-face__progress { grid-area: auto; }
  .teaching-face__question { border-top: 1px solid rgba(170, 198, 188, 0.25); border-left: 0; padding: var(--teaching-face-step-2) 0 0; }
  .teaching-face__controls,
  .teaching-face__progress { grid-column: 1 / -1; }
  .teaching-face__map { min-height: 610px; }
}

/* The application rail remains an independent surface. At owner-frame widths,
 * reserve its physical lane so lesson controls and stops never sit beneath it. */
@media (min-width: 501px) and (max-width: 1120px) {
  .teaching-face {
    padding-right: calc(var(--teaching-face-step-3) + var(--bs-bento-rail-width, 52px) + 34px);
  }
}

@media (max-width: 1000px) {
  .teaching-face { min-height: 0; }

  .teaching-face__map {
    display: flex;
    width: 100%;
    max-height: none;
    aspect-ratio: auto;
    min-height: 0;
    flex-direction: column;
    gap: var(--teaching-face-step-3);
    padding: var(--teaching-face-step-3);
    overflow: visible;
  }

  .teaching-face__route { display: none !important; }

  .teaching-face__center,
  .teaching-face[data-teaching-form='case-trail'] .teaching-face__center,
  .teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__center {
    position: relative;
    inset: auto;
    order: 0;
    width: 100%;
    height: auto;
    min-height: 540px;
    border-radius: 12px;
  }

  .teaching-face .teaching-face__stage:is(
    [data-teaching-stage-composition='case-decision'],
    [data-teaching-stage-composition='evidence-action'],
    [data-teaching-stage-composition='model-decision'],
    [data-teaching-stage-composition='paired-cases'],
    [data-teaching-stage-composition='receipt-action']
  ) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    padding-inline: var(--teaching-face-step-4);
    align-content: start;
  }

  .teaching-face .teaching-face__stage:is(
    [data-teaching-stage-composition='case-decision'],
    [data-teaching-stage-composition='evidence-action'],
    [data-teaching-stage-composition='model-decision'],
    [data-teaching-stage-composition='paired-cases'],
    [data-teaching-stage-composition='receipt-action']
  ) > [data-teaching-role] {
    grid-area: auto;
    grid-column: auto;
    align-self: auto;
  }

  .teaching-face__checkpoints,
  .teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoints,
  .teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoints {
    position: relative;
    inset: auto;
    order: 1;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: var(--teaching-face-step-2);
  }

  .teaching-face__checkpoint:nth-child(n),
  .teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint:nth-child(n),
  .teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint:nth-child(n) {
    grid-area: auto;
  }

  .teaching-face__checkpoint-button,
  .teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoint-button,
  .teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoint-button {
    width: 100%;
    min-height: 58px;
    height: auto;
  }

  .teaching-face .teaching-face__checkpoint:nth-child(4) .teaching-face__checkpoint-button,
  .teaching-face .teaching-face__checkpoint:nth-child(8) .teaching-face__checkpoint-button {
    width: 100%;
  }

  .teaching-face__center-header { grid-template-columns: 1fr; }
  .teaching-face__center-title { padding: 7px 0 0; border-top: 1px solid rgba(23, 50, 53, 0.24); border-left: 0; }
  .teaching-face__presentation-switcher { grid-template-columns: 1fr; }
  .teaching-face__journey { justify-self: center; }
  .teaching-face__footer { grid-template-columns: 1fr; padding-bottom: var(--teaching-face-step-2); }
}

/* Standalone hosts have no application rail. Their short dossier keeps the
 * perimeter stops clear; compact documents grow naturally with their prose. */
.teaching-face[data-teaching-host='standalone'] { padding-right: var(--teaching-face-step-3); }
@media (min-width: 1001px) and (max-height: 760px) {
  .teaching-face[data-teaching-host='standalone'][data-teaching-form='fibonacci-dossier'] .teaching-face__center { top: 18.75%; height: 62.5%; }
}
@media (max-width: 1000px) {
  .teaching-face[data-teaching-host='standalone'] { display: flex; flex-direction: column; gap: var(--teaching-face-step-3); }
  .teaching-face[data-teaching-host='standalone'] .teaching-face__map { height: auto; align-self: stretch; }
  .teaching-face[data-teaching-host='standalone'] .teaching-face__center { height: auto; min-height: 0; grid-template-rows: auto auto auto auto; }
  .teaching-face[data-teaching-host='standalone'] .teaching-face__stage { height: auto; min-height: 0; overflow: visible; }
  .teaching-face[data-teaching-host='standalone'] .teaching-face__stage[data-teaching-stage-composition='prompt-action'] { gap: var(--teaching-face-step-4); grid-template-rows: auto auto; }
}

@media (max-width: 500px) {
  .teaching-face__presentation-options { grid-template-columns: 1fr; }
  .teaching-face__checkpoints,
  .teaching-face[data-teaching-form='case-trail'] .teaching-face__checkpoints,
  .teaching-face[data-teaching-form='sightline-workbench'] .teaching-face__checkpoints { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .teaching-face *,
  .teaching-face *::before,
  .teaching-face *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .teaching-face__route-progress-segment.is-advancing { animation: none; }
}

@media (forced-colors: active) {
  .teaching-face,
  .teaching-face__center,
  .teaching-face__checkpoint-button,
  .teaching-face__presentation-option,
  .teaching-face__journey { forced-color-adjust: auto; }

  .teaching-face__route-entry,
  .teaching-face__route-segment,
  .teaching-face__route-progress-segment,
  .teaching-face__route-origin path,
  .teaching-face__route-origin circle,
  .teaching-face__route-destination circle { stroke: CanvasText; }

  .teaching-face__route marker path,
  .teaching-face__route-destination circle:last-child { fill: CanvasText; }
  .teaching-face__checkpoint[data-state='current'] .teaching-face__checkpoint-button { outline: 4px solid Highlight; }
}
