/* Sprout — Fitness: the day's numbers, two-column cards, food and workout rows, forms and the safety note. */
.fit-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.fit-kpis .kpi { padding-bottom: 24px; }
.fit-kpis .kpi-value { font-size: 40px; }
.fit-kpis .kpi-value small { font-size: 18px; font-weight: 600; color: var(--muted); }
.fit-kpis .kpi-value.neg { color: var(--danger); }
.fit-bar { margin: 4px 0 12px; }
.fit-bar.over i { background: var(--danger); }

.fit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.fit-span { grid-column: 1 / -1; }
.fit-setup, .fit-paused { margin-bottom: 16px; }
.fit-setup .sub, .fit-paused .sub { margin: 8px 0 16px; max-width: 46em; }
.fit-paused { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.fit-paused .sub { margin-bottom: 0; }

.fit-rows { list-style: none; margin: 0; padding: 0; }
.fit-rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fit-rows li:last-child { border-bottom: 0; }
.fit-rows li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fit-rows li > span small { color: var(--muted); font-size: 13px; }
.fit-rows li > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fit-meal + .fit-meal { margin-top: 12px; }
.fit-meal-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }

.fit-watch { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fit-watch li { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); line-height: 1.45; }
.fit-watch .fit-w-over { background: color-mix(in srgb, var(--danger) 9%, var(--surface-2)); }

.fit-week { list-style: none; margin: 0 0 12px; padding: 0; }
.fit-week li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fit-week li b { font-variant-numeric: tabular-nums; }

.fit-form { max-width: none; }
.fit-form-go { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.fit-check { flex-direction: row !important; align-items: center; gap: 12px !important; font-weight: 500 !important; }
.fit-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.fit-safety { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 12px; margin: 0; }
.fit-safety legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.fit-session { margin-top: 16px; display: grid; gap: 4px; }
.fit-session label { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.fit-session .input { width: 90px; }

.fit-warn { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 12%, var(--surface-2)); line-height: 1.45; }
.fit-note { margin-top: 24px; font-size: 13px; color: var(--muted); max-width: 52em; }

@media (max-width: 1100px) { .fit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .fit-grid { grid-template-columns: minmax(0, 1fr); }
  .fit-kpis .kpi-value { font-size: 28px; }
}
@media (max-width: 420px) { .fit-form.form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Fitness section look: hero session card, week strip, categories, sessions, player ---------- */
.fit-app { --fit-r: 26px; }
.fit-section-title { font-size: 16px; font-weight: 700; margin: 24px 0 12px; }
.fit-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .fit-chip { color: var(--accent-2); }
.fit-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.fit-meta span { display: inline-flex; align-items: center; gap: 8px; }
.fit-meta svg { width: 16px; height: 16px; }

/* Week strip */
.fit-weekstrip { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.fit-weekstrip li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 0 16px; border-radius: 16px; background: var(--surface); }
.fit-weekstrip li span { font-size: 13px; color: var(--muted); }
.fit-weekstrip li b { font-size: 16px; font-variant-numeric: tabular-nums; }
.fit-weekstrip li i { position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.fit-weekstrip li.is-done i { background: var(--accent); }
.fit-weekstrip li.is-today { background: var(--hero); color: #fff; }
.fit-weekstrip li.is-today span { color: rgba(255, 255, 255, .75); }
.fit-weekstrip li.is-today.is-done i { background: #fff; }

/* Hero: today's session */
.fit-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 8px; }
.fit-hero, .fit-detail-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--fit-r); padding: 24px; min-height: 250px; display: flex; flex-direction: column; align-items: flex-start; background: var(--hero); color: #fff; }
.fit-hero::before, .fit-detail-hero::before { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 70%, transparent), transparent 65%); opacity: .55; }
.fit-hero::after, .fit-detail-hero::after { content: ""; position: absolute; z-index: -1; width: 520px; height: 220px; right: -140px; bottom: -40px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-2) 80%, #fff); opacity: .35; transform: rotate(-18deg); box-shadow: 0 0 24px color-mix(in srgb, var(--accent-2) 60%, transparent); }
.fit-hero .fit-chip, .fit-detail-hero .fit-chip { background: rgba(255, 255, 255, .16); color: #fff; }
.fit-hero h2 { margin: 16px 0 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; max-width: 12ch; }
.fit-hero .fit-meta, .fit-detail-hero .fit-meta { color: rgba(255, 255, 255, .82); }
.fit-hero-sub { margin: 12px 0 0; color: rgba(255, 255, 255, .82); max-width: 32ch; }
.fit-hero-art { position: absolute; z-index: -1; right: 18px; bottom: 6px; width: 170px; height: 170px; color: rgba(255, 255, 255, .13); }
.fit-hero-art svg { width: 100%; height: 100%; stroke-width: 1.1; }
.fit-hero-go { margin-top: auto; padding-top: 24px; display: flex; align-items: center; gap: 12px; width: 100%; }
.fit-btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; border: 0; text-decoration: none; }
.fit-btn-ghost:hover { background: rgba(255, 255, 255, .22); }
.fit-play { margin-left: auto; width: 58px; height: 58px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: #fff; color: var(--accent-3); box-shadow: 0 8px 28px rgba(0, 0, 0, .22); transition: transform var(--dur-1) var(--ease-out); }
.fit-play svg { width: 22px; height: 22px; margin-left: 4px; }
.fit-play:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .fit-play:hover { transform: scale(1.05); } }

/* Categories */
.fit-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fit-cat { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 20px; min-height: 118px; border-radius: 24px;
  background: var(--surface); color: var(--text); text-decoration: none; transition: transform var(--dur-1) var(--ease-out); }
.fit-cat strong { font-size: 16px; }
.fit-cat small { color: var(--muted); }
.fit-cat-art { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .fit-cat-art { color: var(--accent-2); }
.fit-cat-art svg { width: 24px; height: 24px; }
.fit-cat:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .fit-cat:hover { background: var(--surface-2); } }

/* Plan */
.fit-weekplan { margin-bottom: 16px; }
.fit-weekplan ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; }
.fit-weekplan li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fit-weekplan li span { font-weight: 600; font-size: 14px; }
.fit-weekplan select { max-width: 220px; }
.fit-plantime { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: var(--sp-2) 0 var(--sp-3); font-weight: 600; font-size: 14px; }
.fit-plantime small { display: block; font-weight: 400; color: var(--muted); }
.fit-plantime input { width: 140px; }
.fit-filter { margin: 4px 0 16px; }
.fit-filter button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.fit-sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.fit-scard { position: relative; overflow: hidden; isolation: isolate; padding: 20px 20px 24px; border-radius: 24px; background: var(--surface); min-height: 170px; display: flex; flex-direction: column; align-items: flex-start; }
.fit-scard h4 { margin: 12px 0 0; font-size: 18px; letter-spacing: -0.01em; }
.fit-scard .fit-meta { font-size: 13px; padding-right: 54px; }
.fit-scard-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.fit-scard-art { position: absolute; z-index: -1; right: -8px; top: -8px; width: 110px; height: 110px; color: var(--accent); opacity: .09; }
.fit-scard-art svg { width: 100%; height: 100%; stroke-width: 1.2; }
.fit-play-sm { position: absolute; z-index: 2; right: 16px; bottom: 16px; width: 44px; height: 44px; background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.fit-play-sm svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .fit-scard:hover { background: var(--surface-2); } }
.fit-builder textarea { resize: vertical; font-family: inherit; line-height: 1.5; }
.fit-form-go { gap: 12px; }

/* Session detail */
.fit-detail-hero { min-height: 230px; justify-content: flex-end; margin-bottom: 16px; }
.fit-detail-hero h1 { margin: 12px 0 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.02em; line-height: 1.05; }
.fit-round-btn { position: absolute; top: 18px; left: 18px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff; }
.fit-round-btn svg { width: 20px; height: 20px; }
.fit-detail-hero .fit-hero-art { right: 24px; top: 24px; bottom: auto; width: 150px; height: 150px; }
.fit-block { background: var(--surface); border-radius: 24px; padding: 8px 20px 12px; margin-bottom: 12px; transition: opacity var(--dur-2) var(--ease-out); }
.fit-block.is-off { opacity: .5; }
.fit-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 8px; }
.fit-block-head h3 { margin: 0; font-size: 16px; }
.fit-block-head small { font-weight: 500; color: var(--muted); }
.fit-ex { list-style: none; margin: 0; padding: 0; }
.fit-ex li { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.fit-ex li + li { border-top: 1px solid var(--line); }
.fit-ex-art { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
[data-theme="dark"] .fit-ex-art { color: var(--accent-2); }
.fit-ex-art svg { width: 24px; height: 24px; }
.fit-ex li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.fit-ex small { color: var(--muted); }
.fit-detail-actions { position: sticky; bottom: 16px; z-index: 5; display: flex; gap: 12px; align-items: center; margin-top: 20px; padding: 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.fit-start { flex: 1; height: 54px; border-radius: 999px; border: 0; font-size: 16px; font-weight: 700; background: var(--accent); color: #fff;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform var(--dur-1) var(--ease-out); }
.fit-start:active { transform: scale(.98); }
.fit-start:disabled { opacity: .5; box-shadow: none; }
.fit-detail-actions .btn-outline { height: 54px; border-radius: 999px; }

/* Progress */
.fit-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fit-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; align-items: end; }
.fit-bars li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fit-bars-col { width: 100%; max-width: 46px; height: 140px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.fit-bars-col i { display: block; width: 100%; min-height: 4px; border-radius: 12px; background: var(--hero); }
.fit-bars small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Guided player: one exercise per screen, sets as rows, a progress bar with exercise tabs */
html.fit-playing, html.fit-playing body { overflow: hidden; }
.fit-player { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(150px, 1fr) auto auto; color: var(--text);
  background: radial-gradient(90% 55% at 50% 12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), var(--bg);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.fit-player > * { width: 100%; max-width: 560px; margin-inline: auto; }
.fit-player .fit-round-btn { position: static; flex: none; width: 44px; height: 44px; background: var(--surface); color: var(--text); }
.fp-top { display: flex; align-items: center; gap: 12px; }
.fp-clock { flex: 1; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.fit-player .fp-pause { color: var(--danger); }
.fit-player.is-paused .fp-pause { color: var(--accent); }
.fp-finish-btn { height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }

.fp-hero { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.fp-art { position: absolute; width: min(62vw, 300px); aspect-ratio: 1; color: var(--accent); opacity: .12; display: grid; place-items: center; }
[data-theme="dark"] .fp-art { color: var(--accent-2); }
.fp-art svg { width: 100%; height: 100%; stroke-width: .9; }
.fp-status { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0; }
.fp-eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
[data-theme="dark"] .fp-eyebrow { color: var(--accent-2); }
.fp-name { margin: 0; font-size: clamp(30px, 8vw, 42px); line-height: 1.05; letter-spacing: -0.02em; }
.fp-hint { margin: 0; color: var(--muted); font-size: 14px; }
.fp-ringbox { position: relative; width: 168px; height: 168px; }
.fp-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.fp-track { fill: none; stroke: var(--line); stroke-width: 8; }
.fp-arc { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 250ms linear; }
.fit-player.is-rest .fp-arc { stroke: var(--warn); }
.fp-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.fp-ring-in small { max-width: 120px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-ring-in b { font-size: 40px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.fit-player.is-paused .fp-ring-in b, .fit-player.is-paused .fp-clock { opacity: .45; }
.fp-chips { display: flex; gap: 8px; margin-top: 8px; }
.fp-chips button { height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

.fp-sets { padding: 8px 0 4px; touch-action: pan-y; }
.fp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fp-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 54px; align-items: center; gap: 8px; }
.fp-row:has(.fp-pill-wide) { grid-template-columns: 26px minmax(0, 1fr) 54px; }
.fp-idx { display: grid; place-items: center; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-idx i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fp-pill { height: 54px; border-radius: 999px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 16px; cursor: text;
  transition: background var(--dur-1) ease, box-shadow var(--dur-1) ease; }
.fp-pill:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.fp-pill input { width: 100%; max-width: 76px; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 18px; font-weight: 600;
  text-align: right; font-variant-numeric: tabular-nums; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.fp-pill input::-webkit-outer-spin-button, .fp-pill input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fp-pill input:focus { outline: none; }
.fp-pill span { font-size: 16px; color: var(--muted); }
.fp-row.is-current .fp-pill { background: var(--surface-2); }
.fp-row.is-done .fp-pill { opacity: .55; }
.fp-check { width: 54px; height: 54px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--muted);
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.fp-check svg { width: 24px; height: 24px; stroke-width: 2.4; }
.fp-row.is-current .fp-check { color: var(--text); background: var(--surface-2); }
.fp-check[aria-pressed="true"] { background: #2fa84f; color: #fff; box-shadow: 0 6px 18px rgba(47, 168, 79, .35); }
.fp-play { background: var(--accent); color: #fff; }
.fp-play svg { width: 20px; height: 20px; margin-left: 2px; stroke-width: 1.8; }
.fp-check:active { transform: scale(.92); }
.fp-add { margin: 12px auto 0; display: block; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 8px 12px; }
[data-theme="dark"] .fp-add { color: var(--accent-2); }

.fp-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 16px; border-top: 1px dashed var(--line); }
.fp-mini { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; }
.fp-mini-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fp-mini-ring .fp-track, .fp-mini-ring .fp-arc { stroke-width: 4; }
.fp-mini b { font-size: 13px; font-variant-numeric: tabular-nums; }
.fp-bar-name { min-width: 0; flex: 0 1 auto; display: flex; flex-direction: column; }
.fp-bar-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-bar-name small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-pager { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; padding: 2px;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 16px), transparent); }
.fp-pager::-webkit-scrollbar { display: none; }
.fp-pager button { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.fp-pager button.is-done { color: var(--accent); }
[data-theme="dark"] .fp-pager button.is-done { color: var(--accent-2); }
.fp-pager button[aria-current] { background: var(--surface-2); color: var(--text); }

.fit-player.is-done { grid-template-rows: auto 1fr; }
.fp-finish { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 70vh; text-align: center; }
.fp-finish h2 { margin: 8px 0 0; font-size: 34px; letter-spacing: -0.02em; }
.fp-finish-mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #2fa84f; color: #fff; box-shadow: 0 10px 30px rgba(47, 168, 79, .35); }
.fp-finish-mark svg { width: 40px; height: 40px; stroke-width: 2.4; }
.fp-finish ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 20px 0 8px; padding: 0; }
.fp-finish li { min-width: 92px; padding: 16px 16px; border-radius: 24px; background: var(--surface); display: grid; }
.fp-finish li b { font-size: 22px; font-variant-numeric: tabular-nums; }
.fp-finish li small { color: var(--muted); }
.fp-primary { width: min(320px, 80vw); height: 56px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 12px; }

/* Exercise library and how-to */
.fit-lib-tools { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fit-lib-search { flex: 1 1 260px; position: relative; display: flex; align-items: center; }
.fit-lib-search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.fit-lib-search .input { width: 100%; padding-left: 40px; }
.fit-lib-equip { flex: 0 1 220px; }
.fit-lib-equip .input { width: 100%; }
.fit-lib-parts { margin: 0 0 8px; }
.fit-lib-count { margin: 4px 0 12px; }
.fit-lib-wait { padding: 24px 0; }
.fit-lib { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fit-lib > li { border-radius: 16px; background: var(--surface); }
.fit-lib summary { display: flex; align-items: center; gap: 16px; padding: 12px 16px; cursor: pointer; list-style: none; }
.fit-lib summary::-webkit-details-marker { display: none; }
.fit-lib summary > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fit-lib summary strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit-lib summary small { color: var(--muted); }
.fit-lib summary .fit-ex-art { width: 46px; height: 46px; border-radius: 12px; }
.fit-lib details[open] summary { border-bottom: 1px solid var(--line); }
.fit-lib .fit-howto-body { padding: 12px 16px 4px; }
.fit-lib-go { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 16px 16px; }
.fit-muscles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.fit-muscles span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.fit-muscles span:first-child { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .fit-muscles span:first-child { color: var(--accent-2); }
.fit-muscles svg { width: 14px; height: 14px; }
.fit-muscles .is-equip { background: none; border: 1px solid var(--line); }
.fit-howto-body ol { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; font-size: 14px; }
.fit-howto { margin-top: 8px; }
.fit-howto summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); width: fit-content; }
[data-theme="dark"] .fit-howto summary { color: var(--accent-2); }
.fit-howto .fit-howto-body { padding: 12px 0 2px; }

.fit-demo { display: grid; gap: 12px; margin-bottom: 12px; }
.fit-demo:empty { display: none; }
.fit-demo video, .fit-demo img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 16px; background: #000; }
.fit-demo-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; font-weight: 600; color: var(--accent); text-decoration: none; }
[data-theme="dark"] .fit-demo-link { color: var(--accent-2); }
.fit-demo-link svg { width: 16px; height: 16px; }
.fit-demo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fit-demo-actions .btn svg { width: 15px; height: 15px; }
.fit-demo-form { display: flex; gap: 8px; }
.fit-demo-form[hidden] { display: none; }
.fit-demo-form .input { flex: 1; min-width: 0; }
.fit-demo-note { color: var(--muted); font-size: 13px; }

/* Bundled exercise videos (Your Move) */
/* Clips are portrait: show them as a tall card that the video fills edge to edge, never letterboxed */
.fit-video { position: relative; margin: 0 auto 12px; width: 100%; max-width: 420px; }
.fit-video video { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 72vh; object-fit: cover; border-radius: 24px; background: var(--surface-2); }
.fit-video figcaption { text-align: center; }
.fit-video figcaption, .fp-video-credit { margin-top: 8px; font-size: 11px; color: var(--muted); }
.fit-video figcaption a, .fp-video-credit a { color: inherit; }
.fit-has-video { color: var(--accent); font-weight: 700; }
[data-theme="dark"] .fit-has-video { color: var(--accent-2); }
.fit-lib-video { margin: 0 0 12px; font-size: 14px; }

/* With a video, it fills the top of the player edge to edge and fades into the set rows */
.fit-player.has-video { isolation: isolate; }
.fit-player > .fp-video { position: absolute; z-index: -2; inset: 0 0 auto 0; width: 100%; max-width: none; height: 64%; margin: 0; object-fit: cover; background: var(--surface-2); }
.fit-player.has-video::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto 0; height: 64%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, transparent 20%, transparent 34%, color-mix(in srgb, var(--bg) 70%, transparent) 62%, var(--bg) 92%); }
.fit-player.has-video .fp-status { text-shadow: 0 1px 14px color-mix(in srgb, var(--bg) 70%, transparent); }
.fit-player.has-video .fp-art { display: none; }
.fit-player.has-video .fp-hero { place-items: end center; }
.fit-player.has-video .fp-top .fit-round-btn, .fit-player.has-video .fp-finish-btn { background: rgba(255, 255, 255, .78); color: #141a16; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.fit-player.has-video .fp-pause { color: var(--danger); }
.fit-player.has-video .fp-clock { color: #141a16; background: rgba(255, 255, 255, .78); border-radius: 999px; flex: 0 0 auto; padding: 8px 12px; margin: 0 auto; }
.fit-player.has-video .fp-howto-btn { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.fit-player.is-rest.has-video .fp-status { background: color-mix(in srgb, var(--bg) 80%, transparent); border-radius: 24px; padding: 16px 24px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.fit-player > .fp-video-credit { width: auto; max-width: none; }
.fp-video-credit { position: absolute; z-index: 1; top: calc(max(14px, env(safe-area-inset-top)) + 54px); right: 16px; margin: 0; padding: 4px 8px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 10px; }

.fp-howto-btn { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; }
.fp-howto-btn svg { width: 16px; height: 16px; }
.fp-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; max-height: 75%; overflow-y: auto; padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: 0 -12px 40px rgba(0, 0, 0, .25); }
.fp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fp-sheet-head h3 { margin: 0; font-size: 18px; }
.fp-sheet .fit-round-btn { background: var(--surface-2); }
.fp-sheet ol { font-size: 16px; }

@media (max-width: 1000px) { .fit-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .fit-weekstrip { gap: 4px; }
  .fit-weekstrip li { border-radius: 12px; padding: 8px 0 12px; }
  .fit-hero { min-height: 230px; padding: 24px; }
  .fit-kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .fit-bars { gap: 4px; }
  .fit-bars small { display: none; }
  .fit-detail-actions { flex-wrap: wrap; border-radius: 24px; }
  .fit-detail-actions .fit-start { flex-basis: 100%; }
  .fit-detail-actions .btn-outline { flex: 1; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .fit-play, .fit-cat, .fit-start, .fit-block { transition: none; }
  .fp-arc, .fp-check, .fp-pill { transition: none; }
}

/* ---------- Coach ---------- */
.fit-coach { margin-bottom: 16px; }
.fit-coach .card-head h3 { display: flex; align-items: center; gap: 8px; }
.fit-coach .card-head h3 svg, .fp-coach svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
[data-theme="dark"] .fit-coach .card-head h3 svg, [data-theme="dark"] .fp-coach svg { color: var(--accent-2); }
.fit-coach > ul:not(.fit-rows):not(.fit-coach-week) { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.fit-coach > ul:not(.fit-rows):not(.fit-coach-week) li { position: relative; padding-left: 20px; line-height: 1.45; }
.fit-coach > ul:not(.fit-rows):not(.fit-coach-week) li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.fit-coach li[data-kind="stall"]::before, .fit-coach li[data-kind="rest"]::before { background: var(--warn); }
.fit-coach-flag { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 14%, transparent); line-height: 1.45; }
.fit-coach-week { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fit-coach-week li { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.fit-coach-week b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fit-coach-week small { color: var(--muted); font-size: 13px; }
.fit-coach-lifts li span small { display: block; margin-top: 2px; white-space: normal; }
.fit-coach-tag { flex: none; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.fit-coach-tag[data-status="stalled"], .fit-coach-tag[data-status="returning"] { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.fit-coach-tag[data-status="hold"] { background: var(--surface-2); color: var(--text); }
.fit-pr { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.fit-coach-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.fp-coach { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 12px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: left; }
.fp-coach[data-status="stalled"] svg, .fp-coach[data-status="returning"] svg, .fp-coach[data-status="fade"] svg { color: var(--warn); }
@media (max-width: 760px) { .fit-coach-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ======================= Fitness, redesigned (js/pages/fitness-home.js) =======================
   Component tokens on top of DESIGN.md: one colour per macro, the ring, insight tones. 8-point spacing. */
:root {
  --macro-protein: #2e6b46; --macro-carbs: #c9852b; --macro-fat: #6a6fc4;
  --fx-ring: var(--accent); --fx-ring-over: var(--warn); --fx-tint: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
[data-theme="dark"] { --macro-protein: #5fb684; --macro-carbs: #e0a24e; --macro-fat: #9196e8; --fx-ring: var(--accent-2); }

.fx { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-4); }
@media (min-width: 900px) { .fx { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } .fx-energy, .fx-insights, .fx-targets, .fx-weekcal { grid-column: 1 / -1; } }

/* Energy: calories left in a ring, three numbers beside it */
.fx-energy { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-4) var(--sp-6); align-items: center; background: var(--fx-tint); }
.fx-ring-wrap { position: relative; width: 148px; height: 148px; }
.fx-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.fx-ring-track { stroke: color-mix(in srgb, var(--text) 8%, transparent); }
.fx-ring-fill { stroke: var(--fx-ring); animation: fx-draw 900ms var(--ease-out) both; }
.fx-ring.is-over .fx-ring-fill { stroke: var(--fx-ring-over); }
@keyframes fx-draw { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--off); } }
.fx-ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fx-ring-in b { font-size: 34px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1; }
.fx-ring-in small { color: var(--muted); font-size: 13px; margin-top: var(--sp-1); }
.fx-energy-stats { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.fx-energy-stats li { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: var(--sp-1) var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.fx-energy-stats li:last-child { border-bottom: 0; padding-bottom: 0; }
.fx-energy-stats small { color: var(--muted); font-size: 13px; }
.fx-energy-stats b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fx-energy-stats em { grid-column: 1 / -1; font-style: normal; color: var(--muted); font-size: 11px; }
.fx-energy-foot { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.fx-quick { grid-column: 1 / -1; display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.fx-quick .btn { flex: 1; min-width: 96px; }

/* Macros: a bar each, with a marker at the protein minimum */
.fx-macros ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.fx-macro-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.fx-macro-top span { font-weight: 600; }
.fx-macro-top b { font-variant-numeric: tabular-nums; font-size: 16px; }
.fx-macro-top b small { color: var(--muted); font-weight: 500; font-size: 13px; }
.fx-bar { position: relative; height: 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--text) 8%, transparent); }
.fx-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); transition: width var(--dur-4) var(--ease-out); }
.fx-macro[data-macro="protein"] .fx-bar i { background: var(--macro-protein); }
.fx-macro[data-macro="carbs"] .fx-bar i { background: var(--macro-carbs); }
.fx-macro[data-macro="fat"] .fx-bar i { background: var(--macro-fat); }
.fx-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--text); opacity: .5; }
.fx-macro-note { display: block; margin-top: var(--sp-2); color: var(--muted); font-size: 12px; }
.fx-food-sum .card-head h3 { font-size: 22px; font-variant-numeric: tabular-nums; }
.fx-food-sum .card-head h3 small { font-size: 14px; color: var(--muted); font-weight: 500; }

/* Today's training */
.fx-train { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; }
.fx-train small { display: block; color: var(--muted); font-size: 12px; }
.fx-train strong { display: block; font-size: 16px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-train-ico { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .fx-train-ico { color: var(--accent-2); }
.fx-train-ico svg { width: 22px; height: 22px; }
.fx-train.is-done .fx-train-ico { background: color-mix(in srgb, var(--macro-protein) 18%, transparent); }

/* What to do better */
.fx-insights { display: grid; gap: var(--sp-3); }
.fx-insights .fit-section-title { margin: var(--sp-2) 0 0; }
.fx-insight { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-3); align-items: start; padding: var(--sp-4); }
.fx-insight strong { display: block; font-size: 15px; }
.fx-insight p { margin: var(--sp-1) 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.fx-insight-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fx-insight-ico svg { width: 16px; height: 16px; }
.fx-insight[data-tone="warn"] .fx-insight-ico { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.fx-insight[data-tone="good"] .fx-insight-ico { background: color-mix(in srgb, var(--macro-protein) 18%, transparent); color: var(--macro-protein); }

/* Targets: tiles */
.fx-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (min-width: 900px) { .fx-targets .fx-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fx-tiles li { padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.fx-tiles small { display: block; color: var(--muted); font-size: 12px; }
.fx-tiles b { display: block; font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fx-tiles em { display: block; font-style: normal; color: var(--muted); font-size: 11px; margin-top: 2px; }
.fx-explain { margin: var(--sp-3) 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Setup and profile */
.fx-setup { text-align: center; padding: var(--sp-8) var(--sp-6); display: grid; justify-items: center; gap: var(--sp-3); }
.fx-setup h2 { font-size: 22px; letter-spacing: -.02em; }
.fx-setup p { color: var(--muted); max-width: 420px; margin: 0; line-height: 1.45; }
.fx-form-title { font-size: 16px; margin: var(--sp-2) 0 0; }
.fx-hint { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: var(--sp-1); }
.fx-safety { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.fx-safety summary { cursor: pointer; font-weight: 600; }
.fx-safety summary small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.fx-safety .fit-check { margin-top: var(--sp-3); }

/* One-tap foods */
.fx-quickfood .fit-section-title { margin: var(--sp-2) 0 var(--sp-3); }
.fx-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-2); }
.fx-chip { text-align: left; border: 0; cursor: pointer; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); min-height: 56px; }
.fx-chip b { display: block; font-size: 14px; }
.fx-chip small { color: var(--muted); font-size: 12px; }

/* Week of calories against the target line */
.fx-cols { list-style: none; padding: 0; margin: 0; height: 140px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-2); position: relative; }
.fx-cols em { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed color-mix(in srgb, var(--text) 35%, transparent); }
.fx-cols li { display: grid; grid-template-rows: 1fr auto; gap: var(--sp-1); text-align: center; }
.fx-cols li > span:first-child { position: relative; display: block; height: 100%; }
.fx-cols i { position: absolute; left: 20%; right: 20%; bottom: 0; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 3px; }
.fx-cols li.is-over i { background: var(--warn); }
.fx-cols li.is-empty i { background: var(--line); }
.fx-cols small { color: var(--muted); font-size: 12px; }

@media (max-width: 420px) { .fx-energy { grid-template-columns: 1fr; justify-items: center; } .fx-energy-stats { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .fx-ring-fill { animation: none; } .fx-bar i { transition: none; } }

/* Review fixes: buttons that are links never underline; card titles with a long note wrap cleanly */
.fx a.btn, .fx-quick a { text-decoration: none; }
.fx-weekcal .card-head, .fx-food-sum .card-head { flex-wrap: wrap; row-gap: var(--sp-1); }
.fx-weekcal .card-head .sub { flex-basis: 100%; }
.fx-tiles em { line-height: 1.35; }
