/* Phone layouts keep each illustration in its own space and the copy readable. */
@media (max-width:759px) {
  #payments,#day,#rules,#questions {scroll-margin-top:88px;}
  #payments .m-text-3,#day .m-text-3,#rules .m-text-3,#questions .m-text-3 {
    font-size:clamp(2.1rem,8.6vw,3rem);
    line-height:1.1;
    letter-spacing:-.045em;
    overflow-wrap:normal;
  }
  /* The desktop split-line negative margins crop phone-size ascenders. Keep
     the entrance, but give every measured line its actual line-height. */
  :is(#payments,#day,#rules,#questions) [data-8b-split="lines"] > .line {
    overflow:visible;
    padding-block:0;
    margin-block:0;
  }
  [data-8b-live] :is(#payments,#day,#rules,#questions) [data-8b-motion~="rise"] .line__in {
    animation-name:on-mobile-lower-heading;
    animation-duration:.55s;
    animation-delay:calc(.06s * var(--i));
    animation-timing-function:cubic-bezier(.2,.7,.2,1);
  }
  @keyframes on-mobile-lower-heading {
    from {opacity:0;translate:0 14px;}
    to {opacity:1;translate:0 0;}
  }

  /* Put the useful visual directly after the headline, before the details. */
  #payments {padding-block:4rem 3.5rem;}
  #payments .on-payments__grid {grid-template-columns:minmax(0,1fr);gap:0;}
  #payments .on-payments__copy {display:contents;}
  #payments .on-payments__copy > .m-text-4 {order:0;margin:0 0 .9rem;font-size:.8125rem;}
  #payments .on-payments__copy > h2 {order:1;margin:0;max-width:18ch;}
  #payments .on-invoice-art {
    order:2;
    width:100%;
    min-width:0;
    margin:1.75rem 0 1.5rem;
    padding:1.25rem;
    transform:none;
    rotate:0deg;
    border-radius:12px;
    background:linear-gradient(145deg,#e8ecff,#dfe5ff);
  }
  [data-8b-live] #payments .on-invoice-art[data-8b-motion~="hang"] {
    animation-name:on-mobile-invoice-settle;
    animation-duration:.85s;
    transform-origin:50% 70%;
  }
  @keyframes on-mobile-invoice-settle {
    from {rotate:-2deg;translate:0 10px;}
    to {rotate:0deg;translate:0 0;}
  }
  #payments .on-invoice {padding:1.25rem;border-radius:3px;box-shadow:0 12px 24px #20252214;}
  #payments .on-invoice-top {gap:.75rem;font-size:.75rem;}
  #payments .on-invoice-top > span {font-size:.625rem;}
  #payments .on-invoice > p {font-size:clamp(1.25rem,5.7vw,1.7rem);line-height:1.12;margin:1.5rem 0;}
  #payments .on-invoice-lines {gap:.7rem;}
  #payments .on-invoice-lines > span,#payments .on-invoice-total {gap:.75rem;font-size:.75rem;}
  #payments .on-invoice-total {margin-top:1rem;padding-top:1rem;}
  #payments .on-invoice-total b {font-size:1.65rem;}
  #payments .on-invoice-button {padding:.65rem;margin-top:1.1rem;font-size:.8125rem;}
  #payments .on-invoice small {font-size:.625rem;line-height:1.4;margin-top:.75rem;}
  #payments .on-invoice-art > p {font-size:.6875rem;line-height:1.4;margin:1rem auto 0;max-width:27ch;}
  #payments .on-payments__copy > .m-text {order:3;font-size:1rem;line-height:1.6;}
  #payments .on-checks {order:4;gap:.85rem;margin:1.4rem 0 1.5rem;}
  #payments .on-checks li {font-size:.9375rem;line-height:1.5;gap:.65rem;}
  #payments .on-payments__copy > .m-link {order:5;justify-self:start;font-size:1rem;}
  #payments .on-payment-note {order:6;font-size:.75rem;line-height:1.5;margin-top:.8rem;max-width:40ch;}

  /* The dial keeps its colour/drift choreography, inside a bounded art area.
     It never pins over the process copy on a phone. */
  #day {padding-block:3.5rem 3rem;}
  #day .day__grid {grid-template-columns:minmax(0,1fr);gap:0;}
  #day .day__main {display:contents;}
  #day .day__head {order:0;grid-row:1;gap:1.1rem;margin:0;min-width:0;}
  #day .day__head h2 {max-width:18ch;}
  #day .day__head p {font-size:1rem;line-height:1.6;}
  #day .day__head p br {display:none;}
  #day .day__dial {
    order:1;
    grid-row:2;
    position:relative;
    inset:auto;
    z-index:0;
    width:100%;
    height:clamp(240px,74vw,360px);
    margin:1.5rem 0 2rem;
    padding:1.1rem;
    overflow:hidden;
    isolation:isolate;
    contain:paint;
    background:transparent;
  }
  /* An explicit square width avoids the SVG's intrinsic 300px width winning
     over percentage height in a grid. The surrounding gutter contains drift. */
  #day .day__well {
    width:min(80%,16.25rem);
    height:auto;
    aspect-ratio:1;
    max-width:100%;
    justify-self:center;
    align-self:center;
    overflow:visible;
  }
  #day .day__well .m-well__band {
    animation:none;
    --well-rim:var(--mobile-day-rim,var(--color-8));
    --well-core:var(--mobile-day-core,var(--color-9));
  }
  #day .day__well .m-well__band > path {animation:none;translate:none;}
  #day .day__list {order:2;grid-row:3;min-width:0;}
  #day .day__row,#day[data-dialing] .day__row:not([data-now]) {
    opacity:1;
    grid-template-columns:2.5rem minmax(0,1fr);
    gap:1rem;
    padding-block:1.5rem;
  }
  #day .on-process-icon svg {width:2rem;height:2rem;}
  #day .day__body {gap:.65rem;min-width:0;}
  #day .day__body h3 {font-size:clamp(1.3rem,5.5vw,1.6rem);line-height:1.15;}
  #day .day__body p {font-size:.9375rem;line-height:1.65;}

  /* Each closed band covers the whole canvas. Labels appear only after the
     three bands surrounding them have opened, including during reverse scroll. */
  #rules {padding-block:3.5rem 3rem;}
  #rules .rules__head {
    grid-template-columns:minmax(0,1fr);
    width:100%;
    min-width:0;
    gap:1.1rem;
    margin-bottom:2rem;
    padding-inline:.5rem;
    max-width:34rem;
  }
  #rules .rules__head h2 {
    width:min(100%,19ch);
    min-width:0;
    max-width:100%;
    font-size:clamp(1.9rem,8vw,2.65rem);
    line-height:1.12;
    text-wrap:balance;
  }
  /* Split-line wrappers must inherit the bounded phone column rather than
     retain a min-content track or visually hang outside the centered copy. */
  #rules .rules__head h2 > .line,
  #rules .rules__head h2 .line__in {min-width:0;max-width:100%;white-space:normal;}
  #rules .rules__head p {width:min(100%,30ch);min-width:0;font-size:1rem;line-height:1.6;max-width:100%;}
  #rules .rules__stage {isolation:isolate;overflow:hidden;}
  #rules .rules__strata {z-index:2;}
  #rules .rules__row {min-height:0;}
  #rules .rules__half {
    width:var(--mobile-band-width,12%);
    flex:none;
    animation:none;
    translate:none;
    transform:none;
    will-change:width;
  }
  #rules .rules__list {z-index:1;}
  #rules .rules__rule {
    grid-template-columns:minmax(0,1fr);
    min-height:clamp(180px,48vw,230px);
    padding:1.5rem 0;
    opacity:var(--mobile-label-opacity,1);
    transform:translateY(calc((1 - var(--mobile-label-opacity,1)) * 8px));
  }
  #rules .rules__rule:nth-child(n) .m-text-6 {
    max-width:66%;
    font-size:clamp(1.35rem,6.2vw,1.85rem);
    line-height:1.15;
    text-wrap:balance;
  }

  #questions {padding-block:3.5rem;}
  #questions .on-faq-grid {grid-template-columns:minmax(0,1fr);gap:2rem;}
  #questions .on-faq-head {gap:1.1rem;}
  #questions .on-faq-head > .m-text {font-size:1rem;line-height:1.6;}
  #questions .on-faq-head > .m-link {font-size:.9375rem;}
  #questions .on-faq-list summary {gap:1rem;padding-block:1.3rem;font-size:1rem;line-height:1.45;}
  #questions .on-faq-list details > div {padding:0 1.5rem 1.3rem 0;font-size:.9375rem;line-height:1.65;}

  #footer {padding-block:2.5rem 1.75rem;}
  #footer .footer__top {display:grid;grid-template-columns:minmax(0,1fr);gap:1.75rem;}
  #footer .footer__top > p {font-size:1.5rem;line-height:1.15;}
  #footer .footer__links {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem 1rem;align-items:start;}
  #footer .footer__links a {justify-self:start;font-size:.875rem;line-height:1.4;}
  #footer .footer__word {font-size:calc((100vw - 2.5rem) / 7.9);line-height:1.1;margin-top:2.5rem;}
  #footer .footer__fine {display:grid;grid-template-columns:minmax(0,1fr);gap:.9rem;margin-top:1.5rem;font-size:.75rem;line-height:1.5;}
  #footer .footer__fine > a {justify-self:start;margin-top:.3rem;}
}

@media (max-width:759px) and (prefers-reduced-motion:reduce) {
  :is(#payments,#day,#rules,#questions) .line__in,#payments .on-invoice-art {animation:none;translate:none;rotate:0deg;opacity:1;}
  #rules .rules__half {will-change:auto;}
}
