/* Product-page layout. Picture windows are relative to the displayed figure. */
:root {
  --section-space: clamp(28px, 3vw, 44px);
  --capture-width: 320px;
  --row-gap: clamp(16px, 2vw, 28px);
}
body > header { padding-block: 12px; }
body > main { padding-block: 16px 24px; }
body > footer { gap: 8px 16px; padding-block: 20px; }
main > .section, body[data-page="help"] main > .section, main > .reassurance {
  margin-block-start: var(--section-space);
}
main .hero { min-height: 0; padding-block: clamp(20px, 3vw, 36px); }
main .section h2 { margin-block: 0 16px; }
main .section-content { gap: 14px; }
main :is(.share-result-flow,.sharing-examples,.watch-gallery,.hero-visual):empty { display: none; }
main .device-figure.approved-test-figure {
  container-type: inline-size;
  contain-intrinsic-inline-size: var(--capture-width);
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  width: min(100%, var(--capture-width));
  min-width: 0;
  max-width: 100%;
  height: auto;
  margin: 0;
}
main figure img { display: block; width: 100%; height: auto; object-fit: contain; }
main img[data-image-slot^="watch-"] { clip-path: circle(50%); }
/* On Help, a pending request must not reserve a full native phone screen. */
body[data-page="help"] main img[data-image-slot] { aspect-ratio: auto; }
/* Each portrait window uses the figure's displayed width. The limit does not
   reserve space while a request is pending or change the scale of the pixels. */
main .section img[data-tile-portrait] {
  max-block-size: var(--picture-window, 155cqi);
  object-fit: cover;
  object-position: center var(--picture-anchor, top);
}
/* S045 ends after Keep doing. Leave a small inset after the actual last card. */
main img[data-image-slot="improve-free"] { --picture-window: 96cqi; }
main img[data-image-slot="improve-free"]:is([data-image-language="en-GB"],[data-image-language="en-US"],[data-image-language="sv"]) { --picture-window: 89cqi; }
main img[data-image-slot="improve-free"]:is([data-image-language="nl"],[data-image-language="id"]) { --picture-window: 101cqi; }
main img[data-image-slot="improve-free"][data-image-language="ar"] { --picture-window: 121cqi; }
/* Keep the result, drill controls and focus explanation in their own frames. */
main img[data-image-slot="test-result-free"] { --picture-window: 162cqi; }
main img[data-image-slot="test-result-pro"] { --picture-window: 188cqi; }
main img:is([data-image-slot="drill-done-free"],[data-image-slot="drill-done-pro"]) { --picture-window: 207cqi; }
main img[data-image-slot="drill-diagram"] { --picture-window: 193cqi; }
main img[data-image-slot="improve-pro"] { --picture-window: 172cqi; }
/* Short screens and dialogs are framed around the controls they illustrate. */
main img[data-image-slot="tour-settings-look"] { --picture-window: 108cqi; }
main img[data-image-slot="tour-settings-look"]:is([data-image-language="en-GB"],[data-image-language="en-US"],[data-image-language="nl"],[data-image-language="id"],[data-image-language="pt-BR"]) { --picture-window: 80cqi; }
main img[data-image-slot="tour-settings-look"][data-image-language="ar"] { --picture-window: 96cqi; }
main img[data-image-slot="stats-in-depth-pro"] { --picture-window: 113cqi; }
main img[data-image-slot="stats-in-depth-pro"]:is([data-image-language="en-GB"],[data-image-language="en-US"]) { --picture-window: 154cqi; }
main img[data-image-slot="stats-in-depth-pro"][data-image-language="de"] { --picture-window: 136cqi; }
main img[data-image-slot="stats-in-depth-pro"][data-image-language="ar"] { --picture-window: 176cqi; }
main img[data-image-slot="rivals-free"] { --picture-window: 136cqi; }
main img[data-image-slot="rivals-free"][data-image-language="ar"] { --picture-window: 184cqi; }
/* On S024 the match record and Performance Score chart are below the filters. */
main img[data-image-slot="tour-stats-sample"] { --picture-window: 120cqi; --picture-anchor: 80%; }
main img[data-image-slot="tour-stats-sample"][data-image-language="ar"] { --picture-window: 128cqi; --picture-anchor: bottom; }
main img[data-image-slot="tour-dates-custom"] { --picture-window: 86cqi; }
main img:is([data-image-slot="tour-setup-look"],[data-image-slot="tour-setup-recording"],[data-image-slot="tour-setup-type"],[data-image-slot="tour-setup-ends"],[data-image-slot="tour-dates-open"]) { --picture-anchor: center; }
main img[data-image-slot="tour-shot-selection"] { --picture-window: 90cqi; --picture-anchor: center; }
main img:is([data-image-slot="tour-settings-female"],[data-image-slot="tour-settings-male"]) { --picture-anchor: bottom; }
main .analysis-flow { align-items: start; }
main .tour-topics { align-items: start; }
main .section-inner:has(> .section-content):not(:has(figure)),
main .section-inner:not(:has(figure)) > .section-content > :is(p,ul),
main .plan-group:not(:has(figure)) > :is(p,table) {
  inline-size: 100%;
  max-inline-size: none;
}
main figure figcaption { position: static; margin: 6px 0 0; padding: 0; min-height: 0; line-height: 1.4; font-size: max(13px,.9rem); }
main .section .image-pair, body.page-how main .section .image-pair,
body[data-page="help"] main .section .image-pair {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: start;
  width: 100%; max-width: none; margin: 0; gap: var(--row-gap); direction: inherit;
}
main .section .image-pair > figure.device-figure { flex: none; width: min(100%,var(--capture-width)); margin: 0; }
main .home-screen-frame .device-figure { width: var(--capture-width); max-width: 100%; }
main .home-screen-frame {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--row-gap);
}
main .home-screen-frame .device-figure:has(img[data-image-slot="watch-score-192"]) { width: 150px; }

/* Place the optional opening before the sample pictures at every width. */
.home-screen-hero:has([data-home-summary]) .home-hero-copy { display: contents; }
.home-screen-hero:has([data-home-summary]) .eyebrow { grid-area: tagline; }
.home-screen-hero:has([data-home-summary]) h1 { grid-area: headline; }
.home-screen-hero [data-home-summary] { grid-area: summary; margin-block: 0; }
.home-screen-hero:has([data-home-summary]) .home-screen-frame { grid-area: pictures; }
.home-screen-hero:has([data-home-summary]) .hero-detail:not([data-home-summary]) { grid-area: intro; }
.home-screen-hero:has([data-home-summary]) .hero-actions { grid-area: actions; }
main .home-screen-hero:has([data-home-summary]) {
  grid-template-areas: "tagline" "headline" "summary" "pictures" "intro" "actions";
}
@media (max-width: 899px) {
  html:is([lang="en-GB"], [lang="en-US"]) main .home-screen-hero:has([data-home-summary]) {
    grid-template-areas: "tagline" "headline" "summary" "intro" "pictures" "actions";
  }
}
main .tour-topic { padding-block: 16px; }
main .tour-topic h3 { margin-block-end: 6px; }
main .tour-topic li { margin-block: 3px; }
main .tour-topic .image-pair { margin: 0; }
main .home-tour-column { min-width: 0; }
main #home-screen .tour-illustrated { display: block; }
main #home-screen .tour-illustrated .image-pair { margin-block-start: 12px; }
main .showcase-lead:not(:has(figure)), main .showcase-journey:not(:has(figure)) {
  grid-template-columns: minmax(0,1fr); max-width: none; margin-block: 18px;
}
main .phone-scoring-layout:not(:has(figure)) { grid-template-columns: minmax(0,1fr); }
main .section-content > :last-child, main .plan-group > :last-child { margin-block-end: 0; }

@media (min-width: 900px) {
  main .analysis-flow { grid-template-columns: repeat(3,minmax(0,1fr)); }
  main .analysis-flow .analysis-next-with-picture {
    grid-template-columns: minmax(0,1fr) var(--capture-width);
    align-items: center;
  }
  main .hero.home-screen-hero, main .editorial, main .tour-illustrated,
  main .section:has(> .section-inner + .image-pair) {
    display: grid; grid-template-columns: minmax(0,560px) var(--capture-width);
    align-items: center; justify-content: center; gap: var(--row-gap);
  }
  main .editorial.reverse, main .tour-illustrated:nth-child(even),
  main .section:nth-child(even):has(> .section-inner + .image-pair) {
    grid-template-columns: var(--capture-width) minmax(0,560px);
  }
  main .hero.home-screen-hero {
    grid-template-columns: minmax(0,560px) minmax(0,calc(var(--capture-width) + 150px + var(--row-gap)));
  }
  main .home-screen-hero:has([data-home-summary]) {
    grid-template-areas: "tagline tagline" "headline headline" "summary summary" "intro pictures" "actions pictures";
    grid-template-rows: auto auto auto auto 1fr;
    align-items: start;
  }
  main .home-screen-hero:has([data-home-summary]) :is(.eyebrow,h1,.hero-detail) { margin-block: 0; }
  main .tour-illustrated:nth-child(even) > .image-pair,
  main .section:nth-child(even):has(> .section-inner + .image-pair) > .image-pair { order: -1; }
  main .editorial:has(.image-pair > figure:nth-child(2)), main .tour-illustrated:has(.image-pair > figure:nth-child(2)) {
    grid-template-columns: minmax(200px,1fr) calc(2 * var(--capture-width) + var(--row-gap));
  }
  main .editorial.reverse:has(.image-pair > figure:nth-child(2)),
  main .tour-illustrated:nth-child(even):has(.image-pair > figure:nth-child(2)) {
    grid-template-columns: calc(2 * var(--capture-width) + var(--row-gap)) minmax(200px,1fr);
  }
  main .editorial:has(.image-pair > figure:nth-child(3)), main .tour-illustrated:has(.image-pair > figure:nth-child(3)) {
    display: block;
  }
  main :is(.editorial,.tour-illustrated):has(.image-pair > figure:nth-child(3)) .image-pair { margin-block-start: 16px; }
  main .section-inner:has(> .section-content > .image-pair),
  main .section-inner:has(> .image-pair), main .plan-group:has(> .image-pair),
  main .topic-teaser:has(> figure) {
    --visual-track: var(--capture-width);
    display: grid; grid-template-columns: minmax(0,1fr) var(--visual-track);
    grid-template-rows: auto 1fr; align-content: start; align-items: start;
    column-gap: var(--row-gap); row-gap: 10px;
  }
  main .section-inner:has(> .section-content > .image-pair) > .section-content { display: contents; }
  main :is(.section-inner,.plan-group):has(> .image-pair,> .section-content > .image-pair) > :not(.image-pair,.section-content),
  main .section-content:has(> .image-pair) > :not(.image-pair), main .topic-teaser:has(> figure) > :not(figure) { grid-column: 1; }
  main :is(.section-inner,.plan-group):has(> .image-pair > figure:nth-child(2),> .section-content > .image-pair > figure:nth-child(2)) {
    --visual-track: calc(2 * var(--capture-width) + var(--row-gap));
  }
  main .plan-group:has(> p):has(> .image-pair), main .topic-teaser:has(> figure) {
    grid-template-rows: auto auto 1fr;
  }
  main .section-inner > .image-pair, main .section-content > .image-pair, main .plan-group > .image-pair,
  main .topic-teaser > figure { grid-column: 2; grid-row: 1 / -1; }
  main .section .section-content > .image-pair, main .section .section-inner > .image-pair, main .section .plan-group > .image-pair {
    width: var(--capture-width);
  }
  main .section :is(.section-content,.section-inner,.plan-group) > .image-pair:has(> figure:nth-child(2)) {
    width: calc(var(--capture-width) * 2 + var(--row-gap));
  }
  main .plan-group:has(> .image-pair > figure:nth-child(3)) { display: block; }
  main .section .plan-group > .image-pair:has(> figure:nth-child(3)) { width: 100%; margin-block-start: 16px; }
  main .section.app-tour > .section-inner:has(> .image-pair) { display: block; }
  main .section.app-tour > .section-inner > .image-pair { margin-block-end: 16px; }
  main .courtside-scoreboard .section-inner {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,540px); column-gap: var(--row-gap);
    align-content: center; align-items: end;
  }
  main .courtside-scoreboard .scoreboard-intro { grid-column: 1; align-self: start; margin: 0; }
  main .courtside-scoreboard .courtside-scene { grid-column: 2; grid-row: 1 / span 2; width: 100%; margin: 0; }
  main .section.courtside-scoreboard:has(> .image-pair) .courtside-scene { grid-row: 1 / span 3; }
  main .section.courtside-scoreboard:has(> .image-pair) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,540px); gap: 10px var(--row-gap); align-items: start; }
  main .section.courtside-scoreboard:has(> .image-pair) > .section-inner { display: contents; }
  main .section.courtside-scoreboard:has(> .image-pair) > .image-pair { grid-column: 1; grid-row: 3; order: 0; }
  main #home-screen .tour-topics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--row-gap); }
  main #home-screen .tour-topic { padding-block: 10px; }
  main .editorial:has(.home-analysis-preview) {
    grid-template-columns: minmax(0,540px) var(--capture-width); grid-template-rows: auto auto;
    align-items: start; gap: 16px var(--row-gap);
  }
  main .editorial:has(.home-analysis-preview) .editorial-copy { order: 0; grid-column: 1; }
  main .editorial:has(.home-analysis-preview) .editorial-visual { display: contents; }
  main .home-analysis-preview { grid-column: 1; display: contents; }
  main .home-analysis-preview > figure { grid-column: 2; grid-row: 1 / span 5; }
  main .home-analysis-preview > :not(figure) { grid-column: 1; margin-block: 0; }
  main .plan-comparison { gap: 16px; }
  main .plan-comparison > .plan-group { padding: 16px; }
  main .plan-group :is(th,td) { padding: 8px; }
  main #home-plan-comparison { grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-flow: row dense; align-items: start; }
  main #home-plan-comparison > :not(.plan-group),
  main #home-plan-comparison > .plan-group:has(.image-pair) { grid-column: 1 / -1; }
}
@media (min-width: 1120px) {
  main .app-tour:not(#home-screen) .tour-illustrated:has(.image-pair > figure:only-child) {
    grid-column: auto; grid-template-columns: minmax(0,1fr) var(--capture-width); gap: 16px; align-items: start;
  }
  main .app-tour:not(#home-screen) .tour-illustrated:nth-child(even):has(.image-pair > figure:only-child) {
    grid-template-columns: var(--capture-width) minmax(0,1fr);
  }
  body[data-page="home"] main { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 28px var(--row-gap); }
  body[data-page="home"] main > * { grid-column: 1 / -1; margin-block: 0; }
  body[data-page="home"] main > .topic-teaser.with-approved-picture {
    grid-column: span 4; display: flex; flex-direction: column; align-items: start; justify-content: start; gap: 12px;
  }
  body[data-page="home"] main > .topic-teaser .editorial-visual { order: 2; }
  body[data-page="home"] main > .section:has(.steps) { grid-column: span 7; }
  body[data-page="home"] main > .section:has(.steps) .steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  body[data-page="home"] main .steps article { padding: 0; gap: 8px; align-content: start; }
  body[data-page="home"] main > .courtside-scoreboard:has(> .image-pair) { grid-column: span 5; display: block; }
  body[data-page="home"] main > .section.courtside-scoreboard:has(> .image-pair) > .section-inner { display: block; }
  body[data-page="home"] main > .courtside-scoreboard .courtside-scene { margin-block: 12px; }
  body[data-page="home"] main > .editorial:has(img[data-image-slot="after-match-question"]),
  body[data-page="home"] main > [data-preview-topic="match-prep"] {
    grid-column: span 6; grid-template-columns: minmax(0,1fr) var(--capture-width);
    align-content: start; align-items: start; gap: 12px;
  }
  body[data-page="home"] main > [data-preview-topic="match-prep"] { grid-template-columns: var(--capture-width) minmax(0,1fr); }
  body[data-page="home"] main > .editorial:has(img[data-image-slot="after-match-question"]) h2,
  body[data-page="home"] main > [data-preview-topic="match-prep"] h2,
  body[data-page="home"] main .topic-teaser h2 { font-size: clamp(26px,2.1vw,32px); line-height: 1.12; }
  body[data-page="home"] main :is(.editorial-copy,.home-tour-column) :is(p,li) { line-height: 1.4; }
  body[data-page="home"] main .feature-list { gap: 6px; margin-block: 12px; }
  body[data-page="home"] main .analysis-bars { gap: 6px; }
  body[data-page="home"] main .analysis-bars > * { padding-block: 6px; }
  body[data-page="home"] main .analysis-bars { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-page="home"] main .hero { padding-block: 16px; }
  body[data-page="home"] main .home-tour-column .tour-topic { padding-block: 6px; }
  #home-screen-sample ul { display: flex; flex-wrap: wrap; gap: 0 12px; }
  #home-screen-sample li:first-child { flex-basis: 100%; }
}
@media (max-width: 899px) {
  :root { --capture-width: 360px; }
  main .section .image-pair { min-inline-size: 0; }
  main .section :is(.section-content,.plan-group) { grid-template-columns: minmax(0,1fr); }
  main .section .editorial-visual, main .home-screen-hero .home-screen-frame { width: 100%; max-width: none; }
  main .hero.home-screen-hero, main .editorial, main .topic-teaser, main .tour-illustrated, main #home-screen .tour-topics {
    grid-template-columns: minmax(0,1fr); gap: 14px;
  }
  main .section .image-pair, body.page-how main .section .image-pair,
  body[data-page="help"] main .section .image-pair { justify-content: center; }
  main .section .image-pair > figure.device-figure, main .home-screen-frame .device-figure,
  main .section > figure.device-figure { width: min(100%,360px); margin-inline: auto; }
  main .home-screen-hero .home-screen-frame { justify-self: center; }
  main .courtside-scoreboard > .image-pair { margin-block-start: 12px; }
  main .section-inner > .image-pair, main .practice-follow-up .image-pair { margin-block: 12px; }
}
@media (max-width: 600px) {
  main .section h2 { margin-block-end: 10px; }
  main .editorial-copy > :is(p,ul), main .section .plan-group > p { margin-block: 8px; }
  main .feature-list { gap: 6px; }
  main .tour-topic { padding-block: 10px; }
  main .tour-topic li { margin-block: 2px; }
  main .plan-comparison { gap: 10px; }
  main .plan-comparison > .plan-group { padding: 12px; gap: 6px; }
  main .plan-group :is(th,td) { padding-block: 7px; }
  main .reassurance article { padding-block: 10px; }
  main .analysis-bars { padding: 14px; gap: 10px; }
  #home-screen-sample ul { display: flex; flex-wrap: wrap; gap: 0 12px; }
  #home-screen-sample li:first-child { flex-basis: 100%; }
}

/* Share instructions are separate paragraphs in every language. */
.flow-share .share-notes > p { margin-block: 0 1rem; }

/* Iris, 18 Nov 12:15: preserve the approved Indonesian Home wording.
   Largest whole-pixel sizes that fit: 31px at 320px, 36px at 360px. */
@media (max-width: 360px) {
  html[lang="id"] body[data-page="home"] .home-screen-hero h1 {
    font-size: clamp(31px, calc(12.5vw - 9px), 36px);
  }
}
