/**
 * Kairos Health payer bar — desk density.
 * Canonical tokens: branding/kairos-health-tokens.css
 * Mirrored 2026-09-26. Change the canonical file first, then mirror the values here.
 * Paints the bar and the clearance under it. Does not restyle Material rows.
 */

:root {
  --kh-font: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --kh-ink: #0f172a;
  --kh-muted: #475569;
  --kh-line: #e2e8f0;
  --kh-paper: #f8fafc;
  --kh-surface: #ffffff;
  --kh-primary: #1e3a8a;
  --kh-primary-deep: #172554;
  --kh-clinical: #0f766e;
  --kh-lab: #0e7490;
  --kh-kicker: #8a6a2f;
  --kh-danger: #b91c1c;
  --kh-ok: #047857;
  --kh-warn: #b45309;
  --kh-radius: 1rem;
  --kh-radius-sm: 0.75rem;
  --kh-nav-h: 4rem;
  --kh-measure: 1120px;
  --kh-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --kh-focus: 0 0 0 3px rgba(30, 58, 138, 0.35);
}

:root,
[data-density="public"] {
  --kh-space: 1.25rem;
  --kh-text: 1rem;
  --kh-h1: clamp(2rem, 5vw, 3.25rem);
}

[data-density="desk"] {
  --kh-space: 0.75rem;
  --kh-text: 0.9375rem;
  --kh-h1: 1.35rem;
  --kh-radius: 0.75rem;
}

html.kairos-payer-desk {
  --kairos-switcher-h: var(--kh-nav-h);
}

html.kairos-payer-desk body {
  padding-top: var(--kairos-switcher-h);
}

.kairos-door-switcher {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  box-sizing: border-box;
  min-height: var(--kh-nav-h);
  height: auto;
  padding: 0 0.75rem;
  overflow: visible;
  background: var(--kh-primary-deep);
  color: #ffffff;
  font-family: var(--kh-font);
  font-size: var(--kh-text);
  line-height: 1.3;
}

.kh-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.kairos-door-switcher a,
.kairos-door-switcher .kairos-sw-user {
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--kh-radius);
  flex: 0 0 auto;
}

.kairos-door-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.65rem;
  font-weight: 550;
}

.kh-bar-brand { font-weight: 650; }

.kairos-door-switcher a:hover,
.kairos-door-switcher a.is-current {
  background: rgba(255, 255, 255, 0.14);
}

.kairos-door-switcher a.is-current {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.kairos-door-switcher a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: var(--kh-focus);
}

/* Clearance only: the payer AppBar and drawer stay the engine's components. */
html.kairos-payer-desk .MuiAppBar-root,
html.kairos-payer-desk header[class*="MuiAppBar"],
html.kairos-payer-desk [class*="MuiAppBar-root"],
html.kairos-payer-desk [class*="MuiAppBar-positionFixed"],
html.kairos-payer-desk [class*="appBar"] {
  top: var(--kairos-switcher-h) !important;
}

html.kairos-payer-desk .MuiDrawer-paper,
html.kairos-payer-desk [class*="MuiDrawer-paper"],
html.kairos-payer-desk [class*="drawerPaper"] {
  top: var(--kairos-front-chrome-b, calc(var(--kairos-switcher-h) + 64px)) !important;
  height: calc(100% - var(--kairos-front-chrome-b, calc(var(--kairos-switcher-h) + 64px))) !important;
  max-height: calc(100% - var(--kairos-front-chrome-b, calc(var(--kairos-switcher-h) + 64px))) !important;
}

@media (prefers-reduced-motion: reduce) {
  .kairos-door-switcher a { transition: none; }
}
