/* Permanent screen theme. Loaded last; printing and source documents keep their colors. */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1724;
    --surface: #172436;
    --surface-raised: #1e3046;
    --surface-hover: #253b52;
    --input-bg: #0f1d2e;
    --ink: #f0f5fc;
    --text: #c6d2e1;
    --muted: #b3c2d4;
    --line: #3a526d;
    --border: #3a526d;
    --control-border: #7891ad;
    --white: #172436;
    --green: #91bfff;
    --accent: #91bfff;
    --mint: #153149;
    --lime: #17362d;
    --amber: #ffd18a;
    --success: #a0e5c2;
    --success-soft: #14362e;
    --warning: #ffd18a;
    --warning-soft: #3d2d17;
    --danger: #ffacb3;
    --danger-soft: #3f222b;
    --info: #91c6ff;
    --info-soft: #153149;
    --button-ink: #101c2c;
    --focus: #9cc9ff;
    --shadow: 0 10px 32px #00000038;
    --company-efon: #9fbfff;
    --company-efon-soft: #203049;
    --company-es2: #ffc494;
    --company-es2-soft: #3a2c21;
    --company-zzsx: #84e2df;
    --company-zzsx-soft: #163838;
    --company-titan: #a0e5c2;
    --company-titan-soft: #17362d;
    --company-pf: #f3b1d5;
    --company-pf-soft: #3c2639;
    --company-default: #a0e5c2;
    --company-default-soft: #17362d;
    --area-accent: #91bfff;
    --area-soft: #153149;
    --chart-incoming: #a0e5c2;
    --chart-outgoing: #ffc494;
    --chart-1: #9fbfff;
    --chart-2: #ffc494;
    --chart-3: #a0e5c2;
    --chart-4: #cfb6ff;
    --chart-5: #84e2df;
    --chart-6: #e0caa7;
    --chart-grid: #3a526d;
    scrollbar-color: #7891ad #0e1724;
  }

  html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
  html[data-theme="dark"] :is(h1, h2, h3, h4, strong, legend) { color: var(--ink); }
  html[data-theme="dark"] a { color: var(--accent); }
  html[data-theme="dark"] ::selection { background: #91bfff; color: var(--button-ink); }

  /* Surface hierarchy, including module-specific cards and overlays. */
  html[data-theme="dark"] :is(
    .topbar, .panel, .metric, .analytics-stat, .analytics-panel, .analytics-empty,
    .company-overview, .business-card, .record-card, .entity-card, .integration-card,
    .finance-card, .finance-mobile-card, .kanban-card, .auth-card, .modal,
    .document-preview-dialog, .catalog-item, .catalog-table-wrap, .catalog-empty,
    .bank-account-card, .bank-metrics>div, .pm-card, .manual-topic, .manual-welcome,
    .manual-contents, .manual-status, .proposal-card, .connection-renewal-summary,
    .scope-bar, .scope-select, .filter-row, .catalog-toolbar, .obra-context,
    .entry-picker, .attendance-person, .account-suggestion-panel,
    .account-suggestion-list article, .registry-assist-panel, .case-lookup-panel,
    .fee-preview-list, .document-row, .skip-link
  ) { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: none; }
  html[data-theme="dark"] .metric-row .metric { background: var(--surface); border-color: var(--line); }
  html[data-theme="dark"] .metric .metric-value { color: var(--ink); }
  html[data-theme="dark"] .metric:nth-child(2) .metric-value { color: var(--success); }
  html[data-theme="dark"] .metric:nth-child(4) .metric-value { color: var(--warning); }
  html[data-theme="dark"] .subnav { background: var(--surface); border-color: var(--line); }

  html[data-theme="dark"] :is(
    .modal-footer, .calculation, .receipt-preview, .kanban-column,
    .assisted-entry, .document-upload-zone, .administrator-row, .raw-json,
    .source-list blockquote, .entry-project-property, .entry-payment-preview,
    .finance-supplier-panel, .document-preview, .document-pdf-scroll,
    .manual-identity, .manual-context-note, .manual-notes, .pm-shortcuts, .pm-criteria,
    .contact-history-shortcut, .contact-confirm-panel, .bank-balance-note,
    .bank-match-summary, .invoice-read-summary, .catalog-create-panel, .prep-tax-row,
    .catalog-view-options, .segmented, .analytics-focus
  ) { background: var(--surface-raised); color: var(--text); border-color: var(--line); }

  html[data-theme="dark"] :is(
    .business-card:hover, .catalog-item:hover, .todo-item:hover, .family-person:hover,
    .data-table tbody tr:hover, .catalog-table tbody tr:hover, .analytics-month-table tr.selected,
    .segmented button.active, .analytics-focus button.active, .catalog-view-options button.active
  ) { background: var(--surface-hover); color: var(--ink); border-color: var(--control-border); }

  html[data-theme="dark"] :is(.auth-shell, .starting) { background: var(--bg); }
  html[data-theme="dark"] .auth-story { background: linear-gradient(145deg, #142d45, #102031); color: var(--ink); }
  html[data-theme="dark"] :is(.auth-story p, .auth-story small, .auth-businesses span) { color: var(--text); }
  html[data-theme="dark"] .auth-businesses span { border-color: var(--line); background: var(--surface-raised); }
  html[data-theme="dark"] .modal-backdrop,
  html[data-theme="dark"] .nav-scrim { background: #050c16b8; }
  html[data-theme="dark"] .document-preview-dialog::backdrop { background: #050c16b8; }
  html[data-theme="dark"] #toast { background: #253b52; color: var(--ink); border: 1px solid var(--control-border); }

  /* Navigation retains the selected Analytical geometry. */
  html[data-theme="dark"] .sidebar.analytical-sidebar { background: #0b1420; color: var(--text); }
  html[data-theme="dark"] .analytical-sidebar :is(.nav-item, .sidebar-mode, .nav-section) { color: var(--muted); }
  html[data-theme="dark"] .analytical-sidebar :is(.nav-item:hover, .sidebar-mode:hover) { background: var(--surface-raised); color: var(--ink); }
  html[data-theme="dark"] .analytical-sidebar .nav-item.active { background: #243d5c; color: var(--ink); box-shadow: inset 3px 0 var(--focus); }
  html[data-theme="dark"] .analytical-sidebar .sidebar-scroll { scrollbar-color: var(--control-border) #0b1420; }
  html[data-theme="dark"] :is(.sidebar-bottom, .topbar, .workspace-sections, .subnav, .analytics-data-note, .analytics-panel-foot) { border-color: var(--line); }
  html[data-theme="dark"] :is(.subnav button, .workspace-sections button, .segmented button, .analytics-focus button, .catalog-tabs button, .catalog-property-tabs button) { color: var(--text); }
  html[data-theme="dark"] :is(.subnav button.active, .workspace-sections button.active, .catalog-tabs button.active, .catalog-property-tabs button.active) { color: var(--accent); border-color: var(--accent); }
  html[data-theme="dark"] :is(.family-person, .catalog-property-tabs button) { background: var(--surface); border-color: var(--control-border); color: var(--ink); }
  html[data-theme="dark"] :is(.avatar, .business-card .business-icon, .todo-icon, .catalog-portrait, .manual-welcome-mark, .manual-topic-number, .manual-symbol) { background: var(--surface-raised); color: var(--accent); }
  html[data-theme="dark"] .analytical-workspace-picker select { color: var(--ink); }
  html[data-theme="dark"] .analytical-workspace-picker label { color: var(--muted); }

  /* Companies retain different hues; bright accents are legible on dark surfaces. */
  html[data-theme="dark"] :is(.area-kicker, .area-breadcrumb, .area-badge, .analytical-workspace-mark) { color: var(--area-accent); }
  html[data-theme="dark"] .area-badge { background: var(--area-soft); border-color: var(--area-accent); }
  html[data-theme="dark"] :is([data-area="obr"], [data-area="vei"]) { --area-accent: #ffc494 !important; --area-soft: #3a2c21 !important; }
  html[data-theme="dark"] [data-area="inv"] { --area-accent: #a0e5c2 !important; --area-soft: #17362d !important; }
  html[data-theme="dark"] :is([data-area="adm"], [data-area="imo"]) { --area-accent: #84e2df !important; --area-soft: #163838 !important; }
  html[data-theme="dark"] :is([data-area="jur"], [data-area="pat"]) { --area-accent: #cfb6ff !important; --area-soft: #332744 !important; }
  html[data-theme="dark"] :is([data-area="pes"], [data-area="edu"]) { --area-accent: #f3b1d5 !important; --area-soft: #3c2639 !important; }
  html[data-theme="dark"]:is([data-area="obr"], [data-area="vei"]) { --area-accent: #ffc494 !important; --area-soft: #3a2c21 !important; }
  html[data-theme="dark"][data-area="inv"] { --area-accent: #a0e5c2 !important; --area-soft: #17362d !important; }
  html[data-theme="dark"]:is([data-area="adm"], [data-area="imo"]) { --area-accent: #84e2df !important; --area-soft: #163838 !important; }
  html[data-theme="dark"]:is([data-area="jur"], [data-area="pat"]) { --area-accent: #cfb6ff !important; --area-soft: #332744 !important; }
  html[data-theme="dark"]:is([data-area="pes"], [data-area="edu"]) { --area-accent: #f3b1d5 !important; --area-soft: #3c2639 !important; }
  html[data-theme="dark"] [data-area="ger"], html[data-theme="dark"][data-area="ger"] { --area-accent: #c4d3ca !important; --area-soft: #26302b !important; }
  html[data-theme="dark"] .contact-channel-list>.form-section-label { color: var(--muted); }
  html[data-theme="dark"] .invoice-read-fields dt { color: var(--muted); }

  /* Controls: backgrounds, labels, placeholders and native date/select widgets. */
  html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    color: var(--ink); background-color: var(--input-bg); border-color: var(--control-border); color-scheme: dark;
  }
  html[data-theme="dark"] :is(input, textarea)::placeholder { color: #a5b6ca; opacity: 1; }
  html[data-theme="dark"] :is(input, select, textarea):disabled { color: var(--muted); background-color: var(--surface-raised); }
  html[data-theme="dark"] :is(input, select, textarea):read-only:not(select) { border-color: var(--control-border); }
  html[data-theme="dark"] option { background: var(--input-bg); color: var(--ink); }
  html[data-theme="dark"] :is(.field-search, .catalog-search) {
    background: var(--input-bg); color: var(--muted); border-color: var(--control-border);
  }
  html[data-theme="dark"] :is(.field-search, .catalog-search) input {
    background: transparent; flex: 1; min-width: 0;
  }
  html[data-theme="dark"] :is(input, textarea):-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px var(--input-bg) inset; caret-color: var(--ink); }
  html[data-theme="dark"] :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--accent); }
  html[data-theme="dark"] :is(.btn, .search-launch) { color: var(--ink); background: var(--surface-raised); border-color: var(--control-border); }
  html[data-theme="dark"] :is(.btn.secondary, .btn:hover, .btn.secondary:hover) { color: var(--ink); background: var(--surface-hover); border-color: var(--control-border); }
  html[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--button-ink); filter: none; }
  html[data-theme="dark"]:not([data-area="neutral"]) #main .btn.primary,
  html[data-theme="dark"] .modal[data-area]:not([data-area="neutral"]) .btn.primary { background: var(--area-accent); border-color: var(--area-accent); color: var(--button-ink); filter: none; }
  html[data-theme="dark"] .btn.primary:hover { box-shadow: inset 0 0 0 2px #101c2c4d; filter: none; }
  html[data-theme="dark"] :is(.btn.primary strong, .btn.primary .icon) { color: inherit; }
  html[data-theme="dark"] :is(.text-btn, .search-launch kbd, .icon-btn, .loader) { color: var(--accent); }
  html[data-theme="dark"] :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
  html[data-theme="dark"] :is(.entry-picker-choice, .finance-direction-choice) { background: var(--input-bg); border-color: var(--control-border); color: var(--ink); }
  html[data-theme="dark"] :is(.entry-picker-choice, .finance-direction-choice):has(input:checked) { background: var(--info-soft); border-color: var(--focus); }
  html[data-theme="dark"] :is(.entry-picker-mark, .finance-direction-mark) { border-color: var(--control-border); }
  html[data-theme="dark"] :is(.entry-picker-choice input:checked+.entry-picker-mark, .finance-direction-choice input:checked+.finance-direction-mark) { background: var(--accent); border-color: var(--accent); color: var(--button-ink); }
  html[data-theme="dark"] :is(.entry-picker-choice, .finance-direction-choice):has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

  /* Menus with suggestions are readable in every assisted registration. */
  html[data-theme="dark"] :is(.finance-supplier-options, .registry-name-options, .tok-phone-area-options) { background: var(--input-bg); border-color: var(--control-border); }
  html[data-theme="dark"] :is(.finance-supplier-option, .registry-name-option, .tok-phone .tok-phone-area-option) { background: var(--input-bg); color: var(--ink); border-color: var(--line); }
  html[data-theme="dark"] :is(.finance-supplier-option:hover, .finance-supplier-option[aria-selected="true"], .registry-name-option:hover, .registry-name-option[aria-selected="true"], .tok-phone .tok-phone-area-option:hover, .tok-phone .tok-phone-area-option.is-active, .tok-phone .tok-phone-area-option[aria-selected="true"]) { background: var(--surface-hover); color: var(--ink); }
  html[data-theme="dark"] .tok-phone .tok-phone-area-toggle { color: var(--accent); }

  /* Descriptive copy keeps strong contrast even when visually secondary. */
  html[data-theme="dark"] :is(
    .page-heading p, .header-clock, .analytical-context small, .workspace-footer,
    .eyebrow, .preview-tag, .greeting, .scope-label, .scope-summary, .demo-bar,
    .metric-top, .metric-caption, .metric-foot, .panel-head p, .chart-meta, .chart-note,
    .business-card p, .business-card small, .business-card>.icon, .company-overview p,
    .company-counts, .other-companies summary, .form-field label, .calculation span,
    .details-grid dt, .steps span, .finance-card-sub, .finance-card-foot, .table-footer,
    .entry-tax-note, .finance-supplier-status, .finance-supplier-summary, .finance-supplier-native summary,
    .address-status, .address-source, .registry-assist-status, .case-lookup-status,
    .access-profile p, .access-profile small, .access-template-library>p,
    .account-governance>p, .account-suggestion-panel>p, .attendance-person span,
    .attendance-person small, .attendance-note p, .bank-account-card small,
    .banking p, .banking small, .bank-metrics span, .bank-filters label,
    .bank-field small, .bank-history summary, .bank-automation summary,
    .connection-renewal-summary>p, .integration-card p, .integration-card small,
    .integration-settings summary, .contact-history-shortcut p, .contact-confirm-panel p,
    .contact-approval-panel p, .finance-direction-copy small, .pm-heading p,
    .pm-section-title p, .pm-filter label, .pm-card span, .pm-criteria summary,
    .tok-phone-label, .tok-phone-hint, .tok-phone-region, .tok-phone-no-results,
    .tok-phone .tok-phone-area-option small, .catalog-field-label, .catalog-facts dt,
    .catalog-company-links small, .catalog-note, .catalog-search>svg,
    .catalog-create-panel p, .catalog-create-panel>label, .catalog-empty>svg,
    .manual-welcome p, .manual-field, .manual-contents>p, .manual-topic summary p,
    .manual-topic-chevron, .manual-steps p, .manual-notes li, .manual-essentials p,
    .manual-footnote, .manual-status p, .media-link small, .tab-order,
    .analytics-basis, .analytics-basis .icon, .analytics-field, .analytics-stat>span,
    .analytics-stat>small, .analytics-panel-head p, .analytics-legend,
    .analytics-panel-foot, .analytics-cost-legend>div, .analytics-data-note,
    .analytics-chart-empty, .analytics-property-row>div:first-child,
    .analytics-note, .analytics-access-note, .analytics-empty p
  ) { color: var(--muted); }
  html[data-theme="dark"] :is(
    .business-card h3, .company-counts strong, .finance-card-title, .finance-card-value,
    .metric-value, .analytics-stat>strong, .analytics-panel-head h2,
    .analytics-panel-foot strong, .analytics-cost-legend strong, .analytics-empty h2,
    .analytics-property-row strong, .bank-metrics strong, .catalog-facts dd,
    .catalog-company-links>div>span, .catalog-empty h3, .todo-item strong
  ) { color: var(--ink); }

  html[data-theme="dark"] :is(.data-table th, .catalog-table th, .bank-preview-table thead) { background: var(--surface-raised); color: var(--muted); border-color: var(--line); }
  html[data-theme="dark"] :is(.data-table td, .catalog-table td, .analytics-month-table th, .analytics-month-table td) { color: var(--text); border-color: var(--line); }
  html[data-theme="dark"] :is(.data-table small, .access-workspace .data-table small, .pm-workspace .data-table small, .analytics-month-table thead th) { color: var(--muted); }
  html[data-theme="dark"] .analytics-month-table tbody button { color: var(--accent); text-decoration-color: var(--accent); }
  html[data-theme="dark"] .analytics-month-table td:last-child { color: var(--ink); }
  html[data-theme="dark"] :is(.analytics-progress, .catalog-tabs button span, .catalog-property-tabs button span) { background: var(--surface-hover); color: var(--ink); }
  html[data-theme="dark"] :is(.catalog-company-links>div, .entry-installments>div, .entry-installment) { border-color: var(--line); }
  html[data-theme="dark"] .registry-catalog {
    --catalog-ink: var(--ink); --catalog-muted: var(--muted);
    --catalog-line: var(--line); --catalog-accent: var(--accent); --catalog-soft: var(--info-soft);
    color: var(--text);
  }

  /* Semantic states remain text + color, rather than color alone. */
  html[data-theme="dark"] :is(.tag, .tag.gray, .bank-status, .connection-state, .catalog-badge) { background: var(--surface-hover); color: var(--text); border-color: var(--line); }
  html[data-theme="dark"] :is(.tag.green, .bank-status.reconciled, .connection-state.automatic, .contact-confirmed, .contact-approval-badge.approved, .catalog-badge.own) { background: var(--success-soft); color: var(--success); border-color: var(--success); }
  html[data-theme="dark"] :is(.tag.amber, .bank-status.pending, .connection-state.retrying, .contact-approval-badge.preapproved, .catalog-badge.pending, .demo-pill) { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
  html[data-theme="dark"] :is(.tag.red, .connection-state.requires-action) { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
  html[data-theme="dark"] :is(.tag.blue, .catalog-badge.managed, .analytics-unit, .manual-actions span) { background: var(--info-soft); color: var(--info); border-color: var(--info); }
  html[data-theme="dark"] :is(.info-note, .invoice-notice, .invoice-contact-hint) { background: var(--info-soft); color: var(--info); border-color: var(--info); }
  html[data-theme="dark"] :is(.info-note.amber, .alert-card, .invoice-notice-review, .invoice-missing, .invoice-conflicts, .finance-supplier-warning, .contact-warning, .analytics-warning) { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
  html[data-theme="dark"] :is(.alert-card strong, .alert-card p, .invoice-missing strong, .invoice-conflicts strong, .invoice-conflict dt) { color: var(--warning); }
  html[data-theme="dark"] :is(.invoice-notice-error, .error-text:not(:empty), #bank-form-error:not(:empty), .contact-approval-panel>.error-text:not(:empty)) { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
  html[data-theme="dark"] :is(.danger-text, .tok-phone-error, .bank-debit) { color: var(--danger); }
  html[data-theme="dark"] :is(.bank-credit, .analytics-stat>.analytics-positive, .metric-foot .positive, .connection-renewal-summary>div) { color: var(--success); }
  html[data-theme="dark"] .connection-renewal-summary.requires-action { border-color: var(--danger); }
  html[data-theme="dark"] .connection-renewal-summary.requires-action>div { color: var(--danger); }
  html[data-theme="dark"] :is(.bank-account-card.selected, .attendance-person.selected) { background: var(--info-soft); border-color: var(--focus); }
  html[data-theme="dark"] :is(.manual-eyebrow, .manual-context-note .text-btn, .manual-notes h3) { color: var(--accent); }
  html[data-theme="dark"] .manual-contents button { background: transparent; color: var(--text); }
  html[data-theme="dark"] .manual-contents button:hover { background: var(--surface-hover); color: var(--ink); }
  html[data-theme="dark"] :is(.manual-contents button span, .manual-steps li::before) { background: var(--info-soft); color: var(--info); }

  /* Chart values and series use theme tokens; labels and dash patterns remain. */
  html[data-theme="dark"] :is(.analytics-cartesian text, .analytics-donut text, .cash-chart text) { fill: var(--muted); }
  html[data-theme="dark"] .analytics-donut text.analytics-donut-total { fill: var(--ink); }
  html[data-theme="dark"] .cash-chart line { stroke: var(--chart-grid); }
  html[data-theme="dark"] .analytics-incoming { background: var(--chart-incoming); }
  html[data-theme="dark"] .analytics-outgoing { background: var(--chart-outgoing); }

  /* The positive logo and original files retain their source colors. */
  html[data-theme="dark"] .topbar .tok-logo-frame { background: #fff; border-radius: 8px; padding: 6px 8px; }
  html[data-theme="dark"] :is(.document-preview-frame, .document-preview-image, .document-pdf-scroll canvas, .registry-preview) { background: #fff; }
}

@media print {
  html[data-theme="dark"] { color-scheme: light; }
}

@media (forced-colors: active) {
  html[data-theme="dark"] :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: Highlight; }
  html[data-theme="dark"] :is(input[type="checkbox"], input[type="radio"]) { accent-color: auto; }
}

/* Obra modules share the permanent theme; PDF/image pixels remain unchanged. */
@media screen {
  html[data-theme="dark"] .wm-workspace { --wm-accent: var(--success); --wm-border: var(--line); }
  html[data-theme="dark"] :is(.wm-list-item, .wm-detail, .wm-empty, .wm-category) { background: var(--surface); color: var(--text); border-color: var(--line); }
  html[data-theme="dark"] .wm-list-item:hover { background: var(--surface-hover); border-color: var(--control-border); }
  html[data-theme="dark"] .wm-list-item.is-active { background: var(--info-soft); border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
  html[data-theme="dark"] :is(.wm-list-item, .wm-category):focus-visible { outline-color: var(--focus); }
  html[data-theme="dark"] .wm-status { background: var(--surface-raised); color: var(--ink); }
  html[data-theme="dark"] :is(.wm-status-approved, .wm-status-released, .wm-status-done) { background: var(--success-soft); color: var(--success); }
  html[data-theme="dark"] :is(.wm-status-returned, .wm-status-edited) { background: var(--warning-soft); color: var(--warning); }
  html[data-theme="dark"] :is(.wm-status-author_approved, .wm-status-review) { background: var(--info-soft); color: var(--info); }
  html[data-theme="dark"] .wm-status-superseded { background: var(--surface-raised); color: var(--muted); }
  html[data-theme="dark"] .wm-approval-grid > div { background: var(--input-bg); border-color: var(--line); }
  html[data-theme="dark"] .wm-approval-grid span { background: var(--surface-hover); color: var(--ink); }
  html[data-theme="dark"] .wm-approval-grid .complete { background: var(--success-soft); border-color: var(--success); }
  html[data-theme="dark"] .wm-approval-grid .complete span { background: var(--success); color: var(--button-ink); }
  html[data-theme="dark"] :is(.wm-read-grid h3, .wm-section h3, .wm-meta strong) { color: var(--ink); }
  html[data-theme="dark"] :is(.wm-read-grid section, .wm-history, .wm-history-changes section) { border-color: var(--line); }
  html[data-theme="dark"] .wm-reminders { background: var(--warning-soft); border-color: var(--warning); }
  html[data-theme="dark"] :is(.wm-reminders > p, .wm-reminder small) { color: var(--warning); }
  html[data-theme="dark"] .wm-count { background: var(--surface-raised); color: var(--ink); }
  html[data-theme="dark"] .wm-reminder { border-color: var(--line); }
  html[data-theme="dark"] .wm-form-error { color: var(--danger); }
  html[data-theme="dark"] .wm-private { background: var(--info-soft); border-color: var(--line); }
  html[data-theme="dark"] .wm-history pre { background: var(--input-bg); color: var(--text); }
  html[data-theme="dark"] .wm-category.is-active { background: var(--accent); color: var(--button-ink); border-color: var(--accent); }
  html[data-theme="dark"] .wm-revision.is-current { background: var(--success-soft); border-left-color: var(--success); }
  html[data-theme="dark"] :is(.wm-pdf, .wm-pdf.is-expanded, .wm-source) { background: var(--surface-raised); color: var(--text); }
  html[data-theme="dark"] .wm-history-before { background: var(--danger-soft); color: var(--danger); }
  html[data-theme="dark"] .wm-history-after { background: var(--success-soft); color: var(--success); }
  html[data-theme="dark"] .work-reminder-bar { background: var(--surface-raised); color: var(--text); border-color: var(--warning); }
}

/* 0.11.4 (Claude): contraste no tema escuro — grupos de Patrimônio e listas de seleção dos relatórios. */
@media screen {
  html[data-theme="dark"] .check-row { color: var(--text); }
  html[data-theme="dark"] .access-scope-options .check-row { border-color: var(--line); }
  html[data-theme="dark"] .access-scope-options .check-row:has(input:checked) { background: var(--info-soft); border-color: var(--focus); color: var(--ink); }
  html[data-theme="dark"] .catalog-asset-groups button { background: var(--surface); border-color: var(--line); color: var(--text); }
  html[data-theme="dark"] .catalog-asset-groups button:hover { background: var(--surface-hover); }
  html[data-theme="dark"] .catalog-asset-groups button.active { background: var(--surface-hover); border-color: var(--accent); color: var(--ink); }
}
