:root {
  --navy: #26304a; --navy2: #2c3e5c; --g1: #e5c68a; --g2: #c49a5e; --g3: #8e6338;
  --bg: #f4f2ed; --bg2: #eae7df; --card: #fff; --ink: #1f2638; --mut: #667089; --line: #e3ded3;
  --ok: #2e7d57; --okb: #e6f3ec; --bad: #b23a3a; --badb: #f8e8e8; --warn: #a86a12;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Montserrat, system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; display: flex; flex-direction: column; min-height: 100vh; transition: background 0.3s, color 0.3s; }
html.dark-mode-preload body { transition: none !important; }
main { flex: 1; max-width: 1280px; width: 100%; margin: auto; padding: 24px 20px 60px; }
button, input, select, textarea { font: inherit; }
.gold { background: linear-gradient(120deg, var(--g3), var(--g2) 35%, var(--g1) 55%, var(--g2) 75%, var(--g3)); }

header { background: var(--card); position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 14px rgba(38, 48, 74, .08); transition: background 0.3s; }
header::after { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--g3), var(--g1), var(--g3)); }
html, body { max-width: 100vw; overflow-x: hidden; }
.bar { max-width: 1280px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand img { height: 50px; width: auto; display: block; }
nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; flex: 1; margin: 0 12px; }
.tab { border: 0; background: transparent; color: var(--navy); font-weight: 600; padding: 10px 14px; border-radius: 10px; cursor: pointer; transition: 0.2s; white-space: nowrap; font-size: 15px; }
.tab:hover { background: var(--bg2); }
.tab.on { background: var(--navy); color: var(--card); }
.tab.on:hover { background: var(--navy); color: var(--card); filter: brightness(1.06); }
.tab:disabled { opacity: .4; cursor: not-allowed; }

/* Dropdowns da barra de navegação (Questões e Desempenho) */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 6px; }
.nav-drop-btn .drop-arrow { transition: transform 0.2s ease; flex: none; opacity: 0.85; }
.nav-dropdown.open .nav-drop-btn .drop-arrow { transform: rotate(180deg); }
.nav-dropdown.open .nav-drop-btn:not(.on) { background: var(--bg2); }

.nav-drop-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 185px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(38, 48, 74, 0.16);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 60;
}
.nav-dropdown.open .nav-drop-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-drop-item {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-drop-item:hover { background: var(--bg2); }
.nav-drop-item.on { background: var(--navy); color: var(--card); }

.conta-nav { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; flex: none; justify-content: flex-end; }
.conta-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: background 0.2s; }
.conta-user:hover { background: var(--bg2); }
.conta-nome { color: var(--navy); font-size: 14px; font-weight: 700; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1150px) {
  .bar { justify-content: center; }
  nav { order: 3; flex-basis: 100%; margin-top: 12px; }
  .conta-nav { order: 2; margin-left: auto; }
}

.view { display: none; }
.view.on { display: block; }

.hero { background: linear-gradient(135deg, var(--navy2), var(--navy)); color: #fff; border-radius: 22px; padding: 32px; display: flex; gap: 28px; align-items: center; position: relative; overflow: hidden; transition: background 0.3s; }
.hero .mark { width: 120px; height: auto; flex: none; display: block; }
.hero h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; color: #fff; }
.hero p { margin: 0; color: #d9deea; font-size: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: 12px; font-weight: 700; color: var(--g1); }
@media (max-width: 860px) { .hero { flex-direction: column; text-align: center; } }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 4px 18px rgba(38, 48, 74, .05); transition: background 0.3s, border-color 0.3s; }
.card h2 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.card h3 { margin: 16px 0 10px; font-size: 15px; color: var(--navy); }
.sub { color: var(--mut); font-size: 14.5px; margin: 0 0 16px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 32px; color: var(--navy); }
.stat span { color: var(--mut); font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; cursor: pointer; color: var(--card); background: var(--navy); transition: transform .1s, filter .15s; text-decoration: none; line-height: 1.2; text-align: center; box-sizing: border-box; font-size: 15px; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn.g { color: var(--navy); background: linear-gradient(120deg, var(--g2), var(--g1), var(--g2)); }
.btn.o { background: var(--card); color: var(--navy); border: 1.5px solid var(--navy); }
.btn.r { background: var(--bad); color: #fff; }
.btn.s { padding: 8px 14px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.row > .btn { display: flex; align-items: center; justify-content: center; min-height: 46px; margin: 0; }

label { font-size: 14px; font-weight: 600; color: var(--navy); }
input[type=text], input[type=number], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=password], select, textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); transition: background 0.3s, border-color 0.3s; font-size: 15px; }
textarea { min-height: 100px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g2); box-shadow: 0 0 0 3px rgba(196, 154, 94, .2); }
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--navy); transition: all 0.2s; }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--card); }

.note { background: var(--bg2); border-left: 4px solid var(--g2); padding: 12px 16px; border-radius: 8px; font-size: 14px; color: var(--ink); margin: 12px 0; }
.warnbox { background: #fff4e0; border-left: 4px solid var(--warn); padding: 12px 16px; border-radius: 8px; font-size: 14px; margin: 12px 0; color: #5a4a33; }

/* PROVA — barra com contraste fixo (claro e escuro) */
.ptop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #26304a; color: #fff; border-radius: 16px; padding: 12px 20px; margin-bottom: 16px; position: sticky; top: 80px; z-index: 10; }
.ptop .t { font-weight: 700; color: #fff; font-size: 16px; }
.ptop .cont { font-weight: 700; color: var(--g1); font-size: 15px; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 800; color: var(--g1); }
.timer.low { color: #ff9d8a; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.prog { height: 6px; background: rgba(255, 255, 255, .18); border-radius: 9px; flex-basis: 100%; overflow: hidden; }
.prog i { display: block; height: 100%; }

.playout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
@media (max-width: 900px) { .playout { grid-template-columns: 1fr; } }

.qhead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--mut); margin-bottom: 12px; }
.qnum { font-weight: 800; color: var(--navy); font-size: 18px; }
.tag { display: inline-block; background: var(--bg2); color: var(--navy); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.tag.w { background: #fff1d6; color: var(--warn); }
.tag.x { background: var(--badb); color: var(--bad); }
.tag.k { background: var(--okb); color: var(--ok); }

.enun { font-size: 16.5px; margin: 8px 0 16px; overflow-x: auto; }
.fig { text-align: center; margin: 12px 0 18px; }
.fig img { max-width: 100%; max-height: 340px; border-radius: 10px; background: var(--card); }

.alts { display: flex; flex-direction: column; gap: 10px; }
.alt { display: flex; gap: 14px; align-items: center; text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 13px; padding: 12px 16px; cursor: pointer; color: var(--ink); overflow-x: auto; transition: 0.15s; font-size: 15.5px; }
.alt:hover { border-color: var(--g2); }
.alt .l { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--bg2); color: var(--navy); }
.alt.sel { border-color: var(--navy); background: rgba(38, 48, 74, 0.05); }
.alt.sel .l { background: var(--navy); color: var(--card); }
.alt.cor { border-color: var(--ok); background: var(--okb); }
.alt.cor .l { background: var(--ok); color: #fff; }
.alt.err { border-color: var(--bad); background: var(--badb); }
.alt.err .l { background: var(--bad); color: #fff; }

.alt-fixacao { display: block; width: 100%; text-align: left; padding: 14px; margin-bottom: 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; transition: 0.2s; font-size: 16px; }
.alt-fixacao:hover { border-color: var(--g2); }
.alt-fixacao:disabled { cursor: not-allowed; }
.alt-fixacao .l { display: inline-block; width: 26px; font-weight: bold; margin-right: 8px; color: var(--navy); }

.pnav { display: flex; gap: 10px; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; }

.mapa { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mapa button { aspect-ratio: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--navy); font-size: 14px; transition: 0.2s; }
.mapa button:hover { border-color: var(--g2); }
.mapa button.r { background: var(--navy); color: var(--card); border-color: var(--navy); }
.mapa button.cur { outline: 3px solid var(--g2); outline-offset: 1px; }
.mapa button.ok { background: var(--ok); color: var(--card); border-color: var(--ok); }
.mapa button.bd { background: var(--bad); color: var(--card); border-color: var(--bad); }

/* RESULTADO — anel organizado */
.score { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ring { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ring-inner { width: 104px; height: 104px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: inset 0 2px 8px rgba(0,0,0,0.05); }
.ring-pct { font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1; }
.ring-lbl { font-size: 11px; color: var(--mut); font-weight: 700; margin-top: 5px; text-transform: uppercase; letter-spacing: .08em; }
.score-info { flex: 1; min-width: 240px; }
.score-info h2 { margin: 0 0 10px; color: var(--navy); font-size: 26px; line-height: 1.2; }
.score-resumo { margin: 0 0 8px; color: var(--ink); font-size: 15px; }
.score-tempo { margin: 0; color: var(--mut); font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--navy); }

.blayout { display: block !important; width: 100% !important; }
.blayout > .card { width: 100% !important; box-sizing: border-box !important; max-height: none !important; overflow: visible !important; border-radius: 18px !important; margin-bottom: 24px !important; }
.qitem { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; background: var(--card); }
.qitem:hover { border-color: var(--g2); }
.qitem.on { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(38, 48, 74, .12); }
.altgrid { display: grid; grid-template-columns: 30px 1fr; gap: 8px 10px; align-items: center; }
.altgrid input { padding: 8px 10px; }

.banner-junte-se { padding: 0; overflow: hidden; background: linear-gradient(135deg, var(--card), var(--bg2)); border-radius: 20px; box-shadow: 0 12px 35px rgba(38, 48, 74, 0.08); border: 1px solid var(--line); transition: background 0.3s; }
.banner-junte-se-content { display: flex; align-items: stretch; flex-wrap: wrap; }
.banner-junte-se-texto { flex: 1; min-width: 320px; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.banner-junte-se-texto p { text-align: justify; color: var(--ink); font-size: 15px; }
.banner-junte-se-img { flex: 1.3; min-width: 350px; min-height: 350px; position: relative; background: var(--bg2); }
.banner-junte-se-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }

.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; background: #000; margin: 0; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Cards de curso/concurso — imagem SEM corte lateral (contain) */
.curso-card, .btn-trilha { background: var(--card); border-radius: 12px; box-shadow: 0 6px 18px rgba(35,30,25,0.06); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; text-align: center; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; border: 1px solid var(--line); height: 100%; min-height: 240px; }
.curso-card:hover, .btn-trilha:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(35,30,25,0.09); border-color: var(--g2); }
.curso-card .thumb { width: 100%; height: 150px; background-position: center; background-size: cover; flex: none; }
.curso-card .body { padding: 20px; width: 100%; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.curso-card .titulo, .btn-trilha b { font-weight: 700; color: var(--navy); margin: 0 0 10px 0; font-size: 18px; line-height: 1.3; text-align: center; }
.curso-card .descricao { font-size: 14px; color: var(--g3); min-height: 40px; margin-bottom: 16px; margin-top: auto; flex-grow: 1; text-align: center; }
.curso-card .prog-row { width: 100%; margin-top: auto; }
.curso-card .prog-row .progress-bar { height: 8px; border-radius: 6px; background: var(--line); }
.curso-card .prog-row .progress-bar i { background: var(--navy); }
.curso-card .prog-row .percent { font-size: 13px; color: var(--g3); margin-top: 8px; text-align: right; font-weight: bold; }

.btn-trilha { padding: 20px 16px; justify-content: flex-start; align-items: center; text-align: center; min-height: 140px; }
.btn-trilha img { width: 100%; height: 70px; object-fit: contain; background: var(--card); padding: 6px; margin-bottom: 12px; flex: none; border-radius: 8px; }
.btn-trilha b { margin: 0 0 8px 0; flex: none; font-size: 16px; }

.banner-16x9 { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--bg2); margin-bottom: 24px; }
.banner-16x9 img { width: 100%; height: 100%; object-fit: cover; }

#listaCursosAluno, #listaComponentesAluno, #listaConcursosEdicao, #listaCursosEdicao, #listaCursosPublicos, #listaCadernos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

#salaDeAula { display: block; }
.sala-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.sala-principal { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.sala-trilha { background: var(--bg2); padding: 24px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 900px) { .sala-layout { grid-template-columns: 1fr; } }

.topic-card { background: var(--card); padding: 14px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; cursor: pointer; }
.topic-card .topic-header { display: flex; align-items: center; justify-content: space-between; }
.topic-card .topic-title { font-weight: 600; color: var(--navy); font-size: 15px; }
.topic-card .topic-body { margin-top: 12px; display: none; }
.topic-card.open .topic-body { display: block; }
.aula-item { padding: 8px 10px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; background: transparent; font-size: 14.5px; }
.aula-item:hover { background: var(--bg2); }
.progress-bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg,var(--navy), var(--g2)); width: 0%; }
.resume-box { background: var(--card); padding: 20px; border-radius: 12px; border: 1px solid var(--line); }

.ax-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20, 26, 40, 0.65); z-index: 9999; padding: 20px; }
.ax-modal .ax-box { background: var(--card); border-radius: 12px; padding: 28px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.2); position: relative; color: var(--ink); }
.ax-modal .ax-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal { position: fixed; inset: 0; background: rgba(20, 26, 40, .65); display: none; place-items: center; z-index: 9998; padding: 18px; }
.modal.on { display: grid; }
.modal .card { max-width: 480px; width: 100%; margin: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }

.conta-trocar { display: block; width: 100%; background: transparent; border: none; color: var(--navy); text-decoration: underline; font-size: 15px; font-weight: 600; text-align: center; margin-top: 18px; cursor: pointer; padding: 10px; }
.conta-trocar:hover { color: var(--g2); }
#ctForm .row { display: flex; gap: 12px; margin-top: 20px; }
#ctForm .row .btn { flex: 1; padding: 12px; }
.conta-erro { min-height: 22px; color: var(--bad); font-size: 14px; font-weight: 600; margin: 10px 0; text-align: center; }

hr.divisor { margin: 28px 0; border: none; border-top: 1px solid var(--line); }
.switch-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-toggle .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--line); transition: .3s; border-radius: 24px; }
.switch-toggle .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: var(--card); transition: .3s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch-toggle input:checked + .slider { background-color: #2b6cb0; }
.switch-toggle input:checked + .slider:before { transform: translateX(20px); }
#uBancos, #uCursos { display: flex; flex-wrap: wrap; gap: 10px; }
#uBancos label, #uCursos label { margin: 0 !important; padding: 8px 14px !important; border-radius: 20px !important; font-size: 14.5px; }
.card-small { border: 1px solid var(--line); padding: 20px; border-radius: 12px; background: var(--card); margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); color: var(--ink); transition: background 0.3s; }
.card-small h4 { margin: 0 0 10px 0; font-size: 17px; color: var(--navy); }
.hide { display: none !important; }

footer { text-align: center; color: var(--mut); font-size: 14px; padding: 28px; border-top: 1px solid var(--line); background: var(--bg2); margin-top: auto; width: 100%; }
footer p { margin: 0; }

.selected-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.sel-chip { background: var(--navy); color: var(--card); border-color: var(--navy); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 12px; box-shadow: 0 2px 6px rgba(38, 48, 74, 0.2); transition: all 0.2s ease; }
.sel-chip:hover { background: var(--bad); border-color: var(--bad); }
.search-filter-input { width: 100%; padding: 10px 14px; font-size: 14px; border: 1.5px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: var(--bg2); transition: all 0.2s; }
.search-filter-input:focus { background: var(--card); border-color: var(--g2); box-shadow: 0 0 0 3px rgba(196, 154, 94, 0.15); outline: none; }
.filter-chips-box { display: flex; flex-wrap: wrap; gap: 10px; max-height: 140px; overflow-y: auto; padding: 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.filter-chips-box::-webkit-scrollbar { width: 6px; }
.filter-chips-box::-webkit-scrollbar-track { background: transparent; }
.filter-chips-box::-webkit-scrollbar-thumb { background-color: var(--line); border-radius: 10px; }
.filter-chips-box::-webkit-scrollbar-thumb:hover { background-color: var(--g2); }
.filter-chips-box .chip { background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,0.02); transition: all 0.2s ease; font-size: 13px; padding: 5px 12px; }
.filter-chips-box .chip:hover { border-color: var(--g2); background: var(--bg2); }

.chart-container { position: relative; width: 100%; height: 350px; }

/* Chips de disciplina clicáveis no histórico (acima do gráfico de temas) */
#chFrentesHist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#chFrentesHist .chip { cursor: pointer; }
#chFrentesHist .chip.on { background: var(--g2); border-color: var(--g2); color: #fff; }

/* ===== CADERNOS (treino sem timer, feedback imediato) ===== */
.caderno-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.caderno-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.10); border-color: var(--g2); }
.caderno-card .caderno-icone { font-size: 30px; }
.caderno-card h3 { margin: 0; color: var(--navy); font-size: 19px; }
.caderno-card .cont { font-size: 13px; color: var(--mut); font-weight: 700; }
.caderno-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #26304a; color: #fff; border-radius: 16px; padding: 12px 20px; margin-bottom: 16px; }
.caderno-top .t { font-weight: 700; color: #fff; font-size: 16px; }
.caderno-top .cont { margin-left: auto; font-weight: 700; color: var(--g1); font-size: 15px; }
.caderno-feedback { margin-top: 16px; padding: 16px 18px; border-radius: 10px; font-size: 15px; display: none; }
.caderno-feedback.ok { display: block; background: var(--okb); color: var(--ok); border: 1.5px solid var(--ok); }
.caderno-feedback.erro { display: block; background: var(--badb); color: var(--bad); border: 1.5px solid var(--bad); }
.caderno-resolucao { margin-top: 14px; padding: 16px 18px; background: var(--bg2); border-left: 4px solid var(--g2); border-radius: 8px; font-size: 15px; display: none; }
.caderno-resolucao.show { display: block; }

/* Paginação genérica */
.paginacao { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; }
.paginacao .info { font-size: 14px; font-weight: 600; color: var(--mut); }

.ranking-header { background: var(--card); border-radius: 18px; padding: 48px 24px; text-align: center; color: var(--navy); margin-bottom: 32px; box-shadow: 0 4px 18px rgba(38, 48, 74, .05); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ranking-header h2 { color: var(--navy); font-size: 30px; margin: 0; }
.ranking-header p { color: var(--mut); font-size: 15px; font-weight: 600; margin: 0; }
.ranking-filter-wrapper { display: flex; justify-content: center; width: 100%; margin-top: 12px; }
.ranking-filter-wrapper select { appearance: none; -webkit-appearance: none; width: auto; min-width: 280px; background-color: var(--bg2); color: var(--navy); border: 1px solid var(--line); padding: 14px 44px 14px 24px; border-radius: 30px; font-weight: 600; font-size: 15px; cursor: pointer; outline: none; text-align: center; text-align-last: center; transition: all 0.2s ease; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2326304a%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 20px top 50%; background-size: 14px auto; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.ranking-filter-wrapper select:hover, .ranking-filter-wrapper select:focus { border-color: var(--g2); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }

.ranking-podium { display: flex; justify-content: center; align-items: flex-end; gap: 20px; margin-bottom: 48px; padding-top: 24px; }
.podium-card { background: var(--card); border-radius: 16px; padding: 24px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.06); width: 220px; position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid var(--line); }
.podium-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }
.podium-card.ouro { height: 260px; border-top: 6px solid #FFD700; z-index: 2; width: 240px; }
.podium-card.prata { height: 230px; border-top: 6px solid #C0C0C0; z-index: 1; }
.podium-card.bronze { height: 210px; border-top: 6px solid #CD7F32; z-index: 1; }
.podium-card .medal { font-size: 48px; margin-bottom: 12px; display: block; }
.podium-card .name { font-weight: 800; font-size: 18px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.podium-card .stats { font-size: 14px; color: var(--mut); font-weight: 600; }
.podium-card .score-badge { background: var(--bg2); color: var(--g3); font-weight: 800; font-size: 22px; padding: 6px 14px; border-radius: 20px; display: inline-block; margin-top: 12px; }

.ranking-list-container { background: var(--card); border-radius: 16px; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.ranking-list-header { display: grid; grid-template-columns: 70px 1fr 160px 100px; padding: 16px 24px; background: var(--bg2); font-size: 13px; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--line); }
.ranking-row { display: grid; grid-template-columns: 70px 1fr 160px 100px; padding: 16px 24px; align-items: center; border-bottom: 1px solid var(--line); transition: background 0.2s; font-size: 15px; }
.ranking-row:last-child { border-bottom: none; }
.ranking-row:hover { background: rgba(0,0,0,0.02); }
.ranking-row .pos { font-weight: 800; font-size: 18px; color: var(--mut); }
.ranking-row .name { font-weight: 700; color: var(--navy); padding-right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-row .pct { font-weight: 800; color: var(--ok); text-align: right; font-size: 16px; }
.ranking-row .sims { font-size: 13px; color: var(--mut); text-align: right; }
@media (max-width: 600px) {
  .ranking-list-header, .ranking-row { grid-template-columns: 40px 1fr 100px; }
  .ranking-list-header > div:nth-child(4), .ranking-row > div:nth-child(4) { display: none; }
}

.msg-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; min-height: 500px; }
.msg-sidebar { background: var(--bg2); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg-folder { padding: 14px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.msg-folder:hover, .msg-folder.active { background: var(--card); color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg-item { display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: 0.2s; background: var(--card); }
.msg-item:hover { border-color: var(--g2); }
.msg-item.unread { border-left: 4px solid var(--bad); background: var(--bg2); }
.msg-item-header { display: flex; justify-content: space-between; font-size: 13px; color: var(--mut); margin-bottom: 6px; }
.msg-item-subject { font-weight: 700; color: var(--navy); font-size: 16px; }
.msg-item-preview { font-size: 14px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; }

.msg-detail { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.msg-detail-header { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; }
.msg-detail-header h3 { margin: 0 0 12px 0; color: var(--navy); font-size: 24px; }
.msg-detail-meta { display: flex; gap: 24px; font-size: 14px; color: var(--mut); }
.msg-detail-body { font-size: 16px; line-height: 1.6; white-space: pre-wrap; margin-bottom: 32px; }
.msg-replies { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 24px; }
.msg-reply-item { background: var(--bg2); padding: 16px; border-radius: 8px; margin-bottom: 12px; font-size: 15px; }

.chat-thread { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px dashed var(--line); max-height: 400px; overflow-y: auto; padding-right: 12px; }
.chat-bubble-wrapper { display: flex; flex-direction: column; max-width: 80%; }
.chat-bubble-wrapper.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble-wrapper.mine { align-self: flex-end; align-items: flex-end; }
.chat-meta { font-size: 12px; color: var(--mut); margin-bottom: 6px; display: flex; gap: 10px; }
.chat-bubble { padding: 14px 18px; border-radius: 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-bubble-wrapper.theirs .chat-bubble { background: var(--bg2); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble-wrapper.mine .chat-bubble { background: var(--navy); color: var(--card); border-bottom-right-radius: 4px; }

.streak-badge { background: linear-gradient(135deg, #ff7e5f, #feb47b); color: #fff; font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 12px; margin-left: 8px; display: inline-flex; align-items: center; gap: 2px; box-shadow: 0 2px 6px rgba(255, 126, 95, 0.4); white-space: nowrap; }
.avatar-header { width: 40px; height: 40px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--g2); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.avatar-header img { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center !important; display: block; margin: 0; padding: 0; }
.avatar-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 14px; margin-bottom: 20px; max-height: 280px; overflow-y: auto; padding: 12px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--line); }
.avatar-galeria::-webkit-scrollbar { width: 6px; }
.avatar-galeria::-webkit-scrollbar-thumb { background-color: var(--line); border-radius: 10px; }
.avatar-opcao { width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all 0.2s; background: var(--card); overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.1); position: relative; padding: 0; }
.avatar-opcao img { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center !important; display: block; }
.avatar-opcao:hover { transform: scale(1.1); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.avatar-opcao.on { border-color: var(--g2); box-shadow: 0 0 0 3px rgba(196, 154, 94, 0.4); transform: scale(1.05); }

/* ================= DARK MODE ================= */
body.dark-mode {
  --navy: #e2e8f0; --navy2: #cbd5e0; --g1: #e2b98f; --g2: #d49a6a; --g3: #c27c47;
  --bg: #0b1120; --bg2: #1e293b; --card: #1e293b; --ink: #f7fafc; --mut: #94a3b8; --line: #334155;
  --ok: #48bb78; --okb: #22543d; --bad: #f56565; --badb: #742a2a;
}
body.dark-mode header { background: var(--bg2); box-shadow: 0 2px 14px rgba(0,0,0,0.5); }
body.dark-mode .nav-drop-menu { background: var(--bg2); border-color: var(--line); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55); }
body.dark-mode .nav-drop-item:hover,
body.dark-mode .nav-dropdown.open .nav-drop-btn:not(.on) { background: rgba(255, 255, 255, 0.06); }
body.dark-mode .nav-drop-item.on { background: var(--navy); color: #0b1120; }
body.dark-mode input, body.dark-mode select, body.dark-mode textarea { background: var(--bg2); color: var(--ink); border-color: var(--line); color-scheme: dark; }
body.dark-mode input:focus, body.dark-mode select:focus { border-color: var(--g2); }
.btn-theme { background: transparent; border: 1.5px solid var(--line); color: var(--navy); border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 8px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-theme:hover { background: var(--bg2); border-color: var(--g2); box-shadow: 0 0 10px rgba(196, 154, 94, 0.2); }
body.dark-mode .btn-theme { color: var(--ink); }
body.dark-mode .alt { background: var(--bg); border-color: var(--line); color: var(--ink); }
body.dark-mode .alt .l { background: var(--line); color: var(--ink); }
body.dark-mode .alt.sel { background: #2b6cb0; border-color: #3182ce; color: #fff; }
body.dark-mode .alt.sel .l { background: #1e3a8a; color: #fff; }
body.dark-mode .banner-junte-se { background: var(--card); }
body.dark-mode .sala-trilha { background: var(--bg); }
body.dark-mode .topic-card, body.dark-mode .aula-item { background: var(--card); border-color: var(--line); }
body.dark-mode .resume-box { background: var(--card); border-color: var(--line); }
body.dark-mode .filter-chips-box { background: var(--bg); border-color: var(--line); }
body.dark-mode .filter-chips-box .chip { background: var(--card); border-color: var(--line); color: var(--ink); }
body.dark-mode .sel-chip { background: var(--g2) !important; color: #0b1120 !important; }
body.dark-mode .search-filter-input { background: var(--bg); color: var(--ink); border-color: var(--line); }
body.dark-mode .qitem { background: var(--bg); border-color: var(--line); }
body.dark-mode .ax-modal .ax-box { background: var(--card); color: var(--ink); }
body.dark-mode .card-small { background: var(--bg); border-color: var(--line); }
body.dark-mode .note { background: rgba(212, 154, 106, 0.15); color: var(--g1); border-left-color: var(--g2); }
body.dark-mode .hero { background: linear-gradient(135deg, #1e293b, #0b1120); }
body.dark-mode .stat b { color: var(--ink); }
body.dark-mode .btn.g { color: #0b1120; }
body.dark-mode .mapa button { background: var(--bg2); border-color: var(--line); color: var(--ink); }
body.dark-mode .mapa button.r { background: #2b6cb0; color: #fff; border-color: #3182ce; }
body.dark-mode .mapa button.ok { background: var(--ok); color: #fff; }
body.dark-mode .mapa button.bd { background: var(--bad); color: #fff; }
body.dark-mode th { color: var(--ink); border-bottom: 2px solid var(--line); }
body.dark-mode td { border-bottom: 1px solid var(--line); }
body.dark-mode .alt-fixacao { background: var(--bg); border-color: var(--line); color: var(--ink); }
body.dark-mode .alt-fixacao .l { color: var(--g1); }
body.dark-mode .podium-card { background: var(--card); border-color: var(--line); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
body.dark-mode .podium-card .name { color: var(--ink); }
body.dark-mode .podium-card .score-badge { background: var(--bg); color: var(--g1); }
body.dark-mode .ranking-row { border-bottom-color: var(--line); }
body.dark-mode .ranking-row:hover { background: rgba(255,255,255,0.03); }
body.dark-mode .ranking-row .name { color: var(--ink); }
body.dark-mode .ranking-list-header { background: var(--bg); border-bottom-color: var(--line); }
body.dark-mode .ranking-filter-wrapper select { background-color: var(--bg2); color: var(--ink); border-color: var(--line); }
body.dark-mode .ptop, body.dark-mode .caderno-top { background: #26304a; }
body.dark-mode .ptop .t, body.dark-mode .ptop .cont, body.dark-mode .caderno-top .t, body.dark-mode .caderno-top .cont { color: #fff; }
body.dark-mode .ptop .timer, body.dark-mode .caderno-top .cont { color: var(--g1); }
body.dark-mode .ring-inner { background: #0b1120; }
body.dark-mode .ring-pct { color: #fff; }
body.dark-mode .msg-folder:hover, body.dark-mode .msg-folder.active { background: var(--line); color: var(--ink); }
body.dark-mode .msg-item.unread { background: rgba(30, 41, 59, 0.5); }
body.dark-mode .msg-reply-item { background: var(--bg); }
body.dark-mode .chat-bubble-wrapper.mine .chat-bubble { background: var(--g2); color: #0b1120; }
body.dark-mode .banco-tabs .btab { background: var(--bg2); color: var(--ink); border-color: var(--line); }
body.dark-mode .banco-tabs .btab.on { background: var(--g2); color: #0b1120; border-color: var(--g2); }
body.dark-mode .ax-editor-wrap { background: var(--bg2); border-color: var(--line); }
body.dark-mode .ax-toolbar { background: var(--bg); border-bottom-color: var(--line); }
body.dark-mode .ax-toolbar button, body.dark-mode .ax-toolbar label { background: var(--bg2); color: var(--ink); border-color: var(--line); }
body.dark-mode .ax-editor { background: var(--bg); color: var(--ink); }
body.dark-mode #bNova { color: #0b1120 !important; }
body.dark-mode .caderno-card { background: var(--card); border-color: var(--line); }
body.dark-mode .caderno-card h3 { color: var(--ink); }
body.dark-mode #chFrentesHist .chip.on { background: var(--g2); color: #0b1120; }

/* ================= IMPRESSÃO / PDF ================= */
#print-section { display: none; }
@media print {
  @page { margin: 15mm; size: A4; }
  body > *:not(#print-section) { display: none !important; }
  #print-section { display: block !important; width: 100%; background: #fff !important; color: #000 !important; font-family: Arial, sans-serif; font-size: 12pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; position: relative; }
  #print-section * { font-weight: normal !important; color: #000 !important; background-color: transparent !important; }
  #print-section b, #print-section strong, #print-section h1, #print-section h2, #print-section h3, #print-section .pdf-q-head { font-weight: 700 !important; }
  /* marca d'água vertical em TODAS as páginas (position:fixed repete no print) */
  #print-section .marca-dagua { position: fixed; inset: 0; display: flex !important; align-items: center; justify-content: center; z-index: 0; pointer-events: none; }
  #print-section .marca-dagua img { max-height: 82vh; max-width: 60vw; opacity: 0.07; }
  #print-section > *:not(.marca-dagua) { position: relative; z-index: 1; }
  .pdf-q { page-break-inside: avoid; margin-bottom: 20px; }
  .pdf-q-head { background: #f4f2ed !important; color: #26304a !important; border-left: 4px solid #c49a5e !important; padding: 5px; margin-bottom: 8px; }
  .pdf-q-res { background: #f8f9fa !important; border: 1px solid #e2e8f0 !important; padding: 10px; border-radius: 4px; }
  .pdf-header { display: flex !important; justify-content: space-between; align-items: center; border-bottom: 2px solid #c49a5e; padding-bottom: 10px; margin-bottom: 20px; }
  .pdf-header .pdf-logo { height: 54px; width: auto; display: block; }
  .pdf-header h1 { font-size: 18px; color: #26304a !important; margin: 0; }
  .pdf-header p { font-size: 12px; color: #666 !important; margin: 5px 0 0 0; }
  mjx-container { line-height: 1 !important; font-weight: normal !important; color: #000 !important; display: inline-block !important; vertical-align: middle !important; }
  mjx-container * { font-weight: normal !important; }
  mjx-container svg, mjx-container svg * { font-family: 'Times New Roman', Times, serif !important; font-weight: 400 !important; -webkit-text-stroke: 0.01px transparent !important; text-shadow: none !important; stroke-width: 0 !important; }
}

#msgListaUsuarios { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); margin-bottom: 18px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
#msgListaUsuarios::-webkit-scrollbar { width: 6px; }
#msgListaUsuarios::-webkit-scrollbar-thumb { background-color: var(--line); border-radius: 10px; }

.mapcell { aspect-ratio: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--navy); transition: transform 0.15s, box-shadow 0.15s; }
.mapcell:hover { transform: scale(1.15); box-shadow: 0 4px 8px rgba(0,0,0,0.15); z-index: 10; }
.mapcell.r { background: #26304a; color: #fff; border-color: #26304a; }
.mapcell.cur { outline: 3px solid var(--g2); outline-offset: 2px; }
.mapcell.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.mapcell.bd { background: var(--bad); color: #fff; border-color: var(--bad); }
.mapcell.blank { background: #cbd5e1; color: #64748b; border-color: #cbd5e1; }
.mapcell.anulada { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
body.dark-mode .mapcell { background: var(--bg2); border-color: var(--line); color: var(--ink); }
body.dark-mode .mapcell.r { background: #2b6cb0; color: #fff; border-color: #3182ce; }

#btnScrollTop:hover { background: var(--bg2) !important; filter: brightness(0.9); }

.card-curso { background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.card-curso:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); }
.curso-capa { width: 100%; height: 180px; object-fit: cover; border-bottom: 1px solid var(--line); }
.card-curso-info h3 { color: var(--navy); font-size: 18px; margin: 0 0 8px 0; }
.card-curso-info p { color: var(--mut); font-size: 14px; margin: 0 0 16px 0; }

.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.btn-pair > .btn { width: 100%; height: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; }

.banco-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.banco-tabs .btab { border: 1.5px solid var(--line); background: var(--card); color: var(--navy); font-weight: 700; padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 15px; transition: 0.2s; }
.banco-tabs .btab:hover { border-color: var(--g2); }
.banco-tabs .btab.on { background: var(--navy); color: var(--card); border-color: var(--navy); }
#bNova { background: linear-gradient(120deg, var(--g2), var(--g1), var(--g2)) !important; color: var(--navy) !important; border: 0 !important; }
#bNova:hover { filter: brightness(1.08); }

.ax-editor-wrap { border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; transition: border-color .2s, box-shadow .2s; margin-bottom: 12px; }
.ax-editor-wrap:focus-within { border-color: var(--g2); box-shadow: 0 0 0 3px rgba(196,154,94,.2); }
.ax-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bg2); border-bottom: 1px solid var(--line); padding: 8px 10px; }
.ax-toolbar button, .ax-toolbar label { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-weight: 700; color: var(--navy); font-size: 13px; line-height: 1.2; margin: 0; font-family: inherit; }
.ax-toolbar button:hover, .ax-toolbar label:hover { border-color: var(--g2); background: var(--bg2); }
.ax-toolbar .ax-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.ax-fonte-valor { font-size: 12px; color: var(--mut); min-width: 42px; text-align: center; font-weight: 700; }
.ax-editor { min-height: 140px; max-height: 460px; overflow-y: auto; padding: 12px 14px; outline: none; font-size: 15px; line-height: 1.6; background: var(--card); color: var(--ink); }
.ax-editor p, .ax-editor div { margin: 0 0 8px; }
.ax-editor img { display: block; max-width: 100%; height: auto; margin: 10px auto; border-radius: 8px; }

.enun img, .qbody img, .alt img, .qopts img { display: block; max-width: 100%; height: auto; margin: 12px auto; border-radius: 8px; }
.fig img { display: block; margin: 0 auto; }
#print-section img { display: block; max-width: 100%; height: auto; margin: 8px auto; }
#print-section .marca-dagua img { margin: 0; }

.enun, .qbody, .qcard-fixacao .enun, .alt, .qopts { font-size: var(--q-fonte, 100%) !important; }

.modal .card img, .ax-modal .ax-box img { max-width: 100%; height: auto; }
#ax-conc-desc-html img { display: block; max-width: 100%; height: auto; margin: 10px auto; border-radius: 8px; }

/* Aba pública de Cursos (vendas) */
.curso-pub-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s; min-height: 300px; }
.curso-pub-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(0,0,0,.12); border-color: var(--g2); }
.curso-pub-thumb { width: 100%; height: 170px; background-size: cover; background-position: center; background-color: var(--bg2); flex: none; }
.curso-pub-body { padding: 18px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.curso-pub-body h3 { margin: 0; font-size: 18px; color: var(--navy); }
.curso-pub-body .desc { font-size: 13.5px; color: var(--mut); flex: 1; }
.curso-pub-preco { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.preco-original { text-decoration: line-through; color: var(--mut); font-size: 14px; }
.preco-atual { font-size: 22px; font-weight: 800; color: var(--ok); }
.preco-normal { font-size: 20px; font-weight: 800; color: var(--navy); }
.cupom-badge { background: var(--okb); color: var(--ok); font-size: 12px; font-weight: 800; border-radius: 99px; padding: 3px 10px; }
.estrelas { color: #f5b301; font-size: 14px; letter-spacing: 2px; }
.estrelas .off { color: var(--line); }

.depoimentos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 24px; }
.depoimento-card { aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; position: relative; border: 1px solid var(--line); background: var(--card); box-shadow: 0 6px 18px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.depoimento-card img.depo-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.depoimento-card .depo-overlay { position: absolute; inset: auto 0 0 0; padding: 18px; background: linear-gradient(transparent, rgba(11,17,32,.92)); color: #fff; }
.depoimento-card .depo-overlay b { display: block; font-size: 15px; margin-bottom: 4px; }
.depoimento-card .depo-overlay span { font-size: 12.5px; line-height: 1.45; display: block; }

.desempenho-filtros { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.desempenho-filtros select { width: auto; min-width: 220px; }
table.desempenho th, table.desempenho td { font-size: 13.5px; }
.pct-pill { font-weight: 800; border-radius: 99px; padding: 2px 10px; font-size: 12.5px; }
.pct-pill.ok { background: var(--okb); color: var(--ok); }
.pct-pill.bad { background: var(--badb); color: var(--bad); }
.vis-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--navy); }

/* Composição por disciplina no simulado aleatório */
.comp-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg2); flex-wrap: wrap; }
.comp-row .nome { font-weight: 700; color: var(--navy); flex: 1; min-width: 140px; }
.comp-row input[type=number] { width: 90px; }
body.dark-mode .comp-row { background: var(--bg); }
body.dark-mode .comp-row .nome { color: var(--ink); }
body.dark-mode .curso-pub-card, body.dark-mode .depoimento-card { background: var(--card); border-color: var(--line); }
body.dark-mode .curso-pub-body h3, body.dark-mode .preco-normal { color: var(--ink); }
body.dark-mode .vis-row { color: var(--ink); }