/*
 * Industry pages: the shared components (docs/design/components.md,
 * "Industry pages"): the live card, In short and the author line, the proof
 * strip, the scroll mockup, the comparison table, and the before and after
 * slider (the sticky call button's rules are in site.css: it renders
 * outside <main>, on home too), and every demo's hint, progress bar and
 * inert sample controls (demo-*, sample-control). Linked only on pages whose markup uses
 * these classes (peanut_scoped_css()). Tokens only.
 */

@layer blocks {
  /* ---------- Live card: over the photo's lower-left corner (.hero__overlay
     sets its place and hard shadow). The static card is the finished one;
     livecard.js adds .is-live and steps through the parts. Stacked scenes
     share one grid cell, so the card never changes height. ---------- */

  @media (min-width: 60rem) {
    .hero--has-overlay .hero__overlay.lcard {
      left: calc(-1 * var(--space-3));
      width: min(21rem, 62%);
    }

    /* a placeholder's note stays clear of the card */
    .hero--has-overlay:has(.lcard) .photo-slot__note {
      max-width: 34%;
    }
  }

  /* phones and tablets: the card overlaps the placeholder's foot, with its
     Sample label above it, so the note sits higher and wider (fewer lines) */
  @media (max-width: 59.99rem) {
    .hero--has-overlay:has(.lcard) .hero__slot.photo-slot--empty {
      padding: var(--space-3);
    }
  }

  .lcard {
    position: relative;
    padding: var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--step--1);
    line-height: 1.4;
  }

  /* the whole card is a picture of a site: its drawn buttons and chips are
     sample controls (S3), never a pointer or a text selection */
  .lcard {
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
  }

  .lcard__stack {
    display: grid;
  }

  .lcard__scene {
    grid-area: 1 / 1;
    align-self: start;
  }

  .lcard:not(.is-live) .lcard__early {
    visibility: hidden;
  }

  .lcard.is-live [data-at] {
    transition: opacity 340ms var(--ease-out), translate 340ms var(--ease-out), visibility 340ms;
  }

  .lcard.is-live [data-at]:not(.is-on) {
    visibility: hidden;
    opacity: 0;
    translate: 0 6px;
  }

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

  .lcard__title {
    margin: 0 0 var(--space-2);
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .lcard__choices {
    display: grid;
    gap: var(--space-1);
  }

  .lcard__choice {
    padding: 0.625rem var(--space-2);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
    text-align: center;
    transition: background-color 200ms var(--ease-out);
  }

  .lcard__choice.is-tapped {
    background: var(--color-brand);
  }

  /* a line under each choice saying what is behind it (nanny-two-paths with
     lines 8 and 9): rounded boxes in place of pills */
  .lcard__choices--lines .lcard__choice {
    display: grid;
    gap: 0.125rem;
    padding: 0.5rem var(--space-2);
    border-radius: var(--radius-sm);
    text-align: start;
  }

  /* the two scenes come out close in height; the shorter one sits in the
     middle, so neither leaves a blank strip at the bottom */
  .lcard:has(.lcard__choices--lines) .lcard__scene {
    align-self: center;
  }

  .lcard__under {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
  }

  .lcard__rows {
    display: grid;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .lcard__row {
    padding: 0.4375rem var(--space-2);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .lcard__row--on {
    background: var(--color-brand);
  }

  .lcard__row--next {
    border-style: dashed;
  }

  .lcard__cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 1.125rem;
    height: 1.125rem;
    margin: -0.25rem 0 0 -0.25rem;
    background: var(--color-ink);
    border: 2px solid var(--color-white);
    border-radius: 50%;
    opacity: 0;
    transition: transform 600ms var(--ease-out), opacity 200ms var(--ease-out);
    pointer-events: none;
  }

  .lcard__cursor.is-on {
    opacity: 0.85;
  }

  /* "Sample" (owner, 2026-11-23): a small label just above the card's
     top-left corner, printed for every card by blocks/hero.php. Outside the
     card box, so it covers none of the card and the card never changes
     height; over the photo's lower part on every width, so it stays clear of
     the photo's "Unsplash+ preview" mark (top right). Its own paper and ink,
     so it reads on the light cards, the dark one and any photo. Absolute,
     so nothing moves; never hidden (no data-at), so it shows in every
     state, without JavaScript, under reduced motion and in print. */
  .lcard__sample {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: -1px;
    z-index: 1;
    padding: 0.125rem 0.5rem;
    background: var(--color-paper);
    color: var(--color-ink);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    white-space: nowrap;
  }

  /* ---------- In short and the author line ---------- */

  .block-inshort {
    padding-block: var(--space-5);
  }

  .inshort {
    max-width: 48rem;
    margin-inline: auto;
  }

  .inshort__box {
    padding: var(--space-3) var(--space-4);
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .section--paper .inshort__box {
    background: var(--color-white);
  }

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

  .inshort__text {
    margin: 0;
  }

  /* 40px tall with or without the headshot, so adding it moves nothing */
  .inshort__by {
    min-height: 2.5rem;
    margin: var(--space-2) 0 0;
    font-size: var(--step--1);
  }

  /* the routing line above the box (the Custom websites hub): who belongs on another page */
  .inshort__route {
    margin: 0 0 var(--space-2);
  }

  /* the <picture> around a face (snippets/face.php) is not a box of its own */
  .face {
    display: contents;
  }

  .inshort__face {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    margin-inline-end: 0.5rem;
    vertical-align: middle;
    border: 2px solid var(--color-paper);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--color-ink);
  }

  /* ---------- Proof strip ---------- */

  .block-proofstrip {
    padding-block: var(--space-4);
  }

  .proofstrip {
    display: grid;
    gap: var(--space-2) var(--space-4);
    margin: 0;
    padding: var(--space-3) 0;
    list-style: none;
    border-block: var(--border);
  }

  .proofstrip__item {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    font-weight: 500;
  }

  .proofstrip__icon {
    flex: none;
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  @media (min-width: 48rem) {
    .proofstrip--n3 {
      grid-template-columns: repeat(3, 1fr);
    }

    .proofstrip--n4 {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 64rem) {
    .proofstrip--n4 {
      grid-template-columns: repeat(4, auto);
      justify-content: space-between;
    }
  }

  /* ---------- Scroll mockup ---------- */

  .scrollmock__head {
    max-width: 44rem;
    margin-block-end: var(--space-5);
  }

  .scrollmock__title {
    margin: 0;
  }

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

  .scrollmock__grid {
    display: grid;
    gap: var(--space-5);
  }

  .scrollmock__stage {
    display: none;
  }

  .scrollmock__items {
    display: grid;
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .scrollmock__crop {
    margin-block-end: var(--space-3);
  }

  .scrollmock__name {
    margin: 0 0 var(--space-1);
  }

  .scrollmock__text {
    margin: 0;
  }

  @media (min-width: 60rem) {
    .scrollmock__grid {
      grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
      column-gap: var(--space-7);
      align-items: start;
    }

    .scrollmock__stage {
      display: block;
      position: sticky;
      top: calc(var(--header-height) + var(--space-4));
    }

    .scrollmock__crop {
      display: none;
    }

    .scrollmock__items {
      gap: 0;
    }

    .scrollmock__item {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-height: 50vh;
      padding-block: var(--space-4);
      opacity: 0.5;
      transition: opacity 280ms var(--ease-out);
    }

    .scrollmock__item.is-current,
    .scrollmock__items:not(:has(.is-current)) .scrollmock__item {
      opacity: 1;
    }
  }

  /* ---------- Mockups (site/snippets/mockups/): a simplified site in the
     tier diagrams' line style. A lit part turns mint; the others stay quiet
     while one is lit. ---------- */

  .mock {
    overflow: hidden;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    line-height: 1.35;
  }

  .mock__body {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-3);
  }

  .mock--crop {
    padding: var(--space-2);
  }

  .mock__part {
    border-radius: 0.5rem;
    transition: background-color 280ms var(--ease-out), opacity 280ms var(--ease-out), transform 420ms var(--ease-out), box-shadow 280ms var(--ease-out);
  }

  .is-tracking .mock__part:not(.is-lit) {
    opacity: 0.45;
  }

  .mock__part.is-lit {
    position: relative;
    z-index: 1;
    background: var(--color-brand);
    box-shadow: 0 0 0 0.375rem var(--color-brand);
    transform: scale(1.03);
  }

  @media (prefers-reduced-motion: reduce) {
    .mock__part.is-lit {
      transform: none;
    }
  }

  .mock__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);
    border-radius: 0;
  }

  .mock--crop .mock__bar {
    border-radius: 0.5rem;
    border-block-end: 0;
  }

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

  .mock__url {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    min-width: 0;
    padding: 0.125rem 0.625rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
  }

  .mock__old {
    text-decoration: line-through;
    opacity: 0.6;
  }

  .mock__arrow {
    width: 0.875rem;
    height: 1px;
    background: var(--color-ink);
  }

  .mock__nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.25rem;
  }

  .mock__logo {
    font-family: var(--font-heading);
    font-size: var(--step-0);
    font-weight: var(--weight-heading);
  }

  .mock__menu {
    display: flex;
    gap: var(--space-2);
    font-weight: 500;
  }

  .mock__has-list {
    position: relative;
  }

  .mock__list {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 2;
    display: grid;
    width: 9rem;
    padding: 0.25rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms var(--ease-out), visibility 240ms;
  }

  .mock__list span {
    padding: 0.25rem 0.375rem;
  }

  .is-lit .mock__list {
    visibility: visible;
    opacity: 1;
  }

  .mock--crop .mock__nav {
    padding-block-end: 5.25rem;
  }

  .mock--crop .mock__list {
    visibility: visible;
    opacity: 1;
  }

  .mock__hero {
    display: grid;
    gap: 0.5rem;
    padding: var(--space-3) var(--space-2);
    background: var(--color-paper);
  }

  .mock__line {
    display: block;
    width: 50%;
    height: 0.375rem;
    background: var(--color-ink);
    border-radius: var(--radius-pill);
    opacity: 0.25;
  }

  .mock__line--wide {
    width: 78%;
    height: 0.625rem;
    opacity: 0.8;
  }

  .mock__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-start: 0.25rem;
  }

  .mock__btn {
    padding: 0.375rem 0.625rem;
    border: var(--border);
    border-radius: 0.25rem;
    font-weight: 500;
  }

  .mock__btn--fill {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .mock__badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.375rem;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    text-align: center;
  }

  .mock__badges li {
    padding: 0.375rem 0.125rem;
    border: var(--border);
    border-radius: 0.5rem;
    background: var(--color-white);
  }

  .mock__card {
    display: grid;
    gap: 0.375rem;
    padding: 0.625rem;
    border: var(--border);
  }

  .mock__tags,
  .mock__rows {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .mock__tags span {
    padding: 0.125rem 0.5rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
  }

  .mock__rows span:not(:last-child)::after {
    content: " ·";
  }

  .mock__press {
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
  }

  .mock__logos {
    display: flex;
    gap: 0.5rem;
  }

  .mock__logos i {
    width: 2.25rem;
    height: 0.5rem;
    background: var(--color-ink);
    border-radius: 0.125rem;
    opacity: 0.3;
  }

  .mock__summary {
    text-decoration: underline;
  }

  /* ---------- Comparison table: a stacked list per row on phones ---------- */

  .compare__head {
    max-width: 44rem;
    margin-block-end: var(--space-4);
  }

  .compare__title {
    margin: 0;
  }

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

  .compare__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .compare__col {
    padding: var(--space-2) var(--space-3);
    font-weight: 600;
    text-align: left;
  }

  .compare__col--pick {
    background: var(--color-brand);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .compare__label {
    padding: var(--space-2) var(--space-3) var(--space-2) 0;
    font-weight: 500;
    text-align: left;
    vertical-align: top;
    border-block-start: var(--border);
  }

  .compare__cell {
    padding: var(--space-2) var(--space-3);
    vertical-align: top;
    border-block-start: var(--border);
  }

  .compare__cell--pick {
    background: var(--color-brand);
  }

  .compare__row:last-child .compare__cell--pick {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }

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

  @media (max-width: 47.99rem) {
    .compare__thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }

    .compare__table,
    .compare__table tbody,
    .compare__row,
    .compare__label,
    .compare__cell {
      display: block;
    }

    .compare__row {
      padding-block: var(--space-3);
      border-block-start: var(--border);
    }

    .compare__label {
      padding: 0 0 var(--space-1);
      font-weight: 600;
      border: 0;
    }

    .compare__cell {
      padding: 0.625rem var(--space-2);
      border: 0;
      border-radius: var(--radius-sm);
    }

    .compare__cell + .compare__cell {
      margin-block-start: 0.25rem;
    }

    .compare__cell::before {
      content: attr(data-label);
      display: block;
      font-size: 0.6875rem;
      font-weight: 600;
      letter-spacing: var(--tracking-caps);
      text-transform: uppercase;
    }

    .compare__row:last-child .compare__cell--pick {
      border-radius: var(--radius-sm);
    }
  }

  /* ---------- Before and after: --split is set by beforeafter.js ---------- */

  .beforeafter__head {
    max-width: 44rem;
    margin-block-end: var(--space-4);
  }

  .beforeafter__title {
    margin: 0;
  }

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

  .beforeafter__grid {
    display: grid;
    gap: var(--space-4);
    align-items: center;
  }

  .beforeafter__frame {
    --split: 50%;
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .beforeafter__side {
    position: absolute;
    inset: 0;
  }

  .beforeafter__side--before {
    display: grid;
    place-items: center;
    padding: var(--space-3);
    background: var(--color-paper);
    clip-path: inset(0 calc(100% - var(--split)) 0 0);
  }

  .beforeafter__image,
  .beforeafter__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
  }

  .beforeafter__side--before:has(.beforeafter__image) {
    padding: 0;
  }

  .beforeafter__missing {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    display: grid;
    gap: 0.25rem;
    max-width: 38%;
    margin: 0;
    font-size: var(--step--1);
    line-height: 1.35;
  }

  .beforeafter__label {
    position: absolute;
    bottom: var(--space-2);
    padding: 0.25rem 0.75rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    pointer-events: none;
  }

  .beforeafter__label--before {
    left: var(--space-2);
  }

  .beforeafter__label--after {
    right: var(--space-2);
  }

  .beforeafter__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--split);
    width: 2px;
    margin-inline-start: -1px;
    background: var(--color-ink);
    pointer-events: none;
  }

  .beforeafter__handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.75rem;
    height: 2.75rem;
    margin: -1.375rem 0 0 -1.375rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: 50%;
  }

  .beforeafter__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: ew-resize;
    opacity: 0;
  }

  .beforeafter__frame:has(.beforeafter__range:focus-visible) {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
  }

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

  .beforeafter__figures {
    display: grid;
    gap: var(--space-3);
    margin: 0;
  }

  .beforeafter__figure dt {
    font-family: var(--font-heading);
    font-size: var(--step-4);
    font-weight: var(--weight-heading);
    line-height: 1.1;
  }

  .beforeafter__figure dd {
    margin: var(--space-1) 0 0;
  }

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

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

  /* ---------- Showcase: a section's copy beside one visual ---------- */

  .showcase {
    display: grid;
    gap: var(--space-4) var(--space-6);
  }

  .showcase__head {
    max-width: 40rem;
  }

  .showcase__title {
    margin: 0;
  }

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

  .showcase__items {
    display: grid;
    gap: var(--space-3);
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
  }

  .showcase__name {
    margin: 0 0 var(--space-1);
  }

  .showcase__text,
  .showcase__outro {
    margin: 0;
  }

  /* an In practice fact: a small boxed note (as on the other industry pages) */
  .showcase__outro--note {
    max-width: 44rem;
    padding: var(--space-3) var(--space-4);
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .section--paper .showcase__outro--note {
    background: var(--color-white);
  }

  .showcase__toggle {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  .showcase__toggle[hidden] {
    display: none;
  }

  .showcase__switch {
    min-height: 2.75rem;
    padding: 0.5rem var(--space-2);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font-size: var(--step--1);
    font-weight: 500;
    cursor: pointer;
  }

  .showcase__switch[aria-pressed="true"] {
    background: var(--color-brand);
  }

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

  .showcase__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-2) 0 0;
    padding: 0;
    list-style: none;
  }

  @media (min-width: 60rem) {
    .showcase--right,
    .showcase--left {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      align-items: center;
    }

    .showcase--left .showcase__copy {
      order: 2;
    }

    .showcase__foot {
      grid-column: 1 / -1;
    }

    .showcase--left .showcase__foot {
      order: 3;
    }
  }

  /* ---------- Compact items ---------- */

  .minis__head {
    max-width: 40rem;
    margin-block-end: var(--space-4);
  }

  .minis__title {
    margin: 0;
  }

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

  .minis__list {
    display: grid;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .minis__drawing {
    max-width: 14rem;
    margin-block-end: var(--space-2);
  }

  .minis__name {
    margin: 0 0 var(--space-1);
  }

  .minis__text,
  .minis__outro {
    margin: 0;
  }

  .minis__outro {
    margin-block-start: var(--space-4);
  }

  /* Framed drawings (the block's "Frame the drawings" option; the med spa
     page, 2026-11-19, the same fix as the childcare page): each drawing
     centred in a framed panel of the same size, larger, with room on every
     side, so nothing touches the edges and the columns line up */
  .minis--framed .minis__list {
    align-items: start;
  }

  .minis--framed .minis__drawing {
    display: grid;
    place-items: center;
    max-width: none;
    aspect-ratio: 3 / 2;
    margin-block-end: var(--space-3);
    padding: var(--space-4);
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .section--paper .minis--framed .minis__drawing {
    background: var(--color-white);
  }

  .minis--framed .minis__drawing > svg {
    width: 100%;
    max-width: 18rem;
    height: auto;
  }

  @media (min-width: 48rem) {
    .minis--n2 .minis__list,
    .minis--n4 .minis__list {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .minis--n3 .minis__list {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (min-width: 64rem) {
    .minis--n4 .minis__list {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  /* ---------- Demo hint (snippets/demo/hint.php; owner, 2026-11-23, S1):
     the shared tap mark, then "Tap a step" on touch screens or "Click a
     step" with a mouse. Sentence case, at least 0.875rem, weight 600. The
     text wraps beside the mark, never under it. Colors follow the text, so
     the hint reads on light and dark sections alike ---------- */
  .demo-hint {
    position: relative;
    margin: 0;
    padding-inline-start: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
  }

  .demo-hint[hidden] {
    display: none;
  }

  /* the tap mark: a 1rem ring with a dot, level with the first line */
  .demo-hint__mark {
    position: absolute;
    inset-block-start: 0.15625rem;
    inset-inline-start: 0;
    width: 1rem;
    height: 1rem;
    border: 1px solid currentColor;
    border-radius: 50%;
  }

  .demo-hint__mark::after {
    content: "";
    position: absolute;
    inset: 0.25rem;
    background: currentColor;
    border-radius: 50%;
  }

  .demo-hint__click {
    display: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .demo-hint__tap {
      display: none;
    }

    .demo-hint__click {
      display: inline;
    }
  }

  /* ---------- Demo progress bar (snippets/demo/progress.php, filled by
     demo-play.js): one segment per state, the current one filling. It keeps
     its space, so nothing moves when it goes ---------- */
  .demo-progress {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 0.25rem;
    visibility: hidden;
  }

  .is-playing .demo-progress {
    visibility: visible;
  }

  /* The pinned copy (demo-play.js, topStart: the tall demos on phones): under the sticky header
     while the demo plays and is in view; fixed, so it moves nothing */
  .demo-progress--pin {
    display: none;
  }

  @media screen and (max-width: 47.99rem) {
    .is-playing.demo-in-view > .demo-progress--pin {
      display: grid;
      position: fixed;
      top: calc(var(--header-height) + var(--space-2));
      right: var(--gutter);
      left: var(--gutter);
      z-index: 45;
      padding: 0.5rem 0.75rem;
      border: var(--border);
      border-radius: var(--radius-pill);
      background: var(--color-white);
      color: var(--color-ink);
    }
  }

  .demo-progress__seg {
    display: block;
    height: 0.1875rem;
    overflow: hidden;
    background: var(--color-ink-track);
    border-radius: var(--radius-pill);
  }

  .demo-progress__fill {
    display: block;
    height: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
  }

  .demo-progress__fill:is(.is-full, .is-filling) {
    transform: scaleX(1);
  }

  /* ---------- Sample controls (S3): a button, chip, field, checkbox or
     switch drawn inside a sample screen that does nothing. Never a button,
     link or field: a span or p with no tabindex and no role, read as plain
     text; pure decoration is also aria-hidden. It keeps its look; only
     the pointer and text selection say it is a picture ---------- */
  .sample-control {
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
  }

  @media print {
    .demo-hint,
    .demo-progress {
      display: none;
    }
  }
}

/* ---------- Drawn sample buttons (owner, 2026-11-23): every button drawn
   inside a sample screen (a live card, a phone demo, a sample page, a mockup)
   carries .sample-btn and has one look that is clearly not the real call
   button (ink filled): an outline in the text's color (ink on light, white
   on the dark card) on no fill, its own size and shape kept (the outline is
   drawn inside the box, so nothing moves by a pixel). A state the demo shows
   ("tapped", "done", the checklist's button switching on, a finished route)
   fills it mint. In the utilities layer, so it overrides each page's own
   fill (blocks layer) with no important flag; real controls (chips, tabs, step
   buttons) never carry it. ---------- */
@layer utilities {
  .sample-btn {
    background: transparent;
    color: inherit;
    outline: 1px solid currentColor;
    outline-offset: -1px;
    box-shadow: none;
  }

  .sample-btn:is(.is-tapped, .is-done),
  .checklist-demo.is-done [data-part="cta"] .sample-btn,
  .p09y-router .sample-btn:not(.is-waiting) {
    background: var(--color-brand);
    color: var(--color-ink);
  }

  /* the same look in a small SVG drawing (minis): an ink line, no fill */
  .diagram .sample-btn-svg {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1;
  }

  .diagram .sample-btn-svg__text {
    fill: var(--color-ink);
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    .demo-progress__fill.is-filling {
      transition: transform var(--demo-step, 7000ms) linear;
    }

    html.js-motion .proofstrip[data-play] {
      transition: opacity 600ms var(--ease-out);
    }

    html.js-motion .proofstrip[data-play]:not(.is-in) {
      opacity: 0;
    }
  }
}
