/* Public mobile layouts. Keep this after page and deferred preview styles:
   typography, spacing and stacking must not depend on which page is open. */
@media (max-width: 820px) {
  :root {
    --rz-gutter: clamp(20px, 4vw, 32px);
    --rz-mobile-title: clamp(32px, 9.2vw, 44px);
    --rz-mobile-heading: clamp(28px, 7.7vw, 36px);
    --rz-mobile-section: clamp(36px, 6vw, 48px);
  }

  body .rz-container,
  #main .rz-container {
    width: min(calc(100% - 2 * var(--rz-gutter)), var(--container));
  }
  #main :is(.rz-hero__grid, .rz-feature-hero__grid, .rz-solution-hero__grid,
    .rz-story--split, .rz-story--split.is-image-right, .rz-split,
    .rz-split.is-image-right, .rz-streamers-hero__grid, .rz-streamers-dmca__grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  #main :is(.rz-story__copy, .rz-split__copy, .rz-streamers-dmca__copy) { order: 0; }
  #main :is(.rz-story__visual, .rz-split__visual, .rz-streamers-dashboard) { order: 1; }
  #main :is(.rz-hero__copy, .rz-feature-hero__visual, .rz-solution-hero__visual,
    .rz-streamers-hero__copy, .rz-streamers-hero__media) { min-width: 0; }

  /* Balance the actual section edges, including custom page templates.
     The Help Center shell contains its own sections and needs no outer inset.
     Keep soft preview shadows outside these sections; their inner canvases clip UI. */
  #main > :is(section:not(.rz-help), header),
  #main > :is(.rz-comparison-page, .rz-streamers-page, .rz-product-support,
    .rz-onboarding, .rz-help, .rz-blog-article, .rz-guide-article, .bc-page)
    > :is(section, header, .rz-guide-layout, .rz-blog-content-wrap),
  #main .rz-support-articles > section {
    padding-block: var(--rz-mobile-section);
    margin-block: 0;
    overflow: visible;
  }
  #main .rz-product-nav-section--compact { padding-block: var(--rz-mobile-section) !important; }

  /* Default paragraph margins must not add a hidden gap to one section edge. */
  #main :is(section, header) > .rz-container:first-child > :first-child,
  #main .rz-support-articles > section > :first-child,
  #main :is(.rz-heading, .rz-product-family__heading,
    .rz-code-laptop-intro, .rz-story__copy, .rz-split__copy, .rz-engage-copy,
    .rz-streamers__copy, .rz-streamers-dmca__copy, .rz-streamers-stations__head,
    .rz-comparison-heading, .rz-help-heading, .rz-start-section-heading) > :first-child {
    margin-block-start: 0;
  }
  #main :is(section, header) > .rz-container:last-child > :last-child,
  #main .rz-support-articles > section > :last-child,
  #main :is(.rz-heading, .rz-product-family__heading,
    .rz-code-laptop-intro, .rz-story__copy, .rz-split__copy, .rz-engage-copy,
    .rz-streamers__copy, .rz-streamers-dmca__copy, .rz-streamers-stations__head,
    .rz-comparison-heading, .rz-help-heading, .rz-start-section-heading) > :last-child {
    margin-block-end: 0;
  }
  #main .rz-support-articles > section > :is(ol, ul):last-child > li:last-child {
    margin-block-end: 0;
  }
  #main :is(.rz-hero, .rz-page-hero, .rz-comparison-hero, .rz-streamers-hero) {
    min-height: 0;
  }
  #main .rz-streamers-hero__grid { min-height: 0; }

  #main h1 {
    max-width: 100%;
    font-size: var(--rz-mobile-title);
    line-height: 1.15;
    letter-spacing: -.045em;
    font-weight: 600;
    text-wrap: pretty;
    overflow-wrap: normal;
    hyphens: manual;
  }
  #main :is(.rz-hero__copy, .rz-streamers-hero__copy) { text-align: center; }
  #main :is(.rz-hero__copy, .rz-streamers-hero__copy) h1 { margin: 0 auto 20px; text-align: center; }
  #main :is(.rz-hero__copy, .rz-streamers-hero__copy) > p:not(.rz-kicker):not(.rz-streamers-eyebrow) {
    max-width: 600px;
    margin: 0 auto 24px;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0;
    text-align: center;
    text-wrap: pretty;
  }
  #main :is(.rz-hero__copy > .rz-kicker, .rz-streamers-eyebrow) {
    margin: 0 0 16px;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
  }
  #main .rz-hero__copy > p:last-child:not(.rz-kicker) { margin-bottom: 0; }
  #main :is(.rz-hero__actions, .rz-solution-hero__actions, .rz-streamers-actions) {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 24px;
  }
  #main .rz-hero--home .rz-home-title-line { display: inline; }
  html[data-theme=dark] #main .rz-hero--home .rz-home-title-line { background-image: linear-gradient(100deg, #c48cff, #ff81bc 58%, #ffad8b); }
  #main .rz-hero--home .rz-home-title-line + .rz-home-title-line::before { content: ' '; }
  #main .rz-hero__visual { padding: 0; }
  #main .rz-hero__visual img { width: min(100%, 520px); margin-inline: auto; }
  #main .rz-hero--home .rz-hero__visual img { width: min(100%, 300px); }
  #main .rz-hero--home .rz-hero__visual { display: none; }
  #main :is(.rz-feature-hero__visual, .rz-solution-hero__visual, .rz-streamers-hero__media) {
    width: min(100%, 520px);
    max-width: none;
    justify-self: center;
  }
  #main :is(.rz-feature-hero__visual, .rz-solution-hero__visual) img { aspect-ratio: 4 / 3; border-radius: 16px; }
  #main .rz-streamers-hero__media video { aspect-ratio: 4 / 3; }

  #main :is(.rz-heading, .rz-product-family__heading, .rz-product-nav__heading,
    .rz-comparison-heading, .rz-pricing-features__heading, .rz-pricing-faq__heading) { margin-bottom: 28px; }
  #main :is(.rz-story__copy, .rz-split__copy, .rz-heading, .rz-product-family__heading,
    .rz-product-nav__heading, .rz-code-laptop-intro, .rz-engage-copy, .rz-cta,
    .rz-streamers__copy, .rz-streamers-dmca__copy, .rz-streamers-stations__head,
    .rz-streamers-final__panel, .rz-comparison-heading, .rz-comparison-context,
    .rz-comparison-final__panel, .rz-pricing-features__heading, .rz-pricing-faq__heading,
    .rz-help-heading, .rz-help-contact) h2,
  #main .rz-feature-title-section h2 {
    font-size: var(--rz-mobile-heading);
    line-height: 1.2;
    letter-spacing: -.04em;
    font-weight: 600;
    text-wrap: pretty;
    overflow-wrap: normal;
  }
  #main :is(.rz-story__copy, .rz-split__copy, .rz-code-laptop-intro, .rz-engage-tools,
    .rz-heading, .rz-product-family__heading, .rz-cta, .rz-page-hero) p {
    font-size: 16px;
    line-height: 1.7;
  }
  #main :is(.rz-story__copy, .rz-split__copy) h2 { margin-bottom: 20px; }
  #main :is(.rz-story__copy, .rz-split__copy) > p:last-child { margin-bottom: 0; }
  #main .rz-story__copy :is(p, li) { font-size: 16px; line-height: 1.7; }
  #main .rz-story__actions { margin-top: 24px; }
  #main :is(.rz-story__copy, .rz-code-laptop-intro, .rz-heading, .rz-product-family__heading) > .rz-kicker { font-size: 11px; }
  #main .rz-code-laptop-intro { margin-bottom: 28px; }
  #main .rz-code-laptop-intro h2 { margin-top: 0; }
  #main .rz-logos .rz-kicker { padding-inline: 12px; font-size: 10px; line-height: 1.6; }
  #main :is(.rz-cta, .rz-comparison-final__panel, .rz-streamers-final__panel) {
    min-height: 0;
    padding: 36px 24px;
    border-radius: 20px;
  }
  #main :is(.rz-cta, .rz-comparison-final__panel, .rz-streamers-final__panel) h2 { max-width: 100%; margin-bottom: 20px; }

  /* Keep all six product destinations readable in balanced mobile rows. */
  #main .rz-product-nav-section--compact .rz-product-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border-radius: 16px;
  }
  #main .rz-product-nav-section--compact .rz-product-nav__card {
    min-height: 0;
    padding: 20px 16px;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  #main .rz-product-nav-section--compact .rz-product-nav__card:nth-child(2n) { border-right: 0; }
  #main .rz-product-nav-section--compact .rz-product-nav__card:nth-last-child(-n+2) { border-bottom: 0; }
  #main .rz-product-nav__card :is(h2,h3) { font-size: 18px; line-height: 1.35; }
  #main .rz-product-nav__card > span { width: 40px; height: 40px; margin-bottom: 12px; }
  #main .rz-product-nav__card .rz-phosphor { width: 38px; height: 38px; }
  #main .rz-feature-section--audiences .rz-feature { padding: 22px 16px; }
  #main .rz-feature-section--audiences .rz-feature h3 { font-size: 18px; line-height: 1.35; }

  /* The product's mobile UI uses a simple app frame, rather than a tall laptop. */
  #main .rz-code-laptop { padding: 0; }
  #main .rz-code-laptop__lid { padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
  #main .rz-code-laptop__viewport { border: 0; border-radius: 15px; }
  #main :is(.rz-code-laptop__camera, .rz-code-laptop__base) { display: none; }
  #main .rp-motion-transport { padding: 0; }
  #main .rp-motion-transport .rp-motion-caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-height: 2.7em; white-space: normal; font-size: 11px; line-height: 1.35; }
  /* Floating playback controls keep a circular 44px mobile touch target. */
  #main :is(.rp-motion-transport > button, .sp-showcase [data-sp-tour]) {
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: none;
    padding: 0;
    aspect-ratio: 1;
    border-radius: 50%;
  }

  #main :is(.rz-button, .rz-comparison-button, .rz-streamers-button) {
    min-height: 50px;
    padding: 13px 24px;
    font-size: 15px;
    line-height: 1.4;
  }
  #main :is(.rz-streamers-pricing-link, .rz-start-text-link) { display: inline-flex; min-height: 44px; align-items: center; }
  #main .rz-pricing__controls { margin-block: 28px; gap: 12px; }
  #main .rz-pricing__assurance { gap: 8px 20px; }
  #main .rz-plan { padding: 28px 24px; border-radius: 20px; }
  #main .rz-plan__icon { width: 56px; height: 56px; margin-bottom: 16px; }
  #main .rz-plan__art { width: 52px; height: 52px; }
  #main .rz-streamers-pricing__plan h2 { font-size: 30px; line-height: 1.2; }

  #main .rz-blog-tools { gap: 20px; margin-bottom: 28px; }
  #main .rz-blog-categories { gap: 8px; }
  #main .rz-blog-categories a { padding: 8px 14px; }
  #main .rz-post-card > a { aspect-ratio: 16 / 10; }
  #main .rz-blog-paper { padding: 24px 20px; }
  #main .rz-blog-prose { font-size: 16px; }
  #main .rz-blog-prose h2 { font-size: 28px; line-height: 1.25; }
  #main .rz-blog-prose h3 { font-size: 22px; line-height: 1.3; }
  #main :is(.rz-help-breadcrumb, .rz-start-breadcrumb, .rz-streamers-pricing nav) { flex-wrap: wrap; margin-bottom: 24px; }
  #main .rz-guide-nav a { min-height: 44px; padding-block: 10px; }
  #main .rz-contact-card { padding: 28px 20px; gap: 28px; border-radius: 20px; }
  #main .rz-contact-card h2 { font-size: 28px; line-height: 1.2; }
  #main :is(.rz-contact-form input, .rz-contact-form select, .rz-contact-form textarea) { min-width: 0; font-size: 16px; }

  /* The external review wall otherwise injects fixed 350px cards on phones. */
  #main .rz-review-wall :is(._fbl_wop_grid, ._fbl_wop_griditem) { max-width: 100%; }
  #main .rz-review-wall ._fbl_wop_griditem { width: 100% !important; box-sizing: border-box; }
}

@media (max-width: 520px) {
  :root { --header-height: 64px; --rz-mobile-title: clamp(32px, 9.2vw, 40px); --rz-mobile-heading: clamp(28px, 7.7vw, 34px); }
  .rz-header .rz-header__inner { gap: 8px; }
  .rz-header .rz-brand img { width: 144px; max-width: 100%; }
  .rz-header .rz-header__actions { gap: 6px; }
  .rz-header .rz-header__cta { display: none; }
  .rz-header .rz-nav__links .rz-nav__primary { font-size: 20px; font-weight: 600; }
  .rz-header .rz-submenu__links { grid-template-columns: minmax(0, 1fr); }
  .rz-header .rz-nav__footer { margin-top: 24px; }
  .rz-header .rz-product-menu-card__copy .rz-product-menu-card__logo { max-width: 220px; }
  #main .rz-hero--home .rz-hero__visual img { width: min(100%, 280px); }
  #main .rz-product-card__identity { height: 140px; padding: 28px 24px; --logo-height: 44px; }
  #main .rz-product-card__copy { padding: 24px; }
  #main .rz-product-card :is(h2, h3) { font-size: 25px; line-height: 1.25; }
  #main .rz-product-card__actions { align-items: center; gap: 12px; }
  #main .rz-product-card__actions > .rz-button { width: 100%; }
  #main .rz-streamers-actions { flex-direction: column; gap: 8px; }
  #main .rz-streamers-actions .rz-streamers-button { width: auto; }
  #main .rz-feature-section--audiences .rz-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #main .rz-feature-section--audiences .rz-feature h3 { font-size: 17px; }
  #main .rz-pricing__assurance { flex-direction: column; align-items: center; }
  #main .rz-pricing-feature { padding: 24px; }
  #main .rz-start-actions { gap: 12px 20px; }
  .rz-footer .rz-footer__grid { gap: 28px 20px; }
  .rz-footer .rz-footer__brand { grid-column: 1 / -1; }
  .rz-footer li a { font-size: 13px; }
  .rz-footer .rz-footer__bottom { font-size: 12px; line-height: 1.7; }
}

/* Compose the automatic laptop tour as focused mobile cards, like the listener
   designer. Taking control restores every workspace control and its camera. */
@container rz-preview (max-width: 719px) {
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-screen { padding: 10px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-panel { padding: 10px; margin-bottom: 8px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-heading { min-height: 24px; margin-bottom: 6px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-heading > div > b { font-size: 17px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-stats { gap: 8px; margin: 8px 0 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-stats > div { padding: 6px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-stats small { font-size: 11px; min-height: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-stats strong { margin-top: 4px; font-size: 23px; }

  .rz-code-laptop .rz-zeus-preview.is-auto-tour :is(.rp-station-head, .rp-dashboard-context,
    .rp-upcoming-heading, .rp-dashboard-song, .rp-listener-summary > small,
    .rp-library-notice, .rp-library-tabs, .rp-file-toolbar, .rp-folder-path,
    .rp-table-footer, .rp-podcast-list > .rp-filters, .rp-podcast-list > .rp-form,
    .rp-schedule-filters) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-listener-summary .rp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-listener-summary .rp-stats > div { padding: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-listener-summary .rp-stats small { font-size: 10px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-listener-summary .rp-stats strong { font-size: 19px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-now-playing > .rp-heading .rp-control { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-now-playing > .rp-track.rp-current-song { padding: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-now-playing > .rp-track.rp-current-song > .rp-art { width: 64px; height: 64px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-current-song .rp-current-playlist { margin-top: 4px; font-size: 11px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-mini-player { margin: 8px 0 0; padding: 4px; }

  /* Keep the audio itself in view instead of spending the slide on filters. */
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library .rp-media-table { table-layout: auto; width: 100%; min-width: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library .rp-media-table colgroup,
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library .rp-media-table :is(th, td):not(:nth-child(2)):not(:nth-child(5)),
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library tbody tr:nth-child(n+4) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library .rp-media-table :is(th, td) { padding: 8px 4px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library .rp-file-name b { font-size: 13px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-library .rp-file-name small { font-size: 11px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-podcast-cards article { padding: 12px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-podcast-cards article p { margin-block: 8px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-podcast-list > .rp-heading :is(.rp-control, small) { display: none; }

  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-programming-content { padding: 10px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-playlist-page > :is(.rp-playlist-heading, .rp-playlist-tabs) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-calendar-toolbar { margin: 8px 0!important; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-playlist-schedule .rp-calendar { margin: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-calendar-body { height: 140px!important; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-calendar-body aside { line-height: 28px!important; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-calendar-grid { background-size: 100% 28px, 14.2857% 100%!important; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-event { height: 44px; padding: 5px; }

  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-page > :is(.rp-report-toolbar, .rp-report-note, .rp-report-most-played, .rp-control),
  .rz-code-laptop .rz-zeus-preview.is-auto-tour :is(.rp-report-details, .rp-report-note) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-page > .rp-heading .rp-control { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-page > .rp-heading small { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-summary .rp-stats { margin: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-summary .rp-stats > div:nth-child(n+3) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-summary .rp-report-chart { height: 100px; margin-block: 12px 20px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-report-summary > .rp-control { display: none; }

  /* Match the listener section's uncluttered player preview. */
  .rz-code-laptop .rz-zeus-preview.is-auto-tour :is(.rp-appearance-navigation, .rp-appearance-editor,
    .rp-design-views, .rp-appearance-toolbar, .rp-appearance-preview > .rp-form-tabs,
    .rp-embed, .rp-open-preview, [data-preview-notice]) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-design { grid-template-columns: minmax(0, 1fr); }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-widget-stage { min-height: 0; padding: 12px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-widget-stage .rp-player { padding: 14px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-player > .rp-track { margin: 10px 0; min-height: 48px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-player-controls { padding: 8px 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-player > footer { display: none; }

  /* A single working deck stays readable; the full mixer returns on interaction. */
  .rz-code-laptop .rz-zeus-preview.is-auto-tour.is-live-view .rp-camera-content,
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-live-shell { width: 100%; min-width: 0; height: auto; min-height: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour :is(.rp-console-workspace, .rp-live-grid) { display: block; width: 100%; min-height: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour :is(.rp-live-tabs, .rp-studio-mobile-tabs, .rp-studio-sources,
    .rp-mixer, .rp-deck[data-preview-deck=b], .rp-play-queue-heading, .rp-deck-tracks, .rp-deck > small) { display: none; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-live-grid > .rp-deck { min-height: 0; height: auto; padding: 14px; margin: 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-deck-now { min-height: 0; margin: 8px 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-deck-wave { height: 48px; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-deck-clock { margin: 6px 0; }
  .rz-code-laptop .rz-zeus-preview.is-auto-tour .rp-deck-controls { margin: 8px 0; }
}
