/* Drawing styles share the whiteboard marker palette and native classroom controls. */
.lesson-diagram .ld-label,
.lesson-diagram .ld-value,
.lesson-diagram .ld-node,
.lesson-diagram .ld-chance {
  fill:var(--marker);font-size:22px;font-weight:700;
  paint-order:stroke;stroke:var(--board,#fff);stroke-linejoin:round;stroke-width:5px;
}
.lesson-diagram .ld-label {font-size:19px}
.lesson-diagram .ld-chance {font-size:18px}
.lesson-diagram .ld-focus-label {fill:var(--marker-blue);text-decoration:underline}
.ld-curve {fill:none;stroke:var(--marker-blue);stroke-linecap:round;stroke-width:4px}
.lesson-diagram .ld-dot {fill:var(--marker-red);stroke:var(--board,#fff);stroke-width:2px}
.lesson-diagram .ld-dot.ld-focus {fill:var(--marker-blue);stroke:var(--marker);stroke-width:2px}
.lesson-diagram .ld-circle,
.lesson-diagram .ld-universe {fill:none;stroke:var(--marker);stroke-width:2px}
.lesson-diagram .ld-chord,
.lesson-diagram .ld-radius,
.lesson-diagram .ld-tangent,
.lesson-diagram .ld-mark,
.lesson-diagram .ld-angle,
.lesson-diagram .ld-branch {fill:none;stroke-linecap:round;stroke-width:2.5px}
.lesson-diagram .ld-chord,
.lesson-diagram .ld-mark {stroke:var(--marker)}
.lesson-diagram .ld-radius {stroke:var(--marker-red)}
.lesson-diagram .ld-tangent,
.lesson-diagram .ld-angle,
.lesson-diagram .ld-on-branch {stroke:var(--marker-blue)}
.lesson-diagram .ld-angle-1 {stroke:var(--marker-red);stroke-dasharray:4 3}
.lesson-diagram .ld-branch {stroke:var(--marker)}
.lesson-diagram .ld-branch.ld-on-branch {stroke:var(--marker-blue);stroke-width:5px}
.lesson-diagram .ld-set {fill-opacity:.10;stroke-width:2.5px}
.lesson-diagram .ld-set-a {fill:var(--marker-blue);stroke:var(--marker-blue)}
.lesson-diagram .ld-set-b {fill:var(--marker-red);stroke:var(--marker-red);stroke-dasharray:7 4}
.lesson-diagram .ld-set-c {fill:var(--marker-green);stroke:var(--marker-green);stroke-dasharray:2 4}

.ld-object-model {width:min(100%,440px);margin:0 auto}
.ld-groups {display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:12px}
.ld-group {
  min-width:0;padding:10px;border:2px solid var(--line-strong,#C9D2E3);
  border-radius:14px;text-align:center;
}
.ld-group-label {font:700 20px/1.35 var(--hand)}
.ld-group ul {
  min-height:64px;margin:8px 0 0;padding:0;list-style:none;display:flex;
  flex-wrap:wrap;align-content:center;justify-content:center;gap:8px;
}
.ld-object {
  width:24px;height:24px;border:2px solid var(--marker-blue);border-radius:50%;
  background:color-mix(in srgb,var(--marker-blue) 22%,transparent);
}
.ld-object[data-object="top"] {border-style:dashed;box-shadow:inset 0 0 0 3px var(--board,#fff)}
.ld-object[data-object="block"] {border-radius:4px}
.ld-object[data-object="seed"] {width:16px;height:22px;border-radius:70% 35% 70% 40%}
.ld-move {margin-top:10px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ld-move-status {font:600 16px/1.35 var(--hand);color:var(--marker)}

body.lesson .board:has(#quiz:not([hidden])) .board-visual:has(.plot-grid) {max-width:520px}
body.lesson .board:has(#quiz:not([hidden])) .plot-grid svg {height:auto;max-height:unset}
.plot-grid .pt-hit {fill:transparent;stroke:none}
.plot-grid .pt-hit:hover {fill:var(--marker-blue);fill-opacity:.11}
.plot-grid .plot-guide {fill:var(--marker-blue);fill-opacity:.14;pointer-events:none}
.plot-grid .plot-point {fill:var(--marker-red);stroke:var(--board,#fff);stroke-width:2px}
.plot-grid .plot-expected {fill:none;stroke:var(--marker-green);stroke-width:4px;stroke-dasharray:4 2}
.plot-grid .plot-join {fill:none;stroke:var(--marker-blue);stroke-width:5px;stroke-linejoin:round}
.plot-status {min-height:1.35em;margin:5px 0 0;font:600 16px/1.35 var(--hand);color:var(--marker)}
.plot-coordinates {grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto;gap:8px;align-items:end}
.plot-coordinates label {display:grid;gap:3px;font:700 15px/1.25 var(--hand);color:var(--marker)}
.plot-coordinates input {
  width:100%;min-width:0;min-height:44px;padding:5px 8px;border:2px solid var(--line-strong,#C9D2E3);
  border-radius:10px;background:var(--board,#fff);color:var(--marker);font:700 17px/1.25 var(--hand);
}
.plot-coordinates input:focus-visible,
.plot-coordinates button:focus-visible {outline:3px solid var(--marker-blue);outline-offset:2px}
.plot-coordinates button {min-height:44px;white-space:nowrap}
.quiz-choices:has(.plot-coordinates) .plot-btn {min-height:44px;padding:8px;line-height:1.2}
.quiz-choices:has(.plot-coordinates):not(:has(.plot-line)) .plot-submit {grid-column:2}
body.lesson:has(#quiz:not([hidden]) .plot-coordinates) #askFab .af-bubble {display:none}
body.lesson:has(#quiz:not([hidden]) .plot-coordinates) #askFab :is(.af-ph,.af-face) {width:48px;height:48px}
@media (max-width:640px) {
  .quiz-choices:has(.plot-coordinates) {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .plot-coordinates button {padding:7px 10px}
}
body.lesson .board-visual svg.tally-mark, .choice svg.tally-mark, #quizQ svg.tally-mark, .ink svg.tally-mark {
  display: inline-block;
  width: 1.15em;
  height: 1em;
  margin: 0 .08em;
  vertical-align: -.1em;
}

/* The frame keeps the current diagram separate from the spoken board text. */
.board-visual.mm-teaching-figure,
.curriculum-figure:has(> :is(svg,.fill-table,.ld-object-model)) {
  box-sizing:border-box; min-width:0; border:1px solid var(--line-strong); border-radius:12px;
  padding:clamp(6px,1.5vw,14px); background:var(--board,#fff);
}
.board-visual.mm-visual-focus,.curriculum-figure.mm-visual-focus {
  border-color:var(--marker-blue);
  box-shadow:inset 3px 0 var(--marker-blue);
}
.mm-teaching-figure :is(.pop,.draw),
.board:has(#quiz:not([hidden])) .board-visual :is(.pop,.draw) {
  animation:none !important; opacity:1; stroke-dashoffset:0;
}
.practice-links {margin:0;padding-inline-start:1.2em}
.practice-links li + li {margin-top:.4em}
.practice-links span {display:block;color:var(--text-2,#495B77);font-size:.88em}
.practice-links a:focus-visible {outline:2px solid var(--marker-blue);outline-offset:3px}

@media (prefers-reduced-motion: no-preference) {
  .mm-visual-focus > :is(svg,.fill-table,.ld-object-model,.example-model) {
    animation:mm-figure-enter min(var(--mm-motion),.34s) ease-out;
  }
  .mm-visual-focus :is(.mm-teaching-mark,.ld-focus,.ld-on-branch,.ld-focus-label,.place-value-cell,
                      .example-tray .first,.example-tray .second,.example-x,.example-extra) {
    animation:mm-figure-mark calc(var(--mm-motion) * .56) ease-out !important;
    animation-delay:calc(var(--mm-motion) * var(--mm-order,0) / 20) !important;
  }
}
@keyframes mm-figure-enter {
  from {opacity:.72;transform:translateY(4px)}
  to {opacity:1;transform:translateY(0)}
}
@keyframes mm-figure-mark {
  from,to {filter:none;opacity:1}
  35% {filter:drop-shadow(0 0 4px var(--marker-blue));opacity:.80}
}
