/* UX-01: the only hex definitions for the NEON palette. Semantic jobs are fixed;
   entity pickers choose palette IDs and never edit these tokens. All assets are local. */
@font-face { font-family: Inter; src: url('/assets/fonts/Inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Outfit; src: url('/assets/fonts/Outfit.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: dark;
  --palette-electric-blue: #4C8DFF;
  --palette-violet: #B667FF;
  --palette-cyan: #22D3EE;
  --palette-lime: #C4F82A;
  --palette-amber: #F5B23A;
  --palette-coral: #FF7A6B;
  --palette-pink: #FF6FB5;
  --palette-teal: #2DD4A7;
  --palette-sky: #9CC2FF;
  --palette-slate: #A3ACC4;
  --bg: #060A13;
  --panel: #0D1424;
  --panel-raised: #141E33;
  --ink: #EDF2FF;
  --muted: #A3ACC4;
  --line: #34425D;
  --accent: var(--palette-electric-blue);
  --brand-secondary: var(--palette-violet);
  --accent-ink: #060A13;
  --rail: #090F1C;
  --rail-ink: var(--ink);
  --shared-rail: var(--rail);
  --shared-rail-ink: var(--rail-ink);
  --neutral-bg: var(--panel-raised);
  --focus: var(--palette-sky);
  --patient-send: var(--palette-lime);
  --staff-action: var(--palette-electric-blue);
  --ai-draft: var(--palette-violet);
  --patient-tag: var(--palette-cyan);
  --attention: var(--palette-amber);
  --danger: var(--palette-coral);
  --danger-bg: #331C25;
  --danger-line: #98514B;
  --warn: var(--attention);
  --warn-bg: #302516;
  --warn-line: #866228;
  --ok: var(--palette-teal);
  --ok-bg: #102F2B;
  --ok-line: #267967;
  --delivery-queued: var(--palette-slate);
  --delivery-sent: var(--staff-action);
  --delivery-delivered: var(--patient-tag);
  --delivery-failed: var(--attention);
  --delivery-uncertain: var(--attention);
  --font-body: Inter, system-ui, sans-serif;
  --font-heading: Outfit, Inter, system-ui, sans-serif;
}
body { font-family: var(--font-body); }
h1, h2, h3, h4, .brand-name { font-family: var(--font-heading); }
button, .button-link { min-height: 44px; }
body :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.navigation-panel { background: var(--rail); color: var(--rail-ink); }
/* Compatibility boundary for the existing independently owned light screens.
   Their owners remove this boundary when their NEON rows are integrated. */
.directory-design-host, .connections-content, .messaging-settings-page, .external-conversations {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #5f6b7a;
  --line: #d8dee5;
  --accent: #0055f5;
  --brand-secondary: #8037c7;
  --accent-ink: #ffffff;
  --danger: #8f1f25;
  --danger-bg: #fbe9ea;
  --danger-line: #e8aeb2;
  --ok: #1e6b3a;
  --ok-bg: #e6f4ea;
  --ok-line: #a9d9b7;
  --warn: #6b3f00;
  --warn-bg: #fff1d6;
  --warn-line: #e3c07a;
  --neutral-bg: #eef2f5;
  --focus: #0055f5;
}
/* Existing External controls and bubbles inherit colour from their mount.
   Reset that inherited foreground when returning from a dark workspace view. */
.external-conversations { color: var(--ink); }
/* External's shell sets light-screen muted text above the shared dark rail. */
#app-shell #navigation-panel { --muted: var(--palette-slate); }
.workspace-shell, .incoming-panel, .view-panel { background: var(--bg); }
.view-navigation a[aria-current='page'] { color: var(--palette-sky); box-shadow: inset 3px 0 var(--accent); background: var(--panel-raised); }
.nav-group-title { color: var(--muted); }
/* Shared primitives. Screen owners opt into them without a rewrite of their views. */
.neon-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem .8rem; min-height: 56px; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--panel); color: var(--ink); text-align: left; }
.neon-row-copy { display: grid; min-width: 0; gap: .15rem; }
.neon-row-title, .neon-row-detail { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.neon-row-detail { color: var(--muted); font-size: .85rem; }
.neon-delivery { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--delivery-queued); }
.neon-delivery[data-state='sent'] { color: var(--delivery-sent); }
.neon-delivery[data-state='delivered'] { color: var(--delivery-delivered); }
.neon-delivery[data-state='failed'] { color: var(--delivery-failed); }
.neon-delivery[data-state='uncertain'] { color: var(--delivery-uncertain); }
.neon-hover { position: relative; display: inline-flex; }
.neon-hover-card { position: absolute; inset: calc(100% + .25rem) auto auto 0; z-index: 30; width: max-content; max-width: min(24rem, 80vw); padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .7rem; box-shadow: 0 12px 35px #0008; background: var(--panel-raised); color: var(--ink); overflow-wrap: anywhere; }
.neon-hover-card p { margin: .2rem 0; }
.neon-hover-card--end { left: auto; right: 0; }
.neon-hover-card--above { top: auto; bottom: calc(100% + .25rem); }
/* Shared controls follow tokens on views that use the shared UI kit. Existing
   individually skinned screens keep their own control styles until their owners
   apply UX-04 onward. */
#app-shell:not(.external-workspace-shell) .view-host:not(.directory-design-host):not(:has(.directory-design-host, .connections-content, .messaging-settings-page, .education-page, .external-conversations, .internal-page)) :is(input, select, textarea),
#app-shell:not(.external-workspace-shell) .view-host:not(.directory-design-host):not(:has(.directory-design-host, .connections-content, .messaging-settings-page, .education-page, .external-conversations, .internal-page)) button.secondary {
  color: var(--ink);
  background: var(--panel-raised);
  border-color: var(--line);
}
#app-shell .mobile-tabs { background: var(--panel); border-color: var(--line); }
#app-shell .mobile-tabs button { color: var(--muted); background: var(--panel); border-color: var(--line); }
#app-shell .mobile-tabs button[aria-selected='true'] { color: var(--palette-sky); background: var(--panel-raised); border-color: var(--accent); }
.neon-action-patient { background: var(--patient-send); color: var(--accent-ink); border-color: var(--patient-send); }
.neon-action-staff { background: var(--staff-action); color: var(--accent-ink); border-color: var(--staff-action); }
.neon-ai-draft { border-left: 3px solid var(--ai-draft); }
.neon-patient-tag { color: var(--patient-tag); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
