/* Progress (DESIGN.md › Progress), in the player's one sheet: one view and its
   panes (a measure, How it's counted, How's it going?, Share with your clinician). The view answers at a glance: every
   measure the same card (a trend badge and the headline, its number in Display type) in one carousel, then one short
   next step in words. A measure's pane has its weekly chart, every mark named, so colour is never the only cue. Tokens
   only (guided_tokens_test.mjs). */
/* Controls and headings are scoped to .gp-page so the player's own button and heading rules (box_player.css) don't
   restyle them. */
.gp-page { --gp-gutter: var(--guided-margin); color: var(--gs-text-primary); font-family: var(--guided-font); }
.gp-page :is(.gp-main, .gp-section, .gp-pane) { display: flex; flex-direction: column; gap: var(--guided-gap-block); }
.gp-page :is(.gp-main, .gp-section, .gp-pane)[hidden] { display: none; }
.gp-loading { display: grid; place-items: center; min-block-size: 60dvh; margin: 0; font-size: var(--guided-size-small); color: var(--gs-text-secondary); }
.gp-pane-subtitle { font-size: var(--guided-size-small); line-height: var(--guided-leading-small); color: var(--gs-text-secondary); }
.gp-page :is(h1, h2, h3, p) { margin: 0; }

/* Icons (GuidedProgressHelper::ICONS, the player's own glyphs): outline, currentColor, and each stroke set in the
   pixels it renders at, whatever the icon's size, matched to the text beside it: 1.5px beside regular and medium text
   and on the player's Rows and chevrons, 2px beside semibold, 2.5px beside bold. Only the chevron and the number's
   arrow follow the reading direction; the rest are objects and marks, which never mirror. */
/* Each icon draws at Heroicons' own weight (the icon system, plans/023); here only its size and colour. */
.gp-page .gp-icon { flex: none; }
.gp-page .gp-chevron { inline-size: var(--guided-chevron); block-size: var(--guided-chevron); color: var(--gs-text-secondary); }
.gp-chevron:dir(rtl) { transform: scaleX(-1); }

/* A check-in worth a doctor's look: a soft panel with its sign, first on the page. */
.gp-flag { display: flex; align-items: flex-start; gap: var(--guided-space-3); padding: var(--guided-space-4); border-radius: var(--guided-radius-row); background: var(--box-soft); }
.gp-page .gp-flag-icon { inline-size: var(--guided-icon-row); block-size: var(--guided-icon-row); color: var(--box-warning); }
.gp-flag p { margin: 0; font-size: var(--guided-size-small); line-height: var(--guided-leading-small); }

.gp-empty { font-size: var(--guided-size-body); line-height: var(--guided-leading-body); color: var(--gs-text-secondary); }

/* The cards: every measure the same card, in one carousel that runs past the body's margin to the sheet's
   edges. Each card is 28px narrower than the view so the next one peeks; they snap one at a time and share the
   tallest one's height; the dots under them say how many, the current one longer. One card fills the width. */
.gp-cards { display: flex; flex-direction: column; gap: var(--guided-space-3); }
.gp-carousel { display: flex; gap: var(--guided-space-3); margin-inline: calc(var(--gp-gutter) * -1); padding-inline: var(--gp-gutter); scroll-padding-inline: var(--gp-gutter); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gp-carousel::-webkit-scrollbar { display: none; }
.gp-slide { display: flex; flex: none; inline-size: min(360px, calc(100% - 28px)); scroll-snap-align: start; }
.gp-slide:only-child { inline-size: 100%; }
.gp-slide > .gp-glance { flex: 1; min-inline-size: 0; }
.gp-dots { display: flex; justify-content: center; gap: 6px; }
.gp-dot { inline-size: 6px; block-size: 6px; border-radius: var(--guided-radius-pill); background: var(--box-dot); }
.gp-dot[data-active] { inline-size: 18px; background: var(--gs-text-primary); }
@media (prefers-reduced-motion: no-preference) { .gp-dot { transition-property: inline-size, background-color; transition-duration: 150ms; transition-timing-function: ease-out; } }

/* An answer card, seen rather than read. The badge and headline, the big number and what it
   compares; the whole card is one button to the measure's pane (the chevron says so). The waiting answer, and Practice saved's card,
   end with the next step in words. */
.gp-page .gp-glance { display: flex; flex-direction: column; gap: var(--guided-gap-block); box-sizing: border-box; padding: var(--guided-margin); border: 1px solid var(--box-line); border-radius: var(--guided-radius-card); background: var(--gs-card); }
.gp-page .gp-glance-body { display: flex; flex-direction: column; gap: var(--guided-gap-line); }
/* A card that opens its pane is itself the button, so a tap anywhere on it opens it. The carousel clips anything
   outside a card, so its focus ring sits just inside its edge, as the Welcome's tiles do, and on hover its tint is the
   cue rather than the player's outline. */
.gp-page .gp-glance-open { justify-content: flex-start; gap: var(--guided-gap-line); min-block-size: var(--guided-touch); color: inherit; font: inherit; text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gs-box-player .gp-page .gp-glance-open:focus-visible { outline-offset: calc(var(--guided-space-1) * -1); }
.gs-box-player .gp-page .gp-glance-open:not(:focus-visible):hover { outline: none; }
.gp-glance-head { display: flex; align-items: center; gap: var(--guided-space-3); margin-block-end: var(--guided-space-3); }
.gp-page .gp-glance-headline { flex: 1; min-inline-size: 0; font-size: var(--guided-size-card); font-weight: 800; line-height: var(--guided-leading-heading); letter-spacing: var(--guided-tracking); text-wrap: balance; }
/* The trend badge: a circle with which way the number went. The good way, Progress's soft green with its
   dark arrow; about the same and while waiting, the quiet grey; the other way, the dark neutral, never red (status
   colours stay reserved). The headline beside it says it in words, so colour is never the only cue. */
.gp-badge { display: grid; place-items: center; flex: none; inline-size: 40px; block-size: 40px; border-radius: var(--guided-radius-pill); background: var(--box-soft); color: var(--gs-text-secondary); }
.gp-page .gp-badge-icon { inline-size: 22px; block-size: 22px; }
.gp-badge[data-badge="good"] { background: var(--guided-progress-ask); color: var(--guided-progress-now); }
.gp-badge[data-badge="bad"] { background: var(--gs-text-primary); color: var(--gs-card); }
.gp-badge[data-badge="passed"] { color: var(--gs-text-primary); }
/* The one big number: start → now as the practice's result shows its pair, the start in the secondary text colour and
   now in the primary; its arrow turns round in Arabic. What it compares sits under it in Small. */
.gp-number { display: flex; align-items: center; gap: var(--guided-space-3); margin: 0; font-size: var(--guided-size-pair-card); font-weight: 700; line-height: var(--guided-leading-display); letter-spacing: var(--guided-tracking-tight); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gp-number-before { color: var(--gs-text-secondary); }
.gp-number-now { color: var(--gs-text-primary); }
.gp-page .gp-number-arrow { inline-size: var(--guided-icon-pair-card); block-size: var(--guided-icon-pair-card); color: var(--gs-text-secondary); }
.gp-number-arrow:dir(rtl) { transform: scaleX(-1); }
/* Whether something passed: how many in Display type, the rest of "2 of 4" in Count size, on one baseline. */
.gp-number[data-count] { align-items: baseline; gap: var(--guided-space-2); }
.gp-number-of { font-size: var(--guided-size-count); font-weight: 600; letter-spacing: normal; color: var(--gs-text-secondary); }
/* A since-you-started card's line over the weeks: the band a wash of the text colour, the start dashed in
   it, the weeks in Progress's colour (faint and dashed across a week with nothing), now a dot ringed with the card's
   colour. No axes: the number says start and now. */
.gp-trend { display: block; inline-size: 100%; block-size: auto; margin-block-start: var(--guided-space-3); overflow: visible; }
.gp-trend-band { fill: var(--gs-text-secondary); fill-opacity: 0.14; }
.gp-trend-start { stroke: var(--gs-text-secondary); stroke-width: 1; stroke-dasharray: 3 3; }
.gp-trend-gaps { fill: none; stroke: var(--guided-progress-now); stroke-width: 1.5; stroke-dasharray: 2 4; stroke-opacity: 0.45; stroke-linecap: round; }
.gp-trend-line { fill: none; stroke: var(--guided-progress-now); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gp-trend-dot { fill: var(--guided-progress-now); }
.gp-trend-now { fill: var(--guided-progress-now); stroke: var(--gs-card); stroke-width: 2; }
/* The next step in Small, under the cards on the Rows' text edge, or inside a card under its rule (the waiting answer
   and Practice saved's), where a waiting answer's button sits at its end. */
.gp-page .gp-next { font-size: var(--guided-size-small); font-weight: 600; line-height: var(--guided-leading-small); font-variant-numeric: tabular-nums; text-wrap: pretty; }
.gp-page .gp-clock { padding-inline: var(--guided-space-4); }
.gp-page .gp-step { padding-block-start: var(--guided-space-4); border-block-start: 1px solid var(--box-line); }
.gp-step-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--guided-space-2) var(--guided-space-3); }
/* The measures with nothing to compare yet, one quiet line under the cards. */
.gp-page .gp-later { padding-inline: var(--guided-space-4); font-size: var(--guided-size-small); line-height: var(--guided-leading-small); color: var(--gs-text-secondary); text-wrap: pretty; }
/* A card's pane: the card's content, then its weekly chart. */
.gp-measure { display: flex; flex-direction: column; gap: var(--guided-gap-block); }
.gp-measure-head { display: flex; flex-direction: column; gap: var(--guided-gap-line); }
.gp-card-title { font-size: var(--guided-size-count); font-weight: 700; letter-spacing: var(--guided-tracking); }
.gp-card-hint { font-size: var(--guided-size-small); color: var(--gs-text-secondary); }
.gp-page .gp-chip { display: inline-flex; align-items: center; gap: var(--guided-space-1); flex: none; min-block-size: var(--guided-touch); padding: 0 var(--guided-space-3); border: 0; border-radius: var(--guided-radius); background: var(--box-soft); color: var(--gs-text-primary); font: inherit; font-size: var(--guided-size-small); font-weight: 600; cursor: pointer; }
.gp-page .gp-chip-icon { inline-size: 1.25em; block-size: 1.25em; }

/* The chart (Guided::Progress::Chart): a hairline grid and axis in the text tokens, 2px lines with round joins, 8px
   dots ringed in the card's colour, Before quiet and Now in Progress's colour; "You started" a hairline. The
   read-out follows the crosshair; the table under it is for screen readers. */
.gp-chart { position: relative; display: flex; flex-direction: column; gap: var(--guided-space-2); margin: 0; border-radius: var(--guided-radius-xs); }
.gp-chart:focus-visible { outline: 2px solid var(--gs-text-primary); outline-offset: 4px; }
.gp-chart-plot { position: relative; }
.gp-chart svg { display: block; inline-size: 100%; block-size: auto; overflow: visible; }
.gp-chart-grid { stroke: var(--box-line); stroke-width: 1; }
.gp-chart-axis { fill: var(--gs-text-secondary); font-family: var(--guided-font); font-size: var(--guided-size-label); font-variant-numeric: tabular-nums; }
.gp-chart-cross { stroke: var(--gs-text-secondary); stroke-width: 1; }
/* Since you started: the start dashed across, the "about the same" band a quiet wash of the text colour around it. */
.gp-chart-band { fill: var(--gs-text-secondary); fill-opacity: 0.14; }
.gp-chart-baseline { stroke: var(--gs-text-secondary); stroke-width: 1.5; stroke-dasharray: 5 4; }
.gp-chart-line { fill: none; stroke: var(--guided-progress-now); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gp-chart-dot { fill: var(--guided-progress-now); stroke: var(--gs-card); stroke-width: 2; }
.gp-chart-dot[data-tone="before"] { fill: var(--guided-progress-before); }
.gp-chart-dot[data-tone="start"] { fill: var(--gs-card); stroke: var(--gs-text-secondary); }
/* After a practice: a week's Before and After joined; whether something passed: its count over its check-ins. */
.gp-chart-pair { stroke: var(--guided-progress-before); stroke-width: 2; stroke-linecap: round; }
.gp-chart-track { fill: var(--box-soft); }
.gp-chart-bar { fill: var(--guided-progress-now); }
.gp-chart-value { fill: var(--gs-text-primary); font-family: var(--guided-font); font-size: var(--guided-size-caption); font-weight: 800; font-variant-numeric: tabular-nums; }
/* The legend names each mark: a line, the dashed start, the band, a dot, a bar; the good side is its arrow and words. */
.gp-chart-legend { display: flex; flex-wrap: wrap; gap: var(--guided-space-1) var(--guided-space-4); font-size: var(--guided-size-caption); color: var(--gs-text-secondary); }
.gp-chart-legend > span { display: inline-flex; align-items: center; gap: var(--guided-space-1); }
.gp-chart-legend > span::before { content: ""; flex: none; inline-size: 14px; block-size: 2px; border-radius: var(--guided-radius-pill); background: var(--guided-progress-now); }
.gp-chart-legend > span[data-mark="dot"]::before { inline-size: 8px; block-size: 8px; }
.gp-chart-legend > span[data-mark="bar"]::before { inline-size: 8px; block-size: 10px; border-radius: var(--guided-radius-xs); }
.gp-chart-legend > span[data-tone="before"]::before { background: var(--guided-progress-before); }
.gp-chart-legend > span[data-tone="track"]::before { background: var(--box-soft); }
.gp-chart-tip { position: absolute; inset-block-start: 0; translate: -50% -110%; margin: 0; padding: var(--guided-space-1) var(--guided-space-2); border-radius: var(--guided-radius-xs); background: var(--gs-text-primary); color: var(--gs-card); font-size: var(--guided-size-caption); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.gp-chart-tip[data-edge="start"] { translate: 0 -110%; }
.gp-chart-tip[data-edge="end"] { translate: -100% -110%; }

/* The Rows: How's it going?, Your practices, Share with your clinician, How it's counted. Each is the guided Row
   (box_player.css, .box-np-row); a value sits at its end before the chevron, and How's it going? while it isn't due
   is a Row with its value and no chevron, not a button. */
.gp-link-rows { display: flex; flex-direction: column; gap: var(--guided-gap-row); }
/* Ask about your progress posts, so its Row sits in a form that adds nothing to the group. */
.gp-chat-form { margin: 0; }
.gp-row-end { display: inline-flex; align-items: center; gap: var(--guided-space-2); flex: none; }
.gp-row-value { font-size: var(--guided-size-small); color: var(--gs-text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gp-page .gp-link-row[data-static] { cursor: default; }
.gp-page .gp-link-row { display: flex; align-items: center; justify-content: space-between; gap: var(--guided-space-3); inline-size: 100%; min-block-size: var(--guided-row-h); box-sizing: border-box; padding: var(--guided-space-2) var(--guided-space-4); border: 1px solid var(--box-line); border-radius: var(--guided-radius-row); background: var(--gs-card); color: var(--gs-text-primary); font: inherit; font-size: var(--guided-size-body); font-weight: 500; line-height: var(--guided-leading-label); text-align: start; text-decoration: none; cursor: pointer; }

/* The panes: How it's counted (each source once, under its measures' names), How's it going?. */
.gp-how-measure { display: flex; flex-direction: column; gap: var(--guided-space-3); }
.gp-how { display: flex; flex-direction: column; gap: var(--guided-space-4); margin: 0; }
.gp-how-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: var(--guided-space-3); }
.gp-how-row dt { font-size: var(--guided-size-body); font-weight: 800; }
.gp-how-row dd { margin: 0; font-size: var(--guided-size-body); line-height: var(--guided-leading-body); color: var(--gs-text-secondary); }
.gp-answers { display: flex; flex-direction: column; gap: var(--guided-gap-row); }
.gp-page .gp-answer { min-block-size: var(--guided-primary-h); padding: 0 var(--guided-space-4); border: 1px solid var(--box-line); border-radius: var(--guided-radius); background: var(--gs-card); color: var(--gs-text-primary); font: inherit; font-size: var(--guided-size-body); font-weight: 600; text-align: start; cursor: pointer; }
@media (hover: hover) { .gp-page :is(button.gp-link-row, .gp-answer, .gp-glance-open):hover { background: var(--box-soft); } }
/* The cards, Rows, chips and answers press in as the player's Rows and tools do (box_player.css), unless motion is
   reduced; the hover tint and the pane that opens are the cues that stay. */
@media (prefers-reduced-motion: no-preference) {
  .gp-page :is(.gp-glance-open, button.gp-link-row, .gp-chip, .gp-answer) { transition: transform var(--guided-press) var(--guided-ease-out, ease-out); }
  .gp-page :is(.gp-glance-open, button.gp-link-row, .gp-chip, .gp-answer):active:not(:disabled) { transform: scale(.96); }
}

/* Practice saved, in the player's sheet after a practice: Progress's answer card as the page shows it. */
.gp-offer { display: flex; flex-direction: column; }

/* Share with your clinician: the row in Over time, then its pane, in the image card's share sheet's own
   parts (breathing_share.css; box_player.css › Share): the drawn page and its period, the choices as Rows with that
   sheet's checkbox, and its footer, the privacy line, status, Try again and Share PDF as the Done pill, 8px apart. */
.gp-page .gp-link-row-label { display: flex; align-items: center; gap: var(--guided-space-3); min-inline-size: 0; }
.gp-page .gp-link-row-icon { inline-size: var(--guided-icon-row); block-size: var(--guided-icon-row); color: var(--gs-text-secondary); }
.gp-share-document { display: flex; align-items: center; gap: var(--guided-space-4); padding: var(--guided-space-4); border-radius: var(--guided-radius-card); background: var(--box-soft); }
.gp-share-page { display: flex; flex: none; flex-direction: column; gap: 4px; inline-size: 44px; block-size: 58px; box-sizing: border-box; padding: 8px 6px; border: 1px solid var(--box-line); border-radius: var(--guided-radius-xs); background: var(--gs-card); }
.gp-share-page > span { block-size: 3px; border-radius: var(--guided-radius-pill); background: var(--box-line); }
.gp-share-page > span:first-child { inline-size: 70%; block-size: 4px; background: var(--gs-text-primary); }
.gp-share-page > span:nth-child(3) { inline-size: 85%; }
.gp-share-page > span:last-child { inline-size: 55%; }
.gp-share-document-text { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.gp-share-document-title { font-size: var(--guided-size-body); font-weight: 700; }
.gp-page .gp-share-choices { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.gp-share-footer { gap: var(--guided-gap-row); }
.gp-share-footer [hidden] { display: none !important; }
