.teacher-view {
  --teacher-cream: #f7f6ef;
  --teacher-forest: #182e28;
  --teacher-ink: #22342c;
  --teacher-muted: #465c51;
  --teacher-gold: #85662f;
  --teacher-line: #d4d9cf;
  background: #eceee7;
  min-height: 100dvh;
}
.teacher-header {
  max-width: 92rem;
  padding: 1.2rem clamp(.85rem,3vw,2.5rem) 1rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.teacher-heading a { color: #345247; text-underline-offset: .22rem; font-size: .94rem; }
.teacher-heading h1 { font-size: clamp(1.23rem,2.3vw,1.65rem); margin-top: .28rem; }
.teacher-heading h1 span { font-weight: 560; font-size: .73em; color: #52645b; margin-left: .35rem; white-space: nowrap; }
.teacher-downloads { display: flex; flex-wrap: wrap; gap: .42rem; flex-shrink: 0; }
.deck-shell { max-width: 92rem; padding: 0 clamp(.85rem,3vw,2.5rem) 1.65rem; margin: 0 auto; }
.deck-stage { container-type: inline-size; min-width: 0; }
@media (min-width: 741px) {
  .deck-shell { --normal-stage-width: min(100%, max(42rem, calc((100dvh - 10rem) * 1.77778))); }
  .deck-shell.has-timer { --normal-stage-width: min(100%, max(42rem, calc((100dvh - 13.5rem) * 1.77778))); }
  .deck-stage, .deck-controls, .deck-timer, #teacher-notes { max-width: var(--normal-stage-width); margin-left: auto; margin-right: auto; }
}
.deck-frame {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  min-height: max(25rem, min(43rem, 45cqw));
  border-radius: .62rem;
  border: 1px solid #d2d9cf;
  margin-bottom: .65rem;
  padding: 3.3cqw 4.35cqw 2.25cqw;
  display: flex;
  flex-direction: column;
  background: var(--teacher-cream);
  color: var(--teacher-ink);
  box-shadow: 0 .65rem 1.7rem #243a2b10;
}
.frame-head { margin-bottom: 2.1cqw; }
.frame-meta {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: .62rem; font-size: clamp(.8rem,1.65cqw,1.3rem); font-weight: 780;
  letter-spacing: .018em; color: var(--teacher-gold);
  margin-bottom: .85cqw; line-height: 1.4;
}
.frame-head h2 { font-size: clamp(1.8rem,4.38cqw,3.9rem); line-height: 1.19; letter-spacing: -.055em; }
.frame-intro { font-size: clamp(1rem,2.03cqw,1.75rem); color: var(--teacher-muted); line-height: 1.55; margin-bottom: 1.25cqw; }
.frame-body { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; }
.deck-cards { display: grid; align-items: stretch; gap: 1.25cqw; width: 100%; }
.deck-cards.count-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.deck-cards.count-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.deck-cards.count-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.deck-card {
  padding: 1.65cqw 1.8cqw;
  background: #e9eee5;
  border-radius: .46rem;
  border-top: 3px solid #759383;
  min-width: 0;
}
.deck-card h3 { color: #395e4f; font-size: clamp(.97rem,1.93cqw,1.75rem); margin: 0 0 .58cqw; }
.deck-card p { font-size: clamp(1.045rem,2.24cqw,2rem); font-weight: 550; line-height: 1.48; }
.frame-prompt {
  font-size: clamp(1.04rem,2.07cqw,1.8rem); font-weight: 760;
  color: #243e34; border-left: 3px solid #a78349; background: #eee9da;
  padding: .92cqw 1.25cqw; margin: 1.65cqw 0 1.35cqw; border-radius: .1rem .28rem .28rem .1rem;
}
.frame-footer {
  margin-top: auto; color: #526159; display: flex; justify-content: space-between;
  gap: .55rem; align-items: flex-end; border-top: 1px solid var(--teacher-line);
  padding-top: .65cqw; font-size: clamp(.69rem,1.14cqw,1rem); line-height: 1.4;
}
.frame-footer > :last-child { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.frame-footer a { text-underline-offset: .14rem; }
.frame-cover {
  background: var(--teacher-forest); color: #fff9e9; justify-content: center;
  border: 1px solid #203c31;
}
.frame-cover::before {
  position: absolute; content: ""; z-index: -1; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg,#172e29 0%,#172e29 35%,#172e29e8 52%,#172e2945 100%),
    url("archive.jpg") right 52% / auto 115% no-repeat;
}
.frame-cover .frame-head { margin-bottom: 1.65cqw; }
.frame-cover .frame-meta { color: #ebcd92; }
.frame-cover .frame-head h2 { width: 88%; font-size: clamp(2rem,5.25cqw,4.7rem); margin-top: 6.8cqw; }
.frame-question { font-family: var(--serif); font-size: clamp(1.35rem,3.03cqw,2.7rem); line-height: 1.34; font-weight: 700; letter-spacing: -.05em; max-width: 81%; }
.frame-goal { color: #f1eedf; font-size: clamp(1rem,2.02cqw,1.73rem); margin: 1.45cqw 0 1.5cqw; max-width: 74%; }
.frame-cover .frame-footer { color: #efe8d2; border-top-color: #d3d9c064; }
.frame-media .frame-body { display: grid; grid-template-columns: minmax(0,1.62fr) minmax(0,1fr); gap: 1.6cqw; align-items: center; }
.frame-media .deck-cards { grid-template-columns: 1fr; }
.frame-media .deck-card { padding: 1.15cqw 1.35cqw; }
.frame-media .deck-card p { font-size: clamp(1rem,1.98cqw,1.75rem); }
.deck-media { margin: 0; }
.deck-media img { display: block; width: 100%; max-height: 30cqw; object-fit: contain; background: #eaece5; border-radius: .45rem; }
.frame-media .frame-body:has(> .deck-media:only-child) { grid-template-columns: minmax(0,1fr); }
@media (min-width: 741px), print {
  .frame-media .frame-intro + .frame-body .deck-media img { max-height: 23cqw; }
  .frame-media .deck-media:only-child img { max-height: 35cqw; }
}
.frame-timeline .deck-card { border-top-color: #b18746; }
.frame-timeline .deck-card h3 { color: #6d5226; }
.frame-close .deck-card { background: #e9eee5; }
.frame-close .frame-prompt { color: #fafffa; background: #315447; border-left-color: #d5ac67; }
.frame-specimen .frame-intro {
  font-family: var(--serif); color: #243e34; font-size: clamp(1.6rem,4.2cqw,3.55rem);
  font-weight: 720; margin: 1.5cqw 0 0; padding: 1.15cqw 2.4cqw 0; background: #edf0e8; border-radius: .45rem .45rem 0 0;
}
.frame-specimen .frame-body { align-items: flex-start; }
.frame-specimen .deck-card { background: #edf0e8; border: none; padding: 1.05cqw 2.4cqw 2.4cqw; border-radius: 0 0 .45rem .45rem; }
.frame-specimen .deck-card h3 { font-size: clamp(.9rem,1.55cqw,1.3rem); }
.frame-specimen .deck-card p { font-size: clamp(1.15rem,2.9cqw,2.55rem); }
.frame-schedule .deck-cards { grid-template-columns: 1fr; gap: .7cqw; }
.frame-schedule .deck-card { display: grid; grid-template-columns: 2.7cqw 1fr; gap: 1.25cqw; align-items: center; background: #e9eee5; border: 0; padding: .85cqw 1.45cqw; }
.frame-schedule .deck-card h3 { font-variant-numeric: tabular-nums; margin: 0; color: #725532; }
.frame-schedule .deck-card p { font-size: clamp(1.21rem,2.95cqw,2.45rem); font-weight: 760; }
.deck-controls, .deck-timer, #teacher-notes {
  background: #fffefa; border: 1px solid var(--teacher-line); border-radius: .48rem; padding: .6rem .78rem;
}
.deck-controls, .deck-navigation, .deck-tools, .deck-timer { display: flex; align-items: center; flex-wrap: wrap; gap: .38rem; }
.deck-controls { justify-content: space-between; gap: .55rem; }
.deck-controls button, .deck-controls select, .deck-timer button {
  color: #213a31; background: #f5f6ed; border: 1px solid #c8d2c4; border-radius: .32rem; padding: .39rem .58rem; min-height: 2.5rem;
  font-size: .88rem; font-weight: 720;
}
.deck-controls button:hover:not(:disabled), .deck-timer button:hover:not(:disabled) { background: #e3ebe0; }
.deck-controls button:disabled, .deck-timer button:disabled { opacity: .56; cursor: default; }
.deck-controls select { max-width: 12.7rem; }
.deck-controls [data-move="1"] { color: white; background: #315447; border-color: #315447; }
.deck-controls [data-move="1"]:hover:not(:disabled) { background: #436757; }
.deck-timer { margin-top: .5rem; }
.timer-title { font-weight: 730; color: #365548; }
.deck-timer output { font-size: 1.74rem; font-weight: 820; color: #253d34; min-width: 3.8rem; padding: 0 .35rem; font-variant-numeric: tabular-nums; }
.deck-timer.timed-out output { color: #8c3c29; }
#teacher-notes { margin-top: .5rem; padding: .8rem 1rem; color: #385346; }
.frame-notes .teaching-cues { margin-bottom: .65rem; }
.frame-notes ul { margin: .4rem 0 0; padding: 0; display: flex; gap: .4rem .9rem; flex-wrap: wrap; list-style: none; }
.frame-notes a { color: #315849; text-underline-offset: .16rem; font-weight: 650; }
.deck-shell:fullscreen, .wide-mode .deck-shell {
  background: #101d18; padding: .45rem;
  max-width: none; margin: 0;
  width: 100%; height: 100%; overflow: auto;
}
.deck-shell:fullscreen .deck-stage, .wide-mode .deck-stage {
  max-width: min(100%,calc((100dvh - 4.4rem) * 1.77778)); margin: auto;
}
.deck-shell:fullscreen.has-timer .deck-stage, .wide-mode .deck-shell.has-timer .deck-stage {
  max-width: min(100%,calc((100dvh - 8.75rem) * 1.77778));
}
.deck-shell:fullscreen .deck-frame, .wide-mode .deck-frame { min-height: 0; box-shadow: none; margin-bottom: .36rem; }
.deck-shell:fullscreen .deck-controls, .deck-shell:fullscreen .deck-timer, .wide-mode .deck-controls, .wide-mode .deck-timer { margin-left: auto; margin-right: auto; max-width: 65rem; }
.wide-mode .deck-shell { position: fixed; inset: 0; z-index: 10; }
.deck-shell:fullscreen #teacher-notes, .wide-mode #teacher-notes, .deck-shell:fullscreen [data-notes-toggle], .wide-mode [data-notes-toggle] { display: none; }
.noscript-guide { margin: .5rem 1rem; color: #455d50; }

@media (max-width: 740px) {
  .teacher-header { flex-wrap: wrap; gap: .65rem; padding-top: .85rem; }
  .teacher-downloads .button { min-height: 2.35rem; font-size: .82rem; padding: .37rem .56rem; }
  .teacher-heading h1 span { margin-left: .2rem; }
  .deck-frame { aspect-ratio: auto; min-height: 24rem; padding: .95rem .95rem .75rem; }
  .frame-head { margin-bottom: .7rem; }
  .frame-meta { margin-bottom: .47rem; }
  .frame-head h2 { font-size: clamp(1.58rem,5.35vw,2.9rem); }
  .frame-cover::before { background-position: center, 76% center; background-size: 100% 100%, cover; }
  .frame-cover .frame-head h2 { width: auto; margin-top: 1.45rem; }
  .frame-question, .frame-goal { max-width: 95%; }
  .frame-goal { margin: .62rem 0 .9rem; }
  .deck-cards, .frame-media .frame-body { gap: .55rem; }
  .deck-cards.count-3, .deck-cards.count-4, .frame-media .frame-body { grid-template-columns: 1fr; }
  .deck-card, .frame-media .deck-card, .frame-schedule .deck-card { padding: .55rem .64rem; }
  .frame-schedule .deck-card { grid-template-columns: 1.1rem 1fr; gap: .5rem; }
  .frame-media .deck-media img { max-height: 16rem; }
  .frame-prompt { padding: .48rem .55rem; margin: .64rem 0; }
  .frame-footer { padding-top: .36rem; }
  .deck-shell:fullscreen .deck-stage, .wide-mode .deck-stage, .deck-shell:fullscreen.has-timer .deck-stage, .wide-mode .deck-shell.has-timer .deck-stage { max-width: 100%; }
  .deck-controls select { max-width: 9.4rem; }
  .deck-timer { padding: .4rem; }
}
@media (max-width: 480px) {
  .deck-cards.count-2 { grid-template-columns: 1fr; }
  .deck-controls button, .deck-controls select, .deck-timer button { padding-inline: .43rem; }
}
@media print {
  @page { size: 338.67mm 190.5mm; margin: 0; }
  html, body.teacher-view { margin: 0; padding: 0; background: transparent; min-height: 0; }
  .teacher-header, .deck-controls, .deck-timer, #teacher-notes, .noscript-guide, .skip { display: none !important; }
  .deck-shell { margin: 0; padding: 0; max-width: none; width: 100%; }
  .deck-stage { max-width: none !important; width: 100%; }
  .deck-frame[hidden] { display: flex !important; }
  .deck-frame {
    width: 100vw; height: 100vh; min-height: 0; margin: 0;
    border: 0; border-radius: 0; box-shadow: none;
    break-inside: avoid; break-after: page;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .deck-frame:last-child { break-after: auto; }
}
