/* Accepted Insurance Plans — phone-only redesign (<768px).
   Aligned to the Methadone mobile "Who methadone treatment may help" section (.svcb) as the
   proportional source of truth: shared mobile-heading title scale, compact hierarchy, translucent
   gradient card surfaces with subtle borders/shadows, 40px rounded-square icon tiles, ~70px rows,
   36-38px controls, 24-28px gutters. Every selector is scoped under .avc-insurance and lives inside
   the phone media band, so tablet/desktop and other sections are untouched. The tablet/desktop
   directory (.aip-directory__inner[data-aip-mobile-legacy]) is hidden only under 768px; its markup,
   JS and data are unchanged. Accordion + search wiring is in accepted-insurance.js. Icons are the
   handoff SVGs; insurer logos are the existing payers-normalized-large assets. */

.avc-insurance { display: none; }

@media (max-width: 767.98px) {
  /* Swap the desktop directory for the phone redesign in this band only. */
  .aip-directory[data-aip-directory] > .aip-directory__inner[data-aip-mobile-legacy] { display: none; }
  /* The section carries 24px inline padding for the desktop directory; drop it on phones so the block
     owns its own .svcb-matched gutters. Safe: the only phone child is .avc-insurance. */
  #accepted-insurance-plans.aip-directory[data-aip-directory] { padding-inline: 0; }

  .avc-insurance {
    --avc-navy: #082C30;
    --avc-copy: var(--ink-600, #475569);
    --avc-teal: #087d7b;
    --avc-orange: #b75a36;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 432px;                                   /* .svcb container width */
    margin-inline: auto;
    padding: clamp(22px, 5.5vw, 26px) clamp(24px, 6vw, 28px) clamp(18px, 4.5vw, 22px);  /* .svcb rhythm + gutters */
    background: transparent;
    color: var(--avc-navy);
    font-family: var(--font-sans);
  }
  .avc-insurance *, .avc-insurance *::before, .avc-insurance *::after { box-sizing: border-box; }
  .avc-insurance .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .avc-insurance .avc-ico { display: block; width: 100%; height: 100%; }

  /* ---- Intro (matches the .svcb shared-heading scale) ---- */
  .avc-intro { text-align: center; }
  .avc-eyebrow {
    display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0;
    text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700;
    font-family: var(--font-sans); color: var(--avc-teal);
  }
  .avc-eyebrow__line { width: 26px; border-top: 1.5px solid var(--avc-teal); }
  .avc-eyebrow__dot { width: 11px; height: 11px; border-radius: 50%; background: #ed744d; box-shadow: 0 0 0 4px #ffe2d6; }
  .avc-intro__title {
    margin: 13px 0 0; font-family: var(--font-display); font-weight: 600;
    font-size: clamp(26px, 7vw, 30.8px); line-height: 1.16; letter-spacing: -.018em; color: var(--avc-navy);
    text-wrap: balance;
  }
  .avc-intro__title em { font-style: italic; font-weight: 500; color: #087d7b; }
  .avc-intro__period { color: #e15c30; }
  .avc-intro__lede {
    margin: 14px auto 0; max-width: 30em; color: var(--avc-copy);
    font-family: var(--font-sans); font-size: 14px; font-weight: 400; line-height: 1.5; text-wrap: pretty;
  }

  /* ---- Verify + help cards (.svcb-style translucent teal surface) ---- */
  .avc-verify, .avc-help {
    display: grid; border: 1px solid rgba(15, 118, 110, .2); border-radius: 16px;
    background: linear-gradient(128deg, rgba(233, 249, 247, .95), rgba(255, 255, 255, .72));
    box-shadow: 0 8px 26px rgba(22, 55, 57, .03), inset 0 1px 0 rgba(255, 255, 255, .78);
  }
  .avc-verify { grid-template-columns: 40px 1fr; gap: 12px; margin-top: 22px; padding: 15px 16px 14px; }
  .avc-verify__icon, .avc-help__icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
    border: 1px solid rgba(15, 119, 117, .14); background: rgba(232, 247, 246, .78);
    box-shadow: 0 4px 12px rgba(27, 64, 66, .04); color: var(--avc-teal);
  }
  .avc-verify__icon img { width: 22px; height: 22px; }
  .avc-verify__body { min-width: 0; }
  .avc-verify__title { margin: 0 0 9px; font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.18; letter-spacing: -.014em; }
  .avc-verify__cta, .avc-primary {
    display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 14px;
    border-radius: 999px; background: linear-gradient(100deg, #0a8a80, #12836f);
    color: #fff; text-decoration: none; font-family: var(--font-sans); font-weight: 700; font-size: 15px;
    box-shadow: 0 10px 20px rgba(6, 120, 110, .2);
  }
  .avc-verify__arrow { width: 18px; height: 18px; filter: brightness(0) invert(1); }
  .avc-verify__meta { display: block; margin-top: 9px; text-align: center; color: var(--avc-copy); font-family: var(--font-sans); font-size: 11.5px; }

  /* ---- Search ---- */
  .avc-search {
    display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 18px 0 22px; padding: 0 16px;
    border: 1px solid rgba(23, 74, 78, .16); border-radius: 14px; background: rgba(255, 255, 255, .92);
    box-shadow: 0 4px 14px rgba(22, 55, 57, .03), inset 0 1px 0 rgba(255, 255, 255, .8);
  }
  .avc-search__icon { width: 18px; height: 18px; flex: none; }
  .avc-search__input {
    width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--avc-navy);
    font: 16px/1.2 var(--font-sans); /* 16px: iOS does not zoom the page on focus */
  }
  .avc-search__input::placeholder { color: #63708a; }
  /* 2026-09-24 clean field focus (owner decision): the pill shows focus by its border; a 1px ring only for keyboard focus (--av-ring-w is 0px while <html data-av-input="pointer">). */
  .avc-search:focus-within { border-color: #6bb7bb; box-shadow: 0 0 0 var(--av-ring-w, 1px) #6bb7bb; }
  .avc-search__input:focus, .avc-search__input:focus-visible { outline: none; box-shadow: none; }

  /* ---- Browse header ---- */
  .avc-browse { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 11px; }
  .avc-browse__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.1; letter-spacing: -.015em; }
  .avc-browse__count { flex: none; padding: 7px 14px; border-radius: 999px; background: #e4f6f5; color: var(--avc-navy); font-family: var(--font-sans); font-size: 12.5px; font-weight: 700; }

  /* ---- Accordion group cards (.svcb translucent gradient surfaces) ---- */
  .avc-groups { display: grid; gap: 11px; }
  .avc-group {
    border: 1px solid var(--avc-border); border-radius: 16px;
    background: linear-gradient(128deg, var(--avc-bg-a), var(--avc-bg-b));
    box-shadow: 0 8px 26px rgba(22, 55, 57, .03), inset 0 1px 0 rgba(255, 255, 255, .78);
  }
  .avc-group--medicaid { --avc-accent: #087d7b; --avc-border: rgba(15, 118, 110, .19); --avc-bg-a: rgba(244, 251, 251, .95); --avc-bg-b: rgba(255, 255, 255, .70); --avc-icon-bg: rgba(232, 247, 246, .74); --avc-icon-border: rgba(15, 119, 117, .14); }
  .avc-group--commercial { --avc-accent: #6F9F45; --avc-border: rgba(111, 159, 69, .22); --avc-bg-a: rgba(250, 252, 242, .96); --avc-bg-b: rgba(255, 255, 255, .72); --avc-icon-bg: rgba(239, 248, 229, .82); --avc-icon-border: rgba(111, 159, 69, .15); }
  .avc-group--additional { --avc-accent: #D96B49; --avc-border: rgba(217, 107, 73, .21); --avc-bg-a: rgba(255, 248, 242, .96); --avc-bg-b: rgba(255, 255, 255, .73); --avc-icon-bg: rgba(255, 239, 229, .82); --avc-icon-border: rgba(217, 107, 73, .15); }

  .avc-group__heading { margin: 0; font: inherit; }
  .avc-group__toggle {
    width: 100%; min-height: 70px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 37px;
    gap: 13px; align-items: center; padding: 12px 16px; border: 0; background: transparent;
    text-align: left; color: var(--avc-navy); cursor: pointer; border-radius: 16px;
  }
  .avc-group__icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
    border: 1px solid var(--avc-icon-border); background: var(--avc-icon-bg);
    box-shadow: 0 4px 12px rgba(27, 64, 66, .035);
  }
  .avc-group__icon img { width: 22px; height: 22px; }
  .avc-group__label { min-width: 0; }
  .avc-group__title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.1; letter-spacing: -.012em; }
  .avc-group__count { display: block; margin-top: 4px; color: var(--avc-copy); font-family: var(--font-sans); font-size: 12.5px; }
  .avc-group__chevron {
    display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--avc-accent) 40%, #fff); background: rgba(255, 255, 255, .7); color: var(--avc-accent);
  }
  .avc-group__chevron .avc-ico { width: 18px; height: 18px; }
  .avc-group__toggle[aria-expanded="true"] .when-closed,
  .avc-group__toggle[aria-expanded="false"] .when-open { display: none; }

  /* Panel: height is animated by JS; overflow clipped so the list never spills the card. */
  .avc-group__panel { overflow: hidden; }
  .avc-group__panel[hidden] { display: none; }
  .avc-group__panel-inner { padding: 0 12px 12px; }
  .avc-group__list {
    list-style: none; margin: 0; padding: 0 12px; border: 1px solid rgba(23, 74, 78, .1); border-radius: 12px;
    background: rgba(255, 255, 255, .92);
  }
  .avc-plan {
    display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
    min-height: 52px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--avc-accent, #174a4e) 14%, transparent);
  }
  .avc-plan[hidden] { display: none; }
  .avc-plan:last-child { border-bottom: 0; }
  .avc-plan__logo { display: grid; place-items: center; width: 38px; height: 38px; }
  .avc-plan__logo img { width: 38px; height: 38px; padding: 4px; object-fit: contain; border: 1px solid rgba(23, 74, 78, .12); border-radius: 50%; background: #fff; }
  .avc-plan__name { min-width: 0; font-family: var(--font-display); font-weight: 500; font-size: 13.5px; line-height: 1.2; letter-spacing: -.005em; color: #113C40; }
  .avc-plan__view { display: inline-flex; align-items: center; gap: 3px; flex: none; color: #0a7a70; font: 700 12.5px var(--font-sans); text-decoration: none; white-space: nowrap; }
  .avc-plan__ext { width: 15px; height: 15px; }

  /* ---- Empty state ---- */
  .avc-empty { margin: 13px 2px 0; color: var(--avc-copy); font-family: var(--font-sans); font-size: 13.5px; line-height: 1.45; }

  /* ---- Help / support card ---- */
  .avc-help { grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 0; margin-top: 20px; padding: 16px; }
  .avc-help__icon { color: var(--avc-navy); }
  .avc-help__icon img { width: 22px; height: 22px; }
  .avc-help__body { min-width: 0; }
  .avc-help__title { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.14; letter-spacing: -.012em; }
  .avc-help__copy { margin: 0; color: var(--avc-copy); font-family: var(--font-sans); font-size: 13px; line-height: 1.45; }
  .avc-primary { grid-column: 1 / -1; margin-top: 14px; }
  .avc-call {
    grid-column: 1 / -1; display: flex; min-height: 46px; align-items: center; justify-content: center; margin-top: 10px;
    border: 1px solid rgba(23, 74, 78, .18); border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--avc-navy);
    font-family: var(--font-sans); font-weight: 700; font-size: 15px; text-decoration: none;
  }

  /* ---- Focus + motion ---- */
  .avc-insurance a:focus-visible,
  .avc-insurance .avc-group__toggle:focus-visible {
    outline: 3px solid rgba(8, 125, 123, .55); outline-offset: 2px;
  }
  /* Inset the toggle ring so it sits inside the card; scoped to win over the shared rule above. */
  .avc-insurance .avc-group__toggle:focus-visible { outline-offset: -3px; }

  /* Very narrow phones (.svcb parity: 18px gutters at <=355.98px) */
  @media (max-width: 355.98px) {
    .avc-insurance { padding-inline: 18px; }
    .avc-group__toggle { grid-template-columns: 40px minmax(0, 1fr) 37px; gap: 11px; padding-inline: 13px; }
    .avc-group__title { font-size: 17px; }
    .avc-browse__title { font-size: 18px; }
  }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .avc-group__panel { transition: none !important; }
}
