/*
 * RelaySkills phone layout
 *
 * This file is intentionally scoped to small screens.  The desktop experience
 * keeps its existing layout and scroll choreography; phones get a calmer,
 * vertical reading flow that is easier to tap and much faster to render.
 */

@media (max-width: 840px) {
  :root {
    --mobile-gutter: 18px;
    --mobile-radius: 24px;
    --mobile-ink: #142039;
    --mobile-muted: #5d6b86;
    --mobile-blue: #3158ea;
    --mobile-purple: #7054e8;
    --mobile-paper: #f7f8fc;
    --mobile-line: #d8e0f2;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.home-scroll-journey,
  body:has(main[data-auth-page]) {
    background: var(--mobile-paper) !important;
    color: var(--mobile-ink);
  }

  /* A compact mobile header shared by the three redesigned pages. */
  .site-header {
    z-index: 1200;
    padding: 8px 0 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 10px 30px rgba(34, 49, 91, 0.1) !important;
    backdrop-filter: blur(18px);
  }

  .site-header .nav {
    width: calc(100% - 20px) !important;
    min-height: 58px !important;
    height: 58px !important;
    padding: 7px 8px 7px 10px !important;
    border: 1px solid #dbe2f2 !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(39, 56, 103, 0.08) !important;
  }

  .site-header .brand {
    min-width: 0;
    gap: 8px !important;
  }

  .site-header .brand-mark {
    width: 39px !important;
    height: 39px !important;
    border-radius: 12px !important;
  }

  .site-header .brand-wordmark {
    font-size: 0.98rem !important;
    letter-spacing: -0.04em;
  }

  .site-header .nav-actions {
    gap: 5px !important;
    margin-left: auto;
  }

  .site-header .auth-nav {
    gap: 5px !important;
  }

  .site-header .auth-nav .btn {
    min-height: 39px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 0.78rem !important;
  }

  .site-header .auth-nav .auth-register-stack,
  .site-header .auth-org-link {
    display: none !important;
  }

  .site-header .menu-btn {
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    border: 1px solid #dbe2f2 !important;
    background: #f6f8ff !important;
  }

  /* Keep the no-JavaScript fallback presentable while the shared header
   * component is loading (and useful if a script is blocked). */
  .static-site-header {
    position: relative !important;
    z-index: 1200 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: calc(100% - 20px) !important;
    min-height: 58px !important;
    margin: 8px 10px !important;
    padding: 7px 10px !important;
    border: 1px solid #dbe2f2 !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(39, 56, 103, 0.08) !important;
  }

  .static-site-header .brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--mobile-ink) !important;
    text-decoration: none !important;
  }

  .static-site-header .brand img {
    width: 39px !important;
    height: 39px !important;
    border-radius: 12px !important;
  }

  .static-site-header .brand-wordmark {
    font-size: 0.98rem !important;
    font-weight: 850 !important;
  }

  .static-site-header .static-nav-links {
    display: none !important;
  }

  .static-site-header::after {
    content: "☰";
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #dbe2f2;
    border-radius: 12px;
    background: #f6f8ff;
    color: var(--mobile-ink);
    font-size: 1.2rem;
    line-height: 1;
  }

  /* ------------------------------
   * Homepage: a short vertical route
   * ------------------------------ */

  body.home-scroll-journey .rs-home {
    width: 100%;
    overflow: hidden;
  }

  body.home-scroll-journey .rs-hero {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding: 42px var(--mobile-gutter) 28px !important;
    gap: 22px !important;
    background:
      radial-gradient(circle at 90% 9%, rgba(130, 98, 239, 0.16), transparent 24%),
      linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%) !important;
  }

  body.home-scroll-journey .rs-hero-copy {
    order: 1;
    width: 100%;
    max-width: none !important;
  }

  body.home-scroll-journey .rs-hero-copy .rs-kicker {
    display: inline-flex;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef0ff;
    color: var(--mobile-purple);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
  }

  body.home-scroll-journey .rs-hero-copy h1 {
    margin: 15px 0 14px !important;
    max-width: 100% !important;
    font-size: clamp(2.7rem, 13vw, 4rem) !important;
    line-height: 0.96 !important;
    letter-spacing: -0.075em !important;
  }

  body.home-scroll-journey .rs-hero-copy > p {
    max-width: 33rem;
    color: var(--mobile-muted) !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  body.home-scroll-journey .rs-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }

  body.home-scroll-journey .rs-actions .rs-button {
    width: 100% !important;
    min-height: 54px !important;
    justify-content: space-between !important;
    border-radius: 16px !important;
  }

  body.home-scroll-journey .rs-live-metrics {
    margin-top: 20px !important;
    padding: 16px !important;
    border-radius: 20px !important;
    border: 1px solid var(--mobile-line) !important;
    background: rgba(255, 255, 255, 0.82) !important;
    box-shadow: 0 12px 30px rgba(49, 70, 125, 0.08) !important;
  }

  body.home-scroll-journey .rs-live-heading {
    display: flex !important;
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 5px !important;
  }

  body.home-scroll-journey .rs-live-heading span:last-child {
    max-width: 100%;
    color: #71809c !important;
    font-size: 0.72rem !important;
    line-height: 1.35;
  }

  body.home-scroll-journey .rs-live-values {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin-top: 13px !important;
  }

  body.home-scroll-journey .rs-live-values > div {
    min-width: 0;
    padding: 12px 8px !important;
    border-radius: 14px !important;
    background: #f1f4fc !important;
  }

  body.home-scroll-journey .rs-live-values strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.45rem !important;
    line-height: 1 !important;
  }

  body.home-scroll-journey .rs-live-values span {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.67rem !important;
    line-height: 1.2 !important;
  }

  body.home-scroll-journey .rs-hero-art {
    order: 2;
    width: 100% !important;
    min-height: 0 !important;
  }

  body.home-scroll-journey .rs-toolkit {
    width: 100% !important;
    min-height: 0 !important;
    padding: 18px !important;
    border-radius: 24px !important;
    transform: none !important;
    background: #142039 !important;
    box-shadow: 0 18px 38px rgba(24, 34, 66, 0.22) !important;
  }

  body.home-scroll-journey .rs-toolkit::before {
    opacity: 0.4;
  }

  body.home-scroll-journey .rs-toolkit-top,
  body.home-scroll-journey .rs-toolkit-list,
  body.home-scroll-journey .rs-toolkit-bottom {
    position: relative;
    z-index: 1;
  }

  body.home-scroll-journey .rs-toolkit-top {
    margin-bottom: 18px !important;
  }

  body.home-scroll-journey .rs-toolkit-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  body.home-scroll-journey .rs-toolkit-item {
    min-height: 92px !important;
    padding: 12px !important;
    border-radius: 15px !important;
  }

  body.home-scroll-journey .rs-float-label,
  body.home-scroll-journey .rs-hero-orbit,
  body.home-scroll-journey .rs-scroll-cue,
  body.home-scroll-journey .rs-journey-rail,
  body.home-scroll-journey .rs-motion-toggle {
    display: none !important;
  }

  body.home-scroll-journey .rs-marquee {
    min-height: 42px !important;
    padding: 10px 0 !important;
    overflow: hidden !important;
    background: var(--mobile-blue) !important;
  }

  body.home-scroll-journey .rs-marquee-track {
    width: max-content !important;
    transform: none !important;
    animation: none !important;
  }

  body.home-scroll-journey .rs-marquee-copy {
    font-size: 0.66rem !important;
    letter-spacing: 0.12em !important;
  }

  body.home-scroll-journey .rs-exchange-guide {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
    gap: 24px !important;
    margin: 18px var(--mobile-gutter) 0 !important;
    padding: 26px 20px !important;
    border-radius: var(--mobile-radius) !important;
    background: #ffffff !important;
    box-shadow: 0 14px 34px rgba(44, 65, 113, 0.08) !important;
  }

  body.home-scroll-journey .rs-guide-copy h2,
  body.home-scroll-journey .rs-manifesto h2,
  body.home-scroll-journey .rs-section-heading h2,
  body.home-scroll-journey .rs-rituals-heading h2 {
    font-size: clamp(2rem, 9vw, 3rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.065em !important;
  }

  body.home-scroll-journey .rs-guide-steps {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
    gap: 9px !important;
  }

  body.home-scroll-journey .rs-guide-step {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-items: start !important;
    column-gap: 12px !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 13px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  body.home-scroll-journey .rs-guide-step > i {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: start;
    width: 40px !important;
    height: 40px !important;
    margin: 4px 0 0 !important;
  }

  body.home-scroll-journey .rs-guide-step > span {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0;
    line-height: 1.2;
  }

  body.home-scroll-journey .rs-guide-step h3 {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center;
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.2 !important;
  }

  body.home-scroll-journey .rs-guide-step p {
    /* The paragraph must span both tracks, not auto-place into the icon track. */
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    min-width: 0;
    width: 100% !important;
    max-width: none !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: manual;
    font-size: .95rem !important;
    line-height: 1.5 !important;
  }

  body.home-scroll-journey .rs-guide-step h3,
  body.home-scroll-journey .rs-guide-step p {
    margin: 0 !important;
  }

  body.home-scroll-journey .rs-guide-step p {
    margin-top: 10px !important;
  }

  body.home-scroll-journey .rs-manifesto {
    padding: 60px var(--mobile-gutter) 36px !important;
    text-align: left !important;
  }

  body.home-scroll-journey .rs-manifesto p {
    max-width: 34rem;
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  /* Mobile story cards use document flow, not the desktop pinning timeline. */
  body.home-scroll-journey .rs-next-move,
  body.home-scroll-journey .rs-film,
  body.home-scroll-journey .rs-tools {
    height: auto !important;
    min-height: 0 !important;
  }

  /* Keep the four story steps readable during a quick touch/trackpad swipe.
     The viewport settles on the next card instead of jumping over several
     steps, while proximity keeps ordinary page scrolling natural. */
  html:has(body.rs-linear-story),
  body.rs-linear-story {
    scroll-snap-type: y proximity;
    scroll-padding-top: calc(var(--mobile-header-space, 82px) + 16px);
  }

  body.rs-linear-story .rs-mobile-route-card,
  body.rs-linear-story .rs-mobile-scene-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: calc(var(--mobile-header-space, 82px) + 16px);
  }

  body.home-scroll-journey .rs-next-move-sticky,
  body.home-scroll-journey .rs-film-sticky,
  body.home-scroll-journey .rs-tools-pin,
  body.home-scroll-journey .rs-next-move.is-pinned .rs-next-move-sticky,
  body.home-scroll-journey .rs-film.is-pinned .rs-film-sticky {
    position: relative !important;
    top: 0 !important;
    inset: auto !important;
    min-height: 0 !important;
    height: auto !important;
    transform: none !important;
    backdrop-filter: none !important;
  }

  body.home-scroll-journey .rs-next-move-sticky {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 22px !important;
    padding: 56px var(--mobile-gutter) 40px !important;
  }

  body.home-scroll-journey .rs-next-move-copy {
    max-width: none !important;
  }

  body.home-scroll-journey .rs-next-move-copy h2 {
    max-width: 100% !important;
    font-size: clamp(2.1rem, 9vw, 3rem) !important;
  }

  body.home-scroll-journey .rs-next-move-stage {
    display: flex !important;
    flex-direction: column !important;
    gap: 13px !important;
    width: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
  }

  body.home-scroll-journey .rs-next-move-orbit,
  body.home-scroll-journey .rs-next-move-line,
  body.home-scroll-journey .rs-scroll-status,
  body.home-scroll-journey .rs-next-move .rs-scroll-prompt,
  body.home-scroll-journey .rs-film .rs-scroll-prompt {
    display: none !important;
  }

  body.home-scroll-journey .rs-next-move-card {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 21px !important;
    transform: none !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 34px rgba(36, 52, 101, 0.16) !important;
  }

  body.home-scroll-journey .rs-next-move-card-bottom {
    position: relative !important;
    inset: auto !important;
    margin-top: 22px !important;
  }

  body.home-scroll-journey .rs-next-move-steps {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    transform: none !important;
  }

  body.home-scroll-journey .rs-next-move-steps button {
    min-height: 46px !important;
    transform: none !important;
    border-radius: 13px !important;
  }

  body.home-scroll-journey .rs-film-sticky {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    padding: 54px var(--mobile-gutter) 42px !important;
  }

  body.home-scroll-journey .rs-film-heading {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  body.home-scroll-journey .rs-scene-visual,
  body.home-scroll-journey .rs-scene-copy {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    transform: none !important;
  }

  body.home-scroll-journey .rs-scene-visual {
    min-height: 0 !important;
    aspect-ratio: 1 / 0.86 !important;
    order: 2;
    border-radius: 22px !important;
  }

  body.home-scroll-journey .rs-scene-copy {
    order: 3;
    padding: 0 !important;
  }

  body.home-scroll-journey .rs-scene-copy h2 {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
    line-height: 1 !important;
  }

  body.home-scroll-journey .rs-scene-match {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  body.home-scroll-journey .rs-scene-match .rs-exchange-symbol {
    display: none !important;
  }

  body.home-scroll-journey .rs-scene-dots {
    order: 4;
    margin: 0 !important;
  }

  body.home-scroll-journey .rs-discover {
    padding: 58px var(--mobile-gutter) 42px !important;
  }

  body.home-scroll-journey .rs-skill-cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 24px !important;
  }

  body.home-scroll-journey .rs-skill-card {
    min-height: 0 !important;
    padding: 21px !important;
    border-radius: 20px !important;
  }

  body.home-scroll-journey .rs-tools-pin {
    display: block !important;
    padding: 56px var(--mobile-gutter) 42px !important;
  }

  body.home-scroll-journey .rs-tools-window {
    overflow: visible !important;
    margin-top: 24px !important;
  }

  body.home-scroll-journey .rs-tools-track {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: auto !important;
    padding: 0 !important;
    transform: none !important;
  }

  body.home-scroll-journey .rs-tool-card {
    width: auto !important;
    min-height: 0 !important;
    padding: 20px !important;
    border-radius: 20px !important;
  }

  body.home-scroll-journey .rs-tools-progress {
    display: none !important;
  }

  body.home-scroll-journey .rs-community {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 var(--mobile-gutter) !important;
    padding: 0 18px 28px !important;
    border-radius: 26px !important;
    overflow: hidden !important;
  }

  body.home-scroll-journey .rs-community-image {
    position: relative !important;
    inset: auto !important;
    width: calc(100% + 36px) !important;
    height: 245px !important;
    margin: 0 -18px !important;
    clip-path: none !important;
    border-radius: 0 !important;
  }

  body.home-scroll-journey .rs-community-copy {
    width: 100% !important;
    padding: 28px 0 0 !important;
  }

  body.home-scroll-journey .rs-community-copy h2 {
    font-size: clamp(2.1rem, 9vw, 3rem) !important;
  }

  body.home-scroll-journey .rs-community-copy .rs-button {
    width: 100% !important;
    min-height: 52px !important;
    justify-content: space-between !important;
  }

  body.home-scroll-journey .rs-rituals {
    padding: 60px var(--mobile-gutter) 38px !important;
  }

  body.home-scroll-journey .rs-rituals-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 24px !important;
  }

  body.home-scroll-journey .rs-ritual {
    min-height: 0 !important;
    padding: 19px !important;
    border-radius: 18px !important;
  }

  body.home-scroll-journey .rs-rituals-footer {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin-top: 24px !important;
  }

  body.home-scroll-journey .rs-finale {
    padding: 70px var(--mobile-gutter) 82px !important;
    text-align: left !important;
  }

  body.home-scroll-journey .rs-finale h2 {
    font-size: clamp(2.7rem, 13vw, 4rem) !important;
    line-height: 0.96 !important;
  }

  body.home-scroll-journey .rs-finale .rs-button {
    width: 100% !important;
    justify-content: space-between !important;
    margin-top: 22px !important;
  }

  /* ------------------------------
   * Login and signup: one-column forms
   * ------------------------------ */

  body:has(main[data-auth-page]) .account-main {
    overflow: hidden;
  }

  body:has(main.account-main[data-auth-page]) main.account-main .account-hero,
  body:has(main.account-main[data-auth-page]) main.account-main .quick-register-hero {
    padding: 40px var(--mobile-gutter) 28px !important;
    border-radius: 0 0 28px 28px !important;
    background:
      radial-gradient(circle at 100% 0%, rgba(132, 98, 239, 0.28), transparent 34%),
      linear-gradient(145deg, #17233d 0%, #253d80 58%, #5b4ed0 100%) !important;
    color: #ffffff !important;
  }

  body:has(main[data-auth-page]) .account-hero-grid,
  body:has(main[data-auth-page]) .quick-register-hero-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  body:has(main[data-auth-page]) .account-hero h1,
  body:has(main[data-auth-page]) .quick-register-hero h1 {
    margin: 12px 0 !important;
    max-width: 100% !important;
    color: #ffffff !important;
    font-size: clamp(2.35rem, 11vw, 3.6rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.075em !important;
  }

  body:has(main[data-auth-page]) .account-hero p,
  body:has(main[data-auth-page]) .quick-register-hero p {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.98rem !important;
    line-height: 1.52 !important;
  }

  body:has(main[data-auth-page]) .account-security-note,
  body:has(main[data-auth-page]) .quick-register-hero-card {
    padding: 15px !important;
    border: 1px solid rgba(255, 255, 255, 0.23) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
  }

  body:has(main.account-main[data-auth-page]) main.account-main .account-security-note :is(i, strong, span, p),
  body:has(main.account-main[data-auth-page]) main.account-main .quick-register-hero-card :is(i, strong, span, p) {
    color: rgba(255, 255, 255, 0.9) !important;
  }

  body:has(main[data-auth-page]) .quick-register-hero-card {
    display: none !important;
  }

  body:has(main[data-auth-page]) .account-section,
  body:has(main[data-auth-page]) .quick-register-section {
    padding: 20px 14px 56px !important;
    background: var(--mobile-paper) !important;
  }

  body:has(main[data-auth-page]) .auth-layout,
  body:has(main[data-auth-page]) .quick-register-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  body:has(main[data-auth-page]) .auth-card,
  body:has(main[data-auth-page]) .quick-register-card {
    width: 100% !important;
    padding: 20px !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: var(--mobile-radius) !important;
    background: #ffffff !important;
    box-shadow: 0 16px 34px rgba(43, 60, 111, 0.1) !important;
  }

  body:has(main[data-auth-page]) .auth-card-head,
  body:has(main[data-auth-page]) .quick-register-heading {
    align-items: flex-start !important;
    gap: 14px !important;
  }

  body:has(main[data-auth-page]) .auth-card-head h2,
  body:has(main[data-auth-page]) .quick-register-heading h2 {
    font-size: 1.7rem !important;
    line-height: 1 !important;
    letter-spacing: -0.05em !important;
  }

  body:has(main[data-auth-page]) .auth-card-head p,
  body:has(main[data-auth-page]) .quick-register-heading p {
    margin-top: 7px !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
  }

  body:has(main[data-auth-page]) .field,
  body:has(main[data-auth-page]) .quick-register-fields .field {
    min-width: 0;
  }

  body:has(main[data-auth-page]) .field label,
  body:has(main[data-auth-page]) .quick-register-fields label {
    font-size: 0.82rem !important;
  }

  body:has(main[data-auth-page]) .field input,
  body:has(main[data-auth-page]) .field select,
  body:has(main[data-auth-page]) .field textarea,
  body:has(main[data-auth-page]) .quick-register-fields input,
  body:has(main[data-auth-page]) .quick-register-fields select,
  body:has(main[data-auth-page]) .quick-register-fields textarea {
    min-height: 52px !important;
    border-radius: 15px !important;
    font-size: 1rem !important;
  }

  body:has(main[data-auth-page]) .form-actions,
  body:has(main[data-auth-page]) .quick-register-actions {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-top: 18px !important;
  }

  body:has(main[data-auth-page]) .form-actions .btn,
  body:has(main[data-auth-page]) .quick-register-actions .btn {
    width: 100% !important;
    min-height: 54px !important;
    justify-content: center !important;
    border-radius: 15px !important;
  }

  body:has(main.account-main[data-auth-page]) main.account-main .current-session-banner .btn {
    min-width: 92px !important;
    white-space: nowrap !important;
    font-size: 0.76rem !important;
  }

  body:has(main[data-auth-page]) .auth-benefits {
    order: 2;
    padding: 20px !important;
    border-radius: var(--mobile-radius) !important;
    background: #142039 !important;
    color: #ffffff !important;
  }

  body:has(main[data-auth-page]) .auth-benefits h2,
  body:has(main[data-auth-page]) .auth-benefits > p {
    color: #ffffff !important;
  }

  body:has(main[data-auth-page]) .benefit-list {
    display: grid !important;
    gap: 10px !important;
    margin-top: 16px !important;
  }

  body:has(main[data-auth-page]) .benefit-item {
    padding: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.07) !important;
  }

  body:has(main[data-auth-page]) .quick-register-proof {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin-top: 20px !important;
  }

  body:has(main[data-auth-page]) .quick-register-proof > * {
    min-width: 0;
    padding: 10px 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 13px !important;
    background: rgba(255, 255, 255, 0.09) !important;
    font-size: 0.7rem !important;
  }

  body:has(main.account-main[data-auth-page]) main.account-main .quick-register-proof :is(strong, span, small, b) {
    color: rgba(255, 255, 255, 0.88) !important;
  }

  body:has(main[data-auth-page]) .quick-register-form-block {
    padding: 18px 0 !important;
  }

  body:has(main[data-auth-page]) .quick-register-block-heading {
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  body:has(main[data-auth-page]) .quick-register-fields,
  body:has(main[data-auth-page]) .quick-register-safety-fields {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 13px !important;
  }

  body:has(main[data-auth-page]) .quick-register-age-result {
    min-height: 0 !important;
    padding: 14px !important;
    border-radius: 15px !important;
  }

  body:has(main[data-auth-page]) .quick-register-aside {
    display: none !important;
  }

  body:has(main[data-auth-page]) .quick-register-terms {
    align-items: flex-start !important;
    gap: 9px !important;
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
  }

  body:has(main[data-auth-page]) .quick-register-terms input {
    flex: 0 0 auto;
    margin-top: 3px;
  }
}

/* All four chapters keep their own space on phones. Desktop retains the
   existing pinned scene and these mobile-only copies stay out of its tree. */
.rs-mobile-route,
.rs-mobile-scenes,
.rs-mobile-story-nav {
  display: none;
}

@media (max-width: 840px) {
  body.rs-linear-story .rs-next-move-stage,
  body.rs-linear-story .rs-next-move-copy > .rs-next-move-note,
  body.rs-linear-story .rs-next-move-copy > .rs-next-move-link,
  body.rs-linear-story .rs-film-sticky > .rs-scene-visual,
  body.rs-linear-story .rs-film-sticky > .rs-scene-copy {
    display: none !important;
  }

  body.rs-linear-story .rs-mobile-route,
  body.rs-linear-story .rs-mobile-scenes {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    min-width: 0;
    width: 100%;
  }

  body.rs-linear-story .rs-mobile-route-card,
  body.rs-linear-story .rs-mobile-scene-card {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    scroll-margin-top: calc(var(--mobile-header-space, 82px) + 16px);
  }

  body.rs-linear-story .rs-mobile-route-card h3 {
    margin: 28px 0 14px !important;
    font-size: clamp(1.45rem, 5.5vw, 1.9rem) !important;
    line-height: 1.2 !important;
  }

  body.rs-linear-story .rs-mobile-route-card p {
    font-size: .95rem !important;
    line-height: 1.6 !important;
  }

  body.rs-linear-story .rs-mobile-route-card .rs-next-move-note {
    margin-top: 20px;
    backdrop-filter: none;
  }

  body.rs-linear-story .rs-mobile-story-nav {
    position: relative !important;
    inset: auto !important;
    order: 0;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    transform: none !important;
  }

  body.rs-linear-story .rs-mobile-story-nav button {
    min-width: 0;
    min-height: 48px;
    padding: 12px;
    border: 1px solid #d8dfed;
    border-radius: 14px;
    background: #ffffff;
    color: #172a46;
    font: inherit;
    font-size: .85rem;
    line-height: 1.4;
    cursor: pointer;
    transform: none !important;
  }

  body.rs-linear-story .rs-mobile-story-nav button[aria-current="step"] {
    background: #172a46 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }

  body.rs-linear-story .rs-mobile-story-nav button b {
    font-size: .78rem !important;
    width: 30px;
    height: 30px;
  }

  body.rs-linear-story .rs-mobile-story-nav button span {
    font-size: .9rem !important;
    line-height: 1.2;
  }

  body.rs-linear-story .rs-mobile-story-nav button small {
    font-size: .75rem !important;
    line-height: 1.3;
  }

  body.rs-linear-story .rs-mobile-story-nav button[aria-current="step"] b {
    background: #3159ed !important;
  }

  body.rs-linear-story .rs-mobile-story-nav button[aria-current="step"] small,
  body.rs-linear-story .rs-mobile-story-nav button[aria-current="step"] span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }

  body.rs-linear-story .rs-mobile-scenes {
    gap: 32px;
  }

  body.rs-linear-story .rs-mobile-scene-card {
    padding: 20px;
    border: 1px solid #d8dfed;
    border-radius: 24px;
    background: #ffffff;
    color: #172a46;
  }

  body.rs-linear-story .rs-mobile-scene-count {
    display: inline-block;
    margin-bottom: 20px;
    color: #304dca;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
  }

  body.rs-linear-story .rs-mobile-scene-visual {
    display: block !important;
    aspect-ratio: auto !important;
    max-width: 100%;
    margin: 0 0 28px !important;
    padding: 0 !important;
    overflow: visible;
  }

  body.rs-linear-story .rs-mobile-scene-visual .rs-scene {
    width: 100%;
    padding: 0;
    animation: none !important;
  }

  body.rs-linear-story .rs-mobile-scene-visual .rs-match-person,
  body.rs-linear-story .rs-mobile-scene-visual .rs-match-result {
    position: relative;
    inset: auto;
    width: 100%;
    box-sizing: border-box;
    transform: none !important;
  }

  body.rs-linear-story .rs-mobile-scene-copy .rs-step {
    margin-bottom: 16px;
  }

  body.rs-linear-story .rs-mobile-scene-copy h2 {
    font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
    line-height: 1.15 !important;
  }

  body.rs-linear-story .rs-mobile-scene-copy p {
    margin: 20px 0 !important;
    font-size: .95rem !important;
    line-height: 1.65 !important;
  }

  body.rs-linear-story .rs-mobile-scene-copy > div {
    animation: none !important;
  }
}

@media (max-width: 390px) {
  .site-header .brand-wordmark {
    display: none !important;
  }

  body.home-scroll-journey .rs-hero-copy h1 {
    font-size: 2.65rem !important;
  }

  body.home-scroll-journey .rs-live-values strong {
    font-size: 1.25rem !important;
  }

  body.home-scroll-journey .rs-live-values span {
    font-size: 0.61rem !important;
  }

  body:has(main[data-auth-page]) .quick-register-proof > * {
    font-size: 0.64rem !important;
  }
}
