/*
 * THE token mapping file (docs/HANDOFF.md section 4.2).
 *
 * Each line maps an internal --eoe-* alias to a Webflow site variable, with the
 * Figma value as the fallback. Component CSS uses only the --eoe-* aliases, so
 * when BX supplies the real Webflow Variable names ("Copy CSS" in the Variables
 * panel), only the inner name on each line changes.
 *
 * The inner names below are placeholders from docs/audience-selector/SPEC.md
 * section 4 until BX confirms them. Site variables cross the Shadow DOM
 * boundary because custom properties inherit, so site values win and the
 * fallbacks apply only when the site doesn't define the variable.
 *
 * Applied on .eoe-root, the root element of every component.
 */
.eoe-root {
  /* Typography (SPEC 4.1) */
  --eoe-font-family: var(--font-family-secondary, Inter);
  --eoe-font-size-caption: var(--font-size-caption, 12px);
  --eoe-font-size-body-sm: var(--font-size-body-sm, 14px);
  --eoe-font-size-body-lg: var(--font-size-body-lg, 18px);
  --eoe-font-size-heading-xl: var(--font-size-heading-xl, 40px);

  /* Spacing (SPEC 4.1) */
  --eoe-space-none: var(--space-none, 0);
  --eoe-space-2xs: var(--space-2xs, 4px);
  --eoe-space-xs: var(--space-xs, 8px);
  --eoe-space-sm: var(--space-sm, 12px);
  --eoe-space-md: var(--space-md, 16px);
  --eoe-space-lg: var(--space-lg, 24px);

  /* Radius (SPEC 4.1) */
  --eoe-radius-none: var(--radius-none, 0);
  --eoe-radius-xs: var(--radius-xs, 4px);
  --eoe-radius-sm: var(--radius-sm, 8px);
  --eoe-radius-lg: var(--radius-lg, 16px);
  --eoe-radius-full: var(--radius-full, 999px);

  /* Color (SPEC 4.1) */
  --eoe-color-background-canvas: var(--color-background-canvas, rgba(255, 255, 255, 0.1));
  --eoe-color-background-surface-4: var(--color-background-surface-4, #ecf785);
  --eoe-color-text-link-3: var(--color-text-link-3, #004bd7);
  --eoe-color-border-subtle: var(--color-border-subtle, rgba(255, 255, 255, 0.3));

  /* Values Figma hard-codes, made tokens (SPEC 4.2) */
  --eoe-color-text-on-glass: var(--color-text-on-glass, #ffffff);
  --eoe-color-text-on-glass-muted: var(--color-text-on-glass-muted, rgba(255, 255, 255, 0.5));
  --eoe-color-border-on-glass: var(--color-border-on-glass, rgba(255, 255, 255, 0.5));
  --eoe-color-border-card: var(--color-border-card, rgba(255, 255, 255, 0.9));
  --eoe-shadow-segment-selected: var(--shadow-segment-selected, 0 2px 2px rgba(15, 23, 42, 0.08));
  --eoe-blur-glass: var(--blur-glass, 10px);

  /* Component-level values not in Figma's variables. Internal only: no site variable to follow. */
  --eoe-color-focus-ring: rgba(255, 255, 255, 0.9);
  --eoe-color-option-text: #0e1b3d;
  --eoe-color-option-background: #ffffff;
  --eoe-tracking-title: -0.0036px;
  --eoe-tracking-label: 0.006px;
  --eoe-tracking-count: -0.4px;
  --eoe-size-card-max-width: 460px;
  --eoe-size-avatar: 32px;
  --eoe-size-avatar-overlap: -11px;
  --eoe-size-control-height: 40px;
  --eoe-size-chevron: 14px;
  --eoe-size-hairline: 1px;
  --eoe-size-avatar-border: 1.5px; /* Matt, 2026-10-15: lighter than the 2px in SPEC 3.2 */
  --eoe-size-focus-ring: 2px;

  /*
   * Outcomes Report (docs/outcomes-report/SPEC.md section 5). The glass tokens above are shared.
   * The spec suggests generic names such as --color-text-primary. Those are renamed "on-glass"
   * here so a site's own text colors (meant for white backgrounds) can't leak into the card.
   */
  --eoe-color-accent: var(--color-accent-green, #ecf785);
  --eoe-color-accent-ink: var(--color-accent-green-ink, #3a3f06);
  --eoe-color-text-on-glass-body: var(--color-text-on-glass-body, rgba(255, 255, 255, 0.88));
  --eoe-color-text-on-glass-heading: var(--color-text-on-glass-heading, rgba(255, 255, 255, 0.75));
  --eoe-color-text-on-glass-soft: var(--color-text-on-glass-soft, rgba(255, 255, 255, 0.6));
  --eoe-color-border-tab: var(--color-border-tab, rgba(255, 255, 255, 0.6));
  --eoe-color-fill-tab-number: var(--color-fill-tab-number, rgba(255, 255, 255, 0.15));
  --eoe-color-fill-tab-hover: var(--color-fill-tab-hover, rgba(255, 255, 255, 0.08));
  --eoe-color-divider-on-glass: var(--color-divider-on-glass, rgba(255, 255, 255, 0.3));
  --eoe-color-divider-row-on-glass: var(--color-divider-row-on-glass, rgba(255, 255, 255, 0.2));
  --eoe-color-badge-orange: var(--color-badge-orange, #f5b27a);
  --eoe-color-badge-orange-fill: var(--color-badge-orange-fill, rgba(245, 178, 122, 0.22));
  --eoe-color-badge-purple: var(--color-badge-purple, #d9a8ff);
  --eoe-color-badge-purple-fill: var(--color-badge-purple-fill, rgba(190, 130, 255, 0.18));
  --eoe-color-pill-teal: var(--color-pill-teal, #8ef0cf);
  --eoe-color-pill-teal-fill: var(--color-pill-teal-fill, rgba(110, 230, 190, 0.16));
  --eoe-color-pill-sky: var(--color-pill-sky, #b8d4ff);
  --eoe-color-pill-sky-fill: var(--color-pill-sky-fill, rgba(160, 200, 255, 0.16));

  /* Outcomes Report sizes from the prototype. Internal only. */
  --eoe-or-size-max-width: 994px;
  --eoe-or-size-tab-width: 220px;
  --eoe-or-size-tab-number: 38px;
  --eoe-or-size-tab-number-compact: 30px;
  --eoe-or-size-row-min: 50px;
  --eoe-or-size-subtitle-max: 520px;
  --eoe-or-col-physician: 210px;
  --eoe-or-col-engaged: 260px;
  --eoe-or-col-time: 52px;
  --eoe-or-col-depth: 136px;
  --eoe-or-space-3xs: 2px;
  --eoe-or-space-tab-desc: 10px;
  --eoe-or-space-stack: 20px;
  --eoe-or-space-card-y: 28px;
  --eoe-or-space-card-x: 36px;
  --eoe-or-radius-badge: 6px;
  --eoe-or-font-size-title: 20px;
  --eoe-or-font-size-title-compact: 18px;
  --eoe-or-font-size-stat-value: 24px;
  --eoe-or-font-size-stat-value-compact: 20px;
  --eoe-or-font-size-badge: 12.5px;
  --eoe-or-font-size-pill: 11.5px;
  --eoe-or-font-size-stat-label: 11px;
  --eoe-or-font-size-table: 13px;
  --eoe-or-font-size-table-detail: 11px;
  --eoe-or-font-size-reveal: 10.5px;
  --eoe-or-badge-padding: 4px 10px;
  --eoe-or-pill-padding: 3px 9px;
  --eoe-or-reveal-padding: 1px 7px;
  --eoe-or-tab-padding: 2px 16px 2px 2px;
  --eoe-or-blur-locked: 7px;
  --eoe-or-opacity-locked: 0.55;
  --eoe-or-focus-offset: 3px;
  --eoe-or-duration-reveal: 500ms;
  --eoe-or-duration-tab: 200ms;

  /* ---- Author Roster (docs/author-roster/SPEC.md section 6) ----
   * Inner names follow the Figma variable names (fill/blue-200 -> --fill-blue-200).
   * They are literal palette names, so a matching site variable holds the same value.
   * Fonts: the site's --font-primary / --font-accent win when BX defines them (SPEC 6). */
  --eoe-ar-font-primary: var(--font-primary, "Gotham Pro", system-ui, -apple-system, sans-serif);
  --eoe-ar-font-accent: var(--font-accent, "Tiempos Text", Georgia, serif);
  --eoe-ar-color-blue-200: var(--fill-blue-200, #dde9ff);
  --eoe-ar-color-blue-50: var(--fill-blue-50, #f8faff);
  --eoe-ar-color-blue-800: var(--fill-blue-800, #004bd7);
  --eoe-ar-color-blue-800-15: var(--fill-blue-800-15, rgba(0, 75, 215, 0.15));
  --eoe-ar-color-ink: var(--fill-black, #000000);
  --eoe-ar-color-ink-75: var(--fill-black-75, rgba(0, 0, 0, 0.75));
  --eoe-ar-color-ink-40: var(--fill-black-40, rgba(0, 0, 0, 0.4));
  --eoe-ar-color-stroke-7: var(--stroke-black-7, rgba(0, 0, 0, 0.07));
  --eoe-ar-color-stroke-15: var(--stroke-black-15, rgba(0, 0, 0, 0.15));
  --eoe-ar-color-green: var(--button-green, #ecf785);
  --eoe-ar-color-green-950: var(--fill-green-950, #3a3f06);
  --eoe-ar-color-white: var(--fill-white, #ffffff);
  /* Internal sizes (SPEC 6 element table). No site variable to follow. */
  --eoe-ar-font-size-16: 16px;
  --eoe-ar-font-size-20: 20px;
  --eoe-ar-font-size-32: 32px;
  --eoe-ar-font-size-28: 28px;
  --eoe-ar-font-size-18: 18px;
  --eoe-ar-space-2: 2px;
  --eoe-ar-space-20: 20px;
  --eoe-ar-space-32: 32px;
  --eoe-ar-space-40: 40px;
  --eoe-ar-radius-avatar: 2px;
  --eoe-ar-size-max-width: 1312px;
  --eoe-ar-size-panel-height: 488px;
  --eoe-ar-size-list-height-stacked: 336px;
  --eoe-ar-size-content-height-stacked: 420px;
  --eoe-ar-size-avatar: 44px;
  --eoe-ar-size-board-photo: 200px;
  --eoe-ar-size-board-photo-narrow: 120px;
  --eoe-ar-size-blurb: 346px;
  --eoe-ar-size-thumb: 120px;
  --eoe-ar-size-thumb-narrow: 88px;
  --eoe-ar-size-card-height: 64px;
  --eoe-ar-size-search-height: 46px;
  --eoe-ar-size-icon: 24px;
  --eoe-ar-size-icon-sm: 16px;
  --eoe-ar-size-tab-height: 44px;
  --eoe-ar-size-tab-number: 36px;
  --eoe-ar-size-scrollbar: 6px;
  --eoe-ar-size-scroll-gutter: 14px;
  --eoe-ar-size-focus-ring: 2px;
}

/*
 * Audience Selector styles (docs/audience-selector/SPEC.md sections 3, 5, 10).
 * Every value comes from a --eoe-* alias in src/tokens/tokens.css; scripts/check-tokens.ts
 * fails CI on bare colors or pixel sizes here.
 *
 * .as-root is the component's single root element and its size container (HANDOFF 4.6):
 * @container rules below respond to the card's own width, not the viewport.
 */
.as-root {
  container-type: inline-size;
  width: 100%;
  max-width: var(--eoe-size-card-max-width);
  font-family:
    var(--eoe-font-family),
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: normal;
  color: var(--eoe-color-text-on-glass);
  text-align: left;
}

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

.as-card {
  display: flex;
  flex-direction: column;
  gap: var(--eoe-space-md);
  padding: var(--eoe-space-lg);
  background: var(--eoe-color-background-canvas);
  -webkit-backdrop-filter: blur(var(--eoe-blur-glass));
  backdrop-filter: blur(var(--eoe-blur-glass));
  border: var(--eoe-size-hairline) solid var(--eoe-color-border-card);
  border-radius: var(--eoe-radius-lg);
}

/* Header */
.as-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--eoe-space-sm);
}

.as-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.as-title,
.as-subtitle {
  margin: 0;
}

.as-title {
  font-size: var(--eoe-font-size-body-lg);
  font-weight: 500;
  letter-spacing: var(--eoe-tracking-title);
}

.as-subtitle {
  font-size: var(--eoe-font-size-caption);
  font-weight: 400;
  color: var(--eoe-color-text-on-glass-muted);
}

.as-avatars {
  display: flex;
  flex-shrink: 0;
}

.as-avatar {
  display: block;
  width: var(--eoe-size-avatar);
  height: var(--eoe-size-avatar);
  border: var(--eoe-size-avatar-border) solid var(--eoe-color-text-on-glass);
  border-radius: var(--eoe-radius-full);
  object-fit: cover;
}

.as-avatar + .as-avatar {
  margin-left: var(--eoe-size-avatar-overlap);
}

.as-divider {
  width: 100%;
  height: var(--eoe-size-hairline);
  margin: 0;
  border: 0;
  background: var(--eoe-color-border-subtle);
}

/* Shared field + label */
.as-field {
  display: flex;
  flex-direction: column;
  gap: var(--eoe-space-2xs);
  min-width: 0;
}

.as-label {
  font-size: var(--eoe-font-size-caption);
  font-weight: 600;
  letter-spacing: var(--eoe-tracking-label);
  text-transform: uppercase;
  color: var(--eoe-color-text-on-glass-muted);
}

/* Provider type segmented control */
.as-segments {
  display: flex;
  width: 100%;
  padding: var(--eoe-space-2xs);
  background: var(--eoe-color-background-canvas);
  border: var(--eoe-size-hairline) solid var(--eoe-color-border-on-glass);
  border-radius: var(--eoe-radius-sm);
}

.as-segment {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: var(--eoe-space-xs) var(--eoe-space-none);
  font: inherit;
  font-size: var(--eoe-font-size-body-sm);
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
  text-align: center;
  color: var(--eoe-color-text-on-glass);
  background: transparent;
  border: 0;
  border-radius: var(--eoe-radius-xs);
  cursor: pointer;
}

.as-segment:hover {
  background: var(--eoe-color-background-canvas);
}

.as-segment[aria-checked="true"] {
  font-weight: 600;
  color: var(--eoe-color-text-link-3);
  background: var(--eoe-color-background-surface-4);
  filter: drop-shadow(var(--eoe-shadow-segment-selected));
}

/* Filter row */
.as-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--eoe-space-sm);
}

.as-select {
  position: relative;
}

.as-select select {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: var(--eoe-size-control-height);
  margin: 0;
  padding: 0 calc(var(--eoe-space-sm) + var(--eoe-size-chevron) + var(--eoe-space-xs)) 0
    var(--eoe-space-sm);
  font: inherit;
  font-size: var(--eoe-font-size-body-sm);
  font-weight: 500;
  color: var(--eoe-color-text-on-glass);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background: var(--eoe-color-background-canvas);
  border: var(--eoe-size-hairline) solid var(--eoe-color-border-on-glass);
  border-radius: var(--eoe-radius-sm);
  cursor: pointer;
}

/* White select text would make the OS menu white-on-white on some platforms. */
.as-select option {
  color: var(--eoe-color-option-text);
  background: var(--eoe-color-option-background);
}

.as-chevron {
  position: absolute;
  top: 50%;
  right: var(--eoe-space-sm);
  width: var(--eoe-size-chevron);
  height: var(--eoe-size-chevron);
  transform: translateY(-50%);
  color: var(--eoe-color-text-on-glass);
  pointer-events: none;
}

/* Result */
.as-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--eoe-space-2xs);
  padding: var(--eoe-space-md);
  background: var(--eoe-color-background-canvas);
  border: var(--eoe-size-hairline) solid var(--eoe-color-border-on-glass);
  border-radius: var(--eoe-radius-sm);
}

.as-count {
  font-size: var(--eoe-font-size-heading-xl);
  font-weight: 600;
  letter-spacing: var(--eoe-tracking-count);
  font-variant-numeric: tabular-nums;
}

.as-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus (not in Figma, SPEC 3.4) */
.as-segment:focus-visible,
.as-select select:focus-visible {
  outline: var(--eoe-size-focus-ring) solid var(--eoe-color-focus-ring);
  outline-offset: var(--eoe-size-focus-ring);
}

/* Phones: card narrower than 420px (SPEC 5) */
@container (max-width: 419.98px) {
  .as-card {
    padding: var(--eoe-space-md);
  }

  .as-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .as-segment {
    flex: 1 1 auto;
    padding-inline: var(--eoe-space-sm);
  }
}

/* Very narrow: card narrower than 320px */
@container (max-width: 319.98px) {
  .as-segment {
    font-size: var(--eoe-font-size-caption);
  }
}

