/* Workouts: the session screen, the finish step, the read-out and recent sessions (screens/workout.js).
   Built for a phone in the gym: every control a member touches mid-set is at least 44px, the inputs and the tick
   are 52px, and nothing needs a precise tap. Colours come only from the app.css tokens. */

.wo .topbar { margin-bottom: var(--sp-sm); }
.wo a.btn, .wo-hist a.item { text-decoration: none; }
.wo-hist a.item { color: inherit; }
.wo-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-cancel { margin-left: calc(-1 * var(--sp-sm)); }
.wo-progress { margin: 0 0 var(--sp-md); }
.wo-icon { width: 20px; height: 20px; flex: none; }
.wo-icon.sm { width: 14px; height: 14px; }

/* Rest clock, pinned to the top while it runs */
.wo-rest-slot { position: sticky; top: env(safe-area-inset-top); z-index: 5; }
.wo-rest-slot:empty { display: none; }
.wo-rest { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md); margin-bottom: var(--sp-md); border-radius: var(--r-card); background: color-mix(in srgb, var(--page) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--rule)); box-shadow: 0 8px 24px rgba(0, 0, 0, .10); }
.wo-ring { width: 56px; height: 56px; flex: none; transform: rotate(-90deg); }
.wo-ring circle { fill: none; stroke-width: 5; }
.wo-ring .bg { stroke: var(--rule); }
.wo-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.wo-rest-time { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wo-rest .btn { flex: none; min-height: 44px; }

/* The saving line (SyncBanner): quiet, never red */
.wo-sync { width: 100%; display: flex; gap: var(--sp-sm); align-items: flex-start; text-align: left; padding: var(--sp-sm) var(--sp-md); margin-bottom: var(--sp-md); border-radius: var(--r-control); background: var(--sunken); border: 1px solid var(--rule); color: var(--ink2); font-size: 15px; }
button.wo-sync { cursor: pointer; min-height: 44px; }
.wo-sync .caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Superset and circuit groups */
.wo-group { border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--rule)); padding-left: var(--sp-md); }
.wo-group > .wo-group-head { margin-bottom: var(--sp-md); }

/* One exercise */
.wo-block { padding: var(--sp-lg) var(--sp-md); }
.wo-block > * + * { margin-top: var(--sp-sm); }
.wo-ex-head { display: flex; gap: var(--sp-md); align-items: center; }
.wo-media-btn { padding: 0; border: 0; background: none; border-radius: 12px; flex: none; cursor: pointer; }
.wo-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; object-position: left center; display: grid; place-items: center; background: var(--rule); }
.wo-tile { background: color-mix(in srgb, var(--accent) 14%, var(--sunken)); color: var(--accent); }
.wo-ex-name { display: block; background: none; border: 0; padding: 0; text-align: left; font-size: 18px; font-weight: 600; line-height: 1.25; color: var(--ink); cursor: pointer; }
.wo-info { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--rule); background: var(--page); color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.wo-tags { display: flex; flex-wrap: wrap; gap: var(--sp-xs) var(--sp-sm); align-items: center; }
.wo-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; background: var(--page); border: 1px solid var(--rule); color: var(--ink2); }
.wo-goal { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--accent); font-weight: 500; }
.wo-note { padding: var(--sp-sm) var(--sp-md); border-radius: var(--r-control); background: var(--page); border-left: 3px solid var(--rule); font-size: 15px; color: var(--ink2); white-space: pre-wrap; }
.wo-note.coach { border-left-color: var(--accent); color: var(--ink); }
.wo-carried { font-size: 13px; color: var(--ink3); margin: -2px 0 2px 42px; }

/* Set rows: Set | Previous | inputs | tick */
.wo-sets { margin-top: var(--sp-md); }
.wo-set { display: grid; align-items: center; gap: 6px; padding: 3px 0; }
.wo-set.wo-head { padding: 0 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); }
.wo-set.wo-head > span:nth-child(n+3) { text-align: center; }
.wo-setlabel { min-height: 52px; padding: 0; border: 0; background: none; text-align: left; font-size: 18px; font-weight: 600; color: var(--ink3); cursor: pointer; font-variant-numeric: tabular-nums; }
.wo-setlabel.marked { color: var(--accent); }
.wo-setlabel[disabled] { cursor: default; }
.wo-prev { font-size: 13px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.wo-prev.pinned { color: var(--accent); font-weight: 600; }
.wo-cell { position: relative; display: block; min-width: 0; }
.wo-num { width: 100%; min-height: 52px; padding: 0 24px 0 6px; border-radius: var(--r-control); border: 1px solid var(--rule); background: var(--page); font-size: 20px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.wo-num:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wo-num::placeholder { color: var(--ink3); font-weight: 400; }
.wo-unit { position: absolute; right: 6px; bottom: 7px; font-size: 11px; color: var(--ink3); pointer-events: none; }
.wo-set.done .wo-num { background: color-mix(in srgb, var(--accent) 10%, var(--page)); border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); }
.wo-tick { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink3); background: var(--page); color: var(--ink3); display: grid; place-items: center; cursor: pointer; transition: transform .12s ease; }
.wo-tick:active { transform: scale(.94); }
.wo-tick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wo-tick svg { width: 26px; height: 26px; }
.wo-fail { margin: 0 0 4px 42px; font-size: 14px; }
.wo-fail:empty { display: none; }
.wo-rir { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 6px 42px; }
.wo-rir .caption { margin-right: 2px; }
.wo-pick { min-width: 44px; min-height: 40px; padding: 0 var(--sp-md); border-radius: 999px; border: 1px solid var(--rule); background: var(--page); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.wo-pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wo-addrow { flex-wrap: wrap; margin-top: var(--sp-sm); }
.wo-addrow .btn { min-height: 44px; }

/* Before you start */
.wo-pre .wo-grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wo-pre .wo-grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.wo-pre .wo-pick { min-height: 48px; padding: 0; width: 100%; border-radius: var(--r-control); }
.wo-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-wrap .wo-pick { font-weight: 500; min-height: 44px; }

/* Finish */
.wo-finish-wrap { margin-top: var(--sp-xl); }
.wo-feel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wo-feel .wo-pick { width: 100%; min-height: 52px; padding: 0 4px; border-radius: var(--r-control); font-weight: 500; font-size: 15px; }

/* Read-out */
.wo-hero { text-align: center; padding: var(--sp-lg) 0 var(--sp-sm); }
.wo-hero .eyebrow { letter-spacing: .14em; }
.wo-orn { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--accent); margin-top: var(--sp-lg); }
.wo-orn::before, .wo-orn::after { content: ""; width: 54px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
.wo-orn::after { background: linear-gradient(90deg, var(--accent), transparent); }
.wo-hero-num { font-size: 84px; font-weight: 300; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.wo-hero-label { font-size: 12px; font-weight: 600; letter-spacing: .3em; color: var(--ink2); margin-top: 6px; }
.wo-hero .note { margin-top: var(--sp-md); }
.wo-jump { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-md); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); border: 1px solid color-mix(in srgb, var(--good) 25%, transparent); }
.wo-bar { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.wo-bar > div { height: 100%; background: var(--accent); border-radius: 4px; }
.wo-stats { display: flex; gap: var(--sp-xl); }
.wo-stat .value { font-size: 28px; }
.wo-metric { display: flex; gap: var(--sp-md); align-items: flex-start; padding: var(--sp-sm) 0; border-top: 1px solid var(--rule); }
.wo-metric:first-child { border-top: 0; }
.wo-gain { display: inline-flex; align-items: center; gap: 4px; color: var(--good); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wo-rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-sm); }
.wo-rm { padding: var(--sp-sm); border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.wo-rm > * + * { margin-top: 4px; }
.wo-rm-title { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.wo-rm .wo-gain { font-size: 18px; }
.wo-good-card { display: flex; gap: var(--sp-md); align-items: flex-start; }
.wo-good-card .wo-icon { color: var(--accent); margin-top: 2px; }

/* Exercise detail sheet */
.wo-film { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-card); background: #000; display: block; }
.wo-still { margin: 0; }
.wo-still img { width: 100%; border-radius: var(--r-card); display: block; background: var(--rule); }
.wo-still figcaption { display: flex; justify-content: space-around; margin-top: var(--sp-xs); }
.wo-kv { display: flex; justify-content: space-between; gap: var(--sp-md); padding: var(--sp-sm) 0; border-top: 1px solid var(--rule); }
.wo-kv:first-child { border-top: 0; }
.wo-kv > :last-child { text-align: right; font-weight: 500; }
.wo-cues { margin: 0; padding-left: 1.2em; color: var(--ink2); font-size: 15px; }
.wo-cues li + li { margin-top: 4px; }

/* History */
.wo-hist .item { align-items: flex-start; }
.wo-hist .item > .grow > * + * { margin-top: 2px; }
.wo-hist .wo-date { flex: none; font-size: 13px; color: var(--ink3); padding-top: 2px; }
.wo-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wo-setchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-setchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--page); border: 1px solid var(--rule); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wo-setchip.warm { color: var(--ink3); }
.wo-setchip.best { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); background: color-mix(in srgb, var(--accent) 8%, var(--page)); }

/* Small phones: the units come out of the boxes so the numbers keep their room */
@media (max-width: 380px) {
  .wo-block { padding: var(--sp-md) var(--sp-sm); }
  .wo-unit { display: none; }
  .wo-num { padding: 0 4px; }
  .wo-fail, .wo-rir, .wo-carried { margin-left: 36px; }
}
@media (prefers-reduced-motion: reduce) { .wo-ring .fg, .wo-tick { transition: none; } }
