/* AliPlay — Quizzes do Professor. Interface apenas sob body.quiz-teacher.
   Aluno, autenticação, endpoints e regras de recompensa ficam intocados. */
.quizSide[hidden]{display:none!important}
body.quiz-teacher{font-family:ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;background:radial-gradient(900px 520px at 2% 0%,rgba(96,165,250,.14),transparent 60%),radial-gradient(720px 500px at 98% 8%,rgba(74,222,128,.10),transparent 62%),#f7faff;color:#281b57;min-height:100vh}
body.quiz-teacher *{box-sizing:border-box}
body.quiz-teacher button,body.quiz-teacher input,body.quiz-teacher textarea{font:inherit}
body.quiz-teacher .quizSide{position:fixed;top:0;left:0;bottom:0;width:162px;padding:14px 11px 12px;border-right:1px solid #dfe5ff;background:rgba(255,255,255,.96);backdrop-filter:blur(16px);z-index:40;display:flex;flex-direction:column;overflow:auto}
.quizBrand{height:70px;border-bottom:1px solid #edf0ff;display:flex;align-items:center;justify-content:center;margin-bottom:8px;text-decoration:none;flex:0 0 auto}
.quizBrand img{display:block;width:118px;max-width:calc(100% - 10px);height:auto;object-fit:contain}
.quizNav{display:flex;flex-direction:column;gap:4px}
.quizNav a{width:100%;text-decoration:none;color:#4520e6;display:flex;align-items:center;gap:8px;padding:9px;border-radius:12px;font-size:11px;font-weight:800;line-height:1.1;transition:background .16s ease}
.quizNav a:hover{background:#f0edff}.quizNav a.active{background:#ecebff;color:#3714d9}
.quizNav .navIco{width:22px;height:22px;border:2px solid #6944ff;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;flex:0 0 22px;background:#fff}
.quizSideBottom{margin-top:auto;padding-top:12px}.quizSideBottom a{display:block;text-align:center;text-decoration:none;border:1px solid #ded9fb;background:#faf9ff;color:#5225db;border-radius:12px;padding:9px 8px;font-size:10px;font-weight:900}
body.quiz-teacher #profBox{max-width:1600px;width:calc(100% - 162px);margin:0 0 0 162px;padding:18px clamp(18px,2.4vw,38px) 44px;background:transparent;box-shadow:none;border-radius:0}
.quizTopbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 4px 16px;flex-wrap:wrap}
.quizGreeting{font-size:clamp(22px,2.2vw,27px);font-weight:900;color:#4b13dd;letter-spacing:-.55px;line-height:1.22}
.quizGreeting span{color:#281b57}.quizGreeting small{display:block;margin-top:4px;color:#756b93;font-size:11px;font-weight:800;letter-spacing:0}
.quizTopActions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.quizContext{display:inline-flex;align-items:center;gap:5px;padding:7px 10px;border-radius:999px;background:#ecfff0;border:1px solid #bff1ca;color:#167337;font-size:11px;font-weight:900;white-space:nowrap}
.quizContext.soft{background:#f7f5ff;border-color:#ddd7fb;color:#5d2cf2}
.quizLogout{border:1px solid #d9def5;border-radius:999px;background:#fff;color:#5d2cf2;min-height:33px;padding:6px 12px;font-size:11px!important;font-weight:800!important;cursor:pointer}
.quizHero{display:grid;grid-template-columns:minmax(0,1fr) 268px;gap:22px;align-items:center;padding:27px 29px;min-height:180px;background:linear-gradient(135deg,rgba(255,255,255,.97),rgba(241,247,255,.93) 52%,rgba(238,255,248,.95));border:1px solid #d8ddfb;border-radius:18px;box-shadow:0 8px 26px rgba(74,74,120,.055)}
.quizEyebrow{font-size:10px;font-weight:900;letter-spacing:1px;color:#6a43ef;text-transform:uppercase}
.quizHero h1{font-size:clamp(24px,2.5vw,31px);line-height:1.14;letter-spacing:-.65px;margin:7px 0 8px;color:#25165e}
.quizHero p{margin:0;max-width:750px;color:#696084;font-size:13px;line-height:1.55;font-weight:600}
.quizHeroActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:17px}
.quizPrimary,.quizSecondary{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:11px;padding:10px 13px;min-height:39px;font-size:11px!important;font-weight:850!important;cursor:pointer}
.quizPrimary{border:0;background:linear-gradient(135deg,#6236ed,#7847ff 55%,#4c8bff);color:#fff;box-shadow:0 10px 22px rgba(93,55,225,.16)}
.quizSecondary{border:1px solid #dfdaf5;background:#fff;color:#4b22cf}
.quizHeroInfo{border:1px solid #d9d1ff;border-radius:19px;background:#fff;padding:17px;display:grid;grid-template-columns:44px 1fr;gap:5px 10px;align-items:center;color:#401cce;box-shadow:0 12px 30px rgba(80,50,180,.09)}
.quizHeroIcon{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:#f0edff;font-size:22px;grid-row:1/3}
.quizHeroInfo strong{font-size:13px}.quizHeroInfo small{color:#776b9c;font-size:10px;line-height:1.45}
.quizSectionTitle{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:24px 4px 11px;flex-wrap:wrap}
.quizSectionTitle span:first-child{font-size:10px;font-weight:900;letter-spacing:1px;color:#6a43ef}
.quizSectionTitle h2{font-size:21px;color:#28165f;margin:3px 0 2px}.quizSectionTitle p{color:#776d96;font-size:11px;margin:0}
.quizSectionTitle .quizCount{border:1px solid #ddd7f6;background:#fff;border-radius:999px;padding:8px 11px;font-size:11px;font-weight:850;color:#5c39d4;letter-spacing:0;white-space:nowrap}
body.quiz-teacher .prof-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(370px,.92fr);gap:14px;align-items:start}
.quizPanel{background:#fff;border:1px solid #d8ddfb;border-radius:18px;box-shadow:0 8px 26px rgba(74,74,120,.055);padding:20px;min-width:0;scroll-margin-top:20px}
.quizPanelHeading{display:flex;align-items:center;gap:11px;margin-bottom:18px}.quizPanelHeading>div{min-width:0}
.quizPanelHeading .quizPanelIcon{width:39px;height:39px;flex:0 0 39px;display:grid;place-items:center;background:linear-gradient(135deg,#6236ed,#7a53ff);color:#fff;border-radius:12px;font-weight:900;font-size:23px}
.quizPanelHeading .quizPanelIcon.purple{background:#f0edff;color:#5d2cf2;font-size:22px}
.quizPanelHeading h2{font-size:19px;line-height:1.2;margin:3px 0;color:#28165f}
.quizPanelHeading p{font-size:11px;line-height:1.45;color:#786d97;margin:0}
body.quiz-teacher .field{gap:7px;margin-bottom:14px}
body.quiz-teacher .field label{color:#342165;font-size:12px;font-weight:850}
body.quiz-teacher .field textarea,body.quiz-teacher .field input[type=text],body.quiz-teacher .field input[type=date],body.quiz-teacher .field input[type=number]{font-size:13px;line-height:1.5;border-color:#d8ddfb;border-radius:11px;background:#fff;color:#253456;padding:10px 12px}
body.quiz-teacher .field input[type=date],body.quiz-teacher .field input[type=text],body.quiz-teacher .field input[type=number]{min-height:43px;height:auto}
body.quiz-teacher .field textarea{min-height:95px}
body.quiz-teacher .opt-row{margin-bottom:8px;flex-wrap:wrap;gap:7px}
body.quiz-teacher .opt-row input[type=text]{min-width:110px;flex:1 1 200px;width:auto}
body.quiz-teacher .opt-row .as-correct{min-height:38px;padding:8px 10px;border-color:#d9def5;color:#5426dd;font-size:11px;font-weight:800}
body.quiz-teacher .opt-row .as-correct.on{background:#eafbf1;border-color:#a3e9bf;color:#167a46}
body.quiz-teacher .opt-row .del{min-height:38px;padding:8px 10px;background:#fff4f5;border-color:#ffd6dc;color:#af3045;font-size:11px;font-weight:800}
body.quiz-teacher .opt-add{min-height:38px;border-color:#ded9fa;color:#5225db;background:#f7f5ff;font-size:11px;font-weight:850;width:100%}
body.quiz-teacher .field small{font-size:10px!important;line-height:1.5}
body.quiz-teacher .meta-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 12px;margin-top:17px;align-items:end}
body.quiz-teacher .meta-grid>.field{margin:0}
body.quiz-teacher .meta-actions{grid-column:1/-1;display:flex;justify-content:flex-start;flex-wrap:wrap;gap:8px;margin-top:2px}
body.quiz-teacher .submit{background:linear-gradient(135deg,#6236ed,#7847ff 55%,#4c8bff);border:0;border-radius:11px;font-size:12px;font-weight:850;box-shadow:0 8px 20px rgba(93,55,225,.12)}
body.quiz-teacher .btn-cancel{background:#fff;border:1px solid #ded9fa;color:#5225db;border-radius:11px;font-size:12px;font-weight:800}
body.quiz-teacher .prof-msg{font-size:12px;color:#4c22d3}
/* Biblioteca compacta: pesquisar, recolher e percorrer sem alongar a página. */
body.quiz-teacher .quizLibraryHeading{align-items:center;flex-wrap:wrap}
body.quiz-teacher .quizLibraryHeading>div{flex:1 1 160px}
body.quiz-teacher .quizLibraryToggle{margin-left:auto;flex:0 0 auto;min-height:35px;padding:7px 11px;border:1px solid #ded9fa;background:#faf9ff;color:#5225db;border-radius:11px;font-size:11px;font-weight:850;cursor:pointer}
body.quiz-teacher #quizLibraryBody[hidden],body.quiz-teacher .quizLibraryEmpty[hidden],body.quiz-teacher .prof-item[hidden]{display:none!important}
body.quiz-teacher .quizLibrarySearchRow{display:flex;flex-wrap:wrap;align-items:center;gap:6px 9px;margin:-3px 0 12px}
body.quiz-teacher .quizLibrarySearchRow label{width:100%;font-size:11px;font-weight:850;color:#342165}
body.quiz-teacher #quizLibrarySearch{flex:1 1 195px;min-width:0;width:100%;min-height:42px;padding:9px 12px;border:1px solid #d8ddfb;border-radius:11px;background:#fff;color:#253456;font-size:13px}
body.quiz-teacher .quizLibraryMatches{font-size:11px;font-weight:800;color:#62558d}
body.quiz-teacher .prof-list{background:transparent;border:0;padding:0 5px 0 0;max-height:440px;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}
body.quiz-teacher .quizLibraryHint{margin:10px 0 0;font-size:11px;color:#766c91}
body.quiz-teacher .quizLibraryEmpty{padding:11px;border:1px dashed #d8ddfb;border-radius:11px;font-size:12px;color:#62558d}

body.quiz-teacher .prof-item{padding:15px 14px;border:1px solid #dfe5f3;background:#f9fbff;border-radius:14px;margin-bottom:10px;box-shadow:none;overflow-wrap:anywhere}
body.quiz-teacher .prof-item>div:first-child{font-size:13px;line-height:1.42;color:#241752;margin-bottom:7px}
body.quiz-teacher .prof-item .meta{font-size:10.5px;gap:5px 10px;line-height:1.45;color:#626b83}
body.quiz-teacher .prof-item .actions{margin-top:11px}
body.quiz-teacher .quizLibraryToggle:focus-visible,body.quiz-teacher #quizLibrarySearch:focus-visible{outline:3px solid #a493ff;outline-offset:2px}
body.quiz-teacher .btn-edit,body.quiz-teacher .btn-del{border-radius:10px;padding:8px 11px;font-size:11px;font-weight:800}
body.quiz-teacher .btn-edit{background:#fff;color:#4c22cf;border-color:#d9d1ff}
body.quiz-teacher .btn-del{background:#fff4f5;border-color:#ffd6dc;color:#af3045}
body.quiz-teacher button:hover:not(:disabled),body.quiz-teacher .quizSecondary:hover{filter:brightness(.98)}
body.quiz-teacher button:focus-visible,body.quiz-teacher input:focus-visible,body.quiz-teacher textarea:focus-visible,body.quiz-teacher a:focus-visible{outline:3px solid #a493ff;outline-offset:2px}
@media(max-width:1160px){body.quiz-teacher .prof-grid{grid-template-columns:minmax(0,1fr)}.quizHero{grid-template-columns:minmax(0,1fr)}.quizHeroInfo{max-width:540px}}
@media(max-width:820px){
  body.quiz-teacher .quizSide{position:sticky;top:0;left:auto;bottom:auto;width:100%;height:auto;max-width:100vw;padding:8px 10px;flex-direction:row;align-items:center;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid #dfe5ff;box-shadow:0 6px 20px rgba(50,45,100,.06);scrollbar-width:none}
  .quizSide::-webkit-scrollbar{display:none}.quizBrand{height:48px;min-width:112px;border-bottom:0;border-right:1px solid #edf0ff;margin:0 8px 0 0;padding-right:8px}.quizBrand img{width:92px}
  .quizNav{flex-direction:row;gap:5px;flex:0 0 auto}.quizNav a{min-width:46px;width:46px;height:46px;padding:7px;justify-content:center;border-radius:13px}.quizNav a span:last-child{display:none}.quizNav .navIco{width:28px;height:28px;flex-basis:28px}.quizSideBottom{display:none}
  body.quiz-teacher #profBox{margin:0;width:100%;max-width:none;padding:16px 14px 32px}.quizTopbar{gap:10px;margin:0 5px 14px}.quizGreeting{font-size:24px}.quizContext{display:none}.quizHero{padding:20px}.quizHeroInfo{display:none}
}
@media(max-width:520px){body.quiz-teacher #profBox{padding:13px 10px 28px}.quizPanel{padding:15px}.quizHero{padding:16px}.quizHero h1{font-size:24px}body.quiz-teacher .meta-grid{grid-template-columns:1fr}.quizTopbar{align-items:flex-start}.quizGreeting{font-size:21px}.quizSectionTitle h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){.quizNav a{transition:none}html{scroll-behavior:auto}}

@media(max-width:520px){body.quiz-teacher .prof-list{max-height:380px}body.quiz-teacher .quizLibraryToggle{min-height:38px}}
