/**
 * Acessibilidade global do dash (carregado depois de home.css e páginas específicas).
 * - data-mp-font (sm | md | lg): escala root (rem) + --mp-font-scale para font-size em px (calc nos CSS patchados).
 * - data-mp-theme="dark": tema escuro para shell, home, notificações e configurações.
 */

html {
    --mp-font-scale: 1;
}

html[data-mp-font="sm"] {
    font-size: 93.75%;
    --mp-font-scale: 0.9375;
}

html[data-mp-font="md"] {
    font-size: 100%;
    --mp-font-scale: 1;
}

html[data-mp-font="lg"] {
    font-size: 112.5%;
    --mp-font-scale: 1.125;
}

/* -------------------------------------------------------------------------- */
/* Modais Bootstrap — blur no fundo com transição ao abrir/fechar             */
/* O Bootstrap usa opacity no .modal-backdrop; isso quebra backdrop-filter em */
/* Chrome/WebKit. Usamos fundo rgba + opacity:1 no nó.                        */
/* -------------------------------------------------------------------------- */

.modal-backdrop {
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
}

.modal-backdrop.fade {
    opacity: 1 !important;
    background-color: transparent !important;
    /* Mesma duração e curva no escuro e no blur — fade in/out mais suave */
    transition:
        background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        -webkit-backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.fade.show {
    background-color: rgba(0, 0, 0, 0.64) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
    .modal-backdrop.fade {
        transition: background-color 0.2s linear;
    }

    .modal-backdrop.fade.show {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* -------------------------------------------------------------------------- */
/* Tema escuro                                                                 */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] {
    /* Texto secundário e placeholders: tons mais claros para ≥4.5:1 em fundos slate */
    --mp-dark-muted: #cbd5e1;
    --mp-dark-placeholder: #94a3b8;
    /* Sidebar — ícones e fundos (idle / hover / activo) */
    --mp-sidebar-icon-idle: #94a3b8;
    --mp-sidebar-icon-accent: #facc15;
    --mp-sidebar-link-bg-hover: #334155;
    --mp-sidebar-link-bg-active: rgba(250, 204, 21, 0.14);
}

/* color-scheme só no shell do dash — fluxos Aprender/Praticar/Revisão mantêm paleta própria */
html[data-mp-theme="dark"] body:has(.sidebar) {
    color-scheme: dark;
    background-color: #0f172a;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .sidebar {
    background-color: #1e293b;
    border-right-color: #334155;
}

/* ── Sidebar: estados de ícone e fundo (modo escuro) ───────────────────────
   Todos os SVG passam por currentColor; imgs (gestão docente) fazem swap. */
html[data-mp-theme="dark"] .sidebar .nav-link {
    color: var(--mp-sidebar-icon-idle);
}

html[data-mp-theme="dark"] .sidebar .nav-link:hover {
    background-color: var(--mp-sidebar-link-bg-hover);
    color: var(--mp-sidebar-icon-accent);
}

html[data-mp-theme="dark"] .sidebar .nav-item.active > .nav-link {
    background-color: var(--mp-sidebar-link-bg-active);
    color: var(--mp-sidebar-icon-accent);
}

html[data-mp-theme="dark"] .sidebar .nav-item.active > .nav-link:hover {
    background-color: var(--mp-sidebar-link-bg-hover);
    color: var(--mp-sidebar-icon-accent);
}

/* Stroke — ignora #9CA3AF inline no HTML */
html[data-mp-theme="dark"] .sidebar .nav-link svg path[stroke]:not([stroke="none"]) {
    stroke: currentColor;
    fill: none;
}

/* Fill — professores legacy, ícones só com fill */
html[data-mp-theme="dark"] .sidebar .nav-link svg path[fill]:not([fill="none"]) {
    fill: currentColor;
    stroke: none;
}

html[data-mp-theme="dark"] .sidebar .nav-link.nav-link-professores-fill-icon svg path {
    fill: currentColor;
    stroke: none;
    stroke-width: 0;
}

html[data-mp-theme="dark"] .sidebar .nav-link-gestao-docente-icon .sidebar-nav-icon-gestao-docente path {
    fill: currentColor;
    stroke: none;
}

html[data-mp-theme="dark"] .sidebar .nav-link-admin-icon .sidebar-nav-icon-admin path {
    fill: currentColor;
    stroke: none;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content {
    background-color: #1e293b;
    border-right-color: #334155;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-miolo {
    background-color: #1e293b;
}

/* Home: padding-top no wrapper fica fora do .main-miolo — sem isto vê-se o body (#0f172a) em faixa */
html[data-mp-theme="dark"] body.home-page:has(.sidebar) {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .home-page .main-content-wrapper-full-w {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .home-page .container-fluid {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .page-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .page-subtitle {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .disciplinas-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .search-wrapper {
    background-color: #0f172a;
    border-color: #475569;
}

html[data-mp-theme="dark"] .search-input-main {
    background-color: #0f172a;
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .search-input-main::placeholder {
    color: var(--mp-dark-placeholder);
}

html[data-mp-theme="dark"] .search-icon-input {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .search-filter-badge {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .carousel-btn {
    background-color: #334155;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .carousel-btn:hover {
    background-color: #475569;
}

html[data-mp-theme="dark"] .carousel-container::before {
    background: linear-gradient(
        to right,
        rgba(30, 41, 59, 0) 0%,
        rgba(30, 41, 59, 0.65) 55%,
        #1e293b 100%
    );
}

html[data-mp-theme="dark"] .carousel-container::after {
    background: linear-gradient(
        to left,
        rgba(30, 41, 59, 0) 0%,
        rgba(30, 41, 59, 0.65) 55%,
        #1e293b 100%
    );
}

/* Notificações — layout e lista */
html[data-mp-theme="dark"] .notificacoes-miolo {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .notifications-list {
    background-color: #0f172a;
    border-right-color: #334155;
}

html[data-mp-theme="dark"] .notification-card {
    background-color: #0f172a;
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .notification-card.highlight-blue,
html[data-mp-theme="dark"] .notification-card.highlight-purple {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .notification-card.active-notification {
    background-color: rgba(250, 204, 21, 0.12);
    border-top-color: #334155;
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .notification-card--resultado.active-notification {
    background-color: rgba(250, 204, 21, 0.18);
}

html[data-mp-theme="dark"] .notification-card-actions {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .notifications-list .notification-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .notifications-list .notification-description {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .notification-detail {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .notification-detail-card {
    background-color: #0f172a;
    border-color: #334155;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .back-button-notifications {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .back-button-notifications:hover {
    background-color: #475569;
}

html[data-mp-theme="dark"] .notification-tab:not(.active) {
    background-color: #334155;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .notification-tab:not(.active):hover {
    background-color: #475569;
    color: #f8fafc;
}

html[data-mp-theme="dark"] .mark-all-read-btn {
    background-color: #facc15;
    color: #0f172a;
}

html[data-mp-theme="dark"] .mark-all-read-btn:hover {
    background-color: #eab308;
}

html[data-mp-theme="dark"] .notifications-list-empty-inner {
    background-color: #0f172a;
    border-color: #334155;
}

html[data-mp-theme="dark"] .notifications-empty-icon {
    background-color: #1e293b;
    border-color: #334155;
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .notifications-empty-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .notifications-empty-text,
html[data-mp-theme="dark"] .notifications-empty-hint {
    color: var(--mp-dark-muted);
}

/* Painel de detalhe — textos e blocos */
html[data-mp-theme="dark"] .detail-type,
html[data-mp-theme="dark"] .detail-intro,
html[data-mp-theme="dark"] .detail-result-score-percent,
html[data-mp-theme="dark"] .detail-result-stat-value,
html[data-mp-theme="dark"] .detail-activity-title,
html[data-mp-theme="dark"] .detail-message h4 {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .detail-title,
html[data-mp-theme="dark"] .detail-activity-description p,
html[data-mp-theme="dark"] .detail-message p,
html[data-mp-theme="dark"] .notification-status-summary,
html[data-mp-theme="dark"] .detail-result-stat-label {
    color: var(--mp-dark-muted);
}

/* !important: notificacoes.js usa fundos inline (#FFF7ED, #FAF5FF) em .detail-intro-box */
html[data-mp-theme="dark"] .detail-intro-box {
    background-color: #1e293b !important;
    border: 1px solid #334155;
}

html[data-mp-theme="dark"] .detail-header .detail-icon:not(.detail-icon--resultado) {
    background-color: #1e293b !important;
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] .detail-activity-card {
    background-color: #1e293b !important;
    border-color: #3b82f6;
}

/* Cartão «atualização» com borda inline clara; manter laranja nos .detail-activity-card--nova */
html[data-mp-theme="dark"] .detail-intro-box > .detail-activity-card:not(.detail-activity-card--nova) {
    border-color: #475569 !important;
}

/* conteúdo com cores inline (#1F2937 / #6B7280) em construirHTMLAtualizacao */
html[data-mp-theme="dark"] .notification-detail .detail-intro-box .detail-activity-card h3 {
    color: #f1f5f9 !important;
}

html[data-mp-theme="dark"] .notification-detail .detail-intro-box .detail-activity-card p,
html[data-mp-theme="dark"] .notification-detail .detail-intro-box .detail-activity-card li {
    color: var(--mp-dark-muted) !important;
}

html[data-mp-theme="dark"] .notification-detail .detail-intro-box .detail-activity-card h4 {
    color: #e2e8f0 !important;
}

html[data-mp-theme="dark"] .detail-intro-box .detail-activity-card--nova {
    background-color: #1e293b;
    border-color: #b45309;
}

html[data-mp-theme="dark"] .detail-result-score-card {
    background-color: #1e293b !important;
    border-color: #9a3412 !important;
}

html[data-mp-theme="dark"] .detail-activity-card--status-concluida.detail-activity-card--nova {
    background-color: #1a222e;
    border-color: #334155;
}

html[data-mp-theme="dark"] .detail-activity-card--status-concluida .detail-activity-title {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .detail-activity-card--status-concluida .detail-activity-description p {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .detail-activity-card--status-excluida.detail-activity-card--nova {
    background-color: #1f1a1a;
    border-color: #442828;
}

html[data-mp-theme="dark"] .detail-activity-card--status-excluida .detail-activity-title {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .detail-activity-card--status-excluida .detail-activity-description p {
    color: #d6d3d1;
}

html[data-mp-theme="dark"] .detail-message {
    background-color: #334155;
}

html[data-mp-theme="dark"] .detail-activity-meta .meta-item {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .detail-activity-meta .meta-item i {
    color: var(--mp-dark-placeholder);
}

/* Configurações (cartões: .settings-card; .settings-container é opcional no HTML) */
html[data-mp-theme="dark"] .settings-card {
    background-color: #0f172a;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

html[data-mp-theme="dark"] .settings-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

html[data-mp-theme="dark"] .settings-card-title,
html[data-mp-theme="dark"] .settings-card .notification-title,
html[data-mp-theme="dark"] .settings-container .notification-title,
html[data-mp-theme="dark"] .accessibility-group-label,
html[data-mp-theme="dark"] .settings-card .notification-option label,
html[data-mp-theme="dark"] .notification-option input[type="checkbox"]:checked + label,
html[data-mp-theme="dark"] .help-card-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .profile-field-label,
html[data-mp-theme="dark"] .settings-card .notification-subtitle,
html[data-mp-theme="dark"] .settings-container .notification-subtitle,
html[data-mp-theme="dark"] .account-info-text,
html[data-mp-theme="dark"] .help-card-subtitle,
html[data-mp-theme="dark"] .settings-card .notification-option label.disabled-label {
    color: var(--mp-dark-muted);
}

/* Perfil: campos só leitura — contraste com o modo claro (#E5E7EB + texto #6B7280) */
html[data-mp-theme="dark"] .profile-input-wrapper {
    cursor: not-allowed;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

html[data-mp-theme="dark"] .profile-input-wrapper input {
    background-color: #020617;
    border: 1px solid #475569;
    color: var(--mp-dark-placeholder);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
    cursor: not-allowed;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

html[data-mp-theme="dark"] .profile-field-group:has(.profile-input-wrapper) {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

html[data-mp-theme="dark"] .profile-input-wrapper input::selection,
html[data-mp-theme="dark"] .profile-input-wrapper input::-moz-selection {
    background: transparent;
    color: inherit;
}

html[data-mp-theme="dark"] .profile-input-wrapper .lock-icon {
    color: #64748b;
    opacity: 0.95;
}

html[data-mp-theme="dark"] .btn-excluir-conta {
    background-color: #1e293b;
    border-color: #991b1b;
    color: #fca5a5;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir {
    background-color: #1e293b;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .modal-header {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .modal-header-desativar {
    background: linear-gradient(180deg, #3f1d1d 0%, #1e293b 78%);
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .modal-footer {
    border-top-color: #334155;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .modal-title {
    color: #f8fafc;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .modal-identidade-subtitulo {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .modal-identidade-icone-perigo {
    background: #3f1d1d;
    border-color: #7f1d1d;
    color: #fca5a5;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .btn-excluir-conta-confirmar {
    background: #dc2626;
    color: #ffffff;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .btn-excluir-conta-confirmar:hover {
    background: #b91c1c;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-zona-risco {
    background: #3f1d1d;
    border-color: #7f1d1d;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-zona-risco-titulo {
    color: #fecaca;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-zona-risco-lista {
    color: #fca5a5;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-aviso-contexto {
    border-color: #92400e;
    background: linear-gradient(180deg, #422006 0%, #3f2d1a 100%);
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-form-seguranca .form-label {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-senha-verify-msg.text-muted {
    color: var(--mp-dark-muted) !important;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-senha-verify-msg.text-danger {
    color: #fca5a5 !important;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-frase-referencia {
    border-color: #475569;
    background: #0f172a;
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-frase-dica {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .excluir-frase-dica.excluir-frase-dica--aviso {
    color: #fcd34d;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.82;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .btn-close:hover {
    opacity: 1;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .btn-outline-secondary {
    background-color: #0f172a;
    border-color: #64748b;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .btn-outline-secondary:hover {
    background-color: #1e293b;
    border-color: #94a3b8;
    color: #f8fafc;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .form-control {
    background-color: #0f172a;
    border-color: #64748b;
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .configuracoes-modal-excluir .form-control:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.35);
}

html[data-mp-theme="dark"] .accessibility-btn {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .accessibility-btn:hover:not(.active) {
    background-color: #475569;
}

html[data-mp-theme="dark"] .accessibility-btn.active {
    background-color: #facc15;
    color: #0f172a;
}

html[data-mp-theme="dark"] .accessibility-btn.active:hover {
    background-color: #eab308;
    color: #0f172a;
}

/* Terminar sessão (sidebar): vermelho apenas no hover (tema escuro).
 *
 * Jun 2026 — afinação do hover: o `#3f1d1d` anterior era um vinho muito
 * escuro que, sobre o slate da sidebar (#1e293b), ficava abafado e não
 * comunicava "vermelho / acção destrutiva" como o equivalente em light
 * (`#FEF2F2` rosa-claro + `#EF4444`). Passamos a usar um vermelho
 * translúcido (`red-500` @ 18%) que se mistura com o slate da sidebar e
 * lê-se claramente como tinta vermelha; o ícone vai para `red-300`
 * (`#fca5a5`) para melhor contraste em dark sem ficar berrante. */
html[data-mp-theme="dark"] .sidebar .nav-link-logout {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .sidebar .nav-link-logout svg path {
    stroke: currentColor;
}

html[data-mp-theme="dark"] .sidebar .nav-link-logout:hover {
    background-color: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

html[data-mp-theme="dark"] .sidebar .nav-link-logout:hover svg path {
    stroke: currentColor;
}

html[data-mp-theme="dark"] .sidebar .nav-link-logout:focus-visible {
    outline-color: #facc15;
}

html[data-mp-theme="dark"] .sidebar .nav-link-theme-toggle {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .sidebar .nav-link-theme-toggle:hover {
    background-color: #334155;
    color: #facc15;
}

html[data-mp-theme="dark"] .sidebar .nav-link-theme-toggle:focus-visible {
    outline-color: #facc15;
}

html[data-mp-theme="dark"] .nav-link-notificacoes .sidebar-nav-badge {
    box-shadow: 0 0 0 2px #1e293b;
}

html[data-mp-theme="dark"] .nav-item.active .nav-link-notificacoes .sidebar-nav-badge {
    box-shadow: 0 0 0 2px var(--mp-sidebar-link-bg-active);
}

/* Tooltip da sidebar — mesmo visual em claro e escuro (spec Figma) */
html[data-mp-theme="dark"] .sidebar-nav-tip {
    background: #000;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.10);
}

html[data-mp-theme="dark"] .help-card {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .help-card:hover {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha {
    background-color: #1e293b;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .modal-header {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .modal-header-seguranca {
    background: linear-gradient(180deg, #1e293b 0%, #1e293b 72%);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .modal-footer {
    border-top-color: #334155;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.82;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-close:hover {
    opacity: 1;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .modal-title {
    color: #f8fafc;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .modal-identidade-icone {
    background: #334155;
    border-color: #64748b;
    color: #fbbf24;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .modal-identidade-subtitulo {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .form-label {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .form-control {
    background-color: #0f172a;
    border-color: #64748b;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .form-control::placeholder {
    color: var(--mp-dark-placeholder);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .form-control:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.28);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .form-text {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-strength-title {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-strength {
    background: #0f172a;
    border: 1px solid #64748b;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-strength-bar {
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-strength-label {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-strength-value {
    background: #334155;
    border-color: #64748b;
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-checklist li {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-checklist li::before {
    border-color: #94a3b8;
    background: rgba(15, 23, 42, 0.5);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-checklist li.ok {
    color: #FDE68A;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-checklist li.ok::before {
    border-color: #FACC15;
    background: radial-gradient(circle, #FACC15 42%, transparent 43%);
}

html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-weak .senha-strength-label,
html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-weak .senha-checklist li.ok {
    color: #fca5a5;
}

html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-weak .senha-checklist li.ok::before {
    border-color: #ef4444;
    background: radial-gradient(circle, #ef4444 42%, transparent 43%);
}

html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-medium .senha-strength-label,
html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-medium .senha-checklist li.ok {
    color: #fde68a;
}

html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-medium .senha-checklist li.ok::before {
    border-color: #facc15;
    background: radial-gradient(circle, #facc15 42%, transparent 43%);
}

html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-strong .senha-strength-label,
html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-strong .senha-checklist li.ok {
    color: #86efac;
}

html[data-mp-theme="dark"] #modalAlterarSenha.senha-level-strong .senha-checklist li.ok::before {
    border-color: #22c55e;
    background: radial-gradient(circle, #22c55e 42%, transparent 43%);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-match-text {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-match-text.ok {
    color: #86efac;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .senha-match-text.erro {
    color: #fca5a5;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-outline-secondary {
    background-color: #0f172a;
    border-color: #475569;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-outline-secondary:hover {
    background-color: #1e293b;
    border-color: #94a3b8;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-salvar-nova-senha {
    background-color: #ca8a04;
    color: #0f172a;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-salvar-nova-senha:hover {
    background-color: #eab308;
    color: #0f172a;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

html[data-mp-theme="dark"] .configuracoes-modal-senha .btn-salvar-nova-senha:active {
    background-color: #a16207;
    color: #f8fafc;
}

/* -------------------------------------------------------------------------- */
/* Respostas                                                                  */
/* -------------------------------------------------------------------------- */

/* Corpo da tabela alinhado ao miolo (#1e293b), menos «bloco» que #0f172a */
html[data-mp-theme="dark"] .respostas-table {
    background-color: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .respostas-table thead {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .respostas-table th {
    color: #e2e8f0;
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .respostas-table td {
    color: #cbd5e1;
}

/* `respostas.css` força a 1ª coluna a #111827 (claro) — aqui reescrevemos no tema escuro. */
html[data-mp-theme="dark"] .respostas-table td:first-child:not(.respostas-table-empty-cell) {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .respostas-table tbody tr {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .respostas-table tbody tr:hover {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .respostas-table tbody tr.respostas-table-empty,
html[data-mp-theme="dark"] .respostas-table tbody tr.respostas-table-empty td {
    background-color: transparent;
}

html[data-mp-theme="dark"] .respostas-table tbody tr.respostas-table-empty:hover {
    background-color: transparent;
}

html[data-mp-theme="dark"] .respostas-table tbody tr.respostas-table-empty:hover td {
    background-color: transparent;
}

/* Botões «Editar» em tabelas — mesmo padrão que .btn-desvincular no modo escuro */
html[data-mp-theme="dark"] .btn-editar-atividade {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .btn-editar-atividade:hover {
    background: #475569;
    border-color: #64748b;
    color: #f8fafc;
}

html[data-mp-theme="dark"] .btn-editar-atividade:focus-visible {
    outline-color: #fbbf24;
}

/* Pills de estado — padrão translúcido (igual às tags de disciplina) */
html[data-mp-theme="dark"] .prof-atividade-status--ok,
html[data-mp-theme="dark"] .prof-atividade-status--ok-alt {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

html[data-mp-theme="dark"] .prof-atividade-status--pending {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.35);
}

html[data-mp-theme="dark"] .prof-atividade-status--rascunho,
html[data-mp-theme="dark"] .prof-atividade-status--indisponivel {
    background: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.45);
}

/* Lista de opções do «Refinar»: sem caixa de fundo (alinhado ao modo claro — só padding + gap) */
html[data-mp-theme="dark"] .refine-dropdown {
    background-color: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

html[data-mp-theme="dark"] .filter-option {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .filter-option input[type='checkbox'],
html[data-mp-theme="dark"] .filter-option input[type='radio'] {
    accent-color: #facc15;
    width: 16px;
    height: 16px;
    border: 1px solid #64748b;
    border-radius: 4px;
    background-color: #0f172a;
    cursor: pointer;
}

html[data-mp-theme="dark"] .filter-option input[type='radio'] {
    border-radius: 50%;
}

html[data-mp-theme="dark"] .filter-option input[type='checkbox']:disabled,
html[data-mp-theme="dark"] .filter-option input[type='radio']:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    border-color: #475569;
}

html[data-mp-theme="dark"] .filter-option:has(> input:disabled) {
    cursor: not-allowed;
    opacity: 0.75;
}

html[data-mp-theme="dark"] .filter-option input[type='checkbox']:focus-visible,
html[data-mp-theme="dark"] .filter-option input[type='radio']:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

html[data-mp-theme="dark"] .btn-refazer,
html[data-mp-theme="dark"] .pagination-btn {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .btn-refazer:hover,
html[data-mp-theme="dark"] .pagination-btn:hover {
    background-color: #475569;
    color: #f8fafc;
}

html[data-mp-theme="dark"] .refine-item-toggle.active {
    background-color: rgba(250, 204, 21, 0.15) !important;
}

html[data-mp-theme="dark"] .refine-item:hover:not(.active) {
    background-color: rgba(250, 204, 21, 0.08);
}

/* -------------------------------------------------------------------------- */
/* Regras de segurança / Curso (regras_seguranca.css)                         */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .regras-seguranca-wrapper {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .regras-header-wrapper {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .regras-header-section,
html[data-mp-theme="dark"] .regras-progress {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .regras-back-button {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .regras-back-button:hover {
    background-color: #475569;
}

html[data-mp-theme="dark"] .regras-back-button svg path {
    fill: #e2e8f0;
}

html[data-mp-theme="dark"] .regras-back-button:hover svg path {
    fill: #f8fafc;
}

html[data-mp-theme="dark"] .regras-main-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .regras-header-subtitle,
html[data-mp-theme="dark"] .regras-header-subtitle-item,
html[data-mp-theme="dark"] .regras-progress-text {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .regras-list-btn:not(.selected) {
    background-color: #334155;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .regras-left-panel-wrapper,
html[data-mp-theme="dark"] .regras-activity-list {
    background-color: #0f172a;
    border-right-color: #334155;
}

html[data-mp-theme="dark"] .regras-activity-list {
    box-shadow: 1px 0 0 #334155;
}

html[data-mp-theme="dark"] .regras-activity-item {
    border-bottom-color: #334155;
    border-left-color: transparent;
}

html[data-mp-theme="dark"] .regras-activity-item:hover {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .regras-activity-item.active {
    background-color: rgba(250, 204, 21, 0.12);
    border-left-color: #facc15;
}

html[data-mp-theme="dark"] .regras-activity-title,
html[data-mp-theme="dark"] .regras-disable-title {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .regras-activity-item.active .regras-activity-title,
html[data-mp-theme="dark"] .regras-activity-item:hover .regras-activity-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .regras-activity-description,
html[data-mp-theme="dark"] .regras-activity-meta-item {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .regras-activity-details {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .regras-activity-details-content {
    background-color: #0f172a;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

html[data-mp-theme="dark"] .regras-detail-title,
html[data-mp-theme="dark"] .regras-learning-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .regras-detail-subtitle,
html[data-mp-theme="dark"] .regras-detail-subtitle-item,
html[data-mp-theme="dark"] .regras-detail-description,
html[data-mp-theme="dark"] .regras-learning-text {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .regras-learning-section {
    background-color: rgba(51, 65, 85, 0.5);
}

html[data-mp-theme="dark"] .regras-score-title {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .regras-score-value {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .regras-action-button {
    background: #334155;
    background-image: none;
    color: #e2e8f0;
    border: 1px solid #475569;
    box-shadow: none;
}

html[data-mp-theme="dark"] .regras-action-button:not(.regras-view-button) {
    user-select: none;
    -webkit-user-select: none;
}

html[data-mp-theme="dark"] .regras-action-button:not(.regras-view-button):hover {
    background: #475569;
    background-image: none;
}

html[data-mp-theme="dark"] .regras-action-button.regras-locked-button {
    background: #1e293b;
    background-image: none;
    color: var(--mp-dark-muted);
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] .regras-action-button.regras-locked-button:hover {
    background: #334155;
    background-image: none;
}

html[data-mp-theme="dark"] .regras-view-button {
    background: #facc15;
    background-image: none;
    color: #0f172a;
    border: none;
    box-shadow: none;
}

html[data-mp-theme="dark"] .regras-view-button:hover {
    background: #eab308;
    background-image: none;
    color: #0f172a;
}

html[data-mp-theme="dark"] .regras-progress-bar-total {
    background-color: #334155;
    opacity: 1;
}

html[data-mp-theme="dark"] .curso-professor-page .regras-seguranca-wrapper .text-muted {
    color: #94a3b8 !important;
}

/* -------------------------------------------------------------------------- */
/* Detalhes de atividade                                                      */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .atividade-detalhes-wrapper {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .atividade-main-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-main-description {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-illustration {
    background: transparent;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-illustration:not(.atividade-illustration--foto-destaque) .atividade-miniatura-img {
    display: none !important;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-illustration--foto-destaque .atividade-miniatura-placeholder {
    display: none !important;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-illustration--foto-destaque .atividade-miniatura-img {
    display: block !important;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-miniatura-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 192px;
    height: 128px;
    flex-shrink: 0;
    border-radius: 12px;
    box-sizing: border-box;
    border: none;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-miniatura-placeholder__line {
    display: block;
    font-size: calc(22px * var(--mp-font-scale, 1));
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    /* Mistura cor da matéria (--atividade-materia-cor no elemento pai) com cinza slate */
    color: #64748b;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-miniatura-placeholder__line {
        color: color-mix(in srgb, var(--atividade-materia-cor, #166534) 28%, #64748b 72%);
    }
}

html[data-mp-theme="dark"] .metadata-item,
html[data-mp-theme="dark"] .metadata-item span {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .atividade-tabs-nav,
html[data-mp-theme="dark"] .atividade-tabs-nav-2,
html[data-mp-theme="dark"] .atividade-tabs-nav-3 {
    border-color: #334155;
}

html[data-mp-theme="dark"] .atividade-tab-btn {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .atividade-tab-btn:hover {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-sidebar {
    background-color: #0f172a;
    border-color: #334155;
}

html[data-mp-theme="dark"] .atividade-tab-content {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .lesson-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .metadata-badge-green {
    background-color: #14532d;
    color: #ecfccb;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-tab-header {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .lesson-intro p,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .lesson-section-title,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .lesson-section-text {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .lesson-illustration {
    background-color: #1e293b;
    border: 1px solid #334155;
}

/* Placeholder multimédia (componente .mp-content-media-placeholder) — tema escuro */
html[data-mp-theme="dark"] .lesson-illustration--placeholder,
html[data-mp-theme="dark"] .teacher-hero--placeholder:not(.teacher-hero--destaque-placeholder) {
    background-color: #1e293b;
    border: 1px solid #334155;
}

html[data-mp-theme="dark"] .lesson-illustration--placeholder {
    background-image: none !important;
}

html[data-mp-theme="dark"] .lesson-illustration--placeholder .mp-content-media-placeholder,
html[data-mp-theme="dark"] .teacher-hero--placeholder .mp-content-media-placeholder {
    display: flex;
}

/* Detalhes disciplina — miniatura placeholder (igual lógica visual a atividades/detalhes, só escuro) */
html[data-mp-theme="dark"] .teacher-hero--destaque-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
    border: none !important;
    box-sizing: border-box;
}

html[data-mp-theme="dark"] .teacher-hero--destaque-placeholder .disciplina-hero-miniatura-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: min(100%, 636.41px);
    max-width: 636.41px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 12px;
    box-sizing: border-box;
    border: none;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Desktop: largura total do cartão (alinha com título/descrição); mantém 636.41px só em ecrãs mais estreitos */
@media (min-width: 992px) {
    html[data-mp-theme="dark"] .teacher-hero--destaque-placeholder {
        align-items: stretch;
    }

    html[data-mp-theme="dark"] .teacher-hero--destaque-placeholder .disciplina-hero-miniatura-placeholder {
        width: 100%;
        max-width: none;
        align-self: stretch;
    }
}

html[data-mp-theme="dark"] .teacher-hero--destaque-placeholder .disciplina-hero-miniatura-placeholder__line {
    display: block;
    font-size: calc(32px * var(--mp-font-scale, 1));
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    color: #64748b;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .teacher-hero--destaque-placeholder .disciplina-hero-miniatura-placeholder__line {
        color: color-mix(in srgb, var(--atividade-materia-cor, #166534) 28%, #64748b 72%);
    }
}

html[data-mp-theme="dark"] .mp-content-media-placeholder {
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background-color: transparent;
    color: #94a3b8;
    box-sizing: border-box;
    padding: 32px;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--banner {
    padding: 20px;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--compact {
    position: relative;
    inset: auto;
    min-height: 96px;
    padding: 16px;
}

html[data-mp-theme="dark"] .path-card-image .mp-content-media-placeholder--compact {
    border-radius: 8px;
}

html[data-mp-theme="dark"] .path-card-image-placeholder {
    background-color: transparent;
}

html[data-mp-theme="dark"] .path-card-image-placeholder .mp-content-media-placeholder--compact .mp-content-media-placeholder__label,
html[data-mp-theme="dark"] .path-card-image-placeholder .mp-content-media-placeholder--compact .mp-content-media-placeholder__frame {
    display: block;
}

html[data-mp-theme="dark"] .path-card-image-placeholder .mp-content-media-placeholder--compact .mp-content-media-placeholder__inner {
    flex-direction: column;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    max-width: min(420px, 92%);
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--banner .mp-content-media-placeholder__inner {
    flex-direction: row;
    gap: 16px;
    max-width: none;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--compact .mp-content-media-placeholder__inner {
    gap: 10px;
    max-width: none;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder__frame {
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 12px;
    pointer-events: none;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--banner .mp-content-media-placeholder__frame {
    inset: -8px;
    border-radius: 10px;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--compact .mp-content-media-placeholder__frame {
    inset: -6px;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder__icon {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    color: #64748b;
    opacity: 0.92;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--banner .mp-content-media-placeholder__icon {
    width: 48px;
    height: 48px;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--compact .mp-content-media-placeholder__icon {
    width: 40px;
    height: 40px;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder__label {
    font-size: calc(18px * var(--mp-font-scale, 1));
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.01em;
    line-height: 1.35;
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--banner .mp-content-media-placeholder__label {
    font-size: calc(16px * var(--mp-font-scale, 1));
}

html[data-mp-theme="dark"] .mp-content-media-placeholder--compact .mp-content-media-placeholder__label {
    font-size: calc(13px * var(--mp-font-scale, 1));
    font-weight: 500;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder {
    border: none;
    border-radius: 12px;
    box-shadow: none;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder {
    background-color: transparent;
    padding: clamp(32px, 5vw, 56px);
    -webkit-user-select: none;
    user-select: none;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder * {
    -webkit-user-select: none;
    user-select: none;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__icon,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__frame {
    display: none !important;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__inner {
    gap: 0;
    max-width: none;
    width: 100%;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__label {
    font-size: clamp(4.5rem, 13.5vw, 7.5rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    color: #64748b;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__label {
        color: color-mix(in srgb, var(--atividade-materia-cor, #166534) 28%, #64748b 72%);
    }
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__label--stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28em;
    width: 100%;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo .lesson-illustration--placeholder .mp-content-media-placeholder__label-line {
    display: block;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: 1.15;
    color: inherit;
}

/* Curso /dash/curso/: banner dinâmico — placeholder escuro aqui; claro em regras_seguranca.css */
html[data-mp-theme="dark"] .regras-detail-banner.regras-detail-banner-dynamic:has(.regras-detail-banner-bus--media-placeholder) {
    height: 200px;
}

html[data-mp-theme="dark"] .regras-detail-banner-dynamic .regras-detail-banner-bus--media-placeholder {
    background-image: none !important;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .regras-detail-banner-dynamic .regras-detail-banner-bus--media-placeholder {
        background-color: color-mix(
            in srgb,
            var(--atividade-materia-cor, #22c55e) 24%,
            #1e293b 76%
        ) !important;
        border: 1px solid color-mix(
            in srgb,
            var(--atividade-materia-cor, #22c55e) 38%,
            #334155 62%
        );
    }
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder {
    display: flex;
    padding: 12px 16px;
    -webkit-user-select: none;
    user-select: none;
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder * {
    -webkit-user-select: none;
    user-select: none;
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__icon,
html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__frame {
    display: none !important;
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__inner {
    gap: 0.22em;
    max-width: none;
    width: 100%;
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__label {
    font-size: clamp(1.45rem, 8vw, 2.85rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.08;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    color: #94a3b8;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__label {
        color: color-mix(in srgb, var(--atividade-materia-cor, #166534) 52%, #94a3b8 48%);
    }
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__label--stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.14em;
    width: 100%;
}

html[data-mp-theme="dark"] .regras-detail-banner-bus--media-placeholder .mp-content-media-placeholder__label-line {
    display: block;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: 1.08;
    color: inherit;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-list-btn:not(.selected) {
    background-color: #334155;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border: none;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-list-btn:not(.selected) i.fa-heart,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-list-btn:not(.selected) i.far.fa-heart {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-list-btn:not(.selected):hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-list-btn:not(.selected):hover i.fa-heart,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-list-btn:not(.selected):hover i.far.fa-heart {
    color: #ffffff;
}

/*
 * «Na minha lista» (.btn-lista): coração é SVG com stroke no markup e <style> inline
 * depois deste ficheiro — !important garante fundo escuro e traço visível.
 */
html[data-mp-theme="dark"] .btn-lista:not(.ativo) {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-mp-theme="dark"] .btn-lista:not(.ativo) .icon-heart svg path {
    stroke: #e2e8f0 !important;
    fill: transparent !important;
}

@media (hover: hover) and (pointer: fine) {
    /* Contorno stroke + fill brancos empilhados parecia uma “borda” grossa no ícone */
    html[data-mp-theme="dark"] .btn-lista:not(.ativo):hover .icon-heart svg path {
        stroke: transparent !important;
        fill: #ffffff !important;
    }
}

@media (pointer: coarse) {
    html[data-mp-theme="dark"] .btn-lista:not(.ativo):hover {
        background-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    html[data-mp-theme="dark"] .btn-lista:not(.ativo):hover .icon-heart svg path {
        stroke: #e2e8f0 !important;
        fill: transparent !important;
    }
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo > .lesson-illustration {
    height: 482px;
    min-height: unset;
    max-height: none;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo h1 {
    color: #f8fafc;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo h2 {
    color: #cbd5e1;
}

/* Mesmo “cartão” cinza-claro + barra dourada que no tema claro (legibilidade e marca). */
html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo h3 {
    color: #1f2937;
    background: #f9fafb;
    border-left-color: #ffd700;
}

/* Estado vazio «Sem texto introdutório» / «Sem envios de tarefas»: não usar o estilo de capítulo (fundo claro em h3). */
html[data-mp-theme="dark"]
    .atividade-detalhes-wrapper
    #tab-conteudo
    .atividade-conteudo-empty.atividade-tab-state
    .atividade-conteudo-empty__title,
html[data-mp-theme="dark"]
    .atividade-detalhes-wrapper
    #tab-tarefas-prof
    .atividade-conteudo-empty.atividade-tab-state
    .atividade-conteudo-empty__title {
    color: #f1f5f9;
    background: transparent;
    border-left: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 10px;
    font-weight: 700;
}

html[data-mp-theme="dark"]
    .atividade-detalhes-wrapper
    #tab-conteudo
    .atividade-conteudo-empty.atividade-tab-state
    .atividade-conteudo-empty__desc,
html[data-mp-theme="dark"]
    .atividade-detalhes-wrapper
    #tab-tarefas-prof
    .atividade-conteudo-empty.atividade-tab-state
    .atividade-conteudo-empty__desc {
    color: #cbd5e1;
}

html[data-mp-theme="dark"]
    .atividade-detalhes-wrapper
    #tab-conteudo
    .atividade-conteudo-empty.atividade-tab-state
    .atividade-conteudo-empty__desc strong,
html[data-mp-theme="dark"]
    .atividade-detalhes-wrapper
    #tab-tarefas-prof
    .atividade-conteudo-empty.atividade-tab-state
    .atividade-conteudo-empty__desc strong {
    color: #f8fafc;
    font-weight: 600;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo h4 {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo h5 {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo h6 {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo p,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo li {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo strong,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo b {
    color: #f8fafc;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper #tab-conteudo blockquote {
    background: #1e293b;
    border-left-color: #facc15;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-sidebar .sidebar-section-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-card {
    background-color: #1e293b;
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-card:hover,
html[data-mp-theme="dark"] .atividade-sidebar .see-also-cards > a:focus-visible .see-also-card {
    background-color: #334155;
    border-color: #fbbf24;
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.35),
        0 6px 12px rgba(0, 0, 0, 0.2);
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-card:hover .see-also-title,
html[data-mp-theme="dark"] .atividade-sidebar .see-also-cards > a:focus-visible .see-also-title {
    color: #f8fafc;
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-info-item span {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-card:hover .see-also-info-item span,
html[data-mp-theme="dark"] .atividade-sidebar .see-also-cards > a:focus-visible .see-also-info-item span {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .atividade-sidebar .see-also-card:hover .see-also-info-item svg path,
html[data-mp-theme="dark"] .atividade-sidebar .see-also-cards > a:focus-visible .see-also-info-item svg path {
    stroke: #cbd5e1;
}

html[data-mp-theme="dark"] .atividade-sidebar .score-date {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-sidebar .score-value {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-sidebar .score-history-link {
    color: #93c5fd;
}

html[data-mp-theme="dark"] .atividade-sidebar .score-history-link:hover {
    color: #bfdbfe;
}

html[data-mp-theme="dark"] .atividade-sidebar .sidebar-scores-empty,
html[data-mp-theme="dark"] .atividade-sidebar .sidebar-veja-tambem-empty {
    background: #1e293b;
    border-color: #475569;
    box-shadow: none;
}

html[data-mp-theme="dark"] .atividade-sidebar .sidebar-scores-empty__icon,
html[data-mp-theme="dark"] .atividade-sidebar .sidebar-veja-tambem-empty__icon {
    background: linear-gradient(145deg, #422006 0%, #713f12 100%);
    color: #fde68a;
}

html[data-mp-theme="dark"] .atividade-sidebar .sidebar-scores-empty__title,
html[data-mp-theme="dark"] .atividade-sidebar .sidebar-veja-tambem-empty__title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-sidebar .sidebar-scores-empty__text,
html[data-mp-theme="dark"] .atividade-sidebar .sidebar-veja-tambem-empty__text {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-sidebar .sidebar-scores-empty__text strong,
html[data-mp-theme="dark"] .atividade-sidebar .sidebar-veja-tambem-empty__text strong {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .atividade-sidebar .text-muted {
    color: #cbd5e1 !important;
}

html[data-mp-theme="dark"] .mp-img-lightbox {
    --mp-lb-gold: #facc15;
    --mp-lb-gold-soft: rgba(253, 224, 71, 0.5);
}

html[data-mp-theme="dark"] .mp-img-lightbox__backdrop {
    background: radial-gradient(
        ellipse 95% 85% at 50% 42%,
        rgba(15, 23, 42, 0.5) 0%,
        rgba(0, 0, 0, 0.9) 55%,
        rgba(0, 0, 0, 0.96) 100%
    );
}

html[data-mp-theme="dark"] .mp-img-lightbox__caption {
    color: #f1f5f9;
    background: rgba(0, 0, 0, 0.58);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-mp-theme="dark"] .mp-img-lightbox__close {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-mp-theme="dark"] .mp-img-lightbox__close:hover {
    background: rgba(30, 41, 59, 0.75);
    color: #fef08a;
    border-color: rgba(253, 224, 71, 0.55);
}

html[data-mp-theme="dark"] #tab-conteudo img:hover {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-tab-state {
    color: #cbd5e1;
    background: #1e293b;
    border-color: #475569;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .atividade-tab-state .atividade-tab-state-icon,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-loading .prova-state-icon,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-empty .prova-state-icon {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-folha {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-cabecalho {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-cabecalho h3 {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-cabecalho .prova-meta,
html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-cabecalho .prova-linhas-cabecalho {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-pergunta {
    border-left-color: #475569;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexos-counter {
    border-color: #854d0e;
    background: #422006;
    color: #fde68a;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexo-item {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexo-item:hover {
    border-color: #fbbf24;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexo-icon {
    background: #422006;
    color: #fcd34d;
    border-color: #854d0e;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexo-titulo {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexo-descricao {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexo-tamanho {
    color: #64748b;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexos-empty {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .anexos-empty-icon {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-btn-imprimir {
    background: #334155;
    color: #f8fafc;
}

html[data-mp-theme="dark"] .atividade-detalhes-wrapper .prova-btn-imprimir:hover {
    background: #475569;
}

/* -------------------------------------------------------------------------- */
/* Matemática (resultados)                                                   */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .disciplina-filters-sidebar {
    background-color: #1e293b;
    border-right-color: #334155;
}

html[data-mp-theme="dark"] .disciplina-filters-header {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .disciplina-filters-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .disciplina-search-input {
    background-color: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .disciplina-search-input::placeholder {
    color: var(--mp-dark-placeholder);
}

html[data-mp-theme="dark"] .disciplina-filter-tag {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .matematica-content-area,
html[data-mp-theme="dark"] .matematica-main-content {
    background-color: #1e293b;
    color: #e2e8f0;
}

/* -------------------------------------------------------------------------- */
/* Central de ajuda                                                            */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .central-ajuda-page,
html[data-mp-theme="dark"] .central-ajuda-container {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .help-sidebar {
    background-color: #0f172a;
    border-right-color: #334155;
}

html[data-mp-theme="dark"] .help-logo {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .help-section-title {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .central-ajuda-page .search-input,
html[data-mp-theme="dark"] .help-sidebar .search-input {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .central-ajuda-page .search-input::placeholder,
html[data-mp-theme="dark"] .help-sidebar .search-input::placeholder {
    color: var(--mp-dark-placeholder);
}

html[data-mp-theme="dark"] .help-sidebar .filter-category-btn {
    background-color: rgba(250, 204, 21, 0.12);
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .faq-item {
    background-color: #0f172a;
    border-color: #334155;
}

html[data-mp-theme="dark"] .faq-question {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .faq-content p {
    color: var(--mp-dark-muted);
}

/* Ajuda e suporte — reportar, privacidade, termos */
html[data-mp-theme="dark"] .mp-support-page,
html[data-mp-theme="dark"] .mp-support-container {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .mp-support-main {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .mp-support-back {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-support-back:hover {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-support-hero {
    background: linear-gradient(180deg, rgba(250, 204, 21, 0.08) 0%, #0f172a 88%);
    border-color: rgba(250, 204, 21, 0.25);
}

html[data-mp-theme="dark"] .mp-support-hero-icon {
    background: rgba(250, 204, 21, 0.15);
    border-color: rgba(250, 204, 21, 0.35);
    color: #facc15;
}

html[data-mp-theme="dark"] .mp-support-hero-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-support-hero-subtitle {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-support-updated {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .mp-support-main--doc {
    background: #0f172a;
}

html[data-mp-theme="dark"] .mp-doc-breadcrumb {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-breadcrumb span {
    color: #475569;
}

html[data-mp-theme="dark"] .mp-doc-hero {
    background: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .mp-doc-page[data-doc="privacidade"] .mp-doc-hero {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(45, 212, 191, 0.25);
}

html[data-mp-theme="dark"] .mp-doc-page[data-doc="termos"] .mp-doc-hero {
    background: rgba(250, 204, 21, 0.08);
    border-color: rgba(250, 204, 21, 0.22);
}

html[data-mp-theme="dark"] .mp-doc-hero-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-doc-hero-subtitle {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-meta-pill--muted {
    background: #0f172a;
    border-color: #334155;
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-progress {
    background: #334155;
}

html[data-mp-theme="dark"] .mp-doc-toc-card,
html[data-mp-theme="dark"] .mp-doc-section,
html[data-mp-theme="dark"] .mp-doc-related-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
}

html[data-mp-theme="dark"] .mp-doc-toc a:hover,
html[data-mp-theme="dark"] .mp-doc-toc a.is-active {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-doc-page[data-doc="privacidade"] .mp-doc-toc a:hover,
html[data-mp-theme="dark"] .mp-doc-page[data-doc="privacidade"] .mp-doc-toc a.is-active {
    border-left-color: #2dd4bf;
    background: rgba(13, 148, 136, 0.14);
}

html[data-mp-theme="dark"] .mp-doc-page[data-doc="termos"] .mp-doc-toc a:hover,
html[data-mp-theme="dark"] .mp-doc-page[data-doc="termos"] .mp-doc-toc a.is-active {
    border-left-color: #facc15;
    background: rgba(250, 204, 21, 0.1);
}

html[data-mp-theme="dark"] .mp-doc-toc-mobile-wrap {
    background: #0f172a;
}

html[data-mp-theme="dark"] .mp-doc-section-body {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .mp-callout--aviso {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(251, 146, 60, 0.35);
    color: #fdba74;
}

html[data-mp-theme="dark"] .mp-callout--info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}

html[data-mp-theme="dark"] .mp-doc-related-heading {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-doc-related-desc,
html[data-mp-theme="dark"] .mp-doc-related-secondary {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-related-secondary:hover {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-doc-toc-title {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-toc a {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-toc a:hover,
html[data-mp-theme="dark"] .mp-doc-toc a.is-active {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-doc-toc-mobile-label {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-doc-toc-mobile {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-doc-section-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-doc-section-body {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .mp-doc-section-body a {
    color: #facc15;
}

html[data-mp-theme="dark"] .mp-doc-page[data-doc="privacidade"] .mp-doc-section-body a {
    color: #2dd4bf;
}

html[data-mp-theme="dark"] .mp-callout--resumo {
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.3);
    color: #fde68a;
}

html[data-mp-theme="dark"] .mp-doc-page[data-doc="privacidade"] .mp-callout--resumo {
    background: rgba(13, 148, 136, 0.14);
    border-color: rgba(45, 212, 191, 0.3);
    color: #5eead4;
}

html[data-mp-theme="dark"] .mp-callout {
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.3);
    color: #fde68a;
}

html[data-mp-theme="dark"] .mp-doc-related {
    background: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .mp-doc-related-text {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-report-type {
    background: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .mp-report-type:hover {
    background: #334155;
}

html[data-mp-theme="dark"] .mp-report-type[data-type="bug"] .mp-report-type-icon {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

html[data-mp-theme="dark"] .mp-report-type[data-type="bug"].active {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

html[data-mp-theme="dark"] .mp-report-type[data-type="broken"] .mp-report-type-icon {
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
}

html[data-mp-theme="dark"] .mp-report-type[data-type="broken"].active {
    border-color: #fb923c;
    background: rgba(249, 115, 22, 0.12);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.18);
}

html[data-mp-theme="dark"] .mp-report-type[data-type="suggestion"] .mp-report-type-icon {
    background: rgba(250, 204, 21, 0.18);
    color: #fde047;
}

html[data-mp-theme="dark"] .mp-report-type[data-type="suggestion"].active {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.12);
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.15);
}

html[data-mp-theme="dark"] .mp-report-type[data-type="other"] .mp-report-type-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

html[data-mp-theme="dark"] .mp-report-type[data-type="other"].active {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.14);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

html[data-mp-theme="dark"] .mp-report-type-label {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-report-form-card {
    background: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .mp-report-form-card .form-label {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-report-form-card .form-control {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-report-form-card .form-control::placeholder {
    color: var(--mp-dark-placeholder);
}

html[data-mp-theme="dark"] .mp-report-context {
    background: #0f172a;
    border-color: #334155;
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-report-context-toggle {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .mp-report-context-toggle:hover {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .mp-report-context-chevron {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-report-context-divider {
    background: #334155;
}

html[data-mp-theme="dark"] .mp-report-secondary {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .mp-report-secondary:hover {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .mp-report-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.35);
}

html[data-mp-theme="dark"] .mp-report-success-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

html[data-mp-theme="dark"] .mp-report-success-title,
html[data-mp-theme="dark"] .mp-report-success-text,
html[data-mp-theme="dark"] .mp-report-success-ref {
    color: #86efac;
}

html[data-mp-theme="dark"] .mp-report-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

html[data-mp-theme="dark"] .mp-support-public-page {
    background: #0f172a;
}

html[data-mp-theme="dark"] .mp-support-public-inner {
    background: #1e293b;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

html[data-mp-theme="dark"] .configuracoes-modal-reportar {
    background: #1e293b;
}

html[data-mp-theme="dark"] .configuracoes-modal-reportar .modal-header-reportar {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .configuracoes-modal-reportar .modal-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .configuracoes-modal-reportar .modal-identidade-subtitulo,
html[data-mp-theme="dark"] .configuracoes-modal-reportar .mp-report-types-label {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .configuracoes-modal-reportar .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Matemática — miolo e cartões */
html[data-mp-theme="dark"] .disciplina-refine-item:hover {
    background-color: #334155;
}

html[data-mp-theme="dark"] .disciplina-resultados-section {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .disciplina-resultados-list {
    background-color: #0f172a;
    border-right-color: #334155;
    border-top-color: rgba(250, 204, 21, 0.25);
}

html[data-mp-theme="dark"] .disciplina-resultados-list-item {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .disciplina-resultados-list-item.active {
    background-color: rgba(250, 204, 21, 0.12);
}

html[data-mp-theme="dark"] .disciplina-resultados-list-title,
html[data-mp-theme="dark"] .disciplina-resultados-card-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .disciplina-resultados-list-subtitle,
html[data-mp-theme="dark"] .disciplina-resultados-card-meta {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .disciplina-resultados-card {
    background-color: #0f172a;
    border-color: #334155;
}

/* CRM (estilos inline no template — classes .crm-*) */
html[data-mp-theme="dark"] .crm-card {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .crm-section {
    border-color: #334155;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

html[data-mp-theme="dark"] .crm-section-head {
    border-bottom-color: #475569;
}

html[data-mp-theme="dark"] .crm-section-title,
html[data-mp-theme="dark"] .crm-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .crm-section-subtitle,
html[data-mp-theme="dark"] .crm-subtitle,
html[data-mp-theme="dark"] .crm-muted,
html[data-mp-theme="dark"] .crm-help {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .crm-actions-bar {
    border-top-color: #334155;
}

html[data-mp-theme="dark"] .crm-field label {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .crm-field input,
html[data-mp-theme="dark"] .crm-field select,
html[data-mp-theme="dark"] .crm-field textarea {
    border-color: #475569;
    background: #0f172a;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .crm-field input:focus,
html[data-mp-theme="dark"] .crm-field select:focus,
html[data-mp-theme="dark"] .crm-field textarea:focus {
    background: #0f172a;
    border-color: #818cf8;
}

html[data-mp-theme="dark"] .crm-exercise-card {
    background: #0f172a;
    border-color: #334155;
}

html[data-mp-theme="dark"] .crm-mode-tabs {
    background: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .crm-mode-tab {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .crm-praticar-config,
html[data-mp-theme="dark"] .crm-booster-box {
    border-color: #334155;
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.25) 0%, #0f172a 100%);
}

html[data-mp-theme="dark"] .crm-booster-item {
    background: #0f172a;
    border-color: #475569;
}

html[data-mp-theme="dark"] .crm-booster-title {
    color: #93c5fd;
}

html[data-mp-theme="dark"] .crm-booster-subtitle,
html[data-mp-theme="dark"] .crm-praticar-config-title {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .crm-booster-item h4 {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .crm-booster-item p {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .crm-mode-profile-box {
    border-color: #4338ca;
    background: linear-gradient(180deg, #312e81 0%, #0f172a 100%);
}

html[data-mp-theme="dark"] .crm-mode-profile-head span {
    color: #e0e7ff;
}

html[data-mp-theme="dark"] .crm-mode-profile-box #modo_perfil {
    background: #0f172a;
    border-color: #6366f1;
}

html[data-mp-theme="dark"] .crm-badge {
    background: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .crm-btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

html[data-mp-theme="dark"] .crm-quick-actions {
    border-color: #4c1d95;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
}

html[data-mp-theme="dark"] .crm-api-debug {
    border-color: #334155;
    background: #0f172a;
}

html[data-mp-theme="dark"] .crm-api-debug h4,
html[data-mp-theme="dark"] .crm-api-debug pre {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .crm-advanced {
    border-color: #475569;
    background: #1e293b;
}

html[data-mp-theme="dark"] .crm-advanced summary {
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .crm-separator {
    background: #334155;
}

html[data-mp-theme="dark"] .crm-upload-inline input[type="file"] {
    background: #1e293b;
    border-color: #475569;
}

html[data-mp-theme="dark"] .crm-list-atividades-card {
    background: #0f172a;
    border-color: #334155;
}

html[data-mp-theme="dark"] .crm-list-atividades-card:hover {
    border-color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .crm-list-atividades-card h3 {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .crm-list-atividades-card .meta {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .crm-list-atividades-link {
    color: inherit;
}

html[data-mp-theme="dark"] .crm-field select:disabled {
    background: #334155;
    color: var(--mp-dark-muted);
}

/* Central de ajuda — texto principal */
html[data-mp-theme="dark"] .help-main-content {
    background-color: #1e293b;
}

html[data-mp-theme="dark"] .help-main-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .help-subtitle {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .help-support-title {
    color: #f1f5f9;
}

/* -------------------------------------------------------------------------- */
/* Coluna de filtros (.main-content) — Respostas, Home, etc.                 */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .main-header {
    background-color: #0f172a;
    border-bottom-color: #334155;
}

/* Logo oficial em modo escuro (assets/img/logo-dark.png) — painel com sidebar / home */
.mp-logo-theme-dark {
    display: none !important;
}

html[data-mp-theme="dark"] body:has(.sidebar) .mp-logo-theme-light,
html[data-mp-theme="dark"] .home-page .mp-logo-theme-light,
html[data-mp-theme="dark"] body.criacao-atividade-basico-page .mp-logo-theme-light {
    display: none !important;
}

html[data-mp-theme="dark"] body:has(.sidebar) .mp-logo-theme-dark,
html[data-mp-theme="dark"] .home-page .mp-logo-theme-dark,
html[data-mp-theme="dark"] body.criacao-atividade-basico-page .mp-logo-theme-dark {
    display: inline-block !important;
    filter: none !important;
}

html[data-mp-theme="dark"] body:has(.sidebar) .header-logo .mp-logo-theme-dark,
html[data-mp-theme="dark"] body:has(.sidebar) .header-logo .logo-img.mp-logo-theme-dark,
html[data-mp-theme="dark"] .portal-professor.professores-meus-grupos-page .header-logo .logo-img.mp-logo-theme-dark {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 72px;
}

html[data-mp-theme="dark"] .header-logo .logo-img:not(.mp-logo-theme-dark),
html[data-mp-theme="dark"] .welcome-logo .logo-img:not(.mp-logo-theme-dark),
html[data-mp-theme="dark"] .atividade-sidebar .welcome-logo .logo-img:not(.mp-logo-theme-dark) {
    filter: brightness(0) invert(1);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .search-input {
    background-color: #1e293b;
    border: 1px solid #64748b;
    color: #f1f5f9;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .search-input:focus {
    border-color: #94a3b8;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(250, 204, 21, 0.2);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .search-input::placeholder {
    color: var(--mp-dark-placeholder);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .search-icon {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .section-title {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-item {
    color: #e2e8f0;
    border: 1px solid #334155;
    background-color: #1e293b;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-icon {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-item-toggle.active {
    background-color: rgba(250, 204, 21, 0.14) !important;
    border-color: rgba(250, 204, 21, 0.45);
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-item:hover:not(.active) {
    background-color: #334155;
    border-color: #475569;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-dropdown {
    background-color: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-item-toggle:focus-visible {
    outline: 2px solid rgba(250, 204, 21, 0.55);
    outline-offset: 2px;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .filter-option {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-dropdown .filter-option input[type='checkbox'],
html[data-mp-theme="dark"] body:has(.sidebar) .main-content .refine-dropdown .filter-option input[type='radio'] {
    background-color: transparent;
    border-color: #94a3b8;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .filter-tag {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .btn-clear {
    background-color: #334155;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .btn-clear:hover {
    background-color: #475569;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .btn-apply {
    background-color: #facc15;
    color: #0f172a;
    border: none;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-content .btn-apply:hover {
    background-color: #eab308;
    color: #0f172a;
}

/* Abas (As Minhas Atividades, etc.) — evitar “pílulas” claras sobre miolo escuro */
html[data-mp-theme="dark"] .tabs-container {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .tab-button:not(.active) {
    background-color: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] .tab-button:not(.active):hover {
    background-color: #475569;
    color: #f8fafc;
    border-color: #64748b;
}

html[data-mp-theme="dark"] .tab-button.active {
    border: 1px solid transparent;
}

/* -------------------------------------------------------------------------- */
/* Home — carrossel de disciplinas (activo, laterais e estáticos)            */
/* -------------------------------------------------------------------------- */

/* Miolo do cartão: home.css usa #fff / #F7F7F9 e, no activo, --disciplina-cor com !important */
html[data-mp-theme="dark"] .disciplina-card {
    background-color: #1e293b !important;
}

html[data-mp-theme="dark"] .disciplina-card:not(.active) {
    opacity: 0.93;
    border-color: rgba(148, 163, 184, 0.4);
}

html[data-mp-theme="dark"] .disciplina-card:not(.active) .card-content-top,
html[data-mp-theme="dark"] .disciplina-card.disciplina-card-static .card-content-top {
    background-color: #334155 !important;
}

html[data-mp-theme="dark"] .disciplina-card:not(.active) .card-content-bottom,
html[data-mp-theme="dark"] .disciplina-card.disciplina-card-static .card-content-bottom {
    background-color: #0f172a !important;
    border: 1px solid rgba(51, 65, 85, 0.9);
}

html[data-mp-theme="dark"] .disciplina-card:not(.active) .card-title,
html[data-mp-theme="dark"] .disciplina-card.disciplina-card-static .card-title {
    color: #f1f5f9 !important;
}

html[data-mp-theme="dark"] .disciplina-card:not(.active) .card-subtitle,
html[data-mp-theme="dark"] .disciplina-card.disciplina-card-static .card-subtitle {
    color: var(--mp-dark-muted) !important;
}

/* Cartão central (activo): fundo escuro + texto legível (evita ouro claro sobre branco) */
html[data-mp-theme="dark"] .disciplina-card.active .card-content-top,
html[data-mp-theme="dark"] .disciplina-card[data-slot="active"] .card-content-top {
    background-color: #334155 !important;
}

html[data-mp-theme="dark"] .disciplina-card[data-slot="active"] .card-title {
    color: color-mix(in srgb, var(--disciplina-cor, #facc15) 45%, #f8fafc) !important;
}

html[data-mp-theme="dark"] .disciplina-card.active .card-subtitle,
html[data-mp-theme="dark"] .disciplina-card[data-slot="active"] .card-subtitle {
    color: var(--mp-dark-muted) !important;
}

/* Zona inferior do cartão activo: mais croma que 20% + #0f172a (evita “caixa acinzentada”). */
html[data-mp-theme="dark"] .disciplina-card[data-slot="active"] .card-content-bottom {
    background-color: color-mix(
        in srgb,
        var(--disciplina-cor-background, var(--disciplina-cor, #ca8a04)) 46%,
        color-mix(in srgb, var(--disciplina-cor, #ca8a04) 26%, #0f172a)
    ) !important;
    border: 1px solid rgba(51, 65, 85, 0.85);
}

/* -------------------------------------------------------------------------- */
/* Home — secção «Continuar de onde parou» / grelha de atividades            */
/* home.css força bordas pastel com !important; neutralizar no escuro.       */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .continue-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .continue-card[style*='border-color: #DCFCE1'],
html[data-mp-theme="dark"] .continue-card[style*='border-color: #FAEDFF'],
html[data-mp-theme="dark"] .continue-card[style*='border-color: #DBEAFE'] {
    border: 1px solid #334155 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
}

html[data-mp-theme="dark"] .continue-card:hover {
    border-color: #475569 !important;
    box-shadow:
        0 6px 22px rgba(var(--continue-rgb), 0.3),
        0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

html[data-mp-theme="dark"] .continue-card[style*='border-color: #DCFCE1']:hover,
html[data-mp-theme="dark"] .continue-card[style*='border-color: #FAEDFF']:hover,
html[data-mp-theme="dark"] .continue-card[style*='border-color: #DBEAFE']:hover {
    border-color: #475569 !important;
    box-shadow:
        0 6px 22px rgba(var(--continue-rgb), 0.3),
        0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

html[data-mp-theme="dark"] .continue-card-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .continue-icon {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .continue-grade {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] body:has(.sidebar) .atividades-empty-state {
    background-color: #1e293b;
    border-color: #475569;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

html[data-mp-theme="dark"] body:has(.sidebar) .atividades-empty-state__icon {
    background-color: rgba(154, 52, 18, 0.55);
    color: #facc15;
}

html[data-mp-theme="dark"] body:has(.sidebar) .atividades-empty-state__title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] body:has(.sidebar) .atividades-empty-state__desc {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] body:has(.sidebar) .atividades-empty-state__desc strong {
    color: #e2e8f0;
    font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Recomendados por professores (teacher-layout / lista + painel)            */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .teacher-layout {
    background-color: #1e293b;
    box-shadow: 0 15px 28px -6px rgba(0, 0, 0, 0.5);
}

html[data-mp-theme="dark"] .teacher-list {
    background-color: #0f172a;
    border-right-color: #334155;
    border-top-color: rgba(250, 204, 21, 0.22);
}

html[data-mp-theme="dark"] .teacher-list::-webkit-scrollbar-thumb {
    background-color: #475569;
}

html[data-mp-theme="dark"] .teacher-list-item {
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .teacher-list-item.active {
    background-color: rgba(250, 204, 21, 0.12);
    border-left-color: #facc15;
    border-bottom-color: #334155;
}

html[data-mp-theme="dark"] .teacher-list-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .teacher-list-subtitle {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .teacher-list-footer {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .teacher-card {
    background-color: #1e293b;
    border-color: #334155;
}

html[data-mp-theme="dark"] .teacher-card-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .teacher-card-title a {
    color: inherit;
}

/*
 * Meta do card (ano / tema / professor): no escuro o body impõe #e2e8f0 — !important + --disciplina-cor no .teacher-card
 */
html[data-mp-theme="dark"] .teacher-card .teacher-card-meta {
    color: #94a3b8 !important;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .teacher-card .teacher-card-meta {
        color: color-mix(
            in srgb,
            var(--disciplina-cor, #4ade80) 55%,
            #94a3b8 45%
        ) !important;
    }
}

html[data-mp-theme="dark"] .teacher-card .teacher-meta-item {
    color: inherit !important;
}

html[data-mp-theme="dark"] .teacher-card .teacher-meta-item svg path {
    stroke: currentColor !important;
}

html[data-mp-theme="dark"] .teacher-card .teacher-meta-item svg path[fill]:not([fill='none']) {
    fill: currentColor !important;
}

html[data-mp-theme="dark"] .teacher-meta-separator {
    color: #475569;
}

/*
 * Pastilha da disciplina (detalhes disciplina / pesquisa): --mp-tag-materia-cor / --mp-tag-materia-bg / --disciplina-cor
 */
html[data-mp-theme="dark"] .teacher-tag-subject {
    font-size: calc(13px * var(--mp-font-scale, 1));
    font-weight: 600;
    box-sizing: border-box;
    border: 1px solid #475569;
    background-color: #1e293b;
    color: #e2e8f0;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .teacher-tag-subject {
        --_mc: var(--mp-tag-materia-cor, var(--disciplina-cor, #4ade80));
        border-color: color-mix(in srgb, var(--_mc) 48%, #475569 52%);
        background-color: color-mix(
            in srgb,
            var(--mp-tag-materia-bg, transparent) 14%,
            color-mix(in srgb, var(--_mc) 26%, #1e293b 74%) 86%
        );
        color: color-mix(in srgb, var(--_mc) 58%, #f8fafc 42%);
    }
}

html[data-mp-theme="dark"] .teacher-card-description {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .teacher-list-button:not(.selected) {
    background-color: #334155;
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .teacher-list-button:not(.selected) i.fa-heart,
html[data-mp-theme="dark"] .teacher-list-button:not(.selected) i.far.fa-heart {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .teacher-hero:not(.teacher-hero--placeholder) {
    box-shadow: inset 0 0 0 1px #334155;
}

html[data-mp-theme="dark"] .teacher-hero--placeholder {
    background-image: none !important;
    filter: none;
}

html[data-mp-theme="dark"] .teacher-hero--placeholder:not(.teacher-hero--destaque-placeholder) {
    box-shadow: inset 0 0 0 1px #334155;
}

html[data-mp-theme="dark"] .teacher-btn-outline {
    background-color: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] .teacher-btn-outline:hover {
    background-color: #475569;
    color: #f8fafc;
}

html[data-mp-theme="dark"] .teacher-btn-primary:not(.mp-teacher-modo-btn) svg path {
    fill: #0f172a !important;
}

/*
 * Botões Aprender / Praticar: mantêm sempre a paleta do modo claro (amarelo + cinza escuro),
 * independentemente de html[data-mp-theme="dark"].
 */
html[data-mp-theme="dark"] .teacher-btn.teacher-btn-primary.mp-teacher-modo-btn,
html[data-mp-theme="dark"] a.teacher-btn.teacher-btn-primary.mp-teacher-modo-btn {
    background-color: #ffd400;
    color: #1f2937;
}

html[data-mp-theme="dark"] .teacher-btn.teacher-btn-primary.mp-teacher-modo-btn svg path,
html[data-mp-theme="dark"] a.teacher-btn.teacher-btn-primary.mp-teacher-modo-btn svg path {
    fill: #1f2937 !important;
}

html[data-mp-theme="dark"] .teacher-btn.teacher-btn-secondary.mp-teacher-modo-btn,
html[data-mp-theme="dark"] a.teacher-btn.teacher-btn-secondary.mp-teacher-modo-btn {
    background-color: #1f2933;
    color: #ffffff !important;
}

html[data-mp-theme="dark"] .teacher-btn.teacher-btn-secondary.mp-teacher-modo-btn span,
html[data-mp-theme="dark"] a.teacher-btn.teacher-btn-secondary.mp-teacher-modo-btn span {
    color: #ffffff !important;
}

html[data-mp-theme="dark"] .teacher-btn.teacher-btn-secondary.mp-teacher-modo-btn svg path,
html[data-mp-theme="dark"] a.teacher-btn.teacher-btn-secondary.mp-teacher-modo-btn svg path {
    stroke: #ffffff !important;
}

/* -------------------------------------------------------------------------- */
/* Pesquisa — Percursos (grelha), cabeçalho do miolo, imagens dos cartões      */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] body:has(.sidebar) .main-miolo .back-button {
    background-color: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-miolo .back-button:hover {
    background-color: #475569;
    color: #f8fafc;
}

html[data-mp-theme="dark"] body:has(.sidebar) .main-miolo .learning-paths-section > h2.section-title,
html[data-mp-theme="dark"] body:has(.sidebar) .main-miolo .teacher-section > h2.section-title {
    color: #f1f5f9 !important;
}

html[data-mp-theme="dark"] .learning-path-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-mp-theme="dark"] .learning-path-card:hover {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
    border-color: #475569;
}

html[data-mp-theme="dark"] .path-card-image {
    background-color: #0f172a;
}

html[data-mp-theme="dark"] .path-card-image img {
    box-shadow: 0 0 0 1px #334155;
}

html[data-mp-theme="dark"] .path-card-image-placeholder {
    background-color: #334155;
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] .path-card-image-placeholder--destaque {
    background-color: transparent;
    border: none;
}

html[data-mp-theme="dark"] .path-card-destaque-miniatura .disciplina-hero-miniatura-placeholder__line {
    display: block;
    font-size: calc(12px * var(--mp-font-scale, 1));
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    color: #64748b;
}

@supports (color: color-mix(in srgb, red, blue)) {
    html[data-mp-theme="dark"] .path-card-destaque-miniatura .disciplina-hero-miniatura-placeholder__line {
        color: color-mix(in srgb, var(--atividade-materia-cor, #166534) 28%, #64748b 72%);
    }
}

html[data-mp-theme="dark"] .path-card-image-placeholder svg path {
    stroke: #cbd5e1 !important;
}

html[data-mp-theme="dark"] .path-card-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .path-card-meta,
html[data-mp-theme="dark"] .path-meta-item {
    color: #cbd5e1;
}

html[data-mp-theme="dark"] .path-meta-item svg path {
    stroke: #94a3b8 !important;
}

/* -------------------------------------------------------------------------- */
/* Notificações — resultado / blocos claros com !important em notificacoes.css */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .detail-intro-box--resultado {
    background-color: #1e293b !important;
    border: 1px solid #334155;
}

html[data-mp-theme="dark"] .detail-header--resultado .detail-type {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .detail-header--resultado .detail-title {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .detail-icon--resultado {
    background-color: rgba(30, 41, 59, 0.95) !important;
    border-color: #c2410c !important;
    color: #fdba74;
}

/* -------------------------------------------------------------------------- */
/* Os Meus Professores — cartões (add / connected / pending)                 */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .professor-card {
    background: #1e293b !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

html[data-mp-theme="dark"] .professor-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

html[data-mp-theme="dark"] .professor-card .add-instruction {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .professor-card .school-name {
    color: var(--mp-dark-muted);
}

/* Títulos da matéria: hex escuros (#007d08, etc.) levam a baixo contraste em #1e293b — clarear mantendo o tom */
html[data-mp-theme="dark"] .professor-card .subject-name {
    color: color-mix(in srgb, var(--materia-color, #94a3b8) 82%, #f8fafc) !important;
}

html[data-mp-theme="dark"] .professor-card.add .code-input-group .code-label {
    color: color-mix(in srgb, var(--materia-color, #94a3b8) 56%, #e2e8f0) !important;
}

/* Grupo do código: fundo claro da disciplina → mistura escura mantendo o tom da matéria */
html[data-mp-theme="dark"] .professor-card.add .code-input-group {
    background-color: color-mix(in srgb, var(--materia-color, #64748b) 22%, #1e293b) !important;
    border: 1px solid color-mix(in srgb, var(--materia-color, #64748b) 42%, #334155);
}

html[data-mp-theme="dark"] .professor-card .code-input {
    background-color: #0f172a;
    color: #e2e8f0;
    border: 1px solid #475569;
}

html[data-mp-theme="dark"] .professor-card .code-input:focus {
    border-color: var(--materia-color, #94a3b8);
    outline: none;
}

html[data-mp-theme="dark"] .professor-card.add .code-input-group.error-state {
    background-color: rgba(127, 29, 29, 0.25) !important;
    border-color: #b91c1c;
}

html[data-mp-theme="dark"] .professor-card.pending .invite-status-group {
    background-color: color-mix(in srgb, var(--materia-color, #64748b) 20%, #1e293b) !important;
    border: 1px solid color-mix(in srgb, var(--materia-color, #64748b) 38%, #334155);
}

html[data-mp-theme="dark"] .professor-card.pending .invite-sent-text {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .professor-card.connected .professor-name-badge,
html[data-mp-theme="dark"] .professor-card.pending .professor-name-badge {
    background-color: color-mix(in srgb, var(--materia-color, #64748b) 22%, #1e293b);
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .btn-disconnect {
    background: rgba(127, 29, 29, 0.45);
    color: #fecaca;
}

html[data-mp-theme="dark"] .btn-disconnect:hover {
    background: rgba(153, 27, 27, 0.55);
}

/* -------------------------------------------------------------------------- */
/* Home — Destaques (Mais Acedidos, Recomendados, Favoritos dos alunos)      */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] .highlights-section h2.section-title,
html[data-mp-theme="dark"] .home-page .highlights-section .home-section-heading,
html[data-mp-theme="dark"] .home-page .home-section-heading {
    color: #f1f5f9 !important;
}

html[data-mp-theme="dark"] .home-page .continue-section h2.section-title {
    color: #f1f5f9 !important;
}

html[data-mp-theme="dark"] .highlight-card,
html[data-mp-theme="dark"] .card.highlight-card {
    background-color: #1e293b !important;
    border: 1px solid #334155;
    color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .highlight-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-mp-theme="dark"] .highlight-card .card-body {
    background-color: transparent;
    color: inherit;
}

html[data-mp-theme="dark"] .highlight-card-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .highlight-card-subtitle,
html[data-mp-theme="dark"] .highlight-card .text-muted {
    color: var(--mp-dark-muted) !important;
}

html[data-mp-theme="dark"] .highlight-list-item {
    background-color: #0f172a;
    border: 1px solid #334155;
}

html[data-mp-theme="dark"] .highlight-item-title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .highlight-item-desc,
html[data-mp-theme="dark"] .highlight-card .highlight-item-desc {
    color: var(--mp-dark-muted) !important;
}

html[data-mp-theme="dark"] .highlight-icon-container {
    background-color: #ca8a04;
}

html[data-mp-theme="dark"] .home-page .highlight-card .atividades-empty-state.highlights-empty-state {
    background-color: #0f172a;
    border-color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(71, 85, 105, 0.35);
}

html[data-mp-theme="dark"] .home-page .highlight-card .atividades-empty-state.highlights-empty-state .atividades-empty-state__icon {
    background-color: rgba(154, 52, 18, 0.55);
    color: #facc15;
}

html[data-mp-theme="dark"] .home-page .highlight-card .atividades-empty-state.highlights-empty-state .atividades-empty-state__title {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .home-page .highlight-card .atividades-empty-state.highlights-empty-state .atividades-empty-state__desc {
    color: var(--mp-dark-muted);
}

html[data-mp-theme="dark"] .home-page .highlight-card .atividades-empty-state.highlights-empty-state .atividades-empty-state__desc strong {
    color: #e2e8f0;
    font-weight: 600;
}

html[data-mp-theme="dark"] .highlight-icon-container svg path {
    stroke: #0f172a;
}

/* -------------------------------------------------------------------------- */
/* Foco visível — teclado no shell do dash (.sidebar)                          */
/* -------------------------------------------------------------------------- */

/* Inputs fora desta lista: o anel colorido destoava dos cartões (ex.: código do professor).
   O foco em inputs fica só com outline transparente + borda definida no CSS da página. */
body:has(.sidebar)
    :where(a, button, select, textarea, summary, [tabindex]):not(
        [tabindex="-1"]
    ):focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

body:has(.sidebar) input:not([type="hidden"]):focus-visible {
    outline: transparent;
    outline-offset: 0;
}

html[data-mp-theme="dark"]
    body:has(.sidebar)
    :where(a, button, select, textarea, summary, [tabindex]):not(
        [tabindex="-1"]
    ):focus-visible {
    outline-color: #facc15;
    outline-offset: 3px;
}

html[data-mp-theme="dark"] body:has(.sidebar) input:not([type="hidden"]):focus-visible {
    outline: transparent;
    outline-offset: 0;
}

/* -------------------------------------------------------------------------- */
/* Menos movimento — carrossel e ícones da home no dash                       */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    body:has(.sidebar) .carousel-btn,
    body:has(.sidebar) .disciplinas-carousel .disciplina-card,
    body:has(.sidebar) .discipline-icon-large,
    body:has(.sidebar) .volatile-icon-pizza,
    body:has(.sidebar) .volatile-icon-calculator,
    body:has(.sidebar) .volatile-icon-path {
        transition-duration: 0.01ms !important;
    }

    body:has(.sidebar) {
        scroll-behavior: auto;
    }
}

/* -------------------------------------------------------------------------- */
/* Alto contraste do sistema — reforço no tema escuro                         */
/* -------------------------------------------------------------------------- */

@media (prefers-contrast: more) {
    html[data-mp-theme="dark"] body:has(.sidebar) .sidebar {
        border-right-color: #cbd5e1;
    }

    html[data-mp-theme="dark"] body:has(.sidebar) .main-content {
        border-right-color: #cbd5e1;
    }

    html[data-mp-theme="dark"] body:has(.sidebar) .search-wrapper,
    html[data-mp-theme="dark"] body:has(.sidebar) .search-input-main,
    html[data-mp-theme="dark"] body:has(.sidebar) .main-content .search-input {
        border-color: #cbd5e1;
    }

    html[data-mp-theme="dark"] .crm-field input,
    html[data-mp-theme="dark"] .crm-field select,
    html[data-mp-theme="dark"] .crm-field textarea {
        border-color: #cbd5e1;
    }
}

/* -------------------------------------------------------------------------- */
/* Página 404 (standalone — templates/errors/404.html.twig)                 */
/* -------------------------------------------------------------------------- */

html[data-mp-theme="dark"] body.page-404-root {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-mp-theme="dark"] .panel-404 {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.28),
        0 16px 40px rgba(0, 0, 0, 0.38);
}

html[data-mp-theme="dark"] .logo-wrap img:not(.mp-logo-theme-dark) {
    filter: brightness(0) invert(1);
}

html[data-mp-theme="dark"] .logo-wrap a:focus-visible {
    outline-color: #facc15;
}

html[data-mp-theme="dark"] .route-illus .route-line {
    stroke: #94a3b8;
}

html[data-mp-theme="dark"] .route-illus .route-break {
    fill: #facc15;
    stroke: #1e293b;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

html[data-mp-theme="dark"] .code-404 .digit {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .code-404 .digit-zero {
    color: #0f172a;
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-mp-theme="dark"] .title-404 {
    color: #f1f5f9;
}

html[data-mp-theme="dark"] .subtitle-404 {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .btn-home {
    color: #0f172a;
}

html[data-mp-theme="dark"] .btn-back {
    color: #94a3b8;
    text-decoration-color: rgba(148, 163, 184, 0.45);
}

html[data-mp-theme="dark"] .btn-back:hover {
    color: #e2e8f0;
    text-decoration-color: rgba(226, 232, 240, 0.4);
}

html[data-mp-theme="dark"] .btn-back:focus-visible {
    outline-color: #facc15;
}

/* =========================================================
 * Home (portal aluno/professor) — ajustes visuais (2026-04)
 * ========================================================= */

.home-section-heading {
    margin: 0 0 16px 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: calc(22px * var(--mp-font-scale, 1));
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

.home-section-heading--tight {
    margin-bottom: 12px;
}

/* Home: aproximar layout do print (banner -> busca -> recentes -> destaques) */
.home-page .search-section {
    margin: 0;
}

.home-page .search-wrapper {
    margin-top: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Disciplinas não existe na Home (aluno/professor) */
.home-disciplinas-section {
    display: none;
}

/* Portal aluno: grid mais “clean” para atividades recentes */
body.portal-aluno .continue-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-content: start;
    justify-items: stretch;
    gap: 18px;
}

body.portal-aluno .continue-card {
    width: 100%;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    transform: none;
}

body.portal-aluno .continue-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
}

body.portal-aluno .continue-card-title {
    font-size: calc(15px * var(--mp-font-scale, 1));
    font-weight: 700;
}

body.portal-aluno .continue-grade {
    font-size: calc(12px * var(--mp-font-scale, 1));
}

body.portal-aluno .continue-card-tag {
    border-radius: 999px;
    padding: 2px 10px;
    font-size: calc(12px * var(--mp-font-scale, 1));
}

/* /dash/respostas — miolo em flex com coluna de filtros em fluxo (shimmer em dash-skeleton.css) */
body.respostas-page .main-content-wrapper {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.respostas-page .main-miolo {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

body.respostas-page #respostas-dash-page-skeleton.respostas-dash-page-skel,
body.respostas-page #tarefas-dash-page-skeleton.respostas-dash-page-skel {
    position: absolute;
    inset: 0;
    z-index: 25;
    background: #ffffff;
    opacity: 1;
    transition: opacity 0.42s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: opacity;
    min-height: 100%;
    pointer-events: auto;
}

body.respostas-page #respostas-dash-page-skeleton.respostas-dash-page-skel.respostas-dash-page-skel--exiting,
body.respostas-page #tarefas-dash-page-skeleton.respostas-dash-page-skel.respostas-dash-page-skel--exiting {
    opacity: 0;
    pointer-events: none;
}

body.respostas-page #respostas-dash-page-skeleton.respostas-dash-page-skel[hidden],
body.respostas-page #tarefas-dash-page-skeleton.respostas-dash-page-skel[hidden] {
    display: none !important;
}

body.respostas-page .respostas-dash-page-skel__wrap {
    padding: 50px 32px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
    width: 100%;
}

body.respostas-page .respostas-dash-page-skel__header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

body.respostas-page .respostas-dash-page-skel__header-text {
    flex: 1;
    display: grid;
    gap: 10px;
    min-width: 0;
}

body.respostas-page .respostas-dash-page-skel__logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex-shrink: 0;
}

body.respostas-page .respostas-dash-page-skel__table-outer {
    width: 100%;
    min-width: 0;
    padding: 0 clamp(8px, 2vw, 24px);
    box-sizing: border-box;
}

body.respostas-page .respostas-dash-page-skel__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
}

body.respostas-page .respostas-dash-page-skel__table thead th {
    padding: 16px 12px;
    background: #f9fafb;
    text-align: left;
    vertical-align: middle;
}

body.respostas-page .respostas-dash-page-skel__table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    border-top: 1px solid #e5e7eb;
}

body.respostas-page .respostas-dash-page-skel__pager {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

body.respostas-page .respostas-dash-page-skel__pager-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

body.respostas-page .respostas-dash-page-skel__pager-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

@media (max-width: 576px) {
    body.respostas-page .respostas-dash-page-skel__wrap {
        padding: 28px 18px 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.respostas-page #respostas-dash-page-skeleton.respostas-dash-page-skel,
    body.respostas-page #tarefas-dash-page-skeleton.respostas-dash-page-skel {
        transition: none;
    }

    body.respostas-page #respostas-dash-page-skeleton .mp-dash-skel,
    body.respostas-page #tarefas-dash-page-skeleton .mp-dash-skel {
        animation: none;
        background: #e5e7eb;
    }
}

html[data-mp-theme="dark"] body.respostas-page #respostas-dash-page-skeleton.respostas-dash-page-skel,
html[data-mp-theme="dark"] body.respostas-page #tarefas-dash-page-skeleton.respostas-dash-page-skel {
    background: #1e293b !important;
}

html[data-mp-theme="dark"] body.respostas-page .respostas-dash-page-skel__table {
    border-color: #334155;
}

html[data-mp-theme="dark"] body.respostas-page .respostas-dash-page-skel__table thead th {
    background: #0f172a;
}

html[data-mp-theme="dark"] body.respostas-page .respostas-dash-page-skel__table tbody td {
    border-top-color: #334155;
}

/* /dash/atividades — o miolo é flex child: min-width 0 evita overflow horizontal da grelha */
body.atividades-page .main-content-wrapper {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Painel de filtros (fixed): acima do skeleton do miolo (z-index 25), que geometricamente cobre esta faixa */
body.atividades-page .main-content-wrapper > .main-content {
    z-index: 40;
}

body.atividades-page .main-miolo {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    /* Reserva a coluna do painel fixo de filtros — alinhado com .main-content (max 256px) */
    --atividades-miolo-pad-left: 250px;
    padding-left: var(--atividades-miolo-pad-left);
}

/* /dash/atividades — skeleton só no miolo (shimmer em dash-skeleton.css) */
body.atividades-page #atividades-dash-page-skeleton.atividades-dash-page-skel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--atividades-miolo-pad-left);
    z-index: 25;
    background: #ffffff;
    opacity: 1;
    transition: opacity 0.42s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: opacity;
    min-height: 100%;
    pointer-events: auto;
}

body.atividades-page #atividades-dash-page-skeleton.atividades-dash-page-skel.atividades-dash-page-skel--exiting {
    opacity: 0;
    pointer-events: none;
}

body.atividades-page #atividades-dash-page-skeleton.atividades-dash-page-skel[hidden] {
    display: none !important;
}

body.atividades-page .atividades-dash-page-skel__wrap {
    padding: 50px 32px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
    width: 100%;
}

body.atividades-page .atividades-dash-page-skel__header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

body.atividades-page .atividades-dash-page-skel__header-text {
    flex: 1;
    display: grid;
    gap: 10px;
    min-width: 0;
}

body.atividades-page .atividades-dash-page-skel__logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex-shrink: 0;
}

body.atividades-page .atividades-dash-page-skel__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
}

body.atividades-page .atividades-dash-page-skel__tab {
    width: 96px;
    height: 38px;
    border-radius: 10px;
}

body.atividades-page .atividades-dash-page-skel__section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

body.atividades-page .atividades-dash-page-skel__section-title {
    max-width: 220px;
}

body.atividades-page .atividades-dash-page-skel__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 19px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body.atividades-page .atividades-dash-page-skel__card {
    display: block;
    width: 100%;
    min-height: 132px;
    border-radius: 14px;
}

@media (max-width: 992px) {
    body.atividades-page .atividades-dash-page-skel__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    body.atividades-page .atividades-dash-page-skel__wrap {
        padding: 28px 18px 32px;
    }

    body.atividades-page .atividades-dash-page-skel__cards {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.atividades-page #atividades-dash-page-skeleton.atividades-dash-page-skel {
        transition: none;
    }

    body.atividades-page #atividades-dash-page-skeleton .mp-dash-skel {
        animation: none;
        background: #e5e7eb;
    }
}

html[data-mp-theme="dark"] body.atividades-page #atividades-dash-page-skeleton.atividades-dash-page-skel {
    background: #1e293b !important;
}

body.atividades-page #tab-todas,
body.atividades-page .continue-section {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.atividades-page .tabs-container {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* /dash/atividades — cartões (Continua…, Meu ano, Atribuídas, etc.): máx. 4 por linha, sem transbordo */
body.atividades-page .continue-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 19px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    justify-items: stretch;
    justify-content: start;
    align-content: start;
}

body.atividades-page .continue-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.atividades-page .continue-card-footer {
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
}

body.atividades-page .continue-card-footer .continue-card-tag {
    margin-left: 0;
    min-width: 0;          /* flex item: permite encolher e aplicar ellipsis */
    max-width: 58%;        /* evita quebrar para baixo em tags longas */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Troca de filtro (Todas / Atribuídas / …): cartões surgem com leve “pulo” */
@keyframes mp-atividades-card-pop-in {
    0% {
        opacity: 0;
        transform: scale(0.82);
    }
    65% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mp-atividades-card-pop-out {
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

body.atividades-page .continue-card.mp-tab-anim-in,
body.atividades-page .teacher-list-item.mp-tab-anim-in,
body.atividades-page .highlight-list-item.mp-tab-anim-in,
body.atividades-page .atividades-empty-state--in-section.mp-tab-anim-in {
    animation: mp-atividades-card-pop-in 380ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
    transform-origin: center center;
}

body.atividades-page .continue-card.mp-tab-anim-out,
body.atividades-page .teacher-list-item.mp-tab-anim-out,
body.atividades-page .highlight-list-item.mp-tab-anim-out,
body.atividades-page .atividades-empty-state--in-section.mp-tab-anim-out {
    animation: mp-atividades-card-pop-out 180ms ease-in both;
    transform-origin: center center;
}

@media (prefers-reduced-motion: reduce) {
    body.atividades-page .mp-tab-anim-in,
    body.atividades-page .mp-tab-anim-out {
        animation: none !important;
    }
}

@media (max-width: 992px) {
    body.atividades-page .continue-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    body.atividades-page .continue-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Destaques: sombras mais suaves e itens mais leves (como no print) */
body.portal-aluno .highlight-card {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
    padding: 16px;
}

body.portal-aluno .highlight-list-item {
    background-color: #f3f4f6;
    border-radius: 10px;
}

body.portal-aluno .highlight-card-title {
    font-weight: 700;
    font-size: calc(16px * var(--mp-font-scale, 1));
}

body.portal-aluno .highlight-card-subtitle {
    font-size: calc(13px * var(--mp-font-scale, 1));
    color: #6b7280;
}

/* Stat info tooltip — componente global utilizado ao lado do título de cards
   de estatística (grupo, minhas atividades, percursos, curso). Pequeno botão
   com ícone "i" cinza, foco/hover escurecem para feedback de interatividade.
   Tooltip usa o atributo `title` nativo (mesmo pattern dos `i` que já existem
   nos sub-labels de "Taxa de Conclusão"), portanto não requer JS adicional. */
.stat-info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    vertical-align: middle;
    transition: color 0.15s ease;
}

.stat-info-tip > i {
    font-size: 13px;
    line-height: 1;
}

.stat-info-tip:hover,
.stat-info-tip:focus-visible {
    color: #4b5563;
    outline: none;
}

html[data-mp-theme="dark"] .stat-info-tip {
    color: #94a3b8;
}

html[data-mp-theme="dark"] .stat-info-tip:hover,
html[data-mp-theme="dark"] .stat-info-tip:focus-visible {
    color: #e2e8f0;
}

.stat-info-tip:active {
    color: #1f2937;
}

/* Variante "metric": ícone tabler-icon-alert-square-rounded em amarelo, 24×24,
   usado nos cards de estatística (curso, professor-percursos, professor-minhas-
   atividades, grupo-perfil). Substitui simultaneamente o ornamento `fa-star` e
   o `fa-circle-info` que antes coexistiam no canto superior direito.

   O posicionamento (grid-area `icon` ou position absolute) é definido pelo
   card pai — esta regra só trata da aparência base do botão. */
.stat-info-tip--metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 0;
    padding: 0;
    background: transparent;
    border: 0;
    color: #fbbf24;
    cursor: pointer;
    line-height: 1;
}

.stat-info-tip--metric > svg {
    width: 100%;
    height: 100%;
    display: block;
}

.stat-info-tip--metric:hover,
.stat-info-tip--metric:focus-visible {
    color: #f59e0b;
    outline: none;
}

html[data-mp-theme="dark"] .stat-info-tip--metric {
    color: #fcd34d;
}

html[data-mp-theme="dark"] .stat-info-tip--metric:hover,
html[data-mp-theme="dark"] .stat-info-tip--metric:focus-visible {
    color: #fde68a;
}

/* Posicionamento: cards baseados em grid (curso, professor-minhas-atividades,
   professor-percursos) já têm a area `icon` no canto superior direito. */
.curso-professor-metric .stat-info-tip--metric,
.prof-minhas-atividades-metric .stat-info-tip--metric {
    grid-area: icon;
    align-self: start;
    justify-self: end;
}

/* Posicionamento: card do grupo-perfil usa `position: relative` + absolute. */
.prof-grupo-perfil__stat-card .stat-info-tip--metric {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Balão (popover) usado pelo stat-info-tip.js — substitui o `title` nativo
   porque em tablet/touch o title é praticamente invisível. Aparece em
   tap/click, posiciona-se relativo ao trigger (com auto-flip vertical e
   clamp horizontal), e fecha em ESC / tap fora / scroll / após o timeout
   dinâmico calculado pelo JS. */
.stat-info-popover {
    position: absolute;
    z-index: 1080;
    max-width: 260px;
    padding: 10px 14px;
    font-size: calc(12px * var(--mp-font-scale, 1));
    line-height: 1.45;
    color: #ffffff;
    background: var(--mp-text, #0f172a);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.stat-info-popover.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.stat-info-popover__arrow {
    position: absolute;
    top: -5px;
    left: var(--arrow-x, 50%);
    width: 10px;
    height: 10px;
    background: var(--mp-text, #0f172a);
    transform: translateX(-50%) rotate(45deg);
    border-radius: 2px;
}

.stat-info-popover--above .stat-info-popover__arrow {
    top: auto;
    bottom: -5px;
}

.stat-info-popover__body {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .stat-info-popover {
        transition: opacity 0.01s linear;
        transform: none;
    }
    .stat-info-popover.is-visible {
        transform: none;
    }
}

html[data-mp-theme="dark"] .stat-info-popover {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

html[data-mp-theme="dark"] .stat-info-popover__arrow {
    background: #1e293b;
}

/* Logo clicável → /dash/home (partial _logo_link.html.twig) */
a.logo-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    line-height: 0;
    border-radius: 6px;
}

a.logo-home-link:hover {
    opacity: 0.88;
}

a.logo-home-link:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: 3px;
}

a.logo-home-link--sidebar {
    display: flex;
    width: 100%;
    height: 100%;
}

a.logo-home-link--sidebar .logo-square {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.logo-home-link--sidebar:hover .logo-square,
a.logo-home-link--sidebar:focus-visible .logo-square {
    transform: scale(1.04);
}

.logo-home-link--static {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    cursor: default;
}

/* Faixa de impersonate — banner no fluxo (primeiro filho do body via JS) */
body.mp-impersonating {
    --mp-impersonation-offset: 48px;
}

body.mp-impersonating .sidebar {
    top: var(--mp-impersonation-offset);
    min-height: calc(100vh - var(--mp-impersonation-offset));
    height: calc(100vh - var(--mp-impersonation-offset));
}

body.mp-impersonating > .container-fluid,
body.mp-impersonating > .container-fluid.p-0 {
    min-height: calc(100vh - var(--mp-impersonation-offset));
}

html[data-mp-theme="dark"] .mp-impersonation-banner {
    background: #422006;
    color: #fde68a;
}

html[data-mp-theme="dark"] .mp-impersonation-banner__stop {
    background: #fde68a;
    color: #422006;
    border-color: #fbbf24;
}

