.theme-toggle{white-space:nowrap}.public-theme{position:absolute;top:16px;right:20px;z-index:12}
@media screen{
  :root{color-scheme:light}
  html[data-theme="dark"]{color-scheme:dark;--navy:#0d2033;--blue:#67b4ea;--ink:#e1eaf2;--muted:#a4b5c5;--line:#344658;--bg:#101c29;--teal:#76d0c3}
  html[data-theme="dark"] .topbar,html[data-theme="dark"] .card,html[data-theme="dark"] .secondary{background:#1a2a3b}
  html[data-theme="dark"] .login-panel{background:#101c29}
  html[data-theme="dark"] .environment{background:#153a3a;border-color:#2c5453;color:#b3e2dd}
  html[data-theme="dark"] label{color:#c6d5e2}
  html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#122130;border-color:#42576b;color:var(--ink)}
  html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#95a8ba}
  html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] textarea:focus{border-color:#7cc4f3;outline-color:#31526c}
  html[data-theme="dark"] input[readonly],html[data-theme="dark"] :disabled{background:#223243;color:#c3d1dd}
  html[data-theme="dark"] .secondary{border-color:#42576b;color:var(--ink)}
  html[data-theme="dark"] .secondary:hover,html[data-theme="dark"] tbody tr:hover{background:#263b50}
  html[data-theme="dark"] .primary{background:#267bb5;border-color:#267bb5;color:white}
  html[data-theme="dark"] .primary:hover{background:#1d6595}
  html[data-theme="dark"] th{background:#152537;color:#bdcddd}
  html[data-theme="dark"] td{border-color:var(--line);color:var(--ink)}
  html[data-theme="dark"] .quick-icon,html[data-theme="dark"] .tag{background:#253b50;color:#b5daf4}
  html[data-theme="dark"] .tag.paid,html[data-theme="dark"] .notice.success{background:#193e31;color:#a1e0bb;border-color:#35644c}
  html[data-theme="dark"] .notice,html[data-theme="dark"] .puco-box{background:#1c3448;border-color:#3d617c;color:#c2ddf0}
  html[data-theme="dark"] .notice.error{background:#462a32;border-color:#85505b;color:#ffd0d6}
  html[data-theme="dark"] .document-status:not(:empty){background:#453a25;color:#f5deb0}
  html[data-theme="dark"] .location-status,html[data-theme="dark"] .danger-zone summary{color:#ffb6b6}
  html[data-theme="dark"] .danger-zone{border-color:#72434e}
  html[data-theme="dark"] .catalog-result{background:#1d3144;border-color:var(--line);color:var(--ink)}
  html[data-theme="dark"] .catalog-result:hover,html[data-theme="dark"] .catalog-result:focus{background:#29465f;border-color:#67b4ea}
  html[data-theme="dark"] .order-lines-head,html[data-theme="dark"] .order-line-number{color:#b4c7d7}
  html[data-theme="dark"] .order-editor .patient-lookup,html[data-theme="dark"] .scan-group{border-color:var(--line)}
  /* Los formularios originales conservan su papel blanco también en pantalla. */
  html[data-theme="dark"] .legacy-print-page{color:#18324a;background:white;color-scheme:light}
  @media(max-width:760px){.theme-toggle{padding:7px 8px;font-size:10px}.public-theme{top:12px;right:12px}}
}
