/* ==========================================================================
   FLOWTI • Folha de Estilos Principal (Mobile-First & AMOLED Optimized)
   ========================================================================== */

:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    height: -webkit-fill-available;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--brand-dark);
    color: var(--color-white);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input,
textarea,
select {
    font-size: 16px !important;
}

@media (min-width: 768px) {

    input,
    textarea,
    select {
        font-size: 14px !important;
    }
}

.custom-scrollbar::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track,
.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--indigo-500);
}

/* Carrossel Horizontal de Matérias */
#subject-filter-tabs {
    display: flex !important;
    align-items: center;
    gap: 8px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: 4px;
    width: 100%;
}

#subject-filter-tabs .subject-tab-btn {
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

#subject-filter-tabs::-webkit-scrollbar {
    height: 4px !important;
}

#subject-filter-tabs::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 999px;
}

#subject-filter-tabs::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: 999px;
}

#subject-filter-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--indigo-500);
}

.glass-panel {
    background: var(--slate-900);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--slate-800);
}

.glass-card {
    background: var(--slate-900);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--slate-800);
    transition: all 0.3s ease;
}

.option-card {
    transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
    touch-action: manipulation;
}

.option-card:hover:not(.disabled) {
    border-color: var(--indigo-500);
    background-color: var(--slate-800);
}

.option-card:active:not(.disabled) {
    transform: scale(0.985);
}

button,
.nav-btn,
.filter-btn,
.subject-tab-btn {
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:active:not(:disabled),
.subject-tab-btn:active {
    transform: scale(0.97);
}

.pb-safe {
    padding-bottom: max(0.75rem, var(--sab));
}

.pt-safe {
    padding-top: max(0.5rem, var(--sat));
}

canvas {
    max-width: 100% !important;
}

.card-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.badge-free {
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo-400);
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-pro {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #070d1e;
    font-weight: 900;
}

.badge-elite {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #ffffff;
    font-weight: 900;
}

.deck-locked {
    position: relative;
    cursor: pointer !important;
}

.deck-locked .deck-icon-wrapper {
    opacity: 0.7;
    filter: grayscale(40%);
}

.deck-locked:hover {
    border-color: rgba(245, 158, 11, 0.55) !important;
}

.upgrade-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 13, 30, 0.75); /* Fundo escuro translúcido e suave */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Z-index alto para ficar acima de qualquer elemento da UI mobile */
    padding: 16px;
}

.upgrade-modal-backdrop.hidden {
    display: none !important;
}

.upgrade-modal-card {
    background: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: 24px;
    max-width: 440px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
    .upgrade-modal-card {
        padding: 32px;
    }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animação 3D Flashcard */
.flashcard-scene {
    perspective: 1200px;
    width: 100%;
    max-width: 42rem;
    min-height: 22rem;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 22rem;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard-inner.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 1.5rem;
}

.flashcard-face-back {
    transform: rotateY(180deg);
}

/* Dropdown */
.profile-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-width: 90vw;
    background: var(--slate-900);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--slate-800);
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.85);
    z-index: 60;
    transform-origin: top right;
    animation: menuFadeScale 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuFadeScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-300);
    transition: all 0.15s ease;
    cursor: pointer;
}

.profile-menu-item:hover {
    background: var(--slate-800);
    color: var(--color-white);
}

.profile-menu-item:active {
    transform: scale(0.98);
}

/* Fix de Tabela Mobile (Oculta Resolvidas e Reduz Fontes) */
@media (max-width: 768px) {
    .mobile-hide-col {
        display: none !important;
    }

    #diagnostic-table-body td,
    #diagnostic-table-body th {
        padding-top: 0.6rem !important;
        padding-bottom: 0.6rem !important;
        font-size: 10.5px !important;
    }
}


/* ==========================================================================
   THEMING ENGINE: AWISE (White), GITHUB (Dark), AMOLED Blue/Green
   ========================================================================== */

/* 1. BLUE DARK AMOLED (Padrão Original FLOWTI) */
:root,
[data-theme="blue"] {
    --brand-dark: #070d1e;
    --color-white: #ffffff;

    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #1e2d5a;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #0b1329;

    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --rose-400: #fb7185;
    --rose-500: #ef4444;
    --rose-600: #e11d48;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
}

/* 2. DARK GITHUB */
[data-theme="dark"] {
    --brand-dark: #0d1117;
    --color-white: #c9d1d9;

    --slate-100: #e6edf3;
    --slate-200: #c9d1d9;
    --slate-300: #b1bac4;
    --slate-400: #8b949e;
    --slate-500: #6e7681;
    --slate-600: #484f58;
    --slate-700: #30363d;
    --slate-800: #21262d;
    --slate-900: #161b22;
    --slate-950: #010409;

    --indigo-400: #58a6ff;
    --indigo-500: #2f81f7;
    --indigo-600: #1f6feb;
    --emerald-400: #3fb950;
    --emerald-500: #2ea043;
    --emerald-600: #238636;
    --rose-400: #f85149;
    --rose-500: #da3633;
    --rose-600: #b62324;
    --amber-400: #d29922;
    --amber-500: #bf8700;
}

/* 3. GREEN DARK AMOLED */
[data-theme="green"] {
    --brand-dark: #0a110a;
    --color-white: #ffffff;

    --slate-100: #e6f9ed;
    --slate-200: #ccefdc;
    --slate-300: #a3e0c0;
    --slate-400: #6fcaa0;
    --slate-500: #48a980;
    --slate-600: #328662;
    --slate-700: #1a4230;
    --slate-800: #0f2b1d;
    --slate-900: #0b1a12;
    --slate-950: #050d08;

    --indigo-400: #4ade80;
    --indigo-500: #22c55e;
    --indigo-600: #16a34a;
    --emerald-400: #4ade80;
    --emerald-500: #22c55e;
    --emerald-600: #16a34a;
    --rose-400: #f87171;
    --rose-500: #ef4444;
    --rose-600: #dc2626;
    --amber-400: #fcd34d;
    --amber-500: #f59e0b;
}

/* 4. WHITE MODE AWISE (CSS INTERCEPTOR) 
   Aqui sequestramos as classes de background originais do Tailwind e forçamos o modo branco absoluto. */
[data-theme="white"] {
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-light: #6b7280;
}

[data-theme="white"] body,
[data-theme="white"] aside,
[data-theme="white"] nav.fixed,
[data-theme="white"] .bg-\[\#070d1e\],
[data-theme="white"] .bg-\[\#070d1e\]\/95,
[data-theme="white"] .bg-\[\#070d1e\]\/98,
[data-theme="white"] .bg-slate-950,
[data-theme="white"] .bg-slate-950\/40,
[data-theme="white"] .upgrade-modal-backdrop {
    background-color: var(--bg-main) !important;
    border-color: var(--border-color) !important;
}

[data-theme="white"] .glass-card,
[data-theme="white"] .glass-panel,
[data-theme="white"] .profile-menu-dropdown,
[data-theme="white"] .upgrade-modal-card,
[data-theme="white"] .bg-slate-900,
[data-theme="white"] .bg-slate-900\/80,
[data-theme="white"] .bg-slate-900\/60,
[data-theme="white"] .bg-slate-900\/90 {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="white"] .bg-slate-800,
[data-theme="white"] .bg-slate-800\/80 {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: var(--text-muted) !important;
}

[data-theme="white"] .border-slate-800,
[data-theme="white"] .border-slate-800\/80,
[data-theme="white"] .border-slate-800\/60,
[data-theme="white"] .border-slate-700,
[data-theme="white"] .border-slate-700\/50 {
    border-color: var(--border-color) !important;
}

[data-theme="white"] .text-white,
[data-theme="white"] .text-slate-100,
[data-theme="white"] .text-slate-200,
[data-theme="white"] .text-slate-300 {
    color: var(--text-main) !important;
}

[data-theme="white"] .text-slate-400 {
    color: var(--text-muted) !important;
}

[data-theme="white"] .text-slate-500 {
    color: var(--text-light) !important;
}

/* Proteção Estrita (Aways White) */
[data-theme="white"] .always-text-white {
    color: #ffffff !important;
}

[data-theme="white"] .always-text-slate-950 {
    color: #020617 !important;
}

/* Menus de Navegação Hover no White Mode */
[data-theme="white"] .nav-btn:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

[data-theme="white"] .profile-menu-item:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

/* ==========================================================================
   COMPORTAMENTO DO SIMULADOR (OPÇÕES A, B, C...) NO WHITE MODE AWISE
   ========================================================================== */
[data-theme="white"] .option-card {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="white"] .option-card:hover:not(.disabled) {
    background-color: #f8fafc !important;
    border-color: #6366f1 !important;
}

[data-theme="white"] .option-card span:first-child {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #4b5563 !important;
}

[data-theme="white"] .option-card.border-emerald-500\/80 {
    background-color: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

[data-theme="white"] .option-card.border-emerald-500\/80 span:first-child {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

[data-theme="white"] .option-card.border-rose-500\/80 {
    background-color: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

[data-theme="white"] .option-card.border-rose-500\/80 span:first-child {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

[data-theme="white"] .option-card.opacity-30 {
    opacity: 0.65 !important;
    background-color: #f9fafb !important;
    border-color: #e5e7eb !important;
    color: #9ca3af !important;
}

/* ==========================================================================
   QUESTÕES CONCURSOS — banco oficial (100% extraído de provas reais)
   ========================================================================== */

.badge-oficial {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
    border: 1px solid rgba(16, 185, 129, 0.35);
    white-space: nowrap;
}

.pasta-card {
    background: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.pasta-card:hover {
    border-color: var(--emerald-500);
}

.pasta-card:active {
    transform: scale(0.99);
}

.pasta-icone {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.pasta-titulo {
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--color-white);
}

.pasta-descricao {
    font-size: 0.6875rem;
    color: var(--slate-400);
}

.pasta-abrir {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--emerald-400);
}

.pasta-acoes {
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pasta-estudar-tudo {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--emerald-500), #2563eb);
    border: none;
    border-radius: 0.625rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}

.pasta-estudar-tudo:hover {
    filter: brightness(1.1);
}

.pasta-estudar-tudo:active {
    transform: scale(0.97);
}

/* Barra de metadados fixa de cada questão oficial — banca/órgão/ano/cargo,
   nunca escondida, muda a cada questão dentro da mesma sessão. */
.questao-oficial-meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.875rem;
    border-bottom: 1px dashed var(--slate-800);
}

.meta-linha-1 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: var(--slate-800);
    color: var(--slate-300, #cbd5e1);
    border: 1px solid var(--slate-800);
    white-space: nowrap;
}

.meta-linha-2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--slate-400);
}

.meta-separador {
    color: var(--slate-800);
}

.badge-anulada {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 0.6875rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
}

/* ===== PWA: faixas de aviso ===== */
.pwa-faixa { position: fixed; left: 50%; transform: translateX(-50%); z-index: 9000; width: max-content; max-width: calc(100vw - 24px); border-radius: 14px;
  font-size: 13px; font-weight: 600; padding: 10px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.45); display: flex; align-items: center; gap: 10px; }
.pwa-offline { top: calc(env(safe-area-inset-top, 0px) + 10px); background: #78350f; color: #fde68a; border: 1px solid #f59e0b; }
.pwa-atualizacao { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); background: #0f172a; color: #e2e8f0; border: 1px solid #6366f1; }
.pwa-atualizacao button { background: #6366f1; color: #fff; border: 0; border-radius: 10px; padding: 7px 14px; font: inherit; font-weight: 800; cursor: pointer; }

/* ===== Questões Concursos: lista de questões em quadradinhos ===== */
.qo-grade:not(.hidden) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem;
}

.qo-q-card {
    background: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: 1rem;
    padding: 0.875rem;
    min-height: 11.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    min-width: 0;
    transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.qo-q-card:hover, .qo-q-card:focus-visible {
    border-color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.05);
    outline: none;
}
.qo-q-card:active { transform: scale(0.985); }

.qo-q-topo { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; }
.qo-q-num {
    min-width: 1.5rem; height: 1.5rem; padding: 0 0.375rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 0.5rem; font-size: 0.6875rem; font-weight: 800;
    background: rgba(16, 185, 129, 0.15); color: var(--emerald-400);
}
.qo-q-previa {
    font-size: 0.75rem; line-height: 1.45; color: #e2e8f0;
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
    overflow: hidden; overflow-wrap: anywhere; flex: 0 0 auto;
}
.qo-q-origem {
    font-size: 0.625rem; color: var(--slate-400);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qo-q-responder {
    font-size: 0.6875rem; font-weight: 700; color: var(--emerald-400);
    display: inline-flex; align-items: center; gap: 0.375rem;
}
.qo-q-card:hover .qo-q-responder i { transform: translateX(3px); }
.qo-q-responder i { transition: transform 0.15s ease; }

/* 1º quadradinho: Estudar tudo */
.qo-q-estudar {
    justify-content: space-between;
    background: linear-gradient(135deg, #10b981, #059669 55%, #047857);
    border-color: rgba(52, 211, 153, 0.6);
    color: #fff;
}
.qo-q-estudar:hover, .qo-q-estudar:focus-visible {
    background: linear-gradient(135deg, #34d399, #10b981 55%, #059669);
    border-color: #6ee7b7;
}
.qo-q-estudar-icone {
    width: 2.5rem; height: 2.5rem; border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.2); display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.qo-q-estudar-titulo { font-size: 1.05rem; font-weight: 900; line-height: 1.2; }
.qo-q-estudar-sub { font-size: 0.6875rem; opacity: 0.9; margin-top: 0.125rem; }
.qo-q-estudar-seta {
    align-self: flex-end; width: 2.25rem; height: 2.25rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.25); display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease;
}
.qo-q-estudar:hover .qo-q-estudar-seta { transform: translateX(4px); }

@media (max-width: 640px) {
    .qo-grade:not(.hidden) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .qo-q-card { min-height: 10.5rem; padding: 0.75rem; }
    .qo-q-estudar { grid-column: 1 / -1; min-height: 6.5rem; flex-direction: row; align-items: center; }
    .qo-q-estudar-seta { align-self: center; }
}
@media (max-width: 340px) { .qo-grade:not(.hidden) { grid-template-columns: minmax(0, 1fr); } }

/* ===== Tema branco: pastas/quadrados em azul claro translúcido (vidro) ===== */
/* Pastas (matérias/assuntos) e quadrados de questão: fundo branco, só a borda é azul clara */
[data-theme="white"] .pasta-card {
    background: #ffffff;
    border: 1.5px solid rgba(125, 211, 252, 0.9);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
[data-theme="white"] .pasta-card:hover {
    background: #ffffff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14), 0 6px 16px rgba(14, 165, 233, 0.12);
}
[data-theme="white"] .pasta-icone {
    background: #e0f2fe;
    color: #0284c7;
}
[data-theme="white"] .pasta-titulo { color: #0f172a; }
[data-theme="white"] .pasta-descricao { color: #475569; }
[data-theme="white"] .pasta-abrir { color: #0369a1; }
[data-theme="white"] .qo-q-previa { color: #1e293b; }
[data-theme="white"] .qo-q-origem { color: #475569; }
[data-theme="white"] .qo-q-responder { color: #0369a1; }
/* Quadrado da questão: fundo branco, só a borda é azul claro */
[data-theme="white"] .qo-q-card:not(.qo-q-estudar) {
    background: #ffffff;
    border: 1.5px solid rgba(125, 211, 252, 0.9);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
[data-theme="white"] .qo-q-card:not(.qo-q-estudar):hover,
[data-theme="white"] .qo-q-card:not(.qo-q-estudar):focus-visible {
    background: #ffffff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14), 0 6px 16px rgba(14, 165, 233, 0.12);
}
[data-theme="white"] .qo-q-card:not(.qo-q-estudar) .meta-tag {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}
[data-theme="white"] .qo-q-num { background: #e0f2fe; color: #0369a1; }

/* Banca/órgão com nome longo não pode estourar o quadrado: a tag encolhe com reticências */
.qo-q-topo > * { min-width: 0; }
.qo-q-card .qo-q-topo .meta-tag {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}
.qo-q-card { overflow: hidden; }

/* A prévia mantém suas 5 linhas; sobra de altura vai para antes do rodapé */
.qo-q-origem, .qo-q-previa + .qo-q-responder { margin-top: auto; }

/* ==========================================================================
   RESPONSIVIDADE / ADAPTAÇÃO A TELAS (varredura de 10/10/2026)
   Regras de segurança para celulares (iPhone/Android), tablets e notebooks.
   ========================================================================== */

/* Nada passa da largura da tela; palavras longas quebram em vez de estourar */
html, body { max-width: 100%; overflow-x: hidden; overflow-wrap: break-word; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
.flex > *, .grid > * { min-width: 0; }

/* Navegadores sem unidade dvh (iOS < 15.4 etc.): usa vh */
@supports not (height: 100dvh) {
    .h-\[100dvh\] { height: 100vh; }
}

/* Campos com < 16px fazem o iPhone dar zoom ao tocar; em telas de toque ficam em 16px */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select, textarea {
        font-size: 16px !important;
    }
}

/* Barra de navegação inferior: altura automática + área segura (barra do iPhone),
   toque no botão inteiro (≥ 56px), rótulo legível sem estourar */
.bottom-nav-app {
    height: auto !important;
    min-height: calc(4rem + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    align-items: stretch !important;
    background-color: #070d1e;
}
.bottom-nav-app > button {
    min-width: 0;
    min-height: 3.5rem;
    padding: 0.25rem 0.125rem;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-app > button span {
    font-size: 0.65rem !important;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bottom-nav-app > button i { font-size: 1.05rem; }
[data-theme="white"] .bottom-nav-app { background-color: rgba(255, 255, 255, 0.98); }

/* Conteúdo nunca fica escondido atrás da barra inferior */
@media (max-width: 767px) {
    section[id^="tab-"] { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important; }
    /* textos de 9–10 px viram 10,5–11 px no celular */
    .text-\[9px\] { font-size: 10.5px !important; }
    .text-\[10px\] { font-size: 11px !important; }
    .badge-oficial { font-size: 10px; }
}

/* Alvos de toque: botões de ícone e controles pequenos chegam a ≥ 40–44 px */
@media (pointer: coarse) {
    #btn-profile-trigger { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    #qo-btn-back, #fc-btn-back { min-width: 44px; min-height: 44px; }
    #btn-calendario { min-height: 40px; white-space: nowrap; }
    #btn-period-daily, #btn-period-weekly, #btn-period-monthly { min-height: 36px; min-width: 44px; }
    .profile-menu-item { min-height: 44px; }
    button.p-1, button.p-1\.5 { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
}
#btn-calendario, #current-date { white-space: nowrap; }

/* Linhas de botões podem quebrar para a linha de baixo em telas estreitas */
.acoes-wrap { flex-wrap: wrap; }
.nav-matriz-topo { flex-wrap: wrap; gap: 0.25rem 0.5rem; }
#qo-nav-matrix-label { white-space: nowrap; }

/* Telas muito estreitas (Galaxy Z Fold fechado 280 px, iPhone SE antigo 320 px) */
@media (max-width: 340px) {
    #current-date { display: none; }
    header .font-black.text-base { font-size: 0.95rem; letter-spacing: 0.02em; }
    section[id^="tab-"] { padding-left: 0.5rem; padding-right: 0.5rem; }
    .upgrade-modal-card { padding: 16px; border-radius: 18px; }
}

/* Celular deitado (pouca altura): barra e cabeçalho mais baixos, conteúdo ganha espaço */
@media (max-height: 500px) and (orientation: landscape) {
    header.h-14 { height: 2.75rem; }
    .bottom-nav-app { min-height: calc(2.75rem + env(safe-area-inset-bottom, 0px)); }
    .bottom-nav-app > button { min-height: 2.75rem; flex-direction: row; gap: 0.375rem; }
    .bottom-nav-app > button i { margin-bottom: 0; }
    section[id^="tab-"] { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Telas muito grandes (QHD/4K): o conteúdo não estica indefinidamente */
@media (min-width: 1800px) {
    section[id^="tab-"] > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
}

/* Telas largas e baixas (notebook 1366x768): rótulos não se sobrepõem */
@media (min-width: 1024px) and (max-width: 1400px) {
    #qo-nav-matrix-label { font-size: 10.5px; }
}

/* Sessão de questões em telas intermediárias (1024–1439px): o app já usa uma lateral larga,
   então o Navegador some e o conteúdo ocupa toda a largura útil */
@media (min-width:1024px) and (max-width:1439px){
  #tab-questoes-oficiais-sessao .lg\:grid-cols-4{grid-template-columns:minmax(0,1fr)!important}
  #tab-questoes-oficiais-sessao .lg\:col-span-3{grid-column:auto!important;min-width:0}
  #tab-questoes-oficiais-sessao .lg\:col-span-1{display:none!important}
  #tab-questoes-oficiais-sessao button{flex-shrink:0}
}
/* Botões de ícone: nunca encolher e alvo de toque mínimo */
@media (pointer:coarse){
  button.w-8.h-8,button.w-9.h-9,button.p-1,button.p-1\.5{min-width:40px;min-height:40px;flex-shrink:0}
  .badge-oficial,#menu-user-plan{font-size:10.5px!important}
}

/* Acabamento final: badges mínimos de 10px e alvos de toque confortáveis */
.text-\[9px\],.badge-oficial,#menu-user-plan{font-size:10px!important}
@media (max-width:1279px){
  #btn-profile-trigger,#btn-calendario,#qo-btn-back,
  #btn-period-daily,#btn-period-weekly,#btn-period-monthly,
  #btn-theme-classic,#btn-theme-heartbeat,#btn-theme-stock,
  button.hover\:text-rose-400,button.h-7.rounded-lg,
  button.w-8.h-8,button.w-9.h-9,button.p-2.rounded-xl{min-height:40px;min-width:40px;flex-shrink:0}
  #btn-period-daily,#btn-period-weekly,#btn-period-monthly,
}
@media (max-width:1279px){
  #btn-theme-classic,#btn-theme-heartbeat,#btn-theme-stock{min-width:40px!important;flex-shrink:1!important;padding-left:.5rem;padding-right:.5rem}
  #btn-theme-classic,#btn-theme-heartbeat,#btn-theme-stock{font-size:10px!important}
  #btn-theme-classic{flex-shrink:1}
  :has(>#btn-theme-classic){flex-wrap:wrap;max-width:100%}
}

/* Cabeçalhos com muitos controles: quebram linha em vez de estourar a largura */
@media (min-width:768px) and (max-width:1439px){
  #tab-questoes-oficiais-sessao > .glass-panel{flex-wrap:wrap;row-gap:.5rem}
  #tab-questoes-oficiais-sessao > .glass-panel > *{min-width:0;max-width:100%}
  #tab-metricas .sm\:flex-row{flex-wrap:wrap}
}

/* ===== Rascunho (prancheta de Matemática) ===== */
.rascunho-btn.tem-rascunho::after{content:"";width:7px;height:7px;border-radius:50%;background:#34d399;margin-left:2px}
body.rascunho-aberto{overflow:hidden}
.rascunho-modal{position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;background:#0f172a;
  padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.rascunho-modal[hidden]{display:none}
.rascunho-topo{display:flex;align-items:center;gap:10px;padding:8px 12px;color:#e2e8f0;flex:0 0 auto}
.rascunho-titulo{font-size:14px;display:flex;align-items:center;gap:8px;white-space:nowrap}
.rascunho-dica{font-size:11px;color:#94a3b8;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rascunho-fechar{width:44px;height:44px;border-radius:12px;background:#1e293b;color:#e2e8f0;border:1px solid #334155;flex:0 0 auto;margin-left:auto}
.rascunho-area{position:relative;flex:1 1 auto;min-height:0;margin:0 8px;border-radius:14px;overflow:hidden;background:#fff;
  box-shadow:0 0 0 1px #334155;touch-action:none}
.rascunho-area.com-grade{background-color:#fff;background-image:linear-gradient(#e5e7eb 1px,transparent 1px),linear-gradient(90deg,#e5e7eb 1px,transparent 1px);background-size:28px 28px}
.rascunho-canvas{position:absolute;inset:0;touch-action:none;cursor:crosshair;-webkit-user-select:none;user-select:none}
.rascunho-barra{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;padding:8px 8px 10px;flex:0 0 auto}
.rascunho-barra button{width:44px;height:44px;border-radius:12px;background:#1e293b;color:#cbd5e1;border:1px solid #334155;display:flex;align-items:center;justify-content:center;font-size:15px}
.rascunho-barra button.on{background:#4f46e5;border-color:#818cf8;color:#fff}
.rascunho-barra .cor{background:var(--c)}
.rascunho-barra .cor.on{box-shadow:0 0 0 3px #818cf8;background:var(--c)}
.rascunho-barra .sep{width:1px;height:26px;background:#334155;margin:0 2px}
.rascunho-bola{display:block;width:var(--d);height:var(--d);border-radius:50%;background:currentColor}
@media (max-width:420px){.rascunho-barra{gap:4px}.rascunho-barra button{width:40px;height:40px}.rascunho-dica{display:none}}
@media (max-height:480px) and (orientation:landscape){.rascunho-topo{padding:4px 12px}.rascunho-barra{padding:4px 8px}}
[data-theme="white"] .rascunho-modal{background:#e2e8f0}
[data-theme="white"] .rascunho-topo{color:#0f172a}
[data-theme="white"] .rascunho-dica{color:#475569}
[data-theme="white"] .rascunho-fechar,[data-theme="white"] .rascunho-barra button{background:#fff;color:#334155;border-color:#cbd5e1}
[data-theme="white"] .rascunho-barra button.on{background:#4f46e5;color:#fff;border-color:#4f46e5}
[data-theme="white"] .rascunho-barra .cor,[data-theme="white"] .rascunho-barra .cor.on{background:var(--c)}
.rascunho-btn{background:rgba(14,165,233,.12)!important;color:#7dd3fc!important;border:1px solid rgba(14,165,233,.4)!important;border-radius:12px;min-height:36px;white-space:nowrap}
.rascunho-btn:hover{background:rgba(14,165,233,.22)!important}
[data-theme="white"] .rascunho-btn{background:#e0f2fe!important;color:#0369a1!important;border-color:#7dd3fc!important}

/* ===== Editais verticalizados ===== */
.ed-raiz{max-width:960px;margin:0 auto;display:flex;flex-direction:column;gap:14px;color:#e2e8f0}
.ed-topo{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.ed-titulo-bloco{min-width:0;flex:1 1 240px}
.ed-h2{font-size:1.15rem;font-weight:800;color:#fff;display:flex;align-items:center;gap:8px;overflow-wrap:anywhere}
.ed-sub{font-size:.8rem;color:#94a3b8;margin-top:2px;overflow-wrap:anywhere}
.ed-acoes{display:flex;flex-wrap:wrap;gap:8px}
.ed-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:8px 14px;border-radius:12px;background:#1e293b;color:#e2e8f0;border:1px solid #334155;font-size:.8rem;font-weight:700;cursor:pointer}
.ed-btn:hover{border-color:#818cf8}
.ed-btn-forte{background:#4f46e5;border-color:#4f46e5;color:#fff}
.ed-btn-perigo{color:#fda4af;border-color:rgba(244,63,94,.4)}
.ed-btn-mini{min-height:36px;padding:6px 10px;font-size:.75rem;align-self:flex-start}
.ed-busca,.ed-input,.ed-textarea{width:100%;background:#0f172a;border:1px solid #334155;border-radius:12px;color:#e2e8f0;padding:10px 12px;font-size:16px;font-family:inherit}
.ed-textarea{resize:vertical;line-height:1.45;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px}
.ed-busca:focus,.ed-input:focus,.ed-textarea:focus{outline:none;border-color:#818cf8}
.ed-grade{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:12px}
.ed-card{display:flex;gap:12px;align-items:flex-start;text-align:left;background:#0f172a;border:1.5px solid #272c4a;border-radius:16px;padding:14px;color:inherit;cursor:pointer;min-width:0}
.ed-card:hover{border-color:#818cf8}
.ed-card-icone{width:42px;height:42px;border-radius:12px;background:rgba(99,102,241,.18);color:#a5b4fc;display:flex;align-items:center;justify-content:center;flex:0 0 auto;font-size:1.1rem}
.ed-card-corpo{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.ed-card-titulo{color:#fff;font-size:.9rem;line-height:1.3;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.ed-card-linha{font-size:.75rem;color:#94a3b8;overflow-wrap:anywhere}
.ed-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.ed-chip{font-size:.68rem;font-weight:700;padding:3px 9px;border-radius:99px;background:#1e293b;color:#cbd5e1;border:1px solid #334155;text-decoration:none}
.ed-chip-rascunho{color:#fbbf24;border-color:rgba(251,191,36,.4);background:rgba(251,191,36,.1)}
.ed-chip-link{color:#7dd3fc;border-color:rgba(14,165,233,.4)}
.ed-vazio{text-align:center;color:#94a3b8;padding:36px 10px;grid-column:1/-1}
.ed-cabecalho{display:flex;flex-direction:column;gap:8px}
.ed-cargos{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}
.ed-cargo{flex:0 0 auto;max-width:80vw;min-height:40px;padding:8px 14px;border-radius:99px;background:#1e293b;color:#cbd5e1;border:1px solid #334155;font-size:.78rem;font-weight:700;cursor:pointer;text-align:left}
.ed-cargo small{opacity:.7;font-weight:600}
.ed-cargo.on{background:#4f46e5;border-color:#4f46e5;color:#fff}
.ed-progresso{display:flex;flex-direction:column;gap:6px}
.ed-progresso span{font-size:.75rem;color:#94a3b8}
.ed-barra{height:8px;background:#1e293b;border-radius:99px;overflow:hidden}
.ed-barra i{display:block;height:100%;width:0;background:linear-gradient(90deg,#10b981,#34d399);border-radius:99px;transition:width .3s}
.ed-discs{display:flex;flex-direction:column;gap:10px}
.ed-disc{background:#0f172a;border:1px solid #272c4a;border-radius:16px;overflow:hidden}
.ed-disc-sum{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px;cursor:pointer;list-style:none;min-height:48px}
.ed-disc-sum::-webkit-details-marker{display:none}
.ed-disc-nome{display:flex;flex-direction:column;min-width:0}
.ed-disc-nome strong{color:#fff;font-size:.9rem;overflow-wrap:anywhere}
.ed-disc-nome small{color:#94a3b8;font-size:.68rem}
.ed-disc-cont{font-size:.75rem;font-weight:800;color:#34d399;white-space:nowrap}
.ed-arvore{list-style:none;margin:0;padding:0 14px 10px}
.ed-arvore .ed-arvore{padding:0 0 0 18px;border-left:2px solid #272c4a;margin-left:9px}
.ed-topico-linha{display:flex;gap:10px;align-items:flex-start;padding:7px 0;cursor:pointer}
.ed-cb{width:20px;height:20px;margin-top:2px;flex:0 0 auto;accent-color:#10b981}
.ed-topico-txt{font-size:.85rem;line-height:1.45;overflow-wrap:anywhere;color:#e2e8f0}
.ed-topico.feito>.ed-topico-linha .ed-topico-txt{color:#64748b;text-decoration:line-through}
.ed-envio{display:flex;flex-direction:column;gap:10px}
.ed-arquivo{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}
.ed-arquivo-rotulo{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;border:2px dashed #475569;border-radius:16px;color:#cbd5e1;font-weight:700;cursor:pointer}
.ed-arquivo:focus-visible+.ed-status,.ed-arquivo-rotulo:hover{border-color:#818cf8}
.ed-status{font-size:.8rem;color:#fbbf24;min-height:1.2em;overflow-wrap:anywhere}
.ed-aviso{font-size:.78rem;color:#94a3b8;background:#0f172a;border:1px solid #272c4a;border-radius:12px;padding:10px 12px}
.ed-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:10px}
.ed-campo{display:flex;flex-direction:column;gap:4px;font-size:.72rem;color:#94a3b8;font-weight:700}
.ed-blocos{display:flex;flex-direction:column;gap:14px}
.ed-cargo-caixa{border:1px solid #334155;border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:10px}
.ed-cargo-topo{display:flex;gap:8px;flex-wrap:wrap}
.ed-cargo-topo .ed-input{flex:1 1 220px;font-weight:700}
.ed-discs-edit{display:flex;flex-direction:column;gap:12px}
.ed-disc-edit{display:flex;flex-direction:column;gap:8px;background:#0b1220;border-radius:12px;padding:10px}
.ed-rodape{position:sticky;bottom:0;display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end;padding:10px 0;background:linear-gradient(transparent,#0b0d17 40%)}
.ed-toast{position:fixed;left:50%;bottom:calc(5.5rem + env(safe-area-inset-bottom));transform:translate(-50%,20px);max-width:min(92vw,520px);background:#1e293b;color:#fff;border:1px solid #475569;border-radius:12px;padding:10px 14px;font-size:.82rem;opacity:0;pointer-events:none;transition:.2s;z-index:9998}
.ed-toast.on{opacity:1;transform:translate(-50%,0)}
[data-theme="white"] .ed-raiz{color:#0f172a}
[data-theme="white"] .ed-h2,[data-theme="white"] .ed-card-titulo,[data-theme="white"] .ed-disc-nome strong{color:#0f172a}
[data-theme="white"] .ed-card,[data-theme="white"] .ed-disc,[data-theme="white"] .ed-aviso,[data-theme="white"] .ed-disc-edit{background:#fff;border:1.5px solid rgba(125,211,252,.9)}
[data-theme="white"] .ed-btn,[data-theme="white"] .ed-chip,[data-theme="white"] .ed-cargo{background:#f1f5f9;color:#334155;border-color:#cbd5e1}
[data-theme="white"] .ed-btn-forte,[data-theme="white"] .ed-cargo.on{background:#4f46e5;color:#fff;border-color:#4f46e5}
[data-theme="white"] .ed-busca,[data-theme="white"] .ed-input,[data-theme="white"] .ed-textarea{background:#fff;color:#0f172a;border-color:#cbd5e1}
[data-theme="white"] .ed-topico-txt{color:#1e293b}
[data-theme="white"] .ed-sub,[data-theme="white"] .ed-card-linha{color:#475569}
[data-theme="white"] .ed-card-icone{background:#e0f2fe;color:#0284c7}
[data-theme="white"] .ed-rodape{background:linear-gradient(transparent,#fff 40%)}
[data-theme="white"] .ed-barra{background:#e2e8f0}
[data-theme="white"] .ed-arvore .ed-arvore{border-left-color:#bae6fd}
[data-theme="white"] .ed-topico.feito>.ed-topico-linha .ed-topico-txt{color:#94a3b8}
[data-theme="white"] .ed-arquivo-rotulo{color:#334155;border-color:#94a3b8}
[data-theme="white"] .ed-toast{background:#0f172a}

.ed-cota{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:.8rem;font-weight:700;color:#cbd5e1;background:#0f172a;border:1px solid #272c4a;border-radius:12px;padding:8px 12px}
.ed-card-wrap{display:flex;flex-direction:column;gap:6px;min-width:0}
.ed-card-wrap .ed-card{width:100%}
.ed-card-ativo{border-color:#10b981}
.ed-chip-ativo{color:#34d399;border-color:rgba(16,185,129,.45);background:rgba(16,185,129,.12)}
.ed-desativar,.ed-ativar-dica{align-self:flex-end;font-size:.72rem;font-weight:700;color:#94a3b8;background:none;border:0;padding:4px 6px;min-height:32px}
.ed-desativar{cursor:pointer;text-decoration:underline}
[data-theme="white"] .ed-cota{background:#fff;color:#334155;border-color:rgba(125,211,252,.9)}
[data-theme="white"] .ed-card-ativo{border-color:#10b981}

.ed-desativar.ed-travado{opacity:.65;text-decoration:none}

.ed-extra{display:flex;flex-direction:column;gap:10px;border-top:1px dashed #334155;padding-top:12px}
[data-theme="white"] .ed-extra{border-top-color:#94a3b8}

.ed-selecao{display:flex;flex-direction:column;gap:8px}
.ed-sel-item{display:flex;gap:12px;align-items:flex-start;background:#0f172a;border:1px solid #272c4a;border-radius:12px;padding:10px 12px;cursor:pointer;min-height:48px}
.ed-sel-txt{display:flex;flex-direction:column;min-width:0}
.ed-sel-txt strong{color:#fff;font-size:.85rem;overflow-wrap:anywhere}
.ed-sel-txt small{color:#94a3b8;font-size:.7rem}
[data-theme="white"] .ed-sel-item{background:#fff;border:1.5px solid rgba(125,211,252,.9)}
[data-theme="white"] .ed-sel-txt strong{color:#0f172a}

.ed-sel-comuns{border-color:#6366f1;background:rgba(99,102,241,.1)}
.ed-rodape-col{flex-direction:column;align-items:stretch}
.ed-rodape-col .ed-btn{width:100%}

/* ===== Editais: apresentação minimalista (blocos por edital + quadradinhos simétricos) ===== */
.ed-raiz{gap:18px}
.ed-grade.ed-grade-grupos{display:flex;flex-direction:column;gap:28px}
.ed-grupo{display:flex;flex-direction:column;gap:12px}
.ed-grupo-cab{display:grid;grid-template-columns:1fr auto;column-gap:12px;row-gap:2px;align-items:baseline;padding:0 2px 10px;border-bottom:1px solid #1e2440}
.ed-grupo-titulo{grid-column:1;font-size:.95rem;font-weight:800;color:#fff;line-height:1.3;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ed-grupo-meta{grid-column:1;font-size:.74rem;color:#8b93b5}
.ed-grupo-qtd{grid-column:2;grid-row:1;font-size:.72rem;font-weight:700;color:#8b93b5;white-space:nowrap}
.ed-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:12px}
.ed-tile.ed-card-wrap{display:flex;flex-direction:column;justify-content:space-between;gap:0;min-height:108px;background:#0f1220;border:1px solid #232846;border-radius:16px;padding:0;min-width:0;transition:border-color .15s,background .15s}
.ed-tile.ed-card-wrap:hover{border-color:#6366f1;background:#121630}
.ed-tile.ativo{border-color:rgba(16,185,129,.55)}
.ed-tile .ed-card{display:block;flex:1;width:100%;background:none;border:0;border-radius:16px 16px 0 0;padding:16px 16px 6px;text-align:left;color:inherit;cursor:pointer}
.ed-tile .ed-card-titulo{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.95rem;font-weight:700;line-height:1.3;color:#fff;overflow-wrap:anywhere}
.ed-tile-pe{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 16px 12px;min-height:34px}
.ed-estado{font-size:.7rem;font-weight:700;letter-spacing:.02em;color:#7c85ad;display:inline-flex;align-items:center;gap:6px}
.ed-estado-ativo{color:#34d399}
.ed-estado-ativo i{width:7px;height:7px;border-radius:50%;background:#34d399;display:inline-block}
.ed-estado-rascunho{color:#fbbf24}
.ed-tile .ed-desativar{align-self:auto;min-height:32px;padding:4px 0;font-size:.7rem;color:#7c85ad}
[data-theme="white"] .ed-grupo-cab{border-bottom-color:#e2e8f0}
[data-theme="white"] .ed-grupo-titulo,[data-theme="white"] .ed-tile .ed-card-titulo{color:#0f172a}
[data-theme="white"] .ed-grupo-meta,[data-theme="white"] .ed-grupo-qtd,[data-theme="white"] .ed-estado,[data-theme="white"] .ed-tile .ed-desativar{color:#64748b}
[data-theme="white"] .ed-estado-ativo{color:#059669}
[data-theme="white"] .ed-tile.ed-card-wrap{background:#fff;border:1.5px solid rgba(125,211,252,.9)}
[data-theme="white"] .ed-tile.ed-card-wrap:hover{background:#fff;border-color:#0ea5e9}
[data-theme="white"] .ed-tile.ativo{border-color:#10b981}
@media (max-width:480px){.ed-tiles{grid-template-columns:1fr 1fr;gap:10px}.ed-tile.ed-card-wrap{min-height:100px}.ed-tile .ed-card{padding:14px 12px 4px}.ed-tile-pe{padding:0 12px 10px}.ed-tile .ed-card-titulo{font-size:.85rem}}
@media (max-width:340px){.ed-tiles{grid-template-columns:1fr}}

/* ===== Barra inferior (celular) e menu com todas as funções ===== */
.bottom-nav-app{justify-content:space-between!important;gap:2px;padding-left:6px!important;padding-right:6px!important}
.bottom-nav-app .mn-item{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:3.5rem;padding:6px 2px;color:#8b93b5;border-radius:14px;background:none;border:0;cursor:pointer;transition:color .15s,background .15s,transform .1s}
.bottom-nav-app .mn-item i{font-size:1.05rem;line-height:1}
.bottom-nav-app .mn-item span{font-size:.65rem;font-weight:700;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bottom-nav-app .mn-item:active{transform:scale(.94)}
.bottom-nav-app .mn-item.text-indigo-400{color:#818cf8}
.bottom-nav-app .mn-home{flex:1.15 1 0}
.bottom-nav-app .mn-home i{font-size:1.2rem}
.bottom-nav-app .mn-home.text-indigo-400{background:rgba(99,102,241,.14)}
.bottom-nav-app .mn-menu{flex:0 0 3.4rem}
body.mn-aberto{overflow:hidden}
.mn-sheet{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end}
.mn-sheet[hidden]{display:none}
.mn-sheet-fundo{position:absolute;inset:0;background:rgba(2,6,23,.6);backdrop-filter:blur(3px);opacity:0;transition:opacity .18s}
.mn-sheet-painel{position:relative;width:100%;max-height:86dvh;display:flex;flex-direction:column;background:#0b1020;border-top:1px solid #272c4a;border-radius:22px 22px 0 0;padding-bottom:calc(14px + env(safe-area-inset-bottom));transform:translateY(24px);opacity:0;transition:transform .18s,opacity .18s}
.mn-sheet.on .mn-sheet-fundo{opacity:1}
.mn-sheet.on .mn-sheet-painel{transform:none;opacity:1}
.mn-sheet-topo{display:flex;align-items:center;justify-content:space-between;padding:16px 18px 8px;color:#fff;font-size:.95rem}
.mn-sheet-fechar{width:44px;height:44px;border-radius:12px;background:#151a30;border:1px solid #272c4a;color:#cbd5e1}
.mn-sheet-lista{overflow-y:auto;padding:4px 12px;display:flex;flex-direction:column;gap:2px;-webkit-overflow-scrolling:touch}
.mn-linha{display:flex;align-items:center;gap:14px;min-height:52px;padding:8px 10px;border-radius:14px;background:none;border:0;color:#e2e8f0;font-size:.9rem;font-weight:600;text-align:left;width:100%}
.mn-linha i{width:24px;text-align:center;font-size:1.05rem;flex:0 0 auto}
.mn-linha:active{background:#151a30}
.mn-sheet-extra{display:flex;gap:8px;padding:10px 12px 0;border-top:1px solid #1b2038;margin-top:6px}
.mn-mini{flex:1;min-height:44px;border-radius:12px;background:#151a30;border:1px solid #272c4a;color:#cbd5e1;font-size:.78rem;font-weight:700;display:flex;align-items:center;justify-content:center;gap:6px}
.mn-atalhos{display:flex;flex-direction:column;gap:10px}
.mn-atalhos-titulo{font-size:.7rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#7c85ad;padding:0 2px}
.mn-grade{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.mn-quad{aspect-ratio:1/0.92;min-height:84px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:#0f1220;border:1px solid #232846;border-radius:16px;color:#e2e8f0;padding:8px;transition:border-color .15s,transform .1s}
.mn-quad i{font-size:1.25rem}
.mn-quad span{font-size:.72rem;font-weight:700;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mn-quad:active{transform:scale(.96);border-color:#6366f1}
@media (max-width:340px){.mn-grade{gap:8px}.bottom-nav-app .mn-item span{font-size:.6rem}}
@media (max-height:480px) and (orientation:landscape){.mn-quad{aspect-ratio:auto;min-height:64px}}
[data-theme="white"] .mn-sheet-painel{background:#fff;border-top-color:#e2e8f0}
[data-theme="white"] .mn-sheet-topo{color:#0f172a}
[data-theme="white"] .mn-sheet-fechar,[data-theme="white"] .mn-mini{background:#f1f5f9;border-color:#cbd5e1;color:#334155}
[data-theme="white"] .mn-linha{color:#0f172a}
[data-theme="white"] .mn-linha:active{background:#f1f5f9}
[data-theme="white"] .mn-quad{background:#fff;border:1.5px solid rgba(125,211,252,.9);color:#0f172a}
[data-theme="white"] .mn-atalhos-titulo{color:#64748b}
[data-theme="white"] .bottom-nav-app .mn-item{color:#64748b}
[data-theme="white"] .bottom-nav-app .mn-item.text-indigo-400{color:#4f46e5}
[data-theme="white"] .mn-sheet-extra{border-top-color:#e2e8f0}

/* ===== Editais: tela do cargo (minimalista) ===== */
.ed-topo-det{align-items:center}
.ed-topo-det .ed-btn{background:none;border-color:transparent;color:#8b93b5;padding-left:6px}
.ed-ic{width:42px;height:42px;border-radius:12px;background:#0f1220;border:1px solid #232846;color:#cbd5e1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.ed-ic:hover{border-color:#6366f1}
.ed-ic-perigo{color:#fda4af}
.ed-det-cab{display:flex;flex-direction:column;gap:6px;padding:4px 2px 2px}
.ed-det-edital{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#7c85ad;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ed-det-titulo{font-size:1.4rem;font-weight:800;color:#fff;line-height:1.2;overflow-wrap:anywhere}
.ed-det-meta{font-size:.8rem;color:#8b93b5}
.ed-det-extra{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:2px}
.ed-det-link{font-size:.78rem;font-weight:700;color:#7dd3fc;text-decoration:none}
.ed-prog-cartao{background:#0f1220;border:1px solid #232846;border-radius:16px;padding:14px 16px;gap:8px}
.ed-prog-linha{display:flex;justify-content:space-between;align-items:baseline}
.ed-prog-rotulo{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#7c85ad}
.ed-prog-pct{font-size:1.1rem;font-weight:800;color:#34d399}
.ed-prog-txt{font-size:.75rem;color:#8b93b5}
.ed-lista-topo{display:flex;justify-content:flex-end}
.ed-linkbtn{background:none;border:0;color:#8b93b5;font-size:.75rem;font-weight:700;padding:6px 2px;min-height:36px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.ed-secao{font-size:.68rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#7c85ad;padding:10px 2px 2px}
.ed-discs{gap:10px}
.ed-disc{background:#0f1220;border:1px solid #232846;border-radius:16px}
.ed-disc[open]{border-color:#2f3560}
.ed-disc-sum{padding:14px 16px;min-height:52px}
.ed-disc-dir{display:inline-flex;align-items:center;gap:12px;flex:0 0 auto}
.ed-chev{font-size:.7rem;color:#7c85ad;transition:transform .15s}
.ed-disc[open] .ed-chev{transform:rotate(180deg)}
.ed-arvore{padding:0 16px 12px}
.ed-topico-txt{font-size:.88rem;line-height:1.5}
.ed-cb{width:22px;height:22px}
.ed-cargos{padding-bottom:2px}
@media (max-width:480px){.ed-det-titulo{font-size:1.2rem}.ed-disc-sum{padding:12px 14px}.ed-arvore{padding:0 12px 10px}}
[data-theme="white"] .ed-topo-det .ed-btn{color:#475569}
[data-theme="white"] .ed-ic{background:#fff;border-color:#cbd5e1;color:#334155}
[data-theme="white"] .ed-det-titulo{color:#0f172a}
[data-theme="white"] .ed-det-edital,[data-theme="white"] .ed-det-meta,[data-theme="white"] .ed-prog-rotulo,[data-theme="white"] .ed-prog-txt,[data-theme="white"] .ed-secao,[data-theme="white"] .ed-linkbtn,[data-theme="white"] .ed-chev{color:#64748b}
[data-theme="white"] .ed-prog-cartao,[data-theme="white"] .ed-disc{background:#fff;border:1.5px solid rgba(125,211,252,.9)}
[data-theme="white"] .ed-disc[open]{border-color:#0ea5e9}
[data-theme="white"] .ed-prog-pct{color:#059669}

/* ===== Certo / Errado (CEBRASPE) ===== */
.qo-comando{font-size:.78rem;line-height:1.5;color:#94a3b8;font-weight:500;margin-bottom:8px;white-space:pre-line}
.qo-comando.hidden{display:none}
.qo-ce{display:flex;flex-direction:column;gap:10px;list-style:none;padding:0}
.qo-ce-botoes{display:grid;grid-template-columns:1fr 1fr;gap:10px;list-style:none}
.qo-ce-btn{min-height:64px;border-radius:16px;border:1.5px solid #334155;background:#0f172a;color:#e2e8f0;font-size:1rem;font-weight:800;letter-spacing:.06em;display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;transition:transform .1s,border-color .15s,background .15s}
.qo-ce-btn:active:not(:disabled){transform:scale(.97)}
.qo-ce-certo:hover:not(:disabled){border-color:#10b981;background:rgba(16,185,129,.1)}
.qo-ce-errado:hover:not(:disabled){border-color:#f43f5e;background:rgba(244,63,94,.1)}
.qo-ce-btn.ok{border-color:#10b981;background:rgba(16,185,129,.18);color:#6ee7b7}
.qo-ce-btn.erro{border-color:#f43f5e;background:rgba(244,63,94,.18);color:#fda4af}
.qo-ce-btn.marcado{border-color:#818cf8;background:rgba(99,102,241,.18);color:#c7d2fe}
.qo-ce-btn.apagado{opacity:.35}
.qo-ce-btn:disabled{cursor:default}
.qo-ce-branco-linha{list-style:none;display:flex}
.qo-ce-branco{width:100%;min-height:44px;border-radius:12px;background:none;border:1px dashed #475569;color:#94a3b8;font-size:.8rem;font-weight:700;cursor:pointer}
.qo-ce-branco:hover:not(:disabled){border-color:#fbbf24;color:#fbbf24}
.qo-ce-branco.on{border-style:solid;border-color:rgba(251,191,36,.5);color:#fbbf24;cursor:default}
.qo-ce-resultado{margin-top:12px;padding:12px 14px;border-radius:12px;font-size:.85rem;font-weight:700;background:#0f172a;border:1px solid #334155;color:#e2e8f0}
.qo-ce-resultado.acerto{background:rgba(16,185,129,.12);border-color:rgba(16,185,129,.5);color:#6ee7b7}
.qo-ce-resultado.erro{background:rgba(244,63,94,.12);border-color:rgba(244,63,94,.5);color:#fda4af}
.qo-ce-resultado.hidden,.qo-tag-alterado.hidden{display:none}
.qo-tag-alterado{margin-top:8px;display:inline-block;padding:6px 10px;border-radius:99px;font-size:.72rem;font-weight:700;color:#fbbf24;background:rgba(245,158,11,.12);border:1px solid rgba(245,158,11,.4)}
.qo-ce-resumo{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 10px;padding:10px 12px;border-radius:14px;background:#0f172a;border:1px solid #272c4a;font-size:.78rem;color:#cbd5e1}
.qo-ce-resumo.hidden{display:none}
.qo-ce-chip{padding:4px 10px;border-radius:99px;background:#151a30;border:1px solid #272c4a}
.qo-ce-chip strong{color:#fff}
.qo-ce-chip.ac strong{color:#34d399}.qo-ce-chip.er strong{color:#fb7185}.qo-ce-chip.br strong{color:#fbbf24}.qo-ce-chip.nt strong{color:#a5b4fc}
.qo-ce-nota-txt{flex:1 1 100%;color:#7c85ad;font-size:.7rem}
@media (max-width:480px){.qo-ce-btn{min-height:72px;font-size:1.05rem}}
.dsc-modal{position:fixed;inset:0;z-index:9990;background:rgba(2,6,23,.75);backdrop-filter:blur(3px);display:flex;align-items:flex-end;justify-content:center}
.dsc-painel{width:100%;max-width:760px;max-height:92dvh;display:flex;flex-direction:column;background:#0b1020;border:1px solid #272c4a;border-radius:22px 22px 0 0;color:#e2e8f0;padding-bottom:env(safe-area-inset-bottom)}
@media (min-width:768px){.dsc-modal{align-items:center}.dsc-painel{border-radius:22px}}
.dsc-topo{display:flex;justify-content:space-between;align-items:center;padding:16px 18px 8px;font-size:.95rem}
.dsc-fechar{width:44px;height:44px;border-radius:12px;background:#151a30;border:1px solid #272c4a;color:#cbd5e1}
.dsc-corpo{overflow-y:auto;padding:4px 18px 18px;display:flex;flex-direction:column;gap:16px}
.dsc-item{display:flex;flex-direction:column;gap:10px}
.dsc-item h4{font-size:.8rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#7c85ad}
.dsc-enunciado{font-size:.85rem;line-height:1.6;white-space:pre-line;color:#cbd5e1}
.dsc-perguntas{padding-left:18px;font-size:.85rem;line-height:1.5;color:#e2e8f0}
.dsc-criterios{font-size:.78rem;color:#94a3b8}.dsc-criterios summary{cursor:pointer;font-weight:700;min-height:36px;display:flex;align-items:center}
.dsc-criterios p{white-space:pre-line;line-height:1.55;padding:6px 0}
.dsc-area{width:100%;background:#0f172a;border:1px solid #334155;border-radius:12px;color:#e2e8f0;padding:12px;font-size:16px;line-height:1.5}
.dsc-btn{min-height:44px;border-radius:12px;background:rgba(99,102,241,.16);border:1px solid rgba(99,102,241,.5);color:#c7d2fe;font-weight:700;font-size:.82rem}
.dsc-padrao{padding:12px 14px;border-radius:12px;background:rgba(16,185,129,.08);border:1px solid rgba(16,185,129,.4)}
.dsc-padrao.hidden{display:none}
.dsc-padrao p{white-space:pre-line;font-size:.84rem;line-height:1.6;color:#d1fae5}
[data-theme="white"] .qo-ce-btn,[data-theme="white"] .qo-ce-resultado,[data-theme="white"] .qo-ce-resumo{background:#fff;color:#0f172a;border-color:rgba(125,211,252,.9)}
[data-theme="white"] .qo-comando{color:#64748b}
[data-theme="white"] .qo-ce-chip{background:#f1f5f9;border-color:#cbd5e1;color:#334155}
[data-theme="white"] .qo-ce-chip strong{color:#0f172a}
[data-theme="white"] .dsc-painel{background:#fff;color:#0f172a;border-color:#cbd5e1}
[data-theme="white"] .dsc-enunciado,[data-theme="white"] .dsc-perguntas{color:#1e293b}
[data-theme="white"] .dsc-area{background:#fff;color:#0f172a;border-color:#cbd5e1}
[data-theme="white"] .dsc-fechar{background:#f1f5f9;border-color:#cbd5e1;color:#334155}

/* ===== Flashcards do banco ===== */
/* Em telas >=1800px a regra geral centraliza os filhos com margin auto, o que encolhia o cartão */
#tab-flashcard-player > *{width:100%}
.fc-texto{white-space:pre-line}
.fc-longo .fc-texto{font-size:.95rem!important;line-height:1.55;text-align:left;font-weight:600}
#fc-card-front-content,#fc-card-back-content{max-height:15rem;overflow-y:auto;width:100%}
@media (max-width:480px){.flashcard-scene,.flashcard-inner{min-height:26rem}#fc-card-front-content,#fc-card-back-content{max-height:17rem}}
.fo-vazio{grid-column:1/-1;text-align:center;color:#94a3b8;padding:36px 10px;font-size:.85rem}
.fo-resumo{grid-column:1/-1;font-size:.78rem;color:#8b93b5;margin:0 2px 4px}
.fo-grade{grid-column:1/-1;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:12px}
.fo-tile{display:flex;flex-direction:column;justify-content:space-between;gap:6px;min-height:132px;background:#0f1220;border:1px solid #232846;border-radius:16px;padding:16px;min-width:0}
.fo-nome{font-size:.95rem;font-weight:700;color:#fff;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.fo-qtd{font-size:.72rem;color:#8b93b5}
.fo-acoes{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}
.fo-btn{flex:1 1 auto;min-height:40px;padding:8px 12px;border-radius:12px;background:#151a30;border:1px solid #272c4a;color:#cbd5e1;font-size:.75rem;font-weight:700;cursor:pointer}
.fo-btn-forte{background:#4f46e5;border-color:#4f46e5;color:#fff}
[data-theme="white"] .fo-tile{background:#fff;border:1.5px solid rgba(125,211,252,.9)}
[data-theme="white"] .fo-nome{color:#0f172a}
[data-theme="white"] .fo-btn{background:#f1f5f9;border-color:#cbd5e1;color:#334155}
[data-theme="white"] .fo-btn-forte{background:#4f46e5;color:#fff;border-color:#4f46e5}

/* Apagar pasta de flashcards */
.fc-apagar-pasta{width:30px;height:30px;min-width:30px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:#151a30;border:1px solid #272c4a;color:#94a3b8;font-size:.75rem;cursor:pointer}
.fc-apagar-pasta:hover{color:#fb7185;border-color:#fb7185}
.fc-apagar-texto{width:auto;padding:0 14px;height:36px;gap:6px;font-weight:700}
[data-theme="white"] .fc-apagar-pasta{background:#f1f5f9;border-color:#cbd5e1;color:#475569}
