/* Release 10.64.20: delta visual aplicado sobre o baseline estável 10.64.19 carregado pelo shell. */

/*
 * Release-scoped responsive guarantees.
 * Mantidas aqui, e não na 10.64.19 restaurada, para preservar o baseline imutável.
 */

/* Flashcards: ações permanecem legíveis, compactas e sem quebra indevida. */
#flashcardsWorkspace .anki-folder-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, max-content));
    align-items: center;
    justify-content: center;
    gap: clamp(.4rem, 1.4vw, .75rem);
}

#flashcardsWorkspace .anki-folder-actions > span:last-child {
    white-space: nowrap !important;
}

#flashcardsWorkspace .anki-folder-actions .btn {
    font-size: clamp(.76rem, .72rem + .18vw, .88rem);
}

/* Calendário: mês e ano permanecem alinhados na mesma linha. */
#calendarWorkspace .calendar-month-selectors {
    display: grid;
    grid-template-columns: auto minmax(0, 1.12fr) minmax(0, .88fr);
    align-items: center;
    gap: clamp(.4rem, 1.2vw, .75rem);
}

#calendarWorkspace .calendar-month-selectors label {
    white-space: nowrap !important;
}

#calendarWorkspace .calendar-month-selectors select {
    min-width: 0;
    font-size: clamp(.78rem, .74rem + .18vw, .9rem);
}

/* Retenção: ações principais permanecem centralizadas opticamente. */
.retention-study-now-v1072,
.retention-export-btn {
    margin-inline: auto !important;
}

.retention-diagnostic-tools {
    justify-content: center !important;
}

/* Contrato visual de retenção da release corrente. */
#retentionDiagnosticPanel .rd-metric-icon-v1077 {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

#retentionDiagnosticPanel .rd-metric-label-v1077 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-inline-size: 13ch !important;
    min-width: 0 !important;
    min-height: 2.2em !important;
    padding-inline: 2px !important;
    text-align: center !important;
    text-wrap: balance !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    font-size: clamp(.76rem, .70rem + .22vw, .86rem) !important;
    font-weight: 760 !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
}

@media (max-width: 700px) {
    #retentionDiagnosticPanel .rd-metric-card-v1077 {
        grid-template-rows: minmax(40px, auto) minmax(58px, 1fr) 5px !important;
        row-gap: 7px !important;
        min-height: 164px !important;
        padding: 14px 8px 10px !important;
    }

    #retentionDiagnosticPanel .rd-metric-label-v1077 {
        max-inline-size: 12.5ch !important;
        min-height: 2.18em !important;
        font-size: clamp(.74rem, 3.1vw, .84rem) !important;
        font-weight: 760 !important;
        line-height: 1.1 !important;
        letter-spacing: 0 !important;
        padding-inline: 1px !important;
    }
}

/* V10.64.32 — correções exclusivamente mobile para retenção, cronograma e ações de flashcards. */
@media (max-width: 700px) {
    #retentionDiagnosticPanel .rd-metrics-v1077 {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: minmax(164px, auto) !important;
        align-items: stretch !important;
        gap: 12px !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
    #retentionDiagnosticPanel .rd-metric-card-v1077 {
        position: relative !important;
        inset: auto !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        grid-template-rows: minmax(40px, auto) minmax(58px, 1fr) 5px !important;
        row-gap: 7px !important;
        min-height: 164px !important;
        padding: 14px 8px 10px !important;
        margin: 0 !important;
        align-self: stretch !important;
    }
    #calendarWorkspace .calendar-primary-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }
    #calendarWorkspace .calendar-primary-actions > .btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 46px !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
        line-height: 1.15 !important;
        padding-inline: 10px !important;
    }
    #flashcardsWorkspace .flashcard-anki-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }
    #flashcardsWorkspace .flashcard-anki-actions > .btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
        line-height: 1.15 !important;
        padding-inline: 9px !important;
    }
    #flashcardsWorkspace #btnResetFcFilter {
        grid-column: 1 / -1 !important;
    }
}

/* V10.64.45 — centralização óptica das métricas e ações de Retenção no mobile. */
@media (max-width: 700px) {
    #retentionDiagnosticPanel .rd-metric-card-v1077 {
        justify-items: center !important;
        text-align: center !important;
    }

    #retentionDiagnosticPanel .rd-metric-label-v1077,
    #retentionDiagnosticPanel .rd-metric-card-v1077 > strong {
        justify-self: center !important;
        align-self: center !important;
        width: 100% !important;
        margin-inline: auto !important;
        text-align: center !important;
    }

    #retentionDiagnosticPanel .rd-metric-card-v1077 > strong {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #retentionDiagnosticPanel .rd-metric-progress-v1077 {
        justify-self: stretch !important;
        width: 100% !important;
    }

    #retentionDiagnosticPanel .retention-study-now-v1072,
    #retentionDiagnosticPanel .retention-export-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: min(100%, 420px) !important;
        margin-inline: auto !important;
        text-align: center !important;
    }

    #retentionDiagnosticPanel .retention-diagnostic-tools {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
    }
}


/* V10.64.53 — ações de exclusão por pasta de flashcards. */
#flashcardsWorkspace .anki-folder-actions,
#flashcardsWorkspace .anki-subfolder-actions {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    min-width:0;
}

#flashcardsWorkspace .anki-delete-group-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:4px 10px;
    border:1px solid rgba(251,113,133,.55);
    border-radius:999px;
    background:rgba(251,113,133,.08);
    color:#fb7185;
    font:inherit;
    font-size:.76rem;
    font-weight:800;
    line-height:1;
    cursor:pointer;
    white-space:nowrap;
    transition:background .16s ease,border-color .16s ease,transform .16s ease;
}

#flashcardsWorkspace .anki-delete-group-btn:hover,
#flashcardsWorkspace .anki-delete-group-btn:focus-visible {
    background:rgba(251,113,133,.15);
    border-color:rgba(251,113,133,.8);
}

#flashcardsWorkspace .anki-delete-group-btn:active {
    transform:translateY(1px);
}

@media (max-width:700px) {
    #flashcardsWorkspace .anki-folder-actions,
    #flashcardsWorkspace .anki-subfolder-actions {
        gap:6px;
    }

    #flashcardsWorkspace .anki-delete-group-btn {
        min-height:28px;
        padding:4px 9px;
        font-size:.72rem;
    }
}


/* =====================================================================
   V10.64.74 — TEMA CLARO / CONTRASTE VISUAL
   Corrige calendário, linhas de matérias e estados de leitura no modo claro.
   ===================================================================== */
body.light-mode #tab-calendario .calendar-shell-card,
body.light-mode #calendarWorkspace .card {
    background:#ffffff !important;
    border-color:#d7e2eb !important;
    box-shadow:0 8px 22px rgba(33,52,69,.055) !important;
}
body.light-mode #calendarWorkspace .calendar-shell-icon {
    background:#eef7f6 !important;
    border-color:#b9dedb !important;
    color:#176f6b !important;
    box-shadow:none !important;
}
body.light-mode #calendarWorkspace .calendar-shell-title p,
body.light-mode #calendarWorkspace .calendar-month-selectors label {
    color:#6b7f91 !important;
}
body.light-mode #calendarWorkspace .month-calendar-header {
    color:#5f7890 !important;
}
body.light-mode #calendarWorkspace .month-day-cell {
    background:#ffffff !important;
    border-color:#d9e4ed !important;
    box-shadow:none !important;
}
body.light-mode #calendarWorkspace .month-day-cell:hover {
    background:#f7fbfd !important;
    border-color:#9fc6d7 !important;
}
body.light-mode #calendarWorkspace .month-day-cell.today {
    background:#eaf8f6 !important;
    border-color:#48bdb4 !important;
    box-shadow:0 0 0 1px rgba(22,143,137,.08) !important;
}
body.light-mode #calendarWorkspace .month-day-cell.study-completed {
    background:#eefaf4 !important;
    border-color:#8fd2ae !important;
}
body.light-mode #calendarWorkspace .month-day-cell.study-overdue {
    background:#fff3f4 !important;
    border-color:#efb2b8 !important;
}
body.light-mode #calendarWorkspace .day-num-value,
body.light-mode #calendarWorkspace .month-day-cell:not(.today) .day-num-value {
    color:#2b4257 !important;
}
body.light-mode #calendarWorkspace .month-day-cell.today .day-num-value,
body.light-mode #calendarWorkspace .month-day-cell.study-active .day-num-value {
    color:#168f89 !important;
}
body.light-mode #calendarWorkspace .month-day-cell.other-month .day-num-value {
    color:#94a5b5 !important;
}
body.light-mode #calendarWorkspace .day-progress-summary span {
    color:#536b80 !important;
}
body.light-mode #calendarWorkspace .day-progress-track {
    background:#dfe8ef !important;
}
body.light-mode #calendarWorkspace .day-empty-dots {
    opacity:.45 !important;
}
body.light-mode #calendarWorkspace .day-empty-dots span {
    background:#9db0c0 !important;
}
body.light-mode #calendarWorkspace .day-open-btn {
    background:#f6fafc !important;
    border-color:#ccd9e2 !important;
    color:#395063 !important;
}
body.light-mode #calendarWorkspace .clean-subject-more,
body.light-mode #calendarWorkspace .month-day-mobile-meta,
body.light-mode #calendarWorkspace .month-day-mobile-count {
    color:#526b80 !important;
}

body.light-mode #tab-edital .materia-header-row {
    background:#eef7f6 !important;
    border-color:#cfe2e1 !important;
    box-shadow:inset 4px 0 0 #43bdb4 !important;
}
body.light-mode #tab-edital .materia-header-row td,
body.light-mode #tab-edital .materia-header-row strong,
body.light-mode #tab-edital .materia-header-content strong,
body.light-mode #tab-edital .materia-header-title {
    color:#174f4c !important;
}
body.light-mode #tab-edital .materia-header-meta,
body.light-mode #tab-edital .materia-drag-hint {
    color:#6d8589 !important;
}
body.light-mode #tab-edital .materia-progress-ring {
    background:conic-gradient(#35b4ab calc(var(--pct)*1%), #d7e7e6 0) !important;
}
body.light-mode #tab-edital .materia-progress-ring::before {
    background:#ffffff !important;
}
body.light-mode #tab-edital .materia-progress-ring span,
body.light-mode #tab-edital .materia-expand-label {
    color:#168f89 !important;
}
body.light-mode #tab-edital .priority-input {
    background:#ffffff !important;
    color:#26384a !important;
    border-color:#c8d7df !important;
}
body.light-mode #tab-edital tbody tr:not(.materia-header-row) {
    background:#ffffff !important;
}
body.light-mode #tab-edital tbody tr:not(.materia-header-row) td {
    color:#2c4154 !important;
    border-color:#e1e9ef !important;
}


/* =====================================================================
   V10.64.75 — TEMA CLARO / CARDS DE MATÉRIAS
   Neutraliza backgrounds escuros aplicados diretamente nos TDs.
   ===================================================================== */
body.light-mode #tab-edital .materia-header-row,
body.light-mode #tab-edital .materia-header-row td,
body.light-mode #tab-edital .materia-header-row td[colspan],
body.light-mode #tab-edital .materia-header-content,
body.light-mode #tab-edital .materia-header-main,
body.light-mode #tab-edital .materia-header-right {
    background:#f4faf9 !important;
}
body.light-mode #tab-edital .materia-header-row {
    border:1px solid #d4e5e3 !important;
    box-shadow:inset 4px 0 0 #43bdb4 !important;
}
body.light-mode #tab-edital .materia-header-row td {
    border-color:#d4e5e3 !important;
}
body.light-mode #tab-edital .materia-header-row td:first-child {
    background:#eef7f6 !important;
}
body.light-mode #tab-edital .materia-header-row:hover,
body.light-mode #tab-edital .materia-header-row:hover td,
body.light-mode #tab-edital .materia-header-row:hover .materia-header-content {
    background:#edf8f6 !important;
}
body.light-mode #tab-edital .materia-header-title,
body.light-mode #tab-edital .materia-header-row strong,
body.light-mode #tab-edital .materia-header-content strong {
    color:#1d5753 !important;
}
body.light-mode #tab-edital .materia-header-meta,
body.light-mode #tab-edital .materia-drag-hint {
    color:#758a8d !important;
}
body.light-mode #tab-edital .materia-progress-ring::before {
    background:#ffffff !important;
}
body.light-mode #tab-edital .materia-expand-label {
    color:#168f89 !important;
}
