:root{font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:#243247;background:#f8fafc}*{box-sizing:border-box}body{margin:0}header,main,footer{max-width:1060px;margin:auto}.top{padding:16px 22px;display:flex;justify-content:space-between;align-items:center;gap:14px}.brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none}.brand img{height:57px;width:57px;object-fit:contain}.brand span{display:grid}.brand small{color:#64748b}select,input,button{font:inherit;border:1px solid #cbd5e1;border-radius:10px;padding:10px;background:white}main{padding:8px 22px 48px}.hero{background:#f3e8ff;border-radius:20px;padding:30px 28px;margin-bottom:20px}.hero h1{margin:0 0 8px;font-size:clamp(1.5rem,4vw,2.2rem)}.hero p{margin:0;color:#475569}.tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}.tabs button{cursor:pointer;background:#e0f2fe;border-color:transparent;font-weight:600}.tabs button:nth-child(2){background:#dcfce7}.tabs button:nth-child(3){background:#ffedd5}.tabs button:nth-child(4){background:#fce7f3}.tabs button.active{outline:3px solid #64748b}.panel{border:1px solid #e2e8f0;background:white;padding:25px;border-radius:18px;min-height:260px}.hidden{display:none}.example{background:#f8f5ff;padding:20px;border-radius:14px;margin:18px 0}.example strong{font-size:1.5rem}.row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:18px 0}.row input[type=range]{flex:1;min-width:170px}.row input[type=text]{width:120px}.comparison{display:flex;gap:14px;flex-wrap:wrap}.comparison>div{flex:1;min-width:120px;background:#e0f2fe;padding:16px;border-radius:12px;display:grid;gap:8px}.comparison>div:nth-child(2){background:#dcfce7}.comparison>div:nth-child(3){background:#fce7f3}.comparison b{font-size:1.5rem}.comparison span{font-size:.85rem}button{cursor:pointer}.primary{background:#2563eb;color:white;border-color:#2563eb}.next{margin-top:12px}#feedback{font-weight:700}#solution{line-height:1.6}footer{padding:16px 22px 30px;color:#64748b;text-align:center}@media(max-width:560px){.top{align-items:flex-start}.top label{font-size:.8rem}.top select{max-width:110px}.panel{padding:17px}}

.levelbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:16px}.levelbar select{min-width:160px;background:#f3e8ff}.solution-steps{margin:10px 0;padding-left:23px}.solution-steps li{padding:4px 0}.tip{background:#dcfce7;padding:12px;border-radius:10px}.example strong{overflow-wrap:anywhere}

.levelcards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0}.levelcard{display:grid;gap:7px;text-align:left;padding:20px 16px;border:3px solid transparent;min-height:95px}.levelcard b{font-size:1.08rem}.levelcard small{font-size:.88rem;color:#475569}.levelcard:nth-child(1){background:#dcfce7}.levelcard:nth-child(2){background:#dbeafe}.levelcard:nth-child(3){background:#f3e8ff}.levelcard.selected{border-color:#334155;box-shadow:0 0 0 2px #fff inset}.currentlevel{font-weight:700;color:#334155}.version{font-size:.7rem;color:#64748b}@media(max-width:600px){.levelcards{grid-template-columns:1fr}.levelcard{min-height:65px;padding:12px 16px}}

/* GT Álgebra 1.4: exemplos e dicas */
.learning-path{margin:20px 0}.worked-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.worked-grid article{border-radius:14px;padding:15px;background:#c5ecd7}.worked-grid article:nth-child(2){background:#c6ddfc}.worked-grid article:nth-child(3){background:#e0caf7}.worked-grid h4{margin:0 0 10px}.worked-grid p{line-height:1.5}.hint-controls{margin:12px 0}.hint-controls button{background:#fbdba8;border-color:#e9bd72;font-weight:600}.hint{background:#fff0cb;border-left:4px solid #c7851d;padding:12px;border-radius:8px;line-height:1.5}@media(max-width:650px){.worked-grid{grid-template-columns:1fr}}

/* 1.5: cabeçalho ocupa a largura inteira, conteúdo alinhado ao portal */
body > header.top{width:100%;max-width:none;margin:0;padding:0;background:#bfd9fb !important;border-bottom:1px solid #d2b3f0}
.top-inner{width:min(1100px,100%);margin:0 auto;padding:14px 22px;display:flex;align-items:center;justify-content:space-between;gap:16px}
body > main{max-width:1100px}
.level-instruction{color:#475569;margin-top:0}
.levelcards .levelcard{cursor:pointer;transition:transform .15s,box-shadow .15s;border:3px solid transparent;position:relative}
.levelcards .levelcard:hover{transform:translateY(-2px)}
.levelcards .levelcard.selected{border-color:#243247;box-shadow:0 0 0 3px white inset}
.levelcards .levelcard.selected:after{content:"✓";position:absolute;top:8px;right:12px;font-weight:900;color:#14532d}
.levelcards .levelcard:nth-child(1){background:#b9e9d0}
.levelcards .levelcard:nth-child(2){background:#bfd9fb}
.levelcards .levelcard:nth-child(3){background:#dfc8f7}
body > footer.gt-footer{background:#bfd9fb !important}
@media(max-width:560px){.top-inner{align-items:center;flex-wrap:wrap}}

/* GT Álgebra 1.7 — cabeçalho e rodapé iguais ao cartão azul de entrada */
:root{--gt-algebra-color:#bfd9fb;--gt-algebra-border:#9fc4f4}
body > header.top, body > footer.gt-footer {background:var(--gt-algebra-color) !important}
body > nav.tabs, nav.tabs {background:var(--gt-algebra-color) !important}
nav.tabs button.active{outline:2px solid #65418c;outline-offset:1px}
button.primary,button.practice-this{background:#7150a0;color:#fff;border:1px solid #7150a0;font-weight:650}
button.primary:hover,button.practice-this:hover{background:#5c3987}
.practice-this{margin-top:8px;padding:9px 12px;font-size:.88rem;border-radius:9px}
.worked-grid article{display:flex;flex-direction:column;align-items:flex-start}
.worked-grid article .practice-this{margin-top:auto}

/* 1.8 — seletor de grau e estudo de equações quadráticas */
.degree-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}.degree-choice{background:#bfd9fb;border:3px solid transparent;padding:18px;text-align:left;display:grid;gap:7px}.degree-choice:nth-child(2){background:#dfc8f7}.degree-choice.selected{border-color:#243247}.degree-choice b{font-size:1.1rem}.degree-choice small{color:#334155}.coef-grid{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}.coef-grid label{display:grid;gap:5px}.coef-grid input{width:95px}.quadgraph{width:100%;max-width:640px;background:#f8fafc;border:1px solid #cbd5e1;border-radius:12px}.equation-line{font-weight:700;font-size:1.25rem}.second-tabs{background:#bfd9fb;padding:10px;border-radius:12px}.second-tabs button.active{outline:2px solid #243247}.degree-choice:hover{filter:brightness(.97)}#qsolution{line-height:1.6}#qfeedback{font-weight:700}@media(max-width:600px){.degree-picker{grid-template-columns:1fr}}

/* GT Álgebra 1.9 — identidade azul fixa durante toda a navegação.
   O JS compartilhado pode alterar a variável inline; a declaração !important
   abaixo mantém a cor da área independentemente de abas e grau. */
:root { --gt-active-color: #bfd9fb !important; }
body > header.top, body > footer.gt-footer { background-color: #bfd9fb !important; }
#first-degree nav.tabs, #second-degree nav.tabs { background-color: #bfd9fb !important; }

/* 2.0: identidade fixa do GT Álgebra */
body > header.top, body > footer, body > footer.gt-footer {background:#bfd9fb !important;}
