@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');
:root{--ink:#30234f;--ink-soft:#574c70;--purple:#604889;--purple-deep:#392a5b;--lilac:#cbb9f1;--lilac-pale:#f1eafd;--cream:#fbf8f0;--white:#fffefa;--green:#ccebd0;--green-deep:#477b55;--peach:#f8dfcf;--line:#ebe4d9;--muted:#827b90;--shadow:0 12px 28px #45356812}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background-color:var(--cream);background-image:radial-gradient(#9482b01a .7px,transparent .7px);background-size:18px 18px;color:var(--ink);font-family:'Nunito','DM Sans',sans-serif;font-size:15px;line-height:1.6}h1,h2,h3,.brand{font-family:'Plus Jakarta Sans','Manrope',sans-serif;letter-spacing:-.045em}h1{font-size:clamp(2rem,4vw,3rem);font-weight:800;line-height:1.14;margin:.45rem 0}h2{font-size:1.55rem;font-weight:800;line-height:1.25;margin:.3rem 0}h3{font-size:1.12rem;font-weight:800;line-height:1.4;margin:.45rem 0}p{margin:.45rem 0}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button{color:inherit}.topbar{height:78px;background:#fffefaee;backdrop-filter:blur(12px);position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:0 max(calc((100vw - 1160px)/2),5vw);border-bottom:1px solid #30234f0c;box-shadow:0 3px 16px #3625530a}.brand{display:flex;align-items:center;gap:10px;font-size:1.3rem;font-weight:900}.brand-mark{width:35px;height:35px;border-radius:12px 12px 12px 4px;background:#5d468b;color:white;display:grid;place-items:center;font-size:.85rem;box-shadow:3px 3px 0 #d8caef;transform:rotate(-4deg)}.brand-plus{color:#8e70c6}.topbar nav{display:flex;align-items:center;gap:24px;font-size:.88rem;font-weight:800}.topbar nav a{transition:color .18s,transform .18s}.topbar nav a:hover{color:#7555ab;transform:translateY(-1px)}.nav-user{color:var(--muted);font-weight:700;border-left:1px solid var(--line);padding-left:20px}.nav-exit{color:var(--muted)}.container{max-width:1160px;padding:38px 28px 70px;margin:auto;min-height:calc(100vh - 140px)}.footer{text-align:center;padding:18px;color:var(--muted);font-size:.8rem;font-weight:700;letter-spacing:.02em}.footer span{color:#b7a7d7;margin:0 5px}.muted{color:var(--muted)}.eyebrow{display:inline-block;font-size:.68rem;font-weight:900;letter-spacing:.15em;color:#b8a3de}.eyebrow.lilac{color:#8065b4}.alert{padding:12px 16px;border-radius:12px 15px 12px 5px;background:#e7f3e8;color:#396745;margin:0 0 18px;font-weight:700;transition:opacity .5s}.alert.error{background:#fae6e4;color:#994d49}.alert-hide{opacity:0}
/* Botões e formulários */
.button{display:inline-flex;justify-content:center;align-items:center;gap:12px;border:0;border-radius:14px;padding:12px 17px;background:var(--white);font:800 .87rem 'Nunito',sans-serif;cursor:pointer;transition:transform .2s,box-shadow .2s,background .2s;box-shadow:0 3px 0 #30234f12}.button:hover{transform:translateY(-2px);box-shadow:0 6px 15px #38285216}.button.primary{background:#5a4388;color:white;box-shadow:0 4px 0 #39295c}.button.primary:hover{background:#6b53a0;box-shadow:0 6px 0 #39295c}.button.primary span{font-size:1.05rem}.button.full{width:100%;margin-top:4px;padding:14px}.button.subject-button{border-radius:13px;background:#eee7fb;color:#5d448d;padding:10px 13px;font-weight:900;box-shadow:none!important}.button.disabled{color:#aaa;background:#f2f0ec;cursor:default}.form-stack,.admin-form{display:grid;gap:16px}.form-stack label,.admin-form label{display:grid;gap:7px;font-size:.83rem;font-weight:800}.form-stack small{color:var(--muted);font-weight:500}.form-stack input,.admin-form input,.admin-form select,.admin-form textarea,.question-card textarea{width:100%;border:1px solid #e8e0d7;background:#fffefb;border-radius:13px;padding:12px 14px;color:var(--ink);outline:none;transition:border .2s,box-shadow .2s}.form-stack input:focus,.admin-form input:focus,.admin-form select:focus,.admin-form textarea:focus,.question-card textarea:focus{border-color:#a98cde;box-shadow:0 0 0 4px #cbb9f13d}.admin-form textarea,.question-card textarea{resize:vertical}.admin-form input,.admin-form select,.admin-form textarea{font-size:.87rem;padding:10px 12px}.admin-form [hidden]{display:none!important}
/* Entrada: capa de caderno com detalhes doodle */
.auth-layout{min-height:calc(100vh - 215px);display:grid;grid-template-columns:1.05fr .95fr;align-items:center;gap:7%;max-width:1040px;margin:auto;padding:18px 0}.auth-art{height:510px;min-height:440px;border-radius:30px 30px 30px 7px;background:linear-gradient(145deg,#382953 0%,#2c2147 62%,#46355f 100%);color:white;position:relative;overflow:hidden;padding:56px;display:flex;align-items:flex-end;box-shadow:0 18px 40px #30234f20}.auth-art:after{content:'';position:absolute;width:310px;height:310px;border-radius:50%;background:#725b993b;border:1px solid #e4d8ff36;right:-45px;top:-80px}.auth-art:before{content:'✎';position:absolute;right:53px;bottom:32px;color:#dfd1fa44;font-size:7rem;transform:rotate(-16deg);font-family:serif}.orbit{position:absolute;border:1px dashed #d5c3f055;border-radius:50%;z-index:1}.orbit-one{height:300px;width:300px;right:46px;top:28px}.orbit-two{height:205px;width:205px;right:93px;top:75px;border-style:solid}.art-star{position:absolute;right:165px;top:132px;color:#eadfff;font-size:3.4rem;z-index:2;animation:star-wiggle 4s ease-in-out infinite}.art-copy{position:relative;z-index:3;max-width:425px}.art-copy .eyebrow{color:#d4c5ed}.art-copy h1{font-size:3.15rem;margin:16px 0}.art-copy em{color:#d6c6fa;font-style:normal}.art-copy p{color:#c0bbcf;max-width:340px}.art-tags{display:flex;gap:9px;margin-top:28px;flex-wrap:wrap}.art-tags span{background:#ffffff13;border:1px solid #ffffff25;padding:7px 12px;border-radius:10px 14px 10px 5px;font-size:.75rem;color:#e4dff0;font-weight:700;transform:rotate(-1deg)}.art-tags span:nth-child(2){transform:rotate(1deg)}.auth-card{max-width:410px;width:100%;margin:auto;padding:22px 0}.auth-card h2{font-size:2rem;margin-top:11px}.auth-card>.muted{margin-bottom:26px}.auth-card .eyebrow.lilac{background:var(--lilac-pale);padding:6px 10px;border-radius:8px;letter-spacing:.1em}.auth-foot{font-size:.82rem;color:var(--muted);text-align:center;margin-top:17px}.auth-foot a{color:#7154a9;font-weight:900}.auth-standalone{margin:30px auto;padding:27px;background:var(--white);border:1px solid #efebe4;border-radius:18px 23px 18px 7px;box-shadow:var(--shadow)}
/* Cabeçalho e painel do aluno */
.welcome-row{display:flex;justify-content:space-between;align-items:center;margin:10px 0 30px;padding:24px 27px;border-radius:20px 25px 20px 8px;background:linear-gradient(110deg,#f1ebfb,#f8f3ff 62%,#f4f0fb);border:1px solid #e9e0f5;position:relative;overflow:hidden}.welcome-row:after{content:'✦';position:absolute;right:27%;top:11px;color:#b29bdc35;font-size:4.5rem;transform:rotate(12deg)}.welcome-row h1{font-size:2.45rem}.wave{font-size:1.5rem;color:#9c7bd0;vertical-align:middle;display:inline-block;animation:star-wiggle 3.5s ease-in-out infinite}.welcome-note{display:flex;align-items:center;gap:13px;padding:14px 18px;background:#fffcf4;border:1px dashed #d8caef;border-radius:12px 17px 11px 5px;color:#615578;font-size:.82rem;transform:rotate(1.5deg);font-weight:700}.note-icon{font-size:1.5rem;color:#8e6ebd}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:46px}.stat-card{background:var(--white);border:1px solid #eee6da;border-radius:16px 21px 16px 7px;padding:19px 22px;display:flex;align-items:center;gap:15px;box-shadow:0 4px 0 #3b285a0a,0 10px 25px #3b285a09;transition:transform .2s}.stat-card:hover{transform:translateY(-3px) rotate(-.3deg)}.stat-icon{height:43px;width:43px;border-radius:12px 15px 12px 5px;display:grid;place-items:center;font-size:1.2rem}.lilac-bg{background:var(--lilac-pale);color:#866ab5}.green-bg{background:#e7f2e6;color:#54795a}.peach-bg{background:#fbede5;color:#a96c53}.stat-card div{display:grid}.stat-card strong{font:900 1.65rem 'Plus Jakarta Sans',sans-serif}.stat-card div span{font-size:.78rem;color:var(--muted);font-weight:700}.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}.section-heading .eyebrow{margin-bottom:4px}.section-heading h2{font-size:1.55rem}.subject-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:19px}.subject-card{background:var(--white);border:1px solid #eae4d9;border-radius:19px 24px 19px 8px;padding:22px;box-shadow:0 4px 0 #39295c0b,0 12px 25px #39295c09;min-height:240px;display:flex;flex-direction:column;align-items:flex-start;position:relative;overflow:hidden;transition:transform .2s,box-shadow .2s}.subject-card:hover{transform:translateY(-4px) rotate(-.4deg);box-shadow:0 6px 0 #39295c0b,0 18px 30px #39295c13}.subject-card:after{content:'';position:absolute;width:90px;height:90px;border:1px dashed currentColor;border-radius:50%;right:-36px;top:63px;opacity:.1}.subject-0{background:linear-gradient(145deg,#fffefa 75%,#f4effc)}.subject-1{background:linear-gradient(145deg,#fffefa 75%,#eff8ed)}.subject-2{background:linear-gradient(145deg,#fffefa 75%,#fff3e9)}.subject-top{width:100%;display:flex;align-items:center;justify-content:space-between}.subject-symbol{width:46px;height:46px;border-radius:13px 16px 13px 6px;background:var(--lilac-pale);display:grid;place-items:center;color:#7257a0;font-size:1.45rem}.subject-1 .subject-symbol{background:#e9f3e8;color:#55765b}.subject-2 .subject-symbol{background:#faeee5;color:#9e6a52}.count-pill{background:#f2eee7;border:1px solid #eae4db;border-radius:20px;padding:5px 10px;color:#766d80;font-size:.7rem;font-weight:900}.subject-card h3{font-size:1.25rem;margin:17px 0 2px}.subject-card p{font-size:.84rem;line-height:1.55;color:var(--muted);margin:0 0 17px}.subject-card .button{margin-top:auto}.subject-0 .subject-button{background:#eee7fb;color:#5d448d}.subject-1 .subject-button{background:#e7f3e5;color:#456e4b}.subject-2 .subject-button{background:#faebdf;color:#8a5942}.history-section{margin-top:48px}.table-wrap{overflow:auto;background:var(--white);border:1px solid #efebe4;border-radius:16px 20px 16px 7px;box-shadow:var(--shadow)}.table-wrap table{width:100%;border-collapse:collapse;text-align:left}.table-wrap th,.table-wrap td{padding:14px 19px;border-bottom:1px solid #f0ede8;font-size:.82rem}.table-wrap th{background:#f7f3ed;font-size:.68rem;color:var(--muted);letter-spacing:.07em;text-transform:uppercase}.table-wrap tr:last-child td{border-bottom:0}.table-wrap tbody tr:hover{background:#fcf9f4}.result-pill{border-radius:20px;padding:5px 10px;font-weight:900;font-size:.75rem;white-space:nowrap}.good{background:#e7f3e8;color:#4e7557}.needs-work{background:#f9eee4;color:#996b3d}.empty-state{padding:25px;background:#fffefa;border:1px dashed #d8cfea;border-radius:15px 19px 15px 7px;color:var(--muted);text-align:center;font-size:.9rem}
/* Atividades */
.activity-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.activity-card{background:var(--white);border:1px solid #efebe4;border-radius:17px 22px 17px 7px;padding:19px;box-shadow:var(--shadow)}.activity-card h3{font-size:1.1rem;margin:12px 0 5px}.activity-card p{font-size:.86rem;white-space:pre-line}.activity-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.activity-done{border-color:#cbe5cf;background:#fbfefb;box-shadow:inset 4px 0 #9ecfa4,0 8px 20px #3c76420b}.activity-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.activity-actions .button{font-size:.78rem}.activity-actions form{display:flex}.activity-actions form button{height:100%}
/* Simulados e revisão */
.back-link{color:#847b8f;font-size:.82rem;font-weight:900}.back-link:hover{color:#755ba2}.quiz-intro{margin:24px 0;padding:18px 22px;background:#f2edfb;border:1px solid #e7def6;border-radius:17px 21px 17px 7px}.quiz-intro h1{font-size:2.5rem;margin:.4rem 0}.quiz-intro>.count-pill{display:inline-block;margin-top:15px}.title-spark{color:#a384d3}.question-list{display:grid;gap:16px}.question-card,.review-card{background:var(--white);border:1px solid #ebe4d9;border-radius:18px 23px 18px 7px;padding:22px 25px;box-shadow:0 4px 0 #38285209,0 10px 24px #38285208}.question-label{display:flex;align-items:center;gap:10px;color:#8c78b2;font-size:.66rem;font-weight:900;letter-spacing:.12em}.question-number{height:27px;width:27px;border-radius:8px 11px 8px 4px;background:#eee7fb;color:#654b96;display:grid;place-items:center;font-size:.7rem;font-weight:900;letter-spacing:0}.question-card h3,.review-card h3{margin:13px 0 17px;white-space:normal}.options-list{display:grid;grid-template-columns:1fr 1fr;gap:9px}.option{display:flex;align-items:center;gap:10px;border:1px solid #ece8e1;border-radius:11px 15px 11px 5px;padding:10px 12px;cursor:pointer;font-size:.85rem;font-weight:700;transition:.2s}.option:hover,.option.selected{border-color:#bca7dc;background:#f5f0fe}.option input{accent-color:#705597}.option-letter{height:26px;width:26px;border-radius:8px 10px 8px 4px;background:#f4f1eb;display:grid;place-items:center;font-size:.7rem;font-weight:900;flex:none}.question-card textarea{font-family:inherit}.essay-hint{font-size:.75rem;color:var(--muted)}.submit-quiz{margin-top:22px}.result-hero{text-align:center;padding:32px 0 38px}.result-hero h1{font-size:2.3rem}.score-ring{margin:20px auto;width:158px;height:158px;border-radius:50%;background:conic-gradient(#8870b5 calc(var(--score)*1%),#ece7f0 0);display:grid;place-items:center;position:relative;filter:drop-shadow(0 6px 9px #4535681a)}.score-ring:before{content:'';position:absolute;inset:10px;background:var(--cream);border-radius:50%}.score-ring div{z-index:1;display:grid}.score-ring strong{font:900 2.2rem 'Plus Jakarta Sans',sans-serif}.score-ring span{font-size:.68rem;color:var(--muted)}.result-hero .button{margin-top:15px}.review-section{max-width:800px;margin:0 auto}.review-section h2{margin:7px 0 17px}.review-card{margin:12px 0;padding:20px 22px}.review-correct{border-left:4px solid #8bc895}.review-wrong{border-left:4px solid #e7a898}.review-essay{border-left:4px solid #c9b9eb}.review-card p{font-size:.84rem}.explanation{background:#f4effb;border:1px dashed #d9cbed;padding:11px 13px;border-radius:10px;color:#645776}.answer-text{background:#f8f5ef;border-radius:10px;padding:12px}
/* Área docente */
.admin-heading{margin:8px 0 26px}.admin-heading h1{margin:.4rem 0}.admin-columns,.teacher-grid{display:grid;grid-template-columns:.9fr 1.1fr;gap:17px;align-items:start}.teacher-grid{grid-template-columns:1fr 1fr}.admin-panel{background:var(--white);border:1px solid #ebe4d9;border-radius:18px 23px 18px 7px;padding:22px;box-shadow:0 4px 0 #38285208,0 11px 26px #38285208}.admin-panel h2{font-size:1.45rem}.teacher-grid .admin-panel{height:100%}.teacher-section,.question-bank{margin-top:20px}.panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:19px}.panel-heading h2{font-size:1.4rem}.admin-list{margin-top:20px}.admin-row,.question-admin-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 0;border-top:1px solid #eee9e0}.admin-row>div{display:grid}.admin-row strong{font-size:.85rem}.admin-row small{font-size:.72rem;color:var(--muted)}.icon-button{border:0;border-radius:9px 12px 9px 4px;width:31px;height:31px;font-size:1.15rem;cursor:pointer}.icon-button.danger{background:#f9e9e6;color:#a65e55}.option-input-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.question-bank{margin-top:20px}.question-admin-list{max-height:480px;overflow:auto}.question-admin-row p{margin:3px 0 0;font-size:.82rem}.question-admin-row .eyebrow{font-size:.62rem}.question-admin-row form,.admin-row form{flex:none}.edit-link{display:inline-block;color:#755ba2;font-size:.74rem;font-weight:900;margin-top:5px;cursor:pointer}.edit-link:hover{text-decoration:underline}.teacher-notice-list{max-height:350px;overflow:auto}.notice-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #f0ede8;padding:12px 0}.notice-row>div{display:grid}.notice-row strong{font-size:.82rem}.notice-row small{font-size:.72rem;color:var(--muted)}.notice-unread{border-left:3px solid #b8a3de;padding-left:10px;background:#fcfaff}.reset-code-box{margin:16px 0;padding:19px;border:1px solid #cbe5cf;background:#edf6ed;border-radius:14px 18px 14px 6px;color:#375c3f}.reset-code-box code{display:inline-block;font:900 1.1rem monospace;letter-spacing:.12em;background:white;padding:10px 14px;border-radius:8px;user-select:all}.reset-code-box p{font-size:.84rem}
@keyframes star-wiggle{0%,100%{transform:rotate(-5deg) scale(1)}50%{transform:rotate(7deg) scale(1.06)}}
@media(max-width:800px){.auth-layout{grid-template-columns:1fr;gap:25px;padding:8px 0}.auth-art{height:315px;min-height:0;padding:34px}.art-copy h1{font-size:2.45rem}.art-star{top:50px;right:100px}.orbit-one{top:-10px;right:20px}.orbit-two{top:35px;right:65px}.auth-card{padding:5px 8px}.subject-grid{grid-template-columns:1fr 1fr}.admin-columns,.teacher-grid{grid-template-columns:1fr}.container{padding:30px 20px 55px}.welcome-row:after{right:9%;top:4px}.welcome-row{padding:21px}.welcome-row h1{font-size:2rem}.activity-grid{grid-template-columns:1fr}}
@media(max-width:560px){.topbar{height:66px;padding:0 17px}.topbar nav{gap:12px;font-size:.76rem}.nav-user{display:none}.container{padding:25px 16px 45px}.welcome-row{align-items:flex-start;padding:18px;border-radius:17px 20px 17px 6px}.welcome-row h1{font-size:1.85rem}.welcome-note{display:none}.stats-grid{grid-template-columns:1fr;gap:9px;margin-bottom:35px}.stat-card{padding:13px 16px}.stat-icon{height:38px;width:38px}.subject-grid{grid-template-columns:1fr}.subject-card{min-height:210px}.section-heading{margin-bottom:13px}.section-heading h2{font-size:1.35rem}.options-list{grid-template-columns:1fr}.question-card,.review-card{padding:18px}.question-card h3{font-size:1.05rem}.table-wrap th,.table-wrap td{padding:11px 12px}.auth-art{height:285px;padding:28px}.art-copy h1{font-size:2.1rem}.art-star{font-size:2.4rem;right:96px;top:59px}.orbit-one{width:220px;height:220px;right:14px;top:12px}.orbit-two{width:150px;height:150px;right:49px;top:47px}.auth-art:before{font-size:4.5rem;right:25px;bottom:12px}.auth-layout{min-height:initial}.option-input-grid{grid-template-columns:1fr 1fr}.activity-actions{display:grid}.activity-actions .button{width:100%}.notice-row{align-items:flex-start}.auth-standalone{padding:20px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

#teacher-account-fields,#teacher-login-fields{padding:14px 15px;background:#f2edfb;border:1px dashed #cbb9f1;border-radius:13px}#teacher-account-fields[hidden],#teacher-login-fields[hidden]{display:none!important}#teacher-account-fields label,#teacher-login-fields label{margin:0 0 12px}#teacher-account-fields label:last-child,#teacher-login-fields label:last-child{margin-bottom:0}#teacher-account-fields small{line-height:1.45;color:#766b89}.form-stack select{width:100%;border:1px solid #e8e0d7;background:#fffefb;border-radius:13px;padding:12px 14px;color:var(--ink);outline:none;transition:border .2s,box-shadow .2s}.form-stack select:focus{border-color:#a98cde;box-shadow:0 0 0 4px #cbb9f13d}


/* Tema claro/escuro compartilhado por todas as páginas */
.theme-toggle{border:1px solid var(--line);background:var(--white);color:var(--ink);border-radius:999px;padding:9px 13px;font:inherit;font-size:.85rem;font-weight:800;cursor:pointer;white-space:nowrap}
.profile-nav{text-decoration:none!important;border-bottom:0!important}
.public-nav{display:flex;justify-content:flex-end}
html[data-theme="dark"]{color-scheme:dark;--ink:#f3efff;--ink-soft:#d0c8e2;--purple:#c7a9ff;--purple-deep:#b59af0;--lilac:#8d75bd;--lilac-pale:#302744;--cream:#17151f;--white:#24212e;--line:#40394e;--muted:#b0a8c1;--shadow:0 12px 28px #0005;--green:#23402c;--green-deep:#b4e8bf;--peach:#4b3028}
html[data-theme="dark"] body{background:#17151f;color:var(--ink)}
html[data-theme="dark"] .topbar,html[data-theme="dark"] .admin-panel,html[data-theme="dark"] .auth-card,html[data-theme="dark"] .card,html[data-theme="dark"] .question-admin-row,html[data-theme="dark"] .reset-code-box{background:#24212e;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{background:#191722;color:var(--ink);border-color:#514861}
html[data-theme="dark"] table th,html[data-theme="dark"] table td{border-color:var(--line)}
html[data-theme="dark"] a{color:#d3bdff}
.profile-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:24px 0 48px}
.profile-summary{text-align:center}
.profile-avatar{width:112px;height:112px;border-radius:50%;overflow:hidden;background:var(--lilac-pale);display:grid;place-items:center;margin:8px auto 16px;color:var(--purple);font-size:2.5rem;font-weight:900}
.profile-avatar img{width:100%;height:100%;object-fit:cover}
.profile-summary .admin-form{text-align:left;margin-top:20px}
.profile-data p{display:flex;flex-direction:column;gap:5px;padding:12px 0;border-bottom:1px solid var(--line);margin:0}
.profile-data p:last-child{border-bottom:0}
.profile-data strong{font-size:.88rem;color:var(--muted)}
.profile-data span{overflow-wrap:anywhere}
.profile-password{grid-column:1/-1}
@media(max-width:760px){.profile-layout{grid-template-columns:1fr}.profile-password{grid-column:auto}.topbar nav{flex-wrap:wrap;justify-content:flex-end}.theme-toggle{font-size:.78rem;padding:8px 10px}}

/* Cadastro seguro e aprovação de alunos */
.password-field{display:flex;align-items:center;gap:8px;width:100%}.password-field input{flex:1;min-width:0}.password-toggle{border:1px solid var(--border-color,#ddd);background:var(--card-bg,#fff);color:var(--text-color,inherit);border-radius:10px;padding:10px 12px;cursor:pointer;white-space:nowrap}.password-rules{display:block;margin-top:-8px;margin-bottom:4px;line-height:1.5}.approval-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.approval-actions form{margin:0}.button.danger{background:#b42318;color:#fff;border:1px solid #b42318}.approval-actions .button{padding:9px 14px}

/* Links, chat e filtros de alunos */
.roster-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:16px 0}.roster-tools input[type=search]{flex:1;min-width:220px}.roster-tools select{min-width:220px}.resource-checks{display:flex;gap:12px;flex-wrap:wrap;padding:12px;border:1px solid var(--border,#ddd);border-radius:12px}.resource-checks label{display:flex;gap:6px;align-items:center}.chat-student-list{display:grid;gap:8px;margin-top:14px}.chat-student-row{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--border,#e3e0e9);border-radius:14px;text-decoration:none;color:inherit}.chat-student-row:hover{background:var(--surface-soft,#f8f6fb)}.chat-avatar{width:46px;height:46px;flex:0 0 46px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#ece5fa;color:#4b3679;font-weight:700;overflow:hidden}.chat-avatar img{width:100%;height:100%;object-fit:cover}.chat-student-meta{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}.chat-student-meta small,.chat-conversation-head small{color:var(--muted,#777);overflow-wrap:anywhere}.chat-conversation-head{display:flex;align-items:center;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--border,#e3e0e9)}.chat-messages{display:flex;flex-direction:column;gap:10px;max-height:460px;overflow:auto;padding:16px 0}.chat-message{max-width:82%;padding:10px 14px;border-radius:14px;background:var(--surface-soft,#f5f2fa);align-self:flex-start;overflow-wrap:anywhere}.chat-message.mine{align-self:flex-end;background:#e9defb}.chat-message small{display:block;font-size:12px;color:var(--muted,#777)}.chat-message p{margin:5px 0 0}.chat-compose{display:flex;gap:10px;align-items:end}.chat-compose textarea{flex:1;min-width:0}.admin-form [hidden]{display:none!important}@media(max-width:600px){.roster-tools>*{width:100%}.chat-compose{flex-direction:column;align-items:stretch}.chat-message{max-width:94%}.chat-student-row{align-items:flex-start}.chat-student-row>span:last-child{font-size:12px}}

/* Chats particulares dos alunos com cada professor */
.teacher-chat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-top:18px}
.teacher-chat-card{display:flex;flex-direction:column;align-items:center;gap:9px;padding:22px 16px;border:1px solid var(--border,#e3e0e9);border-radius:18px;text-align:center;text-decoration:none;color:inherit;background:var(--surface,#fff);transition:transform .15s ease,box-shadow .15s ease}
.teacher-chat-card:hover{transform:translateY(-2px);box-shadow:0 8px 24px #20133b12}
.teacher-chat-avatar{width:76px;height:76px;display:flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:#ece5fa;color:#4b3679;font-size:26px;font-weight:700}
.teacher-chat-avatar img{width:100%;height:100%;object-fit:cover}
.teacher-chat-subject{font-size:14px;color:var(--muted,#777)}


/* Menu público das telas de entrada */
.public-nav{gap:10px;position:relative}
.public-explore{position:relative}
.explore-toggle{border:1px solid var(--line);background:var(--white);color:var(--ink);border-radius:999px;padding:9px 13px;font:800 .85rem 'Nunito',sans-serif;cursor:pointer;white-space:nowrap;transition:.2s}
.explore-toggle:hover{border-color:#a98cde;transform:translateY(-1px)}
.public-explore-menu{position:absolute;right:0;top:calc(100% + 12px);z-index:30;width:290px;padding:15px;background:var(--white);border:1px solid var(--line);border-radius:16px 20px 16px 7px;box-shadow:var(--shadow)}
.public-explore-menu[hidden]{display:none}
.public-explore-menu>strong{display:block;font:800 .85rem 'Plus Jakarta Sans',sans-serif;margin:1px 3px 10px}
.public-explore-menu>a:not(.button){display:flex;align-items:center;gap:10px;padding:9px 8px;border-radius:10px;color:var(--ink);transition:background .18s}
.public-explore-menu>a:not(.button):hover{background:var(--lilac-pale)}
.public-explore-menu>a:not(.button)>span:first-child{width:27px;height:27px;display:grid;place-items:center;border-radius:8px;background:var(--lilac-pale);color:var(--purple);font-weight:900}
.public-explore-menu a b,.public-explore-menu a small{display:block}
.public-explore-menu a b{font-size:.78rem}.public-explore-menu a small{color:var(--muted);font-size:.7rem;font-weight:600}
.public-explore-actions{display:flex;gap:8px;margin-top:11px;padding-top:11px;border-top:1px solid var(--line)}
.public-explore-actions .button{flex:1;padding:9px 10px;font-size:.76rem}

/* Contraste consistente em modo escuro, com foco nas telas de login e cadastro */
html[data-theme="dark"] body{background-image:radial-gradient(#c5b6ec18 .7px,transparent .7px)}
html[data-theme="dark"] .topbar{background:#211d2bee;border-bottom-color:#ffffff12;box-shadow:0 3px 18px #0004}
html[data-theme="dark"] .brand-mark{box-shadow:3px 3px 0 #51406f}
html[data-theme="dark"] .brand-plus{color:#c7a9ff}
html[data-theme="dark"] .theme-toggle,html[data-theme="dark"] .explore-toggle{background:#2a2536;color:var(--ink);border-color:#514861}
html[data-theme="dark"] .auth-layout .auth-card{background:transparent;border-color:transparent;box-shadow:none}
html[data-theme="dark"] .auth-card>.eyebrow.lilac{background:#352b4a;color:#d8c7ff}
html[data-theme="dark"] .form-stack input,html[data-theme="dark"] .form-stack select,html[data-theme="dark"] .admin-form input,html[data-theme="dark"] .admin-form select,html[data-theme="dark"] .admin-form textarea{background:#1d1a27;color:#f3efff;border-color:#514861}
html[data-theme="dark"] .form-stack input::placeholder,html[data-theme="dark"] .admin-form input::placeholder{color:#9188a6}
html[data-theme="dark"] #teacher-account-fields,html[data-theme="dark"] #teacher-login-fields{background:#302744;border-color:#69578d}
html[data-theme="dark"] #teacher-account-fields small,html[data-theme="dark"] #teacher-login-fields small{color:#c0b5d4}
html[data-theme="dark"] .password-toggle{background:#2a2536;color:#f3efff;border-color:#514861}
html[data-theme="dark"] .auth-foot a,html[data-theme="dark"] .edit-link{color:#c7a9ff}
html[data-theme="dark"] .auth-standalone{background:#24212e;border-color:#40394e}
html[data-theme="dark"] .alert{background:#23402c;color:#b4e8bf}
html[data-theme="dark"] .alert.error{background:#4b292c;color:#ffc5c4}
html[data-theme="dark"] .public-explore-menu{background:#24212e;border-color:#514861}
html[data-theme="dark"] .public-explore-menu>a:not(.button){color:#f3efff}
html[data-theme="dark"] .public-explore-menu>a:not(.button):hover{background:#302744}
html[data-theme="dark"] .public-explore-menu>a:not(.button)>span:first-child{background:#302744;color:#d2bcff}
html[data-theme="dark"] .public-explore-actions{border-top-color:#40394e}
html[data-theme="dark"] .button.subject-button{background:#352b4a;color:#d8c7ff}
html[data-theme="dark"] .button.disabled{background:#302d38;color:#8f899d}
html[data-theme="dark"] .footer{color:#9188a6}
@media(max-width:620px){.public-explore-menu{right:-44px;width:min(290px,calc(100vw - 34px))}.public-nav{gap:6px}.explore-toggle,.theme-toggle{padding:8px 10px;font-size:.76rem}}

/* Olho integrado aos campos de conteúdo oculto */
.password-field{display:flex;align-items:center;gap:8px;width:100%}
.password-field input{flex:1;min-width:0}
.password-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:1px solid var(--line);background:var(--white);color:var(--ink);border-radius:11px;cursor:pointer;font-size:1.12rem;line-height:1;transition:border-color .2s,background .2s,transform .2s}
.password-toggle:hover{border-color:#a98cde;background:var(--lilac-pale);transform:translateY(-1px)}
.password-toggle span{display:block;line-height:1}
html[data-theme="dark"] .password-toggle{background:#2a2536;color:#f3efff;border-color:#514861}
html[data-theme="dark"] .password-toggle:hover{background:#352b4a;border-color:#8d75bd}

/* Menus laterais dos perfis */
.role-shell{display:grid;grid-template-columns:238px minmax(0,1fr);gap:25px;align-items:start;max-width:1240px;margin:0 auto}
.role-sidebar{position:sticky;top:98px;background:var(--white);border:1px solid var(--line);border-radius:18px 23px 18px 7px;padding:16px 12px;box-shadow:var(--shadow);z-index:5}
.role-sidebar-heading{display:flex;align-items:center;gap:10px;padding:4px 7px 15px;border-bottom:1px solid var(--line);margin-bottom:10px}
.role-sidebar-heading .brand-mark{width:30px;height:30px;font-size:.72rem;flex:none}
.role-sidebar-heading strong,.role-sidebar-heading small{display:block}.role-sidebar-heading strong{font:800 .82rem 'Plus Jakarta Sans',sans-serif}.role-sidebar-heading small{font-size:.7rem;color:var(--muted);margin-top:2px}
.role-sidebar-nav{display:grid;gap:3px}.role-sidebar-nav a{display:flex;align-items:center;gap:9px;padding:9px 8px;border-radius:10px;color:var(--ink);font-size:.76rem;font-weight:800;line-height:1.25;transition:background .18s,color .18s,transform .18s}.role-sidebar-nav a:hover{background:var(--lilac-pale);color:var(--purple);transform:translateX(2px)}.role-sidebar-nav a span{display:grid;place-items:center;width:25px;height:25px;flex:none;background:var(--lilac-pale);border-radius:8px;color:var(--purple);font-size:.86rem}
.role-content{min-width:0}.role-content>.admin-heading{margin-top:0}.role-content section[id]{scroll-margin-top:98px}
html[data-theme="dark"] .role-sidebar{background:#24212e;border-color:#40394e;box-shadow:0 12px 28px #0005}html[data-theme="dark"] .role-sidebar-heading{border-color:#40394e}html[data-theme="dark"] .role-sidebar-nav a{color:#f3efff}html[data-theme="dark"] .role-sidebar-nav a:hover{background:#302744;color:#d3bdff}html[data-theme="dark"] .role-sidebar-nav a span{background:#302744;color:#d3bdff}
/* Contraste adicional para o perfil do professor */
html[data-theme="dark"] .profile-layout .admin-panel{background:#24212e;color:#f3efff;border-color:#40394e}
html[data-theme="dark"] .profile-data p{border-color:#40394e}html[data-theme="dark"] .profile-data strong{color:#b0a8c1}html[data-theme="dark"] .profile-summary .admin-form small,html[data-theme="dark"] .profile-password>.muted{color:#b0a8c1}html[data-theme="dark"] input[type="file"]{background:#1d1a27;color:#f3efff;border-color:#514861}
@media(max-width:900px){.role-shell{grid-template-columns:1fr;gap:15px}.role-sidebar{position:relative;top:auto}.role-sidebar-nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.teacher-shell .role-sidebar-nav{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.role-sidebar-nav,.teacher-shell .role-sidebar-nav{grid-template-columns:1fr}.role-sidebar{padding:13px 10px}}


/* Estuda+ — identidade visual inspirada na referência enviada */
:root{
 --ink:#21164b;--ink-soft:#514675;--purple:#6c25d9;--purple-deep:#35106f;
 --lilac:#c9a8ff;--lilac-pale:#f1e8ff;--cream:#fbf8ff;--white:#fff;
 --line:#e8def5;--muted:#817694;--shadow:0 12px 32px #32105f12;
}
body{background-color:#fbf8ff;background-image:radial-gradient(#8d62d51c .8px,transparent .8px);background-size:19px 19px;color:var(--ink)}
.topbar{height:72px;background:#ffffffeb;border-bottom:1px solid #e8def5;box-shadow:0 5px 22px #36116a0b}
.brand-mark{background:linear-gradient(145deg,#7b31e5,#35106f);box-shadow:3px 3px 0 #d9c3ff;border-radius:11px}
.brand-plus{color:#8a35e8}
.topbar nav a:hover,.auth-foot a,.edit-link{color:#7427d8}
.container{max-width:1440px;padding:28px clamp(18px,4vw,58px) 64px}
.button.primary{background:linear-gradient(100deg,#5820ad,#923fe8);box-shadow:0 4px 0 #3c1478}
.button.primary:hover{background:linear-gradient(100deg,#6827c4,#a04cf0)}
.button.subject-button{background:#f0e5ff;color:#6020b5}
.form-stack input,.form-stack select,.admin-form input,.admin-form select,.admin-form textarea,.question-card textarea{border:1px solid #e7def1;background:#fff;border-radius:12px;padding:12px 14px;color:var(--ink)}
.form-stack input:focus,.form-stack select:focus,.admin-form input:focus,.admin-form select:focus,.admin-form textarea:focus,.question-card textarea:focus{border-color:#9a5be8;box-shadow:0 0 0 4px #b98af32b}
.auth-layout{max-width:1320px;min-height:calc(100vh - 170px);grid-template-columns:minmax(0,1.25fr) minmax(360px,.75fr);gap:4%;padding:18px 0;align-items:center}
.auth-art{height:490px;min-height:420px;border-radius:0;background:linear-gradient(125deg,#f7efff 0%,#f1e7ff 60%,#e7d6ff 100%);color:#21164b;padding:48px 42px;align-items:center;box-shadow:none;overflow:hidden}
.auth-art:after{width:370px;height:370px;right:-50px;top:45px;background:#c9a8ff55;border:0}
.auth-art:before{content:'🎓';font-family:inherit;font-size:10rem;right:6%;bottom:12%;color:initial;transform:rotate(8deg);filter:drop-shadow(0 16px 10px #32105f25);z-index:2}
.orbit{border-color:#9b69e955;z-index:1}
.orbit-one{height:330px;width:330px;right:4%;top:15%}
.orbit-two{height:230px;width:230px;right:10%;top:25%;border-style:solid}
.art-star{right:25%;top:18%;color:#8733e9;font-size:2.8rem}
.art-copy{max-width:560px;margin-right:auto;z-index:3}
.art-copy .eyebrow{color:#7c35d0}
.art-copy h1{font-size:clamp(2.8rem,4.5vw,4rem);color:#21164b;letter-spacing:-.065em}
.art-copy em{color:#7624d9}
.art-copy p{color:#514675;font-size:1.08rem;max-width:420px}
.art-tags{gap:10px;margin-top:28px}
.art-tags span{background:#ffffffb8;border:1px solid #ddc9f5;color:#49336d;border-radius:12px;padding:9px 13px;transform:none}
.art-tags span:nth-child(2){transform:none}
.auth-card{max-width:460px;padding:30px;background:#ffffffed;border:1px solid #e9def6;border-radius:22px;box-shadow:0 18px 50px #3a146b14}
.auth-card h2{font-size:1.9rem;color:#21164b}
.auth-card>.muted{margin-bottom:22px;color:#776b8e}
.auth-card .eyebrow.lilac{background:#f1e7ff;color:#7832cf}
.auth-foot{color:#827694}
.auth-standalone{background:#fff;border-color:#eadff6;border-radius:20px;box-shadow:var(--shadow)}
.role-shell{grid-template-columns:235px minmax(0,1fr);gap:24px;max-width:1360px}
.role-sidebar{background:linear-gradient(160deg,#51218f,#32105f);border:0;border-radius:18px;box-shadow:0 12px 28px #32105f2a;color:#fff;padding:18px 13px}
.role-sidebar-heading{border-color:#ffffff25}
.role-sidebar-heading strong{color:#fff}
.role-sidebar-heading small{color:#d8c5f1}
.role-sidebar-heading .brand-mark{background:#a36aff;box-shadow:2px 2px 0 #d7baff}
.role-sidebar-nav a{color:#f7f0ff;border-radius:11px;padding:11px 9px}
.role-sidebar-nav a:hover{background:#ffffff1c;color:#fff;transform:translateX(2px)}
.role-sidebar-nav a span{background:#ffffff1c;color:#e3caff}
.welcome-row{background:linear-gradient(105deg,#f0e5ff,#f8f3ff 65%,#eadbff);border:1px solid #e5d5fa;border-radius:20px;padding:28px}
.welcome-row h1{color:#25134f}
.welcome-note{background:#fff;border:1px solid #e7d8f7;border-radius:14px;transform:none}
.stats-grid{gap:16px}
.stat-card{border:1px solid #e9e0f3;border-radius:17px;background:#fff;box-shadow:0 8px 24px #36116a0b}
.lilac-bg{background:#f0e5ff;color:#7629d2}
.green-bg{background:#eee6ff;color:#6730a8}
.peach-bg{background:#f7eaff;color:#8b3ed0}
.subject-card,.activity-card,.admin-panel,.question-card,.review-card{background:#fff;border:1px solid #e9e0f3;border-radius:18px;box-shadow:0 8px 24px #36116a0b}
.subject-0,.subject-1,.subject-2{background:linear-gradient(145deg,#fff 70%,#f4edff)}
.subject-symbol,.subject-1 .subject-symbol,.subject-2 .subject-symbol{background:#f0e5ff;color:#7629d2}
.count-pill{background:#f5f0fb;border-color:#e9def5;color:#75668d}
.subject-1 .subject-button,.subject-2 .subject-button{background:#f0e5ff;color:#6020b5}
.table-wrap{background:#fff;border-color:#e9e0f3;border-radius:17px}
.table-wrap th{background:#f6f1fc;color:#76668f}
.table-wrap tbody tr:hover{background:#fcf9ff}
.empty-state{background:#fff;border-color:#d9c5f3;border-radius:16px}
.quiz-intro{background:#f1e8ff;border-color:#e3d3f8}
.question-card,.review-card{border-radius:17px}
.question-number{background:#f0e5ff;color:#6722bf}
.option:hover,.option.selected{border-color:#ad7be8;background:#f7f0ff}
.option input{accent-color:#7629d2}
.score-ring{background:conic-gradient(#8438dd calc(var(--score)*1%),#eee7f6 0)}
.admin-panel h2{color:#25134f}
html[data-theme="dark"] .auth-card{background:#24212e;border-color:#40394e}
html[data-theme="dark"] .auth-art{background:linear-gradient(125deg,#292039,#35214f 60%,#422765);color:#fff}
html[data-theme="dark"] .art-copy h1{color:#fff}
html[data-theme="dark"] .art-copy p{color:#d2c6e4}
html[data-theme="dark"] .art-copy em{color:#d1aaff}
html[data-theme="dark"] .art-tags span{background:#ffffff13;border-color:#ffffff25;color:#eee5ff}
html[data-theme="dark"] .role-sidebar{background:linear-gradient(160deg,#2b2140,#1d182a);border-color:#40394e}
html[data-theme="dark"] .welcome-row{background:linear-gradient(105deg,#302541,#292235);border-color:#40394e}
html[data-theme="dark"] .welcome-row h1,html[data-theme="dark"] .admin-panel h2{color:#f3efff}
html[data-theme="dark"] .welcome-note{background:#292235;border-color:#514365;color:#eee5ff}
@media(max-width:900px){
 .auth-layout{grid-template-columns:1fr;gap:18px;max-width:720px}
 .auth-art{height:360px;min-height:0;padding:34px}
 .auth-card{max-width:560px}
 .role-shell{grid-template-columns:1fr}
 .role-sidebar{position:relative;top:auto}
}
@media(max-width:560px){
 .container{padding:20px 15px 42px}
 .auth-art{height:300px;padding:24px}
 .auth-art:before{font-size:6rem;right:5%;bottom:7%}
 .art-copy h1{font-size:2.35rem}
 .art-copy p{max-width:280px;font-size:.92rem}
 .art-tags{margin-top:17px}
 .art-tags span{font-size:.68rem;padding:7px 9px}
 .auth-card{padding:22px 18px}
 .role-sidebar-nav{grid-template-columns:1fr 1fr}
}

/* Logo oficial Estuda+ */
.brand-logo{
  width:145px;
  height:48px;
  object-fit:contain;
  object-position:left center;
  display:block;
}
.role-sidebar-heading .brand-logo{
  width:105px;
  height:42px;
  flex:none;
  object-fit:contain;
  object-position:left center;
}
@media(max-width:560px){
  .brand-logo{
    width:125px;
    height:43px;
  }
  .role-sidebar-heading .brand-logo{
    width:92px;
    height:38px;
  }
}

/* Ajustes de navegação e contraste para as áreas logadas */
.role-top-nav{gap:22px}
.role-top-nav .nav-user{border-left:0;padding-left:0;color:var(--ink);font-weight:800}
.role-top-nav .nav-exit{color:var(--muted)}

/* O menu lateral ocupa toda a altura disponível e continua acessível ao rolar a página. */
.role-shell{align-items:stretch}
.role-sidebar{
  position:sticky;
  top:72px;
  height:calc(100vh - 72px);
  min-height:560px;
  overflow-y:auto;
  align-self:start;
}
.role-content{min-width:0;padding-bottom:18px}

/* Lista de códigos fixos visível para todos os professores. */
.teacher-codes-section{min-width:0;padding:4px 0 0}
.teacher-codes-section .panel-heading{margin-bottom:8px}
.teacher-codes-list{display:grid;gap:9px;margin-top:14px}
.teacher-code-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 15px;border:1px solid var(--line);border-radius:12px;background:var(--white)}
.teacher-code-row>div{display:grid;gap:3px}
.teacher-code-row strong{font-size:.86rem}
.teacher-code-row small{font-size:.72rem;color:var(--muted)}
.teacher-code-row code{font:800 .92rem/1.2 monospace;letter-spacing:.12em;color:var(--purple);background:var(--lilac-pale);border:1px solid var(--line);border-radius:9px;padding:8px 10px;user-select:all}
html[data-theme="dark"] .teacher-code-row{background:#24212e;border-color:#40394e;color:#f3efff}
html[data-theme="dark"] .teacher-code-row small{color:#b0a8c1}
html[data-theme="dark"] .teacher-code-row code{background:#302744;border-color:#514861;color:#dcc9ff}
@media(max-width:900px){.teacher-codes-section{padding-top:0}.teacher-code-row{align-items:flex-start;flex-direction:column}}

/* Contraste completo no modo escuro: cartões, tabelas, chats, atividades e áreas de conteúdo. */
html[data-theme="dark"] .role-top-nav .nav-user{color:#f3efff}
html[data-theme="dark"] .role-top-nav .nav-exit{color:#b0a8c1}
html[data-theme="dark"] .muted{color:#b0a8c1}
html[data-theme="dark"] .admin-heading h1,
html[data-theme="dark"] .admin-heading h2,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .panel-heading h2,
html[data-theme="dark"] .subject-card h3,
html[data-theme="dark"] .activity-card h3,
html[data-theme="dark"] .question-card h3,
html[data-theme="dark"] .review-card h3,
html[data-theme="dark"] .teacher-chat-card strong,
html[data-theme="dark"] .chat-student-row strong,
html[data-theme="dark"] .stat-card strong,
html[data-theme="dark"] .admin-panel h3,
html[data-theme="dark"] .admin-panel strong{color:#f5f1ff}
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .subject-card,
html[data-theme="dark"] .activity-card,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .question-card,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .teacher-chat-card,
html[data-theme="dark"] .teacher-chat-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .question-admin-row,
html[data-theme="dark"] .reset-code-box,
html[data-theme="dark"] .chat-student-row,
html[data-theme="dark"] .teacher-notice-list .notice-row,
html[data-theme="dark"] .approval-card,
html[data-theme="dark"] .quiz-intro,
html[data-theme="dark"] .result-hero,
html[data-theme="dark"] .teacher-section{background:#24212e;color:#f3efff;border-color:#40394e}
html[data-theme="dark"] .subject-0,
html[data-theme="dark"] .subject-1,
html[data-theme="dark"] .subject-2{background:linear-gradient(145deg,#24212e 70%,#2b2540)}
html[data-theme="dark"] .table-wrap table,
html[data-theme="dark"] table{color:#f3efff}
html[data-theme="dark"] .table-wrap th{background:#302b3b;color:#d9d1e8}
html[data-theme="dark"] .table-wrap td{color:#eee9f7}
html[data-theme="dark"] .table-wrap tbody tr:hover{background:#302744}
html[data-theme="dark"] .subject-card p,
html[data-theme="dark"] .activity-card p,
html[data-theme="dark"] .teacher-chat-subject,
html[data-theme="dark"] .chat-student-meta small,
html[data-theme="dark"] .stat-card div span,
html[data-theme="dark"] .profile-data strong{color:#b0a8c1}
html[data-theme="dark"] .count-pill{background:#302744;border-color:#514861;color:#d7cceb}
html[data-theme="dark"] .subject-symbol,
html[data-theme="dark"] .stat-icon,
html[data-theme="dark"] .lilac-bg,
html[data-theme="dark"] .green-bg,
html[data-theme="dark"] .peach-bg{background:#302744;color:#d8c7ff}
html[data-theme="dark"] .subject-button{background:#352b4a;color:#e0d1ff;border-color:#514861}
html[data-theme="dark"] .question-number,
html[data-theme="dark"] .option-letter{background:#302744;color:#e0d1ff}
html[data-theme="dark"] .option{background:#1d1a27;border-color:#514861;color:#f3efff}
html[data-theme="dark"] .option:hover,
html[data-theme="dark"] .option.selected{background:#352b4a;border-color:#8d75bd;color:#fff}
html[data-theme="dark"] .chat-message{background:#302744;color:#f3efff;border-color:#514861}
html[data-theme="dark"] .chat-message.mine{background:#49356b;color:#fff}
html[data-theme="dark"] .chat-avatar,
html[data-theme="dark"] .teacher-chat-avatar{background:#302744;color:#d8c7ff}
html[data-theme="dark"] .chat-conversation-head{border-color:#40394e}
html[data-theme="dark"] .resource-checks{background:#1d1a27;border-color:#514861}
html[data-theme="dark"] .result-pill{border-color:#514861}
html[data-theme="dark"] .score-ring{background:conic-gradient(#9b69e9 calc(var(--score)*1%),#383241 0)}
html[data-theme="dark"] .back-link{color:#d3bdff}
html[data-theme="dark"] .edit-link{color:#cdb5ff}
html[data-theme="dark"] .admin-panel a,
html[data-theme="dark"] .activity-card a,
html[data-theme="dark"] .subject-card a{color:#d3bdff}
html[data-theme="dark"] .role-sidebar{background:linear-gradient(160deg,#2b2140,#1d182a);border-color:#40394e}
html[data-theme="dark"] .role-sidebar-heading{border-color:#4a4258}
html[data-theme="dark"] .role-sidebar-nav a{color:#f7f2ff}
html[data-theme="dark"] .role-sidebar-nav a:hover{background:#392c50;color:#fff}
html[data-theme="dark"] .role-sidebar-nav a span{background:#352b4a;color:#dcc9ff}

/* Em telas menores o menu deixa de ocupar uma coluna fixa, mas continua utilizável. */
@media(max-width:900px){
  .role-sidebar{position:relative;top:auto;height:auto;min-height:0;max-height:none;overflow:visible}
}

/* Menu lateral em largura total — somente layout do menu */
@media (min-width:901px){
  .role-shell{
    width:100vw;
    max-width:none;
    margin-left:calc(50% - 50vw);
    margin-right:0;
    margin-top:-28px;
    grid-template-columns:300px minmax(0,1fr);
    gap:0;
    align-items:stretch;
  }
  .role-sidebar{
    position:sticky;
    top:72px;
    height:calc(100vh - 72px);
    min-height:calc(100vh - 72px);
    border-radius:0;
    border-left:0;
    border-right:1px solid #ffffff18;
    box-shadow:none;
    padding:24px 22px;
  }
  .role-content{
    padding:28px clamp(24px,4vw,58px) 64px 40px;
  }
}

@media (max-width:900px){
  .role-shell{
    width:100%;
    margin-left:0;
    margin-top:0;
  }
}

/* Perfis com o mesmo sidebar dos painéis e cabeçalho limpo. */
body.role-page .topbar{justify-content:flex-end}
body.role-page .topbar>.brand{display:none}
body.role-page .topbar nav{margin-left:auto;justify-content:flex-end}
body.role-page .container{max-width:none;padding-top:0}
.profile-role-shell{margin-top:0!important}
.profile-role-shell .role-content{padding-top:38px}

/* O sidebar do professor não exibe barra de rolagem. */
.teacher-shell .role-sidebar{overflow-y:hidden}


/* Área docente: exibe somente a tela inicial ou a opção escolhida no menu. */
.teacher-shell .teacher-group{display:contents!important}
.teacher-shell .teacher-view-item{display:none!important}
.teacher-shell .teacher-view-item.is-active{display:block!important}
.teacher-shell:not(.teacher-state-home) .teacher-home{display:none!important}
.teacher-shell.teacher-state-home .teacher-view-item{display:none!important}
.teacher-shell .teacher-codes-section.is-active{display:block!important}
.teacher-shell .role-content{min-width:0}
.teacher-shell .teacher-home{margin:8px 0 26px}

/* Chat aprimorado: avatares, áudio, emojis e ações de mensagem */
.chat-message-row{display:flex;align-items:flex-end;gap:8px;max-width:90%}.chat-message-row.mine{align-self:flex-end;flex-direction:row-reverse}.chat-message-row.theirs{align-self:flex-start}.chat-message-avatar{width:30px;height:30px;flex:0 0 30px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#ece5fa;color:#4b3679;font-size:12px;font-weight:700}.chat-message-avatar img{width:100%;height:100%;object-fit:cover}.chat-message{max-width:calc(100% - 38px);min-width:100px}.chat-message audio{display:block;max-width:100%;width:260px;margin-top:8px}.chat-message-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:8px}.chat-message-actions button{border:0;background:transparent;color:var(--muted,#777);font:inherit;font-size:12px;cursor:pointer;padding:2px 0}.chat-message-actions button:hover{color:var(--accent,#7451b8);text-decoration:underline}.chat-page-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.chat-compose{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.chat-compose-tools{grid-column:1/-1;display:flex;align-items:center;gap:8px;flex-wrap:wrap;position:relative}.chat-compose textarea{width:100%;resize:vertical;min-height:54px}.chat-audio-label{cursor:pointer}.emoji-picker{position:absolute;z-index:5;left:0;bottom:45px;display:grid;grid-template-columns:repeat(6,36px);gap:4px;padding:9px;background:var(--surface,#fff);border:1px solid var(--border,#ddd);border-radius:12px;box-shadow:0 8px 24px #0002}.emoji-picker[hidden]{display:none}.emoji-picker button{border:0;background:transparent;border-radius:7px;font-size:21px;padding:5px;cursor:pointer}.emoji-picker button:hover{background:var(--surface-soft,#f5f2fa)}.chat-edit-panel{margin-top:14px;padding:14px;border:1px solid var(--border,#ddd);border-radius:14px}.chat-edit-panel[hidden]{display:none}.chat-edit-panel textarea{width:100%;min-height:70px}.chat-edit-panel form{display:grid;gap:8px}.chat-edit-panel form>button{justify-self:start}@media(max-width:600px){.chat-compose{grid-template-columns:1fr}.chat-compose>.button{width:100%}.chat-message-row{max-width:100%}.chat-message{max-width:calc(100% - 38px)}.chat-message audio{width:220px}}


/* Ajustes desta atualização: chat com mídia, sidebar integral e layout responsivo. */
html,body{max-width:100%;overflow-x:hidden}
.role-page .container{min-width:0}
.role-shell,.role-content,.admin-panel{min-width:0;max-width:100%}
.role-sidebar-heading>a{display:block;flex:none}
.chat-conversation-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.chat-back-button{margin-left:auto;white-space:nowrap}
.chat-compose{grid-template-columns:minmax(0,1fr) auto}
.chat-compose-tools{grid-column:1/-1}
.chat-message-image{display:block;max-width:min(360px,100%);max-height:340px;width:auto;height:auto;object-fit:contain;border-radius:12px;margin-top:7px}
.chat-audio-button,.chat-send-button{min-width:48px;min-height:46px;font-size:20px}
.chat-compose-tools .button{white-space:nowrap}
.emoji-picker{grid-template-columns:repeat(8,36px);max-width:min(340px,90vw);max-height:240px;overflow:auto}
.teacher-home-highlights{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:22px}
.teacher-home-highlights>.admin-panel{margin:0;padding:18px}
.teacher-home-highlights .teacher-code-row{padding:8px 10px}
.teacher-home-highlights h2{margin:12px 0}
@media(max-width:900px){
 .role-shell{grid-template-columns:minmax(0,1fr)!important;width:100%!important;gap:14px!important}
 .role-sidebar{width:100%;height:auto;min-height:0;max-height:none;position:relative;top:auto;overflow:visible;border-radius:14px}
 .role-content{padding:18px 0 36px!important}
 .teacher-home-highlights{grid-template-columns:1fr}
}
@media(max-width:600px){
 .container{padding-left:12px;padding-right:12px}
 .role-sidebar{padding:14px 12px}
 .role-sidebar-heading{gap:8px}
 .role-sidebar-heading .brand-logo{width:78px;height:36px}
 .role-sidebar-nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .role-sidebar-nav a{font-size:.72rem;padding:9px 7px;overflow-wrap:anywhere}
 .chat-compose{grid-template-columns:minmax(0,1fr) 48px;gap:8px}
 .chat-compose textarea{min-width:0}
 .chat-compose-tools{gap:6px}
 .chat-compose-tools .button{font-size:12px;padding:8px 9px}
 .emoji-picker{grid-template-columns:repeat(6,36px)}
 .chat-messages{padding:12px 8px}
 .chat-message{max-width:calc(100% - 38px);min-width:0;overflow-wrap:anywhere}
 .chat-message audio{max-width:100%;width:230px}
 .chat-message-image{max-width:100%;max-height:260px}
 .chat-conversation-head{align-items:flex-start}
 .chat-back-button{margin-left:0}
}

body.role-page.role-chat-page .topbar>.brand{display:block}

/* Ajustes pontuais: contraste do código temporário, seletor de emojis e distribuição dos perfis. */
html[data-theme="dark"] .reset-code-box{
  background:#292337!important;
  color:#f5efff!important;
  border-color:#8d75bd!important;
}
html[data-theme="dark"] .reset-code-box strong,
html[data-theme="dark"] .reset-code-box p,
html[data-theme="dark"] .reset-code-box a{color:#f5efff!important}
html[data-theme="dark"] .reset-code-box code{
  background:#fff!important;
  color:#241a35!important;
  border:2px solid #c7a9ff;
  font-size:1.2rem;
  letter-spacing:.14em;
  box-shadow:0 0 0 3px #9b79d455;
}
.emoji-picker{
  box-sizing:border-box;
  width:min(100%,310px);
  max-width:calc(100vw - 36px);
  grid-template-columns:repeat(6,minmax(0,1fr));
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
.emoji-picker button{min-width:0}
@media(min-width:901px){
  .role-shell{
    min-height:calc(100vh - 72px);
    align-items:stretch;
  }
  .role-shell>.role-sidebar{
    align-self:stretch;
    height:auto;
    min-height:calc(100vh - 72px);
    box-sizing:border-box;
  }
  .role-shell>.role-content{
    min-height:calc(100vh - 72px);
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    align-content:flex-start;
    gap:18px;
  }
  .role-content>.admin-heading,
  .role-content>.welcome-row{margin-top:0;margin-bottom:8px}
  .role-content>.admin-panel,
  .role-content>.teacher-grid{width:100%;box-sizing:border-box}
  .teacher-grid{align-items:stretch;gap:20px}
}
@media(max-width:900px){
  .role-shell>.role-sidebar{min-height:0;height:auto}
  .role-shell>.role-content{min-height:0;gap:14px}
}


/* Refinamento visual: preenchimento do menu lateral e melhor distribuição do conteúdo. */
@media (min-width: 901px) {
  .role-shell {
    grid-template-columns: 292px minmax(0, 1fr);
    align-items: stretch;
    min-height: calc(100vh - 78px);
  }

  .role-shell > .role-sidebar {
    position: sticky;
    top: 78px;
    align-self: start;
    width: 100%;
    height: calc(100vh - 78px);
    min-height: calc(100vh - 78px);
    margin: 0;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .role-sidebar-nav {
    gap: 7px;
  }

  .role-sidebar-nav a {
    min-height: 43px;
    padding: 10px 11px;
  }

  .role-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 34px clamp(28px, 4vw, 64px) 64px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  .role-content > * {
    min-width: 0;
    width: 100%;
  }

  .role-content > .welcome-row {
    margin: 0 0 2px;
  }

  .role-content > .stats-grid {
    margin: 0 0 8px;
  }

  .role-content > .section-heading {
    margin: 4px 0 -8px;
  }

  .role-content > .subject-grid,
  .role-content > .activity-grid {
    margin-bottom: 12px;
  }

  .role-content > .admin-heading {
    margin: 0 0 2px;
  }

  .teacher-home-highlights {
    gap: 22px;
    margin-top: 26px;
  }

  .teacher-home-highlights > .admin-panel {
    padding: 22px;
  }

  .teacher-grid {
    gap: 22px;
    align-items: stretch;
  }

  .role-content > .admin-panel,
  .role-content > section.admin-panel {
    margin: 0;
  }

  .profile-role-shell .role-content {
    padding-top: 42px;
  }
}

@media (max-width: 900px) {
  .role-shell {
    align-items: start;
  }

  .role-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
  }

  .role-content > * {
    width: 100%;
    min-width: 0;
  }

  .role-content > .welcome-row,
  .role-content > .admin-heading {
    margin-top: 0;
    margin-bottom: 0;
  }

  .role-content > .stats-grid {
    margin-bottom: 8px;
  }

  .teacher-grid {
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .role-content {
    gap: 16px;
  }

  .role-content > .welcome-row {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

  .role-content > .stats-grid,
  .role-content > .subject-grid {
    gap: 12px;
  }

  .role-content .admin-panel {
    padding: 17px;
  }
}
