/* The workout plan builder (T68 stream P-web). Three parts: the questions
   with the week bar beside them, the plan, and the print sheets (paper: its
   own five colours, as on the printable workout log). Site tokens only,
   both themes; every selector is under .wpb or carries the wpb- / wps-
   prefix. Motion is transform and opacity; reduced motion gets none. */

.wpb { display: flex; flex-direction: column; gap: clamp(32px, 5vw, 56px); }
.wpb [hidden] { display: none !important; }
.js .wpb-nojs, .no-js .wpb-js { display: none !important; }
/* A built plan comes first; the questions follow it (script off) or wait behind "Change my answers". */
.wpb[data-mode="plan"] .wpb-plan { order: -1; }
.js .wpb[data-mode="plan"] .wpb-ask { display: none; }

/* ------------------------------------------------------------ questions */
.wpb-ask { display: grid; gap: 28px; }
.wpb-ask > * { min-width: 0; }
.wpb-ask-h { margin-top: 8px; }
@media (min-width: 960px) {
  .wpb-ask { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); column-gap: clamp(40px, 6vw, 96px); align-items: start; }
  .wpb-ask-h { grid-column: 1 / -1; }
  .wpb-stage { position: sticky; top: 88px; }
}

.wpb-bar { max-width: 720px; }
.wpb-bar svg { display: block; width: 100%; height: auto; overflow: visible; }
.wpb-plate { transform-box: fill-box; transform-origin: center; }
.wpb-ask .wpb-slot { cursor: pointer; }
.wpb-fact { margin-top: 8px; text-transform: uppercase; }
.wpb-live { margin-top: 10px; }

.wpb-form { display: grid; gap: 28px; }
.wpb-top { display: grid; gap: 10px; }
.wpb-prog { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.wpb-prog li { height: 4px; border-radius: 2px; background: var(--steel); transition: background-color 200ms ease; }
.wpb-prog li.is-done { background: var(--chalk-dim); }
.wpb-prog li.is-now { background: var(--chalk); }

.wpb-q { min-width: 0; margin: 0; padding: 0; border: 0; outline: none; }
.js .wpb-form .wpb-q { display: none; }
.js .wpb-form .wpb-q.is-on { display: block; }
.wpb-q-t { display: block; padding: 0; font: 700 clamp(32px, 6.4vw, 52px)/.95 var(--f-display); letter-spacing: .3px; text-transform: uppercase; }
.wpb-q-m { margin: 10px 0 20px; font-size: 15px; }
.wpb-sub { margin: 22px 0 10px; }
.wpb-msg { min-height: 1.5em; margin-top: 12px; color: var(--chalk); }

.wpb-opts { display: grid; gap: 10px; }
.wpb-opt { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r-surface); background: var(--iron-plate); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wpb-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wpb-opt > span { display: grid; gap: 5px; min-height: 68px; align-content: center; padding: 14px 18px; border-radius: inherit; transition: background-color 160ms ease, color 160ms ease; }
.wpb-opt b { font: 700 24px/1 var(--f-display); letter-spacing: .4px; text-transform: uppercase; }
.wpb-opt small { font-size: 14px; line-height: 1.35; color: var(--chalk-dim); }
.wpb-opt input:checked + span, .wpb-preset[aria-pressed="true"] > span { background: var(--chalk); color: var(--on-chalk); }
.wpb-opt input:checked + span small, .wpb-preset[aria-pressed="true"] small { color: inherit; opacity: .72; }
.wpb-opt input:focus-visible + span, .wpb-preset:focus-visible > span { outline: 2px solid var(--chalk); outline-offset: 3px; }
@media (min-width: 600px) { .wpb-presets { grid-template-columns: repeat(3, 1fr); } }

.wpb-daychips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wpb-dchip { position: relative; display: block; }
.wpb-dchip input, .wpb-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wpb-dchip span { display: grid; place-items: center; min-height: 48px; border-radius: var(--r-button); background: var(--iron-raised); color: var(--chalk-dim); font: 700 17px/1 var(--f-display); letter-spacing: .5px; text-transform: uppercase; transition: background-color 160ms ease, color 160ms ease; }
.wpb-dchip abbr { text-decoration: none; }
.wpb-dchip input:checked + span, .wpb-seg input:checked + span { background: var(--chalk); color: var(--on-chalk); }
.wpb-dchip input:focus-visible + span, .wpb-seg input:focus-visible + span { outline: 2px solid var(--chalk); outline-offset: 3px; }
.wpb-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--iron-raised); }
.wpb-seg label { position: relative; display: block; }
.wpb-seg span { display: grid; place-items: center; min-width: 64px; min-height: 48px; padding: 0 14px; border-radius: var(--r-button); color: var(--chalk-dim); font: 700 20px/1 var(--f-display); letter-spacing: .5px; text-transform: uppercase; transition: background-color 160ms ease, color 160ms ease; }

.wpb-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.wpb-nav .btn-ember { flex: 1 1 200px; }
.wpb-nav .btn-iron { min-height: 56px; }

/* ----------------------------------------------------------------- plan */
.wpb-out { outline: none; scroll-margin-top: 84px; }
.wpb-rv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.wpb-rv-meta { margin-top: 10px; font-size: 16px; }
.wpb-bar-plan { margin: clamp(20px, 4vw, 36px) 0 8px; }
.wpb-stats { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 720px; margin: 16px 0 0; border-block: 1px solid var(--hairline); }
.wpb-stats div { display: flex; flex-direction: column-reverse; gap: 6px; padding: 16px 0 14px; }
.wpb-stats div + div { padding-left: clamp(12px, 3vw, 24px); border-left: 1px solid var(--hairline); }
.wpb-stats dt { font-size: 13px; color: var(--chalk-dim); }
.wpb-stats dd { margin: 0; font: 700 clamp(32px, 7vw, 56px)/1 var(--f-display); letter-spacing: .3px; }
.wpb-why { max-width: 720px; margin-top: 28px; }
.wpb-why ul { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.wpb-why li { position: relative; padding-left: 20px; font-size: 16px; line-height: 1.45; }
.wpb-why li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--chalk-dim); }
.wpb-short { margin-top: 12px; }
.wpb-open-hint { margin: 28px 0 12px; }
@media (min-width: 1000px) {
  /* Wide: the reasons sit beside the bar they explain. */
  .wpb-out { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 80px); align-items: start; }
  .wpb-out > * { grid-column: 1 / -1; }
  .wpb-out > .wpb-bar-plan, .wpb-out > .wpb-stats { grid-column: 1; }
  .wpb-out > .wpb-why { grid-column: 2; grid-row: 2 / 4; align-self: center; margin-top: 0; }
}

.wpb-days { display: grid; gap: 12px; align-items: start; }
@media (min-width: 900px) { .wpb-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wpb-day { border-radius: var(--r-surface); background: var(--iron-plate); scroll-margin-top: 84px; }
.wpb-day > summary { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; gap: 3px 14px; align-items: center; min-height: 68px; padding: 12px 16px 12px 12px; list-style: none; cursor: pointer; border-radius: var(--r-surface); }
.wpb-day > summary::-webkit-details-marker, .wpb-ex > summary::-webkit-details-marker { display: none; }
.wpb-mono { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-button); background: var(--iron-raised); font: 700 22px/1 var(--f-display); }
.wpb-day-t { align-self: end; font: 700 22px/1 var(--f-display); letter-spacing: .4px; text-transform: uppercase; }
.wpb-day-m { grid-column: 2; align-self: start; }
.wpb-day > summary::after, .wpb-ex > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--steel-icon); border-bottom: 2px solid var(--steel-icon); transform: rotate(45deg); transition: transform 200ms ease; }
.wpb-day > summary::after { grid-column: 3; grid-row: 1 / 3; justify-self: center; }
.wpb-day[open] > summary::after, .wpb-ex[open] > summary::after { transform: rotate(-135deg); }
.wpb-day summary:focus-visible { outline: 2px solid var(--chalk); outline-offset: -2px; }
.wpb-day-f { padding: 0 16px 10px 70px; }
.wpb-steps { margin: 0; padding: 0 8px 8px; list-style: none; }
.wpb-ex > summary { display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 2px 12px; align-items: center; min-height: 56px; padding: 9px 8px; border-top: 1px solid var(--hairline); list-style: none; cursor: pointer; }
.wpb-ex > summary::after { grid-column: 2; grid-row: 1 / 3; justify-self: center; }
.wpb-ex-n { font-size: 16px; font-weight: 500; line-height: 1.3; }
.wpb-ex-l { grid-column: 1; font-size: 14px; color: var(--chalk-dim); }
.wpb-ex-body { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "demo txt" "swap swap"; gap: 14px; align-items: start; padding: 4px 8px 18px; }
/* The demos are drawn on white; the tile keeps them so in both themes. */
.wpb-demo { grid-area: demo; width: 96px; height: 96px; border-radius: 12px; background: #fff; object-fit: contain; }
.wpb-ex-txt { grid-area: txt; align-self: center; font-size: 14px; }
.wpb-ex-swap { grid-area: swap; display: grid; gap: 10px; }
.wpb-alts .chip { display: inline-flex; align-items: center; padding-block: 6px; line-height: 1.25; text-decoration: none; background: var(--iron-raised); }
@media (min-width: 600px) {
  .wpb-ex-body { grid-template-columns: 140px minmax(0, 1fr); grid-template-areas: "demo txt" "demo swap"; grid-template-rows: auto 1fr; gap: 12px 20px; }
  .wpb-demo { width: 140px; height: 140px; }
  .wpb-ex-txt { align-self: start; }
}

/* ---------------------------------------------------- take it with you */
.wpb-take { margin-top: clamp(32px, 5vw, 56px); }
.wpb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.wpb-actions .btn { text-decoration: none; }
.wpb-actions .btn-chalk, .wpb-actions .btn-iron { min-height: 56px; }
.wpb-stored { max-width: 46em; margin-top: 14px; }
.wpb-code { display: grid; gap: 24px; margin-top: 20px; outline: none; }
.wpb-code-main { display: grid; gap: 8px; justify-items: start; align-content: start; }
.wpb-code-v, .wpb-code-h1 { font: 700 clamp(48px, 13vw, 92px)/1 var(--f-display); letter-spacing: 3px; white-space: nowrap; }
.wpb-code-main .btn { margin-top: 8px; }
.wpb-code a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.wpb-qr svg { display: block; width: 176px; height: 176px; border-radius: 8px; }
/* A code to scan is dark on light in both themes: a scanner is not a reader. */
.wpb-qr-bg { fill: #fff; }
.wpb-qr-fg { fill: #111; }
.wpb-next ol { display: grid; gap: 10px; margin: 12px 0 0; padding-left: 22px; font-size: 16px; line-height: 1.45; }
@media (min-width: 900px) { .wpb-code { grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1.2fr); column-gap: 48px; align-items: start; } }

/* --------------------------------------------- the plan page (/p/{code}) */
.wpb-coded { gap: clamp(28px, 4vw, 44px); }
.wpb-coded[data-mode="plan"] .wpb-plan { order: 0; }
.wpb-coded .wpb-bar-plan { max-width: 560px; }
.wpb-coded .wpb-open { margin-top: 0; }
.wpb-open-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.wpb-open-link .btn { text-decoration: none; }
@media (min-width: 900px) { .wpb-coded .wpb-open { grid-template-columns: minmax(0, 1fr) auto; } }
.no-js .wpb-coded .wpb-qr { display: none; }
.wpb-missing-cta { margin: 28px 0 clamp(56px, 9vw, 104px); }
.wpb-missing-cta .btn { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .wpb-opt > span, .wpb-dchip span, .wpb-seg span, .wpb-prog li, .wpb-day > summary::after, .wpb-ex > summary::after { transition: none; }
}

/* ----------------------------------------------------------- the paper
   The printable log's sheet pattern, copied (never its files): every length
   is in em, and one em is 1/72 of the sheet's width, so the sheet is the
   same drawing at any size. */
.wps-sp { --wps-ink: #111; --wps-dim: #555; --wps-faint: #9b9b9b; --wps-tint: rgba(0, 0, 0, .055); }
.wps-sheet { height: 100%; container-type: inline-size; }
.wps-in { position: relative; height: 100%; font-family: var(--f-body); font-size: 2.52mm; font-size: calc(100cqw / 72); line-height: 1.3; color: var(--wps-ink); font-variant-numeric: tabular-nums lining-nums; }
.wps-in p { margin: 0; }
.wps-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2em; padding-bottom: 1.1em; border-bottom: .28em solid var(--wps-ink); }
.wps-head-l { min-width: 0; }
.wps-over { font-size: .95em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--wps-dim); }
.wps-day { margin-top: .08em; font: 700 6.4em/.9 var(--f-display); letter-spacing: .01em; text-transform: uppercase; }
.wps-sum { margin-top: .7em; font-size: 1.1em; color: var(--wps-dim); }
.wps-fields { flex: none; display: grid; gap: .7em; width: 22em; }
.wps-field { display: flex; align-items: flex-end; gap: .6em; font-size: .95em; color: var(--wps-dim); }
.wps-field span { white-space: nowrap; }
.wps-field i { flex: 1; height: 1.5em; border-bottom: .08em solid var(--wps-ink); }

.wps-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.wps-table th, .wps-table td { padding: 0; font-weight: 400; text-align: left; }
.wps-table thead th { padding: .75em .6em .6em; vertical-align: bottom; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; border-bottom: .16em solid var(--wps-ink); }
.wps-table thead .wps-c-set, .wps-table thead .wps-c-rest { padding-inline: 0; text-align: center; letter-spacing: .04em; }
.wps-c-rest { width: 4.8em; }
.wps-c-set { width: 5.6em; }
.wps-c-wk { width: 8.6em; }
.wps-table thead .wps-c-wk { border-left: .07em solid var(--wps-ink); }
.wps-wk { display: block; font: 700 1.5em/1 var(--f-display); letter-spacing: .03em; }
.wps-date { display: flex; align-items: flex-end; gap: .4em; margin-top: .45em; font-size: .85em; font-weight: 400; letter-spacing: .06em; color: var(--wps-dim); }
.wps-date i { flex: 1; height: 1.3em; border-bottom: .08em solid var(--wps-ink); }
.wps-ex { border-bottom: .12em solid var(--wps-ink); break-inside: avoid; }
.wps-name { position: relative; padding: .55em .6em .45em 2.8em !important; vertical-align: top; }
.wps-no { position: absolute; left: .5em; top: .5em; font: 700 1.6em/1 var(--f-display); color: var(--wps-dim); }
.wps-nm { display: block; font-size: 1.15em; font-weight: 600; line-height: 1.22; overflow-wrap: anywhere; }
.wps-tg { display: block; margin-top: .2em; font: 700 1.7em/1 var(--f-display); letter-spacing: .02em; }
.wps-rest { text-align: center !important; vertical-align: middle; font: 600 1.25em/1 var(--f-display) !important; letter-spacing: .02em; }
.wps-set { height: var(--wps-row, 2.3em); text-align: center !important; color: var(--wps-dim); border-top: .05em solid var(--wps-faint); white-space: nowrap; }
.wps-set small { margin-left: .35em; font-size: .78em; }
.wps-cell { height: var(--wps-row, 2.3em); text-align: center !important; border-top: .05em solid var(--wps-faint); border-left: .07em solid var(--wps-ink); }
.wps-cell b { position: relative; left: 6%; font-size: .95em; font-weight: 400; color: var(--wps-faint); }
.wps-warm .wps-set, .wps-warm .wps-cell { background: var(--wps-tint); }
.wps-ex tr:first-child > .wps-set, .wps-ex tr:first-child > .wps-cell { border-top: 0; }
.wps-hint { margin-top: .9em !important; font-size: .95em; color: var(--wps-dim); }
.wps-foot { position: absolute; left: 0; right: 0; bottom: -3.45em; display: flex; justify-content: flex-end; gap: 2em; font-size: 1.15em; font-weight: 600; line-height: 1; letter-spacing: .06em; color: var(--wps-dim); }
.wps-foot-site { display: none; } /* the sheet layout prints the site's line itself */
