/* Omilon design tokens. Light and dark.
   Brand colours (--nx-*) are exactly the NEXUS corporate design palette (SPEC-NFR-DESIGN-003, PS-11): primary NEXUS
   red, dark blue and gray; shades light red, blue and ice blue. No other brand colour, no neon, no blends between
   colours. The --om-* tokens are what the style sheets use. Every text pair meets 4.5:1 and every control/focus pair
   3:1 in both themes (PU-02; tests/a11y/contrast.test.ts). NEXUS red is under 3:1 on dark blue, so focus and the
   recording dot use light red, which works on white and on dark blue; buttons with text use NEXUS red (PU-03). */
:root {
  --nx-red: #B80F2E;
  --nx-navy: #1F2336;
  --nx-gray: #9C9D9F;
  --nx-rose: #BA4C61;
  --nx-blue: #35628B;
  --nx-lg: #E8ECF0;

  --om-bg: #F6F7F9;
  --om-surface: #FFFFFF;
  --om-text: #1F2336;
  --om-muted: #5B6275;
  --om-line: #E1E5EA;
  /* Borders that show where a field is (non-text contrast 3:1). */
  --om-field-line: #7D8699;
  /* Buttons with text. */
  --om-primary: #B80F2E;
  --om-on-primary: #FFFFFF;
  --om-focus: #BA4C61;
  /* The chosen option (segmented buttons, tabs): must stand out from the surface in both themes. */
  --om-selected: #1F2336;
  --om-on-selected: #FFFFFF;
  --om-rec: #BA4C61;
  --om-link: #35628B;
  /* Soft panels (banners, notes, badges). */
  --om-soft: #E8ECF0;
  --om-on-soft: #1F2336;
  --om-err-bg: #FBE7EA;
  --om-err-text: #B80F2E;
  --om-warn-bg: #FFF4E0;
  --om-warn-text: #7A4B00;
  --om-ok-bg: #E6F4EA;
  --om-ok-text: #1E5E33;
  /* The dark chrome (header, the Bar) is navy in both themes. */
  --om-chrome: #1F2336;
  --om-on-chrome: #FFFFFF;
  /* A tint of NEXUS gray (#9C9D9F + 20 % white): NEXUS gray itself is only 4.47:1 on the Bar's patient chip. */
  --om-on-chrome-muted: #B0B1B2;
  --om-on-chrome-error: #FFD3DA;
  --om-chrome-line: rgba(255, 255, 255, 0.4);
  /* The Bar (PW-45): flat dark blue (no blends, NEXUS), quiet white tints behind the icons and the patient chip. */
  --om-chrome-soft: rgba(255, 255, 255, 0.08);
  --om-chrome-sep: rgba(255, 255, 255, 0.14);

  /* Strong colours behind white text (status «failed», the Bar's buttons, admin's primary button). */
  --om-info-strong: #35628B;
  --om-danger-strong: #B80F2E;
  --om-on-strong: #FFFFFF;
  --om-chrome-hover: rgba(255, 255, 255, 0.16);
  /* A QR code is dark on light in both themes, so every camera can read it (PL-24). */
  --om-qr-dark: #1F2336;
  --om-qr-light: #FFFFFF;

  /* Type: one scale in rem, so every text follows the user's font setting (PS-02). 13 · 14 · 16 · 18 · 22 · 28 px. */
  --om-text-xs: 0.8125rem;
  --om-text-sm: 0.875rem;
  --om-text-md: 1rem;
  --om-text-lg: 1.125rem;
  --om-text-xl: 1.375rem;
  --om-text-2xl: 1.75rem;
  /* The large clock of the calm listening view (kilde 3, SPEC-REC-010): readable from a distance. */
  --om-text-clock: 3.5rem;
  --om-leading: 1.5;
  --om-leading-tight: 1.25;
  /* The NEXUS font where installed; Arial is the NEXUS fallback (SPEC-NFR-DESIGN-003). */
  --om-font: "Helvetica Neue LT", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Spacing on a 4 px grid. */
  --om-space-1: 4px;
  --om-space-2: 8px;
  --om-space-3: 12px;
  --om-space-4: 16px;
  --om-space-5: 20px;
  --om-space-6: 24px;
  --om-space-7: 32px;
  --om-space-8: 40px;

  /* Corners, depth and motion. */
  --om-radius-s: 6px;
  --om-radius-control: 10px;
  --om-radius: 14px;
  --om-radius-pill: 999px;
  --om-shadow: 0 6px 24px rgba(31, 35, 54, 0.08);
  --om-shadow-raised: 0 12px 32px rgba(31, 35, 54, 0.16);
  --om-shadow-up: 0 -8px 10px -8px rgba(31, 35, 54, 0.25);
  --om-dur-fast: 120ms;
  --om-dur: 200ms;
  --om-dur-slow: 1200ms;
  /* The recording dot breathes slowly: calm, not alarming. */
  --om-dur-breath: 2400ms;
  --om-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Density. Touch (the default) keeps 16 px text and 44 px controls (RULE-12); only a mouse makes it compact, below. */
  --om-root-text: 100%;
  --om-touch: 44px;
  font-family: var(--om-font);
  font-size: var(--om-root-text);
  line-height: var(--om-leading);
  color: var(--om-text);
  background: var(--om-bg);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --om-bg: #14161F;
    --om-surface: #1F2336;
    --om-text: #EEF1F5;
    --om-muted: #A9B0C2;
    --om-line: #2E3348;
    --om-field-line: #7A83A0;
    --om-link: #A9BEE6;
    --om-soft: #2A3047;
    --om-on-soft: #EEF1F5;
    --om-selected: #EEF1F5;
    --om-on-selected: #1F2336;
    --om-err-bg: #4A1622;
    --om-err-text: #FFC9D2;
    --om-warn-bg: #3D2C0A;
    --om-warn-text: #FFD99A;
    --om-ok-bg: #12331F;
    --om-ok-text: #A8E0B8;
    --om-qr-dark: #1F2336;
    --om-qr-light: #FFFFFF;
    --om-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --om-shadow-raised: 0 12px 32px rgba(0, 0, 0, 0.5);
    --om-shadow-up: 0 -8px 10px -8px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --om-bg: #14161F;
  --om-surface: #1F2336;
  --om-text: #EEF1F5;
  --om-muted: #A9B0C2;
  --om-line: #2E3348;
  --om-field-line: #7A83A0;
  --om-link: #A9BEE6;
  --om-soft: #2A3047;
  --om-on-soft: #EEF1F5;
  --om-selected: #EEF1F5;
  --om-on-selected: #1F2336;
  --om-err-bg: #4A1622;
  --om-err-text: #FFC9D2;
  --om-warn-bg: #3D2C0A;
  --om-warn-text: #FFD99A;
  --om-ok-bg: #12331F;
  --om-ok-text: #A8E0B8;
  --om-qr-dark: #1F2336;
  --om-qr-light: #FFFFFF;
  --om-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --om-shadow-raised: 0 12px 32px rgba(0, 0, 0, 0.5);
  --om-shadow-up: 0 -8px 10px -8px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
/* Compact on a PC (SPEC-NFR-DESIGN-002, PS-09): with a mouse or touchpad as the main input, the root text is 87.5 %
   (14 px at the default font, and it still follows the user's font setting, since every text size is in rem) and
   controls are 36 px, close to the prototype. A phone or tablet (pointer: coarse) never gets here. */
@media (pointer: fine) {
  :root {
    --om-root-text: 87.5%;
    --om-touch: 36px;
  }
}
html, body { margin: 0; height: 100%; background: var(--om-bg); }
/* ONE scroll surface per view: the view's <main> scrolls, nothing inside it does (see shared/layout.ts). */
body { overflow: hidden; }
button { min-height: var(--om-touch); min-width: var(--om-touch); font: inherit; }

/* Visible focus on every control, in every app (PU-05). */
:where(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--om-focus);
  outline-offset: 2px;
}

/* Text only for screen readers (shared/announce.ts and labels that are shown as icons). */
.om-sr, .om-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* «Reduce motion» in the operating system: nothing pulses or slides (PU-10). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
