.school-operations-link { background: #edf3ec; border-color: #b8cebf; }
.school-operations-link .times-mark { background: #346957; color: #fbf5d5; }
.school-verbs-link { background: #f5edf6; border-color: #d6c3d8; }
.school-verbs-link .times-mark { background: #765271; color: #fff1da; }
:is(.subject-operations,.subject-verbes) .gram-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.15rem; }
:is(.subject-operations,.subject-verbes) .gram-card { grid-row: auto; grid-column: auto; flex-direction: column; }
:is(.subject-operations,.subject-verbes) .gram-card .gram-card-image { flex: none; width: 100%; min-width: 0; aspect-ratio: 2.25; min-height: 0; }
:is(.subject-operations,.subject-verbes) .gram-card .gram-card-body { flex: 1; padding: 1rem 1.25rem; }
:is(.subject-operations,.subject-verbes) .gram-card h2 { font-size: clamp(1.25rem,2.5vw,1.6rem); }
.gram-addition { --gram-soft: #edf4e6; --gram-accent: #326846; }
.gram-soustraction { --gram-soft: #edf3f5; --gram-accent: #295e75; }
.gram-multiplication { --gram-soft: #f7f0df; --gram-accent: #765625; }
.gram-division { --gram-soft: #e8f3ee; --gram-accent: #306c62; }
.gram-etre { --gram-soft: #edf2f7; --gram-accent: #3c5c7c; }
.gram-avoir { --gram-soft: #f7efe5; --gram-accent: #79532e; }
.study-listen { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .45rem .8rem; font-size: .9rem; font-weight: 600; color: var(--gram-accent,#325e4d); background: var(--gram-soft,#eff3e9); border: 1px solid #c9d3c6; border-radius: 10px; }
.study-listen .sr-only, .verb-forms .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.study-listen.compact { width: 44px; height: 44px; flex: none; border-radius: 50%; padding: .35rem; }
.study-listen:hover, .study-listen[aria-pressed=true] { background: var(--gram-accent,#325e4d); color: white; }
.gram-question form > .study-listen { margin: 0 0 1rem; }
.gram-feedback .study-listen, .gram-corrections .study-listen { margin-top: .5rem; }
:is(.subject-operations,.subject-verbes) .gram-course-copy > h3 { margin: 1rem 0 .7rem; }
.study-memo { max-width: 900px; }
.study-sheet-tools { margin: .75rem 0; }
.study-sheet ol { list-style: none; counter-reset: sheet; margin: .7rem 0 0; padding: 0; }
.study-sheet li { counter-increment: sheet; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .85rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--line); }
.study-sheet li::before { content: counter(sheet); display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; color: var(--gram-accent); background: var(--gram-soft); font-weight: 700; }
.study-sheet h3 { font-size: 1.08rem; margin: 0; }
.study-sheet li p { margin: .3rem 0; line-height: 1.55; }
.study-example { font-weight: 600; color: var(--gram-accent); }
.study-lab { padding: clamp(1rem,2.4vw,1.8rem); border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow); }
.study-lab h2 { margin: 0; font-size: 1.4rem; }
.study-variants { display: flex; gap: .55rem; flex-wrap: wrap; margin: .95rem 0; }
.study-variants button, .study-arrows button { border: 1px solid #b9c8bc; border-radius: 10px; padding: .55rem .85rem; min-height: 44px; background: #fffef8; font-weight: 600; color: var(--ink); }
.study-variants button[aria-pressed=true] { background: var(--gram-soft); border-color: var(--gram-accent); box-shadow: inset 0 0 0 1px var(--gram-accent); color: var(--gram-accent); }
.study-stage { display: grid; grid-template-columns: minmax(0,1.22fr) minmax(14rem,.9fr); border: 1px solid #d5ded2; border-radius: 14px; overflow: hidden; }
.study-board { min-width: 0; min-height: 255px; display: grid; align-items: center; background-color: var(--gram-soft); background-image: radial-gradient(#34483829 .75px,transparent .9px); background-size: 12px 12px; padding: clamp(.8rem,2vw,1.35rem); }
.study-instruction { min-width: 0; padding: clamp(1rem,2.2vw,1.6rem); align-self: center; }
.study-step-number { margin: 0 0 .6rem; color: var(--gram-accent); font-size: .88rem; font-weight: 700; }
.study-instruction h3 { font-size: 1.2rem; margin: 0; }
.study-instruction [data-step-text] { line-height: 1.55; margin: .5rem 0; }
.study-equation { display: table; margin: .55rem 0 .9rem; padding: .3rem .7rem; background: var(--gram-soft); border-radius: 7px; font-weight: 700; font-size: 1.05rem; }
.study-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.study-arrows { display: flex; gap: .5rem; }
.study-arrows button { font-size: .92rem; min-width: 44px; }
.study-arrows button:disabled { opacity: .4; cursor: default; }
.op-figure { min-width: 0; margin: 0; }
.op-figure figcaption { text-align: center; line-height: 1.4; font-size: .92rem; margin: 1rem auto 0; max-width: 45ch; }
.op-objects { display: flex; align-items: center; justify-content: center; gap: clamp(.6rem,2vw,1.5rem); flex-wrap: wrap; }
.op-pose { border-collapse: separate; border-spacing: 2px 0; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; margin: 0; }
.op-pose th, .op-pose td { min-width: 1.75rem; padding: .08rem .13rem; font-size: 1.32rem; line-height: 1.25; }
.op-pose thead th { font-size: .78rem; color: #435d50; padding-bottom: .4rem; }
.op-pose abbr { text-decoration: none; }
.op-pose .is-rank { background: #ffe3a0; }
.op-pose .op-answer td, .op-pose .op-line td { border-top: 2px solid #3f5b4f; }
.op-pose .op-answer td { font-weight: 700; min-height: 1.6rem; color: #234c38; }
.op-pose .op-carry td { height: 1.15rem; font-size: .82rem; color: #843e24; }
.op-highlight { background: #ffe3a0; }
.op-kit { display: grid; width: min(100%,13.3rem); gap: .34rem; }
.op-kit > div { display: flex; min-height: 1.5rem; align-items: center; justify-content: space-between; gap: .25rem; padding: .22rem .45rem; border-radius: 6px; background: #fffdf3bb; }
.op-blocks { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.op-blocks i { display: block; border: 1px solid #82542b; border-radius: 2px; background: #f9bd5e; }
.op-blocks.plates i { width: 22px; height: 22px; border-color: #407991; background-color: #8dc1d1; background-image: linear-gradient(#548da1 1px,transparent 1px),linear-gradient(90deg,#548da1 1px,transparent 1px); background-size: 10% 10%; }
.op-blocks.rods i { width: 7px; height: 28px; border-color: #487b61; background: repeating-linear-gradient(#80b596 0 9%,#558769 9% 10%); }
.op-blocks.units i { width: 9px; height: 9px; }
.op-kit small, .op-exchange small, .op-area small, .op-rows small, .op-cup small { font-size: .76rem; font-weight: 600; }
.op-exchange { width: min(100%,13.8rem); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .4rem; padding: .8rem .5rem; background: #fffdf4d9; border-radius: 9px; }
.op-exchange > div { text-align: center; }
.op-exchange small, .op-rows small, .op-area small { display: block; margin-top: .35rem; text-align: center; }
.op-exchange .op-blocks { justify-content: center; }
.op-exchange > div:last-child { animation: op-arrive .55s ease-out both; }
@keyframes op-arrive { from { transform: translateX(-11px); opacity: .25; } to { transform: none; opacity: 1; } }
.op-rows > div { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem; margin: .17rem 0; border-radius: 5px; background: #fffdf3d9; }
.op-focus-1 .units, .op-focus-2 .rods { outline: 2px solid #a66e27; outline-offset: 2px; }
.op-area { width: min(100%,9.5rem); }
.op-area-width { text-align: center; font-size: .8rem; font-weight: 650; }
.op-rectangle { overflow: hidden; border: 1px solid #718677; }
.op-strip { background-color: #fffdf8; background-image: linear-gradient(90deg,#a0ab9a 1px,transparent 1px),linear-gradient(#a0ab9a 1px,transparent 1px); background-size: calc(100% / 23) calc(100% / var(--rows)); }
.op-strip.four { --rows: 4; aspect-ratio: 23/4; }
.op-strip.ten { --rows: 10; aspect-ratio: 23/10; }
.op-strip.four.filled { background-color: #f2cd7d; }
.op-strip.ten.filled { background-color: #a8cdb5; }
.op-jumps { padding: 1rem .7rem .4rem; }
.op-ruler { position: relative; border-top: 3px solid #627d68; margin: 5rem .5rem 3.2rem; }
.op-arc { position: absolute; bottom: 0; height: 35px; border: 2px dashed #839785; border-bottom: 0; border-radius: 65% 65% 0 0; text-align: center; }
.op-arc.taken { border-style: solid; border-color: #2f7158; }
.op-arc b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .75rem; color: #334f39; }
.op-tick { position: absolute; width: 2px; height: 7px; background: #56705d; }
.op-tick b { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); font-size: .9rem; }
.op-tick.selected b { color: #175435; text-decoration: underline 2px; }
.op-hopper { position: absolute; width: 0; font-size: 1.5rem; bottom: .2rem; }
.op-hopper i { display: block; width: 2rem; margin-left: -1rem; text-align: center; font-style: normal; animation: op-hop .48s ease-in-out; }
@keyframes op-hop { 45% { transform: translateY(-27px); } }
.op-reserve { border: 1px dashed #7b9584; border-radius: 10px; padding: .5rem .7rem; background: #fffdf3a8; }
.op-reserve > strong { font-size: .85rem; }
.op-reserve > div, .op-cup > div { display: flex; align-content: flex-start; flex-wrap: wrap; gap: .22rem; padding: .38rem 0 0; min-height: 2.65rem; }
.op-bead { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; border: 1px solid #43715e; background: radial-gradient(circle at 33% 29%,#f0fff2 8%,#8fc9a8 23%,#4b9676 82%); }
.op-bead.tone-1 { border-color: #a36c35; background: radial-gradient(circle at 33% 29%,#fff6d9 8%,#f3c56f 23%,#dd9551 82%); }
.op-bead.tone-2 { border-color: #547b94; background: radial-gradient(circle at 33% 29%,#e8f8ff 8%,#a7c9d8 23%,#74a1ba 82%); }
.op-cups { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .4rem; margin-top: .75rem; }
.op-cup { min-width: 0; text-align: center; }
.op-cup > div { justify-content: center; padding: .32rem; min-height: 2.7rem; border: 1px solid #6f9382; border-bottom-width: 3px; border-radius: 3px 3px 15px 15px; background: #fcf8e8; }
.op-cup small { display: block; margin-top: .25rem; }
.calm :is(.op-hopper i,.op-exchange > div:last-child) { animation: none; }
@media (prefers-reduced-motion: reduce) { .op-hopper i, .op-exchange > div:last-child { animation: none; } }
@media (max-width: 790px) {
  .study-stage { grid-template-columns: 1fr; }
  .study-board { min-height: 200px; }
}
@media (max-width: 600px) {
  :is(.subject-operations,.subject-verbes) .gram-gallery { grid-template-columns: minmax(0,1fr); gap: .8rem; }
  :is(.subject-operations,.subject-verbes) .gram-card .gram-card-image { aspect-ratio: 2.35; }
  .study-sheet li { gap: .45rem; }
  .study-controls > .button { font-size: .9rem; }
  .op-objects { gap: .6rem; }
}

@media (max-width: 900px) { .subject-operations.gram-multiplication .gram-course-photo img { object-fit: contain; background: #eef1e3; } }
