/* Explicación visual opcional; el texto sigue contando cada paso sin depender del color. */
.solution-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.school-board { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; padding: 12px; border: 3px solid #b58c58; border-radius: 13px; background: #173f38; color: #fffdf2; box-shadow: inset 0 0 0 2px #ffffff18, 0 4px 0 #8a6a47; }
.school-stage { display: grid; justify-items: center; align-content: start; flex: 1 1 170px; min-width: 0; padding: 3px 7px 6px; }
.school-stage + .school-stage { border-left: 1px dashed #ffffff70; }
.school-stage-title { margin: 0 0 7px; color: #e5ffad; font-size: .76rem; font-weight: 900; line-height: 1.25; text-align: center; }
.school-calculation, .school-division, .school-lines { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-variant-numeric: tabular-nums; font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 800; line-height: 1.15; }
.school-calculation { display: grid; justify-items: stretch; min-width: 3.6ch; }
.school-has-regrouping { padding-top: .74em; }
.school-row { display: grid; grid-template-columns: 1.1ch minmax(0, auto); gap: .2ch; justify-content: end; white-space: nowrap; }
.school-sign { color: #a3f0dc; }
.school-number { text-align: right; }
.school-annotated-number { display: inline-flex; justify-content: flex-end; }
.school-digit { position: relative; display: inline-block; width: 1.25ch; text-align: center; }
.school-digit-borrowed { text-decoration: line-through; text-decoration-color: #f9b989; text-decoration-thickness: 1px; }
.school-small-digit { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); min-width: 1.3ch; padding: 0 .08em; border-radius: 3px; background: #173f38; color: #ffe38e; font-size: .62em; font-weight: 900; line-height: 1.2; text-align: center; text-decoration: none; }
.school-small-borrow { color: #a3f0dc; }
.school-regrouping-note { max-width: 28ch; margin: 7px 0 0 !important; color: #d8f4e9; font-size: .7rem !important; line-height: 1.3 !important; text-align: center; }
.school-rule { height: 2px; margin: 3px 0; background: #fffdf2; }
.school-partial { color: #d5eafc; }
.school-result { color: #ffe38e; }
.school-division { display: grid; grid-template-columns: max-content max-content; align-items: start; }
.school-dividend { grid-column: 1; grid-row: 1; padding: 2px .38em 2px 0; }
.school-divisor { grid-column: 2; grid-row: 1; padding: 2px .12em 2px .38em; border-left: 2px solid #fffdf2; }
.school-remainder { grid-column: 1; grid-row: 2; padding: .16em .38em 0 0; color: #a3f0dc; text-align: right; }
.school-quotient { grid-column: 2; grid-row: 2; padding: .16em .12em 0 .38em; border-top: 2px solid #fffdf2; border-left: 2px solid #fffdf2; color: #ffe38e; }
.school-lines { display: grid; gap: 3px; max-width: 100%; font-size: clamp(.98rem, 2.5vw, 1.35rem); overflow-wrap: anywhere; }
.school-expression:last-child { color: #ffe38e; }
.school-equation-stage { flex-basis: 100%; }
.school-equation { display: grid; grid-template-columns: max-content 1.5ch max-content; align-items: baseline; column-gap: .4ch; max-width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-variant-numeric: tabular-nums; font-size: clamp(.93rem, 2.5vw, 1.45rem); font-weight: 800; line-height: 1.2; }
.school-equation-note { grid-column: 1 / -1; margin-top: 8px; color: #c8f7db; font-family: inherit; font-size: .65em; font-weight: 700; }
.school-equation-note:first-child { margin-top: 0; }
.school-equation-left { text-align: right; white-space: nowrap; }
.school-equation-equals { color: #a3f0dc; text-align: center; }
.school-equation-right { text-align: left; white-space: nowrap; }
.school-equation-answer { color: #ffe38e; font-size: 1.18em; }
.school-equation-check { margin: 12px 0 0 !important; padding-top: 8px; border-top: 1px dashed #ffffff70; color: #fffdf2; font-size: .78rem !important; text-align: center; }
.solution-actions .hint-button { min-height: 42px; }
.block-toggle { border-color: #419b79; background: #dff9eb; color: #175a43; }
.block-toggle:hover { background: #c9f1dd; }
.block-visualization { display: grid; gap: 12px; margin-top: 12px; }
.block-intro { margin: 0 !important; padding: 9px 11px; border-radius: 9px; background: #e9f8ef; color: #24533f; }
.block-step { min-width: 0; padding: 12px; border: 2px solid #b8d6c8; border-radius: 12px; background: #fffefa; }
.block-step-title { margin: 0 0 5px; color: #234f3e; font-size: .94rem; }
.block-equation { display: inline-block; margin: 0 0 5px !important; padding: 4px 9px; border-radius: 7px; background: #e9e4ff; color: #35266b; font-size: 1rem !important; font-weight: 900; font-variant-numeric: tabular-nums; }
.block-step-note { margin: 4px 0 9px !important; color: #385564; }
.block-values, .block-repeat { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.block-value { flex: 1 1 145px; min-width: 0; margin: 0; padding: 9px; border: 1px solid #cbdde0; border-radius: 9px; background: #f5fbff; }
.block-value-label { margin-bottom: 6px; color: #183b58; font-size: .8rem; font-weight: 900; }
.block-value-description { display: block; margin-top: 6px; color: #425f6d; font-size: .69rem; font-weight: 700; line-height: 1.3; }
.block-place-values { display: grid; gap: 5px; }
.block-place { display: flex; align-items: center; gap: 5px; min-width: 0; }
.block-place-key { flex: 0 0 27px; color: #506a79; font-size: .67rem; font-weight: 900; text-align: right; }
.block-tiles { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; }
.math-block { display: inline-block; flex: 0 0 auto; border: 2px solid #27526a; border-radius: 3px; box-shadow: 1px 2px 0 #25405b55; }
.math-block.one { width: 14px; height: 14px; background: #ffdc68; }
.math-block.ten { width: 14px; height: 28px; background: repeating-linear-gradient(to bottom, #61d9c3 0 5px, #3cae9e 5px 6px); }
.math-block.hundred { width: 29px; height: 29px; background-color: #99b7f7; background-image: linear-gradient(#496fc271 1px, transparent 1px), linear-gradient(90deg, #496fc271 1px, transparent 1px); background-size: 7px 7px; }
.math-block.thousand { width: 33px; height: 33px; background: linear-gradient(135deg, #c5a9fa 0 70%, #8266d7 70%); box-shadow: 3px 3px 0 #664ca8; }
.block-zero { padding: 1px 7px; border-radius: 5px; background: #e9eef0; color: #345; font-weight: 900; }
.block-repeat .block-value { flex: 0 1 190px; }
.block-repeat-count { padding: 8px 10px; border: 2px solid #69aa8c; border-radius: 9px; background: #dff8e8; color: #205342; font-size: .82rem; font-weight: 900; }
@media (max-width: 600px) {
  .school-board { padding: 8px; }
  .school-stage { flex-basis: 100%; padding: 5px 2px; }
  .school-stage + .school-stage { border-left: 0; border-top: 1px dashed #ffffff70; }
  .school-equation { font-size: clamp(.78rem, 3.55vw, 1.05rem); column-gap: .2ch; }
  .block-step { padding: 10px; }
  .block-value { flex-basis: 130px; }
  .solution-actions .hint-button { flex: 1 1 150px; }
}
