/* Workout tracker — builds on site.css tokens. Numbers in Poppins for at-a-glance reading,
   labels in the pixel face for personality. */

.lift-page { --tab-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); }
.lift-page .site-footer { display: none; }
.lift {
  width: 100%; max-width: 560px; margin: 0 auto; padding: 14px 16px calc(var(--tab-h) + var(--safe-b) + 28px);
  font-variant-numeric: tabular-nums;
}
body.resting .lift { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 110px); }
.lift .pix { image-rendering: pixelated; display: inline-block; vertical-align: middle; flex: none; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 12px; }

/* ---------- view headers ---------- */
.vhead { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.vtitle {
  font-family: var(--pixel); font-weight: 400; text-transform: uppercase; letter-spacing: .18em;
  font-size: clamp(26px, 7.5vw, 34px); line-height: 1.05; margin: 0; text-shadow: 2px 2px 0 var(--lav-line);
}
.vsub { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.vsub.saved { margin: -6px 0 14px; font-size: 12px; }
.back {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; text-decoration: none;
  border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper); font-size: 26px; line-height: 1; color: var(--text);
}
.home-top { display: flex; justify-content: space-between; align-items: flex-start; margin: 8px 0 18px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper); }
.sec {
  font-family: var(--pixel); font-weight: 400; text-transform: uppercase; letter-spacing: var(--track);
  font-size: 20px; margin: 26px 0 10px; color: var(--ink-soft); text-shadow: var(--px-shadow);
}
.blurb { font-size: 15px; color: var(--ink-soft); margin: -4px 0 16px; }

/* ---------- home ---------- */
.resume {
  position: relative; display: block; text-decoration: none; color: #fff; background: var(--night);
  border: 2px solid var(--ink); border-radius: var(--r-lg); padding: 16px 18px 18px 26px; overflow: hidden;
  box-shadow: inset 10px 0 0 var(--lav), 4px 4px 0 var(--lav);
}
.resume .k { font-size: 16px; color: var(--lav); text-shadow: none; }
.resume-name { font-weight: 600; font-size: 22px; line-height: 1.2; margin: 2px 0 4px; }
.resume-meta { color: #c9c6d8; font-size: 14px; }
.resume-go { position: absolute; right: 16px; top: 16px; font-family: var(--pixel); font-size: 22px; letter-spacing: .16em; text-transform: uppercase; }
.meter-mini { height: 8px; border: 2px solid #3a3550; border-radius: 99px; margin-top: 12px; overflow: hidden; }
.meter-mini i { display: block; height: 100%; background: var(--lav); }

.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.start-card {
  font: inherit; text-align: left; color: var(--text); text-decoration: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; min-height: 104px; padding: 12px 12px 12px 22px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px; box-shadow: inset 8px 0 0 var(--lav);
}
.start-card.ghost { background: var(--paper); box-shadow: inset 8px 0 0 var(--lav-line); }
.start-card:active { transform: translate(1px, 1px); }
.sc-name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.sc-meta { font-size: 12px; color: var(--muted); line-height: 1.35; }
.sc-go { margin-top: auto; font-family: var(--pixel); font-size: 18px; letter-spacing: .16em; text-transform: uppercase; color: var(--lav-dark); }

/* ---------- lists ---------- */
.list { display: grid; gap: 8px; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--text);
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 12px 14px; min-height: 60px;
}
.list-row[hidden] { display: none; }
.list-row > a, .list-row > span:first-child { min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.list-row b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.list-row small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .best { text-align: right; font-weight: 600; font-size: 15px; white-space: nowrap; }
.list-row .go { font-size: 24px; color: var(--lav-dark); }
.list-row.prog { background: var(--card); box-shadow: inset 8px 0 0 var(--lav); padding-left: 22px; }
.win { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; color: var(--lav-dark); }

.lift-empty { text-align: center; padding: 26px 16px; border: 2px dashed var(--lav-line); border-radius: var(--r-md); color: var(--ink-soft); background: var(--paper); }
.lift-empty p { margin: 12px 0 0; font-size: 14px; }
.lift-empty.sm { padding: 18px 14px; margin-bottom: 10px; }

/* ---------- buttons ---------- */
.chip {
  font-family: var(--pixel); font-size: 18px; letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  border: 2px solid var(--ink); background: var(--paper); color: var(--text); border-radius: var(--r-sm);
  padding: 10px 12px; min-height: 42px; cursor: pointer; flex: none;
}
.chip.dark { background: var(--ink); color: #fff; text-shadow: 1px 1px 0 var(--lav-dark); }
.chip:disabled { opacity: .35; cursor: default; }
.ghost-btn {
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--text); text-align: center;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px;
}
.ghost-btn.wide { width: 100%; display: block; }
.ghost-btn.file { cursor: pointer; }
.linkish { font: inherit; font-size: 13px; background: none; border: 0; padding: 4px 0; color: var(--lav-dark); text-decoration: underline; cursor: pointer; }
.linkish.danger, .danger { color: #a33a4a; }
.add-ex {
  display: block; width: 100%; margin: 12px 0 0; padding: 16px; cursor: pointer;
  font-family: var(--pixel); font-size: 22px; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-soft);
  background: transparent; border: 2px dashed var(--ink); border-radius: var(--r-md);
}
.big-btn { width: 100%; text-align: center; padding: 14px; font-size: 24px; }
.btn:disabled { opacity: .4; }
.wk-end { display: grid; gap: 12px; justify-items: center; margin: 26px 0 8px; }
.wk-end > * { width: 100%; }
.wk-end .linkish { width: auto; }

/* ---------- active workout ---------- */
.wk-head {
  position: sticky; top: 56px; z-index: 20; display: flex; align-items: center; gap: 8px;
  margin: -14px -16px 12px; padding: 10px 16px; background: var(--bg); border-bottom: 2px solid var(--ink);
}
.wk-title { flex: 1; min-width: 0; }
.wk-name {
  width: 100%; font: inherit; font-weight: 600; font-size: 17px; line-height: 1.2; border: 0; background: none; padding: 0; color: var(--text);
  text-overflow: ellipsis;
}
.wk-name:focus { outline: 2px solid var(--lav-line); border-radius: 4px; }
.wk-sub { font-size: 12px; color: var(--muted); }
.src-tag { font-size: 15px; color: var(--lav-dark); margin: -4px 0 10px; text-shadow: none; }

.ex-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px; margin-bottom: 14px;
  padding: 12px 12px 12px 22px; box-shadow: inset 8px 0 0 var(--lav);
}
.ex-card.complete { box-shadow: inset 8px 0 0 var(--lav-dark); }
.ex-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-name {
  font: inherit; font-weight: 600; font-size: 18px; line-height: 1.25; text-align: left; color: var(--text);
  background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: none;
}
.kebab { font-size: 14px; letter-spacing: 1px; background: none; border: 0; padding: 10px 6px; cursor: pointer; color: var(--ink-soft); }
.ex-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.ex-meta .linkish { font-size: 12px; }
.tag { background: var(--lav-soft); color: var(--lav-dark); border-radius: 6px; padding: 1px 7px; }
.hint-line { display: flex; gap: 8px; align-items: center; font-size: 13px; background: var(--paper); border: 2px solid var(--lav-line); border-radius: var(--r-sm); padding: 6px 10px; margin-bottom: 8px; }

.sets { display: grid; gap: 6px; }
.set-cols, .set-row { display: grid; grid-template-columns: 30px 1fr 1.25fr 48px; align-items: center; gap: 8px; }
.set-cols { font-family: var(--pixel); font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 0 8px; }
.set-row {
  min-height: 56px; padding: 4px 4px 4px 8px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.set-row .sn { font-family: var(--pixel); font-size: 22px; color: var(--ink-soft); }
.set-row .prev { font-size: 15px; color: var(--muted); white-space: nowrap; }
.set-row .now { font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row .now i { font-weight: 400; font-size: 13px; font-style: normal; }
.set-row.done { background: var(--lav-soft); border-color: var(--lav-line); }
.d { font-style: normal; font-weight: 600; font-size: 12px; }
.d.up { color: var(--lav-dark); }
.d.down { color: var(--muted); }
.d.same { color: var(--ink-soft); }
.chk {
  width: 48px; height: 46px; border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper);
  font-size: 22px; font-weight: 700; color: #fff; cursor: pointer;
}
.chk.on { background: var(--ink); text-shadow: 1px 1px 0 var(--lav-dark); }

.set-edit {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 12px;
  box-shadow: 4px 4px 0 var(--lav);
  margin: 2px 4px 6px 0;
}
.se-top { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.se-top .pxt { font-size: 20px; color: var(--text); }
.se-last { margin-left: auto; font-size: 14px; }
.se-last b { color: var(--text); font-weight: 600; }
.se-fields { display: grid; gap: 8px; margin-top: 10px; }
.se-fields .fld { display: grid; grid-template-columns: 62px 1fr; align-items: center; }
.se-fields .fld label { margin: 0; font-size: 18px; }
.fld label, .fld > .lbl {
  display: block; font-family: var(--pixel); font-size: 16px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px;
}
.stp { display: flex; align-items: stretch; border: 2px solid var(--ink); border-radius: var(--r-sm); overflow: hidden; background: var(--paper); height: 60px; }
.stp button {
  flex: none; width: 60px; border: 0; background: var(--card); font-size: 24px; font-weight: 500; cursor: pointer; color: var(--text);
  touch-action: manipulation;
}
.stp button:active { background: var(--lav-soft); }
.stp input, .stp output {
  flex: 1; min-width: 0; width: 100%; border: 0; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); border-radius: 0;
  text-align: center; font: inherit; font-weight: 700; font-size: 28px; padding: 0; background: var(--paper); color: var(--text);
  display: grid; place-items: center;
}
.stp input:focus { outline: none; background: var(--lav-soft); }
.stp.sm { height: 46px; }
.stp.sm output { font-size: 20px; }
.se-delta { font-size: 13px; font-weight: 600; min-height: 20px; margin: 8px 0 6px; color: var(--muted); text-align: center; }
.se-delta.up { color: var(--lav-dark); }
.se-delta.same { color: var(--ink-soft); }
.log-btn {
  width: 100%; min-height: 60px; cursor: pointer; border: 2px solid var(--ink); border-radius: var(--r-md);
  background: var(--ink); color: #fff; font-family: var(--pixel); font-size: 26px; letter-spacing: .2em; text-transform: uppercase;
  text-shadow: 1px 1px 0 var(--lav-dark); box-shadow: 4px 4px 0 var(--lav); touch-action: manipulation;
}
.log-btn .lb-v { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: 0; text-transform: none; text-shadow: none; margin-left: 6px; }
.log-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--lav); }
.set-edit .linkish { display: block; margin: 8px auto 0; }
.ex-foot { display: flex; gap: 8px; margin-top: 10px; }
.ex-foot .ghost-btn { flex: 1; }

/* ---------- rest bar ---------- */
.restbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--night); color: #fff;
  border-top: 2px solid var(--ink); padding-bottom: var(--safe-b); overflow: hidden;
}
.restbar[hidden] { display: none; }
.rb-fill { position: absolute; left: 0; top: 0; height: 4px; background: var(--lav); transition: width .5s linear; }
.rb-in { position: relative; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.rb-in .pix { filter: invert(1) hue-rotate(180deg); }
.rb-in .pix.spin { animation: tip 2s steps(1) infinite; }
@keyframes tip { 50% { transform: rotate(180deg); } }
.rb-time { flex: 1; font-weight: 700; font-size: 30px; line-height: 1; }
.rb-time small { display: block; font-family: var(--pixel); font-weight: 400; font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: #c9c6d8; margin-top: 4px; }
.rb-in button {
  font-family: var(--pixel); font-size: 20px; letter-spacing: .1em; text-transform: uppercase; min-width: 54px; min-height: 46px;
  background: transparent; color: #fff; border: 2px solid #3a3550; border-radius: var(--r-sm); cursor: pointer;
}
.restbar.done { background: var(--lav-dark); }
.restbar.done .rb-time { font-family: var(--pixel); font-weight: 400; letter-spacing: .2em; font-size: 36px; }
.restbar.done button { border-color: #fff; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--paper); border-top: 2px solid var(--ink); padding-bottom: var(--safe-b);
}
.tabbar a {
  flex: 1; max-width: 186px; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--muted); font-family: var(--pixel); font-size: 16px; letter-spacing: .2em; text-transform: uppercase;
}
.tabbar a .ti { opacity: .45; height: 20px; display: flex; align-items: center; }
.tabbar a.on { color: var(--text); text-shadow: var(--px-shadow); }
.tabbar a.on .ti { opacity: 1; }
body[data-view="workout"] .tabbar { display: none; }
body[data-view="workout"] .lift { padding-bottom: 40px; }
body[data-view="workout"].resting .lift { padding-bottom: 120px; }

/* ---------- toast + sheet ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 60;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); width: max-content;
  background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 10px 10px 10px 16px; font-size: 14px;
  box-shadow: 4px 4px 0 var(--lav);
}
.toast[hidden] { display: none; }
body[data-view="workout"] .toast { bottom: calc(16px + var(--safe-b)); }
body.resting .toast { bottom: calc(96px + var(--safe-b)); }
.toast button {
  font-family: var(--pixel); font-size: 18px; letter-spacing: .16em; text-transform: uppercase; background: var(--lav); color: var(--night);
  border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; min-height: 38px;
}
.sheet-wrap { position: fixed; inset: 0; z-index: 70; }
.sheet-wrap[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(7, 7, 11, .5); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 86vh; overflow-y: auto;
  background: var(--bg); border: 2px solid var(--ink); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + var(--safe-b)); animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
body.sheet-open { overflow: hidden; }
.sheet-grab { width: 44px; height: 4px; border-radius: 4px; background: var(--lav-line); margin: 4px auto 10px; }
.sheet-h { font-family: var(--pixel); font-weight: 400; font-size: 24px; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 12px; text-shadow: var(--px-shadow); }
.menu { display: grid; gap: 8px; }
.menu button {
  font: inherit; font-weight: 500; font-size: 16px; text-align: left; padding: 14px 16px; min-height: 52px; cursor: pointer;
  background: var(--paper); color: var(--text); border: 2px solid var(--ink); border-radius: var(--r-sm);
}
.menu button small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.menu button.danger { color: #a33a4a; }
.menu button:disabled { opacity: .4; }
.rest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rest-grid button, .seg button { min-height: 52px; }
.rest-grid button {
  font: inherit; font-weight: 600; font-size: 18px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-sm); cursor: pointer; color: var(--text);
}
.rest-grid button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.pick-q {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper);
  margin-bottom: 10px; appearance: none; -webkit-appearance: none;
}
.pick-q:focus { outline: 3px solid var(--lav-line); outline-offset: 1px; }
.pick-list { display: grid; gap: 6px; }
.pick-sec { font-size: 15px; color: var(--muted); margin: 10px 0 2px; text-shadow: none; }
.pick-row, .pick-new {
  font: inherit; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 10px 14px; min-height: 54px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-sm); cursor: pointer; color: var(--text);
}
.pick-row span { font-weight: 500; font-size: 15px; line-height: 1.3; }
.pick-row small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.pick-row b { font-size: 22px; color: var(--lav-dark); }
.pick-new { border: 2px solid var(--ink); background: var(--lav-soft); font-weight: 600; }

/* ---------- routine editor ---------- */
.r-name {
  flex: 1; min-width: 0; font: inherit; font-weight: 600; font-size: 22px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper);
}
.r-name:focus { outline: 3px solid var(--lav-line); }
.r-move { display: flex; gap: 4px; }
.r-move button { width: 36px; height: 36px; border: 2px solid var(--ink); background: var(--paper); border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--text); }
.r-grid { display: grid; grid-template-columns: 1fr 1.1fr .9fr; gap: 8px; margin-top: 6px; }
.r-grid .stp button { width: 34px; font-size: 20px; }
.range { display: flex; align-items: center; gap: 4px; height: 46px; }
.range input, .r-grid select {
  width: 100%; min-width: 0; height: 46px; font: inherit; font-weight: 600; font-size: 18px; text-align: center; padding: 0 4px;
  border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper); appearance: none; -webkit-appearance: none;
}
.r-grid select { background-image: none; padding: 0; text-align-last: center; }
.plan { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.plan li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.plan li:last-child { border-bottom: 0; }
.plan b { font-weight: 600; white-space: nowrap; }

/* ---------- lift detail ---------- */
.headline {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 14px 16px; box-shadow: 4px 4px 0 var(--lav);
  font-size: 15px; display: grid; gap: 8px;
}
.hl-up { display: flex; gap: 10px; align-items: flex-start; }
.hl-up .pix { margin-top: 5px; }
.hl-up b { display: block; font-size: 22px; line-height: 1.2; }
.hl-up small { display: block; color: var(--muted); font-size: 13px; }
.hl-cap { color: var(--muted); font-size: 12px; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.stat3 > div { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 10px 10px; min-width: 0; }
.stat3 small { display: block; font-family: var(--pixel); font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat3 b { display: block; font-size: 20px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat3 i { font-style: normal; font-weight: 500; font-size: 13px; color: var(--muted); }
.hist { display: grid; gap: 8px; }
.hist-row { display: block; text-decoration: none; color: var(--text); background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 10px 14px; }
.hr-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.hr-top span { color: var(--muted); font-size: 12px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.chips span { font-weight: 600; font-size: 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: 3px 9px; }
.chips.big span { font-size: 17px; padding: 6px 12px; }
.hist-row .d { display: block; font-size: 13px; margin-top: 4px; }

/* ---------- done screen ---------- */
.done-hero {
  position: relative; overflow: hidden; isolation: isolate; text-align: center; color: #fff; background: var(--night);
  border: 2px solid var(--ink); border-radius: var(--r-lg); padding: 30px 16px 26px; margin: 6px 0 0;
}
.done-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .8;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 41% 30%, #cfc8ff 50%, transparent 51%), radial-gradient(1px 1px at 58% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 40%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 18%, #cfc8ff 50%, transparent 51%);
  background-size: 220px 140px;
}
.lift-anim { position: relative; display: inline-block; animation: press 1.6s steps(4) 2 both; }
.lift-anim .barbell { max-width: 100%; height: auto; filter: drop-shadow(0 0 0 transparent); }
.done-hero .barbell rect[fill="#242424"] { fill: #e9e6f3; }
.bloom-pop { position: absolute; left: 50%; top: 16px; transform: translateX(-50%) scale(0); transform-origin: bottom center; animation: pop .35s steps(3) 3.3s forwards; }
.bloom-pop rect[fill="#242424"] { fill: #9d91be; }
@keyframes press { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes pop { to { transform: translateX(-50%) scale(1); } }
.floor { width: 70%; height: 4px; margin: 6px auto 16px; background: repeating-linear-gradient(90deg, var(--lav) 0 8px, transparent 8px 12px); }
.done-hero .k { font-size: 18px; color: var(--lav); margin: 0; text-shadow: none; }
.done-hero h1 { font-weight: 600; font-size: 24px; margin: 4px 0 0; }
.moved { display: grid; gap: 8px; }
.moved-row { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 10px 14px; display: grid; gap: 4px; }
.moved-row > a { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; }
.moved-row .d { font-size: 18px; font-weight: 700; }
.moved-row .d small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.moved-row .d.down, .moved-row .d.same { font-size: 14px; font-weight: 500; }
.pr { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--lav-dark); }

/* ---------- settings ---------- */
.settings { display: grid; gap: 16px; }
.settings-actions { display: grid; gap: 10px; justify-items: center; margin-top: 12px; }
.note { font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .lift-anim, .rb-in .pix.spin, .sheet { animation: none; }
  .bloom-pop { animation: none; transform: translateX(-50%) scale(1); }
}
@media (min-width: 600px) {
  .wk-head { margin-left: 0; margin-right: 0; border: 2px solid var(--ink); border-radius: var(--r-md); top: 64px; }
}
@media (max-width: 380px) {
  .lift { padding-left: 12px; padding-right: 12px; }
  .wk-head { margin-left: -12px; margin-right: -12px; padding: 8px 12px; gap: 6px; }
  .wk-head .chip { padding: 8px 8px; font-size: 16px; }
  .ex-card { padding: 10px 8px 10px 16px; box-shadow: inset 6px 0 0 var(--lav); }
  .set-edit { padding: 10px 8px; margin-right: 2px; }
  .se-fields .fld { grid-template-columns: 48px 1fr; }
  .se-fields .fld label { font-size: 15px; letter-spacing: .12em; }
  .stp button { width: 44px; }
  .stp input { font-size: 26px; }
  .log-btn { font-size: 22px; letter-spacing: .14em; }
  .log-btn .lb-v { font-size: 19px; }
  .set-cols, .set-row { grid-template-columns: 22px 1fr 1.3fr 44px; gap: 6px; }
  .set-row .now { font-size: 16px; }
  .chk { width: 44px; }
}

/* ---------- exercise illustrations ---------- */
.art { position: relative; display: block; width: 100%; max-width: 320px; margin: 0 auto; background: #0d0c16;
  border: 2px solid var(--ink); border-radius: var(--r-md); overflow: hidden; box-shadow: 4px 4px 0 var(--lav); }
.art img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.art-anim .b { position: absolute; inset: 0; animation: art-flip 1.8s linear infinite; }
@keyframes art-flip { 0%, 49.99% { opacity: 0; } 50%, 100% { opacity: 1; } }
.art-none { display: grid; place-items: center; gap: 10px; aspect-ratio: 4 / 3; color: #c9c6d8; font-size: 13px; text-align: center; padding: 16px; }
.art-none .pix { filter: invert(1) hue-rotate(180deg); }
.art-th { flex: none; width: 80px; height: 60px; border-radius: 8px; image-rendering: pixelated; display: grid; place-items: center; background: #0d0c16; }
.art-th.none .pix { filter: invert(1) hue-rotate(180deg); opacity: .5; }
.info { display: grid; gap: 10px; }
.info .art { margin-top: 4px; }
.info-h { margin: 6px 0 0; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchips span { font-size: 12px; font-weight: 600; color: var(--lav-dark); background: var(--lav-soft); border-radius: 6px; padding: 2px 8px; }
.cue { margin: 0; font-size: 15px; line-height: 1.5; }
.info-last { margin: 0; font-size: 13px; color: var(--muted); }
.menu button.primary { background: var(--ink); color: #fff; font-family: var(--pixel); font-size: 22px; letter-spacing: .16em; text-transform: uppercase; text-align: center; }
.info-i { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--lav-dark); border-radius: 50%;
  font: italic 600 11px/1 Georgia, serif; color: var(--lav-dark); vertical-align: 2px; margin-left: 4px; }
.pick-item { display: flex; gap: 6px; align-items: stretch; }
.pick-item .pick-row { flex: 1; min-width: 0; }
.pick-peek { position: relative; flex: none; padding: 0; border: 2px solid var(--ink); border-radius: var(--r-sm); background: #0d0c16; cursor: pointer; overflow: hidden; }
.pick-peek .art-th { border-radius: 0; }
.pick-peek i { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--lav); color: var(--night);
  font: italic 700 11px/16px Georgia, serif; text-align: center; }
.plan-name { display: flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; text-align: left; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.plan-name .art-th { border: 1.5px solid var(--ink); }
.plan li { align-items: center; }
.lift-art { display: grid; gap: 10px; margin-bottom: 16px; }
@media (prefers-reduced-motion: reduce) { .art-anim .b { animation: none; opacity: 0; } }

/* ---------- setup (onboarding) ---------- */
body[data-view="setup"] .tabbar { display: none; }
body[data-view="setup"] .lift { padding-bottom: calc(110px + var(--safe-b)); }
.su { display: flex; flex-direction: column; min-height: calc(100vh - 90px); }
.su-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 44px; margin-bottom: 6px; }
.su-top .pxt { text-align: center; font-size: 20px; text-shadow: none; color: var(--ink-soft); }
.su-back, .su-x { width: 40px; height: 40px; display: grid; place-items: center; text-decoration: none; color: var(--text); font-size: 26px;
  border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--paper); }
.su-x { font-size: 16px; }
.su-prog { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-bottom: 22px; }
.su-prog i { display: block; height: 100%; background: var(--lav-dark); transition: width .25s; }
.su-q { font-weight: 700; font-size: 24px; line-height: 1.25; margin: 0 0 6px; }
.su-hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.su-body { display: grid; gap: 10px; margin-top: 8px; }
.su-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(14px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%);
  display: grid; justify-items: center; gap: 6px; }
.su-foot .btn { max-width: 528px; }
.su-foot .btn:disabled { box-shadow: none; transform: none; cursor: default; }
.su-intro .vtitle { margin-top: 18px; }
.su-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; }
.su-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 0 0 22px; position: relative; color: var(--muted); }
.su-steps li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 2px; width: 2px; background: var(--line); }
.su-steps .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--paper); font-weight: 700; font-size: 14px; }
.su-steps b { display: block; font-size: 17px; line-height: 32px; }
.su-steps small { display: block; font-size: 13px; color: var(--ink-soft); }
.su-steps li.cur { color: var(--text); }
.su-steps li.cur .n { background: var(--ink); color: #fff; border-color: var(--ink); }
.su-steps li.done .n { background: var(--lav-dark); color: #fff; border-color: var(--lav-dark); }
.su-steps li.done { color: var(--ink-soft); }

.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-md); padding: 14px 14px; min-height: 64px; }
.opt.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--lav); }
.opt-t { flex: 1; min-width: 0; }
.opt-t b { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; }
.opt-t small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.opt-i { width: 32px; text-align: center; font-size: 22px; color: var(--lav-dark); }
.radio, .box { flex: none; width: 22px; height: 22px; border: 2px solid var(--ink-soft); border-radius: 50%; }
.box { border-radius: 6px; }
.opt.on .radio { border-color: var(--ink); background: radial-gradient(var(--ink) 45%, transparent 50%); }
.opt.on .box { border-color: var(--ink); background: var(--ink); position: relative; }
.opt.on .box::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.bars { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 32px; height: 22px; padding: 0 5px; }
.bars i { flex: 1; background: var(--line); border-radius: 1px; }
.bars i:nth-child(1) { height: 40%; } .bars i:nth-child(2) { height: 70%; } .bars i:nth-child(3) { height: 100%; }
.bars i.f { background: var(--lav-dark); }

.su-seg { max-width: 340px; margin: 0 auto; width: 100%; }
.bf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bf { display: grid; justify-items: center; gap: 4px; padding: 8px 6px 8px; font: inherit; cursor: pointer; color: var(--text);
  background: #1a1826; border: 2px solid var(--line); border-radius: var(--r-md); }
.bf svg { width: 100%; max-width: 96px; height: auto; display: block; }
.bf span { font-size: 12px; font-weight: 600; color: #e9e6f3; }
.bf.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--lav); background: #2a2740; }
.days-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 20px; }
.dayb { height: 56px; font: inherit; font-weight: 700; font-size: 20px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); cursor: pointer; color: var(--text); }
.dayb.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.rir-demo { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 12px; }
.rir-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.rir-ends b { display: block; color: var(--text); font-size: 14px; }
.rir-ends span:last-child { text-align: right; }
.explain { font-size: 14px; color: var(--ink-soft); }
.explain p { margin: 0 0 8px; }
.setup-nudge { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; margin-top: 14px; padding: 12px 16px; text-decoration: none; color: var(--text);
  background: var(--lav-soft); border: 2px solid var(--ink); border-radius: var(--r-md); }
.setup-nudge span { font-size: 13px; color: var(--ink-soft); grid-column: 1; }
.setup-nudge i { grid-row: 1 / 3; grid-column: 2; font-style: normal; font-size: 24px; color: var(--lav-dark); }

/* ---------- calendar ---------- */
.cal { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 10px 12px 12px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-h b { font-weight: 600; font-size: 16px; }
.cal-h button { width: 40px; height: 36px; font-size: 22px; border: 0; background: none; cursor: pointer; color: var(--text); }
.cal-h button:disabled { opacity: .25; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-g i { font-style: normal; font-family: var(--pixel); font-size: 15px; letter-spacing: .1em; color: var(--muted); }
.cal-g .cd { display: grid; place-items: center; aspect-ratio: 1; max-height: 42px; margin: 0 auto; width: 100%; border-radius: 10px; font-size: 14px; color: var(--ink-soft); border: 2px solid transparent; font-family: inherit; background: none; padding: 0; }
.cal-g .cd.on { background: var(--lav-dark); color: #fff; font-weight: 700; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.cal-g .cd.today { border-color: var(--ink); }
.cal-f { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.cal-f .wk b { color: var(--text); font-size: 15px; }
.cal-f .dots { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 1px; }
.cal-f .dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); }
.cal-f .dots i.f { background: var(--lav-dark); }
.cal-f .streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--lav-dark); }

/* ---------- muscles ---------- */
.mtags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; }
.mtags span { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.mtags span.p { color: var(--lav-dark); background: var(--lav-soft); border-color: var(--lav-line); font-weight: 600; }
.tm-card { margin: 0 0 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 0 12px; }
.tm-card summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.tm-card summary::-webkit-details-marker { display: none; }
.tm-card summary .pxt { font-size: 18px; text-shadow: none; }
.tm-card summary i { font-style: normal; font-size: 13px; color: var(--lav-dark); text-decoration: underline; }
.tm-card:not([open]) { padding-bottom: 0; }
.tm-card .tm { padding-bottom: 12px; }
.tm-card:not([open]) summary + * { display: none; }
.tm { display: grid; gap: 10px; }
.tm-map { background: #0d0c16; border-radius: var(--r-sm); padding: 8px 4px 2px; }
.tm-map svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.tm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-chips span { font-size: 13px; color: var(--ink-soft); background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: 3px 9px; }
.tm-chips span.hi { color: var(--text); background: var(--lav-soft); border-color: var(--lav-line); }
.tm-chips b { font-weight: 700; }
/* the target-muscles summary also appears outside a card (done screen) */
.lift > .tm { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 12px; }

/* ---------- RIR ---------- */
.rir-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; margin: 0 0 4px; }
.rir-l { font-family: var(--pixel); font-size: 17px; letter-spacing: .16em; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; }
.rir-l button { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ink-soft); background: none; font: 600 11px/1 var(--sans); color: var(--ink-soft); cursor: pointer; padding: 0; }
.rir-scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rir-b { height: 40px; min-width: 0; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border-radius: 9px; padding: 0;
  color: var(--c); background: var(--paper); border: 2px solid var(--c); touch-action: manipulation; }
.rir-b.on { background: var(--c); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.rir-demo .rir-b { cursor: default; }
.rir-last { font-size: 12px; color: var(--muted); text-align: right; margin: -2px 0 6px; }
em.rir { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 6px; border-radius: 6px; vertical-align: 2px;
  font-style: normal; font-weight: 700; font-size: 11px; color: #fff; background: var(--c); }
.chips em.rir { margin-left: 5px; }

/* ---------- levels ---------- */
.lv-seg { margin-bottom: 12px; }
.lv-map { background: #0d0c16; border: 2px solid var(--ink); border-radius: var(--r-md); padding: 6px 6px 10px; box-shadow: 4px 4px 0 var(--lav); }
.lv-map svg { display: block; width: 100%; max-width: 480px; margin: 0 auto; }
.lv-lab { display: grid; grid-template-columns: 1fr 1fr; text-align: center; font-family: var(--pixel); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: #8f89a9; margin-top: -2px; }
.lv-legend { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 8px; font-size: 11px; color: #c9c6d8; }
.lv-legend i { width: 16px; height: 10px; border-radius: 2px; }
.lv-legend span { margin: 0 6px; }
.lv-list { display: grid; gap: 8px; }
.lv-row { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 10px 14px; }
.lv-t { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lv-t > b { font-weight: 600; font-size: 15px; }
.lv-t span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lv-t span b { color: var(--text); font-size: 17px; }
.lv-bar { height: 10px; border-radius: 6px; background: var(--card); border: 1.5px solid var(--line); overflow: hidden; margin-top: 6px; }
.lv-bar i { display: block; height: 100%; border-radius: 6px; }
.lv-row small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- misc ---------- */
.prof { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: 4px 14px; }
.prof div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.prof div:last-child { border-bottom: 0; }
.prof span { color: var(--muted); }
.prof b { font-weight: 600; text-align: right; }
.settings-actions a.ghost-btn { text-decoration: none; }
.pick-filter { margin: -2px 0 10px; }
.pick-filter button { min-height: 40px; font-size: 16px; }
.grp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grp-grid button { min-height: 52px; font: inherit; font-weight: 600; font-size: 15px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-sm); cursor: pointer; color: var(--text); }
.tabbar a { font-size: 15px; letter-spacing: .14em; }

/* ---------- scroll wheels + ruler (setup) ---------- */
.wheels { position: relative; display: grid; gap: 6px; margin: 36px auto 0; max-width: 360px; width: 100%; }
.wheels.w3 { grid-template-columns: 1.1fr .8fr 1.1fr; }
.wheels.w1 { max-width: 220px; margin-top: 26px; }
.wheel { position: relative; z-index: 1; height: 200px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); }
.wheel::-webkit-scrollbar { display: none; }
.wh-pad { height: 80px; }
.wh-it { height: 40px; display: grid; place-items: center; scroll-snap-align: center; font-size: 18px; color: var(--muted); cursor: pointer; user-select: none; transition: color .1s, font-size .1s; }
.wh-it.near { color: var(--ink-soft); }
.wh-it.on { color: var(--text); font-weight: 700; font-size: 22px; }
.wh-band { position: absolute; left: 0; right: 0; top: 80px; height: 40px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); border-radius: 8px; background: var(--lav-soft); pointer-events: none; z-index: 0; }
.bigw { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 40px 0 6px; }
.bigw input { width: 170px; border: 0; background: none; text-align: center; font: inherit; font-weight: 700; font-size: 52px; padding: 0; color: var(--text); }
.bigw input:focus { outline: none; border-bottom: 3px solid var(--lav); }
.bigw span { font-size: 18px; color: var(--muted); }
.su-body > * { min-width: 0; }
.ruler-wrap { position: relative; margin: 6px -16px 0; min-width: 0; overflow: hidden; }
.hruler { width: 100%; }
.hruler { display: flex; overflow-x: auto; overscroll-behavior: contain; scrollbar-width: none; height: 74px; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); }
.hruler::-webkit-scrollbar { display: none; }
.hr-sp { flex: none; display: block; }
.hr-track { flex: none; position: relative; height: 100%;
  background-image: linear-gradient(90deg, var(--ink) 0 2px, transparent 2px), linear-gradient(90deg, var(--ink-soft) 0 1.5px, transparent 1.5px), linear-gradient(90deg, var(--lav-line) 0 1px, transparent 1px);
  background-size: 200px 34px, 40px 24px, 4px 14px; background-repeat: repeat-x; background-position: 0 0; }
.hr-track span { position: absolute; top: 40px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--muted); }
.hr-track span:nth-child(5n+1) { color: var(--text); font-size: 12px; }
.hr-needle { position: absolute; left: 50%; top: -6px; width: 3px; height: 46px; margin-left: -1.5px; background: var(--lav-dark); border-radius: 2px; pointer-events: none; }
.hr-needle::before { content: ""; position: absolute; left: -5px; top: -2px; border: 6.5px solid transparent; border-top-color: var(--lav-dark); }
