/* Semantic presentation layer. Existing layout, data and status meanings are preserved. */
:root { color-scheme: light; }
.appearance-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 88px; min-height: 40px; padding: 7px 12px; border: 1px solid #65758c; border-radius: 999px; color: #f4f7ff; background: #223650; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.appearance-toggle:hover { background: #354d6b; }
.appearance-toggle:focus-visible { outline: 3px solid #67e8d1; outline-offset: 3px; box-shadow: none; }
.appearance-toggle span:first-child { font-size: 20px; line-height: 1; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6edf7; --ink-soft: #afbed2; --muted: #afbed2;
  --navy: #cadbf5; --navy-deep: #0b1423;
  --blue: #8ab8f8; --blue-deep: #acd1ff; --blue-soft: #20354f;
  --aqua-soft: #153c38; --aqua-ink: #82e0c9;
  --amber-soft: #3a301b; --amber-ink: #f4d38a;
  --red: #f1a2ad; --red-soft: #422631;
  --surface: #172437; --canvas: #0d1726; --line: #344359; --line-strong: #566a85;
  --focus: #67e8d1; --shadow: 0 16px 42px #0004;
}
/* These component selectors also override legacy literal light colors. */
html[data-theme="dark"] .organized-workspace .report-workspace { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] :is(.task-panel, .progressive-section, .admin-record, .admin-editor, .readiness-item, .insight-card, .chat-thread, .chat-evidence-card, .chat-source-card, .ocr-review, .outcome-ring > span, .case-queue-item, .file-choice, .dataset-reset, .workspace-tab, .disposition-actions button, #patient-reference) { background: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] :is(.organized-workspace .control-panel, .admin-console, .report-metrics div, .analysis-card, .case-review-record, .dataset-provenance div, .progressive-section[open] > summary, .report-table th, .report-table thead, #case-source-evidence pre) { background: #1c2b40; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] :is(.intelligence-chart-card, .investigation-panel, .ai-workspace) { background: linear-gradient(145deg, #1c2b40, #152235); border-color: var(--line); }
html[data-theme="dark"] :is(.upload-form, .file-drop-zone, .chat-evidence-panel, .recommendation-disposition, .evidence-readiness) { background: #1a3045; border-color: var(--line-strong); }
html[data-theme="dark"] :is(.shell-navigation button.is-active, .admin-navigation button[aria-current="page"], .user-message, .outcome-filter.is-active, .primary-button, .admin-editor button[type="submit"]) { color: #fff; background: #315d93; border-color: #82b8fa; }
html[data-theme="dark"] :is(.shell-navigation button:hover, .report-table tbody tr:hover, .outcome-legend button:hover, .case-queue-item.is-selected) { background: var(--blue-soft); }
html[data-theme="dark"] :is(input, select, textarea, .secondary-button, .outcome-filter, .filter-chip, .admin-navigation button:not([aria-current="page"])) { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] :is(.primary-button:hover:not(:disabled), .filter-chip.is-active, .filter-chip:hover) { background: #426fa6; color: #fff; }
html[data-theme="dark"] #reference-bundle-file::file-selector-button { background: #315d93; color: #fff; }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: var(--ink-soft); opacity: 1; }
html[data-theme="dark"] :is(.financial-coverage, .admin-boundary, .quality-summary, .evidence-verified, .readiness-item.is-ready > span, .outcome-filter.pass, .case-outcome[data-status="PAID"]) { background: var(--aqua-soft); color: var(--aqua-ink); border-color: #4d998b; }
html[data-theme="dark"] :is(.quality-summary.has-issues, .evidence-unverified, .readiness-item.is-missing > span, .outcome-filter.flag) { background: var(--amber-soft); color: var(--amber-ink); border-color: #a68b50; }
html[data-theme="dark"] :is(.outcome-filter.reject, .case-outcome[data-status="DENIED"], .case-outcome[data-status="REJECTED"], .danger-button) { background: var(--red-soft); color: var(--red); border-color: #b47883; }
html[data-theme="dark"] :is(.outcome-filter.pass.is-active, .outcome-filter.flag.is-active, .outcome-filter.reject.is-active) { outline: 2px solid currentColor; outline-offset: 2px; }
html[data-theme="dark"] :is(.bar-track, .evidence-track) { background: #35455c; }
html[data-theme="dark"] :is(.outcome-legend button, .case-review-record ol, .chat-scope-controls label, .investigation-panel p, .investigation-panel li) { color: var(--ink); }
html[data-theme="dark"] :is(.selected-file, .case-queue-item span, .evidence-bar small, .review-stages span, .chat-answer-meta, .field-help, .report-scope-caption) { color: var(--ink-soft); }
html[data-theme="dark"] footer { color: var(--ink-soft); background: var(--canvas); }
html[data-theme="dark"] :is(.inspector-summary > div, .empty-illustration, .timeline-marker) { background: var(--surface); }
html[data-theme="dark"] .reference-table-scroll :is(th, td) { border-color: var(--line); }
html[data-theme="dark"] :is(button:disabled, input:disabled, select:disabled, textarea:disabled) { background: #2b394d; color: #a6b4c7; border-color: #536176; opacity: 1; }
@media (max-width: 600px) { .topbar { gap: 12px; padding-inline: 14px; flex-wrap: wrap; padding-block: 12px; } .topbar-context { gap: 8px; flex-wrap: wrap; } .appearance-toggle { min-height: 44px; } }
@media print { html[data-theme] { color-scheme: light; --ink: #172235; --ink-soft: #4d5c70; --surface: #fff; --canvas: #fff; --navy: #172a45; --line: #bdc8d2; } .appearance-toggle { display: none; } html[data-theme="dark"] body, html[data-theme="dark"] body * { color: #172235 !important; background: transparent !important; box-shadow: none !important; } }
