/* Loaded only by the public Patient page. All reading controls use their existing states. */
@property --zt-stage-rise {
  syntax:"<length>";
  inherits:false;
  initial-value:0px;
}
@layer patient-reading {
  @media (760px < width < 900px) {
    #top .hero-photo {
      background-position-x: calc(85% + clamp(0px, 450px - 50vw, 54px)) !important;
    }
  }
  /* Keep the mobile photo inside its own frame, below the opening copy. */
  #top .hero-photo:has(> .patient-scroll-landscape) {overflow:clip}
  #top .patient-scroll-landscape {
    position:absolute;inset:0;display:block;pointer-events:none;
    background:inherit;transform-origin:70% 78%;
  }
  #lower-back .lumbar-photo {transform-origin:50% 65%}
  @media (600px <= width <= 740px) {
    #lower-back .lumbar-photo {
      width:min(100%,62vw,430px)!important;height:auto!important;max-width:100%!important;
      margin-inline:0 auto!important;justify-self:start!important;transform-origin:left 65%!important;
    }
  }
  @media (650px < width <= 740px) {
    #lower-back .lumbar-layout {
      grid-template-columns:minmax(0,610px)!important;
      justify-content:center!important;
    }
  }
  #visit-guide .visit-writing {transform-origin:right bottom}
  #meet figure.meet-stage {margin:0}
  #meet #meet-rotation-caption {
    font-size:14px!important;line-height:1.45!important;text-wrap:balance;
  }

  /* Keep the exit reachable while the reader works down the long guide. */
  @media screen {
    #prepare-appointment {scroll-padding-block-start:64px}
    #prepare-appointment .visit-return-row {
      position:sticky;inset-block-start:0;z-index:2;
      background:var(--appointment-surface,#eef3f6);
      padding-block:4px!important;
    }
  }

  #contact .underlined {min-height:44px!important;align-content:center}
  #contact :is(input,textarea,select):focus-visible {
    outline:2px solid #067e93!important;outline-offset:2px;
  }
  .zt-footer a:focus-visible {outline:2px solid #b9e1ed;outline-offset:3px}

  #patient-faq .knowledge-toggle-icon {
    position:relative;display:block!important;flex:0 0 22px!important;width:22px;height:22px;
    margin:0!important;border-radius:50%;color:#216578;background:#edf4f5;font-size:0!important;
  }
  #patient-faq .knowledge-toggle-icon::before,
  #patient-faq .knowledge-toggle-icon::after {
    content:"";position:absolute;inset:0;margin:auto;width:10px;height:2px;
    background:currentColor;pointer-events:none;
  }
  #patient-faq .knowledge-toggle-icon::after {width:2px;height:10px}
  #patient-faq [aria-expanded="true"] .knowledge-toggle-icon::after {transform:scaleY(0)}
  #patient-faq .knowledge-toggle {align-items:center!important}
  #patient-faq .knowledge-add[aria-pressed="false"] .knowledge-add-icon {
    position:relative;flex:none;font-size:0!important;
  }
  #patient-faq .knowledge-add[aria-pressed="false"] .knowledge-add-icon::before,
  #patient-faq .knowledge-add[aria-pressed="false"] .knowledge-add-icon::after {
    content:"";position:absolute;inset:0;margin:auto;box-sizing:border-box;
    width:9px;height:0;border-top:1px solid currentColor;pointer-events:none;
  }
  #patient-faq .knowledge-add[aria-pressed="false"] .knowledge-add-icon::after {
    width:0;height:9px;border:0;border-left:1px solid currentColor;
  }
  #patient-faq .knowledge-disclosure {display:flow-root;overflow:clip}
  @media (width < 900px) {
    /* Use the existing space beneath the guide link for its one-line status. */
    #patient-faq .knowledge-companion {margin-block-end:0!important}
    #patient-faq .knowledge-saved-summary[hidden] {display:block!important;visibility:hidden}
  }
  @media (prefers-reduced-motion:reduce) {
    #fusion-approaches .z4-plus::before,#fusion-approaches .z4-plus::after {transition:none!important}
  }
  #patient-faq .knowledge-add[aria-pressed="true"] .knowledge-add-icon {background:#135b65!important;color:white!important}
  #fusion-approaches .z4-visual-stage[data-dragging] .z4-handle {
    outline:2px solid #9cdae6!important;outline-offset:3px!important;
  }
  #fusion-approaches .z4-reset {min-height:44px!important}
  #fusion-approaches .z4-view-help {min-height:44px!important}

  @media (hover:hover) and (pointer:fine) {
    #lower-back .lumbar-citation:hover,.zt-footer a:hover {
      text-decoration:underline!important;text-underline-offset:.22em;
    }
    #stories .series-entry:hover .film-action svg {
      outline:2px solid #fff;outline-offset:3px;
    }
  }
  #stories .series-entry:focus-visible .film-action svg {
    outline:2px solid #fff;outline-offset:3px;
  }

  @media (prefers-reduced-motion:no-preference) {
    /* The legacy treatment module resets every standard card property with !important. */
    #care-options .z4-step {translate:0 var(--zt-stage-rise,0px)!important}
    #top .light-pill b,#lower-back .lumbar-open > [aria-hidden],#stories .film-action svg {
      transition:translate 160ms var(--zt-editorial-ease),scale 160ms var(--zt-editorial-ease);
    }
    @media (hover:hover) and (pointer:fine) {
      #top .light-pill:hover b {translate:0 3px}
      #lower-back .lumbar-open:hover > [aria-hidden] {translate:3px 0}
      #stories .series-entry:hover .film-action svg {scale:1.045}
    }
    #stories .series-entry:active .film-action svg {scale:.96}
    #patient-faq .knowledge-toggle-icon::after {
      transition:transform 160ms var(--zt-editorial-ease);
    }

    /* The selected illustration resolves inside its stationary stage. */
    #difference .feature-panel:not([hidden]) .studio-visual {
      opacity:1!important;
      transition:opacity 220ms var(--zt-editorial-ease)!important;
      @starting-style {opacity:.34!important}
    }
    #difference:has([role="tab"]:focus-visible) .feature-panel .studio-visual {transition:none!important}
    #patient-faq .knowledge-add[aria-pressed="true"]:not(:focus-visible) .knowledge-add-icon {
      animation:patient-save-check 200ms var(--zt-editorial-ease);
    }
    @keyframes patient-save-check {
      from {transform:scale(.68);opacity:.6}
      to {transform:scale(1);opacity:1}
    }

    @supports (animation-timeline:view()) {
      /* Clip the artwork without creating a scroll container around the care stages. */
      #zenfuze-patient-education {overflow:clip!important}
      /* Only the small existing connectors move. The care stages stay readable. */
      #care-options .z4-step-arrow svg {
        animation:patient-stage-connector 1s linear both;
        animation-timeline:view(block);animation-range:entry 0% cover 23%;
      }
      #care-options .z4-step-arrow:nth-of-type(2) svg {animation-range:entry 0% cover 32%}
      @keyframes patient-stage-connector {
        from {transform:translateX(-7px);opacity:.38} to {transform:translateX(0);opacity:1}
      }
    }
  }
}
