/* Train, You and workouts share one quiet, tungsten-accented app shell. */
:root { --workout-inset: 24px; }
.connection:not(.offline) { display: none; }
.topbar { border-bottom-color: transparent; }
.text-button { min-height: 44px; padding: 10px 0; border: 0; background: transparent; color: var(--orange); font-size: 13px; font-weight: 550; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.loading-copy { padding: 32px 0; color: var(--muted); }
#train-content { max-width: 920px; margin: auto; }
.train-section { margin-top: 30px; }
.train-section .section-heading { margin: 0 0 14px; }
.train-section .section-heading > button { min-height: 44px; padding: 8px 0 8px 12px; color: var(--orange); border: 0; background: transparent; font-size: 13px; }
.duration-picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.duration-option { flex: 1; min-width: 42px; min-height: 46px; display: flex; align-items: baseline; justify-content: center; gap: 3px; border: 1px solid #34363a; border-radius: 12px; background: #151619; color: #c0c2c8; font-size: 14px; font-weight: 550; padding: 11px 7px; font-variant-numeric: tabular-nums; }
.duration-option small { font-size: 9px; font-weight: 450; }
.duration-option[aria-pressed=true], .duration-option.active { background: var(--orange); color: #251a0c; border-color: var(--orange); }
.workout-list { display: grid; gap: 10px; }
.workout-row { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 98px; padding: 17px 18px; text-align: left; border: 1px solid #292b2f; border-radius: 17px; background: #151619; }
.workout-row:hover { background: #1b1d21; border-color: #59482f; }
.workout-length { display: flex; flex-direction: column; justify-content: center; flex-shrink: 0; align-items: center; width: 54px; height: 60px; color: #edc68d; border-right: 1px solid #383126; padding-right: 15px; font-family: var(--ff-font-heading); font-size: 32px; line-height: 1.1; }
.workout-length small { font-family: var(--ff-font-body); font-size: 9px; line-height: 1.5; text-transform: uppercase; letter-spacing: .08em; }
.workout-copy { flex: 1; min-width: 0; }
.workout-copy h3 { font-size: 16px; line-height: 1.25; margin: 0 0 5px; }
.workout-copy p, .workout-copy small { display: block; color: #9d9fa8; font-size: 11px; line-height: 1.5; }
.workout-arrow { color: var(--orange); font-size: 20px; flex-shrink: 0; }
.library-shortcut { margin-top: 28px; }
.you-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 28px; gap: 20px; }
.you-heading h1 { font-size: clamp(36px,5vw,56px); line-height: 1.08; }
.you-mark { width: 64px; height: 64px; border: 1px solid #5a4529; border-radius: 50%; display: grid; place-items: center; color: var(--orange); }
.you-mark .icon { width: 29px; height: 29px; }
#you-view { max-width: 720px; margin: auto; }
#you-view .week-summary { background: #191816; border-color: #36312a; }
.you-links { border-top: 1px solid #2a2c30; }
.you-links > a, .you-links > button { display: flex; align-items: center; gap: 15px; min-height: 74px; width: 100%; text-align: left; padding: 15px 3px; background: transparent; border: 0; border-bottom: 1px solid #2a2c30; font-size: 15px; }
.you-links .icon { color: #b4a187; width: 21px; }
.you-links > :is(a,button) > span:nth-child(2) { flex: 1; }
.you-links > :is(a,button) > span:last-child { color: #85868e; }
.gym-card { position: relative; display: block; padding: 24px; margin-top: 32px; border: 1px solid #373128; border-radius: 18px; background: #191816; }
.gym-card .eyebrow { font-size: 9px; color: #bea583; }
.gym-card h2 { font-family: var(--ff-font-heading); font-size: 28px; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; }
.gym-card h2 span { float: right; color: var(--orange); font-family: var(--ff-font-body); font-weight: 400; }
.gym-card > p:last-child { font-size: 12px; color: var(--muted); margin-top: 14px; }
.you-footnote { margin: 24px 0 6px; color: #888a93; font-size: 11px; line-height: 1.8; }
.you-footnote b { font-weight: 400; }
/* Full-screen workout layers keep the footage and controls in separate rows. */
.workout-overview, .workout-builder, .workout-complete { width: min(620px,calc(100% - 40px)); height: min(960px,calc(100dvh - 40px)); max-height: none; overflow: hidden; }
:is(.workout-overview,.workout-builder,.workout-complete)[open] { display: flex; flex-direction: column; }
:is(.workout-overview,.workout-builder,.workout-complete) .dialog-header { background: var(--bg); border-color: #24262a; }
.overview-scroll, .builder-scroll, .complete-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 28px var(--workout-inset); }
.overview-title { font-family: var(--ff-font-heading); text-transform: uppercase; font-size: 46px; line-height: 1.08; letter-spacing: .01em; margin-bottom: 18px; }
.overview-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: #c6b69d; font-size: 12px; margin: 16px 0 24px; }
.overview-scroll > p { color: #aeb0b8; font-size: 13px; line-height: 1.75; margin: 12px 0; }
.overview-scroll > h3 { margin: 26px 0 12px; }
.overview-scroll label { display: block; color: #b6b8c0; font-size: 12px; margin: 20px 0; }
.overview-scroll select { display: block; width: 100%; margin-top: 7px; }
.overview-scroll select, .builder-scroll input, .builder-scroll select, .workout-small-sheet :is(input,select) { min-height: 48px; font-size: 16px; background: #1b1d21; border: 1px solid #383a40; border-radius: 10px; padding: 10px 12px; color: #f4f4f5; min-width: 0; }
.overview-block { margin: 24px 0; }
.overview-block > h3 { margin-bottom: 4px; }
.overview-block > p, .overview-block > small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 12px; line-height: 1.65; }
.overview-drill { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #292b30; }
.overview-drill img { width: 42px; height: 72px; object-fit: contain; border-radius: 6px; background: #16171a; }
.overview-drill > div { flex: 1; min-width: 0; }
.overview-drill h4, .overview-drill strong { display: block; font-size: 14px; margin: 0 0 4px; line-height: 1.4; }
.overview-drill p, .overview-drill small { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; }
.overview-actions { padding: 14px var(--workout-inset) max(16px,env(safe-area-inset-bottom, 0px)); border-top: 1px solid #2a2c30; background: #111214; flex-shrink: 0; }
.overview-actions .button { width: 100%; min-height: 54px; }
.workout-player { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; max-height: none; max-width: none; margin: 0; border: 0; border-radius: 0; overflow: hidden; background: #0a0b0c; isolation: isolate; }
.workout-player[open] { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto auto; }
#workout-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(32px) brightness(.14); pointer-events: none; z-index: -1; }
#workout-backdrop:not([src]) { display: none; }
.workout-top { display: flex; align-items: center; gap: 14px; padding: max(10px,env(safe-area-inset-top, 0px)) max(16px,env(safe-area-inset-right, 0px)) 8px max(16px,env(safe-area-inset-left, 0px)); }
.workout-top > div { flex: 1; min-width: 0; }
#workout-running-name { display: block; font-size: 12px; color: #dedfe2; line-height: 1.4; }
#workout-round { font-size: 10px; color: #9e9fa7; margin-top: 3px; }
#workout-pause { border-radius: 28px; min-height: 44px; padding: 10px 15px; font-size: 12px; }
.workout-footage { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; overflow: hidden; }
#workout-video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
#workout-video-message { position: absolute; inset: auto 20px 14px; background: #15171be8; border: 1px solid #41434a; border-radius: 12px; padding: 12px; font-size: 12px; color: #dedfe3; text-align: center; }
.workout-timing { display: flex; align-items: center; gap: 18px; width: 100%; max-width: 720px; margin: 0 auto; padding: 16px max(24px,env(safe-area-inset-right, 0px)) 10px max(24px,env(safe-area-inset-left, 0px)); }
.countdown-ring { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 112px; height: 112px; }
.countdown-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.countdown-ring circle { fill: none; stroke: #ffffff13; stroke-width: 3; }
#workout-ring-progress { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 339.292; stroke-dashoffset: 0; }
.countdown-ring > div { text-align: center; z-index: 1; }
#workout-phase { display: block; color: #c5ad8b; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
#workout-clock { display: block; font-family: var(--ff-font-heading); font-size: 36px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.25; }
#workout-reps-label { display: block; color: #aeb0b8; font-size: 9px; }
.workout-current { min-width: 0; }
#workout-block { color: #b4a188; font-size: 10px; line-height: 1.5; margin-bottom: 5px; }
#workout-current-name { font-family: var(--ff-font-heading); font-size: clamp(21px,3vw,31px); text-transform: uppercase; line-height: 1.13; letter-spacing: .01em; overflow-wrap: anywhere; }
#workout-notes { font-size: 11px; padding: 7px 0; }
.workout-bottom { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 max(20px,env(safe-area-inset-right, 0px)) max(12px,env(safe-area-inset-bottom, 0px)) max(20px,env(safe-area-inset-left, 0px)); }
.workout-next { display: flex; align-items: center; gap: 10px; min-height: 47px; margin: 5px 0 12px; }
#workout-next-poster { width: 23px; height: 40px; border-radius: 4px; object-fit: contain; background: #191b1f; }
.workout-next > div { flex: 1; min-width: 0; }
.workout-next small { display: block; color: #858792; font-size: 8px; letter-spacing: .1em; margin-bottom: 2px; }
#workout-next-name { display: block; color: #babcc4; font-size: 10px; line-height: 1.4; }
.workout-progress-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
#workout-progress-label { color: #d4d5db; }
#workout-total-remaining { color: #c5ad8b; flex-shrink: 0; }
#workout-progress { display: block; width: 100%; height: 3px; border: 0; border-radius: 5px; overflow: hidden; background: #32343b; accent-color: var(--orange); }
#workout-progress::-webkit-progress-bar { background: #32343b; }
#workout-progress::-webkit-progress-value { background: var(--orange); }
#workout-progress::-moz-progress-bar { background: var(--orange); }
.workout-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.workout-controls .button { min-height: 44px; font-size: 12px; padding: 10px 14px; border-color: #ffffff15; background: #ffffff08; }
.music-level-toggle { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px; color: #c1b49d; background: transparent; border: 0; font-size: 10px; }
#workout-visualiser { width: 24px; height: 20px; }
.workout-pause-cover { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: max(24px,env(safe-area-inset-top, 0px)) 28px max(24px,env(safe-area-inset-bottom, 0px)); overflow-y: auto; background: #0d0e11e8; backdrop-filter: blur(15px); }
.workout-pause-cover > div { width: min(330px,100%); margin: auto; text-align: center; }
.workout-pause-cover h2 { font-family: var(--ff-font-heading); font-size: 62px; letter-spacing: .01em; line-height: 1.1; }
.workout-pause-cover h2 span { color: var(--orange); }
#workout-pause-reason { color: #b0b2bb; font-size: 13px; line-height: 1.7; margin: 15px 0 26px; }
.workout-pause-cover .button { width: 100%; margin-bottom: 10px; }
.workout-pause-cover .text-button { margin-top: 5px; }
.workout-small-sheet { position: fixed; inset: auto 0 0; margin: auto auto 0; width: min(620px,100%); max-width: none; max-height: 86dvh; border-radius: 24px 24px 0 0; border-bottom: 0; background: #15171b; padding-bottom: max(18px,env(safe-area-inset-bottom, 0px)); }
.workout-small-sheet .dialog-header { position: sticky; top: 0; background: #15171b; padding-top: 10px; min-height: 68px; }
.workout-small-sheet .dialog-header h2 { flex: 1; }
#workout-sheet-content { padding: 20px 24px; font-size: 14px; color: #c4c6ce; line-height: 1.8; }
#workout-sheet-content label { display: block; margin-bottom: 18px; }
#workout-sheet-content select { display: block; width: 100%; margin-top: 8px; }
#workout-sheet-content input[type=range] { width: 100%; min-height: 44px; padding: 0; accent-color: var(--orange); }
/* Builder rows offer buttons as well as any pointer gestures. */
.builder-name-label { display: block; font-size: 11px; color: var(--muted); letter-spacing: .03em; }
#builder-name { display: block; width: 100%; margin-top: 8px; font-size: 20px; min-height: 56px; font-weight: 550; }
#builder-duration { color: #cab18c; font-size: 12px; line-height: 1.6; margin: 0 0 26px; }
.builder-block { padding: 18px; background: #14161a; border: 1px solid #303238; border-radius: 18px; margin-bottom: 18px; }
.builder-block > header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.builder-block > header input { flex: 1; width: 100%; }
.builder-block label { display: block; font-size: 10px; color: #a5a8b1; }
.builder-block label :is(input,select) { display: block; width: 100%; margin-top: 6px; }
.builder-block .form-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.builder-block .builder-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 10px; margin: 12px 0 18px; }
.builder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #2d3036; }
.builder-row > img { width: 29px; height: 50px; object-fit: contain; border-radius: 4px; }
.builder-row > span, .builder-row > div:first-of-type { flex: 1; min-width: 0; font-size: 12px; line-height: 1.5; }
.builder-row-controls { display: flex; gap: 3px; margin-left: auto; }
.builder-row-controls button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #33363e; border-radius: 10px; background: #1d2025; padding: 5px; font-size: 13px; }
.builder-add { width: 100%; min-height: 46px; margin-top: 12px; border: 1px dashed #524431; border-radius: 10px; background: transparent; color: #dfbd8b; font-size: 12px; }
.builder-summary { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 12px; }
#builder-add-block { width: 100%; border-color: #4c402f; background: #211e19; color: #e7c18b; }
#builder-status, #backup-status { color: #f0c58c; font-size: 12px; line-height: 1.6; margin-top: 14px; }
#builder-search { display: block; width: calc(100% - 40px); margin: 14px 20px; }
#builder-drills { padding: 0 20px; }
.picker-drill { display: flex; width: 100%; align-items: center; text-align: left; gap: 13px; min-height: 76px; border: 0; border-bottom: 1px solid #303239; padding: 8px 0; background: transparent; font-size: 13px; }
.picker-drill img { width: 32px; height: 57px; object-fit: contain; border-radius: 5px; }
.picker-drill span { flex: 1; }
/* The result screen echoes the ring and oversized type of Train. */
.complete-scroll { padding-top: 40px; padding-bottom: max(30px,env(safe-area-inset-bottom, 0px)); }
#complete-title { font-family: var(--ff-font-heading); font-size: clamp(48px,10vw,76px); line-height: 1.02; letter-spacing: .01em; }
.complete-stats { display: flex; align-items: center; gap: 32px; margin: 32px 0 22px; padding: 24px 0; border-top: 1px solid #3e3324; border-bottom: 1px solid #3e3324; }
.complete-stats > div { display: flex; flex-direction: column; }
.complete-stats b { font-family: var(--ff-font-heading); font-size: 46px; line-height: 1.1; color: var(--orange); font-weight: 500; font-variant-numeric: tabular-nums; }
.complete-stats span { font-size: 11px; color: #ac9f8c; margin-top: 7px; }
#complete-name { font-size: 20px; font-weight: 550; }
#complete-status { font-size: 12px; line-height: 1.7; color: #aaadb7; margin: 10px 0 26px; }
.complete-scroll > .button { display: flex; width: 100%; margin-top: 10px; }
#share-card-preview { display: block; width: min(220px,65%); height: auto; margin: 24px auto; border: 1px solid #51402a; border-radius: 15px; }
.import-label { margin-top: 8px; cursor: pointer; }
#notes-sheet .detail-actions { flex-wrap: wrap; gap: 8px; }
#notes-sheet .detail-actions #save-drill { flex: 1; min-width: 74px; }
#notes-sheet .detail-actions #add-to-workout { flex: 2; width: auto; padding-inline: 10px; }
#notes-sheet .detail-actions #show-log { flex: 0 0 100%; }
.detail-screen[data-mode=log] #add-to-workout { display: none; }
/* One stationary cold-start mark, with a ring and sweep over about 1.6 seconds. */
#launch-reveal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #0b0c0e; pointer-events: auto; overflow: hidden; animation: launch-away 250ms ease-out 1300ms both; }
.launch-mark { position: absolute; left: var(--launch-center-x, 50%); top: var(--launch-center-y, 50%); transform: translate(-50%, -50%); width: 170px; height: 110px; display: grid; place-items: center; }
.launch-mark > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-8deg); }
.launch-mark ellipse { stroke: var(--orange); fill: none; stroke-width: 2; stroke-dasharray: 680; stroke-dashoffset: 680; animation: ring-draw 950ms cubic-bezier(.25,.5,.5,1) both; }
.launch-mark > img { width: 128px; height: 76px; object-fit: contain; }
.launch-sweep { position: absolute; top: -30%; height: 160%; width: 18%; background: linear-gradient(90deg,transparent,#f5ad4218,transparent); transform: skewX(-20deg) translateX(-600%); animation: tungsten-pass 1250ms ease-in-out both; pointer-events: none; }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
@keyframes tungsten-pass { to { transform: skewX(-20deg) translateX(600%); } }
@keyframes launch-away { to { opacity: 0; visibility: hidden; } }
@media (min-width: 901px) {
  body[data-view=home] main { padding-top: 35px; }

  .workout-timing { padding-top: 16px; }
}
@media (max-width: 900px) {
  :root { --workout-inset: 22px; }
  .sidebar nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .sidebar { border-color: #26282c; }
  .sidebar nav a { min-height: 53px; }
  .duration-picker { gap: 6px; }
  .duration-option { min-width: 0; }
  .workout-row { padding: 15px; gap: 13px; }
  .train-section { margin-top: 27px; }
  .workout-overview, .workout-builder, .workout-complete { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
  .overview-title { font-size: 40px; }
  .workout-small-sheet .dialog-header { padding-top: 10px; min-height: 68px; }
  #workout-player .workout-small-sheet { max-height: 85dvh; }
}
@media (max-width: 359px) {
  :root { --workout-inset: 18px; }
  .duration-picker { gap: 4px; }
  .duration-option { padding-inline: 4px; font-size: 12px; }
  .duration-option small { font-size: 8px; }
  .you-mark { width: 50px; height: 50px; }
  .workout-timing { padding: 10px 16px 4px; gap: 13px; }
  .countdown-ring { width: 92px; height: 92px; }
  #workout-clock { font-size: 30px; }
  #workout-current-name { font-size: 20px; }
  .workout-top { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .workout-top .icon-button { width: 44px; height: 44px; }
  .workout-bottom { padding-left: 16px; padding-right: 16px; }
  .workout-next { margin-bottom: 8px; }
  .workout-controls { margin-top: 5px; }
  .builder-block { padding: 13px; }
  .builder-row-controls { gap: 2px; }
  .complete-scroll { padding-top: 28px; }
}
@media (max-height: 680px) and (orientation: portrait) {
  .workout-timing { padding-top: 9px; padding-bottom: 3px; }
  .countdown-ring { width: 90px; height: 90px; }
  #workout-clock { font-size: 29px; }
  .workout-next { min-height: 34px; margin-bottom: 7px; }
  #workout-next-poster { width: 19px; height: 33px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .workout-player[open] { grid-template-columns: minmax(0,1fr) minmax(285px,43%); grid-template-rows: auto minmax(0,1fr) auto; }
  .workout-top { grid-column: 1/-1; }
  .workout-footage { grid-column: 1; grid-row: 2 / 4; padding-bottom: max(10px,env(safe-area-inset-bottom, 0px)); }
  .workout-timing { grid-column: 2; grid-row: 2; padding: 5px 20px 0 12px; gap: 13px; }
  .countdown-ring { width: 92px; height: 92px; }
  #workout-clock { font-size: 30px; }
  #workout-current-name { font-size: 21px; }
  .workout-bottom { grid-column: 2; grid-row: 3; padding-left: 12px; }
  .workout-next { margin-top: 0; margin-bottom: 6px; min-height: 33px; }
  #workout-next-poster { height: 33px; width: 19px; }
  .workout-controls { margin-top: 5px; }
  .workout-pause-cover { padding: 18px; }
  .workout-pause-cover h2 { font-size: 38px; }
  #workout-pause-reason { margin: 8px 0 12px; }
  .workout-pause-cover .button { min-height: 44px; margin-bottom: 7px; }
  .workout-small-sheet { max-height: 95dvh; }
}
@media (prefers-reduced-motion: no-preference) {
  .workout-row, .duration-option { transition: background 140ms ease, border-color 140ms ease; }
  :is(.workout-overview,.workout-builder,.workout-complete)[open] { animation: screen-in 180ms ease-out; }
  .workout-small-sheet[open] { animation: sheet-in 180ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  #launch-reveal { display: none !important; }
  .launch-mark > svg, .launch-mark ellipse, .launch-mark > img, .launch-sweep { animation: none; }
}
/* Contracts shared with the DOM renderers. */
.workout-copy strong { display: block; font-size: 15px; line-height: 1.3; margin-bottom: 5px; font-weight: 600; }
.train-section .section-heading > span { color: #91949e; font-size: 10px; max-width: 135px; text-align: right; line-height: 1.5; }
.overview-preferences { border-top: 1px solid #303239; padding-top: 6px; margin-top: 28px; }
.overview-preferences .preview-preference { display: flex; margin: 13px 0; }
.overview-preferences .preview-preference input { min-height: 0; }
.overview-preferences > p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.builder-preparation { display: flex; align-items: center; gap: 20px; color: #a5a8b1; font-size: 11px; margin: 18px 0; }
.builder-preparation input { width: 85px; margin-left: auto; }
.builder-block-heading { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.builder-block-name { flex: 1 0 100%; }
.builder-block-defaults { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 10px; margin-bottom: 20px; }
.builder-row > h3 { flex: 1 0 100%; font-size: 13px; margin-top: 4px; line-height: 1.5; }
.builder-row-controls .text-button { width: auto; padding-inline: 10px; color: #bd9c79; font-size: 10px; }
.builder-row-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 10px; flex: 1 0 100%; width: 100%; }
.builder-rest-note { color: #90949e; font-size: 10px; line-height: 1.6; align-self: center; }
.picker-drill strong { display: block; font-size: 12px; font-weight: 550; line-height: 1.5; }
.picker-drill small { display: block; color: #90949e; font-size: 10px; margin-top: 4px; }
.picker-drill .picker-plus { flex: 0; font-size: 22px; color: var(--orange); }
.builder-timing-details { flex: 1 0 100%; width: 100%; }
.builder-timing-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 46px; color: #c9b598; font-size: 11px; list-style: none; cursor: pointer; }
.builder-timing-details > summary::-webkit-details-marker { display: none; }
.builder-timing-details > summary::after { content: '+'; font-size: 19px; color: #a89a85; padding-left: 12px; }
.builder-timing-details[open] > summary::after { content: '−'; }
.builder-timing-details .builder-block-defaults, .builder-timing-details .builder-row-fields { padding-top: 9px; }
.complete-scroll { display: flex; flex-direction: column; }
.complete-scroll > * { flex-shrink: 0; }
#share-card-preview { order: 2; }
@media (max-width: 359px) {
  .builder-row-controls .text-button { padding-inline: 7px; }
  .builder-preparation { font-size: 10px; gap: 14px; }
  #builder-targets .duration-option { font-size: 11px; padding: 11px 3px; white-space: nowrap; }
}
:is(.overview-scroll,.builder-scroll,.workout-small-sheet) select { -webkit-appearance: none; appearance: none; height: 48px; padding-right: 30px; background-image: linear-gradient(45deg,transparent 50%,#ada99f 50%),linear-gradient(135deg,#ada99f 50%,transparent 50%); background-position: calc(100% - 17px) 21px,calc(100% - 12px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.builder-scroll input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.builder-scroll input[type=number]::-webkit-inner-spin-button, .builder-scroll input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.app-update { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; margin-bottom:18px; border:1px solid #695031; border-radius:14px; background:#211c15; font-size:13px; }
.app-update .button { flex-shrink:0; font-size:12px; }
#app-version { font-variant-numeric:tabular-nums; }

.unfinished-workout { margin:24px 0; padding:16px; border:1px solid #695031; border-radius:14px; background:#211c15; font-size:13px; line-height:1.6; }
.unfinished-workout p { color:var(--muted); margin:8px 0 0; }
.workout-length { min-width:62px; width:auto; }

.builder-target-label { margin: 22px 0 0; color: #b8bbc4; font-size: 12px; }
.builder-target-label + .duration-picker { margin-top: 10px; }
.builder-draft-notice { margin: 12px 0; padding: 12px 14px; border-left: 2px solid #ab8754; border-radius: 0 8px 8px 0; background: #211e19; color: #d1b58e; font-size: 12px; line-height: 1.6; }
#notes-drill-name { margin: 12px 0 14px; color: #c8cbd2; font-size: 16px; font-weight: 550; line-height: 1.45; }
#workout-current-name .drill-name-detail { display: block; margin-top: 6px; color: #b6b9c2; font-family: var(--ff-font-body); font-size: 12px; font-weight: 400; line-height: 1.4; text-transform: none; letter-spacing: 0; }

.workout-prescription { margin: 7px 0 0; color: #e8bd7e; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#workout-clock[data-rep-range] { font-size: clamp(29px, 6vw, 42px); letter-spacing: -.04em; }
#workout-video-message { max-height: 100%; max-width: 520px; overflow: auto; padding: 24px; font-size: 15px; line-height: 1.65; color: #d0d2d8; white-space: pre-line; }
.coach-review { margin: 22px 0; padding: 18px; border: 1px solid #76542d; border-radius: 14px; background: #241d15; font-size: 13px; line-height: 1.6; }
.coach-review h2 { font-size: 16px; color: #efc384; margin: 0 0 8px; }
.coach-review p { margin: 0; }
.coach-review ul { padding-left: 20px; margin: 12px 0 0; }
.coach-review li + li { margin-top: 8px; }
.workout-footage[data-illustrated] { grid-template-rows: minmax(0,1fr) auto; padding: 12px 16px 8px; }
.workout-illustration { display: block; width: 100%; height: 100%; min-height: 0; max-width: 660px; object-fit: contain; }
.workout-footage[data-illustrated] #workout-video-message { position: static; margin: 8px auto 0; max-width: 460px; max-height: none; padding: 8px 12px; font-size: 12px; line-height: 1.45; }

/* Train is a focused catalogue, with a single programme week on each screen. */
#train-content { max-width: 680px; }
.train-tabs { display: flex; padding: 4px; gap: 3px; border: 1px solid #303238; background: #111215; border-radius: 15px; }
.train-tabs button { flex: 1; min-width: 0; min-height: 44px; padding: 8px 4px; border: 0; border-radius: 11px; background: transparent; color: #a3a6af; font-size: 12px; font-weight: 600; }
.train-tabs button[aria-selected=true] { background: #34312b; color: #f5d4a4; box-shadow: inset 0 0 0 1px #5b4b35; }
.train-panel { margin-top: 25px; }
.train-panel .section-heading { min-height: 36px; margin-bottom: 12px; }
.train-panel .section-heading h2 { font-family: var(--ff-font-body); font-size: 17px; text-transform: none; letter-spacing: -.02em; }
.programme-list { display: grid; gap: 12px; }
.programme-card { display: flex; align-items: center; gap: 17px; width: 100%; min-height: 125px; padding: 0 17px 0 0; border: 1px solid #33353b; border-radius: 19px; overflow: hidden; text-align: left; background: linear-gradient(110deg,#242322,#18191d); }
.programme-cover { width: 83px; height: 125px; object-fit: contain; flex-shrink: 0; background: #0e0f11; }
.programme-copy { flex: 1; min-width: 0; padding: 14px 0; }
.programme-copy strong { display: block; font-family: var(--ff-font-heading); font-weight: 500; font-size: 24px; line-height: 1.2; text-transform: uppercase; }
.programme-copy small { display: block; color: #a9abb2; font-size: 11px; margin-top: 10px; }
.train-chevron { color: #d3ad78; font-size: 25px; flex-shrink: 0; font-family: var(--ff-font-body); font-weight: 400; }
.train-hint { margin: 15px 0 0; color: #9598a2; font-size: 12px; }
.train-library { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin-top: 22px; border-top: 1px solid #303238; color: #b8bac3; font-size: 13px; }
.train-continue { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 14px 4px; border: 0; border-bottom: 1px solid #303238; background: transparent; text-align: left; }
.train-continue > span:nth-child(2) { flex: 1; min-width: 0; }
.train-continue small { display: block; color: #d3ad78; font-size: 9px; letter-spacing: .1em; margin-bottom: 4px; }
.train-continue strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-symbol { display: grid; place-items: center; color: #d3ad78; width: 34px; height: 34px; border: 1px solid #55462f; border-radius: 50%; font-size: 22px; }
.train-panel .workout-row { min-height: 85px; padding: 13px; gap: 13px; border-radius: 15px; }
.train-panel .workout-length { width: 48px; height: 48px; padding-right: 10px; font-size: 27px; }
.train-panel .workout-copy strong { font-size: 14px; }
.train-empty { padding: 24px 16px; text-align: center; border: 1px dashed #42403c; border-radius: 18px; }
.empty-ring { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 18px; border-radius: 50%; border: 1px solid #8c6a3c; color: #d3ad78; font-size: 27px; }
.train-empty h3 { font-size: 17px; }
.train-empty p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 10px 0 20px; }
.train-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px 0 0; margin-top: -12px; border: 0; background: transparent; color: #d3ad78; font-size: 13px; }
.programme-title { font-family: var(--ff-font-heading); font-weight: 500; text-transform: uppercase; font-size: clamp(28px,6vw,36px); line-height: 1.12; margin: 12px 0 8px; }
.programme-meta { font-size: 12px; color: #a3a6af; margin: 0 0 24px; }
.programme-schedule { margin-top: 16px; }
.programme-day { display: flex; gap: 14px; align-items: stretch; border-bottom: 1px solid #2c2e34; }
.programme-day > h3 { width: 32px; flex-shrink: 0; align-self: flex-start; margin: 22px 0 18px; color: #9699a3; font-size: 9px; line-height: 1.3; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.programme-day > h3 span { display: block; font-family: var(--ff-font-heading); font-size: 23px; color: #ccb18b; letter-spacing: 0; margin-top: 3px; }
.programme-day-items { flex: 1; min-width: 0; }
.programme-workout { display: flex; align-items: center; gap: 10px; min-height: 91px; padding: 17px 2px; width: 100%; border: 0; background: transparent; text-align: left; }
.programme-workout > span:first-child { flex: 1; min-width: 0; }
.programme-workout strong { display: block; font-size: 14px; line-height: 1.45; font-weight: 550; }
.programme-workout small { display: block; margin-top: 5px; font-size: 10px; color: #a3a6af; }
.programme-workout .programme-workout-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; font-size: 11px; line-height: 1.5; }
.programme-workout-duration { color: #d3b58d; font-variant-numeric: tabular-nums; white-space: nowrap; }
.programme-unavailable { opacity: .65; }
.rest-day { display: flex; align-items: center; height: 100%; min-height: 91px; margin: 0; color: #9396a0; font-size: 13px; }
#train-content button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
#train-screen-title:focus { outline: none; }
@media (hover: hover) { .programme-card:hover { border-color: #8c6a3c; } .programme-workout:hover { background: #1b1c20; } }
@media (max-width: 359px) { .programme-card { gap: 12px; min-height: 112px; padding-right: 12px; } .programme-cover { width: 74px; height: 112px; } .programme-copy strong { font-size: 21px; } .programme-copy small { font-size: 10px; } .train-panel { margin-top: 18px; } }

.programme-day-rest > h3 { margin-block: 10px; }
.programme-day-rest .rest-day { min-height: 60px; }

/* Music is available directly while training, without opening or pausing a sheet. */
.workout-music-dock { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px; border: 1px solid #38332b; border-radius: 13px; background: #211e1980; }
.workout-music-dock .music-level-toggle { flex-shrink: 0; justify-content: center; gap: 4px; min-width: 62px; padding: 6px; border-radius: 9px; }
.workout-music-dock .music-level-toggle[aria-pressed=true] { background: #483922; color: #f2cc94; }
#workout-music-track { flex: 1; width: 0; min-width: 0; min-height: 44px; border: 0; background-color: transparent; padding: 8px 20px 8px 4px; font-size: 12px; text-overflow: ellipsis; }
#workout-music-next { flex-shrink: 0; width: 44px; height: 44px; font-size: 18px; color: #e3be89; }
.workout-volume { display: flex; flex: 1; min-width: 0; align-items: center; gap: 7px; color: #a4a6af; font-size: 10px; }
#workout-music-level { width: 0; min-width: 0; flex: 1; min-height: 44px; padding: 0; accent-color: var(--orange); }
.workout-music-status { color: #e3be89; font-size: 11px; margin: 5px 0 0; }
@media (max-height: 500px) and (orientation: landscape) { .workout-music-dock { margin-top: 6px; } .workout-next { display: none; } }

#workout-pause { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
#workout-player[data-paused] #workout-pause { background: #d9af72; color: #21180e; }

#workout-music-track { appearance: none; -webkit-appearance: none; height: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M2 2l4 4 4-4' fill='none' stroke='%23c5ad8b' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; }

.workout-top, .workout-timing, .workout-bottom { min-width: 0; }
#workout-music-level { appearance: none; -webkit-appearance: none; background: transparent; }
#workout-music-level::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #69655e; }
#workout-music-level::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 0; border-radius: 50%; background: #e6bb7e; }
#workout-music-level::-moz-range-track { height: 4px; border-radius: 4px; background: #69655e; }
#workout-music-level::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #e6bb7e; }

/* Full-screen workout: the demonstration owns the space between two quiet edges. */
#workout-player { background: #090a0b; color: #f4f1ec; padding: 0; }
#workout-player[open] { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto auto; }
#workout-backdrop { display: none; }
#workout-player .workout-top { position: relative; grid-column: 1; grid-row: 1; gap: 10px; padding: max(8px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left)); background: #0d0e0f; }
#workout-player .workout-top-copy { min-width: 0; }
#workout-player .workout-top-copy > strong { display: block; font-family: var(--ff-font-heading); font-size: clamp(14px,4.1vw,18px); font-weight: 500; letter-spacing: .055em; }
#workout-player #workout-running-name { font-size: 11px; line-height: 1.5; color: #b7b8b9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#workout-player #end-workout { flex-shrink: 0; font-size: 30px; width: 44px; height: 44px; border: 0; background: transparent; }
#workout-player .workout-overall { flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; }
#workout-player .workout-overall small { display: block; color: #b7b8b9; font-size: 10px; }
#workout-player #workout-elapsed { display: block; font-size: 21px; font-weight: 550; margin-top: 2px; }
#workout-player #workout-total-remaining { display: block; font-size: 10px; color: #c5ad8b; margin-top: 2px; }
#workout-player .workout-footage { grid-column: 1; grid-row: 2; padding: 0; }
#workout-player #workout-video { width: 100%; height: 100%; object-fit: contain; }
#workout-player .workout-timing { grid-column: 1; grid-row: 3; justify-content: space-between; align-items: flex-end; gap: 15px; max-width: 720px; padding: 12px max(24px,env(safe-area-inset-right)) 10px max(24px,env(safe-area-inset-left)); }
#workout-player .workout-current { flex: 1; min-width: 0; }
#workout-player .workout-set-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 6px; }
#workout-player #workout-phase { color: #e0b47a; font-size: 10px; line-height: 1.5; letter-spacing: .1em; }
#workout-player #workout-round { margin: 0; color: #c7af8c; font-size: 10px; line-height: 1.5; }
#workout-player #workout-block { display: none; }
#workout-player[data-phase=rest] #workout-block { display: block; font-size: 10px; color: #b7b8b9; margin-bottom: 4px; }
#workout-player #workout-current-name { font-size: clamp(23px,6.5vw,30px); line-height: 1.08; font-weight: 500; }
#workout-player #workout-current-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
#workout-player #workout-current-name .drill-name-detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; margin-top: 5px; font: 400 11px/1.4 var(--ff-font-body); color: #b7b8b9; text-transform: none; }
#workout-player .workout-prescription { margin: 5px 0 0; font-size: 11px; line-height: 1.4; color: #c4b398; -webkit-line-clamp: 1; }
#workout-player .workout-countdown { flex-shrink: 0; text-align: right; }
#workout-player #workout-clock { font-size: clamp(40px,11vw,52px); line-height: 1; letter-spacing: -.03em; }
#workout-player #workout-reps-label { font-size: 10px; line-height: 1.5; color: #b7b8b9; white-space: nowrap; margin-top: 4px; }
#workout-player .workout-bottom { grid-column: 1; grid-row: 4; padding: 0 max(24px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left)); }
#workout-interval-progress { display: block; width: 100%; height: 3px; border: 0; border-radius: 3px; overflow: hidden; background: #303234; accent-color: #e0b47a; }
#workout-interval-progress::-webkit-progress-bar { background: #303234; }
#workout-interval-progress::-webkit-progress-value { background: #e0b47a; }
#workout-interval-progress::-moz-progress-bar { background: #e0b47a; }
#workout-player .workout-progress-summary { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#workout-player .workout-controls { display: grid; grid-template-columns: minmax(0,1fr) 54px minmax(0,1fr); gap: 16px; align-items: center; margin-top: 9px; }
#workout-player #workout-notes { justify-self: start; min-height: 44px; min-width: 44px; color: #efede8; padding: 8px 0; font-size: 12px; }
#workout-player #workout-pause { display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0; width: 54px; height: 54px; min-height: 54px; background: #e0b47a; color: #21190f; }
.workout-play-icon { display: block; width: 15px; height: 19px; border-left: 5px solid currentColor; border-right: 5px solid currentColor; }
#workout-pause[data-playing=false] .workout-play-icon { width: 0; height: 0; border: 0; border-left: 16px solid currentColor; border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 4px; }
#workout-player .workout-music-button { justify-self: end; display: flex; align-items: center; gap: 5px; border: 0; border-radius: 25px; min-height: 44px; padding: 8px 10px; color: #dbd9d3; background: #232527; font-size: 11px; }
#workout-player .workout-music-button[data-enabled=true] { color: #edc48b; background: #30291f; }
#workout-player #workout-visualiser { width: 19px; height: 19px; }
#workout-player .workout-pause-cover { z-index: 5; }
.workout-interval-actions { display: flex; gap: 9px; }
.workout-interval-actions .button { flex: 1; font-size: 12px; padding-inline: 7px; }
#workout-player .workout-music-sheet { inset: auto 12px max(12px,env(safe-area-inset-bottom)); width: min(380px,calc(100% - 24px)); margin: auto auto 0; border: 1px solid #454440; border-radius: 22px; background: #202224; padding: 0; max-height: calc(100dvh - 24px); }
#workout-player .workout-music-sheet::backdrop { background: #0005; backdrop-filter: none; }
#workout-player .workout-music-sheet .dialog-header { min-height: 58px; padding: 8px 16px 0; background: #202224; border: 0; }
#workout-player .workout-music-sheet .dialog-header h2 { font-family: var(--ff-font-body); font-size: 16px; font-weight: 550; }
.workout-music-panel { padding: 0 18px 16px; }
.workout-music-heading { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #c2c0ba; }
#workout-player #workout-audio { justify-content: center; min-width: 54px; min-height: 44px; border-radius: 24px; background: #303234; font-size: 12px; color: #cfcdc7; }
#workout-player #workout-audio[aria-pressed=true] { background: #493a27; color: #f2cc94; }
.workout-track-row { display: flex; align-items: center; gap: 5px; margin-top: 9px; }
#workout-player #workout-music-track { background-color: #292b2d; border-radius: 10px; padding: 8px 26px 8px 10px; background-position: right 9px center; font-size: 12px; }
#workout-track-credit { color: #b5b4b0; font-size: 11px; margin: 6px 0 10px; }
#workout-player .workout-volume { display: flex; align-items: center; gap: 10px; border-top: 1px solid #414242; font-size: 11px; padding-top: 4px; color: #c9c7c1; }
#workout-player #workout-volume-value { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
#workout-player .workout-footage[data-illustrated] { padding: 10px 20px; }
#workout-player .workout-footage[data-illustrated] #workout-video-message { margin: 6px auto 0; }
@media(max-width:359px) {
  #workout-player .workout-top { gap: 5px; padding-inline: 6px 12px; }
  #workout-player .workout-top-copy > strong { font-size: 13px; }
  #workout-player .workout-overall small { font-size: 9px; }
  #workout-player .workout-timing { padding: 9px 18px 8px; gap: 10px; }
  #workout-player #workout-current-name { font-size: 22px; }
  #workout-player .workout-bottom { padding-inline: 18px; }
}
@media(min-width:901px) {
  #workout-player .workout-top { padding-inline: 28px; }
  #workout-player .workout-top-copy > strong { font-size: 19px; }
  #workout-player #workout-current-name { font-size: 32px; }
}
@media(max-height:500px) and (orientation:landscape) {
  #workout-player[open] { grid-template-columns: minmax(0,1fr) minmax(290px,40%); grid-template-rows: auto minmax(0,1fr) auto; }
  #workout-player .workout-top { grid-column: 1/-1; grid-row: 1; }
  #workout-player .workout-footage { grid-column: 1; grid-row: 2/4; }
  #workout-player .workout-timing { grid-column: 2; grid-row: 2; padding: 10px 22px 15px 12px; }
  #workout-player .workout-bottom { grid-column: 2; grid-row: 3; padding-left: 12px; padding-right: 22px; }
  #workout-player #workout-clock { font-size: 42px; }
  #workout-player #workout-current-name { font-size: 23px; }
  #workout-player .workout-pause-cover { padding: 14px 28px; }
  #workout-player .workout-pause-cover h2 { font-size: 30px; }
  #workout-player #workout-pause-reason { margin: 5px 0 10px; }
}

.workout-link-actions { display: flex; align-items: center; gap: 14px; }
.workout-link-actions > .button { flex: 1; }
#workout-link-fallback { display: block; margin: 12px 0; font-size: 12px; }
#workout-link-url { display: block; width: 100%; margin-top: 8px; min-height: 44px; font-size: 16px; }
