/* Navigate storefront styles.
 *
 * Product register: the user is mid-task, often in a hurry, sometimes on a phone in a
 * waiting room. The interface should disappear into finding a clinician.
 *
 * Per-deployment identity arrives as CSS custom properties set on <html> by the
 * template. Nothing below hard-codes a brand colour, so a new storefront is a theme
 * record and not a stylesheet.
 *
 * The data is text-only — no photos, no bios, no availability. So the design is
 * deliberately text-forward rather than a photo directory with holes in it: the name is
 * the largest thing on the row, and everything else supports scanning.
 */

:root {
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: 1.25rem;
  --step-3: 1.5rem;
  --step-4: 1.875rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius: 6px;
  --radius-lg: 10px;

  /* Semantic scale so no rule ever invents a z-index. */
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-toast: 400;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --medium: 220ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.5;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.014em;
}

a {
  color: inherit;
}

/* One focus treatment everywhere. Visible against both the light surface and the ink
   masthead, which is why it is an outline with an offset rather than a background. */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  z-index: var(--z-toast);
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  transition: top var(--fast) var(--ease);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--masthead-bg);
  color: var(--masthead-ink);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.masthead__logo {
  font-size: var(--step-2);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.masthead__tagline {
  font-size: var(--step--1);
  opacity: 0.72;
}
.masthead__switch {
  margin-left: auto;
  font-size: var(--step--1);
  opacity: 0.72;
  text-decoration: none;
}
.masthead__switch:hover {
  opacity: 1;
}

/* ---------- search ---------- */

.searchbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.searchbar__inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  gap: var(--space-3);
}
.searchbar__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-4);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.searchbar__field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent);
}
.searchbar__field svg {
  flex: none;
  color: var(--ink-muted);
}
.searchbar input {
  flex: 1;
  border: 0;
  background: none;
  padding: var(--space-3) 0;
  font: inherit;
  color: inherit;
  min-width: 0;
}
.searchbar input:focus {
  outline: none;
}
/* Placeholders must clear 4.5:1 like any other text — the default muted grey does not. */
.searchbar input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.button {
  /* Set explicitly because .button is used on both <button> and <a>; without it the
     anchor keeps its underline and the two render differently. */
  text-decoration: none;
  display: inline-block;
  text-align: center;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 550;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.button:hover {
  background: var(--accent-strong);
}
.button:active {
  transform: translateY(0.5px);
}

/* ---------- shell ---------- */

.shell {
  max-width: 78rem;
  margin: 0 auto;
  padding: var(--space-5);
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 60rem) {
  .shell {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ---------- facet rail ---------- */

.rail {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
@media (max-width: 60rem) {
  .rail {
    position: static;
  }
}

.facet__heading {
  font-size: var(--step--1);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--ink);
}
.facet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.facet__item a {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  margin-inline: calc(-1 * var(--space-2));
  border-radius: var(--radius);
  font-size: var(--step--1);
  color: var(--ink-muted);
  text-decoration: none;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.facet__item a:hover {
  background: var(--panel);
  color: var(--ink);
}
.facet__item a[aria-current="true"] {
  color: var(--accent-strong);
  font-weight: 600;
  background: color-mix(in oklch, var(--accent) 10%, transparent);
}
.facet__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facet__count {
  flex: none;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* ---------- results ---------- */

.resultmeta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--ink-muted);
}
.resultmeta strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0 0;
  margin: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step--1);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 550;
}
.chip:hover {
  background: color-mix(in oklch, var(--accent) 18%, transparent);
}

/* A list, not a card grid. Providers are a homogeneous sequence people scan top to
   bottom; boxing each one adds 5,548 borders and no information. */
.results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.result {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
}
.result__name {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.result__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 0;
  list-style: none;
}
.tag {
  font-size: var(--step--1);
  color: var(--ink-muted);
}
.tag + .tag::before {
  content: "·";
  margin-right: var(--space-2);
  opacity: 0.6;
}

.locations {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.location {
  background: var(--panel);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--step--1);
}
.location__name {
  font-weight: 550;
  color: var(--ink);
}
.location__address {
  color: var(--ink-muted);
  margin-top: var(--space-1);
}
.result__more {
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: var(--space-3);
}

/* ---------- empty / error ---------- */

.notice {
  padding: var(--space-7) var(--space-5);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  margin-top: var(--space-5);
}
.notice__title {
  font-size: var(--step-2);
  font-weight: 600;
}
.notice__body {
  color: var(--ink-muted);
  margin: var(--space-3) auto 0;
  max-width: 44ch;
}
.notice__body p {
  margin: 0 0 var(--space-2);
}
.notice--error {
  border-style: solid;
  border-color: color-mix(in oklch, oklch(0.55 0.18 25) 40%, var(--line));
  text-align: left;
}
/* The shared .notice__body centres itself with auto margins, which left the outage
   message indented away from its own heading. Left-align it with the title. */
.notice--error .notice__body {
  margin-inline: 0;
}

/* With no results there are no facets, so the rail column is 15rem of nothing. Collapse
   to a single column rather than framing the error with empty space. */
.shell--full {
  grid-template-columns: 1fr;
}

.pager {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5) 0;
}
.pager a {
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--accent-strong);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease);
}
.pager a:hover {
  border-color: var(--accent);
}

/* ---------- deployment picker ---------- */

.picker {
  max-width: 46rem;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}
.picker h1 {
  font-size: var(--step-4);
}
.picker__lede {
  color: var(--ink-muted);
  max-width: 60ch;
  margin: var(--space-3) 0 var(--space-6);
  text-wrap: pretty;
}
.picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.picker__item a {
  display: block;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.picker__item a:hover {
  border-color: var(--accent);
  background: var(--panel);
}
.picker__name {
  font-weight: 600;
  font-size: var(--step-1);
}
.picker__scope {
  color: var(--ink-muted);
  font-size: var(--step--1);
  margin-top: var(--space-1);
}

/* Results appear on a full page load, so the entrance is a single short fade on the
   list — enough to mark that the content changed, not a choreographed sequence. The
   content is visible by default; the animation only softens its arrival, so a headless
   render or a background tab still ships a full page. */
@media (prefers-reduced-motion: no-preference) {
  .results,
  .notice {
    animation: rise var(--medium) var(--ease) both;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
 * Admin — the staff surface.
 *
 * Denser than the storefront and neutral rather than branded: an operator here is
 * changing who a customer's storefront serves, so the chrome should not look like the
 * customer's own site.
 * ------------------------------------------------------------------------- */

.banner {
  background: color-mix(in oklch, oklch(0.72 0.14 75) 16%, var(--surface));
  border-bottom: 1px solid color-mix(in oklch, oklch(0.62 0.14 75) 45%, var(--line));
  color: var(--ink);
  font-size: var(--step--1);
  padding: var(--space-3) var(--space-5);
  text-align: center;
}

.admin {
  max-width: 78rem;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-7);
}
.admin--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 64rem) {
  .admin--split {
    grid-template-columns: 1fr;
  }
}

.admin__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.admin__title {
  font-size: var(--step-3);
}
.admin__sub {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font-size: var(--step--1);
}
.admin__sub code,
.table__meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* ---------- table ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}
.table th {
  text-align: left;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-muted);
  padding: 0 var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table__name {
  font-weight: 600;
}
.table__meta {
  font-size: var(--step--1);
  color: var(--ink-muted);
}
.table__actions {
  text-align: right;
  white-space: nowrap;
}
.table__actions a {
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--accent-strong);
  text-decoration: none;
  margin-left: var(--space-3);
}
.table__actions a:hover {
  text-decoration: underline;
}

.table__share {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}
.table__share .share {
  width: 5.5rem;
  margin-bottom: 0;
}

.share {
  height: 5px;
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
  margin-bottom: var(--space-1);
}
.share--lg {
  height: 8px;
  margin: var(--space-3) 0 var(--space-4);
}
.share__fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width var(--medium) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .share__fill {
    transition: none;
  }
}

/* ---------- fields ---------- */

.field {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-6);
}
.field__legend {
  font-size: var(--step-1);
  font-weight: 600;
  padding: 0;
  margin-bottom: var(--space-2);
}
.field__hint {
  color: var(--ink-muted);
  font-size: var(--step--1);
  margin: 0 0 var(--space-3);
  max-width: 62ch;
  text-wrap: pretty;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-1) var(--space-4);
}
.checklist--compact {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.check {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2);
  margin-inline: calc(-1 * var(--space-2));
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--step-0);
  transition: background var(--fast) var(--ease);
}
.check:hover {
  background: var(--panel);
}
.check input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  flex: none;
  translate: 0 2px;
}
.check__label {
  flex: 1;
  min-width: 0;
  /* Several business-unit names are single unbroken tokens
     ("Allergy/Immunology/Rheumatology"), which have no space to wrap at and so overrun
     the column and collide with the count. Break inside the word instead. */
  overflow-wrap: anywhere;
}
.check__count {
  font-size: var(--step--1);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.check--wide {
  align-items: flex-start;
  max-width: 62ch;
}
.check__note {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: var(--space-1);
  text-wrap: pretty;
}

/* ---------- scope card ---------- */

.admin__side {
  position: sticky;
  top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
@media (max-width: 64rem) {
  .admin__side {
    position: static;
  }
}

.scopecard {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-5);
}
.scopecard__count {
  font-size: 2.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.scopecard__of {
  color: var(--ink-muted);
  font-size: var(--step--1);
  margin-top: var(--space-2);
}
.scopecard__hint {
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin: var(--space-3) 0 0;
  text-align: center;
}
.scopecard__link {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--accent-strong);
  text-decoration: none;
}

.button--full {
  width: 100%;
}

.alert {
  font-size: var(--step--1);
  padding: var(--space-3);
  border-radius: var(--radius);
  margin: 0 0 var(--space-3);
  text-wrap: pretty;
}
.alert--warn {
  background: color-mix(in oklch, oklch(0.72 0.14 75) 18%, transparent);
  color: oklch(0.36 0.08 62);
}
.alert--error {
  background: color-mix(in oklch, oklch(0.58 0.19 25) 14%, transparent);
  color: oklch(0.38 0.14 25);
}

.record {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-size: var(--step--1);
}
.record summary {
  cursor: pointer;
  font-weight: 600;
}
.record pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  background: var(--panel);
  padding: var(--space-3);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: var(--space-3) 0 0;
}

/* ---------- result-type tabs (total site search) ---------- */

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-4);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--step-0);
  font-weight: 550;
  color: var(--ink-muted);
  text-decoration: none;
  /* Underline the active tab with the accent rather than boxing it: a boxed tab reads
     as a button and invites a second click. */
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab--on {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}
.tab__count {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.result--page .result__link {
  color: var(--accent-strong);
  text-decoration: none;
}
.result--page .result__link:hover { text-decoration: underline; }
.result__url {
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: var(--space-1);
  overflow-wrap: anywhere;
}
.result__snippet {
  margin: var(--space-3) 0 0;
  font-size: var(--step-0);
  color: var(--ink);
  max-width: 72ch;
  text-wrap: pretty;
}
.result__snippet mark {
  background: color-mix(in oklch, var(--accent) 22%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.crosslink {
  margin: var(--space-5) 0 0;
  font-size: var(--step-0);
}
.crosslink a {
  color: var(--accent-strong);
  font-weight: 550;
  text-decoration: none;
}
.crosslink a:hover { text-decoration: underline; }

/* ---------- admin console shell (Optimize AppLayout idiom) ---------- */

.console {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 8rem);
}
@media (max-width: 60rem) {
  .console { grid-template-columns: 1fr; }
}

.sidenav {
  position: sticky;
  top: 0;
  padding: var(--space-5) var(--space-3);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-height: calc(100vh - 8rem);
}
@media (max-width: 60rem) {
  .sidenav {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    gap: var(--space-5);
    overflow-x: auto;
  }
}

.sidenav__heading {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 var(--space-2) var(--space-3);
}
.sidenav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
@media (max-width: 60rem) { .sidenav__list { flex-direction: row; } }

.navitem {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--step-0);
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.navitem:hover { background: var(--panel); color: var(--ink); }
.navitem--on {
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
}
.navitem__icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.9em;
}

.console__main {
  padding: var(--space-6) var(--space-6) var(--space-7);
  max-width: 68rem;
}
/* The console owns its own padding, so the inner .admin wrapper must not add more. */
.console__main .admin { padding: 0; max-width: none; }

.record-pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: var(--space-4);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
