/* Tréning (v4): the list, the exercise popup (Cvik), its rest (Pauza), the full-screen timer, the rest bar, menus,
   swap and stretch sheets. Contract: docs/v4/design.md; look: mockups/finale (trening, cvik, pauza).
   Flat: one page grey, #212121 wells, a light primary pill, the accent once per screen (the suggested next start).
   Only --f-* tokens. Old app.css rules that still match these screens are overridden at the end of this file. */

/* ====================================================================== shell glue */
/* index.html still has the old title and day tabs in #view-trening; the view renders its own top. */
#view-trening > .view-title, #view-trening > #day-tabs { display: none; }
#day-content { font-family: var(--f-font); color: var(--f-text); gap: 0; display: block; padding: 0 6px; }
#day-content :where(h1, h2, h3, p, ul, ol) { margin: 0; }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:is(.t-top, .t-body, .t-rest, .t-timer, .t-menu, .t-toast, .cv-bar, .cv, .cv-rest, .t-session, .t-swap-list, .t-swap-now) :is(button, input) { font-family: var(--f-font); text-transform: none; letter-spacing: 0; }

/* ---------------------------------------------------------------- round buttons (popup, rest, timer) */
/* outline circle (−15, +15, ±, close); --quiet: the filled quiet circle (⋯) */
.t-ob {
  width: var(--f-tap);
  height: var(--f-tap);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--f-outline);
  color: var(--f-text);
  font-size: 16px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  transition: transform var(--f-dur-1) var(--f-ease), background-color var(--f-dur-2) var(--f-ease);
}
.t-ob svg { width: 18px; height: 18px; }
.t-ob:active, .t-ob.is-pressed { transform: scale(0.92); background: var(--f-quiet); }
.t-ob--quiet { box-shadow: none; background: var(--f-quiet); }
.t-ob--quiet:active, .t-ob--quiet.is-pressed { background: var(--f-quiet-pressed); }

/* ====================================================================== Tréning list */
/* top: only the days, small centred words; the ⋯ menu a quiet icon on the right */
.t-top { position: relative; display: flex; justify-content: center; align-items: center; min-height: 52px; padding: 2px 0 0; }
.t-days { display: flex; justify-content: center; gap: 26px; min-width: 0; }
.t-days > button { position: relative; min-height: var(--f-tap); padding: 0; font-size: 15.5px; font-weight: 500; color: var(--f-text-3); white-space: nowrap; transition: color var(--f-dur-2) var(--f-ease); }
.t-days > button[aria-selected="true"] { color: var(--f-text); }
.t-today { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.t-top__more { position: absolute; right: -10px; top: 50%; translate: 0 -50%; width: var(--f-tap); height: var(--f-tap); display: grid; place-items: center; border-radius: 50%; color: var(--f-text-3); }
.t-top__more svg { width: 20px; height: 20px; }
.t-top__more:active { background: var(--f-quiet); }
.t-body { display: block; }
.t-body.is-swapping { animation: t-in var(--f-dur-3) var(--f-ease); }
@keyframes t-in { from { opacity: 0; transform: translateY(8px); } }

/* sections: a quiet label and "done / total"; a finished one folds to its one line */
.t-secs { display: block; }
.t-sec > summary { list-style: none; display: flex; align-items: baseline; gap: var(--f-s3); padding: 26px 0 10px; cursor: pointer; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.t-sec > summary::-webkit-details-marker { display: none; }
.t-sec:first-child > summary { padding-top: 14px; }
.t-sec__name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: var(--f-fs-sub); font-weight: 500; line-height: 1.2; color: var(--f-text-2); }
.t-sec__count { flex: none; font-size: var(--f-fs-sub); color: var(--f-text-3); font-variant-numeric: tabular-nums; }
.t-sec.is-done > summary .t-sec__name { color: var(--f-text-3); }
.t-spicy { display: inline-grid; color: var(--f-text-3); }
.t-spicy svg { width: 12px; height: 12px; }
.t-info { margin: -14px -8px -14px 0; align-self: center; }
.t-tips { font-size: var(--f-fs-sub); color: var(--f-text-2); padding: 0 0 var(--f-s3); }
.t-tips ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; list-style: disc; }
.t-list { display: grid; touch-action: pan-y; } /* two fingers on the rows pinch them (superset), the page does not zoom */
.t-empty { font-size: var(--f-fs-sub); color: var(--f-text-3); padding: 4px 0; }

/* exercise row: picture 72 · name and sets · a 44 start button */
.t-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--f-tap); gap: 14px; align-items: center; padding: 7px 0; }
.t-open { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; text-align: left; border-radius: var(--f-r-pic); transition: transform var(--f-dur-1) var(--f-ease); }
.t-open.is-pressed { transform: scale(0.985); }
.t-pic { width: 72px; height: 72px; border-radius: var(--f-r-pic); background: var(--f-surface-1); overflow: hidden; display: block; position: relative; transition: opacity var(--f-dur-2) var(--f-ease); }
.t-pic > svg, .t-pic .pic { width: 100%; height: 100%; display: block; }
.t-pic .pic img { object-fit: cover; }
.t-main { min-width: 0; display: block; }
.t-name { display: block; font-size: var(--f-fs-body); font-weight: 500; line-height: 1.2; overflow-wrap: break-word; }
.t-meta { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.25; color: var(--f-text-2); font-variant-numeric: tabular-nums; }
/* a caution that matters for safety: one quiet line, the small triangle in the "worse" amber */
.t-caution { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--f-fs-caption); line-height: 1.25; color: var(--f-text-2); }
.t-caution svg { width: 13px; height: 13px; flex: none; color: var(--f-worse); }
.t-caution.is-skip { color: var(--f-worse); }
.t-row .care-tag { position: relative; cursor: pointer; border-radius: 6px; }
.t-row .care-tag::after { content: ""; position: absolute; inset: -12px -8px; } /* a bigger hit area than the words */
/* the start button: quiet circle, ▶; the suggested next one in the accent; finished = a check, dimmed */
.t-go { width: var(--f-tap); height: var(--f-tap); border-radius: 50%; display: grid; place-items: center; background: var(--f-quiet); color: var(--f-text); justify-self: end; transition: transform var(--f-dur-1) var(--f-ease), background-color var(--f-dur-2) var(--f-ease); }
.t-go svg { width: 17px; height: 17px; translate: 1px 0; }
.t-go:active, .t-go.is-pressed { transform: scale(0.92); }
.t-row.is-next .t-go { background: var(--f-accent); color: var(--f-on-accent); }
.t-row.is-done .t-go { background: none; color: var(--f-text-3); }
.t-row.is-done .t-go svg { translate: 0 0; width: 20px; height: 20px; }
.t-row.is-done .t-pic { opacity: 0.4; }
.t-row.is-done :is(.t-name, .t-meta) { color: var(--f-text-3); }
/* long-press: no text selection, no iOS callout, no image drag, so the hold is never stolen by the browser */
.t-row, .t-row * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.t-row img, .t-thumb img { -webkit-user-drag: none; pointer-events: none; }

/* edit mode: a quiet bar, a minus on each row, "+ Pridať cvik" under each part */
.t-editbar { display: flex; align-items: center; gap: var(--f-s3); padding: 14px 0 0; font-size: var(--f-fs-sub); color: var(--f-text-2); }
.t-editbar p { flex: 1; min-width: 0; }
.t-editbar .f-btn { flex: none; }
.t-minus { width: var(--f-tap); height: var(--f-tap); border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--f-outline); color: var(--f-text-2); justify-self: end; }
.t-minus svg { width: 16px; height: 16px; }
.t-add { display: inline-flex; align-items: center; gap: 10px; min-height: var(--f-tap); margin-top: 2px; padding-right: 12px; font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-2); border-radius: var(--f-r-pill); }
.t-add svg { width: 18px; height: 18px; margin-left: 27px; }
.t-reset { display: flex; margin: var(--f-s5) auto 0; color: var(--f-text-2); }
.t-trim { font-size: var(--f-fs-caption); color: var(--f-text-2); }

/* superset: a quiet label over its rows and a thin grey line joining their pictures (no tint, no accent) */
.t-ss { position: relative; }
.t-ss::before { content: ""; position: absolute; left: 35px; width: 2px; top: 44px; bottom: 40px; border-radius: 1px; background: var(--f-surface-3); }
.t-ss .t-row { z-index: 1; }
.t-ss__label { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0; text-align: left; font-size: var(--f-fs-caption); color: var(--f-text-3); border-radius: 8px; }
.t-ss__label > svg { width: 14px; height: 14px; flex: none; margin-left: 28px; }
.t-ss__more { margin-left: auto; width: var(--f-tap); height: 36px; display: grid; place-items: center; color: var(--f-text-3); }
.t-ss__more svg { width: 18px; height: 18px; }
.t-ss.is-new { animation: t-ss-in 420ms var(--f-ease); }
@keyframes t-ss-in { from { opacity: 0.4; transform: scale(0.98); } }
.t-row.is-pinch { z-index: 2; border-radius: var(--f-r-pic); background: var(--f-surface-1); transition: background-color var(--f-dur-2) var(--f-ease); }
.t-row.is-ready { background: var(--f-surface-3); }

/* ====================================================================== Dnes: today's workout card (B2 uses it) */
.td-workout .f-card__head { align-items: center; }
.td-workout__ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--f-quiet); color: var(--f-text); flex: none; }
.td-workout__ico svg { width: 30px; height: 30px; }
.td-workout__ico.is-done { color: var(--f-better); }
.td-workout__text { display: grid; gap: 4px; min-width: 0; }

/* ====================================================================== menu, toast, rest bar (fixed on <body>) */
.t-menu-scrim { position: fixed; inset: 0; z-index: calc(var(--f-z-menu) - 1); background: var(--f-scrim); animation: t-fade var(--f-dur-2) var(--f-ease); }
@keyframes t-fade { from { opacity: 0; } }
.t-menu, .t-menu .f-menu__item, .t-toast { font-family: var(--f-font); }
body.sheet-open .t-toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* the rest with the popup closed: a flat bar above the tab bar (time · +15 · ×); the time opens the exercise */
.t-rest {
  position: fixed;
  z-index: calc(var(--f-z-timer) - 1);
  left: var(--f-gutter);
  right: var(--f-gutter);
  bottom: calc(var(--f-dock-h) + var(--f-dock-bottom) + 14px);
  max-width: 420px;
  margin: 0 auto;
  min-height: 60px;
  padding: 8px 8px 8px 8px;
  display: flex;
  align-items: center;
  gap: var(--f-s2);
  border-radius: var(--f-r-pill);
  background: var(--f-bar);
  box-shadow: var(--f-shadow-2);
  color: var(--f-text);
  font-family: var(--f-font);
  animation: f-toast-in var(--f-dur-3) var(--f-ease);
}
body.sheet-open .t-rest { display: none; }
.t-rest__text { flex: 1; min-width: 0; min-height: var(--f-tap); display: flex; align-items: baseline; gap: 10px; padding: 0 12px; text-align: left; border-radius: var(--f-r-pill); }
.t-rest__text b { align-self: center; font-family: var(--f-font-num); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 500; letter-spacing: var(--f-track-display); }
.t-rest__text span { align-self: center; font-size: var(--f-fs-sub); color: var(--f-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-rest__btn { min-height: var(--f-tap); min-width: var(--f-tap); padding: 0 14px; border-radius: var(--f-r-pill); background: var(--f-quiet); font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text); font-variant-numeric: tabular-nums; }
.t-rest__x { width: var(--f-tap); height: var(--f-tap); border-radius: 50%; display: grid; place-items: center; color: var(--f-text-2); }
.t-rest__x svg { width: 18px; height: 18px; }
.t-rest.is-done .t-rest__text span { color: var(--f-text); }

/* ====================================================================== the dotted ring (Pauza, timer) */
/* lib.js "dots" mode on a canvas (timer.js dotRing); the time sits inside, ~94 px at the mockup's 348 px ring */
.t-ring { position: relative; width: min(100%, 348px); aspect-ratio: 1; display: grid; place-items: center; container-type: inline-size; color: var(--f-accent); }
.t-ring__dots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity var(--f-dur-3) var(--f-ease); }
.t-ring__time { position: relative; font-family: var(--f-font-display); font-weight: 600; font-size: 27cqi; line-height: 1; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; color: var(--f-text); }
/* the row under it: −15 · Preskočiť · +15 (timer: Pauza · ⏭) */
.t-ctl { display: flex; align-items: center; gap: var(--f-s3); }
.t-ctl > .f-btn { flex: 1; min-width: 0; }
.t-ctl > .t-ob { width: 64px; height: 64px; font-size: 16px; }
.t-ctl > .t-ob svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- full-screen timer (timed moves, holds) */
.f-timer.t-timer { grid-template-rows: auto minmax(0, 1fr) auto auto; gap: var(--f-s4); padding-inline: 18px; font-family: var(--f-font); color: var(--f-text); animation: t-fade var(--f-dur-2) var(--f-ease); }
.t-timer .f-timer__round { color: var(--f-text-2); font-weight: 500; font-size: var(--f-fs-sub); }
.t-timer__mid { min-height: 0; display: grid; place-items: center; container-type: size; }
.t-timer__mid .t-ring { width: min(100%, 348px, 100cqh); }
.t-timer__text { text-align: center; display: grid; gap: 6px; }
.t-timer__title { font-family: var(--f-font-display); font-size: 27px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.t-timer__label { font-size: var(--f-fs-sub); color: var(--f-text-2); }
.t-timer .f-timer__next { margin: 0; font-size: var(--f-fs-caption); color: var(--f-text-3); }
.t-timer.is-rest .t-ring { color: var(--f-text-3); }
.t-timer.is-paused .t-ring__dots { opacity: 0.4; }
.t-timer [data-tm="pause-icon"] { display: inline-grid; }
.t-timer .f-btn svg { width: 20px; height: 20px; }

/* ====================================================================== exercise popup (Cvik) */
/* The popup frame is app.css (10 px from the edges, radius 28). Its content fills the height: the picture takes
   what the bar, name, dots, cards and the primary button leave; Viac adds below and the popup scrolls. */
#sheet-scroll:has(> .cv-bar) { display: flex; flex-direction: column; padding: 0 16px 14px; }
.cv-bar { flex: none; display: flex; align-items: center; gap: var(--f-s3); min-height: var(--f-tap); padding: 0 0 4px; }
.cv-bar__mid { flex: 1; min-width: 0; font-size: 20px; color: var(--f-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-bar__mid b { font-family: var(--f-font-num); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--f-text-2); margin-left: 4px; }
.cv-close svg { width: 8px; height: 14px; translate: -1px 0; }
.cv { flex: 1 0 auto; display: flex; flex-direction: column; gap: 14px; font-family: var(--f-font); color: var(--f-text); }
.cv[hidden], .cv-rest[hidden] { display: none; }

/* the picture (no box: the painting sits on the popup's grey, its edges fade out) with Pohyb / Svaly under it */
.cv-stage { position: relative; flex: 1 1 0; min-height: 200px; display: flex; flex-direction: column; margin: 0 -4px; }
.cv-stage--empty { flex: 0 0 0; min-height: 0; }
.cv-stage > .pose.anim, .cv-stage .t-media__page > .pose.anim { position: absolute; inset: 0; width: auto; height: auto; aspect-ratio: auto; max-width: none; border-radius: 0; background: none; overflow: visible; }
.cv-stage .pose.anim .pic { position: absolute; inset: 0; }
.cv-stage .pose.anim img { object-fit: contain; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 99%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 99%); }
.cv-stage .pose.anim .pic > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cv-stage.t-media .t-media__track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.cv-stage .t-media__track::-webkit-scrollbar { display: none; }
.cv-stage .t-media__page { position: relative; flex: 0 0 100%; min-height: 0; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.cv-stage .t-muscles { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 4px; }
.cv-stage .t-muscles img { flex: 1 1 0; min-height: 0; width: 100%; max-width: 520px; object-fit: contain; border-radius: var(--f-r-pic); background: none; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%); }
.cv-mus { flex: none; text-align: center; font-size: 14px; line-height: 1.35; color: var(--f-text-2); text-wrap: balance; }
.cv-mus b { font-weight: 500; color: var(--f-text); }
.cv-mus i { font-style: normal; color: var(--f-text-3); }
.cv-stage .t-media__tabs { flex: none; display: flex; justify-content: center; gap: 26px; padding-top: 2px; }
.cv-stage .t-media__tab { position: relative; min-height: 32px; padding: 0 2px; font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-3); background: none; border: 0; cursor: pointer; transition: color var(--f-dur-2) var(--f-ease); }
.cv-stage .t-media__tab::after { content: ""; position: absolute; inset: -6px -10px; } /* 44 px hit area */
.cv-stage .t-media__tab.is-on { color: var(--f-text); }
.cv-stage.t-art--two { justify-content: center; }
.cv-stage.t-art--two .poses { width: min(100%, 320px); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cv-stage.t-art--two .pose { border-radius: var(--f-r-pic); background: var(--f-surface-1); }
.cv-stage .pose-wrap figcaption { background: none; color: var(--f-text-2); font-size: var(--f-fs-caption); font-weight: 500; padding: 0; }
.cv-stage .pose-wrap.active figcaption { background: none; color: var(--f-text); }

.cv-name { padding: 0 4px; font-family: var(--f-font-display); font-size: 30px; font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; overflow-wrap: break-word; }
.cv-caution { align-self: flex-start; min-height: 32px; margin: -10px 0 -6px; padding: 0 4px; font-size: 14px; border-radius: 8px; text-align: left; }
/* set dots: done = filled, the one to do = a ring with a dot, the rest = a thin ring */
.cv-dots { display: flex; align-items: center; gap: 16px; padding: 0 6px; color: var(--f-text-2); font-size: var(--f-fs-sub); font-variant-numeric: tabular-nums; }
.cv-dots__row { display: flex; flex-wrap: wrap; gap: 10px; }
.cv-dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--f-text-2); transition: background-color var(--f-dur-3) var(--f-ease), box-shadow var(--f-dur-3) var(--f-ease); }
.cv-dot.is-done { background: var(--f-text); box-shadow: none; }
.cv-dot.is-cur { box-shadow: inset 0 0 0 1px var(--f-text), inset 0 0 0 3px var(--f-bg), inset 0 0 0 7px var(--f-text); }
/* the number cards: label, the calm number (types too), + over − */
.cv-live { display: flex; flex-direction: column; gap: 14px; }
.cv-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cv-cards--one { grid-template-columns: minmax(0, 1fr); }
.cv-card { display: grid; grid-template-columns: minmax(0, 1fr) var(--f-tap); gap: 12px; align-items: center; padding: 16px; border-radius: var(--f-r-lg); background: var(--f-surface-1); }
.cv-card__v { display: grid; gap: 8px; min-width: 0; padding-left: 6px; cursor: text; }
.cv-card__v > span { font-size: 14.5px; color: var(--f-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-num {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  height: 58px;
  font-family: var(--f-font-num);
  font-size: var(--f-fs-hero);
  font-weight: 500;
  line-height: 58px;
  letter-spacing: var(--f-track-display);
  font-variant-numeric: tabular-nums;
  color: var(--f-text);
  caret-color: var(--f-accent);
  border-radius: 10px;
}
.cv-num[data-len="3"] { font-size: 46px; }
.cv-num[data-len="4"] { font-size: 38px; }
.cv-num:is([data-len="5"], [data-len="6"], [data-len="7"]) { font-size: 31px; }
.cv-num::selection { background: rgba(244, 239, 233, 0.2); }
.cv-num:focus-visible { box-shadow: none; }
.cv-card:focus-within { box-shadow: inset 0 0 0 1px var(--f-outline); }
.cv-card__st { display: grid; gap: 8px; }
.cv-plan { padding: 0 6px; font-family: var(--f-font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.cv-main { width: 100%; flex: none; }
.cv-main svg { width: 20px; height: 20px; }
.cv-main .chev { width: 8px; height: 14px; margin-left: 2px; }

/* Viac: a quiet line under the primary button; everything else of the old sheet is behind it */
.cv-more { flex: none; margin: -6px 0 0; }
.cv-more > summary { list-style: none; display: flex; justify-content: center; align-items: center; gap: 8px; min-height: var(--f-tap); font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-2); cursor: pointer; border-radius: var(--f-r-pill); }
.cv-more > summary::-webkit-details-marker { display: none; }
.cv-more > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--f-dur-2) var(--f-ease); }
.cv-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.cv-more__body { display: grid; gap: 14px; padding: 4px 0 8px; }
.cv-sec { display: grid; gap: 10px; }
.cv-sec__head { padding: 14px 4px 0; font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-2); }
.cv-more__body > .cv-sec__head:first-child { padding-top: 6px; }
.cv-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--f-s3); padding: 0 4px; font-size: var(--f-fs-sub); }
.cv-line span { color: var(--f-text-2); min-width: 0; }
.cv-line b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.cv-why { margin-top: -8px; padding: 0 4px; font-size: var(--f-fs-caption); color: var(--f-text-3); }
.cv-facts { margin: 0; display: grid; }
.cv-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--f-s4); padding: 9px 4px; font-size: var(--f-fs-sub); }
.cv-facts dt { color: var(--f-text-2); flex: none; }
.cv-facts dd { margin: 0; text-align: right; min-width: 0; }

/* the sets table (under Viac): # · last time · values · check */
.t-tracker { display: grid; gap: var(--f-s2); }
.t-table { display: grid; gap: 4px; font-family: var(--f-font); }
.t-th, .t-tr { display: grid; grid-template-columns: 24px minmax(0, 1fr) repeat(var(--t-cols, 2), 66px) 44px; align-items: center; gap: 8px; }
.t-table--1 { --t-cols: 1; }
.t-table--1 .t-th, .t-table--1 .t-tr { grid-template-columns: 24px minmax(0, 1fr) 84px 44px; }
.t-table--0 .t-th, .t-table--0 .t-tr { grid-template-columns: 24px minmax(0, 1fr) 44px; }
.t-th { padding: 0 6px 0 8px; font-size: var(--f-fs-caption); color: var(--f-text-3); }
.t-th span:nth-child(n + 3) { text-align: center; }
.t-tr { min-height: 52px; padding: 0 6px 0 8px; border-radius: var(--f-r-md); transition: background-color var(--f-dur-2) var(--f-ease); }
.t-tr.is-active { background: var(--f-surface-1); }
.t-tr__n { text-align: center; font-family: var(--f-font-num); font-weight: 500; font-size: var(--f-fs-sub); color: var(--f-text-3); font-variant-numeric: tabular-nums; }
.t-tr.is-active .t-tr__n { color: var(--f-text); }
.t-tr__prev { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--f-fs-caption); color: var(--f-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.t-tr__arrow { font-style: normal; font-size: 10px; }
.t-tr__arrow--better { color: var(--f-better); }
.t-tr__arrow--worse { color: var(--f-worse); }
.t-cell { display: grid; height: 40px; border-radius: var(--f-r-sm); background: var(--f-surface-1); cursor: text; transition: background-color var(--f-dur-2) var(--f-ease); }
.t-tr.is-active .t-cell { background: var(--f-surface-3); }
.t-tr.is-done .t-cell { background: transparent; }
.t-tr:not(.is-active) .t-cell input { color: var(--f-text-2); }
.t-cell:focus-within { box-shadow: inset 0 0 0 1px var(--f-outline); }
.t-cell input {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  text-align: center;
  font-family: var(--f-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 500;
  color: var(--f-text);
  caret-color: var(--f-accent);
}
.t-cell input::selection { background: rgba(244, 239, 233, 0.2); }
.t-tr__chk, .t-tr__go { justify-self: end; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--f-quiet); color: var(--f-text-3); position: relative; transition: transform var(--f-dur-1) var(--f-ease), background-color var(--f-dur-2) var(--f-ease); }
.t-tr__chk::after, .t-tr__go::after { content: ""; position: absolute; inset: -2px; }
.t-tr__chk svg, .t-tr__go svg { width: 18px; height: 18px; }
.t-tr.is-active :is(.t-tr__chk, .t-tr__go) { background: var(--f-text); color: #141414; }
.t-tr__chk[aria-pressed="true"] { background: none; color: var(--f-text); box-shadow: inset 0 0 0 1px var(--f-outline); }
.t-tr__chk.is-pressed, .t-tr__go.is-pressed { transform: scale(0.92); }
.t-tr__chk.f-delta--pop { animation: f-pop var(--f-dur-2) var(--f-ease); }
.t-tracker__actions { display: flex; justify-content: center; gap: var(--f-s2); }
.t-tracker__actions .f-btn { color: var(--f-text-2); }
.t-tracker__actions .f-btn svg { width: 16px; height: 16px; }
.t-dim { color: var(--f-text-3); }

/* cautions in full, how-to (under Viac) */
.t-fit__body { display: grid; gap: var(--f-s3); padding: 0 4px; font-size: var(--f-fs-sub); line-height: var(--f-lh-body); color: var(--f-text-2); }
.t-fit__body .f-btn, .care .f-btn { justify-self: start; }
.t-fit.skip .cv-sec__head { color: var(--f-worse); }
.care { font-family: var(--f-font); font-size: var(--f-fs-sub); line-height: var(--f-lh-body); color: var(--f-text-2); display: grid; gap: var(--f-s2); }
.cv-sec .care { padding: 0 4px; }
.care p { margin: 0; }
.care b { color: var(--f-text); font-weight: 500; }
.care .care-label { font-size: var(--f-fs-caption); font-weight: 500; color: var(--f-text-2); margin-top: var(--f-s2); }
.care-list { margin: 0; padding-left: 1.2em; list-style: disc; display: grid; gap: 6px; color: var(--f-text); }
.care-stop { display: grid; gap: 6px; padding: var(--f-s4); border-radius: var(--f-r-md); background: var(--f-surface-1); color: var(--f-text-2); margin-top: var(--f-s2); }
.care-stop b { color: var(--f-worse); }
.care-actions { display: grid; gap: var(--f-s2); margin-top: var(--f-s4); font-family: var(--f-font); }
.t-steps { margin: 0; padding: 0 4px 0 26px; display: grid; gap: 10px; font-size: var(--f-fs-sub); line-height: var(--f-lh-body); color: var(--f-text); list-style: decimal; }
.t-steps li::marker { color: var(--f-text-3); }
.t-tip { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 0; padding: 0 4px; font-size: var(--f-fs-sub); line-height: var(--f-lh-body); color: var(--f-text-2); }
.t-tip svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--f-text-3); }
/* the inner layer's fold (inner-ui.js markup) sits flat in Viac */
.cv-more__body .section-label { padding: 14px 4px 0; margin: 0; font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-2); text-transform: none; letter-spacing: 0; }
.cv-more__body .inner-fold { background: none; margin: 0; }

/* ====================================================================== Pauza (the rest, in the popup) */
.cv-rest { flex: 1 0 auto; display: flex; flex-direction: column; gap: 14px; font-family: var(--f-font); color: var(--f-text); animation: t-fade var(--f-dur-3) var(--f-ease); }
.cv-rest__mid { flex: 1 1 0; min-height: 220px; display: grid; place-items: center; container-type: size; }
.cv-rest__mid .t-ring { width: min(100%, 348px, 100cqh); }
.cv-rest__next { text-align: center; }
.cv-rest__t { font-family: var(--f-font-display); font-size: 27px; font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 6px; }
.cv-rest__next p { font-size: var(--f-fs-sub); color: var(--f-text-2); font-variant-numeric: tabular-nums; }
.cv-rest .t-ctl { padding-top: 8px; }

/* ====================================================================== other sheets: swap, library, stretch session */
.t-label { font-size: var(--f-fs-caption); font-weight: 500; color: var(--f-text-2); }
.t-note { font-size: var(--f-fs-caption); color: var(--f-text-2); margin: var(--f-s3) 0 0; font-family: var(--f-font); }
.t-session__meta { margin: -6px 0 var(--f-s2); }
.t-session { display: grid; gap: var(--f-s3); font-family: var(--f-font); }
.t-session .t-sec:first-child > summary { padding-top: 6px; }
.t-session-seg { margin: var(--f-s2) 0; }
/* chips are plain words now (no tinted pills for metadata) */
.t-chips { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.t-chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--f-fs-caption); font-weight: 400; color: var(--f-text-2); white-space: nowrap; }
.t-chip svg { width: 12px; height: 12px; }
.t-swap-now { display: flex; align-items: center; gap: var(--f-s3); padding: 0 0 var(--f-s3); font-family: var(--f-font); }
.t-swap-now .t-thumb { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; background: var(--f-surface-1); flex: none; }
.t-swap-now .t-thumb .pic img { object-fit: cover; }
.t-swap-now__name { font-weight: 500; }
.t-swap-now__aim { font-size: var(--f-fs-caption); color: var(--f-text-2); margin-top: 2px; }
.t-swap-now__aim b { color: var(--f-text); font-weight: 500; }
.t-swap-head { font-family: var(--f-font); font-size: var(--f-fs-sub); font-weight: 500; color: var(--f-text-2); padding: var(--f-s3) 4px var(--f-s2); }
.t-swaprow { width: 100%; text-align: left; }
.t-swaprow .t-thumb { border-radius: 16px; overflow: hidden; }
.t-swaprow .t-thumb .pic img { object-fit: cover; }
.t-swaprow .f-row__main { gap: 4px; }
.t-focus { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: var(--f-fs-caption); }
.t-focus__badge { font-weight: 500; white-space: nowrap; color: var(--f-text); }
.t-focus__what { color: var(--f-text-2); min-width: 0; }
.t-swaprow--other .t-focus__badge { color: var(--f-worse); }
.t-swaprow--other .f-row__title { color: var(--f-text-2); }
.t-swaprow .t-chips:empty { display: none; }
.t-swap-warn { display: flex; gap: var(--f-s2); align-items: flex-start; margin: var(--f-s5) 0 var(--f-s2); padding: 0 4px; color: var(--f-text-2); font-family: var(--f-font); font-size: var(--f-fs-caption); line-height: 1.4; }
.t-swap-warn svg { width: 15px; height: 15px; flex: none; color: var(--f-worse); margin-top: 1px; }
.t-swap-warn b { color: var(--f-text); font-weight: 500; }
.t-search { display: flex; align-items: center; gap: var(--f-s2); min-height: var(--f-tap); padding: 0 var(--f-s4); margin: 0 0 var(--f-s3); border-radius: var(--f-r-pill); background: var(--f-surface-1); color: var(--f-text-3); font-family: var(--f-font); }
.t-search svg { width: 18px; height: 18px; flex: none; }
.t-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--f-text); font: inherit; font-size: var(--f-fs-body); padding: 10px 0; outline: none; -webkit-appearance: none; appearance: none; }
.t-search:focus-within { box-shadow: inset 0 0 0 1px var(--f-outline); }

/* ====================================================================== legacy app.css rules overridden here */
/* app.css .fit-tag (tinted pill) → a quiet word; .pose / .pose.anim (cream box, cover) and .pose-wrap figcaption
   (accent pill) inside the popup are handled in .cv-stage above; .day-content gap. */
.fit-tag { background: none; padding: 0; border-radius: 0; font-size: var(--f-fs-caption); font-weight: 500; color: var(--f-text-2); }
.fit-tag.skip { color: var(--f-worse); background: none; }
.fit-tag.care { color: var(--f-text-2); background: none; }
.t-art .pose.anim { background: none; }

@media (max-width: 360px) {
  .t-days { gap: 20px; }
  .t-days > button { font-size: 15px; }
  .cv-name { font-size: 25px; }
  /* two cards side by side are narrow here: the number gets the card's width, − and + sit under it */
  .cv-card { grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 12px; }
  .cv-card__v { grid-column: 1 / -1; order: -2; padding-left: 4px; }
  .cv-card__st { display: contents; }
  .cv-card__st > [data-by="-1"] { order: -1; }
  .cv-card__st > .t-ob { justify-self: center; }
  .cv-cards--one .cv-card { grid-template-columns: minmax(0, 1fr) var(--f-tap) var(--f-tap); align-items: end; }
  .cv-cards--one .cv-card__v { grid-column: auto; }
  .cv-num { font-size: 46px; height: 50px; line-height: 50px; }
  .cv-num[data-len="3"] { font-size: 40px; }
  .cv-num[data-len="4"] { font-size: 34px; }
  .cv-num:is([data-len="5"], [data-len="6"], [data-len="7"]) { font-size: 27px; }
  .cv-stage { min-height: 150px; }
  .cv-rest__t, .t-timer__title { font-size: 24px; }
  .t-th, .t-tr { grid-template-columns: 20px minmax(0, 1fr) repeat(var(--t-cols, 2), 58px) 42px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .t-body.is-swapping, .t-rest, .t-timer, .t-menu-scrim, .t-ss.is-new, .cv-rest { animation: none; }
  .t-ring__dots, .cv-dot, .t-days > button, .t-go, .t-open, .t-pic { transition: none; }
}
