/* Oficina de cálculo: regras restritas à aula de Operações Básicas. */
#study[data-lesson="basic-numeros-e-operacoes"] .study-heading {margin-bottom:2.5rem;padding:clamp(1.5rem,4vw,3rem);border-color:#8e815c;border-left-color:#e3c375;border-radius:.75rem;background:linear-gradient(115deg,#35352c,#282820);}
#study[data-lesson="basic-numeros-e-operacoes"] .study-heading::after {display:none;}
#study[data-lesson="basic-numeros-e-operacoes"] .study-heading h1 {font-size:clamp(2.25rem,4.5vw,3.75rem);max-width:20ch;}
#study[data-lesson="basic-numeros-e-operacoes"] .study-heading #study-subtitle {max-width:60ch;color:#e7e0cc;}
#study .calc-workshop {--calc-ink:#fff8e8;--calc-muted:#e3ddcc;--calc-gold:#edcc80;--calc-rule:#9b906968;--calc-surface:#302f28;--calc-paper:#f5f0e2;--calc-paper-ink:#282b22;max-width:100%;min-width:0;color:var(--calc-ink);font-family:system-ui,sans-serif;}
#study .calc-workshop [hidden] {display:none!important;}
#study .calc-workshop :is(h2,h3) {color:var(--calc-ink);font-family:Georgia,serif;font-weight:550;letter-spacing:-.02em;}
#study .calc-workshop h2 {max-width:32ch;margin:0 0 1rem;font-size:clamp(1.6rem,2.7vw,2.15rem);line-height:1.2;}
#study .calc-workshop h3 {margin:1rem 0;font-size:1.3rem;line-height:1.4;}
#study .calc-workshop p {max-width:70ch;margin:.75rem 0;color:var(--calc-muted);font:400 1rem/1.65 system-ui,sans-serif;overflow-wrap:break-word;}
#study .calc-workshop section {scroll-margin-top:6rem;}
#study .calc-workshop .calc-opening {padding:0 0 2.5rem;}
#study .calc-workshop .calc-opening > p {max-width:68ch;}
#study .calc-workshop .calc-local-nav {display:flex;flex-wrap:wrap;gap:.3rem 1.25rem;margin:1.25rem 0 0;}
#study .calc-workshop .calc-local-nav a {display:inline-flex;align-items:center;min-height:2.75rem;color:var(--calc-gold);font:600 1rem/1.4 system-ui,sans-serif;text-decoration:underline;text-underline-offset:.35em;text-decoration-color:#edcc8066;}
#study .calc-workshop .calc-local-nav a:hover {color:#fff6db;text-decoration-color:currentColor;}
#study .calc-workshop .calc-section {min-width:0;margin:0;padding:clamp(1.75rem,4vw,3rem) 0;border-top:1px solid var(--calc-rule);}
#study .calc-workshop .calc-foundations {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(1.5rem,4vw,3rem);}
#study .calc-workshop .calc-foundations > section > p {min-height:7.4em;}
#study .calc-workshop .calc-multiplication {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(1.5rem,4vw,3rem);align-items:start;}
#study .calc-workshop .calc-multiplication > div {min-width:0;}
#study .calc-workshop .calc-algorithm-view {padding:1.25rem;border:1px solid #d3c7a3;border-radius:.5rem;background:var(--calc-paper);}
#study .calc-workshop .calc-table-scroll {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-color:#9a8250 transparent;}
#study .calc-workshop .calc-column-table {width:auto;margin:0 auto;border-collapse:collapse;table-layout:fixed;color:var(--calc-paper-ink);font:600 clamp(1.25rem,2.5vw,1.6rem)/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;}
#study .calc-workshop .calc-column-table caption {max-width:35ch;padding:0 0 1rem;color:#4a4b3d;font:500 .875rem/1.5 system-ui,sans-serif;text-align:left;white-space:normal;}
#study .calc-workshop .calc-column-table thead th {padding:0 .45rem .6rem;color:#575846;font:600 .75rem/1.4 system-ui,sans-serif;}
#study .calc-workshop .calc-column-table :is(td,tbody th) {min-width:2rem;height:2rem;padding:.15rem .45rem;text-align:center;white-space:nowrap;border:0;background:transparent;}
#study .calc-workshop .calc-column-table tbody th {min-width:1.75rem;font-weight:500;}
#study .calc-workshop .calc-column-table .calc-carries td {height:1.6rem;color:#81520d;font-size:.9rem;}
#study .calc-workshop .calc-column-table .calc-total > * {padding-top:.45rem;border-top:2px solid #62654b;font-weight:750;}
#study .calc-workshop .calc-column-table .calc-partial:nth-child(3) > * {border-top:1px solid #9a9c86;}
#study .calc-workshop .calc-column-table .calc-subtract-line > * {border-bottom:1px solid #92967a;}
#study .calc-workshop .calc-algorithm-note {min-height:6.5em;padding:.8rem 0;color:var(--calc-muted);font-size:.95rem;line-height:1.6;}
#study .calc-workshop .calc-actions {display:flex;flex-wrap:wrap;align-items:center;gap:.65rem;margin:1rem 0;}
#study .calc-workshop .calc-button {max-width:100%;min-height:2.875rem;padding:.7rem 1rem;border:1px solid #b7a477;border-radius:.4rem;background:#3d3c30;color:#fff6e3;font:600 .95rem/1.4 system-ui,sans-serif;text-align:center;cursor:pointer;transition:background .15s ease,border-color .15s ease;}
#study .calc-workshop .calc-button:hover {background:#514b35;border-color:#f0d493;}
#study .calc-workshop .calc-button:disabled {border-color:#827c68;background:#34342d!important;color:#bcb9a7!important;opacity:1;border-style:solid;cursor:default;}
#study .calc-workshop .calc-button[aria-pressed="true"] {border-color:#f0d493;background:#edcc80!important;color:#282b22!important;box-shadow:inset 0 -3px #98742a;font-weight:700;}
#study .calc-workshop :is(button,a,input,select,summary,[tabindex]):focus-visible {outline:3px solid #ffe6a9;outline-offset:4px;}
#study .calc-workshop .calc-table-scroll:focus-visible {outline-color:#836218;outline-offset:2px;}
#study .calc-workshop .calc-note {margin:1rem 0 0;border-top:1px solid var(--calc-rule);border-bottom:1px solid var(--calc-rule);}
#study .calc-workshop .calc-note summary {min-height:2.875rem;padding:.85rem .2rem;color:var(--calc-gold);font:600 .95rem/1.5 system-ui,sans-serif;cursor:pointer;}
#study .calc-workshop .calc-note > p {margin:.5rem .2rem 1rem;font-size:.95rem;}
#study .calc-workshop .calc-expression {display:inline-block;max-width:100%;overflow-x:auto;vertical-align:middle;white-space:nowrap;overscroll-behavior-x:contain;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;}
#study .calc-workshop .calc-division-vocabulary {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1.25rem;margin:1.75rem 0 2rem;}
#study .calc-workshop .calc-division-vocabulary div {min-width:0;padding-left:1rem;border-left:2px solid #b3a470;}
#study .calc-workshop .calc-division-vocabulary dt {margin-bottom:.4rem;color:var(--calc-gold);font:650 1rem/1.4 system-ui,sans-serif;}
#study .calc-workshop .calc-division-vocabulary dd {margin:0;color:var(--calc-muted);font:400 .95rem/1.6 system-ui,sans-serif;}
#study .calc-workshop .calc-division-workbench {display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:clamp(1.5rem,4vw,3rem);padding:clamp(1.25rem,3vw,2rem);border:1px solid #9c906a;border-radius:.5rem;background:var(--calc-surface);}
#study .calc-workshop :is(label,.calc-division-question) {display:block;color:var(--calc-ink);font:600 .95rem/1.5 system-ui,sans-serif;}
#study .calc-workshop :is(input,select) {display:block;width:100%;max-width:100%;min-width:0;min-height:3rem;margin:.5rem 0 0;padding:.65rem .85rem;border:1px solid #b0a488;border-radius:.35rem;background:#f5f0e2;color:#282b22;font:500 1.125rem/1.4 system-ui,sans-serif;font-variant-numeric:tabular-nums;}
#study .calc-workshop input::placeholder {color:#6b695e;opacity:1;}
#study .calc-workshop input:disabled {background:#dcd7c8;color:#55584a;}
#study .calc-workshop .calc-division-choice select {max-width:20rem;}
#study .calc-workshop .calc-identity {max-width:100%;overflow-x:auto;padding:.5rem 0;color:var(--calc-gold);font-size:.875rem;white-space:nowrap;}
#study .calc-workshop .calc-identity .calc-expression {overflow:visible;}
#study .calc-workshop .calc-long-division {display:grid;grid-template-columns:minmax(0,1fr) minmax(4.5rem,.4fr);gap:.5rem;align-items:start;max-width:100%;padding:1.1rem;border:1px solid #d3c7a3;border-radius:.5rem;background:var(--calc-paper);color:var(--calc-paper-ink);}
#study .calc-workshop .calc-long-division .calc-column-table caption {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
#study .calc-workshop .calc-division-right {display:flex;flex-direction:column;gap:.3rem;min-width:0;margin-top:1.65rem;padding-left:.85rem;border-left:2px solid #62654b;font-variant-numeric:tabular-nums;}
#study .calc-workshop .calc-division-right span {color:#555745;font:500 .75rem/1.4 system-ui,sans-serif;}
#study .calc-workshop .calc-division-right strong {font:650 1.5rem/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap;overflow-x:auto;}
#study .calc-workshop .calc-division-right strong:first-of-type {padding-bottom:.45rem;border-bottom:2px solid #62654b;}
#study .calc-workshop #calc-division-form {margin-top:1.25rem;}
#study .calc-workshop .calc-answer-row {display:flex;flex-wrap:wrap;gap:.65rem;align-items:end;margin:.5rem 0;}
#study .calc-workshop .calc-answer-row input {width:7rem;margin:0;}
#study .calc-workshop .calc-feedback {min-height:3.4em;margin:1rem 0;padding:.65rem .8rem;border-left:3px solid #b6a279;background:#3b3a2f;color:#f4eddc;font-size:.95rem;line-height:1.6;}
#study .calc-workshop .calc-feedback:empty {display:none;}
#study .calc-workshop .calc-feedback[data-correct="true"] {border-left-color:#d1d5a5;background:#37412f;}
#study .calc-workshop .calc-feedback[data-correct="false"] {border-left-color:#f0c092;background:#483c2e;}
#study .calc-workshop #calc-division-reset {display:block;margin-top:.75rem;background:transparent;}
#study .calc-workshop #calc-division-complete {padding:1rem;border-left:3px solid #d1d5a5;background:#37412f;color:#f4eddc;}
#study .calc-workshop .calc-division-notes {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.5rem;margin-top:.75rem;align-items:start;}
#study .calc-workshop .calc-decimal-steps {padding-left:1.5rem;color:var(--calc-muted);font:400 .95rem/1.7 system-ui,sans-serif;}
#study .calc-workshop .calc-decimal-steps li {margin:.5rem 0;}
#study .calc-workshop .calc-mode-buttons {display:flex;flex-wrap:wrap;gap:.6rem;margin:1.25rem 0;}
#study .calc-workshop .calc-lab-form {padding:clamp(1rem,3vw,2rem);border:1px solid #9c906a;border-radius:.5rem;background:var(--calc-surface);}
#study .calc-workshop .calc-operands {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.25rem;max-width:35rem;}
#study .calc-workshop .calc-operation-buttons {display:flex;flex-wrap:wrap;gap:.6rem;margin:1.25rem 0;}
#study .calc-workshop .calc-operation-buttons button span {display:inline-block;margin-right:.35rem;font:500 1.3rem/1 ui-monospace,Consolas,monospace;}
#study .calc-workshop .calc-equation {max-width:100%;overflow-x:auto;margin:1.5rem 0;color:var(--calc-gold);font:600 clamp(1.5rem,3vw,2rem)/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;white-space:nowrap;}
#study .calc-workshop .calc-answer-fields {display:flex;flex-wrap:wrap;gap:1rem;max-width:35rem;margin:1rem 0;}
#study .calc-workshop .calc-answer-fields label {flex:1 1 10rem;min-width:0;max-width:24rem;}
#study .calc-workshop #ops-calc-resolution {margin-top:1.5rem;padding-top:1rem;border-top:1px solid var(--calc-rule);}
#study .calc-workshop #ops-calc-resolution .calc-table-scroll {padding:1.1rem;border-radius:.5rem;background:var(--calc-paper);}
#study .calc-workshop #ops-calc-resolution .calc-long-division .calc-table-scroll {padding:0;}
#study .calc-workshop #ops-practice-stage {min-width:0;padding:clamp(1rem,3vw,2rem);border-left:3px solid #b3a470;background:#302f2880;}
#study .calc-workshop #ops-practice-question {max-width:65ch;margin:0 0 1.25rem;color:var(--calc-ink);font:600 1.125rem/1.7 system-ui,sans-serif;}
#study .calc-workshop #ops-practice-question .calc-expression {color:var(--calc-gold);font-size:1.75rem;}
#study .calc-workshop .basic-end-nav {margin-top:1.5rem;}
@media(max-width:900px){
  #study .calc-workshop .calc-foundations,#study .calc-workshop .calc-multiplication {grid-template-columns:minmax(0,1fr);gap:0;}
  #study .calc-workshop .calc-foundations > section > p {min-height:0;}
  #study .calc-workshop .calc-multiplication > div + div {margin-top:1.5rem;}
  #study .calc-workshop .calc-division-workbench {grid-template-columns:minmax(0,1fr);}
  #study .calc-workshop .calc-division-active {max-width:40rem;}
  #study .calc-workshop .calc-division-vocabulary {grid-template-columns:repeat(2,minmax(0,1fr));}
  #study .calc-workshop .calc-algorithm-note {min-height:0;}
}
@media(max-width:600px){
  #study .calc-workshop .calc-division-notes {grid-template-columns:minmax(0,1fr);gap:0;}
  #study .calc-workshop .calc-division-workbench {padding:1rem;}
  #study .calc-workshop .calc-long-division {grid-template-columns:minmax(0,1fr) minmax(4rem,.35fr);padding:.75rem;gap:.35rem;}
  #study .calc-workshop .calc-column-table :is(td,tbody th) {min-width:1.6rem;padding:.15rem .2rem;}
  #study .calc-workshop .calc-column-table thead th {padding:0 .2rem .6rem;}
  #study .calc-workshop .calc-division-right {padding-left:.5rem;}
  #study .calc-workshop .calc-division-right strong {font-size:1.25rem;}
  #study .calc-workshop .calc-operands {gap:.75rem;}
  #study .calc-workshop .calc-operation-buttons {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  #study .calc-workshop .calc-operation-buttons button {padding:.7rem .45rem;font-size:.875rem;}
  #study .calc-workshop .calc-actions {align-items:stretch;}
  #study .calc-workshop .calc-actions .calc-button {flex:1 1 10rem;}
}
@media(prefers-reduced-motion:reduce){
  #study .calc-workshop .calc-button {transition:none;}
  #study .calc-workshop * {scroll-behavior:auto!important;}
}
