/* First-lesson candidate: the shared lesson layout, without changing other lessons. */
.v2-board { container-type:size; }
/* Count the complete group height so stacked tens cannot overlap the number. */
.v2-visual > .v2-model { max-height:none; }
.v2-reading-coach { display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;min-height:0; }
.v2-reading-path { display:grid;grid-template-columns:minmax(0,1fr) clamp(38px,8cqw,64px) minmax(0,1fr);grid-template-rows:auto minmax(2.8em,auto);align-items:center;justify-items:center;gap:12px 4px;width:100%;max-width:620px; }
.v2-path-left { grid-column:1; }
.v2-path-right { grid-column:3; }
.v2-path-number { grid-row:1;min-width:0;width:100%;padding:12px 2px;border:2px solid #d8c7ac;border-radius:16px;background:#fffaf1;color:#155e65;text-align:center;font:800 clamp(32px,9cqw,64px)/1.15 system-ui; }
.v2-path-number.is-focus { border-color:#e2a540;background:#fff0c9; }
.v2-path-word { grid-row:2;text-align:center;font-size:clamp(16px,3.3cqw,23px);line-height:1.35;overflow-wrap:normal; }
.v2-path-bin { grid-area:2/2;padding:7px 6px;border-radius:10px;background:#ffe0a0;color:#80530b;font-size:clamp(17px,3.4cqw,24px); }
.v2-reading-path [hidden] { display:block;visibility:hidden; }
.v2-reading-coach[data-read-part="groups"] .v2-reading-path { grid-template-rows:auto; }
.v2-reading-coach[data-read-part="groups"] .v2-reading-path [hidden] { display:none; }
.v2-coach-parts { display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%;align-items:stretch; }
.v2-coach-parts > section { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;padding:8px;border:2px solid transparent;border-radius:16px; }
.v2-reading-coach[data-read-part="left"] .v2-coach-left,
.v2-reading-coach[data-read-part="bin"] .v2-coach-left,
.v2-reading-coach[data-read-part="right"] .v2-coach-right { border-color:#dda44c;background:#fff4db; }
.v2-coach-cabinets { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px; }
.v2-coach-cabinets .v2-unit img,.v2-coach-bin-count .v2-unit img { width:auto;height:min(80px,15cqh);max-width:100%;object-fit:contain; }
.v2-coach-cabinets .v2-unit,.v2-coach-bin-count .v2-unit { min-width:44px; }
.v2-coach-bin-count { display:flex;align-items:center;gap:12px; }
.v2-coach-bin-count > strong { font:800 clamp(28px,6cqw,44px)/1.2 system-ui; }
.v2-coach-bin-count small { display:block;font-size:15px;font-weight:650; }
.v2-reading-coach .v2-model { max-height:none;gap:5px;align-items:flex-end; }
.v2-reading-coach .v2-group { gap:4px; }
.v2-reading-coach .v2-group-label { display:none; }
.v2-reading-coach .v2-objects { min-height:0;gap:3px; }
.v2-reading-coach .v2-group[data-unit="100"] .v2-object { flex-basis:40px; }
.v2-reading-coach .v2-group[data-unit="10"] .v2-object { max-width:32px; }
.v2-reading-coach .v2-group[data-unit="1"] .v2-object { flex-basis:18px;max-width:18px; }
.v2-reading-coach .v2-empty { padding:5px;font-size:12px; }
.v2-coach-words { display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px 8px;min-height:1.5em;font-size:clamp(16px,3.3cqw,23px);line-height:1.35; }
.v2-coach-words [hidden] { display:none; }
.v2-coach-words b { border-radius:6px;padding:2px 7px;color:#80530b;background:#ffe0a0; }
.v2-thousand-unit { display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:center;width:100%;max-width:620px; }
.v2-hundred-crates { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px 7px; }
.v2-hundred-crates .v2-unit img { height:auto;max-height:20cqh;object-fit:contain; }
.v2-thousand-unit.is-grouped { grid-template-columns:minmax(0,3fr) minmax(0,1fr); }
.v2-thousand-unit > strong { grid-column:1/-1;text-align:center;font-size:clamp(16px,3cqw,22px); }
.v2-thousand-equivalent { display:flex;align-items:center;gap:8px; }
.v2-thousand-equivalent[hidden] { display:none; }
.v2-thousand-equivalent > span { font-size:28px; }
.v2-thousand-equivalent .v2-unit img { width:100%;height:auto;max-height:40cqh;object-fit:contain; }
@container (min-width:501px) {
  .v2-visual > .v2-model:has([data-unit="1000"]) .v2-group[data-unit="10"] .v2-object {
    max-width:min(100px,14cqh);
  }
}
.lesson-shell[data-grade="4"].grade4-read-write-shell .teacher-bubble {
  font-size:14px !important;
  line-height:1.4 !important;
}
.lesson-shell[data-grade="4"].grade4-read-write-shell #lesson-footer .phase-button {
  margin-left:auto;
}
.lesson-shell[data-grade="4"].grade4-read-write-shell .v2-group-label {
  font-size:12.5px;
}
.v2-entry:focus-visible {
  outline:3px solid #e9a13c;
  outline-offset:2px;
}
@media (max-width:720px) {
  .lesson-shell[data-grade="4"].grade4-read-write-shell .teacher-classroom {
    padding-bottom:8px !important;
  }
  /* The inherited sticky offset remains active after the teacher becomes relative. */
  .lesson-shell[data-grade="4"].grade4-read-write-shell .lesson-teacher {
    top:0 !important;
  }
  .lesson-shell[data-grade="4"].grade4-read-write-shell #lesson-support-dock,
  .lesson-shell[data-grade="4"].grade4-read-write-shell #lesson-support-dock button {
    overflow:visible !important;
  }
}
@media (max-width:720px) and (max-height:740px) {
  .lesson-shell[data-grade="4"].grade4-read-write-shell .teacher-bubble {
    min-height:48px !important;
    max-height:48px !important;
  }
  .lesson-shell[data-grade="4"].grade4-read-write-shell .lesson-avatar {
    height:96px !important;
  }
  .lesson-shell[data-grade="4"].grade4-read-write-shell .v2-keypad {
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:5px;
  }
  .lesson-shell[data-grade="4"].grade4-read-write-shell .v2-keypad :is([data-erase],[data-check]) {
    grid-column:auto;
    font-size:12.5px;
    padding:3px;
  }
}
@container (max-height:320px) {
  .v2-reading-path { gap:8px 4px; }
  .v2-path-number { padding:6px 2px;font-size:32px; }
  .v2-path-word { font-size:16px; }
  .v2-reading-coach { gap:5px; }
  .v2-reading-coach .v2-record { padding:3px 8px; }
  .v2-coach-parts { gap:5px; }
  .v2-coach-parts > section { padding:3px;gap:4px; }
  .v2-reading-coach .v2-group[data-unit="10"] .v2-object { max-width:24px; }
  .v2-reading-coach .v2-group[data-unit="100"] .v2-object { flex-basis:28px; }
  .v2-coach-words { font-size:15px; }
  .v2-scene:not(.v2-city-intro) { padding:8px; }
  .v2-visual { gap:7px; }
  .v2-visual > .v2-model .v2-group[data-unit="1000"] .v2-object { flex-basis:38px; }
  .v2-visual > .v2-model:has(.v2-group:nth-child(2)) .v2-group[data-unit="1000"] .v2-object { flex-basis:38px; }
  .v2-visual > .v2-model .v2-group[data-unit="100"] .v2-object { flex-basis:50px; }
  .v2-visual > .v2-model .v2-group[data-unit="10"] .v2-object { flex-basis:24px;max-width:24px; }
  .v2-visual > .v2-model .v2-group[data-unit="10"] .v2-objects { flex-direction:row;align-items:flex-end; }
  .v2-visual > .v2-model .v2-group[data-unit="1"] .v2-object { flex-basis:20px;max-width:20px; }
  .v2-question > .v2-model { gap:4px; }
  .v2-question > .v2-model .v2-group { gap:4px; }
  .v2-question > .v2-model:has(.v2-group:nth-child(2)) .v2-group[data-unit="1000"] .v2-object { flex-basis:32px; }
  .v2-question > .v2-model .v2-group[data-unit="100"] .v2-object { flex-basis:30px; }
  .v2-visual > .v2-model > .v2-group[data-unit="1000"]:only-child .v2-object { flex-basis:min(85px,28cqh); }
  .v2-visual > .v2-model > .v2-group[data-unit="1000"]:only-child .v2-object:only-child { flex-basis:min(85px,28cqh); }
  .v2-visual > .v2-model > .v2-group[data-unit="100"]:only-child .v2-object { flex-basis:min(130px,45cqh); }
  .v2-visual > .v2-model .v2-objects { min-height:0; }
  .v2-number { font-size:36px; }
  .v2-record { padding:6px 12px; }
  .v2-counting { width:min(88%,65cqh);padding:6px;gap:6px; }
  .v2-spoken { font-size:20px; }
  .v2-entry { font-size:32px; }
  .v2-caption { margin-top:5px;padding-top:5px;min-height:0; }
  .v2-reading { font-size:18px;margin-top:5px; }
  .v2-scene[data-v2-phase="21"] .v2-visual { gap:6px; }
  .v2-scene[data-v2-phase="21"] .v2-visual > p { margin:0;line-height:1.3;font-size:14px; }
  .v2-scene[data-v2-phase="21"] h2 { font-size:21px; }
  .v2-scene[data-v2-phase="21"] .v2-summary-count { padding:5px 8px; }
}
