/* Aritmética e Álgebra: identidade-piloto para a Fase 1. */
#study.algebra-pilot-active { --algebra-ink:#f4f1fa; --algebra-muted:#c2bbd0; --algebra-panel:#17151f; --algebra-line:#40364f; --algebra-violet:#ba8cff; --algebra-magenta:#ec83c5; background:#111018; color:var(--algebra-ink); }
#study.algebra-pilot-active .study-page { background:radial-gradient(ellipse at 82% 9%,rgba(89,51,128,.19),transparent 33%),linear-gradient(180deg,#111018 0%,#14121c 44%,#100f17 100%); }
#study.algebra-pilot-active .study-toolbar { border-color:#393140; }
#study.algebra-pilot-active .study-back,#study.algebra-pilot-active .study-central { color:#d0c8dc; }
#study.algebra-pilot-active .study-back:hover,#study.algebra-pilot-active .study-central:hover { color:#fff; }
#study.algebra-pilot-active .study-heading { position:relative; display:block; margin:42px 0 55px; padding:38px clamp(22px,5vw,66px) 45px; overflow:hidden; border:1px solid #43354f; border-left:3px solid #bd83e6; border-radius:17px; background:radial-gradient(circle at 84% 45%,rgba(127,77,174,.18),transparent 34%),linear-gradient(118deg,#211a2c,#17151f 72%); }
#study.algebra-pilot-active .study-heading::after { content:"x   y     f(x)"; position:absolute; right:2%; top:14%; color:rgba(208,169,255,.07); font:clamp(54px,9vw,125px)/1 Georgia,serif; letter-spacing:.03em; pointer-events:none; }
#study.algebra-pilot-active .study-heading :is(h1,.study-kicker,#study-subtitle,.study-start-button) { position:relative; z-index:1; }
#study.algebra-pilot-active .study-heading .study-kicker { margin:0 0 19px; color:#dda8ed; font:750 12px/1.4 system-ui,sans-serif; letter-spacing:.17em; }
#study.algebra-pilot-active .study-heading h1 { max-width:800px; color:#fbf8ff; font-size:clamp(42px,6vw,76px); line-height:1.02; letter-spacing:-.045em; }
#study.algebra-pilot-active .study-heading #study-subtitle { max-width:710px; margin:17px 0 0; color:#d3c9dc; font-size:clamp(17px,2vw,21px); line-height:1.6; }
#study.algebra-pilot-active .study-start-button { margin-top:25px; border-color:#6e4a86; color:#fff; background:#4a2d5a; }
#study.algebra-pilot-active .study-start-button:hover { background:#5c3970; }
#study.algebra-pilot-active .study-reading { max-width:1180px; }
.algebra-lesson { --al-ink:#f4f1fa; --al-muted:#c2bbd0; --al-panel:#191720; --al-panel-2:#211b2b; --al-line:#41374c; --al-violet:#c39af5; --al-pink:#f09bd3; color:var(--al-ink); font-family:Inter,system-ui,sans-serif; }
.algebra-lesson :is(h2,h3,p,ul,ol) { margin-top:0; }
.algebra-lesson h2 { margin-bottom:13px; color:#faf7ff; font-size:clamp(25px,3vw,36px); line-height:1.14; letter-spacing:-.025em; }
.algebra-lesson h3 { color:#f6f1fc; font-size:19px; }
.algebra-lesson p,.algebra-lesson li { color:var(--al-muted); font-size:16px; line-height:1.75; }
.algebra-lesson strong { color:#fff; }
.algebra-overline { margin:0 0 12px !important; color:#d7a2ed !important; font-size:11px !important; font-weight:800; letter-spacing:.16em; }
.algebra-opening { position:relative; display:grid; grid-template-columns:minmax(0,1.15fr) minmax(220px,.7fr); gap:35px; align-items:center; padding:clamp(25px,5vw,58px); overflow:hidden; border:1px solid #4a3b5a; border-radius:19px; background:radial-gradient(circle at 90% 12%,rgba(148,80,180,.2),transparent 31%),linear-gradient(120deg,#211b2b,#17151f 77%); }
.algebra-opening-copy { max-width:680px; }
.algebra-opening-copy > p:not(.algebra-overline) { font-size:17px; }
.algebra-question { margin:22px 0 0 !important; padding:14px 18px; border-left:2px solid var(--al-pink); background:rgba(255,255,255,.035); }
.algebra-question strong { color:#e1b5f1; font-size:12px; letter-spacing:.1em; text-transform:uppercase; }
.algebra-mark { position:relative; display:flex; align-items:center; justify-content:center; gap:12px; min-height:210px; color:#f8eefa; font:clamp(40px,6vw,73px)/1 Georgia,serif; }
.algebra-mark span { padding:17px 15px; border:1px solid #604873; border-radius:14px; background:linear-gradient(145deg,#32223d,#211925); box-shadow:0 15px 40px #0b0910; }
.algebra-mark i { color:#e595cb; font-style:normal; }
.algebra-mark b { position:absolute; right:5%; bottom:2%; color:#bd91ea; font:45px/1 Georgia,serif; transform:rotate(-35deg); }
.algebra-objectives { display:grid; grid-template-columns:minmax(190px,.55fr) 1.4fr; gap:24px; align-items:start; margin:30px 0 72px; padding:23px 28px; border:1px solid #373140; border-radius:15px; background:#17151e; }
.algebra-objectives h2 { font-size:21px; }
.algebra-objectives ul { display:grid; grid-template-columns:1fr 1fr; gap:9px 24px; margin:0; padding-left:20px; }
.algebra-objectives li { font-size:14px; line-height:1.55; }
.algebra-concept,.algebra-translation { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(245px,.65fr); gap:34px; align-items:center; margin:0 0 70px; }
.algebra-concept > div:first-child,.algebra-translation-copy { max-width:720px; }
.algebra-note { padding:24px; border:1px solid #54415f; border-radius:15px; background:linear-gradient(145deg,#241d2d,#191720); }
.algebra-note > span { display:block; margin-bottom:16px; color:#d7a2ed; font-size:10px; font-weight:800; letter-spacing:.15em; }
.algebra-note > strong { display:block; color:#fbf7ff; font:42px/1.2 Georgia,serif; }
.algebra-note > strong em { color:#e6a4d6; font-style:normal; }
.algebra-note > strong b { color:#b99be0; font-weight:400; }
.algebra-note p { margin:10px 0 0; font-size:13px; }
.algebra-live { margin:0 0 72px; padding:clamp(23px,4vw,43px); border:1px solid #554268; border-radius:20px; background:radial-gradient(circle at 92% 7%,rgba(141,83,174,.16),transparent 29%),#17151f; box-shadow:0 23px 70px rgba(5,4,9,.2); }
.algebra-live-heading { max-width:720px; }
.algebra-live-stage { display:grid; grid-template-columns:minmax(240px,.8fr) minmax(260px,1fr); gap:24px; margin-top:25px; }
.algebra-slider-wrap,.algebra-substitution { padding:23px; border:1px solid #40364c; border-radius:14px; background:#111018; }
.algebra-slider-wrap label { color:#f7f1ff; font-size:16px; }
.algebra-slider-line { display:grid; grid-template-columns:42px 1fr 42px; gap:12px; align-items:center; margin:18px 0 0; }
.algebra-step,.algebra-action,.algebra-builder button,.algebra-options button { min-height:44px; border:1px solid #5a4768; border-radius:10px; color:#fbf7ff; background:#282130; font:inherit; font-size:15px; font-weight:650; cursor:pointer; transition:background .18s ease,border-color .18s ease,transform .18s ease; }
.algebra-step:hover,.algebra-action:hover,.algebra-builder button:hover,.algebra-options button:hover { border-color:#c198e0; background:#382a43; }
.algebra-step:active,.algebra-action:active { transform:translateY(1px); }
.algebra-step:focus-visible,.algebra-action:focus-visible,.algebra-builder button:focus-visible,.algebra-options button:focus-visible,.algebra-examples summary:focus-visible,.algebra-meaning summary:focus-visible { outline:3px solid #e4a8d4; outline-offset:3px; }
.algebra-slider-line input { width:100%; accent-color:#c794ed; }
.algebra-slider-wrap > p { margin:10px 0 0; font-size:12px; }
.algebra-ticks { display:flex; justify-content:space-between; color:#b8adc5; font-size:12px; }
.algebra-substitution { display:grid; grid-template-columns:minmax(120px,.65fr) 1fr; gap:15px; align-items:center; }
.algebra-live-expression { color:#e9c4fa; font:clamp(30px,4vw,45px)/1.15 Georgia,serif; }
.algebra-substitution ol { margin:0; padding-left:23px; }
.algebra-substitution li { padding:5px 0; color:#c7bbd3; font:17px/1.5 ui-monospace,monospace; }
.algebra-substitution li::marker { color:#a888c7; }
.algebra-substitution .algebra-result { color:#fff; font-size:25px; font-weight:800; }
.algebra-insight { margin:17px 0 0 !important; padding:13px 16px; border-left:2px solid #c897e9; color:#d9cfe2 !important; background:rgba(187,142,222,.065); }
.algebra-insight strong { color:#ebc8fa; }
.algebra-translation { grid-template-columns:.8fr 1fr; margin-bottom:76px; }
.algebra-builder { padding:24px; border:1px solid #4c3e57; border-radius:16px; background:linear-gradient(145deg,#211b29,#17151f); }
.algebra-pieces { display:flex; flex-wrap:wrap; gap:10px; }
.algebra-pieces button { min-width:51px; padding:7px 14px; color:#f3dafa; font:26px/1.2 Georgia,serif; }
.algebra-built-label { margin-top:22px; color:#c4a5da; font-size:10px; font-weight:800; letter-spacing:.14em; }
.algebra-built { display:block; min-height:63px; margin:8px 0 14px; padding:13px; border:1px dashed #68537a; border-radius:10px; color:#fff; background:#14111a; font:29px/1.3 Georgia,serif; }
.algebra-builder-actions { display:flex; gap:10px; }
.algebra-action { padding:9px 15px; font-size:13px; }
.algebra-action-primary { border-color:#835da0 !important; background:#4b3260 !important; }
.algebra-action-primary:hover { background:#624177 !important; }
.algebra-action:disabled { border-color:#38333d; color:#958d9b; background:#201d24; cursor:not-allowed; }
.algebra-feedback { min-height:1.5em; margin:13px 0 0 !important; color:#e7c3f1 !important; font-size:14px !important; line-height:1.55 !important; }
.algebra-feedback.is-correct { color:#b9f0d4 !important; }
.algebra-feedback.is-incorrect { color:#ffb5c2 !important; }
.algebra-meaning { margin:0 0 72px; padding:35px clamp(22px,4vw,42px); border-top:1px solid #44394f; border-bottom:1px solid #44394f; background:linear-gradient(90deg,rgba(45,34,56,.52),transparent); }
.algebra-meaning-head { max-width:700px; margin-bottom:26px; }
.algebra-meaning-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:15px; }
.algebra-meaning-grid article { position:relative; padding:22px; border:1px solid #40364a; border-radius:14px; background:#18161f; }
.algebra-index { color:#dfa3dd; font:italic 22px Georgia,serif; }
.algebra-meaning-grid h3 { margin:12px 0 8px; }
.algebra-meaning-grid p { font-size:14px; }
.algebra-equation { padding:10px; border-radius:8px; color:#f0d2ff; background:#111018; font:19px/1.4 ui-monospace,monospace; text-align:center; }
.algebra-equation span { color:#ed9fcf; }
.algebra-lesson details { margin-top:14px; }
.algebra-lesson summary { color:#e7c5f2; font-size:14px; font-weight:700; cursor:pointer; }
.algebra-detail { padding:12px 14px 1px; border-left:1px solid #8b6a9b; }
.algebra-detail p { margin-bottom:9px; font-size:14px; }
.algebra-example-zone { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(0,1.3fr); gap:30px; margin:0 0 73px; }
.algebra-examples details { margin:0 0 10px; padding:15px 18px; border:1px solid #3e3647; border-radius:12px; background:#191720; }
.algebra-examples summary { color:#f0e8f5; font-weight:700; cursor:pointer; }
.algebra-examples .algebra-detail { margin-top:12px; }
.algebra-errors { display:grid; grid-template-columns:minmax(220px,.75fr) minmax(0,1.25fr); gap:30px; margin:0 0 72px; padding:clamp(23px,4vw,40px); border:1px solid #624050; border-radius:17px; background:linear-gradient(120deg,#2b1924,#19151d 76%); }
.algebra-errors .algebra-overline { color:#f09abd !important; }
.algebra-errors ul { margin:0; padding-left:20px; }
.algebra-errors li { padding:0 0 11px 4px; font-size:14px; }
.algebra-errors li::marker { color:#e797bb; }
.algebra-guided { margin:0 0 72px; padding:clamp(23px,4vw,42px); border-left:3px solid #c394e7; border-radius:0 15px 15px 0; background:#1b1722; }
.algebra-guided > p,.algebra-guided li { max-width:850px; }
.algebra-guided ol { margin-bottom:17px; padding-left:24px; }
.algebra-train,.algebra-challenge { margin:0 0 55px; padding:clamp(23px,4vw,43px); border:1px solid #493a59; border-radius:20px; background:radial-gradient(circle at 100% 0,rgba(122,80,156,.14),transparent 27%),#17151f; }
.algebra-section-head { display:flex; justify-content:space-between; gap:22px; align-items:flex-start; }
.algebra-section-head > div:first-child { max-width:690px; }
.algebra-section-head h2 { font-size:clamp(30px,4vw,44px); letter-spacing:.015em; }
.algebra-progress { min-width:130px; color:#d7cbe0; font-size:12px; text-align:right; }
.algebra-progress-track { height:5px; margin-top:10px; overflow:hidden; border-radius:99px; background:#332d39; }
.algebra-progress-track span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#a875ce,#ed8fc8); transition:width .25s ease; }
.algebra-question-count { margin:0 0 9px !important; color:#d3a4e7 !important; font-size:10px !important; font-weight:800; letter-spacing:.14em; }
.algebra-quiz { margin-top:19px; padding:24px; border:1px solid #42374c; border-radius:14px; background:#111018; }
.algebra-quiz h3 { margin-bottom:17px; }
.algebra-options { display:flex; flex-wrap:wrap; gap:10px; margin:14px 0 17px; }
.algebra-options button { padding:10px 14px; font-size:14px; }
.algebra-options button[aria-pressed="true"] { border-color:#cd91e9; background:#4b3260; box-shadow:0 0 0 1px #cd91e9; }
.algebra-quiz-complete { padding:8px 0; }
.algebra-quiz-complete strong { color:#c8f4d9; font-size:20px; }
.algebra-quiz-complete a { color:#e5c3fa; font-weight:700; }
.algebra-challenge { position:relative; border-color:#71425e; background:radial-gradient(circle at 100% 0,rgba(197,76,155,.17),transparent 31%),linear-gradient(145deg,#211722,#17151f 75%); }
.algebra-challenge .algebra-overline { color:#f0a3d4 !important; }
.algebra-challenge-mark { color:rgba(230,152,210,.32); font:clamp(45px,8vw,85px)/1 Georgia,serif; }
.algebra-challenges { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:22px; }
.algebra-challenge-card { padding:20px; border:1px solid #533a50; border-radius:14px; background:rgba(16,14,21,.72); }
.algebra-challenge-card h3 { margin-bottom:10px; }
.algebra-challenge-card > p:not(.algebra-feedback):not(.algebra-question-count) { font-size:14px; }
.algebra-challenge-card .algebra-options { display:grid; }
.algebra-challenge-card .algebra-options button { text-align:left; }
.algebra-summary { margin:0 0 30px; padding-top:23px; border-top:1px solid #443a4c; }
.algebra-summary-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:11px; }
.algebra-summary-grid p { padding:16px; border:1px solid #3e3548; border-radius:12px; background:#191720; font-size:13px; }
.algebra-summary-grid strong { color:#e5baf1; }
.algebra-next { display:flex; flex-direction:column; gap:8px; margin-top:22px; padding:22px; border:1px solid #6d4b78; border-radius:14px; background:linear-gradient(110deg,#2b2036,#201923); }
.algebra-next span { color:#d9a9e9; font-size:10px; font-weight:800; letter-spacing:.14em; }
.algebra-next strong { font-size:20px; }
.algebra-next p { margin:0; font-size:13px; }
.algebra-phase-entry { position:relative; padding:clamp(24px,5vw,48px); overflow:hidden; border:1px solid #463650; border-radius:18px; background:radial-gradient(circle at 88% 15%,rgba(128,76,161,.16),transparent 33%),linear-gradient(130deg,#211a2b,#17151e); }
.algebra-phase-label { margin:0 0 10px; color:#d49de6; font-size:10px; font-weight:800; letter-spacing:.16em; }
.algebra-phase-entry h3 { margin:0; color:#f5ecfb; font-size:clamp(22px,3vw,29px); }
.algebra-phase-entry > p:not(.algebra-phase-label) { max-width:640px; color:#c8bfce; font-size:15px; line-height:1.65; }
.algebra-pilot-link { display:grid; max-width:720px; margin-top:23px; border-color:#715580 !important; background:rgba(21,18,28,.86) !important; }
.algebra-pilot-link strong { color:#fff !important; }
.algebra-pilot-link p { color:#c8bfce !important; }

@media (max-width:760px) {
  .algebra-opening,.algebra-concept,.algebra-translation,.algebra-example-zone,.algebra-errors { grid-template-columns:1fr; }
  .algebra-opening { gap:8px; }
  .algebra-mark { min-height:120px; justify-content:flex-start; padding-left:9%; }
  .algebra-objectives { grid-template-columns:1fr; gap:6px; margin-bottom:55px; }
  .algebra-objectives ul { grid-template-columns:1fr; }
  .algebra-live-stage { grid-template-columns:1fr; }
  .algebra-substitution { grid-template-columns:1fr; }
  .algebra-meaning-grid,.algebra-challenges { grid-template-columns:1fr; }
  .algebra-summary-grid { grid-template-columns:1fr 1fr; }
  #study.algebra-pilot-active .study-heading { margin:25px 0 37px; padding:30px 22px; }
  #study.algebra-pilot-active .study-heading::after { top:5%; right:2%; font-size:61px; opacity:.65; }
}
@media (max-width:430px) {
  .algebra-lesson p,.algebra-lesson li { font-size:15px; }
  .algebra-opening { padding:24px 19px; }
  .algebra-live,.algebra-train,.algebra-challenge { padding:21px 17px; }
  .algebra-slider-wrap,.algebra-substitution,.algebra-quiz { padding:17px; }
  .algebra-summary-grid { grid-template-columns:1fr; }
  .algebra-section-head { flex-direction:column; }
  .algebra-progress { width:100%; text-align:left; }
  .algebra-builder-actions { flex-wrap:wrap; }
  #study.algebra-pilot-active .study-heading h1 { font-size:clamp(38px,11vw,52px); }
}
@media (prefers-reduced-motion:reduce) {
  .algebra-lesson *,#study.algebra-pilot-active * { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}

/* Refinamento: categoria integrada ao QG e aula organizada como um percurso. */
#study.algebra-pilot-active { background:#15121b; }
#study.algebra-pilot-active .study-page { background:radial-gradient(ellipse at 76% 8%,rgba(89,51,128,.14),transparent 34%),linear-gradient(180deg,#17141d 0%,#191620 48%,#15121b 100%); }
#study.algebra-pilot-active .study-heading { margin:30px 0 36px; padding:29px clamp(24px,4.5vw,54px) 31px; border-color:#40344d; background:radial-gradient(circle at 84% 38%,rgba(127,77,174,.13),transparent 34%),linear-gradient(120deg,#241e2b,#1c1922 73%); }
#study.algebra-pilot-active .study-heading::after { top:12%; color:rgba(208,169,255,.025); font-size:clamp(48px,7vw,96px); }
#study.algebra-pilot-active .study-heading .study-kicker { margin-bottom:14px; }
#study.algebra-pilot-active .study-heading h1 { max-width:760px; font-size:clamp(40px,5.2vw,65px); }
#study.algebra-pilot-active .study-heading #study-subtitle { margin-top:12px; font-size:clamp(16px,1.8vw,19px); }
#study.algebra-pilot-active .study-start-button { min-height:43px; margin-top:17px; padding:9px 16px; border-color:#76578a; background:linear-gradient(120deg,#533866,#3c2b48); box-shadow:0 5px 16px rgba(12,8,17,.16); }
.algebra-lesson { width:min(100%,1120px); margin-inline:auto; padding-inline:clamp(12px,2.2vw,27px); display:flex; flex-direction:column; gap:clamp(42px,5.3vw,61px); }
.algebra-lesson > * { width:100%; margin:0 !important; }
.algebra-lesson h2 { max-width:780px; }
.algebra-opening { grid-template-columns:minmax(0,1.15fr) minmax(190px,.62fr); gap:24px; padding:clamp(23px,3.5vw,42px); border-color:#4a3d55; background:radial-gradient(circle at 88% 13%,rgba(148,80,180,.12),transparent 34%),linear-gradient(120deg,#29232f,#211e28 78%); box-shadow:0 15px 34px rgba(8,6,12,.12); }
.algebra-opening-copy > p:not(.algebra-overline) { max-width:690px; }
.algebra-mark { min-height:145px; font-size:clamp(36px,5vw,61px); }
.algebra-mark span { padding:13px 12px; border-color:rgba(133,98,152,.58); background:linear-gradient(145deg,rgba(67,47,77,.8),rgba(42,35,49,.86)); box-shadow:0 9px 25px rgba(8,6,12,.24); }
.algebra-mark b { color:rgba(189,145,234,.56); }
.algebra-objectives { margin:0 !important; padding:19px 12px 20px; border:0; border-top:1px solid #453a4b; border-bottom:1px solid #453a4b; border-radius:0; background:linear-gradient(90deg,rgba(102,74,117,.09),transparent 75%); }
.algebra-concept { align-items:start; }
.algebra-terms { max-width:760px; margin-top:22px; padding:18px 20px; border-left:2px solid #a77dc2; background:linear-gradient(100deg,rgba(113,83,128,.12),rgba(113,83,128,.025)); }
.algebra-terms h3 { margin:0 0 8px; color:#e7c9f2; font-size:18px; }
.algebra-terms p { margin-bottom:8px; font-size:15px; }
.algebra-terms p:last-child { margin-bottom:0; }
.algebra-note { background:linear-gradient(145deg,rgba(61,48,70,.72),rgba(38,33,45,.8)); border-color:#554761; box-shadow:0 12px 26px rgba(8,6,12,.12); }
.algebra-live { padding:clamp(22px,3.3vw,37px); border-color:#51425e; background:radial-gradient(circle at 92% 7%,rgba(141,83,174,.11),transparent 31%),linear-gradient(135deg,#24202a,#1d1a24 78%); box-shadow:0 17px 38px rgba(8,6,12,.14); }
.algebra-expression-picker { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:18px; }
.algebra-expression-picker label { color:#e6dcec; font-size:13px; font-weight:700; }
.algebra-expression-picker select { min-height:44px; max-width:210px; padding:8px 36px 8px 12px; border:1px solid #675674; border-radius:10px; color:#fff7ff; background:#302938; font:inherit; }
.algebra-expression-picker select:focus-visible { outline:3px solid #e4a8d4; outline-offset:3px; }
.algebra-slider-wrap,.algebra-substitution { background:linear-gradient(145deg,#2b2631,#25212b); border-color:#4e4356; box-shadow:inset 0 1px rgba(255,255,255,.025); }
.algebra-translation-copy { max-width:690px; }
.algebra-builder { background:linear-gradient(145deg,rgba(58,48,65,.82),rgba(37,32,44,.92)); border-color:#574760; box-shadow:0 12px 26px rgba(8,6,12,.12); }
.algebra-built { background:linear-gradient(120deg,#2a2430,#25212a); border-color:#746080; }
.algebra-meaning { padding:27px 0; border-color:#453a4b; background:linear-gradient(90deg,rgba(86,66,98,.08),transparent 75%); }
.algebra-meaning-grid article,.algebra-examples details,.algebra-quiz { background:linear-gradient(145deg,rgba(48,42,56,.82),rgba(36,32,43,.92)); border-color:#494050; box-shadow:0 9px 22px rgba(8,6,12,.1); }
.algebra-examples details { padding:16px 19px; }
.algebra-equation { background:rgba(21,18,27,.42); }
.algebra-errors { padding:0; grid-template-columns:minmax(220px,.7fr) minmax(0,1.3fr); border:0; border-radius:0; background:linear-gradient(90deg,rgba(123,61,91,.085),transparent 78%); }
.algebra-errors > div:first-child { padding:10px 0; }
.algebra-error-list { display:grid; gap:9px; }
.algebra-error-list details { padding:13px 16px; border:1px solid rgba(135,84,111,.54); border-radius:12px; background:linear-gradient(135deg,rgba(66,44,57,.76),rgba(44,35,46,.83)); }
.algebra-error-list summary { color:#f1d9e7; }
.algebra-error-list .algebra-detail { margin-top:10px; }
.algebra-guided { padding:23px 26px; border:1px solid #4a3d53; border-left:3px solid #b38acb; border-radius:0 14px 14px 0; background:linear-gradient(105deg,rgba(82,62,94,.26),rgba(42,36,49,.46)); }
.algebra-train { border-color:#51425f; background:radial-gradient(circle at 100% 0,rgba(122,80,156,.12),transparent 29%),linear-gradient(135deg,#27222d,#201d27 78%); }
.algebra-challenge { border-color:#654859; background:radial-gradient(circle at 100% 0,rgba(197,76,155,.13),transparent 32%),linear-gradient(135deg,#2b222c,#211d27 78%); }
.algebra-challenge-card { background:linear-gradient(145deg,rgba(59,44,59,.76),rgba(39,32,43,.85)); border-color:#5d4558; box-shadow:0 9px 21px rgba(8,6,12,.1); }
.algebra-summary-grid p { background:linear-gradient(145deg,rgba(52,45,61,.78),rgba(38,34,46,.88)); border-color:#494052; }
.algebra-next { background:linear-gradient(110deg,rgba(74,55,88,.76),rgba(46,36,52,.9)); border-color:#725b80; }
.algebra-phase-entry { padding:25px 26px; overflow:visible; border:1px solid rgba(157,218,237,.23); border-radius:17px; background:linear-gradient(120deg,rgba(67,123,153,.12),rgba(255,255,255,.035)); box-shadow:0 10px 28px rgba(0,17,34,.12); }
.algebra-phase-label { color:#c7a1df; }
.algebra-phase-entry h3 { color:#f2f7fa; }
.algebra-phase-entry > p:not(.algebra-phase-label) { color:#c9dbe8; }
.algebra-pilot-link { max-width:760px; margin-top:19px; border-color:rgba(157,218,237,.33) !important; background:linear-gradient(120deg,rgba(67,123,153,.13),rgba(255,255,255,.045)) !important; }
.algebra-pilot-link .content-tag { display:inline-flex; width:max-content; max-width:100%; align-self:start; color:#d8b6e8; background:rgba(163,118,188,.13); }
.algebra-pilot-link::after { color:#cf9ce2; }
.algebra-pilot-link:hover,.algebra-pilot-link:focus-visible { border-color:#a783b9 !important; box-shadow:0 9px 24px rgba(0,17,34,.18),0 0 0 1px rgba(167,131,185,.22); }
.algebra-pilot-link strong { color:#f6fbff !important; }
.algebra-pilot-link p { color:#c9dbe8 !important; }
.algebra-pieces button:disabled,.algebra-options button:disabled { color:#a59aaa; background:#332e38; cursor:default; }
.algebra-quiz-complete { display:flex; flex-wrap:wrap; gap:11px; align-items:center; }
.algebra-quiz-complete p { flex-basis:100%; }
.algebra-quiz-complete a { padding:10px 0; }
.algebra-summary-grid { grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); }
.algebra-builder-actions { flex-wrap:wrap; }

@media (max-width:760px) {
  .algebra-lesson { gap:43px; padding-inline:8px; }
  .algebra-opening { grid-template-columns:1fr; padding:24px; }
  .algebra-mark { min-height:100px; }
  .algebra-objectives { padding-inline:3px; }
  .algebra-terms { padding:16px; }
  .algebra-errors { grid-template-columns:1fr; gap:10px; }
  .algebra-challenges { grid-template-columns:1fr; }
  #study.algebra-pilot-active .study-heading { margin:23px 0 30px; padding:25px 21px; }
  #study.algebra-pilot-active .study-heading::after { top:5%; right:2%; font-size:54px; opacity:.35; }
}
@media (max-width:430px) {
  .algebra-lesson { gap:37px; padding-inline:2px; }
  .algebra-opening { padding:21px 18px; }
  .algebra-expression-picker { align-items:stretch; }
  .algebra-expression-picker label { width:100%; }
  .algebra-expression-picker select { width:100%; max-width:none; }
  .algebra-expression-picker .algebra-action { width:100%; }
  .algebra-error-list details { padding:12px 13px; }
}

/* Revisão de percurso: superfícies contínuas, espaçamento e interações diversas. */
#study.algebra-pilot-active .study-page { background:radial-gradient(ellipse at 78% 4%,rgba(104,67,139,.15),transparent 35%),linear-gradient(180deg,#191620 0%,#1b1822 48%,#17151e 100%); }
#study.algebra-pilot-active .study-heading { margin:26px 0 43px; padding:25px clamp(22px,4vw,48px) 27px; border:1px solid #443b4d; border-left:2px solid #a77ac0; border-radius:16px; background:radial-gradient(circle at 82% 40%,rgba(127,77,174,.1),transparent 32%),linear-gradient(120deg,#292330,#211e28 75%); }
#study.algebra-pilot-active .study-heading h1 { max-width:690px; font-size:clamp(36px,4.7vw,58px); line-height:1.06; }
#study.algebra-pilot-active .study-heading::after { top:18%; right:4%; color:rgba(208,169,255,.018); font-size:clamp(36px,5vw,64px); }
#study.algebra-pilot-active .study-heading .study-kicker { margin-bottom:10px; }
#study.algebra-pilot-active .study-heading #study-subtitle { max-width:650px; margin-top:9px; font-size:clamp(15px,1.5vw,17px); }
#study.algebra-pilot-active .study-start-button { margin-top:13px; }
.algebra-lesson { gap:clamp(38px,4.8vw,55px); overflow:hidden; }
.algebra-lesson > * { min-width:0; }
.algebra-lesson h2 { overflow-wrap:anywhere; }
.algebra-opening,.algebra-live,.algebra-train,.algebra-challenge { border-color:rgba(123,103,137,.48); }
.algebra-opening { grid-template-columns:minmax(0,1fr) minmax(140px,.38fr); gap:20px; background:radial-gradient(circle at 90% 12%,rgba(148,80,180,.1),transparent 31%),linear-gradient(120deg,#292430,#24212b 78%); }
.algebra-mark { opacity:.68; font-size:clamp(30px,3.8vw,45px); }
.algebra-mark span { padding:9px 10px; border-color:rgba(133,98,152,.4); background:linear-gradient(145deg,rgba(67,47,77,.5),rgba(42,35,49,.52)); }
.algebra-mark b { font-size:.5em; }
.algebra-objectives { border:0; padding:8px 3px; background:linear-gradient(90deg,rgba(102,74,117,.07),transparent 65%); }
.algebra-meaning { padding:7px 0; border:0; background:transparent; }
.algebra-meaning-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr)); gap:13px; }
.algebra-meaning-grid article { min-width:0; padding:19px; background:linear-gradient(145deg,rgba(48,42,56,.72),rgba(36,32,43,.77)); }
.algebra-errors { gap:clamp(22px,4vw,48px); background:linear-gradient(90deg,rgba(123,61,91,.055),transparent 70%); }
.algebra-error-card { min-width:0; padding:20px clamp(17px,3vw,27px); border:1px solid rgba(135,84,111,.46); border-radius:14px; background:linear-gradient(135deg,rgba(55,43,57,.64),rgba(39,34,45,.72)); }
.algebra-error-count,.algebra-contexts .algebra-overline { color:#d6a9d9 !important; font-size:11px !important; font-weight:800; letter-spacing:.13em; }
.algebra-error-card h3 { overflow-wrap:anywhere; }
.algebra-error-card [hidden] { display:none !important; }
.algebra-anatomy-buttons,.algebra-truefalse [role=group] { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.algebra-anatomy-buttons button,.algebra-truefalse button { min-width:46px; min-height:44px; padding:9px 15px; border:1px solid #65546e; border-radius:10px; color:#f6eef9; background:linear-gradient(145deg,#36303d,#2b2732); font:inherit; font-weight:750; cursor:pointer; }
.algebra-anatomy-buttons button:hover,.algebra-truefalse button:hover,.algebra-anatomy-buttons button[aria-pressed=true] { border-color:#bd8ecb; background:#46354b; }
.algebra-anatomy-buttons button:focus-visible,.algebra-truefalse button:focus-visible { outline:3px solid #e4a8d4; outline-offset:3px; }
.algebra-note [data-anatomy-feedback] { min-height:3em; margin-bottom:0; font-size:14px; }
.algebra-contexts { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:24px clamp(24px,4vw,48px); align-items:start; padding:10px 0; }
.algebra-contexts > div:first-child { grid-row:span 2; max-width:630px; }
.algebra-match,.algebra-truefalse { min-width:0; padding:18px 20px; border-radius:14px; background:linear-gradient(145deg,rgba(47,41,55,.63),rgba(35,32,42,.72)); }
.algebra-context-prompt { color:#eee7f1 !important; }
.algebra-match-options { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.algebra-match-options button { min-height:42px; padding:8px 14px; border:1px solid #625269; border-radius:10px; color:#f5edf7; background:#302b36; font:inherit; cursor:pointer; }
.algebra-match-options button:hover,.algebra-match-options button:focus-visible { border-color:#d4a0d7; }
.algebra-guided-sequence { background:linear-gradient(100deg,rgba(82,62,94,.15),rgba(42,36,49,.25)); }
.algebra-guided-task { max-width:790px; }
.algebra-guided-task .algebra-options { display:flex; flex-wrap:wrap; }
.algebra-lesson :is(button,select,a,summary):focus-visible { outline:3px solid #e4a8d4; outline-offset:3px; }
.algebra-feedback.is-correct { color:#b7e6c7 !important; }
.algebra-feedback.is-incorrect { color:#f2bbc7 !important; }
.algebra-summary { border:0; padding-top:0; }
.algebra-summary-grid p { min-width:0; }
.algebra-pilot-link .content-tag { display:none !important; }
.algebra-pilot-link { min-height:90px; }
@media(max-width:760px) {
  .algebra-contexts { grid-template-columns:1fr; gap:15px; }
  .algebra-contexts > div:first-child { grid-row:auto; }
  .algebra-opening { grid-template-columns:1fr; }
  .algebra-mark { min-height:85px; justify-content:flex-start; }
}
@media(max-width:520px) {
  .algebra-lesson { padding-inline:5px; }
  .algebra-contexts,.algebra-match,.algebra-truefalse,.algebra-error-card { padding-inline:15px; }
  .algebra-opening { padding-inline:18px; }
  .algebra-anatomy-buttons button,.algebra-truefalse button { flex:1; }
}
@media(prefers-reduced-motion:reduce) {
  .algebra-lesson *,#study.algebra-pilot-active * { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}
.algebra-equivalence-lab { margin:14px 0 4px; padding:13px 14px; border-radius:12px; background:rgba(87,68,99,.22); }
.algebra-equivalence-lab > p { margin-bottom:8px; font-size:14px; }
.algebra-equivalence-lab [role=group] { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:8px; }
.algebra-equivalence-lab button { min-height:40px; padding:7px 12px; border:1px solid #65546e; border-radius:9px; color:#f6eef9; background:#302b36; cursor:pointer; }
.algebra-equivalence-lab button:hover { border-color:#d4a0d7; }
.algebra-equivalence-lab button:focus-visible { outline:3px solid #e4a8d4; outline-offset:3px; }

/* Fundo ambiental em uma só camada, aplicado à largura integral da página. */
body.portal-theme.study-active:has(#study.algebra-pilot-active) {
  background-color:#39233a;
  background-image:
    linear-gradient(180deg,rgba(63,38,62,.18) 0%,rgba(42,31,49,.07) 22%,rgba(26,24,36,.05) 50%,rgba(42,31,49,.07) 78%,rgba(63,38,62,.18) 100%),
    linear-gradient(90deg,#39233a 0%,#30243c 18%,#242035 36%,#1c1a28 50%,#242035 64%,#30243c 82%,#39233a 100%);
  background-repeat:no-repeat;
}
#study.algebra-pilot-active,
#study.algebra-pilot-active .study-page { background:transparent !important; }
