/* VisuoSight v122.0.23.2.1 — focused surface/contrast repair.
 * Loaded AFTER v122.0.23.2. Preserve the original Light theme.
 * Only clinician chrome is themed. No clinical stimulus, test target,
 * diagnostic display geometry, calibrated color or print report changes.
 */

/* The Appearance popover is portaled directly to body. Fixed coordinates from
 * the trigger prevent the sticky patient bar from clipping/covering it. */
body > .vt-theme-menu {
  position:fixed !important;
  z-index:12000 !important;
  right:auto !important;
  display:grid;
  gap:3px;
  min-width:168px;
  padding:7px;
  border:1px solid #c4d4e7;
  border-radius:12px;
  background:#fff;
  color:#253e5a;
  box-shadow:0 18px 42px rgba(9,24,43,.25);
  font:700 12px/1.25 Inter,system-ui,sans-serif;
}
body > .vt-theme-menu[hidden] {display:none !important;}
body > .vt-theme-menu .vt-theme-choice {
  display:block;width:100%;min-height:42px;
  padding:10px 12px;border:0;border-radius:8px;
  background:transparent;color:#294361;
  font:inherit;text-align:left;cursor:pointer;
}
body > .vt-theme-menu .vt-theme-choice:is(.selected,:hover,:focus-visible){
  background:#e7f1fe;color:#194c85;
}
body > .vt-theme-menu .vt-theme-choice.selected::before {
  content:'✓';padding-right:9px;
}
body > .vt-theme-menu .vt-theme-choice:focus-visible {
  outline:3px solid #7bb4f5;outline-offset:1px;
}
@media screen {
  html[data-vt-theme="dark"] body > .vt-theme-menu{
    background:#20324b;color:#f0f6ff;border-color:#53718f;
    box-shadow:0 18px 42px rgba(0,0,0,.54);
  }
  html[data-vt-theme="dark"] body > .vt-theme-menu .vt-theme-choice{
    color:#e6f0fe;
  }
  html[data-vt-theme="dark"] body > .vt-theme-menu .vt-theme-choice:is(.selected,:hover,:focus-visible){
    background:#345374;color:#fff;
  }

  /* VisuoSight design tokens, all foreground/surface pairs checked together. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 {
    --vt-theme-bg:#0f1929;
    --vt-theme-panel:#18283d;
    --vt-theme-tile:#20334b;
    --vt-theme-input:#112238;
    --vt-theme-border:#39536f;
    --vt-theme-title:#eef5ff;
    --vt-theme-text:#dce9f9;
    --vt-theme-muted:#b5c9df;
    --vt-theme-link:#98c7ff;
  }

  /* The dashboard home CSS uses its own names, not .vt-panel/.vt-card.
   * This is the underlying white-on-white bug reported in Safari. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview.doctor-dashboard-home-v121292{
    background:var(--vt-theme-panel)!important;
    border-color:var(--vt-theme-border)!important;
    color:var(--vt-theme-text)!important;
    box-shadow:0 8px 24px rgba(0,0,0,.15)!important;
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-home-head,.doctor-dashboard-calibration-overview,
    .doctor-dashboard-card-head
  ){border-color:var(--vt-theme-border)!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-summary-card,.doctor-dashboard-command-card,
    .doctor-dashboard-patient-row,.doctor-dashboard-attention-row,
    .doctor-dashboard-active-identity,.doctor-dashboard-empty,
    .doctor-dashboard-loading,.doctor-dashboard-clear-state,
    .doctor-dashboard-quick-grid button,.doctor-dashboard-quick-grid a,
    .doctor-dashboard-calibration-link,.doctor-clinic-logo-preview
  ){
    color:var(--vt-theme-text)!important;
    background:var(--vt-theme-tile)!important;
    background-image:none!important;
    border-color:var(--vt-theme-border)!important;
    box-shadow:none!important;
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-home-head h2,.doctor-dashboard-card-head h3,
    .doctor-dashboard-calibration-copy h3,.doctor-dashboard-summary-card strong,
    .doctor-dashboard-patient-copy strong,.doctor-dashboard-attention-copy strong,
    .doctor-dashboard-quick-grid strong,.doctor-clinic-summary h3
  ){color:var(--vt-theme-title)!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-home-head p,.doctor-dashboard-card-head p,
    .doctor-dashboard-calibration-copy p,.doctor-dashboard-summary-card small,
    .doctor-dashboard-summary-label,.doctor-dashboard-patient-copy span,
    .doctor-dashboard-attention-copy span,.doctor-dashboard-quick-grid small,
    .doctor-clinic-summary p,.doctor-dashboard-empty,
    .doctor-dashboard-loading,.doctor-dashboard-clear-state
  ){color:var(--vt-theme-muted)!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-text-action,.doctor-dashboard-recent-list a,
    .doctor-dashboard-calibration-link small,.doctor-dashboard-quick-grid a:hover
  ){color:var(--vt-theme-link)!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-row-action,.doctor-dashboard-active-actions button:not(.primary),
    .doctor-dashboard-quick-icon,.doctor-dashboard-patient-avatar
  ){background:#294664!important;border-color:#52708f!important;color:#d8edff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-dashboard-summary-icon,.doctor-dashboard-attention-mark
  ){background:#294663!important;color:#badbff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview .doctor-dashboard-count-badge{
    background:#46361e!important;color:#f8d297!important;border-color:#80643c!important;
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview .doctor-dashboard-clear-state strong {
    color:#89e2bb!important;
  }

  /* Package summary injected by commercial-entitlements.js at runtime.
   * Its CSS is dynamically appended after the theme stylesheet. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-package-summary-card,.vt-plan-chip,
    .vt-package-current,.vt-package-upgrade
  ){
    background:#1c2f46!important;color:#e7f1ff!important;
    border-color:#42607e!important;
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-package-summary-main strong,.vt-plan-chip-copy strong
  ){color:#eef5ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-package-summary-main small,.vt-package-summary-main span,
    .vt-package-summary-expiry,.vt-plan-chip-copy small
  ){color:#bbcee6!important;}
  /* Commercial package modals remain contrast-correct when opened in dark UI. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-package-modal,.vt-commercial-gate-card
  ){background:#1c2d43!important;color:#eaf3ff!important;border-color:#456180!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-package-modal h2,.vt-commercial-gate-card h2
  ){color:#eef5ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-package-modal p,.vt-commercial-gate-card p
  ){color:#c2d2e7!important;}

  /* The compact calibration guidance is UI only. Calibration charts/targets
   * are rendered elsewhere and deliberately receive no theme CSS. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-cal-guide,.vt-cal-guide-row,.vt-cal-guide-refresh
  ){background:#20334b!important;color:#e5f0ff!important;border-color:#46617e!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-cal-guide-summary,.vt-cal-guide summary,
    .vt-cal-guide summary strong
  ){color:#eef5ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-cal-guide-intro,.vt-cal-guide-hint,.vt-cal-guide-row p,
    .vt-cal-guide-status,.vt-cal-guide-requirement
  ){color:#b8cce4!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 .vt-cal-guide-action{
    color:#a1cbff!important;
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 .vt-cal-guide-glasses select{
    color:#eef5ff!important;background:#142840!important;border-color:#526b88!important;
  }

  /* Dashboard clinic profile configuration remains legible. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-clinic-details>summary,.doctor-clinic-field span,
    .doctor-clinic-message,.doctor-clinic-logo-preview span
  ){color:var(--vt-theme-muted)!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview :is(
    .doctor-clinic-field input,.doctor-clinic-field textarea
  ){background:var(--vt-theme-input)!important;color:var(--vt-theme-title)!important;
    border-color:var(--vt-theme-border)!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview .doctor-clinic-logo-preview{
    background:#f5f8fc!important; /* Neutral backdrop for uploaded clinic logos. */
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 #overview .doctor-clinic-logo-preview span{
    color:#36516f!important;
  }

  /* Dashboard topnav: avoid pale text over dark header. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .v120-patient-context-identity,.v120-patient-context-actions,
    .v120-context-action,.active-patient-topbar
  ){color:#e7f1ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .v120-patient-context-copy strong,.v120-patient-context-identity strong
  ){color:#f1f6ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .v120-patient-context-copy small,.v120-patient-context-kicker,
    .active-patient-topbar-copy span,.doctor-credit-wallet
  ){color:#b8cde6!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .v120-patient-context-scope,.v120-patient-context-scope.neutral
  ){background:#253b57!important;color:#c6dbf5!important;border-color:#496584!important;}

  /* Patient/evaluation/diagnostics and Quick Office: fill remaining small
   * surface components while preserving existing action and status colors. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .evaluation-main .worksheet-card,.evaluation-main .evaluation-section-head,
    .evaluation-main .v120-profile-panel,
    .dh-library,.dh-context-card,.dh-test-grid .dh-test-card,
    .qot-session-settings-grid,.qot-workspace-tablist,.qot-workspace-intro,
    .qot-advanced-settings,.qot-engine-card,.qot-therapy-card,
    .pw-record-card,.pw-activity-row,.pw-section-nav,
    .pw-feature-card,.pw-metric-card,.pw-home-card
  ){background:#1c2e45!important;color:#e6f0fd!important;
    border-color:#39536f!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .evaluation-main .worksheet-card h3,.dh-test-card strong,
    .qot-engine-card strong,.qot-therapy-card strong,
    .pw-record-card h3,.pw-metric-card strong,.pw-card h3
  ){color:#edf5ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .evaluation-main .worksheet-card p,.dh-test-card p,
    .qot-engine-card small,.qot-therapy-card small,
    .pw-record-card p,.pw-metric-card small,.pw-card-head p
  ){color:#b9cde5!important;}

  /* Progress cards are also first-class clinician surfaces. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    #quickOfficeProgressDashboard .qot-progress-summary-tile,
    #quickOfficeClinicalProgression .vt-cp-card,
    #quickOfficeClinicalProgression .vt-cp-value,
    #quickOfficeClinicalProgression .vt-cp-prior,
    #quickOfficeClinicalProgression .vt-cpp-current,
    #quickOfficeProgressionHandoff
  ){background:#21354e!important;color:#dfeafb!important;border-color:#415e7e!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    #quickOfficeProgressDashboard .qot-progress-summary-tile strong,
    #quickOfficeClinicalProgression .vt-cp-value strong,
    #quickOfficeClinicalProgression h4
  ){color:#f1f7ff!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    #quickOfficeClinicalProgression .vt-cp-muted,
    #quickOfficeClinicalProgression .vt-cp-header p,
    #quickOfficeProgressDashboard .qot-progress-summary-tile span
  ){color:#bed0e5!important;}

  /* Neutral native controls: readable without recoloring diagnostic stimuli. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .qot-advanced-settings,.evaluation-main,.dh-context-card,
    .pw-workspace,.security-section
  ) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
        textarea,select) {
    background:#12253b!important;color:#eaf4ff!important;
    border-color:#4c6886!important;
  }
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .vt-main,.evaluation-main,.qot-main,.pw-main,.dh-main,.security-main
  ) :is(a:not(.vt-nav-link),.doctor-dashboard-text-action){
    text-decoration-color:currentColor;
  }

  /* Important status badges keep semantic color on a compatible dark tile. */
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .pw-status-pill.clinical,.evaluation-status-badge,
    .doctor-dashboard-calibration-state,.doctor-calibration-badge
  ){background:#26405c!important;color:#d9eafa!important;border-color:#55718e!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .pw-status-pill.active,.doctor-dashboard-calibration-state.ready,
    .doctor-calibration-badge.ready
  ){background:#173f32!important;color:#9ce7bd!important;border-color:#286e4e!important;}
  html[data-vt-theme="dark"] body.doctor-dashboard-v119 :is(
    .pw-status-pill.paused,.doctor-dashboard-calibration-state.check,
    .doctor-calibration-badge.check
  ){background:#44351e!important;color:#f5d197!important;border-color:#806237!important;}
}
@media(max-width:700px){
  body > .vt-theme-menu{min-width:150px;}
  .vt-theme-control .vt-theme-trigger{min-height:42px;}
}
@media print{
  body > .vt-theme-menu{display:none!important;}
}
