/* Shared palette; loaded after page styles. */
:root[data-theme="light"]{color-scheme:light;--theme-bg:#f4f7f2;--theme-surface:#fffefb;--theme-raised:#edf3e8;--theme-field:#f7faf5;--theme-ink:#193d31;--theme-muted:#5e7264;--theme-line:#d2dece;--theme-accent:#16734f;--theme-soft:#e3efdc;--theme-shadow:0 24px 70px #264b3520}
:root[data-theme="dark"]{color-scheme:dark;--theme-bg:#0a1110;--theme-surface:#111c18;--theme-raised:#18261f;--theme-field:#0d1713;--theme-ink:#edf3ee;--theme-muted:#a0b2a7;--theme-line:#2a4033;--theme-accent:#45d6a0;--theme-soft:#1c3327;--theme-shadow:0 24px 90px #0005}
:root[data-theme]{--bg:var(--theme-bg);--paper:var(--theme-surface);--ink:var(--theme-ink);--muted:var(--theme-muted);--line:var(--theme-line);--green:var(--theme-accent);--bs-body-bg:var(--theme-bg);--bs-body-color:var(--theme-ink);--bs-border-color:var(--theme-line)}
html[data-theme] body{background-color:var(--theme-bg);color:var(--theme-ink)}
.theme-toggle{position:relative;display:inline-flex;align-items:center;justify-content:space-between;width:64px;height:32px;flex:0 0 64px;padding:0 9px;border:1px solid var(--theme-line);border-radius:99px;background:var(--theme-raised);color:var(--theme-muted);cursor:pointer;isolation:isolate;vertical-align:middle;box-shadow:inset 0 1px #ffffff08;touch-action:manipulation}
.theme-toggle svg{position:relative;z-index:1;width:14px;height:14px;pointer-events:none;stroke-width:1.6}
.theme-toggle-thumb{position:absolute;left:3px;top:3px;width:24px;height:24px;border-radius:50%;background:var(--theme-surface);box-shadow:0 1px 5px #0002;transition:transform 180ms ease,background-color 180ms ease;pointer-events:none}
[data-theme="dark"] .theme-toggle-thumb{transform:translateX(32px);background:#2a5741}
[data-theme="light"] .theme-toggle .theme-sun,[data-theme="dark"] .theme-toggle .theme-moon{color:var(--theme-ink)}
.theme-toggle:hover{border-color:var(--theme-accent)}.theme-toggle:focus-visible{outline:2px solid var(--theme-accent);outline-offset:4px}
.logo-on-dark{display:none!important}html[data-theme="dark"] .logo-on-dark{display:block!important}html[data-theme="dark"] .logo-on-light{display:none!important}
.site-header .theme-toggle{margin-left:4px}.account-body>.topbar{gap:18px;background:var(--theme-surface)}
.workspace-body .page-heading{position:relative;padding-right:80px}
.workspace-theme-toggle{position:absolute;right:0;top:1px}
/* Access forms sit in a quiet, readable card in either palette. */
html[data-theme] .auth-entry{background:var(--theme-bg);background-image:radial-gradient(ellipse at 72% 80%,var(--theme-soft),transparent 64%)}
.auth-entry .account-layout{padding:85px 24px 35px}
.auth-entry .account-card{width:470px;max-width:100%;padding:36px 40px 32px;border:1px solid var(--theme-line);border-radius:24px;background:var(--theme-surface);box-shadow:var(--theme-shadow)}
.auth-entry .auth-brand{margin-bottom:30px}.auth-entry .account-description{margin-bottom:24px}
.auth-entry .auth-brand,.auth-entry .auth-brand .inmedflow-logo{max-width:100%;height:auto}
html[data-theme] :is(.step,.pill,.text-button,.history-actions button,.patient-age-unit){color:var(--theme-muted)}
html[data-theme] .account-card input::placeholder{color:var(--theme-muted);opacity:.8}
html[data-theme] :is(.clinical-question>summary,.question-objective p,.question-objective strong,.patient-hypothesis-label){color:var(--theme-ink)}
html[data-theme] .clinical-question>summary:hover{color:var(--theme-accent)}
html[data-theme] .clinical-warning-dock:not(.has-alerts){background:var(--theme-raised);border-color:var(--theme-line)}
html[data-theme] .clinical-warning-dock:not(.has-alerts)>button{color:var(--theme-muted)}
html[data-theme="light"] .clinical-warning-dock.has-alerts{background:#fff0d9;border-color:#dfb67b}
html[data-theme="light"] .clinical-warning-dock.has-alerts>button{color:#714317}
html[data-theme] .patient-dni-edit:hover .patient-inline-input{background:var(--theme-field);color:var(--theme-ink)}
@media(min-width:381px) and (max-width:650px){.site-header{gap:12px}.site-header .inmedflow-logo{width:135px}.site-header .header-actions{gap:4px}.site-header .header-actions .login-link{padding-inline:8px}.site-header .register-link{padding-inline:10px}}
.auth-entry>.topbar,.settings-page>.topbar{display:flex;position:absolute;right:24px;top:20px;width:auto;height:34px;padding:0;border:0;background:transparent;backdrop-filter:none;z-index:5}
.auth-entry>.topbar>:not(.theme-toggle),.settings-page>.topbar>:not(.theme-toggle){display:none}
html[data-theme] .account-card,html[data-theme] .settings-shell{background:var(--theme-surface);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme] .settings-page{background:var(--theme-bg);padding-top:72px}
.settings-page .settings-shell{height:min(590px,calc(100dvh - 128px))}
html[data-theme] .settings-page .account-card{background:transparent}
html[data-theme] .settings-nav{background:var(--theme-raised);border-color:var(--theme-line)}
html[data-theme] :is(.account-card h2,.account-card label,.account-intro h1,.settings-page .settings-label label,.settings-page .settings-label h3,.settings-content-header h2,.settings-nav h1){color:var(--theme-ink)}
html[data-theme] :is(.account-description,.account-switch,.account-footer,.account-intro>p,.settings-label p,.settings-notice,.account-card small){color:var(--theme-muted)}
html[data-theme] .account-card input:not([type="hidden"]):not([type="checkbox"]),html[data-theme] .account-card select{background:var(--theme-field);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme] .account-card input:focus,html[data-theme] .account-card select:focus{border-color:var(--theme-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 15%,transparent)}
html[data-theme] .account-card input:-webkit-autofill{-webkit-text-fill-color:var(--theme-ink);box-shadow:0 0 0 1000px var(--theme-field) inset;caret-color:var(--theme-ink)}
html[data-theme] :is(.account-card a:not(.auth-brand),.account-back,.account-footer a,.account-card .terms-check){color:var(--theme-accent)}
html[data-theme] :is(.settings-row,.settings-content-header,.settings-footer,.settings-nav,.billing-bottom){border-color:var(--theme-line)}
html[data-theme] :is(.settings-tabs button,.settings-action,.settings-close){color:var(--theme-muted)}
html[data-theme] .settings-tabs button[aria-selected="true"],html[data-theme] .settings-tabs button:hover{background:var(--theme-soft);color:var(--theme-ink)}
html[data-theme] :is(.billing-plan,.billing-notice,.local-mail-note){background:var(--theme-raised);border-color:var(--theme-line);color:var(--theme-muted)}
html[data-theme] :is(.billing-plan-heading,.billing-price strong,.billing-price,.billing-features){color:var(--theme-ink)}
html[data-theme] .auth-notice{background:var(--theme-surface);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme] .auth-notice p{color:var(--theme-muted)}
/* Public pages retain the same editorial hierarchy, with theme-aware surfaces. */
html[data-theme] .site-page{background:var(--theme-bg)}
html[data-theme="dark"] .site-page em{color:#a8c59c}
html[data-theme] :is(.site-page .eyebrow,.site-footer>p,.footer-location,.visual-caption,.workflow-index,.feature-detail){color:var(--theme-muted)}
html[data-theme] :is(.login-link,.faq-list details,.principles-strip,.workflow li,.site-header,.footer-location){border-color:var(--theme-line)}
html[data-theme] :is(.login-link:hover,.closing-section,.preview-note,.legal-highlight){background:var(--theme-soft);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme="dark"] :is(.hero-visual::before,.orbit){opacity:.25}
html[data-theme] .clinical-preview{background:var(--theme-surface);border-color:var(--theme-line)}
html[data-theme] :is(.preview-top,.preview-bottom,.preview-result+.preview-result,.preview-results,.review-principles article){border-color:var(--theme-line)}
html[data-theme] .preview-results{background:var(--theme-raised)}
html[data-theme] :is(.preview-transcript p,.preview-result p,.preview-bottom,.tiny-label,.preview-kicker,.preview-badge,.number,.legal-article p,.legal-index a,.legal-sources p,.legal-highlight p){color:var(--theme-muted)}
html[data-theme] .preview-transcript mark{background:var(--theme-soft);color:var(--theme-ink)}
html[data-theme] :is(.legal-article a,.legal-sources a,.faq-list details a){color:var(--theme-accent)}
html[data-theme="dark"] .judgment-section{background:#10251b}
/* Clinical workspace: maintain highlight layers and clinical state colors. */
html[data-theme] :is(.chat-sidebar,.panel,.recording-bar,.recording-dock,.sidebar-account-menu,.chat-context-menu,.medflow-modal .modal-content,.patient-profile-modal .modal-content){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme] .recording-bar{background:linear-gradient(110deg,var(--theme-raised),var(--theme-surface))}
html[data-theme] :is(.panel-description,.panel-footer,.sidebar-footer,.sidebar-account,.local-note,.branch,.diagnosis-metrics,.recording-dock,.subtitle-cue,.medflow-modal .modal-header,.medflow-modal .modal-footer){border-color:var(--theme-line)}
html[data-theme] :is(.chat-name,.chat-age,.patient-age-edit,.patient-dni-edit,.diagnosis>summary,.metric-heading strong,.metrics-summary,.medflow-modal .modal-title,.patient-timeline-entry h3){color:var(--theme-ink)}
html[data-theme] :is(.panel-description,.panel-footer,.chat-diagnosis,.chat-date,.chat-meta,.chat-dni,.sidebar-heading,.sidebar-footer,.empty-state,.empty-state p,.branch ul,.branch h3,.decision-note,.local-note,#recordStatus,#timer,.medflow-modal .modal-body,.patient-history-excerpt,.patient-snapshot,.patient-profile-range,.patient-profile-note){color:var(--theme-muted)}
html[data-theme] :is(.chat-item:hover,.chat-item.active,.chat-item.active:hover,.sidebar-account-trigger:hover,.sidebar-account-menu .dropdown-item:hover,.chat-context-menu .dropdown-item:hover,.subtitle-cue:hover){background:var(--theme-soft);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme] :is(.dropdown-item,.sidebar-account-trigger,#accountName){color:var(--theme-ink)}
html[data-theme] :is(.btn-light,.btn-outline-secondary,.sidebar-toggle,.chat-search,.recording-transport select,.form-select,.selection-toggle,.archive-toggle,.chat-bulk-actions button){background-color:var(--theme-raised);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme] :is(.btn-light:hover,.btn-outline-secondary:hover,.sidebar-toggle:hover){background:var(--theme-soft);border-color:var(--theme-accent);color:var(--theme-ink)}
html[data-theme] :is(.diagnosis,.decision-note,.step,.pill,.count,.metrics-summary,.recording-dock,.patient-profile-note,.patient-tag){background:var(--theme-raised);border-color:var(--theme-line)}
html[data-theme] .dialog-editor,html[data-theme] .history-editor{background:var(--theme-field)}
html[data-theme] #txtDialog,html[data-theme] #txtMedicalHistory{background:transparent;color:var(--theme-ink);caret-color:var(--theme-accent)}
html[data-theme] .has-panel-search #txtDialog,html[data-theme] .has-panel-search #txtMedicalHistory{color:transparent;-webkit-text-fill-color:transparent}
html[data-theme] .has-panel-search #dialogHighlights,html[data-theme] .has-panel-search #historyHighlights{color:var(--theme-ink)}
html[data-theme="light"] .dialog-editor mark:not(.search-hit){background:#9ed9b577}
html[data-theme="light"] .dialog-editor mark.negated:not(.search-hit){background:#f2cc8277}
html[data-theme] .patient-dni-edit:focus-within .patient-inline-input,html[data-theme] .patient-inline-input:focus{background:var(--theme-field);color:var(--theme-ink)}
html[data-theme] :is(.patient-timeline-meta,.patient-profile-modal [data-profile-status],.patient-profile-modal [data-profile-identity],.patient-hypotheses){color:var(--theme-ink)}
html[data-theme] .patient-profile-modal{--bs-modal-bg:var(--theme-surface);--bs-modal-header-border-color:var(--theme-line);--bs-modal-footer-border-color:var(--theme-line)}
html[data-theme="light"] .shimmer-text{color:var(--theme-muted);background:none}
html[data-theme="light"] .clinical-alerts{background:#fff0d9;color:#714317;border-color:#dfb67b}
html[data-theme="light"] .account-message{background:#fff3df;color:#714317;border-color:#dfc391}
html[data-theme="light"] .account-message.success{background:#e4f2e4;color:#28643c;border-color:#a2c9a5}
html[data-theme="light"] .record-btn:not(.recording),html[data-theme="light"] .new-chat-btn{background:#1b6145;color:#fff;border-color:#1b6145}
html[data-theme="light"] .new-chat-btn span{color:#c7e8cc}
@media(max-width:650px){.auth-entry .account-layout{padding:76px 18px 25px}.auth-entry .account-card{padding:30px 24px;border-radius:20px}.auth-entry>.topbar,.settings-page>.topbar{top:17px;right:18px}.site-header .register-link span{display:none}.site-header .theme-toggle{margin-left:3px}.account-body>.topbar .inmedflow-logo{width:130px}.account-body>.topbar{gap:12px}.workspace-body .page-heading{padding-right:0;padding-top:37px}.workspace-theme-toggle{top:0}.settings-page{padding-inline:14px}}
@media(max-width:380px){.site-header .inmedflow-logo{width:115px}.site-header .header-actions{gap:3px}.site-header .header-actions .login-link{padding-inline:5px;font-size:11px}.site-header .register-link{padding-inline:8px;font-size:11px}.site-header .theme-toggle{width:50px;flex-basis:50px;height:28px;padding:0 7px}.site-header .theme-toggle svg{width:12px;height:12px}.site-header .theme-toggle-thumb{width:20px;height:20px}.site-header[data-theme] .theme-toggle-thumb{transform:none}html[data-theme="dark"] .site-header .theme-toggle-thumb{transform:translateX(22px)}}
@media(prefers-reduced-motion:reduce){.theme-toggle-thumb{transition:none}}
