/* ============================================================
   DESIGN SYSTEM — TEMAS (CLARO / PRETO) & 6 PALETAS UNIFICADAS
   ============================================================ */
:root {
    --bg-canvas: #F5F6F2;
    --surface: #FFFFFF;
    --surface-subtle: #F9FAF7;
    --surface-hover: #EFF3F5;
    --ink: #171B20;
    --ink-muted: #55606B;
    --border: #DCE1E5;
    --border-strong: #BFC7CF;

    --accent: #0F4C5C;
    --accent-hover: #0B3A46;
    --accent-secondary: #17667A;
    --accent-soft: #E6F0F3;
    --accent-border: #B4D0D8;
    --on-accent: #FFFFFF;

    --correct: #1B7A43;
    --correct-bg: #EBF7F0;
    --correct-ink: #114D2A;
    --correct-border: #B6DFC6;

    --wrong: #C03221;
    --wrong-bg: #FDEEEC;
    --wrong-ink: #6B170E;
    --wrong-border: #F2BCB6;

    --warn: #B85D00;
    --warn-bg: #FFF5E8;
    --warn-border: #F0D2B2;

    --glass-bg: rgba(245, 246, 242, 0.85);
    --glass-card: rgba(255, 255, 255, 0.94);
    --shadow-sm: 0 1px 3px rgba(23, 27, 32, 0.06);
    --shadow-md: 0 8px 24px rgba(23, 27, 32, 0.10);
    --shadow-lg: 0 18px 42px rgba(23, 27, 32, 0.18);

    --radius: 10px;
    --radius-sm: 7px;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    color-scheme: light;
}

/* PALETAS NO MODO CLARO */
:root[data-paleta="azul"] {
    --accent: #1D4ED8; --accent-hover: #1E40AF; --accent-secondary: #2563EB;
    --accent-soft: #E8F0FE; --accent-border: #B6CEFC;
}
:root[data-paleta="verde"] {
    --accent: #157347; --accent-hover: #0F5132; --accent-secondary: #198754;
    --accent-soft: #E8F5EE; --accent-border: #B2DEC6;
}
:root[data-paleta="rosa"] {
    --accent: #BE185D; --accent-hover: #9D174D; --accent-secondary: #DB2777;
    --accent-soft: #FCE7F3; --accent-border: #F5B8D8;
}
:root[data-paleta="roxo"] {
    --accent: #6D28D9; --accent-hover: #5B21B6; --accent-secondary: #7C3AED;
    --accent-soft: #F3E8FF; --accent-border: #D2B8FC;
}
:root[data-paleta="ambar"] {
    --accent: #B45309; --accent-hover: #92400E; --accent-secondary: #D97706;
    --accent-soft: #FEF3C7; --accent-border: #F5D582;
}

/* TEMA PRETO (MODO ESCURO) */
:root[data-tema="escuro"] {
    --bg-canvas: #0C0E12;
    --surface: #14181E;
    --surface-subtle: #1B2028;
    --surface-hover: #232934;
    --ink: #EEF2F6;
    --ink-muted: #98A3B0;
    --border: #272E38;
    --border-strong: #394352;

    --accent: #38A3B8;
    --accent-hover: #52B8CC;
    --accent-secondary: #2B899C;
    --accent-soft: rgba(56, 163, 184, 0.15);
    --accent-border: rgba(56, 163, 184, 0.42);
    --on-accent: #090C10;

    --correct: #34D399;
    --correct-bg: rgba(52, 211, 153, 0.13);
    --correct-ink: #A7F3D0;
    --correct-border: rgba(52, 211, 153, 0.35);

    --wrong: #F87171;
    --wrong-bg: rgba(248, 113, 113, 0.14);
    --wrong-ink: #FECACA;
    --wrong-border: rgba(248, 113, 113, 0.35);

    --warn: #FBBF24;
    --warn-bg: rgba(251, 191, 36, 0.12);
    --warn-border: rgba(251, 191, 36, 0.35);

    --glass-bg: rgba(12, 14, 18, 0.85);
    --glass-card: rgba(20, 24, 30, 0.94);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.65);
    color-scheme: dark;
}

/* PALETAS NO TEMA PRETO */
:root[data-tema="escuro"][data-paleta="azul"] {
    --accent: #60A5FA; --accent-hover: #93C5FD; --accent-secondary: #3B82F6;
    --accent-soft: rgba(96, 165, 250, 0.15); --accent-border: rgba(96, 165, 250, 0.42);
}
:root[data-tema="escuro"][data-paleta="verde"] {
    --accent: #34D399; --accent-hover: #6EE7B7; --accent-secondary: #10B981;
    --accent-soft: rgba(52, 211, 153, 0.15); --accent-border: rgba(52, 211, 153, 0.42);
}
:root[data-tema="escuro"][data-paleta="rosa"] {
    --accent: #F472B6; --accent-hover: #F9A8D4; --accent-secondary: #EC4899;
    --accent-soft: rgba(244, 114, 182, 0.15); --accent-border: rgba(244, 114, 182, 0.42);
}
:root[data-tema="escuro"][data-paleta="roxo"] {
    --accent: #A78BFA; --accent-hover: #C4B5FD; --accent-secondary: #8B5CF6;
    --accent-soft: rgba(167, 139, 250, 0.15); --accent-border: rgba(167, 139, 250, 0.42);
}
:root[data-tema="escuro"][data-paleta="ambar"] {
    --accent: #FBBF24; --accent-hover: #FCD34D; --accent-secondary: #F59E0B;
    --accent-soft: rgba(251, 191, 36, 0.15); --accent-border: rgba(251, 191, 36, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--ink);
    margin: 0;
    padding: 0;
    background: var(--bg-canvas);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============================================================
   TOPBAR GLASSMORPHIC
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.topbar-inner {
    max-width: 880px;
    margin: 0 auto;
    padding: 12px 18px 9px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.topbar-info { min-width: 0; flex: 1; }

.prova-titulo-topo {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.placar {
    font-size: 0.84rem;
    color: var(--ink-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    position: relative;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.icon-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.icon-btn:active { transform: scale(0.96); }

.menu-btn {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}
.menu-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.progresso-wrap {
    width: 100%;
    height: 4px;
    background: var(--border);
}

.progresso-barra {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}
.progresso-barra.completo { background: var(--correct); }

.materias-stats-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 18px;
}

.materias-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 7px 0 9px 0;
    font-size: 0.77rem;
}
.materias-stats:empty { padding: 0; }

.stat-pill {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   TOOLTIPS (SOMENTE DESKTOP COM MOUSE — SEGURO NO CELULAR)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
    [data-tooltip] { position: relative; }
    [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 7px);
        left: 50%;
        transform: translateX(-50%) translateY(4px);
        background: var(--ink);
        color: var(--bg-canvas);
        font-size: 0.74rem;
        font-weight: 600;
        line-height: 1.3;
        padding: 5px 9px;
        border-radius: 6px;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.16s ease, transform 0.16s ease;
        z-index: 400;
        box-shadow: var(--shadow-sm);
    }
    .topbar [data-tooltip]::after {
        bottom: auto;
        top: calc(100% + 7px);
        transform: translateX(-50%) translateY(-4px);
    }
    .topbar-actions .icon-btn:last-child::after {
        left: auto;
        right: 0;
        transform: translateY(-4px);
    }
    [data-tooltip]:hover::after,
    [data-tooltip]:focus-visible::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    .topbar-actions .icon-btn:last-child:hover::after,
    .topbar-actions .icon-btn:last-child:focus-visible::after {
        transform: translateY(0);
    }
}

/* ============================================================
   DRAWER LATERAL & SELETOR DE PALETA
   ============================================================ */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(3px);
    z-index: 200;
}
.drawer-overlay.aberto { display: block; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 210;
    transform: translateX(100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}
.drawer.aberto { transform: translateX(0); }

.drawer-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink);
    font-size: 1.02rem;
}

.drawer-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.drawer-section {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.drawer-section:last-child { border-bottom: none; }

.drawer-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.filtro-duplo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.drawer select, .select-full, .modal-body input, .modal-body select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
}

.drawer-grid-btns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.paleta-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.paleta-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid var(--surface);
    outline: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.14s ease, outline-color 0.14s ease;
}
.paleta-btn:hover { transform: scale(1.1); }
.paleta-btn.ativo {
    outline-color: var(--ink);
    transform: scale(1.08);
}

/* ============================================================
   BOTÕES UNIFICADOS NA PALETA ESCOLHIDA
   ============================================================ */
.btn {
    padding: 9px 14px;
    font-family: inherit;
    font-size: 13.5px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    background: var(--accent);
    color: var(--on-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

.btn-block { width: 100%; margin-bottom: 8px; }

/* Ação Primária / Confirmar → segue 100% a paleta */
.btn-ok {
    background: var(--accent);
    color: var(--on-accent);
}
.btn-ok:hover { background: var(--accent-hover); }

/* Ação Secundária / Revisão / Reforço → variação tonal da paleta */
.btn-revisao, .btn-warn {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-border);
}
.btn-revisao:hover, .btn-warn:hover {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}
.btn-revisao.ativo, .btn-warn.ativo {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 0 3px var(--accent-border);
}

.btn-help {
    background: var(--accent-secondary);
    color: var(--on-accent);
}
.btn-help:hover { background: var(--accent-hover); }
.btn-help.locked {
    background: var(--surface-subtle);
    color: var(--ink-muted);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}
.btn-help.ativo { box-shadow: 0 0 0 3px var(--accent-border); }

/* Botões Neutros & Fantasmas */
.btn-sec, .btn-ghost {
    background: var(--surface-subtle);
    color: var(--ink);
    border-color: var(--border-strong);
}
.btn-sec:hover, .btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-border);
}

/* Botão Destrutivo (discreto até passar o mouse) */
.btn-del {
    background: transparent;
    color: var(--wrong);
    border-color: var(--wrong-border);
}
.btn-del:hover {
    background: var(--wrong);
    color: var(--on-accent);
    border-color: var(--wrong);
}

.btn-mini {
    background: var(--bg-canvas);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn-mini:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.file-label { cursor: pointer; }

.btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    line-height: 1;
}
:root[data-tema="escuro"] .btn:not(.btn-ghost):not(.btn-sec):not(.btn-mini):not(.btn-revisao):not(.btn-warn):not(.btn-del):not(.locked) .btn-badge {
    background: rgba(0, 0, 0, 0.22);
}
.btn-ghost .btn-badge,
.btn-mini .btn-badge,
.btn-revisao:not(.ativo) .btn-badge,
.btn-warn:not(.ativo) .btn-badge,
.btn-filtro-erro:not(.ativo) .btn-badge,
.tema-tab-btn:not(.ativo) .btn-badge,
.btn-help.locked .btn-badge {
    background: var(--accent-soft);
    color: var(--accent);
}
.tema-tab-btn.ativo .btn-badge {
    background: var(--accent);
    color: var(--on-accent);
}

.tema-subtitulo {
    font-size: 0.84rem;
    color: var(--ink-muted);
    font-weight: 500;
    margin-top: 3px;
    line-height: 1.4;
}

/* ============================================================
   ÁREA CENTRAL & COCKPIT FUNCIONAL (BENTO GRID)
   ============================================================ */
.main-container {
    max-width: 880px;
    margin: 22px auto;
    padding: 0 18px 60px 18px;
}

.cockpit-panel {
    margin-bottom: 24px;
    animation: fadeSlideIn 0.22s ease-out;
}

.cockpit-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 14px;
}

.bento-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.bento-card-destaque {
    background: linear-gradient(155deg, var(--surface) 0%, var(--accent-soft) 100%);
    border-color: var(--accent-border);
}

.bento-meta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}

.bento-titulo {
    margin: 2px 0 4px 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.28;
}

.bento-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

.bento-footer-span {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 14px 18px;
}

@media (max-width: 720px) {
    .cockpit-grid { grid-template-columns: 1fr; }
    .bento-footer-span { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ============================================================
   PAINÉIS, SUMÁRIO E EDITOR
   ============================================================ */
.panel-topo, .sumario-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.panel-topo h3, .sumario-topo h3 { margin: 0; color: var(--ink); font-size: 1.08rem; }

.btn-row, .flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.editor-panel {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}

.catalogo-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hint { font-size: 0.9rem; margin-top: 0; color: var(--ink-muted); }
.editor-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.editor-panel label { font-weight: 700; font-size: 0.85rem; display: block; margin-bottom: 3px; }
.editor-panel input, .editor-panel textarea, .editor-panel select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--surface);
    color: var(--ink);
}
.f1 { flex: 1; }
.f2 { flex: 2; }

.sumario {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.sumario-links { display: flex; flex-wrap: wrap; gap: 6px; }
.sumario-links a {
    padding: 5px 10px;
    background: var(--bg-canvas);
    color: var(--ink);
    border: 1px solid var(--border);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}
.sumario-links a.done-correct { background: var(--correct-bg); color: var(--correct); border-color: var(--correct); }
.sumario-links a.done-wrong { background: var(--wrong-bg); color: var(--wrong); border-color: var(--wrong); }

/* ============================================================
   QUESTÕES — MODO FOCO LIMPO (SÓLIDO & <= 74ch)
   ============================================================ */
.questao {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 26px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 100px;
}
.questao p {
    margin-top: 0;
    font-size: 1.03rem;
    line-height: 1.68;
    max-width: 74ch;
    color: var(--ink);
}
.prova-tag { font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 8px; font-weight: 700; }

.alternativas { list-style: none; padding-left: 0; margin-top: 18px; max-width: 74ch; }
.alternativas li { margin-bottom: 9px; }
.alternativas label {
    display: block;
    padding: 12px 15px;
    background: var(--surface-subtle);
    border-radius: 8px;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.alternativas label:hover {
    background: var(--surface-hover);
    border-color: var(--accent-border);
    transform: translateX(2px);
}
.alternativas input[type="radio"] { display: none; }
.alternativas input[type="radio"]:checked + span { font-weight: 700; }
.alternativas input[type="radio"]:checked + span::before {
    content: "✓ ";
    color: var(--accent);
    display: inline-block;
    animation: popCheck 0.2s ease;
}
.alternativas label.selected { background: var(--accent-soft); border-color: var(--accent); }
.alternativas label.correct { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); }
.alternativas label.wrong { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); }

.btn-individual {
    display: block;
    width: 100%;
    max-width: 74ch;
    padding: 12px;
    margin-top: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--accent);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn-individual:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-individual.checked { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); cursor: default; }
.btn-individual.checked-wrong { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); cursor: default; }

.explicacao {
    display: none;
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--surface-subtle);
    border: 1px solid var(--accent-border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: 0.94rem;
    max-width: 74ch;
}
.diag-erro {
    background: var(--wrong-bg);
    border-left: 4px solid var(--wrong);
    padding: 10px 13px;
    border-radius: 6px;
    margin-bottom: 10px;
    color: var(--wrong-ink);
}
.diag-acerto {
    background: var(--correct-bg);
    border-left: 4px solid var(--correct);
    padding: 10px 13px;
    border-radius: 6px;
    margin-bottom: 10px;
    color: var(--correct-ink);
}
.materia {
    display: inline-block;
    background: var(--accent);
    color: var(--on-accent);
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* ============================================================
   TIPO DE ERRO & FILTRO CADERNO DE ERROS
   ============================================================ */
.tipo-erro-box {
    margin: 10px 0 12px 0;
    padding: 11px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.tipo-erro-titulo {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 8px;
}
.tipo-erro-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-tipo-erro {
    background: var(--bg-canvas);
    color: var(--ink);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 5px 11px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s ease;
}
.btn-tipo-erro:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn-tipo-erro.ativo { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.erros-filtro-bar {
    background: var(--surface);
    border: 1px solid var(--accent-border);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.btn-filtro-erro {
    background: var(--bg-canvas);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-filtro-erro.ativo { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ============================================================
   PLANO DE REFORÇO (ACORDEÃO POR MATÉRIA)
   ============================================================ */
.reforco-panel { margin-bottom: 25px; }
.reforco-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--accent);
}
.reforco-header.parabens { border-left-color: var(--correct); background: var(--correct-bg); }
.reforco-header h2 { margin: 0 0 6px 0; color: var(--accent); font-size: 1.24rem; }
.reforco-header.parabens h2 { color: var(--correct); }
.reforco-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.acordeao-materia {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease;
}
.acordeao-materia:hover { border-color: var(--accent-border); }

.acordeao-topo {
    width: 100%;
    background: var(--surface);
    border: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.14s ease;
}
.acordeao-topo:hover { background: var(--surface-subtle); }
.acordeao-titulo-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acordeao-titulo { font-size: 1.06rem; font-weight: 700; color: var(--ink); }
.acordeao-sub { font-size: 0.83rem; color: var(--ink-muted); font-weight: 500; }
.acordeao-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.acordeao-seta { font-size: 0.82rem; color: var(--accent); font-weight: 700; }

.acordeao-corpo {
    padding: 4px 18px 18px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-canvas);
}

.subdivisao-bloco {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-top: 14px;
}
.subdivisao-bloco.com-erro { border-left: 4px solid var(--wrong); }
.subdivisao-bloco.sem-erro { border-left: 4px solid var(--correct); }

.subdivisao-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}
.subdivisao-topo h4 { margin: 0; color: var(--ink); font-size: 1.02rem; }

.prioridade-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.prioridade-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; }

.btn-guia-tri {
    background: var(--bg-canvas);
    color: var(--ink);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-guia-tri:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.acertadas-toggle-btn {
    margin-top: 14px;
    background: var(--correct-bg);
    color: var(--correct);
    border: 1px solid var(--correct-border);
    border-radius: 7px;
    padding: 9px 13px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.reforco-card-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.reforco-card-topo h3 { margin: 0; color: var(--ink); }
.reforco-badge-erro { background: var(--wrong-bg); color: var(--wrong); border: 1px solid var(--wrong-border); padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.reforco-badge-ok { background: var(--correct-bg); color: var(--correct); border: 1px solid var(--correct-border); padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.reforco-secao { margin-bottom: 14px; }
.reforco-secao h4 { margin: 0 0 6px 0; color: var(--accent); font-size: 0.96rem; }
.reforco-formulas {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.formula-item { padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 0.93rem; }
.formula-item:last-child { border-bottom: none; }
.formula-eq {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.reforco-aplicar {
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.94rem;
    margin-bottom: 14px;
}
.reforco-erros-lista { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.88rem; }
.reforco-erro-chip {
    background: var(--wrong-bg);
    color: var(--wrong);
    border: 1px solid var(--wrong-border);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.83rem;
}
.reforco-erro-chip:hover { background: var(--wrong); color: var(--on-accent); }

/* ============================================================
   CENTRAL DE REVISÃO, ABAS & MAPA MENTAL
   ============================================================ */
.revisao-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    border-left: 5px solid var(--accent);
    box-shadow: var(--shadow-sm);
}
.revisao-header h2 { margin: 0 0 6px 0; color: var(--accent); font-size: 1.24rem; }
.revisao-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.revisao-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.funil-origens {
    background: var(--wrong-bg);
    border: 1px solid var(--wrong-border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.funil-origens-titulo { font-size: 0.85rem; font-weight: 700; color: var(--wrong); margin-bottom: 8px; }
.funil-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--wrong-border);
    font-size: 0.88rem;
}
.funil-item:last-child { border-bottom: none; }
.funil-motivo-tag {
    display: inline-block;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: 6px;
}
.questao-fixa-box {
    background: var(--surface-subtle);
    border: 1.5px solid var(--accent-border);
    border-radius: 8px;
    padding: 18px;
    margin-top: 12px;
}
.questao-fixa-tag {
    display: inline-block;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.tema-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin: 14px 0;
}
.tema-tab-btn {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--ink-muted);
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.tema-tab-btn:hover { background: var(--surface-subtle); color: var(--ink); }
.tema-tab-btn.ativo { background: var(--accent-soft); color: var(--accent); }

.guia-dica-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 12px;
}
.guia-dica-box.conteudo,
.guia-dica-box.leitura {
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    color: var(--ink);
}

.mapa-mental-wrap {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.mapa-arvore { display: flex; flex-direction: column; gap: 12px; }
.mapa-no-central {
    display: inline-block;
    background: var(--accent);
    color: var(--on-accent);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.94rem;
    box-shadow: var(--shadow-sm);
}
.mapa-ramos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mapa-ramo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent) !important;
    border-radius: 6px;
    padding: 12px;
}
.mapa-ramo-tit { font-size: 0.84rem; font-weight: 800; margin-bottom: 8px; color: var(--accent) !important; }
.mapa-folhas { display: flex; flex-direction: column; gap: 6px; }
.mapa-folha {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: filter 0.2s ease, opacity 0.2s ease;
}
.mapa-folha.recall-blur { filter: blur(5px); opacity: 0.6; user-select: none; }

/* ============================================================
   MODAIS GLASSMORPHIC & TOASTS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-box-sm { max-width: 460px; }

.modal-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; color: var(--ink); }

.modal-body {
    padding: 18px;
    overflow-y: auto;
    font-size: 0.93rem;
}
.modal-body .campo-grupo { margin-bottom: 12px; }
.modal-body .campo-grupo label { display: block; font-size: 0.83rem; font-weight: 700; margin-bottom: 4px; color: var(--ink-muted); }

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tri-nivel-card { border-radius: 8px; padding: 14px; margin-bottom: 12px; border-left: 5px solid #333; color: #171B20; }
.tri-nivel-card h4 { margin: 0 0 6px 0; font-size: 1rem; }
.tri-regra-box { background: var(--bg-canvas); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-top: 14px; font-size: 0.91rem; }

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(20, 24, 30, 0.94);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 11px 15px;
    border-radius: 9px;
    font-size: 0.87rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--accent);
    animation: toastIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.ok { border-left-color: #34D399; }
.toast.warn { border-left-color: #FBBF24; }
.toast.err { border-left-color: #F87171; }
.toast.saindo { opacity: 0; transform: translateY(8px); }

/* ============================================================
   RESPONSIVIDADE & MOBILE FIRST TOQUE
   ============================================================ */
@media (hover: none) {
    .alternativas label:hover { transform: none; background: var(--surface-subtle); border-color: var(--border); }
    .icon-btn:hover, .btn:hover { transform: none; }
}

@media (max-width: 640px) {
    .topbar-inner { padding: 10px 14px 8px 14px; }
    .icon-btn { width: 42px; height: 42px; font-size: 17px; }

    .materias-stats {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 0 8px 0;
    }
    .materias-stats::-webkit-scrollbar { display: none; }
    .stat-pill { flex-shrink: 0; }

    .modal-footer { flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-height: 42px; }

    .drawer select, .select-full, .modal-body input, .modal-body select,
    .editor-panel input, .editor-panel textarea, .editor-panel select {
        font-size: 16px;
        min-height: 42px;
    }

    .main-container { padding: 0 12px 64px 12px; margin-top: 14px; }
    .questao { padding: 18px 16px; scroll-margin-top: 118px; }
    .alternativas label { padding: 13px 14px; }
    .btn-individual { min-height: 44px; }
    .btn-tipo-erro, .btn-filtro-erro, .btn-mini { min-height: 36px; }

    .acordeao-topo { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
    .acordeao-meta { width: 100%; justify-content: space-between; }
    .mapa-ramos { grid-template-columns: 1fr; }

    .toast-container { right: 14px; left: 14px; bottom: 14px; max-width: none; }
}

/* ============================================================
   ANIMAÇÕES & IMPRESSÃO
   ============================================================ */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popCheck {
    0% { transform: scale(0.7); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .topbar, .drawer, .drawer-overlay, .cockpit-panel, .editor-panel, .btn-individual, .sumario,
    .reforco-filtros, .reforco-erros-lista, .tipo-erro-box, .erros-filtro-bar, .btn-guia-tri,
    .modal-overlay, .revisao-filtros, .toast-container { display: none !important; }
    .main-container { max-width: 100%; margin: 0; padding: 0; }
    .questao, .revisao-card, .acordeao-materia { border: 1px solid #000; break-inside: avoid; box-shadow: none; }
    .explicacao, .acordeao-corpo { display: block !important; }
}
.tri-nivel-card { border-radius: 8px; padding: 14px; margin-bottom: 12px; border-left: 5px solid #333; color: #171B20; }
.tri-nivel-card h4 { margin: 0 0 6px 0; font-size: 1rem; }
.tri-regra-box { background: var(--bg-canvas); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-top: 14px; font-size: 0.91rem; }

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(20, 24, 30, 0.94);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 11px 15px;
    border-radius: 9px;
    font-size: 0.87rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--accent);
    animation: toastIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.ok { border-left-color: #34D399; }
.toast.warn { border-left-color: #FBBF24; }
.toast.err { border-left-color: #F87171; }
.toast.saindo { opacity: 0; transform: translateY(8px); }

@media (hover: none) {
    .alternativas label:hover { transform: none; background: var(--surface-subtle); border-color: var(--border); }
    .icon-btn:hover, .btn:hover { transform: none; }
}

@media (max-width: 640px) {
    .topbar-inner { padding: 10px 14px 8px 14px; }
    .icon-btn { width: 42px; height: 42px; font-size: 17px; }

    .materias-stats {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 0 8px 0;
    }
    .materias-stats::-webkit-scrollbar { display: none; }
    .stat-pill { flex-shrink: 0; }

    .modal-footer { flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-height: 42px; }

    .drawer select, .select-full, .modal-body input, .modal-body select,
    .editor-panel input, .editor-panel textarea, .editor-panel select {
        font-size: 16px;
        min-height: 42px;
    }

    .main-container { padding: 0 12px 64px 12px; margin-top: 14px; }
    .questao { padding: 18px 16px; scroll-margin-top: 118px; }
    .alternativas label { padding: 13px 14px; }
    .btn-individual { min-height: 44px; }
    .btn-tipo-erro, .btn-filtro-erro, .btn-mini { min-height: 36px; }

    .acordeao-topo { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
    .acordeao-meta { width: 100%; justify-content: space-between; }
    .mapa-ramos { grid-template-columns: 1fr; }

    .toast-container { right: 14px; left: 14px; bottom: 14px; max-width: none; }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popCheck {
    0% { transform: scale(0.7); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   NITIDEZ TIPOGRÁFICA & DISTRIBUIÇÃO DE COR (FÓRMULAS/TEXTOS)
   ============================================================ */
.explicacao,
.reforco-secao,
.reforco-aplicar,
.mapa-folha-texto,
.mapa-folha-desc {
    color: var(--ink);
    font-size: 0.94rem;
    line-height: 1.62;
    font-weight: 450;
}

.mapa-folha-desc {
    font-size: 0.88rem;
    color: var(--ink-muted);
    margin-top: 5px;
}

.explicacao strong,
.reforco-aplicar strong,
.reforco-secao strong,
.mapa-folha strong {
    color: var(--accent);
    font-weight: 700;
}

.explicacao code,
.reforco-aplicar code,
.reforco-secao code,
.mapa-folha code {
    font-family: var(--font-mono);
    font-size: 0.87em;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--accent-border);
}

.formula-eq {
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    line-height: 1.75;
}

.formula-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.formula-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 0.86rem;
    line-height: 1.4;
}

.formula-chip-lbl {
    color: var(--accent);
    font-weight: 700;
}

.formula-chip-eq {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--ink);
}

.mapa-ramos {
    align-items: start;
}

.mapa-ramo-full {
    grid-column: 1 / -1;
}

/* No Active Recall, borra só o texto interno mantendo a borda do cartão nítida */
.mapa-folha.recall-blur {
    filter: none;
    opacity: 1;
}
.mapa-folha.recall-blur > * {
    filter: blur(5.5px);
    opacity: 0.45;
    transition: filter 0.2s ease, opacity 0.2s ease;
}
/* ============================================================
   NITIDEZ NATIVA CLEARTYPE (ESCALA 100% NO WINDOWS & MOBILE)
   ============================================================ */
:root {
    --font-sans: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
}

body {
    -webkit-font-smoothing: auto;
    text-rendering: auto;
}

.explicacao,
.reforco-secao,
.reforco-aplicar,
.mapa-folha-texto,
.mapa-folha-desc {
    font-weight: 400;
}

.alternativas label:hover,
.btn:hover,
.icon-btn:hover {
    transform: none;
}
/* ============================================================
   SEÇÕES MINIMIZÁVEIS DO MENU LATERAL
   ============================================================ */
.drawer-label-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 2px;
    border-radius: 5px;
    transition: color 0.14s ease;
}
.drawer-label-toggle:hover {
    color: var(--accent);
}
.drawer-label-toggle::after {
    content: '▾';
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-left: 8px;
}
.drawer-section.fechada {
    padding-bottom: 10px;
    margin-bottom: 12px;
}
.drawer-section.fechada .drawer-label-toggle {
    margin-bottom: 0;
}
.drawer-section.fechada .drawer-label-toggle::after {
    content: '▸';
}
.drawer-section.fechada .drawer-section-body {
    display: none;
}
/* ============================================================
   LAYOUT FLUIDO ADAPTATIVO (PREENCHIMENTO TOTAL & ZOOM/DPI)
   ============================================================ */
.topbar-inner,
.materias-stats-wrap,
.main-container {
    max-width: min(94vw, 70rem);
}

.questao p,
.alternativas,
.btn-individual,
.explicacao {
    max-width: none;
    width: 100%;
}

@media (max-width: 640px) {
    .topbar-inner,
    .materias-stats-wrap,
    .main-container {
        max-width: 100%;
    }
}