:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --ink: #15171c;
  --ink-2: #474c57;
  --muted: #7b808b;
  --line: #e5e2db;
  --accent: #ff5b2e;
  --accent-2: #e8481c;
  --accent-ink: #ffffff;
  --accent-soft: #ffe8df;
  --ok: #138a4b;
  --ok-soft: #dcf3e6;
  --warn: #a86a00;
  --warn-soft: #fff1d6;
  --bad: #c9362c;
  --bad-soft: #fde4e1;
  --photo-bg: #ffffff;
  --fig-line: #cdc8bd;
  --fig-far: #a3a7af;
  --shadow: 0 1px 2px rgba(22, 20, 15, 0.05), 0 8px 24px rgba(22, 20, 15, 0.07);
  --shadow-lg: 0 18px 50px rgba(22, 20, 15, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1f2630;
    --ink: #eef1f5;
    --ink-2: #c1c7d0;
    --muted: #8d95a3;
    --line: #29303a;
    --accent: #ff6b3f;
    --accent-2: #ff8257;
    --accent-ink: #1a0b05;
    --accent-soft: #3b2119;
    --ok: #4cc987;
    --ok-soft: #12301f;
    --warn: #f2b84b;
    --warn-soft: #33270f;
    --bad: #ff7a70;
    --bad-soft: #3a1714;
    --photo-bg: #f4f4f4;
    --fig-line: #3b4350;
    --fig-far: #5d6674;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
#view:focus { outline: none; }

.ic { width: 22px; height: 22px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.screen { padding: 0 var(--gutter) calc(32px + var(--bottom)); animation: enter 0.22s ease-out; }
.screen.has-dock { padding-bottom: calc(108px + var(--bottom)); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.boot { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  margin: 0 calc(-1 * var(--gutter));
  padding: calc(8px + var(--top)) 8px 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar h1 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink);
}
.icon-btn:active { background: var(--surface-2); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0;
  background: var(--surface-2); color: var(--ink);
  font-weight: 650; font-size: 16px; letter-spacing: -0.01em; text-decoration: none;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:active { background: var(--accent-2); }
.btn.big { min-height: 60px; font-size: 17px; border-radius: 18px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--accent); padding: 0 12px; min-height: 44px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; gap: 6px; }
.btn.small .ic { width: 18px; height: 18px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ---------- home */
.brand { display: flex; align-items: center; gap: 12px; padding: calc(18px + var(--top)) 0 6px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.brand-mark .ic { width: 24px; height: 24px; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.brand-by { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.brand .icon-btn { margin-left: auto; color: var(--muted); }

.hero {
  position: relative; overflow: hidden;
  margin-top: 14px; padding: 22px 20px 20px;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow);
}
.hero h2 { margin: 0; font-size: clamp(28px, 8vw, 34px); line-height: 1.04; font-weight: 850; letter-spacing: -0.035em; }
.hero h2 em { font-style: normal; color: var(--accent); }
.hero p { margin: 10px 0 18px; color: var(--ink-2); font-size: 15.5px; max-width: 30ch; }
.hero-art ~ p { margin-right: 104px; }
@media (max-width: 360px) { .hero-art ~ p { margin-right: 0; } }
.hero .stack { display: grid; gap: 10px; }
.hero-art { position: absolute; right: -8px; top: 14px; width: 118px; height: 132px; pointer-events: none; }
.hero-art .card-a, .hero-art .card-b { position: absolute; width: 92px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--photo-bg); border: 3px solid var(--surface); }
.hero-art .card-a { right: 22px; top: 0; transform: rotate(-8deg); }
.hero-art .card-b { right: 4px; top: 46px; transform: rotate(6deg); }
.hero-art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 360px) { .hero-art { display: none; } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 10px; }
.section-title h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tile {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px; border: 0; border-radius: var(--radius); text-align: left;
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.tile:active { transform: scale(0.99); }
.tile .thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .meta { flex: 1; min-width: 0; }
.tile .t { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile > .ic { color: var(--muted); width: 18px; height: 18px; }
.empty-note { padding: 16px; border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 14.5px; box-shadow: var(--shadow); }
.how { display: grid; gap: 12px; margin-top: 10px; }
.how-step { display: flex; gap: 12px; align-items: flex-start; }
.how-step b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.how-step span { color: var(--ink-2); font-size: 15px; padding-top: 3px; }
.foot { margin-top: 30px; text-align: center; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }

/* ---------- animated preview: start and end photo crossfading */
.anim { position: relative; overflow: hidden; width: 100%; height: 100%; background: var(--photo-bg); }
.anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.anim img.b { animation: flip 2.6s ease-in-out infinite; }
.anim.contain img { object-fit: contain; }
.anim.paused img.b { animation-play-state: paused; }
@keyframes flip { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.no-photo { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); background: var(--surface-2); }

/* animated figure for exercises without photos (lib/figure.js) */
.fig { width: 100%; height: 100%; background: var(--surface-2); }
.fig svg { display: block; width: 100%; height: 100%; }
.fig .st { stroke: var(--fig-line); stroke-width: 3; fill: none; stroke-linecap: round; }
.fig .st.faint { stroke-dasharray: 4 6; stroke-width: 1.5; }
.fig .nr, .fig .fr { stroke-width: 9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fig .nr { stroke: var(--ink); }
.fig .fr { stroke: var(--fig-far); }
.fig .hd { fill: var(--ink); }
.fig .pr { fill: var(--accent); }
.fig .pr.far { opacity: 0.5; }
.fig .pr-o { fill: var(--surface); stroke: var(--accent); stroke-width: 5; }
.fig .pr-line { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; }
.fig .pr-line.far { opacity: 0.5; }
.player .fig { position: absolute; inset: 0; padding: calc(44px + var(--top)) 8px 8px; }
.no-photo .ic { width: 28px; height: 28px; }
@media (prefers-reduced-motion: reduce) {
  .anim img.b { animation: none; opacity: 0; }
  .screen, .sheet { animation: none !important; transition: none !important; }
}

/* ---------- workout */
.photo-strip { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; padding: 10px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.photo-strip button.ph { width: 64px; height: 64px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-2); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; }
.photo-strip .meta { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); }
.photo-strip .meta b { display: block; color: var(--ink); font-size: 15px; }

.entries { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.h-entry { margin: 14px 2px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.h-entry b { font-size: 13px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.h-entry span { font-size: 13px; color: var(--muted); }
.scheme { justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.rest { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.rest::before, .rest::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.note { font-size: 14px; color: var(--muted); padding: 0 4px; font-style: italic; }

.ex {
  display: flex; gap: 14px; align-items: stretch;
  padding: 10px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  position: relative;
}
.ex .open { position: absolute; inset: 0; border: 0; background: transparent; border-radius: var(--radius); z-index: 1; }
.ex .open:active { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ex .pic { width: 104px; height: 80px; border-radius: 12px; overflow: hidden; flex: none; align-self: center; }
.ex .body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-right: 2px; }
.ex .name { font-weight: 700; font-size: 16.5px; line-height: 1.2; letter-spacing: -0.015em; }
.ex .src { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.rx { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.ex .fix { position: relative; z-index: 2; align-self: flex-start; margin-top: 2px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--accent); font-weight: 650; font-size: 13.5px; padding: 6px 0; }
.ex .fix .ic { width: 16px; height: 16px; }
.ex.unknown .pic { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 30px; font-weight: 800; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px var(--gutter) calc(12px + var(--bottom));
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.dock-inner { max-width: 608px; margin: 0 auto; display: flex; gap: 10px; }
.dock-inner .btn.primary { flex: 1; }

/* ---------- scan */
.scan { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: calc(8px + var(--top)) var(--gutter) calc(24px + var(--bottom)); }
.scan .stage { position: relative; flex: 1; margin: 8px 0 20px; border-radius: 24px; overflow: hidden; background: #000; min-height: 40vh; }
.scan .stage img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.scan .beam { position: absolute; left: 0; right: 0; height: 22%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 45%, transparent) 85%, var(--accent)); opacity: 0.85; animation: beam 2.2s ease-in-out infinite alternate; mix-blend-mode: screen; }
@keyframes beam { from { top: -22%; } to { top: 100%; } }
.scan .status { text-align: center; }
.scan .status b { display: block; font-size: 19px; letter-spacing: -0.01em; }
.scan .status span { display: block; color: var(--muted); font-size: 14.5px; margin-top: 4px; min-height: 1.4em; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 16px auto 0; max-width: 320px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width 0.25s ease; }
.bar.indeterminate i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.scan .error { margin-top: 18px; display: grid; gap: 10px; }
.scan .error p { margin: 0 0 6px; text-align: center; color: var(--ink-2); }

/* ---------- demo media: video / photos / animation */
.media { margin: 0 calc(-1 * var(--gutter)); }
.media-box { position: relative; background: #000; }
.vid { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.vid.vert { width: auto; height: min(72vh, 640px); aspect-ratio: 9 / 16; margin: 0 auto; }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media .player { margin: 0; width: 100%; }
.media-tabs { display: flex; gap: 8px; padding: 10px var(--gutter) 0; }
.media-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 650; font-size: 14px; }
.media-tabs button .ic { width: 14px; height: 14px; }
.media-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vbadge { position: absolute; right: 6px; bottom: 6px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.62); color: #fff; }
.vbadge .ic { width: 12px; height: 12px; margin-left: 2px; }
.ex .pic { position: relative; }
.go .pic { aspect-ratio: auto; overflow: visible; border-radius: 0; box-shadow: none; }
.go .pic .media { margin: 0; }
.go .pic .media-box { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.go .pic .media-tabs { padding: 10px 0 0; }
.go .pic .player { aspect-ratio: 3 / 2; }

/* ---------- exercise detail */
.player { position: relative; margin: 0 calc(-1 * var(--gutter)); aspect-ratio: 3 / 2; max-height: 62vh; width: calc(100% + 2 * var(--gutter)); }
.player .anim { position: absolute; inset: 0; }
.player-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; justify-content: space-between; padding: calc(8px + var(--top)) 8px 8px; }
.player-top .icon-btn { background: color-mix(in srgb, #000 42%, transparent); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.player-ctl { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 10px; }
.phase { display: flex; gap: 6px; padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, #000 50%, transparent); color: #fff; font-size: 12.5px; font-weight: 650; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.phase span { opacity: 0.55; transition: opacity 0.2s; }
.phase span.on { opacity: 1; }
.player-ctl .icon-btn { margin-left: auto; background: color-mix(in srgb, #000 50%, transparent); color: #fff; width: 40px; height: 40px; }
.player.nophoto { aspect-ratio: auto; height: calc(150px + var(--top)); background: var(--surface-2); }
.player.nophoto .no-photo { padding-top: var(--top); flex-direction: column; gap: 6px; font-size: 14px; }

.detail h2 { margin: 18px 0 8px; font-size: 26px; line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; }
.yourset { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); display: flex; gap: 10px; align-items: center; }
.yourset b { color: var(--accent); }
.yourset .src { display: block; font-size: 12.5px; color: var(--muted); }
.block { margin-top: 22px; }
.block h3 { margin: 0 0 10px; font-size: 13px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.muscles { display: grid; gap: 6px; font-size: 15px; }
.muscles .k { color: var(--muted); font-size: 13.5px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); font-weight: 750; font-size: 14px; margin-top: -1px; }
.video-btn { margin-top: 22px; }
.credit { margin-top: 26px; font-size: 12.5px; color: var(--muted); }

/* ---------- library */
.searchbox { position: relative; margin: 4px 0 10px; }
.searchbox .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.searchbox input { width: 100%; height: 50px; padding: 0 16px 0 44px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
.searchbox input:focus { border-color: var(--accent); }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { font-size: 13px; color: var(--muted); margin: 0 2px 8px; }

/* ---------- sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 14, 0.45); opacity: 0; transition: opacity 0.24s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  max-height: calc(100dvh - 24px - var(--top)); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px var(--gutter) calc(18px + var(--bottom)); border-radius: 24px 24px 0 0;
  background: var(--bg); box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 10px; }
.sheet h2 { margin: 4px 0 4px; font-size: 21px; letter-spacing: -0.02em; }
.sheet .lead { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.sheet textarea { width: 100%; min-height: 220px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; line-height: 1.5; resize: vertical; outline: none; }
.sheet textarea:focus { border-color: var(--accent); }
.sheet .actions { display: grid; gap: 10px; margin-top: 14px; }
.sheet.photo { padding: 8px 8px calc(12px + var(--bottom)); background: #000; }
.sheet.photo img { width: 100%; max-height: calc(100dvh - 80px); object-fit: contain; border-radius: 16px; }
.pick-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pick-list .tile { box-shadow: none; border: 1.5px solid var(--line); }
.pick-list .tile.best { border-color: var(--accent); }
.menu { display: grid; gap: 8px; }
.menu .btn { justify-content: flex-start; }

/* ---------- guided workout */
.go { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 0 var(--gutter) calc(16px + var(--bottom)); }
.go .progress { display: flex; gap: 4px; margin: 4px 0 12px; }
.go .progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.go .progress i.done { background: var(--accent); }
.go .progress i.now { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.go .pic { border-radius: 22px; overflow: hidden; aspect-ratio: 3 / 2; box-shadow: var(--shadow); }
.go h2 { margin: 16px 0 6px; font-size: 26px; line-height: 1.1; letter-spacing: -0.03em; }
.go .target { font-size: 18px; font-weight: 700; color: var(--accent); }
.sets { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.sets button { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-weight: 800; font-size: 17px; }
.sets button.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.restcard { margin-top: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.restcard .clock { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.restcard .lbl { color: var(--muted); font-size: 13.5px; }
.restcard .btn { margin-left: auto; }
.go .nav { margin-top: auto; padding-top: 16px; display: flex; gap: 10px; }
.go .nav .btn.primary { flex: 1; }
.go .peek { margin-top: 14px; font-size: 14px; color: var(--muted); }
.go .peek b { color: var(--ink-2); }
.finish { text-align: center; padding-top: 18vh; }
.finish .big { font-size: 64px; }
.finish h2 { font-size: 28px; margin: 8px 0; letter-spacing: -0.03em; }
.finish p { color: var(--muted); }

/* ---------- toast */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--bottom)); z-index: 60; transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg);
  font-size: 14.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.about p, .about li { color: var(--ink-2); font-size: 15px; }
.about h3 { margin-top: 24px; }
.about ul { padding-left: 20px; }
