/* A categoria continua no QG; apenas suas aulas usam o Modo Estudo. */
#qg .qg-stack.basic-category {display:grid; gap:clamp(35px,5vw,65px);}
#qg .basic-phase {padding:30px 0 0; border-top:1px solid rgba(159,218,234,.35);}
#qg .basic-phase:first-child {border-top:0; padding-top:0;}
#qg .basic-phase-heading {max-width:850px; margin-bottom:20px;}
#qg .basic-phase-heading h3 {margin:7px 0; color:#f6fbff; font:750 clamp(22px,2.7vw,32px)/1.2 system-ui,sans-serif;}
#qg .basic-phase-heading p {margin:0; color:#cce3ed; font:16px/1.55 system-ui,sans-serif;}
#qg .basic-topic-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px;}
#qg .basic-topic-card {min-height:112px; align-content:center; gap:7px; padding:18px 48px 18px 19px;}
#qg .basic-topic-card strong {font-size:clamp(16px,1.55vw,19px); overflow-wrap:anywhere;}
#qg .basic-topic-card .content-tag {font-size:12px;}
#qg .basic-topic-card::after {right:15px; font-size:21px;}
/* Cada aula muda os detalhes e as representações; o fundo vinho permanece estável. */
#study[data-lesson^="basic-"] .study-heading {position:relative; display:block; min-height:0; margin:30px 0 69px; padding:clamp(35px,5vw,66px); border:1px solid #896777; border-left:4px solid #e1b896; border-radius:16px; background:radial-gradient(circle at 83% 36%,rgba(195,131,105,.15),transparent 38%),linear-gradient(120deg,#503349,#34243d);}
#study[data-lesson^="basic-"] .study-heading::after {content:attr(data-basic-symbol); position:absolute; right:4%; top:15%; max-width:42%; color:rgba(242,206,176,.13); font:clamp(54px,9vw,132px)/1.1 Georgia,serif; text-align:center; pointer-events:none; white-space:normal;}
#study[data-lesson^="basic-"] .study-heading :is(h1,.study-kicker,#study-subtitle,.study-start-button) {position:relative; z-index:1; grid-column:auto; grid-row:auto;}
#study[data-lesson^="basic-"] .study-heading h1 {max-width:800px; font-size:clamp(39px,5.3vw,72px); line-height:1.08;}
#study[data-lesson^="basic-"] .study-heading #study-subtitle {max-width:660px; color:#f1e0e0;}
#study[data-lesson^="basic-"] .study-start-button {margin-top:29px;}
#study[data-lesson^="basic-"] .study-hero-art[hidden] {display:none;}
#study .basic-lesson {--accent:#eac68e; --accent-low:#895e56; --card:#3c2a3d; --card-light:#523849; --edge:#936e79; color:#f8eeed; font-family:Georgia,"Times New Roman",serif;}
#study .basic-lesson.basic-terracotta {--accent:#e9b29d;--accent-low:#9a675e;}
#study .basic-lesson.basic-coral {--accent:#f2c1aa;--accent-low:#a76b6a;}
#study .basic-lesson.basic-rose {--accent:#eebed0;--accent-low:#9a667e;}
#study .basic-lesson.basic-violet {--accent:#d6c0f0;--accent-low:#7f619a;}
#study .basic-lesson.basic-moss {--accent:#caddb2;--accent-low:#6a8970;}
#study .basic-lesson.basic-sand {--accent:#ead4ac;--accent-low:#9b7961;}
#study .basic-lesson.basic-brick {--accent:#e7b5a4;--accent-low:#a47465;}
#study .basic-lesson.basic-sage {--accent:#d1e0bb;--accent-low:#738d6e;}
#study .basic-lesson.basic-amber {--accent:#f0d299;--accent-low:#9a7c56;}
#study .basic-lesson.basic-cosmic {--accent:#e2c1ef;--accent-low:#8362a2;}
#study .basic-lesson.basic-clay {--accent:#eec2aa;--accent-low:#a57665;}
#study .basic-lesson * {box-sizing:border-box;}
#study .basic-section {scroll-margin-top:32px; margin-bottom:clamp(86px,9vw,133px);}
#study .basic-kicker {display:block; margin:0 0 11px; color:var(--accent); font:750 12px/1.4 system-ui,sans-serif; letter-spacing:.14em; text-transform:uppercase;}
#study .basic-lesson :is(h2,h3) {color:#fff3ec; font-weight:540; letter-spacing:-.025em;}
#study .basic-lesson h2 {margin:0 0 16px; font-size:clamp(30px,3.6vw,47px); line-height:1.14;}
#study .basic-lesson h3 {font-size:clamp(19px,2vw,24px); line-height:1.25;}
#study .basic-lesson p {color:#e6d7d9; font:17px/1.67 Georgia,serif;}
#study .basic-section-heading {max-width:810px;}
#study .basic-section-heading p {max-width:660px; margin:0;}
#study .basic-intro {display:grid; grid-template-columns:minmax(0,1.05fr) minmax(250px,.95fr); gap:clamp(25px,5vw,77px); align-items:center;}
#study .basic-intro > div:first-child p {max-width:660px; margin:0;}
#study .basic-visual {display:grid; place-items:center; min-height:300px; padding:25px; overflow:hidden; border:1px solid var(--edge); border-radius:16px; background:radial-gradient(circle at 72% 24%,color-mix(in srgb,var(--accent) 16%,#493248),#37263b 72%);}
#study .basic-main {display:grid; grid-template-columns:minmax(230px,.75fr) minmax(0,1.25fr); align-items:center; gap:clamp(20px,5vw,70px);}
#study .basic-deeper {display:grid; grid-template-columns:minmax(0,1.3fr) minmax(230px,.7fr); gap:clamp(20px,5vw,70px); align-items:center;}
#study .basic-deeper > .basic-section-heading {grid-column:2; grid-row:1;}
#study .basic-deeper > .basic-workbench {grid-column:1; grid-row:1;}
#study .basic-coral .basic-deeper,#study .basic-moss .basic-deeper,#study .basic-amber .basic-deeper,#study .basic-cosmic .basic-deeper {display:block;}
#study .basic-main .basic-lab,#study .basic-workbench {min-width:0; padding:clamp(23px,3.4vw,42px); border:1px solid var(--edge); border-radius:15px; background:radial-gradient(circle at 88% 7%,color-mix(in srgb,var(--accent) 9%,#483047),#38283d 75%);}
#study .basic-deeper .basic-section-heading {margin-bottom:25px;}
#study .basic-lab p,#study .basic-workbench p {font-size:16px;}
#study .basic-options {display:flex; flex-wrap:wrap; gap:9px; align-items:center;}
#study .basic-choice,#study .basic-button {display:inline-flex; justify-content:center; align-items:center; min-height:44px; padding:10px 15px; border:1px solid #ac8c9a; border-radius:9px; background:#533a50; color:#f7eded; font:650 14px/1.35 system-ui,sans-serif; text-align:center; text-decoration:none; cursor:pointer; transition:transform .2s,background .2s,border-color .2s;}
#study .basic-choice:hover,#study .basic-button:hover {transform:translateY(-2px); border-color:#e9c8ac; background:#695066; color:#fff8f4;}
#study .basic-choice[aria-pressed="true"] {border-color:#f1d2b3; background:#825a70; color:#fff9f4;}
#study .basic-button {background:#eac2a4; border-color:#f5d6bd; color:#332435;}
#study .basic-button:hover {background:#f7d9c0; color:#2d2030;}
#study .basic-lesson :is(button,a,input,select):focus-visible {outline:3px solid #ffe0b6; outline-offset:3px;}
#study .basic-choice:disabled,#study .basic-choice:disabled:hover,#study .basic-button:disabled,#study .basic-button:disabled:hover {opacity:1; cursor:default; transform:none; border-color:#907b8c; background:#48384b; color:#dfd4da;}
#study .basic-choice:disabled[aria-pressed="true"],#study .basic-choice:disabled[aria-pressed="true"]:hover {border-color:#f1d2b3; background:#825a70; color:#fff9f4;}
#study .basic-feedback {min-height:2.5em; margin:15px 0 12px; color:#f0e2e3 !important; font:600 15px/1.5 system-ui,sans-serif !important;}
#study .basic-feedback[data-correct="true"] {color:#d8f0ca !important;}
#study .basic-feedback[data-correct="false"] {color:#ffd3bd !important;}
#study .basic-concept-note {max-width:800px; margin:22px 0 0 !important; padding:16px 19px; border-left:3px solid var(--accent); background:#4b3447; color:#f2e2e1 !important; font:15px/1.6 system-ui,sans-serif !important;}
#study .basic-field {display:grid; gap:10px; max-width:530px; color:#f5e5df; font:650 15px/1.4 system-ui,sans-serif;}
#study .basic-field strong {color:var(--accent); margin-left:5px;}
#study .basic-field input[type=range] {width:100%; accent-color:#e9b892; cursor:pointer;}
#study .basic-lab output,#study .basic-workbench output {display:block; margin-top:13px; color:#f4e7e1; font:600 21px Georgia,serif;}
#study .basic-summary {padding:clamp(25px,4vw,50px); border-top:2px solid var(--accent); border-radius:13px; background:linear-gradient(120deg,#54384b,#392940);}
#study .basic-summary ol {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; margin:26px 0 0; padding:0; list-style:none;}
#study .basic-summary li {display:flex; align-items:start; gap:12px; min-width:0; padding:18px; border:1px solid #8a697d; border-radius:10px; background:#432f43; color:#f3e5e4; font:16px/1.55 system-ui,sans-serif;}
#study .basic-summary li > span {flex:none; color:var(--accent); font-weight:750;}
#study .basic-bridge {display:inline-flex; min-height:44px; align-items:center; margin-top:25px; color:#f6d4b8; font:650 15px system-ui,sans-serif; text-decoration:none;}
#study .basic-bridge:hover {color:#fff5e8; text-decoration:underline;}
#study .basic-final {padding:clamp(24px,4vw,48px); border:1px solid #967387; border-radius:16px; background:radial-gradient(circle at 92% 10%,color-mix(in srgb,var(--accent) 12%,#493548),#3e2e41 72%);}
#study .basic-final-head {display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:15px; margin-bottom:25px;}
#study .basic-final-head p {margin:0;}
#study .basic-progress {min-width:140px; color:#fff4e8; font:750 26px system-ui,sans-serif; text-align:right;}
#study .basic-progress [role=progressbar] {width:140px; height:6px; margin-top:7px; overflow:hidden; border-radius:6px; background:#776074;}
#study .basic-progress [role=progressbar] span {display:block; width:0; height:100%; background:var(--accent); transition:width .35s ease;}
#study .basic-challenge-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px;}
#study .basic-challenge-card {min-width:0; padding:20px; border:1px solid #8f7285; border-radius:12px; background:#34273b;}
#study .basic-challenge-card.is-complete {border-color:#c8d9b2;}
#study .basic-challenge-card h3 {min-height:92px; margin:8px 0 15px; font-size:20px; overflow-wrap:anywhere;}
#study .basic-challenge-card .basic-choice {font-size:13px;}
#study .basic-complete {margin-top:26px; padding:24px; border:1px solid #ddc2a1; border-radius:12px; background:#604456;}
#study .basic-complete[hidden] {display:none;}
#study .basic-complete > span {color:#f8d59e; font-size:34px;}
#study .basic-complete h3 {margin:5px 0; font-size:29px;}
#study .basic-complete p {margin:0 0 20px;}
#study .basic-end-nav {display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px 22px; margin:30px 0 5px; padding-top:23px; border-top:1px solid #8e6a7e;}
#study .basic-end-nav a {display:flex; align-items:center; min-height:44px; color:#f1c9b8; font:650 15px/1.35 system-ui,sans-serif; text-decoration:none;}
#study .basic-end-nav a:hover {color:#fff5ec; text-decoration:underline; text-underline-offset:5px;}
#study .basic-end-nav a:nth-child(2) {color:#e1d1d6; font-weight:500;}
/* Conjuntos, deslocamentos e hierarquia de cálculo. */
#study .basic-set-map {width:min(100%,445px); padding:16px; border:1px solid #bca17d; border-radius:48% 48% 43% 43%; background:#604453; color:#fff4e9; font:650 16px/1.5 system-ui,sans-serif; text-align:center;}
#study .set-integer {margin:13px auto 0; width:83%; padding:13px; border:1px solid #e6bd98; border-radius:44%; background:#503b4d;}
#study .set-natural {margin:12px auto; width:84%; padding:15px 10px; border:1px solid #e9d2a5; border-radius:46%; background:#78564f;}
#study .basic-glyph {display:block; color:#ffdfb6; font:clamp(54px,8vw,100px)/1.2 Georgia,serif; text-align:center;}
#study .basic-classifier .basic-options {justify-content:center;}
#study .number-line {position:relative; padding:45px 8px; overflow:visible;}
#study .number-ticks {display:grid; grid-template-columns:repeat(11,minmax(0,1fr)); border-top:2px solid #e9bd9d;}
#study .number-ticks span {position:relative; padding-top:12px; color:#f2e4e3; font:600 12px system-ui,sans-serif; text-align:center;}
#study .number-ticks span::before {content:""; position:absolute; top:-6px; left:50%; width:1px; height:10px; background:#e9bd9d;}
#study .number-marker {position:absolute; top:22px; width:15px; height:15px; border-radius:50%; background:#f3d59e; transform:translateX(-50%); transition:left .35s;}
#study .number-marker span {position:absolute; top:-23px; left:50%; transform:translateX(-50%); color:#fff1df; font:750 14px system-ui,sans-serif;}
#study .order-stack {display:grid; gap:8px; width:min(100%,405px);}
#study .order-stack span {padding:13px; border:1px solid #d5a7a1; border-radius:6px; background:#674653; color:#fff0e7; font:650 15px system-ui,sans-serif; text-align:center;}
#study .order-stack span:nth-child(2) {margin:0 14px;}.order-stack span:nth-child(3) {margin:0 28px;}.order-stack span:nth-child(4) {margin:0 42px;}
#study .order-expression {display:flex; align-items:center; justify-content:center; gap:8px; color:#fff2e7; font:clamp(35px,5vw,68px) Georgia,serif;}
#study .order-operator {display:grid; place-items:center; width:50px; height:50px; border:1px solid #d5a7a1; border-radius:10px; background:#604251; color:#fff1e1; font:32px Georgia,serif; cursor:pointer;}
#study .order-operator:hover,#study .order-operator[aria-pressed="true"] {background:#966567; color:#fff;}
#study .order-steps,#study .order-progress {margin:14px 0; padding:18px; border-radius:8px; background:#553d4a; color:#ffeadf; font:600 18px/1.5 system-ui,sans-serif;}
/* Frações, valor posicional e áreas quadradas. */
#study .fraction-mosaic {display:grid; grid-template-columns:repeat(4,1fr); gap:4px; width:min(100%,380px);}
#study .fraction-mosaic span {height:105px; border:1px solid #e4b9a0; background:#432f40;}
#study .fraction-mosaic span:nth-child(-n+2) {background:#dc9e87;}
#study .fraction-mosaic strong {grid-column:1/-1; margin-top:15px; color:#ffeadd; font:550 27px Georgia,serif; text-align:center;}
#study .fraction-parts {display:grid; grid-template-columns:repeat(4,1fr); gap:4px;}
#study .fraction-parts button {height:100px; border:1px solid #e6b49d; border-radius:7px; background:#563b48; cursor:pointer;}
#study .fraction-parts button:hover,#study .fraction-parts button[aria-pressed="true"] {background:#de9f88;}
#study .fraction-output {font-size:34px!important; text-align:center;}
#study .fraction-equivalence {display:grid; grid-template-columns:repeat(var(--pieces),1fr); gap:3px; min-height:70px; margin:20px 0;}
#study .fraction-equivalence span {border:1px solid #d9a790; border-radius:5px; background:#382a40;}
#study .fraction-equivalence span.filled {background:#ddaa87;}
#study .fraction-comparison {margin-top:32px; padding-top:25px; border-top:1px solid #947181;}
#study .fraction-comparison > strong {color:#fff0e8; font:32px Georgia,serif;}
#study .fraction-comparison > span {margin:0 15px; color:#e5c4ae;}
#study .fraction-comparison .basic-options {margin-top:18px;}
#study .decimal-visual {display:grid; grid-template-columns:repeat(4,auto); gap:6px; align-items:center; color:#fff1ec; font:65px Georgia,serif;}
#study .decimal-visual span {padding:4px 14px; border:1px solid #e4bdc4; border-radius:7px; background:#704958;}
#study .decimal-visual i {font-style:normal;}
#study .decimal-visual small {grid-column:1/-1; color:#efdee0; font:14px system-ui,sans-serif; text-align:center;}
#study .decimal-table {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px;}
#study .decimal-table > div {color:#f2d8df; font:650 14px/1.4 system-ui,sans-serif; text-align:center; overflow-wrap:anywhere;}
#study .decimal-table button {min-height:80px; border:1px solid #e8b9cf; border-radius:9px; background:#69475d; color:#fff1ed; font:37px Georgia,serif; cursor:pointer;}
#study .decimal-table button:hover,#study .decimal-table button[aria-pressed="true"] {background:#8f6178;}
#study .decimal-conversion {margin:22px 0; padding:22px; border:1px solid #c99faf; border-radius:9px; background:#614354; color:#fff1ec; font:28px Georgia,serif;}
#study .decimal-minilesson {padding-top:18px; border-top:1px solid #957180;}
#study .decimal-minilesson strong {color:#f4d4df; font:22px Georgia,serif;}
#study .power-visual {display:grid; place-items:center; gap:6px;}
#study .power-visual > span {color:#e8ceef; font:75px Georgia,serif;}
#study .power-visual small {color:#f4e7e8; font:20px Georgia,serif;}
#study .power-cubes {max-width:290px; color:#dec0ed; font:28px/1.4 Georgia,serif; text-align:center; letter-spacing:.16em;}
#study .power-controls {display:grid; grid-template-columns:1fr 1fr; gap:20px;}
#study .power-result {display:grid; gap:10px; margin-top:25px; padding:22px; border:1px solid #ab87aa; border-radius:10px; background:#513c56;}
#study .power-result strong {color:#f9e8fa; font:26px/1.35 Georgia,serif;}
#study .power-result span {color:#eddde9; font:15px/1.5 system-ui,sans-serif;}
#study .root-panel {display:grid; grid-template-columns:minmax(135px,220px) 1fr; align-items:center; gap:25px; margin-top:25px;}
#study .square-diagram {display:grid; grid-template-columns:repeat(var(--cells),1fr); gap:2px; aspect-ratio:1; width:min(100%,220px); padding:9px; border:1px solid #c8a1cb; border-radius:9px; background:#503a52;}
#study .square-diagram span {border:1px solid #e6c4e8; background:#9475a0;}
#study .root-panel strong {color:#f0daf3; font:34px Georgia,serif;}
/* Padrões, receita, variação direta e inversa. */
#study .divisor-visual {display:grid; grid-template-columns:1fr 1fr; gap:24px; align-items:center; color:#f4eade;}
#study .divisor-visual > span {color:#e0e7bd; font:80px Georgia,serif;}
#study .divisor-visual > div {font:20px/1.7 Georgia,serif;}
#study .basic-number-input,#study .convert-controls label {display:grid; gap:8px; color:#f2e5e3; font:650 15px system-ui,sans-serif;}
#study .basic-number-input input,#study .convert-controls input,#study .convert-controls select {min-height:47px; max-width:330px; padding:9px 12px; border:1px solid #ae8e9b; border-radius:8px; background:#493449; color:#fff3ec; font:18px system-ui,sans-serif;}
#study .scan-grid {display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:20px;}
#study .scan-item {display:grid; gap:5px; min-width:0; padding:12px 8px; border:1px solid #8b7981; border-radius:8px; background:#493848; text-align:center;}
#study .scan-item[data-divides="true"] {border-color:#bdcf9e; background:#425041;}
#study .scan-item strong {color:#fff5ec; font:19px Georgia,serif;}.scan-item span {color:#e8f3dc; font:750 15px system-ui,sans-serif;}.scan-item small {color:#e4dce1; font:12px/1.35 system-ui,sans-serif;}
#study .sieve-grid {display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:7px; margin:24px 0 0;}
#study .sieve-grid span {display:grid; place-items:center; min-height:44px; border:1px solid #c9d7b2; border-radius:7px; background:#4d5148; color:#f7f0e5; font:600 16px system-ui,sans-serif;}
#study .sieve-grid span.eliminated {border-color:#907e85; background:#44373f; color:#e2d2d6; text-decoration:line-through;}
#study .factor-panel {margin-top:24px; padding-top:21px; border-top:1px solid #8e8183;}
#study .factor-panel > div:not(.basic-options) {margin:18px 0; color:#f3eedc; font:25px Georgia,serif;}
#study .recipe-visual {display:grid; gap:10px; text-align:center;}.recipe-visual span {color:#f3dec1; font:38px Georgia,serif; letter-spacing:.2em;}.recipe-visual strong {color:#fff0db; font:35px Georgia,serif;}.recipe-visual small {color:#f2e6df; font:16px system-ui,sans-serif;}
#study .recipe-output {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:25px;}
#study .recipe-output > div,#study .sale-display > div {display:grid; gap:9px; padding:20px 12px; border:1px solid #ad9083; border-radius:9px; background:#534249;}
#study .recipe-output span,#study .sale-display span {color:#f1e4db; font:600 14px system-ui,sans-serif;}
#study .recipe-output strong,#study .sale-display strong {color:#fff1dd; font:27px Georgia,serif;}
#study .ratio-linked {margin-top:25px; padding:22px; border:1px solid #bea996; border-radius:10px; background:#564349;}
#study .ratio-linked strong {color:#fff0d6; font:24px Georgia,serif;}
#study .ratio-bar {display:flex; flex-wrap:wrap; gap:3px; margin-top:17px;}.ratio-bar span,.ratio-bar i {display:block; width:20px; height:33px; border:1px solid #e7cc9f; border-radius:3px; background:#ddbb89;}.ratio-bar i {background:#866e67;}
#study .variation-visual {display:grid; gap:17px; width:min(100%,420px);}.variation-visual div {display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px; border:1px solid #d9ab9f; border-radius:9px; background:#664752; color:#fff0e9; font:650 17px system-ui,sans-serif;}.variation-visual span {font-size:29px; color:#ffdac1;}
#study .relation-output {margin-top:20px; padding:21px; border:1px solid #b78b83; border-radius:9px; background:#594049;}.relation-output strong {color:#ffe2cb; font:27px Georgia,serif;}.relation-output p {margin:7px 0 0;}
#study .rule-three-panels {display:grid; grid-template-columns:1fr 1fr; gap:14px;}.rule-three-panels > div {min-width:0; padding:21px; border:1px solid #a27f7f; border-radius:10px; background:#493440;}.rule-three-panels strong {color:#ffe9df; font:23px Georgia,serif;}.rule-three-panels p {min-height:60px;}
/* Aplicações: descontos, unidades, escalas e linguagem algébrica. */
#study .sale-ticket {display:grid; gap:13px; min-width:min(100%,320px); padding:30px; border:1px dashed #d3dda7; border-radius:13px; background:#5a4851; color:#fff5e8;}.sale-ticket span {font:750 14px system-ui,sans-serif; letter-spacing:.14em;}.sale-ticket strong {font:54px Georgia,serif;}.sale-ticket small {font:23px Georgia,serif;}
#study .sale-display {display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:23px;}
#study .percent-track {height:25px; margin-top:20px; border:1px solid #af9d91; border-radius:25px; background:#584452; overflow:hidden;}.percent-track span {display:block; height:100%; background:#ced7a5; transition:width .3s;}
#study .percent-change {margin-top:22px; padding:25px; border:1px solid #b1ab92; border-radius:9px; background:#52444c; color:#fff0de; font:25px Georgia,serif;}
#study .measure-visual {display:grid; gap:4px; text-align:center;}.measure-visual span,.measure-visual strong {color:#ffead2; font:52px Georgia,serif;}.measure-visual i {color:#e9c28b; font:32px Georgia,serif;}.measure-visual small {color:#f5e9e0; font:15px system-ui,sans-serif;}
#study .convert-controls {display:grid; grid-template-columns:1.5fr .8fr; gap:14px;}.convert-controls select,.convert-controls input {width:100%;}
#study .convert-result {margin-top:20px; padding:22px; border:1px solid #bf9c83; border-radius:9px; background:#59414a; color:#fff0df; font:29px/1.3 Georgia,serif; overflow-wrap:anywhere;}
#study .unit-question {margin-bottom:17px; color:#ffebd7; font:25px Georgia,serif;}
#study .scale-visual {display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; width:100%; border-bottom:2px solid #d7b8e2; padding-bottom:24px;}.scale-visual span {position:relative; color:#f9e6fa; font:17px Georgia,serif;}.scale-visual span::after {content:""; position:absolute; bottom:-32px; left:50%; width:12px; height:12px; border-radius:50%; background:#e3c3eb; transform:translateX(-50%);}
#study .scale-stations {margin-bottom:18px;}.scale-detail {min-height:130px; padding:22px; border:1px solid #ae8bbd; border-radius:10px; background:#523c5d;}.scale-detail strong {color:#f8e7ff; font:30px Georgia,serif;}.scale-detail p {margin:8px 0 0;}
#study .science-transform {display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:25px; padding:25px; border:1px solid #ad85bd; border-radius:10px; background:#533c5b; color:#fff1f9; font:25px Georgia,serif;}.science-transform strong {color:#f6d5fa;}.science-transform small {flex:0 0 100%; color:#eddbe9; font:15px/1.55 system-ui,sans-serif;}
#study .algebra-machine {display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:9px;}.algebra-machine span,.algebra-machine strong {padding:17px; border:1px solid #e0b293; border-radius:10px; background:#745251; color:#fff0dc; font:28px Georgia,serif;}.algebra-machine strong {background:#5b4050;}.algebra-machine i {color:#e8c7af; font:23px Georgia,serif;}
#study .machine-result {display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-top:22px; padding:22px; border:1px solid #c6a18d; border-radius:10px; background:#59404a;}.machine-result span {color:#fff0e5; font:24px Georgia,serif;}.machine-result strong {color:#ffe6ba; font:42px Georgia,serif;}
#study .algebra-phrase {color:#fff0e7!important; font-size:25px!important;}.balance-demo {margin-top:26px; padding-top:22px; border-top:1px solid #aa8c8f;}.balance-sides {display:flex; justify-content:space-around; align-items:center; flex-wrap:wrap; gap:10px; margin:12px 0 22px;}.balance-sides strong {padding:13px; border-bottom:3px solid #dfb6a0; color:#fff0e4; font:24px Georgia,serif;}.balance-sides span {color:#f4d4aa; font-size:29px;}
@media(max-width:960px){
  #qg .basic-topic-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  #study .basic-challenge-grid {grid-template-columns:1fr;}
  #study .basic-challenge-card h3 {min-height:0;}
}
@media(max-width:720px){
  #study[data-lesson^="basic-"] .study-heading {margin:24px 0 57px; padding:35px 22px;}
  #study[data-lesson^="basic-"] .study-heading::after {font-size:61px; max-width:45%; opacity:.7; top:6%;}
  #study .basic-intro,#study .basic-main,#study .basic-deeper {display:grid; grid-template-columns:1fr; gap:23px;}
  #study .basic-deeper > .basic-section-heading,#study .basic-deeper > .basic-workbench {grid-column:1; grid-row:auto;}
  #study .basic-visual {min-height:220px;}
  #study .basic-summary ol {grid-template-columns:1fr;}
  #study .basic-end-nav {flex-direction:column; gap:3px;}
  #study .sieve-grid {grid-template-columns:repeat(6,minmax(0,1fr));}
  #study .rule-three-panels {grid-template-columns:1fr;}
  #study .rule-three-panels p {min-height:0;}
}
@media(max-width:480px){
  #qg .basic-topic-grid {grid-template-columns:1fr;}
  #qg .basic-topic-card {min-height:84px;}
  #study .basic-section {margin-bottom:80px;}
  #study .basic-main .basic-lab,#study .basic-workbench {padding:21px 17px;}
  #study .basic-lesson .basic-choice {max-width:100%;}
  #study .recipe-output,#study .sale-display,#study .convert-controls,#study .power-controls {grid-template-columns:1fr;}
  #study .recipe-output > div {padding:12px;}
  #study .scan-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  #study .root-panel {grid-template-columns:1fr;}
  #study .science-transform {font-size:20px;}
  #study .fraction-parts button {height:78px;}
  #study .decimal-visual {font-size:46px;}
  #study .decimal-visual span {padding:4px 8px;}
  #study .order-expression {gap:5px;font-size:39px;}
  #study .order-operator {width:38px;height:38px;font-size:26px;}
}
@media(prefers-reduced-motion:no-preference){
  #study .basic-feedback[data-correct],#study .basic-complete:not([hidden]),#study .basic-visual {animation:basic-reveal .34s ease;}
  @keyframes basic-reveal {from{opacity:.55;transform:translateY(5px)}to{opacity:1;transform:none}}
}
@media(prefers-reduced-motion:reduce){
  #study .basic-lesson *,#study .basic-lesson *::before,#study .basic-lesson *::after {animation:none!important;transition:none!important;scroll-behavior:auto!important;}
  #study .basic-lesson :is(.basic-choice,.basic-button):hover {transform:none;}
}
