/* Tema escuro do design novo. Mantido como camada final para não alterar as funções dos hubs. */
.theme-toggle .theme-icon-sun { display: none; }

html.is-theme-surface-scanning *,
html.is-theme-surface-scanning *::before,
html.is-theme-surface-scanning *::after { transition: none !important; }

html[data-egghead-theme="dark"] {
  --ink: #d8d4cc;
  --paper: #181a1f;
  --surface: #23262d;
  --yellow: #d1ad42;
  --blue: #293943;
  --lilac: #35323f;
  --green: #293b31;
  --peach: #3b332c;
  --pink: #3d3037;
  --muted: #b6b2aa;
  --line: 1px solid #444a54;
  --shadow: 2px 2px 0 rgba(10, 11, 15, .72);
  --shadow-small: 1px 1px 0 rgba(10, 11, 15, .72);
  --dark-canvas: #181a1f;
  --dark-chrome: #1c1f25;
  --dark-surface: #23262d;
  --dark-raised: #2a2e36;
  --dark-inset: #1f2228;
  --dark-text: #d8d4cc;
  --dark-text-body: #c9c5bc;
  --dark-muted: #b6b2aa;
  --dark-border: #444a54;
  --dark-border-strong: #646c79;
  --dark-shadow: #101217;
  --dark-shadow-soft: rgba(9, 10, 14, .64);
  --dark-accent-soft: #342f20;
  --dark-accent-text: #211c11;
  --legacy-chart-accent: #9d99d3;
  --legacy-chart-accent-dark: #b5b0e4;
  --legacy-chart-accent-soft: #35334a;
  --legacy-chart-success: #63b5a7;
  --legacy-chart-success-soft: #263b37;
  --legacy-chart-info: #7fa4c3;
  --legacy-chart-info-soft: #2a3944;
  --legacy-chart-danger: #cf8397;
  --legacy-chart-danger-soft: #443138;
  --legacy-chart-warn: #c9aa6c;
  --legacy-chart-grid: #545762;
  --legacy-chart-grid-soft: #30333a;
  --legacy-chart-muted: #b8b6bd;
  --legacy-chart-surface: #26282d;
  color-scheme: dark;
}

html[data-egghead-theme="dark"] body.is-data-loading::before,
html[data-egghead-theme="dark"] body.is-maintenance-checking::before {
  color: var(--dark-text) !important;
  background: var(--dark-canvas) !important;
}

html[data-egghead-theme="dark"] #migrationMaintenance {
  color: var(--dark-text) !important;
  background: var(--dark-canvas) !important;
}

html[data-egghead-theme="dark"] #migrationMaintenance .maintenance-card {
  border-color: var(--dark-border-strong) !important;
  background: var(--dark-surface) !important;
  box-shadow: 6px 6px 0 var(--dark-shadow) !important;
}

html[data-egghead-theme="dark"] #migrationMaintenance .maintenance-kicker {
  border-color: var(--dark-border-strong) !important;
  color: var(--dark-text) !important;
  background: var(--dark-accent-soft) !important;
}

html[data-egghead-theme="dark"] #migrationMaintenance h1 {
  color: var(--dark-text) !important;
}

html[data-egghead-theme="dark"] #migrationMaintenance .maintenance-message {
  color: var(--dark-text-body) !important;
}

html[data-egghead-theme="dark"] .prototype-body {
  --surface-white: #26282d;
  --detail-control: #6e91a3;
  --detail-data: #89aebe;
  --detail-content: #837f78;
  --detail-success: #67b682;
  --detail-danger: #cf738f;
  --detail-current: var(--yellow);
  --semantic-control: #2a3942;
  --semantic-control-strong: #36505e;
  --semantic-stat: #302c21;
  --semantic-content: #2d3036;
  --semantic-current: var(--dark-accent-soft);
  --semantic-success: #326344;
  --semantic-success-soft: #263e2f;
  --semantic-danger: #713d50;
  --semantic-danger-soft: #4b303a;
  --semantic-data: #8ca7b5;
}

html[data-egghead-theme="dark"] [data-screen="desempenho"] {
  --performance-white: #26282d;
  --performance-control-detail: #608599;
  --performance-data-detail: #86aaba;
  --performance-analysis-detail: #837f78;
  --performance-success-detail: #67b682;
  --performance-danger-detail: #cf738f;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] {
  --cartoon-surface: var(--dark-surface);
  --cartoon-surface-2: var(--dark-raised);
  --cartoon-grid: #4c525e;
  --cartoon-badge: #34313c;
  --cartoon-shadow: var(--dark-shadow-soft);
}

html[data-egghead-theme="dark"] body,
html[data-egghead-theme="dark"] .prototype-canvas,
html[data-egghead-theme="dark"] .main-content {
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(216, 212, 204, .025) .8px, transparent .8px);
}

html[data-egghead-theme="dark"] .topbar {
  color: var(--ink);
  background: rgba(28, 31, 37, .96);
  border-color: var(--dark-border);
}

html[data-egghead-theme="dark"] .topbar-date,
html[data-egghead-theme="dark"] .eyebrow,
html[data-egghead-theme="dark"] small,
html[data-egghead-theme="dark"] .quiet-note,
html[data-egghead-theme="dark"] .time-note { color: var(--muted); }

html[data-egghead-theme="dark"] .screen .eyebrow {
  font-size: 11px !important;
  letter-spacing: .1em;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] .screen :is(
  small, .preview-label, .time-note, .quiet-copy, .chart-label, .graph-label
) {
  font-size: 12px !important;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] .screen :is(label, legend) {
  font-size: 12px !important;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] .screen :is(label > span, legend) {
  font-size: 12px !important;
}

html[data-egghead-theme="dark"] .screen button:not(.icon-button, .mobile-menu, .sidebar-collapse-button) {
  font-size: 12px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] .screen :is(input, select, textarea) {
  font-size: 12px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
html[data-egghead-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }

html[data-egghead-theme="dark"] .icon-button,
html[data-egghead-theme="dark"] .streak-pill,
html[data-egghead-theme="dark"] .migration-data-chip {
  color: var(--ink);
  background: var(--dark-raised);
  border-color: var(--dark-border);
  box-shadow: 1px 1px 0 var(--dark-shadow-soft);
}

html[data-egghead-theme="dark"] .theme-toggle:hover,
html[data-egghead-theme="dark"] .theme-toggle:focus-visible {
  color: #171719;
  background: var(--yellow);
}

html[data-egghead-theme="dark"] .prototype-sidebar { background: var(--dark-chrome) !important; }
html[data-egghead-theme="dark"] .prototype-sidebar .nav-link.is-active {
  color: var(--dark-accent-text);
  background: var(--yellow);
}

html[data-egghead-theme="dark"] .prototype-sidebar .nav-link:hover:not(.is-active) {
  color: var(--dark-text);
  background: var(--dark-raised);
}

html[data-egghead-theme="dark"] .prototype-nav .nav-glyph,
html[data-egghead-theme="dark"] .prototype-nav .nav-count {
  color: var(--dark-text-body);
  background: var(--dark-raised);
  border-color: var(--dark-border);
  box-shadow: none;
}

html[data-egghead-theme="dark"] .prototype-nav .nav-copy strong {
  font-size: 13px;
  font-weight: 800;
}

html[data-egghead-theme="dark"] .prototype-nav .nav-copy small {
  color: var(--dark-muted);
  font-size: 12px;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] .prototype-nav .nav-section-heading {
  color: var(--dark-muted);
  font-size: 10.5px;
}

html[data-egghead-theme="dark"] .prototype-nav .nav-cluster .nav-link.is-active :is(.nav-glyph, .nav-count) {
  color: var(--dark-accent-text);
  background: #e2c15d;
  border-color: #756127;
}

html[data-egghead-theme="dark"] .prototype-nav .nav-cluster .nav-link.is-active .nav-copy small {
  color: var(--dark-accent-text);
}

html[data-egghead-theme="dark"] .prototype-profile .profile-card {
  color: var(--dark-text-body);
  background: var(--dark-raised);
  border-color: var(--dark-border-strong);
  box-shadow: 1px 1px 0 var(--dark-shadow-soft);
}

html[data-egghead-theme="dark"] .prototype-profile .avatar {
  color: var(--dark-accent-text);
}

html[data-egghead-theme="dark"] :is(
  .test-card, .migration-data-banner, .notice-card, .notice-topbar-panel, .screen-panel,
  .bank-filter-panel, .bank-question-card, .bank-community-shell, .community-panel,
  .community-card, .youtube-resolution-panel, .performance-card, .xray-card, .list-card,
  .list-manager, .simulation-card, .essay-card, .revision-card, .annotation-card, .graph-card,
  .timex-card, .timex-history-card, .schedule-card, .file-card, .feedback-card, .config-card,
  .profile-main-card, .profile-stat, .migration-auth-dialog
) {
  color: var(--ink);
  background-color: var(--surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft) !important;
}

html[data-egghead-theme="dark"] .screen :where(
  header, footer, section, article, div, li, table, thead, tbody, tr, td, th
) {
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] :is(.days-row > span > b, .quiet-note, .notice-topbar-item) {
  color: var(--ink);
  background: var(--dark-raised) !important;
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] .days-row > span.done > b { background: #264431 !important; }
html[data-egghead-theme="dark"] .days-row > span.current > b {
  color: #171719;
  background: var(--yellow) !important;
}

html[data-egghead-theme="dark"] :is(
  .list-row, .metric-row > div, .search-field, .answers button, .compact-insight,
  .generator-banner, .mini-search, .manager-list > button, .list-detail-stats > div,
  .timer-card, .compact-message, .bank-filter-heading, .bank-filter-section,
  .bank-filter-footer, .bank-filter-actions, .bank-select-grid label, .bank-question-media,
  .bank-question-footer, .bank-answer-details, .bank-community-tabs, .bank-community-comment,
  .community-comment, .community-thread, .community-stat, .youtube-resolution-card,
  .simple-list > *, .dash-restored-summary > article, .timex-summary-strip > div,
  .timex-new-subject-card, .timex-subject-card, .timex-history-layout,
  .timex-week-grid > button, .timex-week-total, .timex-day-detail, .timex-day-heading,
  .timex-day-subjects > div, .crx-item, .arx-item, .fbx-item
) {
  color: var(--ink);
  background-color: var(--dark-raised) !important;
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] :is(input, select, textarea) {
  color: var(--ink) !important;
  background: var(--dark-inset) !important;
  border-color: var(--dark-border-strong) !important;
  caret-color: var(--yellow);
}

html[data-egghead-theme="dark"] :is(input, textarea)::placeholder { color: #96938c; }
html[data-egghead-theme="dark"] select option { color: var(--ink); background: var(--dark-inset); }

html[data-egghead-theme="dark"] :is(
  .outline-action, .filter-chip, .tab-button, .bank-tab, .pagination-button,
  .config-choice, .chip
) {
  color: var(--ink);
  background: var(--dark-raised) !important;
  border-color: var(--dark-border-strong) !important;
}

html[data-egghead-theme="dark"] :is(
  .outline-action:hover, .filter-chip.is-active, .tab-button.is-active, .bank-tab.is-active,
  .pagination-button.is-active, .config-choice.is-active, .chip.is-active
) {
  color: var(--dark-accent-text) !important;
  background: var(--yellow) !important;
}

html[data-egghead-theme="dark"] :is(.dark-action, .primary-action, button[type="submit"]):not(.outline-action) {
  color: var(--dark-accent-text);
  background: var(--yellow);
  border-color: #806b31;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft);
}

html[data-egghead-theme="dark"] :is(.dark-action, .primary-action, button[type="submit"]):not(.outline-action):disabled {
  color: #85817a;
  background: #3a3a3f;
  border-color: #666269;
}

html[data-egghead-theme="dark"] :is(
  .is-highlight, .is-selected, .is-current, .current, .bank-answer-option.is-selected,
  .timex-subject-card.is-running, .timex-week-grid > button.is-selected
) { background-color: var(--dark-accent-soft) !important; }

html[data-egghead-theme="dark"] :is(.success, .is-correct, .correct) {
  color: #c4f2d1;
  background-color: #1f432d !important;
}

html[data-egghead-theme="dark"] :is(.danger, .is-wrong, .wrong, .error) {
  color: #ffc9c5;
  background-color: #502724 !important;
}

html[data-egghead-theme="dark"] :is(.progress-line, .bar-track, .chart-track, .xray-track) {
  background: #444249 !important;
}

html[data-egghead-theme="dark"] :is(.progress-line, .bar-track, .chart-track, .xray-track) > i,
html[data-egghead-theme="dark"] :is(.progress-line, .bar-track, .chart-track, .xray-track) > span {
  background: var(--yellow);
}

html[data-egghead-theme="dark"] :is(svg text, .chart-label, .graph-label) {
  fill: var(--ink);
  color: var(--ink);
}

html[data-egghead-theme="dark"] :is(.chart-grid, .graph-grid, svg .grid-line) { stroke: #555861; }

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-chart-shell {
  background: transparent !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-chart-area {
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(168, 155, 223, .075), rgba(168, 155, 223, 0) 78%) !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-area-fill {
  fill: rgba(168, 155, 223, .12) !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(.graphx-y-labels, .graphx-x-labels) {
  color: var(--dark-muted) !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-mode-tabs > button.is-active > span {
  color: var(--dark-text) !important;
  background: #34313c !important;
  border-color: #615873 !important;
}

html[data-egghead-theme="dark"] :is(
  .migration-auth-dialog header, .migration-auth-dialog footer, .notice-topbar-panel header,
  .notice-topbar-list, .bank-community-header, .youtube-resolution-header
) {
  color: var(--ink);
  background: var(--surface) !important;
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] :is(.migration-auth-backdrop, .modal-backdrop, .bank-image-backdrop) {
  background: rgba(7, 8, 11, .72);
  backdrop-filter: blur(2px);
}

/* Modais internos: texto legível e ações secundárias sem faixas luminosas. */
html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-dialog {
  border-color: var(--dark-border-strong) !important;
  box-shadow: 4px 4px 0 var(--dark-shadow-soft) !important;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-dialog > header {
  background: var(--dark-raised) !important;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-dialog > header > button {
  color: var(--dark-text);
  background: var(--dark-inset);
  border-color: var(--dark-border-strong);
  box-shadow: none;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-dialog > header > button:hover {
  color: var(--dark-accent-text);
  background: var(--yellow);
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-signed-out > p {
  color: var(--dark-text-body);
  font-size: 12px;
  line-height: 1.55;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-google-button {
  color: var(--dark-text);
  background: var(--dark-raised);
  border-color: var(--dark-border-strong);
  box-shadow: 2px 2px 0 var(--dark-shadow-soft);
  font-size: 12px;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-google-button > span {
  color: var(--dark-accent-text);
  background: var(--yellow);
  border-color: #806b31;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-divider {
  color: var(--dark-muted);
  font-size: 10px;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-divider::before,
html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-divider::after {
  background: var(--dark-border);
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-signed-out label {
  color: var(--dark-text-body);
  font-size: 11px;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-signed-out input {
  font-size: 13px;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-password-actions {
  display: flex;
  justify-content: flex-end;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-password-actions button {
  width: auto !important;
  min-height: 0;
  margin: -3px 0 0 auto !important;
  padding: 5px 0 !important;
  border: 0 !important;
  color: var(--dark-text-body) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-password-actions button:hover {
  color: var(--yellow) !important;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-signed-out form > button[type="submit"] {
  min-height: 44px;
  font-size: 12px;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-message {
  color: #e3a19c;
  font-size: 11px;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-dialog > footer {
  background: var(--dark-inset) !important;
}

html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-dialog > footer span,
html[data-egghead-theme="dark"] body:not(.is-public-signed-out) .migration-auth-signed-in > div small {
  color: var(--dark-muted);
  font-size: 10px;
  line-height: 1.4;
}

/* Avisos flutuantes: hierarquia clara entre itens lidos e novos. */
html[data-egghead-theme="dark"] .notice-topbar-panel {
  border-color: var(--dark-border-strong) !important;
  box-shadow: 3px 3px 0 var(--dark-shadow-soft) !important;
}

html[data-egghead-theme="dark"] .notice-topbar-panel header span,
html[data-egghead-theme="dark"] .notice-topbar-meta :is(span, time) {
  color: var(--dark-muted);
  font-size: 10px;
}

html[data-egghead-theme="dark"] .notice-topbar-panel header button {
  color: var(--dark-text-body);
  border-color: var(--dark-border-strong);
  font-size: 11px;
}

html[data-egghead-theme="dark"] .notice-topbar-item {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] .notice-topbar-item:hover {
  background: var(--dark-raised) !important;
}

html[data-egghead-theme="dark"] .notice-topbar-item.is-unread {
  background: var(--dark-accent-soft) !important;
  box-shadow: inset 3px 0 0 var(--yellow);
}

html[data-egghead-theme="dark"] .notice-topbar-icon {
  color: var(--dark-accent-text);
  background: var(--yellow);
  border-color: #806b31;
}

html[data-egghead-theme="dark"] .notice-topbar-copy strong {
  font-size: 12px;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] .notice-topbar-copy p,
html[data-egghead-theme="dark"] .notice-topbar-empty {
  color: var(--dark-text-body);
  font-size: 11px;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] .icon-button[aria-expanded="true"] {
  color: var(--dark-accent-text);
  background: var(--yellow);
}

/* Mensagens temporárias deixam de piscar em tons pastel claros. */
html[data-egghead-theme="dark"] :is(
  .anno-toast,
  .arx-toast,
  .crx-toast,
  .fbx-toast,
  .rev-toast,
  .timex-toast,
  .red-toast,
  .stability-message
) {
  color: var(--dark-text) !important;
  background: var(--dark-raised) !important;
  border-color: var(--dark-border-strong) !important;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft) !important;
  font-size: 12px;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] :is(
  .anno-toast,
  .arx-toast,
  .crx-toast,
  .fbx-toast,
  .rev-toast,
  .timex-toast,
  .red-toast
)[data-tone="success"],
html[data-egghead-theme="dark"] .stability-message.is-success {
  color: #c5e7cf !important;
  background: #264431 !important;
  border-color: #4e765b !important;
}

html[data-egghead-theme="dark"] :is(
  .arx-toast,
  .crx-toast,
  .fbx-toast,
  .timex-toast
)[data-tone="warning"],
html[data-egghead-theme="dark"] .stability-message.is-warning {
  color: #e2d3a5 !important;
  background: #3d3623 !important;
  border-color: #746640 !important;
}

html[data-egghead-theme="dark"] :is(
  .anno-toast,
  .arx-toast,
  .crx-toast,
  .fbx-toast,
  .rev-toast,
  .timex-toast,
  .red-toast
)[data-tone="error"],
html[data-egghead-theme="dark"] .stability-message.is-error {
  color: #ebc3c6 !important;
  background: #4b3035 !important;
  border-color: #79535b !important;
}

html[data-egghead-theme="dark"] a { color: inherit; }
html[data-egghead-theme="dark"] .marker { color: var(--ink) !important; }
html[data-egghead-theme="dark"] hr { border-color: #666269; }
html[data-egghead-theme="dark"] img { color-scheme: normal; }

/* Corrige superfícies claras herdadas pelos módulos funcionais e preserva a semântica das cores. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="neutral"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="neutral"] {
  color: var(--ink) !important;
  background-color: var(--dark-raised) !important;
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="soft-accent"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="soft-accent"] {
  color: #cec8bc !important;
  background-color: #302d25 !important;
  border-color: #524b39 !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="accent"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="accent"] {
  color: var(--dark-accent-text) !important;
  background-color: var(--yellow) !important;
  border-color: #8d773c !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="success"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="success"] {
  color: #bfd7c5 !important;
  background-color: #2a4032 !important;
  border-color: #4e765b !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="danger"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="danger"] {
  color: #dabcc5 !important;
  background-color: #46323a !important;
  border-color: #795563 !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="info"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="info"] {
  color: #bed0d8 !important;
  background-color: #2b3b44 !important;
  border-color: #506f7d !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="violet"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-tone="violet"] {
  color: #cec9dc !important;
  background-color: #373342 !important;
  border-color: #666078 !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-tone="accent"] :is(span, strong, small, b, em),
html[data-egghead-theme="dark"] .screen:not([data-screen$="-legacy"]) :is(.dark-action, .primary-action),
html[data-egghead-theme="dark"] .tag-yellow {
  color: var(--dark-accent-text) !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-text="primary"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-text="primary"] {
  color: #d8d4cc !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-text="secondary"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-text="secondary"] {
  color: #aaa69e !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-egghead-dark-text="accent"],
html[data-egghead-theme="dark"] body.prototype-body .migration-auth-modal [data-egghead-dark-text="accent"] {
  color: var(--dark-accent-text) !important;
}

/* O seletor sentinela eleva a prioridade acima dos estilos legados que usam IDs. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="neutral"]) {
  color: var(--ink) !important;
  background-color: var(--dark-raised) !important;
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="soft-accent"]) {
  color: #cec8bc !important;
  background-color: #302d25 !important;
  border-color: #524b39 !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="accent"]) {
  color: var(--dark-accent-text) !important;
  background-color: var(--yellow) !important;
  border-color: #8d773c !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="success"]) {
  color: #bfd7c5 !important;
  background-color: #2a4032 !important;
  border-color: #4e765b !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="danger"]) {
  color: #dabcc5 !important;
  background-color: #46323a !important;
  border-color: #795563 !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="info"]) {
  color: #bed0d8 !important;
  background-color: #2b3b44 !important;
  border-color: #506f7d !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-tone-boost, [data-egghead-dark-tone="violet"]) {
  color: #cec9dc !important;
  background-color: #373342 !important;
  border-color: #666078 !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-text-boost, [data-egghead-dark-text="primary"]) {
  color: #d8d4cc !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main :is(#egghead-dark-text-boost, [data-egghead-dark-text="accent"]) {
  color: var(--dark-accent-text) !important;
}

html[data-egghead-theme="dark"] .screen:not([data-screen$="-legacy"]) :is(.dark-action, .primary-action) {
  border-color: #806b31 !important;
  background: var(--yellow) !important;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft) !important;
}

html[data-egghead-theme="dark"] :is(.test-card, [class*="-card"]):not(.bank-youtube-card) {
  border-color: var(--dark-border) !important;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft) !important;
}

html[data-egghead-theme="dark"] .screen :is(button, a, input, select, textarea) {
  border-color: var(--dark-border-strong);
}

html[data-egghead-theme="dark"] .screen :is(button, a):focus-visible {
  outline: 3px solid #d0ab43;
  outline-offset: 3px;
}

html[data-egghead-theme="dark"] .days-row > span.current > b {
  color: var(--dark-accent-text) !important;
  background: var(--yellow) !important;
}

html[data-egghead-theme="dark"] .list-sharing-panel,
html[data-egghead-theme="dark"] .public-list-preview li {
  border-color: var(--dark-border) !important;
  color: var(--dark-text);
  background: var(--dark-raised) !important;
}

html[data-egghead-theme="dark"] .list-sharing-panel.is-public {
  background: #243c2c !important;
}

html[data-egghead-theme="dark"] .public-list-preview li > button {
  border-color: var(--dark-border);
  color: var(--dark-text);
  background: var(--dark-surface);
}

html[data-egghead-theme="dark"] :is(.community-challenge-card > section > div, .bank-community-comment.is-resolution) { border-color: var(--dark-border) !important; color: var(--dark-text); background: var(--dark-raised) !important; }
html[data-egghead-theme="dark"] .public-list-star { border-color: var(--dark-border); color: var(--dark-text); background: var(--dark-surface); }
html[data-egghead-theme="dark"] .public-list-star.is-starred { color: var(--dark-accent-text); background: var(--yellow); }

html[data-egghead-theme="dark"] .notification-dot {
  background: #df7777;
  border-color: #35363c;
}

html[data-egghead-theme="dark"] [data-screen="banco"] .bank-filter-refined .bank-select-grid .bank-exam-primary {
  border-color: #e7c94d;
  background: #393522 !important;
  box-shadow: 3px 3px 0 #111217;
}

html[data-egghead-theme="dark"] [data-screen="banco"] .bank-filter-refined .bank-select-grid .bank-exam-primary > span {
  color: var(--dark-text);
}

html[data-egghead-theme="dark"] [data-screen="banco"] .bank-filter-refined .bank-select-grid .bank-exam-primary select {
  border-color: #e7c94d;
  color: var(--dark-text);
  background: var(--dark-raised);
}

/* Acabamento final das telas mais densas: menos contornos luminosos e nenhum painel claro residual. */
html[data-egghead-theme="dark"] [data-screen="dashboard"] .dash-restored-summary {
  background: var(--dark-surface);
  border-color: var(--dark-border) !important;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft);
}

html[data-egghead-theme="dark"] [data-screen="dashboard"] .dash-restored-summary article {
  border-color: var(--dark-border) !important;
}

html[data-egghead-theme="dark"] [data-screen="dashboard"] .dash-restored-summary span {
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

html[data-egghead-theme="dark"] [data-screen="dashboard"] .session-body p,
html[data-egghead-theme="dark"] [data-screen="tempo"] .timex-summary-strip span,
html[data-egghead-theme="dark"] [data-screen="tempo"] .timex-session-meta span {
  font-size: 12px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-mode-tabs strong {
  font-size: 12px !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-mode-tabs,
  .graphx-toolbar,
  .graphx-context-strip > div,
  .graphx-record-list > div
) {
  border-color: var(--dark-border) !important;
  box-shadow: 1px 1px 0 var(--dark-shadow-soft) !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="graficos"] .graphx-mode-tabs > button.is-active > span {
  color: var(--dark-text) !important;
  background: #34313c !important;
  border-color: #615873 !important;
}

/* Leitura confortável em áreas densas, sem alterar dados ou escalas dos gráficos. */
html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-mode-tabs strong {
  font-size: 13px !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-mode-tabs small,
html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-toolbar-count,
  .graphx-toolbar-period,
  .graphx-card-heading,
  .graphx-section-heading,
  .graphx-comparison-heading,
  .graphx-context-strip > div
) > span {
  font-size: 12px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-x-labels,
  .graphx-y-labels,
  .graph-live-x,
  .graph-live-y,
  .graphx-mini-chart > div
) {
  font-size: 12px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-mode-tabs > button > span,
  .graphx-subject-index,
  .graphx-record-list > div > span
) {
  font-size: 10px !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-record-list strong,
html[data-egghead-theme="dark"] [data-screen="graficos"] .graphx-record-list b {
  font-size: 12px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-comparison-table,
  .graph-live-table
) :is(strong, span, b) {
  font-size: 12px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-table-head,
  .graph-live-table-head
) :is(strong, span, b) {
  font-size: 11px !important;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
  .graphx-card-heading,
  .graphx-section-heading,
  .graphx-comparison-heading
) span {
  font-size: 12px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graph-live-table strong small {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="graficos"] .graph-live-main-footer span {
  font-size: 11px !important;
  line-height: 1.4;
}

/* Cronograma: horários e conteúdos da grade precisam continuar legíveis por horas de uso. */
html[data-egghead-theme="dark"] [data-screen="cronograma"] small {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="cronograma"] :is(
  .crx-summary span,
  .crx-legend span,
  .crx-board-head > div:first-child > span,
  .crx-field > span,
  .crx-colors legend,
  .crx-editor-note
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="cronograma"] :is(
  .crx-slot strong,
  .crx-day strong,
  .crx-today-list span strong
) {
  font-size: 12px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="cronograma"] :is(
  .crx-time strong,
  .crx-today-list time,
  .crx-today-list b
) {
  font-size: 11px !important;
}

html[data-egghead-theme="dark"] [data-screen="cronograma"] :is(.crx-corner span, .crx-day span) {
  font-size: 10px !important;
}

html[data-egghead-theme="dark"] [data-screen="cronograma"] .crx-load-bars :is(span, small) {
  font-size: 10px !important;
}

/* Simulados: formulários, histórico e tabelas sem legendas microscópicas. */
html[data-egghead-theme="dark"] [data-screen="simulados"] small {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-summary-strip span,
  .sim-section-heading > span,
  .sim-runner-create-card > footer > span,
  .sim-special-card > footer > span,
  .sim-history-toolbar label span,
  .sim-history-detail-heading > div:first-child > span,
  .sim-history-metrics span,
  .sim-history-note span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-mode-tabs strong,
  .sim-subject-table > div > strong,
  .sim-model-list strong,
  .sim-models-card > footer strong,
  .sim-history-list strong
) {
  font-size: 12px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-subject-table .sim-table-head,
  .sim-special-table > header
) {
  font-size: 11px !important;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-subject-table > div > span b,
  .sim-special-row > strong,
  .sim-special-row > span,
  .sim-history-subjects > div,
  .sim-history-note p
) {
  font-size: 12px !important;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-runner-timed,
  .sim-model-create > div button,
  .sim-models-card > footer
) {
  font-size: 11px !important;
}

/* Superfícies críticas não dependem da adaptação dinâmica em dispositivos lentos. */
html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-runner-create-intro,
  .sim-subject-table .sim-table-total,
  .sim-model-create,
  .sim-history-detail-heading,
  .sim-history-note
) {
  color: var(--dark-text);
  background: var(--dark-raised) !important;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] .sim-input-suffix {
  color: var(--dark-text);
  background: var(--dark-inset) !important;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-input-suffix b,
  .sim-runner-create-index
) {
  color: var(--dark-text);
  background: #2a3942 !important;
}

html[data-egghead-theme="dark"] [data-screen="simulados"] :is(
  .sim-runner-create-index,
  .sim-mode-tabs > button > span,
  .sim-model-list > button > span,
  .sim-model-list > button > b,
  .sim-history-date small,
  .sim-input-suffix b
) {
  font-size: 10px !important;
}

/* Anotações: referências, eixos e citações são conteúdo de leitura, não decoração. */
html[data-egghead-theme="dark"] [data-screen="anotacoes"] small {
  font-size: 11px !important;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] [data-screen="anotacoes"] :is(
  .anno-summary-strip span,
  .anno-section-heading > span,
  .anno-selected-axes > span,
  .anno-axis-list span,
  .anno-axis-list strong,
  .anno-error-explanation > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="anotacoes"] :is(
  .anno-tags-field > div > button,
  .anno-selected-axes > button,
  .anno-axis-options > button,
  .anno-axis-heading > span,
  .anno-axis-list b,
  .anno-repertory-top > div:first-child span,
  .anno-repertory-top > div:last-child button,
  .anno-repertory-card > footer span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="anotacoes"] :is(
  .anno-repertory-card > p,
  .anno-error-explanation p,
  .anno-error-photo > p
) {
  font-size: 12px !important;
  line-height: 1.6;
}

html[data-egghead-theme="dark"] [data-screen="anotacoes"] :is(
  .anno-repertory-card > footer strong,
  .anno-error-photo strong,
  .anno-axes-manage-list strong
) {
  font-size: 11px !important;
  line-height: 1.4;
}

/* Arquivos: nomes, formatos, datas e detalhes deixam de depender de microtexto. */
html[data-egghead-theme="dark"] [data-screen="arquivos"] small {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="arquivos"] :is(
  .arx-summary span,
  .arx-breadcrumb button,
  .arx-breadcrumb strong,
  .arx-search input,
  .arx-folder div strong,
  .arx-file > div strong,
  .arx-file-preview strong,
  .arx-upload > div strong
) {
  font-size: 12px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="arquivos"] :is(
  .arx-file-head,
  .arx-file-type,
  .arx-folder > b
) {
  font-size: 10px !important;
}

html[data-egghead-theme="dark"] [data-screen="arquivos"] :is(
  .arx-file > b,
  .arx-file time,
  .arx-details dt,
  .arx-details dd,
  .arx-details > footer,
  .arx-upload > button,
  .arx-files > header label,
  .arx-files > header select
) {
  font-size: 11px !important;
  line-height: 1.4;
}

/* Redações: notas, competências e devolutivas são conteúdo principal de leitura. */
html[data-egghead-theme="dark"] [data-screen="redacoes"] :is(
  .red-summary-strip span,
  .red-section-heading > span,
  .red-type-tag,
  .red-detail-heading > div:first-child > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="redacoes"] :is(
  .red-mode-tabs > button > span,
  .red-competence-heading > span,
  .red-competence-card b,
  .red-score-band > span,
  .red-detail-total > span,
  .red-detail-competences span,
  .red-correction-note > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="redacoes"] :is(
  .red-competence-card > strong,
  .red-score-band > b,
  .red-history-list strong,
  .red-detail-total > b,
  .red-detail-competences strong,
  .red-upload-file,
  .red-attachment-card strong
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="redacoes"] .red-correction-note > p {
  font-size: 12px !important;
  line-height: 1.55;
}

/* Revisões: datas e etapas precisam ser reconhecidas rapidamente, sem aproximação visual. */
html[data-egghead-theme="dark"] [data-screen="revisoes"] :is(
  .rev-summary-strip span,
  .rev-section-heading > span,
  .rev-field > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="revisoes"] :is(
  .rev-interval-heading > span,
  .rev-interval-editor b,
  .rev-timeline-preview > div > span,
  .rev-plan-marker,
  .rev-plan-progress > span,
  .rev-cycle-steps b,
  .rev-plan-card > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="revisoes"] .rev-compact-steps strong {
  font-size: 11px !important;
  line-height: 1.35;
}

/* Desempenho: métricas, escalas e cabeçalhos deixam de competir com o fundo. */
html[data-egghead-theme="dark"] [data-screen="desempenho"] :is(
  .performance-period > span,
  .performance-chart-axis span,
  .performance-card-heading > span,
  .hit-error-total span,
  .performance-table-row.heading > span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="desempenho"] :is(
  .performance-metric > span,
  .performance-goal-card > span,
  .performance-summary-card > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

/* Feedback: relatos e conversas são texto corrido e recebem uma escala de leitura real. */
html[data-egghead-theme="dark"] [data-screen="feedback"] :is(
  .fbx-summary span,
  .fbx-safety strong,
  .fbx-form-footer > span,
  .fbx-guide > strong
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="feedback"] :is(
  .fbx-card-head > b,
  .fbx-field-grid i,
  .fbx-guide > span,
  .fbx-ticket-type,
  .fbx-status,
  .fbx-original > span,
  .fbx-thread-label span,
  .fbx-thread article header > span,
  .fbx-thread article time
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="feedback"] .fbx-thread article header > strong {
  font-size: 11px !important;
}

html[data-egghead-theme="dark"] [data-screen="feedback"] :is(
  .fbx-original > p,
  .fbx-thread article > p
) {
  font-size: 12px !important;
  line-height: 1.55;
}

/* Tempo: histórico e distribuição diária passam a ser consultáveis sem esforço. */
html[data-egghead-theme="dark"] [data-screen="tempo"] :is(
  .timex-section-heading > span,
  .timex-running-status,
  .timex-new-subject-card > div > span,
  .timex-color-picker > span,
  .timex-history-nav > span,
  .timex-intensity-legend > span,
  .timex-week-grid > button > span,
  .timex-week-total > span,
  .timex-day-detail > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="tempo"] :is(
  .timex-active-card > footer span,
  .timex-active-card > footer strong,
  .timex-subject-share
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] [data-screen="tempo"] .timex-day-subjects :is(span, strong, b) {
  font-size: 11px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] [data-screen="tempo"] :is(
  .timex-active-heading,
  .timex-history-nav
) {
  color: var(--dark-text);
  background: var(--dark-raised) !important;
}

html[data-egghead-theme="dark"] [data-screen="tempo"] .timex-history-nav > button {
  color: var(--dark-text);
  background: var(--dark-inset) !important;
}

/* Reforço de especificidade contra regras funcionais legadas com !important. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="redacoes"] .red-score-band :is(span, b) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="revisoes"] :is(
  .rev-interval-heading span,
  .rev-plan-progress span,
  .rev-plan-card > footer > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="desempenho"] :is(
  .performance-goal-card footer span,
  .performance-summary-card > div > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="feedback"] :is(
  .fbx-guide ol li > span,
  .fbx-guide > footer > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="feedback"] .fbx-guide > footer > strong {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="tempo"] :is(
  .timex-history-nav > div > span,
  .timex-day-detail > footer span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

/* Configurações: estados da conta, metas e links passam a ter escala funcional. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="config"] :is(
  .cfgx-nav button > span,
  .profilex-state,
  .profilex-ranking-head > span,
  .profilex-ranking-me > span,
  .cfgx-section-head > b,
  .cfgx-goal-grid span,
  .cfgx-goal-preview > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="config"] :is(
  .cfgx-nav strong,
  .profilex-photo-field > span,
  .profilex-account > p,
  .cfgx-goal-grid strong,
  .profilex-institutional a
) {
  font-size: 11px !important;
  line-height: 1.45;
}

/* Raio X: recorte, incidência e cabeçalhos de tabela precisam ser comparáveis. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="raio-x"] :is(
  .xray-scope-strip span,
  .xray-card-heading > span,
  .xray-detail-card > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="raio-x"] :is(
  .xray-donut > span,
  .xray-rank,
  .xray-table-head > span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

/* Dashboard: agenda e progresso diário continuam compactos, mas deixam de ser microscópicos. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="dashboard"] .session-card > footer :is(span, strong) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="dashboard"] :is(
  .days-row b,
  .card-heading > .status,
  .simple-list > .list-row > .check,
  .simple-list > .list-row > time,
  .simple-list > .list-row > span:last-child
) {
  font-size: 10px !important;
  line-height: 1.35;
}

/* Listas: explicações do gerador e disponibilidade do banco viram texto de leitura. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="listas"] :is(
  .lists-summary > div > span,
  .list-step-heading p,
  .list-exam-selector > div > span,
  .list-years > span,
  .list-generator-footer > span,
  .list-preview-heading p
) {
  font-size: 11px !important;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="listas"] :is(
  .lists-quota span,
  .list-step-heading > strong
) {
  font-size: 10px !important;
  line-height: 1.35;
}

/* Banco: resumo, filtros e paginação ficam legíveis durante buscas repetidas. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="banco"] :is(
  .bank-summary span,
  .bank-filter-footer > span,
  .bank-recent-filters > strong,
  .bank-recent-filters > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="banco"] :is(
  .bank-filter-section-title > strong,
  .bank-progress > span,
  .bank-pagination span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="config"] .cfgx-nav nav a > span {
  font-size: 10px !important;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="config"] .profilex-account > footer > p {
  font-size: 11px !important;
  line-height: 1.45;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="raio-x"] :is(
  .xray-card-heading > div > span,
  .xray-detail-card > footer > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="raio-x"] .xray-donut > div > span {
  font-size: 10px !important;
  line-height: 1.35;
}

/* Anotações: filtros e eixos deixam de usar microtexto para conteúdo navegável. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="anotacoes"] :is(
  .anno-mode-tabs > button > span,
  .anno-axis-colors > span,
  .anno-library-filters button > strong,
  .anno-library-filters > footer > span
) {
  font-size: 10px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="anotacoes"] :is(
  .anno-tags-field > span,
  .anno-library-filters button > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

/* Meus erros: métricas e paginação recebem a mesma escala das demais telas analíticas. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="erros"] :is(
  .errors-period > span,
  .errors-pagination span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="erros"] .errors-metric > span {
  font-size: 11px !important;
  line-height: 1.4;
}

/* Avisos: o resumo permanece compacto, mas pode ser lido sem esforço. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="avisos"] .notice-summary span {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="avisos"] .notice-empty-state .notice-symbol {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid #665b3f;
  border-radius: 16px;
  color: #d8bb58;
  background: #302d25;
  box-shadow: 2px 2px 0 var(--dark-shadow-soft);
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="avisos"] .notice-empty-state .notice-symbol svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Últimos resíduos da auditoria global de tipografia. */
html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="simulados"] :is(
  .sim-optional-block > div > span,
  .sim-model-create > div > span
) {
  font-size: 11px !important;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] body.prototype-body .prototype-main [data-screen="cronograma"] :is(
  .crx-legend > b,
  .crx-editor-preview > span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

/* Tutorial: rótulos auxiliares continuam compactos sem cair em microtexto cansativo. */
html[data-egghead-theme="dark"] .egghead-tutorial :is(
  .egghead-tutorial-nav li,
  .egghead-tutorial-nav li b,
  .egghead-tutorial-sidebar footer,
  .egghead-tutorial-sidebar footer strong,
  .egghead-tutorial-kicker,
  .egghead-tutorial-counter,
  .egghead-tutorial-demo > header span,
  .egghead-tutorial-demo > header b,
  .egghead-tutorial-metrics span,
  .egghead-tutorial-row i,
  .egghead-tutorial-row b,
  .egghead-tutorial-timing span
) {
  font-size: 10px !important;
  line-height: 1.35;
}

html[data-egghead-theme="dark"] .egghead-tutorial .egghead-tutorial-nav li {
  font-size: 11px !important;
}

html[data-egghead-theme="dark"] .egghead-tutorial :is(
  .egghead-tutorial-tip small,
  .egghead-tutorial-demo-note
) {
  font-size: 11px !important;
  line-height: 1.45;
}

/* Visualizador de questões: remove o último cartão branco que aparecia sobre a tela. */
html[data-egghead-theme="dark"] .bank-image-viewer figure {
  border-color: var(--dark-border-strong);
  color: var(--dark-text);
  background: var(--dark-raised);
  box-shadow: 8px 8px 0 var(--dark-shadow);
}

html[data-egghead-theme="dark"] .bank-image-viewer figure > button {
  border-color: #181a1f;
  color: #181a1f;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--dark-shadow);
}

html[data-egghead-theme="dark"] .bank-image-viewer figcaption {
  color: var(--dark-body);
  font-size: 11px;
  line-height: 1.4;
}

html[data-egghead-theme="dark"] .anno-axes-modal header small {
  color: var(--dark-body);
  font-size: 11px;
  line-height: 1.45;
}

/* Controles nativos também acompanham a paleta, evitando pontos claros isolados. */
html[data-egghead-theme="dark"] {
  accent-color: var(--yellow);
  scrollbar-color: #646c79 var(--dark-inset);
}

html[data-egghead-theme="dark"] ::selection {
  color: #f2eee5;
  background: #66572f;
}

html[data-egghead-theme="dark"] :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

/* Movimento confortável: troca de telas sem deslocamento e indicadores sem piscar forte. */
@keyframes egghead-dark-screen-fade {
  from { opacity: .78; }
  to { opacity: 1; }
}

@keyframes egghead-dark-status-breathe {
  50% { opacity: .62; }
}

html[data-egghead-theme="dark"] .screen.is-visible {
  animation: egghead-dark-screen-fade .14s ease-out;
}

html[data-egghead-theme="dark"] :is(
  .migration-data-chip.is-loading > i,
  .migration-data-banner.is-loading .migration-data-icon,
  [data-screen="avisos"] .notice-summary-state.is-loading i,
  [data-screen="banco"] .bank-summary-state.is-loading i
) {
  animation: egghead-dark-status-breathe 1.8s ease-in-out infinite;
}

html[data-egghead-theme="dark"] .bank-youtube-loading i {
  background: linear-gradient(100deg, #252830 25%, #383d47 42%, #252830 60%) !important;
  background-size: 220% 100% !important;
  animation-duration: 2.2s;
}

html[data-egghead-theme="dark"] :is(
  .arx-library-loading span,
  .arx-loading span,
  .fbx-loading span,
  .crx-loading span,
  .timex-loading span
) {
  border-color: var(--dark-border) !important;
  border-top-color: var(--yellow) !important;
}

html[data-egghead-theme="dark"] ::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

html[data-egghead-theme="dark"]::-webkit-scrollbar:horizontal,
html[data-egghead-theme="dark"] body::-webkit-scrollbar:horizontal {
  height: 0;
}

html[data-egghead-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--dark-inset);
}

html[data-egghead-theme="dark"] ::-webkit-scrollbar-thumb {
  border: 3px solid var(--dark-inset);
  border-radius: 999px;
  background: #646c79;
}

html[data-egghead-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #777f8d;
}

@media (max-width: 700px) {
  html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
    .graphx-x-labels,
    .graphx-y-labels,
    .graph-live-x,
    .graph-live-y,
    .graphx-mini-chart > div
  ) {
    font-size: 10px !important;
  }

  html[data-egghead-theme="dark"] [data-screen="graficos"] :is(
    .graphx-comparison-table,
    .graph-live-table
  ) :is(strong, span, b) {
    font-size: 11px !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html[data-egghead-theme] body,
  html[data-egghead-theme] .topbar,
  html[data-egghead-theme] .test-card,
  html[data-egghead-theme] .icon-button {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-egghead-theme="dark"],
  html[data-egghead-theme="dark"] *,
  html[data-egghead-theme="dark"] *::before,
  html[data-egghead-theme="dark"] *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
