/* CliniFarma Design System — Etapa A. Escopo de tela; impressão mantém base branca. */
@media screen {
.cf-shell .ux-filter-shell,.cf-shell .evolution-card,.cf-shell .evaluation-detail,.cf-shell .bio-photo-card,.cf-shell .bio-actions-cell {background:var(--cf-surface);color:var(--cf-text);border-color:var(--cf-border);}
.cf-shell .evaluation-detail b,.cf-shell .ux-filter-main label > span,.cf-shell .ux-filter-secondary label,.cf-shell .ux-search-field > span {color:var(--cf-text);}
.cf-shell .agenda-tabs button,.cf-shell .ux-record-menu summary {background:var(--cf-surface);color:var(--cf-primary);border-color:var(--cf-border);min-height:42px;}
.cf-shell .agenda-tabs button.active {background:var(--cf-primary);color:var(--cf-on-primary);}
.cf-shell .ux-clear-filters {color:var(--cf-primary);}
.cf-shell .ux-menu-group {color:var(--cf-muted);}
.cf-shell .ux-menu-group.danger-group {color:var(--cf-danger);}
.cf-shell .bio-compact-table tr:hover .bio-actions-cell {background:var(--cf-raised);}
.cf-shell .bio-compact-table thead th:last-child {background:var(--cf-raised);}
@media (max-width:1024px) and (min-width:768px) {
 .cf-shell .ux-filter-main {grid-template-columns:repeat(2,minmax(0,1fr));}
}
}
@media screen {
:root {
 --cf-brand:#0059d6; --cf-brand-deep:#133a76; --cf-accent:#ffc72c;
 --cf-bg:#f3f6fb; --cf-surface:#ffffff; --cf-raised:#f8faff; --cf-text:#192b45; --cf-muted:#617188; --cf-border:#dce4ef;
 --cf-primary:var(--cf-brand); --cf-primary-soft:#eaf2ff; --cf-on-primary:#ffffff;
 --cf-danger:#b42318; --cf-danger-soft:#fff0ee; --cf-success:#156747;
 --cf-radius:14px; --cf-radius-sm:9px; --cf-radius-lg:20px;
 --cf-shadow:0 3px 16px rgb(24 52 88 / 4%); --cf-shadow-modal:0 24px 80px rgb(12 27 49 / 24%);
 --cf-space-1:4px; --cf-space-2:8px; --cf-space-3:12px; --cf-space-4:16px; --cf-space-5:24px; --cf-space-6:32px;
 --cf-sidebar:252px; --cf-font:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
 --cf-transition:160ms ease;
}
:root[data-cf-theme="dark"] {
 --cf-bg:#101925; --cf-surface:#182434; --cf-raised:#1e2d40; --cf-text:#e8eff9; --cf-muted:#a9b8cc; --cf-border:#344459;
 --cf-primary:#7bb5ff; --cf-primary-soft:#223d60; --cf-on-primary:#10233e;
 --cf-danger:#ffb4aa; --cf-danger-soft:#492c32; --cf-success:#83d6b4;
 --cf-shadow:0 3px 16px rgb(0 0 0 / 12%); --cf-shadow-modal:0 24px 80px rgb(0 0 0 / 45%);
}
body:has(.cf-shell),body:has(.cf-shell) .modal-backdrop {
 --blue:var(--cf-primary); --blue-2:var(--cf-primary); --gold:var(--cf-accent); --ink:var(--cf-text); --muted:var(--cf-muted); --line:var(--cf-border); --soft:var(--cf-raised); --white:var(--cf-surface);
 color:var(--cf-text); background:var(--cf-bg); font-family:var(--cf-font);
}
.cf-shell {display:grid;grid-template-columns:var(--cf-sidebar) minmax(0,1fr);min-height:100dvh;background:var(--cf-bg);font-size:14px;line-height:1.5;}
.cf-shell .sidebar {position:sticky;top:0;height:100dvh;overflow-y:auto;overscroll-behavior:contain;background:var(--cf-surface);color:var(--cf-muted);border-right:1px solid var(--cf-border);padding:24px 16px 16px;gap:20px;z-index:35;}
.cf-brand {display:flex;align-items:center;gap:10px;padding:0 6px;min-height:52px;}
.cf-brand img {width:196px;max-width:100%;padding:4px;background:#fff;border-radius:var(--cf-radius-sm);}
.cf-brand-mark {display:none;width:40px;height:40px;align-items:center;justify-content:center;background:var(--cf-primary-soft);color:var(--cf-primary);border-radius:12px;font-weight:850;font-size:19px;}
.cf-shell .nav {gap:4px;}
.cf-nav-group {font-size:10px;font-weight:750;letter-spacing:1.3px;text-transform:uppercase;color:var(--cf-muted);margin:15px 12px 5px;}
.cf-nav-group:first-child {margin-top:0;}
.cf-shell .nav button,.cf-shell .logout {display:flex;align-items:center;gap:12px;min-height:44px;padding:10px 12px;border-radius:var(--cf-radius-sm);font-size:13px;font-weight:550;color:var(--cf-muted);transition:background var(--cf-transition),color var(--cf-transition);}
.cf-icon {width:20px;height:20px;flex:none;}
.cf-shell .nav button:hover,.cf-shell .logout:hover {background:var(--cf-raised);color:var(--cf-text);}
.cf-shell .nav button.active {background:var(--cf-primary-soft);color:var(--cf-primary);font-weight:750;box-shadow:inset 3px 0 var(--cf-primary);}
.cf-shell .logout {margin-top:auto;border-top:1px solid var(--cf-border);border-radius:0;padding-top:16px;}
.cf-shell .main {padding:0 32px 32px;min-width:0;}
.cf-shell .topbar {height:100px;min-height:100px;margin:0 0 26px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--cf-border);}
.cf-header-context,.cf-header-tools,.cf-user {display:flex;align-items:center;gap:14px;min-width:0;}
.cf-shell .topbar h1 {font-size:24px;line-height:1.25;font-weight:750;letter-spacing:-.6px;color:var(--cf-text);margin:4px 0 0;}
.cf-eyebrow {font-size:9px;font-weight:750;letter-spacing:1.4px;color:var(--cf-muted);}
.cf-icon-button {display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;flex:none;border:1px solid var(--cf-border);border-radius:var(--cf-radius-sm);background:var(--cf-surface);color:var(--cf-muted);cursor:pointer;}
.cf-icon-button:hover {background:var(--cf-primary-soft);color:var(--cf-primary);}
.cf-avatar {width:38px;height:38px;border-radius:50%;display:grid;place-items:center;flex:none;color:var(--cf-brand-deep);background:var(--cf-accent);font-size:13px;font-weight:800;}
.cf-user-copy {display:grid;gap:1px;max-width:170px;}
.cf-user-copy strong {font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cf-user-copy small {font-size:10px;color:var(--cf-muted);}
.cf-shell .panel,.cf-shell .card {background:var(--cf-surface);border:1px solid var(--cf-border);border-radius:var(--cf-radius);padding:24px;box-shadow:var(--cf-shadow);min-width:0;}
.cf-shell .stat {position:relative;padding:24px;min-height:126px;}
.cf-shell .stat strong {font-size:32px;font-weight:750;letter-spacing:-1px;color:var(--cf-text);}
.cf-shell .stat span {font-size:12px;color:var(--cf-muted);}
.cf-shell h2 {font-size:19px;letter-spacing:-.35px;color:var(--cf-text);}
.cf-shell h3 {color:var(--cf-text);}
.cf-shell .grid {gap:20px;}
.cf-shell .empty {background:var(--cf-raised);color:var(--cf-muted);border-color:var(--cf-border);border-radius:var(--cf-radius-sm);padding:30px 18px;}
.cf-shell .btn,body:has(.cf-shell) .modal .btn {min-height:42px;border-radius:var(--cf-radius-sm);font-size:13px;font-weight:650;background:var(--cf-primary);color:var(--cf-on-primary);border:1px solid var(--cf-primary);box-shadow:none;transition:filter var(--cf-transition);}
.cf-shell .btn:hover,body:has(.cf-shell) .modal .btn:hover {filter:brightness(.94);}
.cf-shell .btn.secondary,body:has(.cf-shell) .modal .btn.secondary {background:var(--cf-surface);color:var(--cf-primary);border-color:var(--cf-border);}
.cf-shell .btn.danger,body:has(.cf-shell) .modal .btn.danger {background:var(--cf-danger-soft);color:var(--cf-danger);border-color:var(--cf-danger);}
.cf-shell .btn.gold {background:var(--cf-accent);color:var(--cf-brand-deep);}
.cf-shell :is(input,select,textarea),body:has(.cf-shell) .modal :is(input,select,textarea) {color:var(--cf-text);background:var(--cf-surface);border-color:var(--cf-border);border-radius:var(--cf-radius-sm);min-height:42px;font-size:14px;}
.cf-shell :is(input,textarea)::placeholder,body:has(.cf-shell) .modal :is(input,textarea)::placeholder {color:var(--cf-muted);opacity:1;}
.cf-shell :is(input,select,textarea):disabled,body:has(.cf-shell) .modal :is(input,select,textarea):disabled {background:var(--cf-raised);color:var(--cf-muted);opacity:1;}
.cf-shell :is(input[type=checkbox],input[type=radio]),body:has(.cf-shell) .modal :is(input[type=checkbox],input[type=radio]) {width:18px;height:18px;min-height:18px;flex:none;accent-color:var(--cf-primary);}
.cf-shell label,body:has(.cf-shell) .modal label {color:var(--cf-text);font-size:12px;}
.cf-shell :focus-visible,body:has(.cf-shell) .modal :focus-visible {outline:3px solid var(--cf-primary);outline-offset:3px;}
.cf-shell button:disabled,body:has(.cf-shell) .modal button:disabled {opacity:.55;cursor:not-allowed;}
.cf-shell table {color:var(--cf-text);border-collapse:collapse;width:100%;}
.cf-shell th {background:var(--cf-raised);color:var(--cf-muted);font-size:11px;font-weight:700;white-space:normal;}
.cf-shell :is(th,td) {border-color:var(--cf-border);padding:14px 12px;}
.cf-shell tbody tr:hover {background:var(--cf-raised);}
.cf-shell :is(.badge,.status-badge) {background:var(--cf-primary-soft);color:var(--cf-primary);border-radius:999px;padding:5px 10px;font-size:11px;}
.cf-shell :is(.ux-record-menu-panel,.ux-action-menu,.ux-menu-panel) {background:var(--cf-surface);border:1px solid var(--cf-border);color:var(--cf-text);box-shadow:var(--cf-shadow-modal);}
.cf-shell details.ux-record-menu > div {background:var(--cf-surface);color:var(--cf-text);border-color:var(--cf-border);}
.cf-shell .ux-menu-action {color:var(--cf-text);}
.cf-shell .ux-menu-action:hover {background:var(--cf-primary-soft);}
.cf-shell :is(.quick-link,.soft-panel,.patient-context,.agenda-toolbar,.agenda-filters,.ux-filter-panel) {background:var(--cf-surface);color:var(--cf-text);border-color:var(--cf-border);}
body:has(.cf-shell) .modal-backdrop {background:rgb(9 21 39 / 58%);z-index:100;}
body:has(.cf-shell) .modal {background:var(--cf-surface);color:var(--cf-text);border-color:var(--cf-border);border-radius:var(--cf-radius-lg);padding:26px;box-shadow:var(--cf-shadow-modal);max-height:90dvh;}
body:has(.cf-shell) .modal :is(.panel,.soft-panel,.card,.appointment-patient-picker) {background:var(--cf-raised);border-color:var(--cf-border);color:var(--cf-text);}
body:has(.cf-shell) .modal-close {background:var(--cf-raised);color:var(--cf-text);width:38px;height:38px;}
body:has(.cf-shell) .modal h2 {color:var(--cf-text);}
:root[data-cf-theme=dark] body:has(.cf-shell) {color-scheme:dark;}
:root[data-cf-theme=dark] .cf-shell :is(.notice,.alert,.warning,.bio-reading) {background:var(--cf-raised);color:var(--cf-text);border-color:var(--cf-border);}
:root[data-cf-theme=dark] .cf-shell :is(.chart-panel,.bio-dashboard,.bio-summary,.evaluation-detail-slot,.bio-metric-card) {background:var(--cf-surface);color:var(--cf-text);}
.cf-drawer-backdrop[hidden],.cf-drawer-close {display:none;}
:root[data-cf-collapsed=true] .cf-shell {--cf-sidebar:80px;}
:root[data-cf-collapsed=true] .cf-shell .sidebar {padding-inline:12px;}
:root[data-cf-collapsed=true] .cf-shell :is(.cf-nav-label,.cf-nav-group,.cf-brand img) {display:none;}
:root[data-cf-collapsed=true] .cf-brand-mark {display:flex;}
:root[data-cf-collapsed=true] .cf-shell .nav button {justify-content:center;padding-inline:8px;}
:root[data-cf-collapsed=true] .cf-shell .nav {gap:10px;}
@media (max-width:1100px) {
 .cf-shell .main {padding-inline:22px;}
 .cf-shell .grid.cols-4 {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:767px) {
 .cf-shell,:root[data-cf-collapsed=true] .cf-shell {display:block;--cf-sidebar:272px;}
 .cf-shell .sidebar {position:fixed;inset:0 auto 0 0;width:min(290px,86vw);height:100dvh;transform:translateX(-105%);transition:transform var(--cf-transition);z-index:70;padding:20px 16px;}
 .cf-shell.cf-drawer-open .sidebar {transform:translateX(0);}
 .cf-drawer-backdrop:not([hidden]) {display:block;position:fixed;inset:0;border:0;background:rgb(9 21 39 / 55%);z-index:60;}
 .cf-drawer-close {display:inline-flex;margin-left:auto;}
 .cf-drawer-lock {overflow:hidden;}
 :root[data-cf-collapsed=true] .cf-shell :is(.cf-nav-label,.cf-nav-group,.cf-brand img) {display:initial;}
 :root[data-cf-collapsed=true] .cf-shell .nav button {justify-content:flex-start;}
 :root[data-cf-collapsed=true] .cf-shell .cf-brand-mark {display:none;}
 .cf-shell .main {padding:0 16px 24px;}
 .cf-shell .topbar {height:82px;min-height:82px;gap:8px;margin-bottom:18px;}
 .cf-shell .topbar h1 {font-size:20px;}
 .cf-header-context,.cf-header-tools {gap:8px;}
 .cf-user-copy,.cf-eyebrow {display:none;}
 .cf-shell .panel,.cf-shell .card {padding:16px;}
 .cf-shell .grid.cols-3 {grid-template-columns:1fr;}
 .cf-shell .grid.cols-4 {grid-template-columns:repeat(2,minmax(0,1fr));}
 .cf-shell .stat {min-height:108px;}
 .cf-shell .stat strong {font-size:27px;}
 .cf-shell .panel:has(>table) {overflow-x:auto;}
 .cf-shell table {min-width:640px;}
 body:has(.cf-shell) .modal {width:100%;max-height:94dvh;padding:20px 16px;}
 body:has(.cf-shell) .modal-backdrop {padding:10px;}
 .cf-shell .grid {gap:12px;}
}
@media (prefers-reduced-motion:reduce) {.cf-shell * {transition:none!important;scroll-behavior:auto!important;}}
}
@media print {
 .cf-shell .sidebar,.cf-shell .topbar,.cf-drawer-backdrop {display:none!important;}
 .cf-shell {display:block!important;}
 .cf-shell .main {padding:0!important;}
 .cf-shell,.cf-shell * {color-scheme:light;}
}

/* Financeiro: contraste da tabela e dos cartões no tema escuro. */
@media screen {
 :root[data-cf-theme="dark"] .cf-shell #finance-receivables-panel table,
 :root[data-cf-theme="dark"] .cf-shell #finance-receivables-panel tbody tr {
  background:var(--cf-surface);color:var(--cf-text);
 }
 :root[data-cf-theme="dark"] .cf-shell #finance-receivables-panel tbody tr:hover,
 :root[data-cf-theme="dark"] .cf-shell #finance-receivables-panel tbody tr:hover td {
  background:var(--cf-raised);
 }
 :root[data-cf-theme="dark"] .cf-shell #finance-receivables-panel td::before {
  color:var(--cf-muted);
 }
}

/* Central de Início — Fase 1: scoped to the dashboard. */
.cf-shell .cf-start {display:grid;gap:20px;min-width:0;}
.cf-shell .cf-start-content {display:grid;gap:20px;min-width:0;}
.cf-shell .cf-start-welcome {display:flex;align-items:center;justify-content:space-between;gap:24px;border-left:4px solid var(--cf-accent);}
.cf-shell .cf-start-welcome h2 {margin:4px 0 10px;font-size:clamp(22px,2.6vw,30px);line-height:1.25;overflow-wrap:anywhere;}
.cf-shell .cf-start-welcome p {margin:4px 0;color:var(--cf-muted);}
.cf-shell .cf-start-welcome time {color:var(--cf-muted);max-width:250px;text-transform:capitalize;}
.cf-shell .cf-start-cards {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;}
.cf-shell .cf-start-stat {display:flex;flex-direction:column;align-items:flex-start;gap:10px;min-height:150px;width:100%;font:inherit;text-align:left;color:var(--cf-text);cursor:pointer;overflow-wrap:anywhere;}
.cf-shell .cf-start-stat strong {font-size:32px;line-height:1.1;color:var(--cf-primary);}
.cf-shell .cf-start-stat small {color:var(--cf-muted);margin-top:auto;}
.cf-shell .cf-start-stat:hover {border-color:var(--cf-primary);background:var(--cf-raised);}
.cf-shell .cf-start :is(button,summary):focus-visible {outline:3px solid var(--cf-primary);outline-offset:3px;}
.cf-shell .cf-start-shortcuts h2 {margin-top:0;}
.cf-shell .cf-start-shortcuts > div {display:flex;flex-wrap:wrap;gap:10px;}
.cf-shell .cf-start-section {padding:0;min-width:0;}
.cf-shell .cf-start-section summary {display:flex;align-items:center;gap:12px;padding:20px;cursor:pointer;list-style:none;font-size:17px;font-weight:700;min-height:60px;color:var(--cf-text);}
.cf-shell .cf-start-section summary::-webkit-details-marker {display:none;}
.cf-shell .cf-start-chevron {margin-left:auto;transition:transform var(--cf-transition);}
.cf-shell .cf-start-section[open] .cf-start-chevron {transform:rotate(180deg);}
.cf-shell .cf-start-section-body {padding:0 20px 20px;}
.cf-shell .cf-start-list {list-style:none;margin:0 0 16px;padding:0;}
.cf-shell .cf-start-list li {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid var(--cf-border);}
.cf-shell .cf-start-list li > div {min-width:0;overflow-wrap:anywhere;}
.cf-shell .cf-start-list p {margin:6px 0;color:var(--cf-muted);}
.cf-shell .cf-start-list .btn {flex-shrink:0;}
.cf-shell .cf-start-note {font-size:12px;margin:0;}
.cf-shell .cf-start-loading {min-height:180px;}
@media(max-width:1100px) {.cf-shell .cf-start-cards {grid-template-columns:repeat(2,minmax(0,1fr));}.cf-shell .cf-start-welcome {align-items:flex-start;flex-direction:column;gap:12px;}}
@media(max-width:767px) {.cf-shell .cf-start-list li {align-items:flex-start;flex-direction:column;}.cf-shell .cf-start-shortcuts > div {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}.cf-shell .cf-start .btn {white-space:normal;min-height:44px;}.cf-shell .cf-start-section {padding:0;}.cf-shell .cf-start-section summary {padding:16px;}.cf-shell .cf-start-section-body {padding:0 16px 16px;}}
@media(max-width:380px) {.cf-shell .cf-start-cards,.cf-shell .cf-start-shortcuts > div {grid-template-columns:1fr;}}
@media(prefers-reduced-motion:reduce) {.cf-shell .cf-start-chevron {transition:none;}}

/* Independent collapsible navigation groups; Início stays outside all groups. */
.cf-shell .cf-nav-section-group {display:grid;gap:4px;min-width:0;}
.cf-shell .cf-nav-section-items {display:grid;gap:4px;}
.cf-shell .cf-nav-section-items[hidden] {display:none!important;}
.cf-shell .nav .cf-nav-section-toggle {width:100%;margin-top:10px;font-size:11px;font-weight:750;text-transform:uppercase;letter-spacing:1px;min-width:0;}
.cf-shell .cf-nav-section-arrow {margin-left:auto;font-size:16px;transition:transform var(--cf-transition);}
.cf-shell .cf-nav-section-toggle[aria-expanded=false] .cf-nav-section-arrow {transform:rotate(-90deg);}
.cf-shell .cf-nav-section-current {display:none;font-size:10px;letter-spacing:0;text-transform:none;overflow-wrap:anywhere;}
.cf-shell .cf-nav-section-toggle[aria-expanded=false] .cf-nav-section-current {display:block;}
.cf-shell .cf-nav-section-toggle.cf-nav-section-active {color:var(--cf-primary);}
.cf-shell .cf-nav-section-toggle:focus-visible {outline:2px solid var(--cf-primary);outline-offset:2px;}
@media(min-width:768px) {:root[data-cf-collapsed=true] .cf-shell .cf-nav-section-current {display:none;}:root[data-cf-collapsed=true] .cf-shell .cf-nav-section-arrow {margin:0;}}
@media(prefers-reduced-motion:reduce) {.cf-shell .cf-nav-section-arrow {transition:none;}}
.cf-shell .nav {grid-template-columns:minmax(0,1fr);align-content:start;}

/* Retornos: preserve legibility of the existing table in the dark theme. */
@media screen {
 :root[data-cf-theme="dark"] .cf-shell .panel:has([data-return-action]) :is(table,tbody,tr,td) {background:var(--cf-surface);color:var(--cf-text);}
 :root[data-cf-theme="dark"] .cf-shell .panel:has([data-return-action]) tbody tr:hover,
 :root[data-cf-theme="dark"] .cf-shell .panel:has([data-return-action]) tbody tr:hover td {background:var(--cf-raised);}
}

/* Explicit recovery control for deliberate compact mode; legacy preferences start expanded. */
.cf-shell .cf-sidebar-expand {display:none;}
@media(min-width:768px) {
 :root[data-cf-collapsed=true] .cf-shell .cf-sidebar-expand {display:flex;align-items:center;justify-content:center;min-height:44px;width:100%;padding:8px 2px;border:1px solid var(--cf-border);border-radius:var(--cf-radius-sm);background:var(--cf-primary-soft);color:var(--cf-primary);font:inherit;font-size:11px;cursor:pointer;}
}

/* Screen-only repair of legacy surfaces; printed clinical documents keep their palette. */
@media screen {
 .cf-shell table, body:has(.cf-shell) .modal table {
  background:var(--cf-surface);color:var(--cf-text);
 }
 .cf-shell tbody tr, body:has(.cf-shell) .modal tbody tr {
  background:var(--cf-surface);
 }
 .cf-shell tbody tr:hover td, body:has(.cf-shell) .modal tbody tr:hover td {
  background:var(--cf-raised);color:var(--cf-text);
 }
 body:has(.cf-shell) .modal th {
  background:var(--cf-raised);color:var(--cf-muted);border-color:var(--cf-border);
 }
 .cf-shell .ux-record-menu-popover {
  background:var(--cf-surface);color:var(--cf-text);border-color:var(--cf-border);
 }
 .cf-shell .ux-record-menu[open] summary,.cf-shell .ux-filter-chip,.cf-shell .period-badge {
  background:var(--cf-primary-soft);color:var(--cf-primary);border-color:var(--cf-border);
 }
 .cf-shell .ux-filter-chip b {color:var(--cf-primary);}
 .cf-shell .ux-record-menu-popover .danger {color:var(--cf-danger);}
 .cf-shell :is(.evolution-weight>strong,.evolution-bar .bar-value,.metric-value,.bar-label,.imc-panel>b,.imc-donut strong) {color:var(--cf-text);}
 .cf-shell .evolution-weight .positive {color:var(--cf-success);}
 .cf-shell .imc-donut::before {background:var(--cf-surface);}
 .cf-shell .chart .value-label {fill:var(--cf-text);}
 :root[data-cf-theme="dark"] .cf-shell .evolution-weight .attention {color:var(--cf-accent);}
 :root[data-cf-theme="dark"] body:has(.cf-shell) .modal :is(.notice,.exam-selector,.exam-selector-toolbar,.exam-category-card,.exam-category-header,.exam-custom-field,.exam-selection-summary,.exam-form-footer) {
  background:var(--cf-surface);color:var(--cf-text);border-color:var(--cf-border);
 }
 :root[data-cf-theme="dark"] body:has(.cf-shell) .modal :is(.exam-category-title h3,.exam-search,.exam-option) {color:var(--cf-text);}
 :root[data-cf-theme="dark"] body:has(.cf-shell) .modal :is(.exam-category-icon,.exam-action-link,.exam-summary-item) {
  background:var(--cf-raised);color:var(--cf-text);border-color:var(--cf-border);
 }
 :root[data-cf-theme="dark"] body:has(.cf-shell) .modal :is(.exam-option:hover,.exam-option:has(input:checked),.exam-action-link:hover,.exam-summary-item:hover) {
  background:var(--cf-primary-soft);color:var(--cf-text);border-color:var(--cf-primary);
 }
 :root[data-cf-theme="dark"] body:has(.cf-shell) .modal .exam-summary-item b {color:var(--cf-danger);}
}

@media screen {
 .cf-shell .financial-strip {background:var(--cf-raised);color:var(--cf-text);}
 .cf-shell .financial-strip strong {color:var(--cf-text);}
}

@media screen {
 .cf-shell td[data-label]::before,body:has(.cf-shell) .modal td[data-label]::before {color:var(--cf-muted);}
}
