/*! Xplor shell v1.11.0 — design tokens and page-level rules for apps that embed <xplor-shell-header>.
   The shell sets --xplor-brand-primary, --xplor-brand-accent, --xplor-on-primary and --xplor-brand-logo
   on :root once it knows the brand (affiliate or Xplor). These defaults are the Xplor brand. */
:root {
  --xplor-brand-primary: #0f5a75;
  --xplor-brand-accent: #136f8f;
  --xplor-on-primary: #ffffff;
  --xplor-brand-logo: none;
  --xplor-shell-height: 56px;
  /* 1.10.0 (owner 11/21): the bar's colour. Xplor's = the navy of the left navigation (white on it 15.8:1; dark 18.5:1).
     The header sets both from the brand once it knows it: an affiliate's bar is the affiliate's main colour. */
  --xplor-shell-bar: #0b1f52;
  --xplor-shell-bar-dark: #0a1326;
  /* How far below the top of the window the header sticks (an app with a strip above it may set this) */
  --xplor-shell-top: 0px;
  --xplor-radius: 8px;
  --xplor-focus: #2563eb;
}

/* Reserve the header's height before the script runs, so the page doesn't jump */
xplor-shell-header { display: block; min-height: var(--xplor-shell-height); background: var(--xplor-shell-bar, var(--xplor-brand-primary)); color: var(--xplor-on-primary); }
/* 1.10.0 (owner 11/21): the header stays at the top of the window while the page scrolls, on every page and screen
   width. Above the page's own sticky bars and side panes (z-index up to 40), below dialogs, drawers and the header's
   own menus. An app's sticky elements sit under it with top: var(--xplor-shell-offset). Sticky needs every element
   between the header and the page to scroll with the page (no overflow: hidden/auto on them). */
xplor-shell-header { position: sticky; top: var(--xplor-shell-top, 0px); z-index: 45; }
:root { --xplor-shell-offset: calc(var(--xplor-shell-top, 0px) + var(--xplor-shell-height)); }
html:has(xplor-shell-header) { scroll-padding-top: calc(var(--xplor-shell-offset) + 8px); }
/* Several headers on one page (no-root-theme, as on /shell/demo): they stay in the page's flow */
xplor-shell-header[no-root-theme] { position: relative; top: auto; z-index: 40; }
@media print { xplor-shell-header { position: static; } }
/* Before the script upgrades the element, show just the empty bar (no unstyled flash of the nav) */
xplor-shell-header:not(:defined) > * { visibility: hidden; }
/* The app's slotted nav: inherit the bar's colours */
xplor-shell-header > [slot="nav"] { color: inherit; }

/* Optional fallback: give your old header class="xplor-fallback" and it hides once the shell is ready.
   If Accounts can't be reached, the shell reports "unavailable" and the fallback stays. */
html[data-xplor-shell="ready"] .xplor-fallback { display: none !important; }
html:not([data-xplor-shell="ready"]) .xplor-when-shell { display: none !important; }

/* Helpers apps may use to map their primary buttons and links onto the brand */
.xplor-btn-primary { background: var(--xplor-brand-primary); color: var(--xplor-on-primary); border: 0; border-radius: var(--xplor-radius); padding: 0.5rem 1rem; font-weight: 600; cursor: pointer; }
.xplor-btn-primary:hover { background: var(--xplor-brand-accent); }
.xplor-btn-primary:focus-visible, .xplor-link:focus-visible { outline: 3px solid var(--xplor-focus); outline-offset: 2px; }
.xplor-link { color: var(--xplor-brand-primary); }
.xplor-logo { width: 32px; height: 32px; background: var(--xplor-brand-logo) center / contain no-repeat; }

/* Slotted nav links: a simple default look (apps can style their own instead) */
.xplor-nav { display: flex; gap: 2px; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.xplor-nav a { color: inherit; text-decoration: none; padding: 0.5rem 0.75rem; border-radius: var(--xplor-radius); white-space: nowrap; }
.xplor-nav a:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.xplor-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -3px 0 currentColor; }
.xplor-nav a:focus-visible { outline: 3px solid currentColor; outline-offset: -3px; }

@media (prefers-color-scheme: dark) {
  :root { --xplor-focus: #93c5fd; }
  html:not(.light):not([data-theme=light]) xplor-shell-header[theme=auto],
  xplor-shell-header:not([theme=light]):not([theme=auto]) { background: var(--xplor-shell-bar-dark, color-mix(in srgb, var(--xplor-brand-primary) 42%, #020617)); color: #f8fafc; }
}
/* 1.3.1: in dark mode the bar is a deep shade of the brand colour (the page's .dark class or data-theme counts for theme="auto") */
xplor-shell-header[theme=dark], html.dark xplor-shell-header[theme=auto], html[data-theme=dark] xplor-shell-header[theme=auto] { background: var(--xplor-shell-bar-dark, color-mix(in srgb, var(--xplor-brand-primary) 42%, #020617)); color: #f8fafc; }
/* 1.10.0: the dark bar is the navy of the dark left navigation for Xplor, a deep shade of the brand for an affiliate */
