/* HMS demo themes share a named surface scale. The product remains independent of the folio CSS. */
:root {
  --hms-canvas: #f4f6f8;
  --hms-surface: #ffffff;
  --hms-surface-raised: #ffffff;
  --hms-surface-soft: #f5f9fb;
  --hms-surface-hover: #edf5f9;
  --hms-text: #1b2836;
  --hms-text-muted: #637685;
  --hms-border: #e4e9ee;
  --hms-border-soft: #eef1f4;
  --hms-alert-surface: #fff3e6;
  --hms-alert-text: #86521e;
  --hms-good-surface: #edf6f0;
  --hms-good-text: #327460;
}
html.theme-dark {
  color-scheme: dark;
  --ink: #e8f2f5;
  --navy: #d5ebf4;
  --blue: #84d4f0;
  --paper: #101c26;
  --muted: #aabfca;
  --line: #304451;
  --red: #f3b877;
  --green: #8fd7b8;
  --surface: #192c38;
  --focus: #9cddf2;
  --hms-canvas: #101c26;
  --hms-surface: #192c38;
  --hms-surface-raised: #203744;
  --hms-surface-soft: #243c49;
  --hms-surface-hover: #294858;
  --hms-text: #e8f2f5;
  --hms-text-muted: #b0c4ce;
  --hms-border: #304451;
  --hms-border-soft: #2a3f4b;
  --hms-alert-surface: #463421;
  --hms-alert-text: #ffd19c;
  --hms-good-surface: #1d3b38;
  --hms-good-text: #a3e8c6;
}
.topbar #hms-theme-toggle{border:1px solid var(--hms-border);background:var(--hms-surface);color:var(--hms-text);white-space:nowrap}
.topbar #hms-theme-toggle:hover{background:var(--hms-surface-hover)}
html.theme-dark body,
html.theme-dark .app{background:var(--hms-canvas);color:var(--hms-text)}
html.theme-dark :is(.topbar,#nav,.journey-context,.stats,.tablewrap,.panel,.projectcard,.flow-panel,.entry-card,.ws-priority,.ws-monitor,.ws-device,.ws-project-card,.ws-account-card,dialog){background:var(--hms-surface);color:var(--hms-text);border-color:var(--hms-border)}
html.theme-dark :is(.entry-card:first-child,.task-card,.invite-banner,.ws-account-invitation,.message,.brand-mark,.channels,.ws-file-preview pre){background:var(--hms-surface-soft);color:var(--hms-text)}
html.theme-dark :is(.ws-reading:hover,.ws-project-card:hover,#nav>button:hover,button:hover){background:var(--hms-surface-hover);color:var(--hms-text)}
html.theme-dark button,html.theme-dark input,html.theme-dark select,html.theme-dark .dialoghead button,html.theme-dark .channels button[aria-pressed=true]{background:var(--hms-surface);color:var(--hms-text);border-color:var(--hms-border)}
html.theme-dark :is(input,select)::placeholder{color:var(--hms-text-muted)}
html.theme-dark button.primary{background:#087ba8;color:#fff;border-color:#087ba8}
html.theme-dark button.primary:hover{background:#0b6f97;border-color:#0b6f97}
html.theme-dark :is(#nav>button.active,.ws-project-icon){background:#24485b;color:#a7e3f5}
html.theme-dark :is(.tag,.ws-owner){background:var(--hms-surface-soft);color:var(--hms-text-muted)}
html.theme-dark :is(.tag.alert,.tag--alert,.alertbox,.ws-priority-icon){background:var(--hms-alert-surface);color:var(--hms-alert-text)}
html.theme-dark .tag--connected{background:var(--hms-good-surface);color:var(--hms-good-text)}
html.theme-dark :is(.subtitle,.note,.eyebrow,.meta a,.source,.source summary,.entry-card p,.onboard>p,.flow-panel>p,.flow-aside p,.task-card p,.team-row p,.readiness strong,.readiness small,.ws-account-card>p,.ws-account-explainer p,.ws-file-details dt,.ws-breadcrumb,.ws-health dt,.ws-health dd small,.ws-device-name small,.ws-reading-context,.ws-project-card p,.ws-project-card>div,.ws-data-note,.ws-log-disclaimer){color:var(--hms-text-muted)}
html.theme-dark :is(.ws-device-name,.ws-project-card h3,.ws-account-row strong,.wordmark,.metric>span:first-child,.stat strong,.ws-reading strong,.ws-toolbar strong){color:var(--hms-text)}
html.theme-dark :is(.ws-device,.ws-reading,.ws-account-row,.ws-project-card>div,.team-row,.flow-actions,.ws-tabs,.ws-file-details>div,.config-summary>div,th,td){border-color:var(--hms-border-soft)}
html.theme-dark :is(thead th,thead th:first-child,tbody th,th:first-child,td:first-child){background:var(--hms-surface);color:var(--hms-text-muted)}
html.theme-dark tbody th,
html.theme-dark th:first-child,
html.theme-dark td:first-child{color:var(--hms-text)}
html.theme-dark :is(.ws-project-head #ws-fullscreen,.ws-priority-action,.access button,.ws-open-machine,.ws-back,.ws-account-row){background:transparent;color:var(--hms-text);border-color:var(--hms-border)}
html.theme-dark :is(.ws-reading.is-alert strong,.ws-priority p strong,.ws-health .has-alert dd,.metric.highlight strong){color:var(--hms-alert-text)}
html.theme-dark .ws-file-preview pre{color:var(--hms-text-muted)}
html.theme-dark .toast{background:#d5eaf3;color:#152733}
html.theme-dark dialog::backdrop{background:#06111caa}
@media(max-width:650px){
  .topbar #hms-theme-toggle{font-size:9px;padding:6px 8px;min-height:32px}
  .topbar{gap:8px}
}

html.theme-dark #nav>button{color:var(--hms-text-muted)}
html.theme-dark #nav>button.active{color:#a7e3f5}

/* Keep the persona control in its own row so it never covers top-bar actions. */
@media (min-width:951px){.hms-project-open #journey-context{position:static;min-height:42px;padding:8px 25px;justify-content:flex-end;background:var(--hms-surface);border-bottom:1px solid var(--hms-border)}}

/* Contrast corrections for the landing decision and diagnostic instruments. */
html.theme-dark .entry-card .mini-fleet strong{color:#9bdcf2}html.theme-dark .entry-card .mini-fleet span,html.theme-dark .entry-card .entry-number,html.theme-dark .entry-card>small{color:#b3cbd6}html.theme-dark .entry-card .readiness :is(strong,small){color:#c5d9e2}html.theme-dark .entry-card .readiness .step-dot{color:#17303d;background:#b2dcea}html.theme-dark .metrics{background:#233947;border-color:#385565}html.theme-dark .metric{border-color:#385565}html.theme-dark .metric>span:last-child{color:#a9c2cf}html.theme-dark .incident-steps li.is-done{background:#244637;color:#d8efe1}html.theme-dark .incident-checks{border-color:#385565}html.theme-dark .diag-surface dl div{border-color:#385565}html.theme-dark .diag-hmi-screen{background:#284e60}html.theme-dark :is(.incident-insight p,.incident-resolved p){color:#bed0da}

html.theme-dark .entry-hero{background:#203a49}html.theme-dark .entry-hero-copy p,html.theme-dark .entry-hero-copy>small{color:#c0d4de}html.theme-dark .entry-preview{background:#182f3d;border-color:#3a5666}html.theme-dark .entry-preview-top,html.theme-dark .entry-preview-row{border-color:#3a5666}html.theme-dark .entry-preview-top :is(strong,small),html.theme-dark .entry-preview-row :is(strong,small),html.theme-dark .entry-preview-foot{color:#d0e0e7}html.theme-dark .entry-preview-alert{background:#493623}html.theme-dark .entry-preview-alert :is(strong,small),html.theme-dark .entry-preview-kicker,html.theme-dark .entry-preview-alert b{color:#ffd29f}html.theme-dark .entry-secondary{background:#1b303d;border-color:#38515f}html.theme-dark .entry-secondary p{color:#c0d4de}html.theme-dark .entry-pipeline li{background:#2b4b5c;color:#d2e9f3}html.theme-dark .entry-preview-mark{background:#315365;color:#d2eff7}

html.theme-dark .ws-tabs button{background:transparent;color:#b8cdd6;border-color:transparent}html.theme-dark .ws-tabs button[aria-current=page]{color:#e8f2f5;border-color:#84d4f0}html.theme-dark .ws-tabs button:hover{background:transparent;color:#fff}html.theme-dark .entry-hero .entry-number,html.theme-dark .entry-secondary .entry-number{color:#b5cbd5}html.theme-dark{--hms-chart-band:#294456;--hms-chart-line:#48677b;--hms-chart-label:#a9c6d5}
