/* Near-black canvas, lifted cards, a pink-to-orange "move" gradient as the accent, and colour-coded rings. */
:root {
  --bg: #0b0b0f;
  --card: #16161a;
  --card2: #222228;
  --ink: #f5f5f7;
  --muted: #a3a3ad;
  --dim: #8a8a94;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.14);
  --accent: #ff375f;
  --accent-bg: #fa114f;
  --grad: linear-gradient(135deg, #fa114f 0%, #ff4d3d 55%, #ff7a2f 100%);
  --accent-soft: rgba(250, 17, 79, 0.14);
  --good: #4ade80;
  --lime: #a3e635;
  --cyan: #22d3ee;
  --gold: #f5b83d;
  --bad: #ff375f;
  --warn: #fbbf24;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pad: clamp(16px, 4vw, 28px);
  --r: 22px;
  --top-h: calc(54px + env(safe-area-inset-top));
}

* { box-sizing: border-box; }
html { scroll-padding-top: var(--top-h); -webkit-text-size-adjust: 100%; overscroll-behavior-x: none; -webkit-tap-highlight-color: transparent; }
html.on-log { overscroll-behavior-y: contain; }
body {
  margin: 0; color: var(--ink);
  background: radial-gradient(120% 60% at 100% -10%, rgba(250, 17, 79, 0.10), transparent 60%) no-repeat, var(--bg);
  font: 16px/1.45 var(--sans); font-feature-settings: "tnum" 1;
  padding-top: var(--top-h);
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
a { color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0.35rem 0; }
button { font: inherit; color: inherit; }
button, a, summary, label, select, input, textarea { touch-action: manipulation; }
button, .btn, .cta, .pill, .tabs a, .dot, .subtabs a, summary { -webkit-user-select: none; user-select: none; }

.mono { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.small { font-size: 0.86rem; }
.muted { color: var(--muted); }
.r { text-align: right; }
.c { text-align: center; }
.hidden { display: none !important; }
.up { color: var(--good); }
.down { color: var(--bad); }
.same { color: var(--muted); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--bad) !important; }
.accent-text { color: var(--accent); }
.gold-text { color: var(--gold); }
.display { font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }

/* ---------- Top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) 10px max(var(--pad), env(safe-area-inset-left));
  background: rgba(11, 11, 15, 0.82); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.brand { position: relative; display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.08em; }
.brand::after { content: ""; position: absolute; inset: -10px -6px; }
.brand i { font-style: normal; color: var(--accent); margin-left: -0.1em; }
#top-right { display: flex; align-items: center; gap: 8px; }
.pill { position: relative; font-size: 0.78rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; text-decoration: none; background: var(--card2); white-space: nowrap; }
.pill.live { background: var(--grad); color: #fff; }
.pill.live::before, .pill.sync::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pill.live::before { background: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.pill.sync { color: var(--muted); }
.pill.sync::before { background: var(--good); }
.pill.s-syncing::before, .pill.s-pending::before { animation: pulse 1.2s infinite; }
.pill.s-offline::before { background: var(--dim); }
.pill.s-error, .pill.s-signedout { color: var(--warn); }
.pill.s-error::before, .pill.s-signedout::before { background: var(--warn); }
.pill::after { content: ""; position: absolute; inset: -9px -4px; }

main { max-width: 640px; margin: 0 auto; padding: 4px max(var(--pad), env(safe-area-inset-right)) 24px max(var(--pad), env(safe-area-inset-left)); }

/* ---------- Headings ---------- */
.page-title { font-size: 2rem; margin: 8px 0 14px; }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 22px 4px 8px; font-size: 0.95rem; font-weight: 700; }
.label b { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
.eyebrow { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

/* ---------- Cards ---------- */
.panel { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 40%), var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 10px 0; }
.panel h3 { font-size: 1.35rem; margin-bottom: 6px; }
.panel.accent { background: linear-gradient(135deg, rgba(250, 17, 79, 0.22), rgba(255, 122, 47, 0.10)), var(--card); border-color: rgba(250, 17, 79, 0.35); }
.panel.warn { border-color: rgba(251, 191, 36, 0.35); background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), transparent 60%), var(--card); }
.panel.flat { background: none; border: 0; padding: 0; }
.framed { }
.list { padding: 4px 18px; }

/* ---------- Today hero ---------- */
.hero { position: relative; overflow: hidden; border: 1px solid rgba(250, 17, 79, 0.22); border-radius: 26px; padding: 22px 18px 18px; margin: 6px 0 10px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(250, 17, 79, 0.30), transparent 60%), radial-gradient(70% 90% at 0% 100%, rgba(255, 122, 47, 0.12), transparent 60%), var(--card); }
.hero.rest-day { border-color: rgba(34, 211, 238, 0.22); background: radial-gradient(90% 120% at 100% 0%, rgba(34, 211, 238, 0.20), transparent 60%), var(--card); }
.hero.cleared { border-color: rgba(163, 230, 53, 0.25); background: radial-gradient(90% 120% at 100% 0%, rgba(163, 230, 53, 0.20), transparent 60%), var(--card); }
.hero .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.hero h1 { font-size: clamp(2.6rem, 12vw, 3.6rem); margin: 6px 0 2px; line-height: 1; }
.hero .lede { color: var(--muted); margin: 6px 0 16px; }
.hero.rest-day h1, .hero.cleared h1 { color: var(--ink); }
.hero .check { color: var(--lime); }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--grad); color: #fff; cursor: pointer; text-decoration: none;
  font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: 0 8px 28px rgba(250, 17, 79, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.cta:active { transform: scale(0.98); }
.cta.ghost { background: var(--card2); color: var(--ink); box-shadow: none; }
.cta + .cta, .cta + .btn { margin-top: 10px; }

/* ---------- Rings ---------- */
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 10px 14px; margin: 10px 0; text-decoration: none; color: var(--ink); }
.ring-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; text-decoration: none; color: var(--ink); }
.ring { position: relative; width: 88px; height: 88px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; opacity: 0.2; }
.ring .val { fill: none; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--glow)); }
.ring .in { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .in b { font-size: 1.45rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.ring .in b.letter { font-family: var(--display); font-size: 2.3rem; font-weight: 900; }
.r-E { color: #d1d5db; } .r-D { color: #4ade80; } .r-C { color: #22d3ee; } .r-B { color: #a78bfa; } .r-A { color: #fbbf24; } .r-S { color: #ff375f; }
.ring .in span { display: block; font-size: 0.66rem; color: var(--muted); margin-top: 2px; }
.ring-cell .cap { font-size: 0.8rem; color: var(--muted); font-weight: 500; line-height: 1.2; }
.ring-cell .cap b { display: block; color: var(--ink); font-weight: 600; }
.ring.lg { width: 150px; height: 150px; }
.ring.lg .in b.letter { font-size: 4.2rem; }
.ring.sm { width: 46px; height: 46px; }
.ring.sm .in b { font-size: 0.78rem; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-width: 0; }
.stat .n { font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.stat .mono { display: block; margin-top: 2px; }
.stat .d { font-size: 0.78rem; font-weight: 600; margin-top: 4px; }
.bignum { font-size: clamp(2.6rem, 12vw, 3.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }

/* ---------- Rows (workout list, history, review) ---------- */
.daylist { list-style: none; margin: 0; padding: 4px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.dayrow, .hist, .rev-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  width: 100%; min-height: 60px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer;
}
.daylist li:last-child .dayrow { border-bottom: 0; }
.dayrow .name, .hist .name { font-weight: 650; font-size: 1.05rem; }
.dayrow .info { grid-column: 1; color: var(--muted); font-size: 0.84rem; }
.dayrow .go, .hist .go { grid-row: 1 / span 2; grid-column: 2; color: var(--dim); font-size: 1.2rem; }
.dayrow.next .name::after { content: "Today"; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 0.72rem; font-weight: 700; vertical-align: 2px; }
.dayrow:active, .hist:active, .rev-row:active { opacity: 0.6; }
.hist-group { padding: 4px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 4px; }
.hist-group .hist:last-child { border-bottom: 0; }
.hist .r { color: var(--muted); font-size: 0.84rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--card2); color: var(--ink); font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.btn.primary { background: var(--ink); color: #000; }
.btn.acc { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(250, 17, 79, 0.28); }
.btn.danger { background: none; color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 55, 95, 0.35); }
.btn.full { width: 100%; margin-top: 10px; }
.btn.sm { min-height: 44px; padding: 0 16px; font-size: 0.84rem; }
.btn.big { width: 100%; min-height: 56px; font-size: 1rem; margin-top: 10px; }
.btn.yt { margin-top: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row > .btn { flex: 1; }
.link { position: relative; background: none; border: 0; padding: 6px 0; color: var(--accent); font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.link::after { content: ""; position: absolute; left: -8px; right: -8px; top: 50%; height: 44px; transform: translateY(-50%); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
table.mini th, table.mini td { padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 0.88rem; vertical-align: top; }
table.mini th { font-size: 0.76rem; color: var(--muted); font-weight: 500; text-align: left; }
table.mini th.r { text-align: right; }
table.mini tr:last-child td { border-bottom: 0; }
table.mini tr.has-note td { border-bottom: 0; padding-bottom: 2px; }
table.mini tr.note-row td { padding-top: 0; }

/* ---------- Exercise tier badges ---------- */
.tier { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; vertical-align: middle; white-space: nowrap; background: var(--card2); color: var(--muted); }
.t-splus { background: var(--grad); color: #fff; }
.t-s { background: rgba(245, 184, 61, 0.16); color: var(--gold); }
.t-a { box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); background: none; }
.t-pick { background: none; box-shadow: inset 0 0 0 1px var(--line2); }

/* ---------- Exercise screen ---------- */
.ex-head span:first-child { text-transform: capitalize; }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 0.82rem; }
.ex-title { font-size: clamp(1.6rem, 7vw, 2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin-top: 4px; }
.ex-sub { margin-top: 2px; color: var(--muted); font-size: 0.9rem; }
.ex-top { display: flex; gap: 14px; align-items: center; }
.ex-info { flex: 1; min-width: 0; }
.ex-name { font-weight: 650; }
.thumb { position: relative; flex: 0 0 64px; width: 64px; height: 64px; padding: 0; border-radius: 14px; overflow: hidden; border: 0; background: #fff; cursor: pointer; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb img.f2, .ex-media .photo img.f2 { animation: flip 2.4s steps(1) infinite; }
@keyframes flip { 0% { opacity: 0; } 50% { opacity: 1; } }
.ex-media { display: grid; grid-template-columns: 1fr 38%; gap: 8px; margin-top: 14px; }
.ex-media .photo { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border-radius: 16px; overflow: hidden; border: 0; background: #fff; cursor: pointer; }
.ex-media .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-media .photo::after { content: "How to"; position: absolute; left: 8px; bottom: 8px; font-size: 0.72rem; font-weight: 700; background: rgba(0, 0, 0, 0.75); color: #fff; padding: 4px 9px; border-radius: 999px; }
.ex-media .mmap { display: grid; align-items: center; }
.target { margin-top: 12px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(250, 17, 79, 0.16), rgba(255, 122, 47, 0.06)), var(--card); border: 1px solid rgba(250, 17, 79, 0.25); }
.target .t-main { font-size: 1.05rem; font-weight: 650; }
.target .t-last { font-size: 0.84rem; color: var(--muted); margin-top: 2px; }
.ex-actions { display: flex; gap: 22px; margin-top: 12px; }
.prev-note { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card2); font-size: 0.86rem; }
.prev-note .mono { display: block; margin-bottom: 2px; }
.ex-note { display: block; margin-top: 4px; color: var(--ink); font-style: italic; }
.ex-note::before { content: "“"; }
.ex-note::after { content: "”"; }
.note-box { margin-top: 12px; }
.note-box summary { list-style: none; cursor: pointer; display: inline-block; padding: 8px 0; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.note-box summary::-webkit-details-marker { display: none; }
.note-box textarea { margin-top: 6px; }

/* How-to sheet */
.howto { margin-top: 8px; }
.frames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frames img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 12px; background: #fff; }
.howto-mm { display: grid; grid-template-columns: 34% 1fr; gap: 12px; align-items: center; margin-top: 12px; }
.cues { counter-reset: c; list-style: none; padding: 0; margin: 12px 0 0; }
.cues li { counter-increment: c; display: grid; grid-template-columns: 28px 1fr; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.cues li::before { content: counter(c); color: var(--accent); font-weight: 700; }
.caution { margin: 8px 0 0; font-size: 0.86rem; color: var(--muted); }
.caution b { color: var(--warn); margin-right: 6px; }
.mm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 0.84rem; color: var(--muted); }
.mm-legend b { color: var(--ink); font-weight: 600; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.key.p { background: var(--accent); }
.key.s { background: rgba(255, 122, 47, 0.6); }

/* Set table */
table.sets { margin-top: 14px; }
table.sets th { font-size: 0.74rem; color: var(--muted); font-weight: 500; padding: 2px 3px 6px; text-align: center; }
table.sets td { padding: 3px; }
table.sets input, table.sets select {
  width: 100%; min-height: 50px; padding: 0 6px; border-radius: 14px; border: 0;
  background: var(--card2); color: var(--ink); font: inherit; font-size: 1.25rem; font-weight: 700; text-align: center;
  -moz-appearance: textfield; appearance: none;
}
table.sets select { font-size: 1rem; }
table.sets input::-webkit-outer-spin-button, table.sets input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
table.sets input:focus, table.sets select:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
table.sets input::placeholder { color: var(--dim); }
table.sets tr.done input, table.sets tr.done select { background: rgba(74, 222, 128, 0.14); color: var(--good); }
table.sets td:first-child { width: 28px; color: var(--muted); font-size: 0.84rem; }
table.sets td:nth-child(4) { width: 62px; }
table.sets td:last-child { width: 54px; }
.tick { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--card2); color: var(--muted); font-size: 1.1rem; cursor: pointer; transition: all 0.25s var(--ease); }
.tick.on { background: var(--good); color: #052e16; font-weight: 800; box-shadow: 0 0 14px rgba(74, 222, 128, 0.45); }
.small-btns .btn { flex: 0 0 auto; }

/* Workout header */
.log-head { position: sticky; top: var(--top-h); z-index: 30; background: var(--bg); padding: 4px 0 8px; }
.log-head .row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.log-head h1 { font-size: 1.6rem; }
.log-head .step { color: var(--ink); font-weight: 600; font-size: 0.86rem; white-space: nowrap; }
.bar { height: 6px; background: var(--card2); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width 0.6s var(--ease); }
.dots { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.dots::-webkit-scrollbar { display: none; }
.dot { flex: 0 0 auto; min-width: 44px; height: 36px; padding: 0 6px; border-radius: 999px; border: 0; background: var(--card); color: var(--muted); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.dot.ok { color: var(--good); }
.dot.on { background: var(--grad); color: #fff; }
#log-body { touch-action: pan-y pinch-zoom; }
.ex-screen { margin-top: 4px; }
.lognav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 12px; }
.lognav .btn.big { margin-top: 0; }
.lognav.stick { position: sticky; z-index: 20; bottom: calc(84px + env(safe-area-inset-bottom)); margin: 12px -6px 0; padding: 14px 6px 6px; background: linear-gradient(rgba(11, 11, 15, 0), var(--bg) 35%); }
body.resting .lognav.stick { bottom: calc(146px + env(safe-area-inset-bottom)); }
body.kb .lognav.stick { position: static; background: none; }
.review { padding: 4px 18px; }
.rev-row { grid-template-columns: 1fr auto; }
.rev-row:last-child { border-bottom: 0; }
.rev-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rev-main b { font-weight: 650; }

textarea, .form input, select.full {
  width: 100%; padding: 13px 14px; border-radius: 14px; border: 0;
  background: var(--card2); color: var(--ink); font: inherit; font-size: 16px;
}
textarea:focus, .form input:focus, select.full:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
textarea::placeholder, input::placeholder { color: var(--dim); opacity: 1; }
.lbl { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }

/* Rest timer */
.rest {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 45;
  width: min(616px, calc(100% - 24px));
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 20px; border-radius: 999px; background: rgba(34, 34, 40, 0.92); color: var(--ink); border: 1px solid var(--line2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.rest .mono { color: var(--ink); }
body.resting { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.rest.done { background: var(--good); color: #052e16; animation: restdone 0.5s ease-in-out 3; }
.rest.done .mono, .rest.done .small { color: #052e16; }
@keyframes restdone { 50% { transform: translateX(-50%) scale(1.03); } }
body.kb .tabs, body.kb .rest { display: none; }
.rest b { font-size: 1.5rem; font-weight: 800; margin-right: 8px; vertical-align: -2px; }

/* ---------- Summary ---------- */
.done-hero { text-align: center; padding: 22px 18px; }
.done-hero h1 { font-size: 2rem; margin: 12px 0 4px; }
.done-hero .headline { color: var(--muted); margin: 0 auto; max-width: 32ch; }
.done-hero .ring { margin: 0 auto; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cmp-head .ex-name { font-weight: 650; font-size: 1rem; }
.chip { font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--card2); color: var(--muted); }
.chips { display: flex; gap: 6px; }
.c-up, .c-heavier { background: rgba(74, 222, 128, 0.15); color: var(--good); }
.c-down { background: var(--accent-soft); color: var(--bad); }
.c-new { color: var(--ink); }
.c-skip { color: var(--warn); }
.c-pr { background: linear-gradient(135deg, #f5b83d, #ffe08a); color: #3b2500; }
.cmp-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .next { margin-top: 4px; font-size: 0.86rem; color: var(--muted); }
.cmp-row .next b { color: var(--ink); font-weight: 600; }
.tips { list-style: none; padding: 0; margin: 0; }
.tips li { padding: 8px 0 8px 18px; position: relative; font-size: 0.92rem; }
.tips li::before { content: ""; position: absolute; left: 0; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.dyk { border-color: rgba(34, 211, 238, 0.25); background: linear-gradient(135deg, rgba(34, 211, 238, 0.10), transparent 60%), var(--card); }
.dyk .eyebrow { color: var(--cyan); font-weight: 600; }
.dyk p { margin: 6px 0 0; }
.source { font-size: 0.74rem; color: var(--dim); }

/* ---------- Chart ---------- */
.chart { width: 100%; height: auto; margin: 10px 0; overflow: visible; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#g); opacity: 0.3; }
.chart .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .grid { stroke: var(--line2); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-family: var(--sans); font-size: 9px; }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.form label.check { flex-direction: row; align-items: center; min-height: 44px; gap: 10px; grid-column: 1 / -1; color: var(--ink); font-size: 0.92rem; }
.form label.check input { width: 22px; height: 22px; accent-color: var(--accent-bg); }
.form .wide { grid-column: 1 / -1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 8px 0; }
details.more > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-weight: 650; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; font-weight: 400; }
details.more[open] > summary::after { content: "−"; }

/* ---------- Plan ---------- */
.subtabs { display: flex; margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.subtabs a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.subtabs a.active { background: var(--grad); color: #fff; }
.plan-ex { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-ex:last-child { border-bottom: 0; }
.plan-ex .howto-wrap { margin-top: 10px; }
.myweek { padding: 4px 18px; }
.wk-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wk-row:last-of-type { border-bottom: 0; }
.wk-day { display: flex; gap: 8px; align-items: baseline; }
.wk-day b { font-weight: 650; }
.wk-row.off .wk-day b { color: var(--muted); }
.wk-row.today .wk-day b { color: var(--accent); }
.wk-row select { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--card2); color: var(--ink); font: inherit; font-size: 16px; }
.wk-row select:focus, input.wk-info:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.wk-info { grid-column: 1 / -1; }
input.wk-info { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--card2); color: var(--ink); font: inherit; font-size: 16px; }

/* ---------- Ranks ---------- */
.rank-hero { text-align: center; padding: 24px 18px; }
.rank-hero .ring { margin: 0 auto; }
.rank-hero h2 { font-size: 1.6rem; margin-top: 12px; }
.ladder { list-style: none; margin: 0; padding: 4px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.rung { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rung:last-child { border-bottom: 0; }
.badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--card2); color: var(--muted); font-family: var(--display); font-size: 1.7rem; font-weight: 900; }
.badge.r-E { --b1: #6b7280; --b2: #d1d5db; } .badge.r-D { --b1: #16a34a; --b2: #86efac; } .badge.r-C { --b1: #0891b2; --b2: #67e8f9; }
.badge.r-B { --b1: #7c3aed; --b2: #c4b5fd; } .badge.r-A { --b1: #d97706; --b2: #fde68a; } .badge.r-S { --b1: #fa114f; --b2: #ff7a2f; }
.rung .badge { color: var(--b2); background: color-mix(in srgb, var(--b1) 16%, var(--card2)); }
.rung.done .badge, .rung.here .badge, .rankup .badge { background: linear-gradient(135deg, var(--b1), var(--b2)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.rung.here .badge { box-shadow: 0 0 18px color-mix(in srgb, var(--b1) 60%, transparent); }
.rung.locked .badge { opacity: 0.55; }
.rung-body b { font-weight: 650; }
.rung-body p { margin: 0; }
.rung.locked .rung-body b { color: var(--muted); }
.rung .state { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.rung.done .state { color: var(--good); }
.rung.here .state { color: var(--accent); font-weight: 600; }
.rankup { text-align: center; padding: 22px 18px; border-color: rgba(245, 184, 61, 0.35); background: radial-gradient(80% 100% at 50% 0%, rgba(245, 184, 61, 0.22), transparent 70%), var(--card); animation: pop 0.6s var(--ease) both; }
.rankup .badge { margin: 0 auto 10px; width: 72px; height: 72px; font-size: 2.8rem; border-radius: 20px; box-shadow: 0 0 28px color-mix(in srgb, var(--b1) 60%, transparent); }
.rankup h3 { font-size: 1.4rem; }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }

/* ---------- Install + settings ---------- */
.install-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.install-steps { margin: 8px 0 0; padding-left: 20px; }
.install-steps li { margin: 4px 0; }
.share-ico { width: 18px; height: 18px; fill: var(--accent); vertical-align: -3px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 0; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle input { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 1px; accent-color: var(--accent-bg); }
.toggle > span { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Modal sheet ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.7); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(640px, 100%); max-height: 86vh; overflow: auto; background: var(--card); border: 1px solid var(--line2); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet 0.4s var(--ease); }
@keyframes sheet { from { transform: translateY(100%); } }
.sheet h3 { font-size: 1.4rem; margin-bottom: 4px; }
.dlg { z-index: 70; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } }
.dlg .sheet { animation-duration: 0.28s; }
.dlg .sheet p { line-height: 1.5; }
.dlg-actions { margin-top: 14px; }
.dlg-actions .btn.full { min-height: 52px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px; margin-top: 8px; border-radius: 16px; border: 0; background: var(--card2); text-align: left; cursor: pointer; }
.opt .thumb { flex-basis: 52px; width: 52px; height: 52px; }

/* ---------- Tab bar ---------- */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 6px;
  width: min(480px, calc(100% - 24px));
  background: rgba(30, 30, 36, 0.78); border: 1px solid var(--line2); border-radius: 999px;
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.66rem; font-weight: 600; }
.tabs a svg { width: 22px; height: 22px; fill: currentColor; }
.tabs a.active { color: var(--ink); background: rgba(250, 17, 79, 0.16); }
.tabs a.active svg { fill: var(--accent); }

/* ---------- Muscle map ---------- */
.mm { display: block; width: 100%; height: auto; }
.mm .b { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.14); stroke-width: 0.5; }
.mm .m { fill: rgba(255, 255, 255, 0.12); stroke: rgba(255, 255, 255, 0.18); stroke-width: 0.5; }
.mm .s { fill: rgba(255, 122, 47, 0.5); stroke: rgba(255, 122, 47, 0.8); }
.mm .p { fill: #fa114f; stroke: #ffb3c4; }
.mm .ln { fill: none; stroke: rgba(0, 0, 0, 0.5); stroke-width: 0.6; }
.mm .mm-t { fill: var(--muted); font-family: var(--sans); font-size: 7px; letter-spacing: 0.08em; text-anchor: middle; }
.mmap { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 4px 2px; }

/* ---------- Missed ---------- */
.missed-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; }
.missed-row .btn { flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
