/*
 * Therapist page, final pass (owner, 2026-11-20): the two interactive
 * sections, classes p05x-. "Your receptionist, built in" (the receptionist
 * block: three tabs, each with its copy and one large sample page; the New
 * clients tab carries the availability switch) and "Every place, every
 * person" (the places block: the licensed-states map with its sample result
 * and page, and the three doors). Linked only on pages with those classes
 * (peanut_scoped_css()). Tokens only. Layer blocks for the static state,
 * layer motion for what moves. Nothing here loops.
 */

@layer blocks {
  /* ---------- Shared: the head, a sample page in a browser frame ---------- */

  .p05x-rec__head,
  .p05x-places__head {
    max-width: 44rem;
    margin-block-end: var(--space-5);
  }

  .p05x-rec__title,
  .p05x-places__title {
    margin: 0;
  }

  .p05x-rec__intro,
  .p05x-places__intro {
    margin: var(--space-3) 0 0;
  }

  .p05x-site {
    overflow: hidden;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--step--1);
    line-height: 1.45;
  }

  .p05x-site__bar,
  .p05x-page__bar {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    padding: 0.5rem var(--space-2);
    background: var(--color-paper);
    border-block-end: var(--border);
    font-size: 0.75rem;
  }

  .p05x-site__dots {
    flex: none;
    width: 0.4375rem;
    height: 0.4375rem;
    margin-inline-end: 1.5rem;
    background: var(--color-ink);
    border-radius: 50%;
    box-shadow: 0.75rem 0 0 var(--color-ink), 1.5rem 0 0 var(--color-ink);
    opacity: 0.35;
  }

  .p05x-site__url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 0.125rem 0.625rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .p05x-site__body {
    display: grid;
    gap: var(--space-2);
    align-content: start;
    padding: var(--space-3);
  }

  .p05x-site__nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    justify-content: space-between;
    align-items: baseline;
    margin: 0;
    padding-block-end: var(--space-1);
    border-block-end: 1px solid var(--color-ink-line-faint);
  }

  .p05x-site__brand,
  .p05x-page__brand {
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .p05x-site__links {
    display: flex;
    gap: var(--space-2);
    font-size: 0.75rem;
    font-weight: 500;
  }

  .p05x-site__here {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
  }

  .p05x-site__h {
    margin: var(--space-1) 0 0;
    font-family: var(--font-heading);
    font-size: var(--step-3);
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }

  .p05x-site__pill {
    justify-self: start;
    margin: 0;
    padding: 0.25rem 0.875rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
  }

  .p05x-site__cta {
    margin: 0;
  }

  .p05x-site__btn {
    display: inline-block;
    padding: 0.625rem 1rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  /* ---------- Your receptionist, built in: the tabs ---------- */

  .p05x-rec__tabs {
    display: inline-flex;
    flex-wrap: wrap;
    margin-block-end: var(--space-4);
    padding: 0.25rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
  }

  .p05x-rec__tabs[hidden] {
    display: none;
  }

  /* the tap hints (snippets/demo/hint.php, industry.css): above the tabs,
     and on its own line at the top of the site settings */
  .p05x-rec__hint {
    margin-block-end: var(--space-2);
  }

  .p05x-avail__hint {
    flex-basis: 100%;
  }

  .p05x-places__hint {
    margin-block-end: var(--space-2);
  }

  /* in the sample column the grid gap spaces it */
  .p05x-places__sample > .p05x-places__hint {
    margin-block-end: 0;
  }

  .p05x-rec__tab {
    position: relative;
    overflow: hidden;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.625rem 0.875rem;
    background: none;
    border: 0;
    border-radius: var(--radius-pill);
    color: inherit;
    font: inherit;
    font-size: var(--step--1);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
  }

  .p05x-rec__tab[aria-selected="true"] {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .p05x-rec__tab:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  /* the step bar under the selected tab while the tabs play (motion layer) */
  .p05x-rec__tab::after {
    content: "";
    position: absolute;
    inset: auto 1rem 0.3125rem;
    height: 2px;
    background: var(--color-brand);
    border-radius: var(--radius-pill);
    transform: scaleX(0);
    transform-origin: left center;
  }

  /* ---------- the panels: without the script, one under the other ---------- */

  /* the copy and the sample page start at the top, so the sample sits right
     under the tabs whichever panel is the tallest */
  .p05x-rec__panel {
    display: grid;
    gap: var(--space-4);
    align-content: start;
    align-items: start;
  }

  .p05x-rec__panel:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 6px;
  }

  .p05x-rec:not(.is-live) .p05x-rec__panel + .p05x-rec__panel {
    margin-block-start: var(--space-5);
    padding-block-start: var(--space-5);
    border-block-start: var(--border);
  }

  /* with it the panels share one cell: the tallest sets the height, so a
     switch never moves the page */
  .p05x-rec.is-live .p05x-rec__panels {
    display: grid;
  }

  .p05x-rec.is-live .p05x-rec__panel {
    grid-area: 1 / 1;
  }

  .p05x-rec.is-live .p05x-rec__panel[data-off] {
    visibility: hidden;
  }

  /* the tab's name over its copy, only where the tabs do not show */
  .p05x-rec__step {
    margin: 0 0 var(--space-label-text);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p05x-rec.is-live .p05x-rec__step {
    display: none;
  }

  .p05x-rec__name {
    margin: 0 0 var(--space-2);
  }

  .p05x-rec__text {
    margin: 0;
  }

  .p05x-rec__mock .p05x-site {
    box-shadow: 4px 4px 0 var(--color-ink);
  }

  .p05x-rec__outro {
    max-width: 44rem;
    margin: var(--space-5) 0 0;
  }

  @media (min-width: 60rem) {
    .p05x-rec__panel {
      grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
      gap: var(--space-6);
    }

    .p05x-site__body {
      padding: var(--space-4);
    }
  }

  /* ---------- the fees page ---------- */

  .p05x-fees {
    display: grid;
    margin: 0;
  }

  .p05x-fees__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem var(--space-2);
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-block-start: 1px solid var(--color-ink-line-faint);
  }

  .p05x-fees__row:last-child {
    border-block-end: 1px solid var(--color-ink-line-faint);
  }

  .p05x-fees__row dt {
    font-weight: 500;
  }

  .p05x-fees__row dd {
    margin: 0;
  }

  .p05x-fees__blank {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border: 1px dashed var(--color-ink);
    border-radius: 0.375rem;
    font-size: 0.75rem;
  }

  /* ---------- the first-contact form ---------- */

  .p05x-form {
    display: grid;
    gap: var(--space-3);
  }

  .p05x-form__fields {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p05x-form__field {
    padding: 0.625rem 0.75rem;
    background: var(--color-white);
    border: 1px dashed var(--color-ink);
    border-radius: 0.375rem;
  }

  .p05x-form__never {
    align-self: start;
    padding: var(--space-2);
    background: var(--color-paper);
    border-radius: 0.5rem;
  }

  .p05x-form__nevertitle {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p05x-form__nevers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p05x-form__nevers del {
    color: inherit;
    text-decoration-thickness: 1px;
  }

  @media (min-width: 40rem) {
    .p05x-form {
      grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }

    .p05x-form__nevers {
      display: grid;
      gap: 0.25rem;
    }
  }

  /* ---------- the availability switch and its page ---------- */

  .p05x-avail {
    display: grid;
    gap: var(--space-2);
  }

  .p05x-avail__settings {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem 0.5rem var(--space-2);
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p05x-avail__settings[hidden] {
    display: none;
  }

  .p05x-avail__where {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p05x-switch {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.375rem 0.75rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    color: inherit;
    font: inherit;
    font-size: var(--step--1);
    font-weight: 500;
    cursor: pointer;
  }

  .p05x-switch:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .p05x-switch__track {
    position: relative;
    flex: none;
    width: 2.75rem;
    height: 1.5rem;
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-pill);
  }

  .p05x-switch__knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.5rem - 6px);
    height: calc(1.5rem - 6px);
    background: var(--color-white);
    border: var(--border);
    border-radius: 50%;
  }

  .p05x-switch[aria-checked="true"] .p05x-switch__track {
    background: var(--color-brand);
  }

  .p05x-switch[aria-checked="true"] .p05x-switch__knob {
    translate: 1.25rem 0;
  }

  .p05x-avail__label {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p05x-rec.is-live .p05x-avail__label {
    display: none;
  }

  .p05x-rec:not(.is-live) .p05x-avail__view + .p05x-avail__view {
    border-block-start: var(--border);
  }

  .p05x-rec.is-live .p05x-avail__views {
    display: grid;
  }

  .p05x-rec.is-live .p05x-avail__view {
    grid-area: 1 / 1;
  }

  .p05x-rec.is-live .p05x-avail__view[data-off] {
    visibility: hidden;
  }

  .p05x-avail__banner {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: 0.375rem;
    font-weight: 500;
  }

  .p05x-avail__banner--off {
    background: var(--color-butter);
  }

  .p05x-avail__reply {
    padding: 0.75rem;
    background: var(--color-paper);
    border-inline-start: 3px solid var(--color-ink);
    border-radius: 0 0.375rem 0.375rem 0;
  }

  .p05x-avail__reply p {
    margin: 0 0 0.375rem;
  }

  .p05x-avail__reply p:last-child {
    margin-block-end: 0;
  }

  /* ---------- Every place, every person ---------- */

  .p05x-places__grid {
    display: grid;
    gap: var(--space-6);
  }

  .p05x-places__name {
    margin: 0 0 var(--space-2);
  }

  .p05x-places__text {
    max-width: 38rem;
    margin: 0 0 var(--space-4);
  }

  .p05x-places__demo {
    display: grid;
    gap: var(--space-3);
    align-items: start;
  }

  /* the map: the Southwest, the three states, a button on each */
  .p05x-places__map {
    position: relative;
    overflow: hidden;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p05x-map {
    display: block;
    width: 100%;
    height: auto;
  }

  .p05x-map .hm-land {
    fill: var(--color-paper);
    stroke: var(--color-ink);
    stroke-width: 1.2;
    stroke-linejoin: round;
  }

  .p05x-map .hm-states {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 0.8;
    opacity: 0.25;
  }

  .p05x-map__state {
    fill: var(--color-butter);
    stroke: var(--color-ink);
    stroke-width: 1.2;
    stroke-linejoin: round;
  }

  .p05x-map__state[data-on] {
    fill: var(--color-brand);
    stroke-width: 2;
  }

  .p05x-places__pins[hidden] {
    display: none;
  }

  .p05x-places__pin {
    position: absolute;
    min-height: 2.5rem;
    margin: 0;
    padding: 0.375rem 0.875rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    translate: -50% -50%;
  }

  .p05x-places__pin[aria-pressed="true"] {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .p05x-places__pin:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  /* each on its state (the map's crop: x 110 to 450, y 190 to 470) */
  .p05x-places__pin--az {
    left: 25%;
    top: 68%;
  }

  .p05x-places__pin--nm {
    left: 57.5%;
    top: 70%;
  }

  .p05x-places__pin--co {
    left: 63.5%;
    top: 32%;
  }

  .p05x-places__pin--next {
    left: 27%;
    top: 20%;
    background: var(--color-paper);
    border-style: dashed;
  }

  .p05x-places__pin--next[aria-pressed="true"] {
    background: var(--color-ink);
    border-style: solid;
  }

  /* the sample: a search result above a page */
  .p05x-places__sample {
    display: grid;
    gap: var(--space-2);
  }

  .p05x-result {
    padding: var(--space-2) var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p05x-result__label {
    margin: 0 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p05x-result__title {
    margin: 0;
    font-size: var(--step-0);
    font-weight: 500;
    line-height: 1.35;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  .p05x-result__url {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
  }

  .p05x-page {
    overflow: hidden;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p05x-page__brand {
    flex: 1;
    min-width: 0;
    font-size: var(--step-0);
  }

  .p05x-page__langs {
    display: inline-flex;
    padding: 2px;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
  }

  .p05x-page__langs[hidden] {
    display: none;
  }

  .p05x-page__lang {
    min-width: 2.5rem;
    min-height: 2rem;
    margin: 0;
    padding: 0.25rem 0.5rem;
    background: none;
    border: 0;
    border-radius: var(--radius-pill);
    color: inherit;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
  }

  .p05x-page__lang[aria-pressed="true"] {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .p05x-page__lang:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .p05x-page__body {
    padding: var(--space-3);
  }

  .p05x-page__body .p05x-stack__item {
    display: grid;
    gap: var(--space-1);
    align-content: start;
  }

  .p05x-page__h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }

  .p05x-page__license {
    margin: 0 0 var(--space-1);
    font-size: var(--step--1);
  }

  /* the next state: a page waiting for its license */
  .p05x-page__next {
    margin: calc(var(--space-1) * -1);
    padding: var(--space-1);
    border: 1px dashed var(--color-ink);
    border-radius: 0.5rem;
  }

  .p05x-places__caption {
    margin: var(--space-3) 0 0;
  }

  /* every variant in one cell once the script runs: the largest sets the
     size, so a change of state or language never moves the page */
  .p05x-stack__item[hidden],
  .p05x-lang__v[hidden] {
    display: none;
  }

  .p05x-places.is-live .p05x-stack {
    display: grid;
  }

  .p05x-places.is-live .p05x-stack__item {
    grid-area: 1 / 1;
  }

  .p05x-places.is-live .p05x-lang {
    display: inline-grid;
  }

  .p05x-places.is-live .p05x-lang__v {
    grid-area: 1 / 1;
  }

  .p05x-places.is-live :is(.p05x-stack__item, .p05x-lang__v)[data-off] {
    visibility: hidden;
  }

  /* the doors: without the script each door has its preview under it; with
     it the previews share one cell under the row */
  .p05x-doors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .p05x-doors--n2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p05x-doors--n1 {
    grid-template-columns: minmax(0, 1fr);
  }

  .p05x-doors__door {
    display: grid;
    gap: var(--space-1);
    align-content: start;
  }

  .p05x-doors__face {
    display: grid;
    gap: var(--space-1);
    justify-items: center;
    align-content: start;
    padding: var(--space-2) 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-align: center;
  }

  .p05x-doors__btn {
    width: 100%;
    margin: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }

  .p05x-doors__btn[aria-pressed="true"] {
    background: var(--color-white);
    border-color: var(--color-ink);
  }

  .p05x-doors__btn:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .p05x-doors__art {
    width: 4.5rem;
    height: auto;
  }

  .p05x-doors__shape {
    stroke: var(--color-ink);
    stroke-width: 1.5;
  }

  .p05x-doors__art--mint .p05x-doors__shape {
    fill: var(--color-brand);
  }

  .p05x-doors__art--butter .p05x-doors__shape {
    fill: var(--color-butter);
  }

  .p05x-doors__art--peach .p05x-doors__shape {
    fill: var(--color-accent-2);
  }

  .p05x-doors__inner {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
  }

  .p05x-doors__knob {
    fill: var(--color-ink);
  }

  .p05x-doors__label {
    font-size: var(--step--1);
    font-weight: 500;
    line-height: 1.3;
  }

  .p05x-doors__preview {
    margin: 0;
    font-size: var(--step--1);
    line-height: 1.45;
  }

  .p05x-doors__url {
    display: block;
    margin-block-end: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
  }

  .p05x-places.is-live .p05x-doors__door {
    display: contents;
  }

  .p05x-places.is-live .p05x-doors__btn {
    grid-row: 1;
  }

  .p05x-places.is-live .p05x-doors__preview {
    grid-row: 2;
    grid-column: 1 / -1;
    padding: var(--space-2) var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p05x-places.is-live .p05x-doors__preview[data-off] {
    visibility: hidden;
  }

  @media (min-width: 40rem) {
    .p05x-places__demo {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
  }

  @media (min-width: 64rem) {
    .p05x-places__grid {
      grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
      gap: var(--space-6);
    }
  }

  /* Print: no tabs, no switch; every panel and both views read one after
     the other, as without the script; nothing mirrored */
  @media print {
    .p05x-rec__tabs,
    .p05x-avail__settings,
    .p05x-page__langs {
      display: none;
    }

    .p05x-rec.is-live .p05x-rec__panels,
    .p05x-rec.is-live .p05x-avail__views {
      display: block;
    }

    .p05x-rec.is-live .p05x-rec__panel[data-off],
    .p05x-rec.is-live .p05x-avail__view[data-off] {
      visibility: visible;
    }

    .p05x-rec.is-live .p05x-rec__panel {
      break-inside: avoid;
    }

    .p05x-rec.is-live .p05x-rec__panel + .p05x-rec__panel {
      margin-block-start: var(--space-4);
      padding-block-start: var(--space-4);
      border-block-start: var(--border);
    }

    .p05x-rec.is-live .p05x-rec__step,
    .p05x-rec.is-live .p05x-avail__label {
      display: block;
    }

    .p05x-rec.is-live .p05x-avail__view + .p05x-avail__view {
      border-block-start: var(--border);
    }

    .p05x-rec__mock .p05x-site {
      box-shadow: none;
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* the step bar fills under the selected tab while the tabs play */
    .p05x-rec.is-auto .p05x-rec__tab[aria-selected="true"]::after {
      animation: p05x-step var(--p05x-step, 5000ms) linear both;
    }

    .p05x-rec__tab {
      transition: background-color 400ms var(--ease-out), color 400ms var(--ease-out);
    }

    .p05x-rec.is-live .p05x-rec__panel {
      transition: opacity 500ms var(--ease-out), visibility 0s;
    }

    .p05x-rec.is-live .p05x-rec__panel[data-off] {
      opacity: 0;
      transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
    }

    .p05x-switch__knob {
      transition: translate 320ms var(--ease-out);
    }

    .p05x-switch__track {
      transition: background-color 320ms var(--ease-out);
    }

    .p05x-map__state {
      transition: fill 400ms var(--ease-out);
    }

    .p05x-places__pin,
    .p05x-doors__face {
      transition: background-color 300ms var(--ease-out), border-color 300ms var(--ease-out), color 300ms var(--ease-out);
    }
  }

  @keyframes p05x-step {
    from {
      transform: scaleX(0);
    }

    to {
      transform: scaleX(1);
    }
  }
}
