/* StartFit */
:root {
  --bg: #0d1014;
  --surface: #141920;
  --card: #192028;
  --card2: #212934;
  --line: #2a333e;
  --text: #e8edf2;
  --muted: #95a2b0;
  --faint: #5f6b79;
  --acc: #10b981;
  --acc-ink: #03140d;
  --acc-soft: rgba(16, 185, 129, .16);
  --rest: #3b82f6;
  --prep: #f59e0b;
  --switch: #a855f7;
  --hold: #f97316;
  --danger: #ef4444;
  --warn: #f59e0b;
  --r: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --tabh: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4f7; --surface: #fff; --card: #fff; --card2: #eef1f5; --line: #dfe4ea;
    --text: #131820; --muted: #5a6775; --faint: #9aa5b1;
    --acc: #059669; --acc-ink: #fff; --acc-soft: rgba(5, 150, 105, .12);
    --shadow: 0 6px 24px rgba(20, 30, 40, .12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabh) + var(--safe-b) + 20px);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.015em; }
h3 { font-size: 16px; font-weight: 650; margin-bottom: 10px; }
h4 { font-size: 13px; margin: 22px 4px 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
h4 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
p { margin: 0 0 8px; }
small { font-size: 12px; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pre { white-space: pre-line; }
.ic { flex: none; }
.link { color: var(--acc); font-size: 14px; font-weight: 600; }
.acc-text { color: var(--acc); }
.danger-text { color: var(--danger) !important; }
.err-text { color: var(--danger); }
[hidden] { display: none !important; }

/* ---------- ogrodje ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + var(--safe-t)) 12px 8px 16px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.brand b { color: var(--acc); font-weight: 800; }
.view { max-width: 860px; margin: 0 auto; padding: 16px; }
.offline { background: var(--warn); color: #1b1200; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  height: calc(var(--tabh) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--faint); }
.tabbar a.on { color: var(--acc); }
body.playing { padding-bottom: 0; overflow: hidden; }
body.playing .topbar, body.playing .tabbar, body.playing .offline { display: none; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 16px; min-height: 40px; }
.page-head h1 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.head-actions { display: flex; gap: 8px; }
.hello { margin: 4px 2px 16px; }
.hello h1 { font-size: 28px; margin-top: 2px; }

/* ---------- gradniki ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.empty { text-align: center; padding: 28px 16px; }
.empty p { color: var(--muted); }
.empty .btn { margin-top: 8px; }
.hint-card { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; border-style: dashed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; font-size: 15px;
  white-space: nowrap; transition: transform .08s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 16px; }
.btn.wide { width: 100%; }
.btn.round { width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%; flex: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border-radius: 10px; border: 0; background: transparent; color: var(--muted);
}
.icon-btn:hover, .icon-btn.on { color: var(--text); background: var(--card2); }
.icon-btn.sm { width: 34px; height: 34px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.row-actions.left { justify-content: flex-start; margin: 8px 0; }
.row-btns { display: flex; gap: 2px; flex: none; }

.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.input.sm { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.input.num { width: 90px; text-align: center; flex: none; }
textarea.input { resize: vertical; min-height: 64px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=range] { width: 100%; accent-color: var(--acc); }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fld > span small { font-weight: 500; margin-left: 4px; }
.fld.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.fld.row > span { font-size: 15px; color: var(--text); font-weight: 500; display: flex; flex-direction: column; }
.fld.row > span small { margin: 2px 0 0; }
.chk { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--acc); flex: none; }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 12px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--acc); color: var(--acc-ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--acc-soft); border-color: var(--acc); color: var(--acc); }
.search { position: relative; margin-bottom: 10px; }
.search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--card2); color: var(--muted); vertical-align: middle; }
.tag.acc, .tag.ok { background: var(--acc-soft); color: var(--acc); }
.tag.warn { background: rgba(245, 158, 11, .16); color: var(--warn); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--acc-soft); color: var(--acc); font-weight: 750; font-size: 13px; flex: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 0 0 14px; }
.stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 20px; font-weight: 750; }
.stats span { font-size: 12px; color: var(--muted); }

/* ---------- sličice, mediji ---------- */
.thumb { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; background: var(--card2); border-radius: 10px; width: 64px; height: 64px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { font-weight: 750; color: var(--faint); font-size: 18px; letter-spacing: .02em; }
.thumb.sm { width: 44px; height: 44px; border-radius: 9px; }
.thumb.sm .ph { font-size: 14px; }
.thumb.lg { width: 92px; height: 92px; border-radius: 14px; }
.pl-card-main .thumb.lg.fig-live { width: 120px; height: 120px; }
@media (max-height: 640px) { .pl-card-main .thumb.lg.fig-live { width: 88px; height: 88px; } }
.thumb.card { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
.thumb.card .ph { font-size: 28px; }
.yt-badge { position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 6px; background: #e11d2e; color: #fff; display: flex; align-items: center; justify-content: center; }
.thumb.sm .yt-badge { width: 16px; height: 16px; right: 3px; bottom: 3px; border-radius: 4px; }
.hero-img { width: 100%; max-height: 60vh; object-fit: contain; background: var(--card2); border-radius: var(--r); margin-bottom: 12px; }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; margin-bottom: 12px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- animirani trener ---------- */
.fig { display: block; width: 100%; height: 100%; }
.fig path { stroke-width: .6; stroke-linejoin: round; }
.thumb.has-fig, .fig-live { background: radial-gradient(110% 90% at 50% 30%, var(--card), var(--card2)); }
.thumb .fig { position: absolute; inset: 0; padding: 5%; }
.thumb.card.has-fig .fig { padding: 4% 8%; }
.fig-stage {
  position: relative; width: 100%; height: min(56vh, 420px); border-radius: var(--r); margin-bottom: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 25%, var(--card), var(--card2)); border: 1px solid var(--line);
}
.fig-stage .fig-box { position: absolute; inset: 8px 8px 48px; }
.fig-stage .fig { cursor: grab; }
.fig-stage .fig.dragging { cursor: grabbing; }
.fig-ctl { position: absolute; left: 10px; right: 12px; bottom: 8px; display: flex; align-items: center; gap: 10px; }
.fig-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; }
.fig-btn:active { transform: scale(.94); }
.fig-hint { margin-left: auto; font-size: 12px; color: var(--faint); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg.sm { margin: 0; padding: 2px; border-radius: 10px; }
.seg.sm button { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.anim-edit { display: flex; gap: 14px; align-items: center; }
.anim-side { min-width: 0; flex: 1; }
.anim-side .media-btns { flex-direction: row; flex-wrap: wrap; }
.anim-side p { margin-bottom: 10px; }
.fig-prev { width: 130px; height: 130px; flex: none; border-radius: 12px; overflow: hidden; color: var(--faint); display: flex; align-items: center; justify-content: center; background: radial-gradient(110% 90% at 50% 30%, var(--card), var(--card2)); }
.fig-prev > .fig { padding: 4px; }
@media (max-width: 420px) { .anim-edit { flex-direction: column; align-items: stretch; } .fig-prev { width: 100%; height: 190px; } }
.fig-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.fig-pick-it { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: left; font-size: 13px; font-weight: 600; line-height: 1.25; }
.fig-pick-it.hit { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.fig-pick-it:active { transform: scale(.98); }
.fig-pick-img { display: block; position: relative; aspect-ratio: 1; border-radius: 9px; background: radial-gradient(110% 90% at 50% 30%, var(--card), var(--card2)); }
.fig-pick-img .fig { position: absolute; inset: 0; padding: 6%; }

/* urejevalnik gibanja */
.fe-top { position: sticky; top: -10px; z-index: 3; background: var(--surface); padding: 4px 0 0; }
.fe-stage { height: min(34vh, 300px); margin-bottom: 8px; }
.fe-steps { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.fe-steps::-webkit-scrollbar { display: none; }
.fe-steps .chip { display: inline-flex; align-items: center; gap: 4px; }
.fe-note { margin: 10px 0 0; }
#feStep { padding-top: 12px; }
.fe-grp { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin: 8px 0; background: var(--card); }
.fe-grp > summary { padding: 12px 0; font-weight: 650; cursor: pointer; }
.fe-grp[open] > summary { margin-bottom: 4px; }
.fe-sl { display: grid; grid-template-columns: 1fr 50px; gap: 0 10px; align-items: center; margin: 2px 0 8px; }
.fe-sl .fe-lb { grid-column: 1 / -1; font-size: 13px; color: var(--muted); font-weight: 600; }
.fe-sl output { text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.fe-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fe-cols h5, .fe-h { margin: 8px 0 4px; font-size: 13px; }
.fe-h small { display: block; font-weight: 500; }
.fe-checks { display: flex; flex-wrap: wrap; gap: 0 16px; }
@media (max-width: 560px) { .fe-cols { grid-template-columns: 1fr; } }

.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.ex-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ex-card:active { transform: scale(.98); }
.ex-info { padding: 10px 12px 12px; }
.ex-name { font-weight: 650; font-size: 15px; line-height: 1.25; }
.ex-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.link-list a { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 600; }
.link-list a:first-child { border-top: 0; }

.media-edit { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.img-prev { width: 110px; height: 110px; border-radius: 12px; background: var(--card2); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--faint); flex: none; }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-prev.busy { opacity: .4; }
.media-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.sticky-save { position: sticky; bottom: calc(var(--tabh) + var(--safe-b) + 8px); z-index: 5; padding-top: 8px; }
.sticky-save .btn { box-shadow: var(--shadow); }

/* ---------- treningi ---------- */
.list { display: flex; flex-direction: column; }
.w-card { display: flex; align-items: center; gap: 12px; }
.w-main { flex: 1; min-width: 0; }
.w-name { font-weight: 700; font-size: 17px; margin-bottom: 2px; }
.blk-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.blk-title h3 { margin: 0; }
.it-line { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.blk-title + .it-line { border-top: 0; }
.it-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.it-adj { flex: none; padding: 0 10px; color: var(--acc); }
.it-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.it-name { font-weight: 600; font-size: 15px; }
.it-pause { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--rest); font-weight: 600; margin-top: 1px; }
.it-pause:empty, .it-pause:has(> span:empty) { display: none; }

.blk { padding: 14px; }
.blk-head { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.blk-name { font-weight: 700; font-size: 17px; }
.items { margin: 4px 0 12px; }
.it { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--bg); }
.it.open { border-color: var(--acc); }
.it-row { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; }
.it-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 2px 0; }
.it-main .chev { color: var(--faint); margin-left: auto; }
.it-edit { padding: 4px 12px 12px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- domov, teden ---------- */
.today-card { border-color: var(--acc); background: linear-gradient(160deg, var(--acc-soft), var(--card) 60%); }
.today-w { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.today-w + .today-w { border-top: 1px solid var(--line); padding-top: 12px; }
.tw-name { font-weight: 700; font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.ws-day b { font-size: 16px; color: var(--text); }
.ws-day i { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ws-day.planned i { background: var(--card2); box-shadow: inset 0 0 0 2px var(--faint); }
.ws-day.done i { background: var(--acc); color: var(--acc-ink); box-shadow: none; }
.ws-day.today { border-color: var(--acc); }
.days { display: grid; gap: 0 12px; }
@media (min-width: 700px) { .days { grid-template-columns: 1fr 1fr; } }
.day.today { border-color: var(--acc); }
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.day-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; min-height: 22px; }
.day-item { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px 6px 12px; }
.day-item > a:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- dnevnik ---------- */
.list-card { padding: 4px 12px; }
.hist { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.card > .hist:first-of-type, .list-card > .hist:first-child { border-top: 0; }
.hist-date { display: flex; flex-direction: column; align-items: center; width: 38px; flex: none; }
.hist-date b { font-size: 18px; }
.hist-date span { font-size: 11px; color: var(--muted); }
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; border: 0; background: transparent; padding: 0; gap: 2px; }
.hist-main:disabled { opacity: 1; }
.hist-name { font-weight: 650; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hist-note { color: var(--muted); }
.set-list { display: flex; flex-direction: column; gap: 10px; }
.set-grp { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.set-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 8px; }
.set-rows { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: var(--card2); }
.set-chip small { color: var(--acc); font-weight: 750; }
.set-chip.skip { opacity: .45; text-decoration: line-through; }

/* ---------- modal, toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); padding-bottom: var(--safe-b); animation: up .2s ease-out; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 12px 4px 18px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 10px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body > p:first-child:last-child { margin: 6px 0 4px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 10px 18px 18px; }
@media (min-width: 640px) {
  .modal-wrap { align-items: center; }
  .modal { border-radius: 20px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow-y: auto; margin: 0 -6px; }
.pick { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; }
.pick:hover, .pick:focus-visible { background: var(--card2); }
.pick span:last-child { display: flex; flex-direction: column; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabh) + var(--safe-b) + 14px); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; animation: up .2s; }
.toast.err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
/* med vadbo zgoraj – spodaj so gumbi (Potek, Preskoči vajo), ki jih obvestilo ne sme prekriti */
body.playing #toasts { bottom: auto; top: calc(var(--safe-t) + 64px); }

/* ---------- vodenje treninga ---------- */
.player {
  --ph: var(--acc);
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--bg); padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  overflow-y: auto;
}
.player.run { background: radial-gradient(120% 70% at 50% 20%, color-mix(in srgb, var(--ph) 22%, var(--bg)), var(--bg) 75%); transition: background .4s; }
.player.ph-rest { --ph: var(--rest); }
.player.ph-prep { --ph: var(--prep); }
.player.ph-switch { --ph: var(--switch); }
.player.g-hold { --ph: var(--hold); }
.player.paused { --ph: var(--faint); }
.pl-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.pl-title { flex: 1; min-width: 0; text-align: center; }
.pl-wname { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-clock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-progress { height: 4px; background: var(--line); margin: 0 14px; border-radius: 4px; overflow: hidden; }
.pl-progress div { height: 100%; width: 0; background: var(--ph); transition: width .3s; }
.pl-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 16px; max-width: 560px; width: 100%; margin: 0 auto; }
.pl-phase { font-size: 14px; font-weight: 800; letter-spacing: .14em; color: var(--ph); padding: 4px 14px; border-radius: 99px; background: color-mix(in srgb, var(--ph) 16%, transparent); }
.pl-ctx { font-size: 13px; color: var(--muted); min-height: 18px; text-align: center; }
.pl-card { display: flex; align-items: stretch; width: 100%; border-radius: 18px; border: 1px solid var(--line); background: var(--card); background: color-mix(in srgb, var(--card) 85%, transparent); overflow: hidden; }
.pl-card-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px; text-align: left; border: 0; background: transparent; position: relative; }
.pl-adj { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ph); font-size: 12px; font-weight: 700; }
.pl-adj:active { background: color-mix(in srgb, var(--ph) 12%, transparent); }
.pl-card-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pl-pre { font-size: 12px; font-weight: 700; color: var(--ph); text-transform: uppercase; letter-spacing: .08em; }
.pl-name { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 750; line-height: 1.2; }
.pl-dose { font-size: 16px; font-weight: 600; color: var(--text); }
.pl-side { align-self: flex-start; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 8px; background: var(--ph); color: #fff; }
.pl-notes { font-size: 13px; color: var(--muted); }
.pl-info { position: absolute; top: 8px; right: 8px; color: var(--faint); }

/* ---------- popravek vaje ---------- */
.adj-mode-wrap { margin-bottom: 6px; }
.adj-mode { margin-bottom: 4px; }
.adj-mode.changed { border-color: var(--acc); }
.adj-mode-hint { min-height: 18px; }
.adj-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.adj-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.adj-row.changed { border-color: var(--acc); background: var(--acc-soft); }
.adj-label { display: flex; flex-direction: column; font-weight: 600; font-size: 15px; min-width: 0; }
.adj-ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.adj-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); font-size: 22px; font-weight: 600; line-height: 1; padding: 0; }
.adj-btn:active { transform: scale(.94); background: var(--acc-soft); }
.adj-in { width: 84px; min-height: 44px; text-align: center; font-weight: 700; padding: 6px; }
.adj-row.changed .adj-in { color: var(--acc); border-color: var(--acc); }
.adj-unit { font-size: 13px; color: var(--muted); margin-left: -2px; }
@media (max-width: 380px) { .adj-in { width: 64px; } .adj-btn { width: 40px; } }
.pl-ring { position: relative; width: min(64vw, 36vh, 300px); aspect-ratio: 1; border: 0; background: transparent; padding: 0; margin: 4px 0; }
.pl-ring svg { width: 100%; height: 100%; }
.pl-ring circle { fill: none; stroke-width: 10; }
.pl-ring .rb { stroke: var(--line); }
.pl-ring .rf { stroke: var(--ph); stroke-linecap: round; transition: stroke-dashoffset .12s linear, stroke .3s; }
.pl-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#plTime { font-size: clamp(48px, 15vw, 84px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
#plTime.long { font-size: clamp(34px, 10vw, 56px); }
.pl-tsub { font-size: 14px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.pl-action { display: flex; gap: 10px; justify-content: center; min-height: 44px; width: 100%; }
.done-btn { width: 100%; max-width: 360px; min-height: 64px; font-size: 20px; border-radius: 18px; background: var(--acc); border-color: var(--acc); color: var(--acc-ink); box-shadow: 0 8px 26px color-mix(in srgb, var(--acc) 35%, transparent); }
.pl-next { font-size: 14px; text-align: center; min-height: 20px; }
.pl-ctrl { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 10px 0 10px; }
.pl-extra { display: flex; justify-content: center; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px 16px; }
.pl-extra .btn { flex: 1; max-width: 220px; min-height: 44px; }
.pl-extra b { font-variant-numeric: tabular-nums; color: var(--ph); }
.ctl { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; }
.ctl.main { width: 72px; height: 72px; background: var(--ph); border-color: var(--ph); color: #fff; }
.ctl:active { transform: scale(.94); }
@media (max-height: 640px) {
  .thumb.lg { width: 70px; height: 70px; }
  .pl-name { font-size: 18px; }
  .pl-body { gap: 6px; padding-top: 6px; }
  .pl-ctrl { padding: 6px 0; }
  .pl-extra { padding-bottom: 10px; }
}

/* potek vadbe (seznam vaj s stanjem) */
.prog-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 2px 4px; }
.prog-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.prog-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 8px; border: 1px solid transparent; border-radius: 12px; background: transparent; }
.prog-row:hover, .prog-row:focus-visible { background: var(--card2); }
.prog-ic { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--faint); }
.prog-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; }
.prog-name .tag { margin-left: 6px; }
.prog-cnt { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-row.st-done .prog-ic { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.prog-row.st-done .prog-name { color: var(--muted); font-weight: 500; }
.prog-row.st-cur { border-color: var(--acc); background: var(--acc-soft); }
.prog-row.st-cur .prog-ic { border-color: var(--acc); color: var(--acc); }
.prog-row.st-skip .prog-ic, .prog-row.st-part .prog-ic { border-color: var(--warn); color: var(--warn); }

/* nedokončana vadba (domov, uvod v vadbo) */
.resume-card { border-color: var(--prep); background: linear-gradient(160deg, rgba(245, 158, 11, .13), var(--card) 60%); }
.resume-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.resume-card h3 .ic { color: var(--prep); }
.intro-body .resume-card { margin: 0; }
.intro-body .resume-card p { margin: 0 0 12px; }

.intro-body, .sum-body { max-width: 520px; width: 100%; margin: 0 auto; padding: 12px 20px 30px; display: flex; flex-direction: column; gap: 14px; }
.intro-body h1, .sum-body h1 { font-size: 28px; text-align: center; }
.intro-body .stats, .sum-body .stats { margin: 0; }
.intro-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.sum-body { align-items: stretch; text-align: center; padding-top: 40px; }
.sum-body h3 { margin: 10px 0 0; }
.sum-ic { width: 80px; height: 80px; margin: 0 auto; border-radius: 50%; background: var(--acc); color: var(--acc-ink); display: flex; align-items: center; justify-content: center; }
.sum-ic.warn { background: var(--warn); color: #1b1200; }
.rpe { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rpe button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 700; padding: 0; }
.rpe button.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.rpe-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: -8px; }
