:root {
  --bg: #000;
  --surface: #0f0f0f;
  --card: #151515;
  --card-2: #1d1d1d;
  --card-3: #262626;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #fff;
  --muted: #8b8b8b;
  --dim: #5a5a5a;
  --accent: #fff;
  --on-accent: #000;
  --accent-soft: rgba(255, 255, 255, 0.13);
  --lime: #c8f03c;
  --lime-deep: #6f9a12;
  --lime-grad: linear-gradient(135deg, #e2ff7a 0%, #c8f03c 45%, #8dbb1c 100%);
  --lime-glow: rgba(200, 240, 60, 0.35);
  --up: #c8f03c;
  --up-soft: rgba(200, 240, 60, 0.13);
  --down: #ff5b4a;
  --down-soft: rgba(255, 91, 74, 0.14);
  --radius: 24px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 60px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body {
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input { outline: none; }
svg { display: block; }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; }

.view {
  padding: calc(var(--safe-top) + 34px) 20px calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
  /* the page scrolls in here instead of the document: iOS home-screen apps blur whatever
     scrolls under the status bar, and an inner scroller avoids that system effect */
  position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: 480px;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
}
.view.enter { animation: viewIn 0.38s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.stagger > * { animation: rise 0.5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(n+7) { animation-delay: 0.26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.who { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #3a3a3a, #161616);
  border: 1px solid var(--line-2);
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.hello { color: var(--muted); font-size: 12.5px; }
.name { font-weight: 600; font-size: 17px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; position: relative;
  transition: transform 0.15s var(--ease), background 0.2s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 2px; }
.page-sub { color: var(--muted); font-size: 13px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, #1b1b1b 0%, #111 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 0% 0%, rgba(255,255,255,0.06), transparent 60%);
}
.hero {
  padding: 20px;
  background:
    radial-gradient(110% 85% at 100% 0%, rgba(200, 240, 60, 0.20), transparent 58%),
    radial-gradient(60% 50% at 85% 100%, rgba(141, 187, 28, 0.08), transparent 70%),
    linear-gradient(180deg, #1b1b1b 0%, #101010 100%);
  border-color: rgba(200, 240, 60, 0.16);
}
.label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.chip-ico { width: 22px; height: 22px; border-radius: 7px; background: var(--card-3); display: grid; place-items: center; }
.chip-ico svg { width: 12px; height: 12px; stroke: #bbb; fill: none; stroke-width: 2; }
.big-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; }
.big { font-size: 38px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.big .dec, .val .dec { color: var(--dim); }
.big .unit { font-size: 17px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px;
  background: var(--card-3); color: var(--muted);
}
.pill.up { background: var(--up-soft); color: var(--up); }
.pill.down { background: var(--down-soft); color: var(--down); }
.hero .divider { height: 1px; background: var(--line); margin: 16px 0; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: #ddd; }
.action .btn-circ {
  width: 100%; height: 46px; border-radius: 99px;
  background: var(--card-2); border: 1px solid var(--line-2);
  display: grid; place-items: center;
  transition: transform 0.15s var(--ease), background 0.2s;
}
.action .btn-circ svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.action.primary .btn-circ { background: var(--lime-grad); border-color: transparent; box-shadow: 0 8px 24px -10px var(--lime-glow); color: #000; }
.action:active .btn-circ { transform: scale(0.92); }

.sec-head { display: flex; justify-content: space-between; align-items: center; margin: 32px 2px 14px; }
.sec-head h3 { margin: 0; font-size: 14.5px; font-weight: 500; color: var(--muted); }
.sec-head .link { font-size: 14px; color: #eee; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.sec-head .link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* lift cards (horizontal) */
.hscroll {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px;
  margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y;
  cursor: grab;
}
/* spacer so the last card can scroll fully into view (flex containers drop end padding) */
.hscroll::after { content: ""; flex: 0 0 6px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll.dragging, .picker-row.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.hscroll.dragging > * { pointer-events: none; }
.lift-card {
  flex: 0 0 62%; scroll-snap-align: start; padding: 14px 14px 0; min-height: 168px;
  display: flex; flex-direction: column; text-align: left;
  transition: transform 0.18s var(--ease);
}
.lift-card:active { transform: scale(0.97); }
.lift-card .lc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.lift-card .lc-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lift-card .lc-sub { color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.mono {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: #000; border: 1px solid var(--line-2);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
}
.lift-card .val { font-size: 22px; font-weight: 600; margin-top: 14px; letter-spacing: -0.02em; }
.val .unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.chg { font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); } .chg.flat { color: var(--dim); }
.spark { margin: auto -14px 0; height: 64px; }
.spark svg { width: 100%; height: 100%; }

/* list rows (watchlist style) */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 15px 2px;
  border-bottom: 1px solid var(--line); width: 100%; text-align: left;
  transition: background 0.2s, transform 0.15s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row:active { transform: scale(0.985); }
.row .r-main { flex: 1; min-width: 0; }
.row .r-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-sub { color: var(--dim); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-right { text-align: right; }
.row .r-val { font-weight: 600; font-size: 14.5px; }
.row .r-chg { font-size: 11.5px; margin-top: 2px; }
.row .mono { width: 40px; height: 40px; border-radius: 12px; }
.mono.done { background: var(--up-soft); color: var(--up); border-color: transparent; }
.mono.today { background: var(--lime-grad); color: #000; border-color: transparent; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: var(--card-3); color: var(--muted); font-weight: 500; }
.badge.up { background: var(--up-soft); color: var(--up); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.panel { padding: 4px 14px; }

.empty { color: var(--muted); text-align: center; padding: 28px 16px; font-size: 13.5px; }
.empty b { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }

/* ---------- progress ---------- */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px; position: relative; }
.seg button { flex: 1; padding: 7px 0; font-size: 12.5px; font-weight: 500; color: var(--muted); border-radius: 99px; position: relative; z-index: 1; transition: color 0.25s; }
.seg button.on { color: #000; }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; border-radius: 99px; background: var(--lime-grad); box-shadow: 0 4px 14px -6px var(--lime-glow); transition: left 0.3s var(--ease), width 0.3s var(--ease); }
.picker-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 2px; scrollbar-width: none; }
.picker-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 500;
  background: var(--card); border: 1px solid var(--line); color: #cfcfcf; white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--lime-grad); color: #000; border-color: transparent; }
.chart-card { padding: 16px 0 10px; }
.chart-card .cc-head { padding: 0 16px; }
.chart { height: 220px; margin-top: 8px; position: relative; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none;
  background: rgba(30, 30, 30, 0.6); color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); font-size: 11.5px; font-weight: 600; padding: 5px 8px; border-radius: 8px; white-space: nowrap;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 0.15s;
}
.chart .tip small { display: block; font-weight: 500; color: #aaa; font-size: 10.5px; }
.chart-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-fill { opacity: 0; animation: fadeIn 0.6s 0.35s ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { padding: 12px; }
.stat .s-l { color: var(--dim); font-size: 11.5px; }
.stat .s-v { font-weight: 600; font-size: 17px; margin-top: 4px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px; }
.cal-head .m { font-weight: 600; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 6px 10px 14px; }
.cal-grid .wd { text-align: center; font-size: 11px; color: var(--dim); padding: 6px 0; }
.day {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13.5px; position: relative; transition: background 0.2s, transform 0.15s;
}
.day:active { transform: scale(0.9); }
.day.out { color: #333; }
.day.planned::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
.day.trained { background: var(--accent-soft); color: #fff; font-weight: 600; }
.day.trained::after { content: ""; position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.day.today { box-shadow: inset 0 0 0 1.5px #fff; }
.day.sel { background: var(--lime-grad); color: #000; }
.day.sel::after { background: #000; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin: 10px 4px 0; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.streak { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }

/* ---------- plan ---------- */
.stepper-lg { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.stepper-lg .num { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; min-width: 48px; text-align: center; }
.round {
  width: 42px; height: 42px; border-radius: 50%; background: var(--card-3); border: 1px solid var(--line-2);
  display: grid; place-items: center; transition: transform 0.15s var(--ease), background 0.2s;
}
.round:active { transform: scale(0.88); background: #333; }
.round svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.round.accent { background: var(--lime-grad); color: #000; border-color: transparent; box-shadow: 0 6px 18px -8px var(--lime-glow); }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0 16px 16px; }
.wdb {
  aspect-ratio: 1; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all 0.2s var(--ease);
}
.wdb.on { background: var(--lime-grad); color: #000; box-shadow: 0 6px 16px -8px var(--lime-glow); border-color: transparent; transform: translateY(-2px); }
.day-card { padding: 14px; margin-bottom: 10px; }
.day-card .dc-head { display: flex; align-items: center; gap: 12px; }
.day-card .dc-title { flex: 1; min-width: 0; }
.day-card .dc-title input {
  background: transparent; border: 0; font-weight: 600; font-size: 16px; width: 100%; padding: 2px 0;
  border-bottom: 1px dashed transparent;
}
.day-card .dc-title input:focus { border-bottom-color: var(--line-2); }
.ex-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 11px; border-radius: 99px; background: var(--card-3); font-size: 12.5px; animation: pop 0.25s var(--ease); }
.tag button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.tag button svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.5; }
.tag.add { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); padding: 6px 12px; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; border-radius: 99px; font-weight: 600; font-size: 15px; width: 100%;
  background: var(--lime-grad); color: #000; transition: transform 0.15s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.accent { background: var(--lime-grad); color: #000; box-shadow: 0 10px 30px -12px var(--lime-glow); }
.btn.ghost { background: var(--card-2); color: #fff; border: 1px solid var(--line-2); }
.btn.danger { background: var(--down-soft); color: var(--down); }
.btn.sm { height: 40px; font-size: 13.5px; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tab bar: static, full width, solid down to the bottom edge ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0 max(12px, calc((100% - 480px) / 2 + 12px)) var(--safe-bottom);
  display: flex; align-items: center; gap: 4px;
  background: #000;
}
/* the same solid colour continues below the bar, so any strip iOS leaves at the bottom still matches */
.tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 200px; background: #000; pointer-events: none; }
.tabbar button {
  flex: 1 1 0; min-width: 0; height: 44px; border-radius: 14px; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.25s, background 0.3s;
}
.tabbar button > span:not(.fab) { display: none; } /* icons only; names stay as aria-labels */
.tabbar button.active { color: #fff; background: none; }
.tabbar svg { flex: 0 0 auto; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; transition: transform 0.3s var(--ease); }
.tabbar button.active svg { stroke: var(--lime); }
.tabbar button:active svg { transform: scale(0.88); }

/* ---------- sheets / overlays ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 40; animation: fadeIn 0.25s ease forwards; opacity: 0; }
.backdrop.out { animation: fadeOut 0.22s ease forwards; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 480px; z-index: 41;
  background: rgba(20, 20, 20, 0.6); border: 1px solid var(--line-2); border-bottom: 0;
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-radius: 26px 26px 0 0; padding: 10px 16px calc(var(--safe-bottom) + 18px);
  max-height: 88vh; overflow-y: auto;
  transform: translate(-50%, 100%); animation: sheetIn 0.38s var(--ease) forwards;
}
.sheet.out { animation: sheetOut 0.26s ease-in forwards; }
@keyframes sheetIn { to { transform: translate(-50%, 0); } }
@keyframes sheetOut { from { transform: translate(-50%, 0); } to { transform: translate(-50%, 100%); } }
.grab { width: 38px; height: 4px; border-radius: 4px; background: #3a3a3a; margin: 0 auto 14px; }
.sheet h2 { font-size: 19px; margin: 0 0 4px; letter-spacing: -0.01em; }
.sheet .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.field {
  width: 100%; height: 50px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2);
  padding: 0 14px; font-size: 16px; transition: border-color 0.2s;
}
.field:focus { border-color: #666; }
.field-label { font-size: 12px; color: var(--muted); margin: 12px 2px 6px; display: block; }
.sheet .btns { display: flex; gap: 8px; margin-top: 18px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.check-row .box { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid #444; display: grid; place-items: center; transition: all 0.2s var(--ease); flex: 0 0 auto; }
.check-row .box svg { width: 14px; height: 14px; stroke: #000; stroke-width: 3; fill: none; opacity: 0; transform: scale(0.5); transition: all 0.2s var(--ease); }
.check-row.on .box { background: var(--lime-grad); border-color: transparent; }
.check-row.on .box svg { opacity: 1; transform: none; stroke: var(--on-accent); }
.check-row .cr-main { flex: 1; min-width: 0; }
.check-row .cr-sub { color: var(--dim); font-size: 12px; }
.mini-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--card-2); flex: 0 0 auto; }
.mini-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mini-btn:active { transform: scale(0.9); }

/* ---------- workout (full screen) ---------- */
.workout {
  position: fixed; inset: 0; z-index: 30; background: var(--bg);
  max-width: 480px; margin: 0 auto; overflow-y: auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 110px);
  animation: woIn 0.42s var(--ease) both;
}
.workout.out { animation: woOut 0.28s ease-in forwards; }
@keyframes woIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes woOut { to { transform: translateY(40px); opacity: 0; } }
.wo-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wo-timer { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; background: var(--card); border: 1px solid var(--line); padding: 8px 14px; border-radius: 99px; display: flex; align-items: center; gap: 8px; }
.wo-timer .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.wo-progress { height: 4px; background: var(--card-3); border-radius: 4px; overflow: hidden; margin: 12px 0 4px; }
.wo-progress i { display: block; height: 100%; background: var(--lime-grad); border-radius: 4px; transition: width 0.5s var(--ease); }
.ex-card { padding: 14px; margin-top: 12px; }
.ex-card .ex-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ex-card .ex-title { flex: 1; min-width: 0; }
.ex-card .ex-title b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-card .ex-title span { font-size: 12px; color: var(--dim); }
.set-head, .set-row { display: grid; grid-template-columns: 26px 1fr 1fr 44px; gap: 8px; align-items: center; }
.set-head { font-size: 11px; color: var(--dim); padding: 0 2px 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.set-head span:nth-child(2), .set-head span:nth-child(3) { text-align: center; }
.set-row { padding: 6px 2px; border-radius: 14px; transition: background 0.3s, opacity 0.3s; }
.set-row.new { animation: rise 0.3s var(--ease) both; }
.set-row.done { background: var(--up-soft); }
.set-row .n { font-weight: 600; color: var(--muted); text-align: center; font-size: 13px; }
.set-row.done .n { color: var(--up); }
.stp { display: flex; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; height: 44px; overflow: hidden; }
.stp button { width: 34px; height: 100%; display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; transition: background 0.15s, color 0.15s; }
.stp button:active { background: var(--card-3); color: #fff; }
.stp button svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; }
.stp input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; text-align: center; font-weight: 600; font-size: 16px; padding: 0; }
.stp input::-webkit-outer-spin-button, .stp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tick {
  width: 44px; height: 44px; border-radius: 12px; background: var(--card-3); display: grid; place-items: center;
  transition: background 0.25s var(--ease), transform 0.15s var(--ease);
}
.tick svg { width: 20px; height: 20px; stroke: var(--dim); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; }
.tick:active { transform: scale(0.88); }
.set-row.done .tick { background: var(--lime-grad); animation: tickPop 0.35s var(--ease); }
.set-row.done .tick svg { stroke: #000; }
@keyframes tickPop { 40% { transform: scale(1.15); } }
.ex-foot { display: flex; gap: 8px; margin-top: 8px; }
.ex-foot .btn { height: 38px; font-size: 13px; font-weight: 500; }
.last-hint { font-size: 11.5px; color: var(--muted); margin: -4px 2px 8px; }
.last-hint b { color: #ddd; font-weight: 600; }
.wo-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; z-index: 31;
  padding: 14px 16px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, transparent, #000 35%);
}
.rest {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 86px); z-index: 32;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(30, 30, 30, 0.6); color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 99px; padding: 8px 8px 8px 16px;
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px;
  transition: transform 0.35s var(--ease), opacity 0.3s;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.rest.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.rest .t { font-variant-numeric: tabular-nums; min-width: 42px; }
.rest button { background: rgba(255, 255, 255, 0.14); color: #fff; border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 12px); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: rgba(30, 30, 30, 0.6); color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); font-weight: 600; font-size: 13.5px; padding: 10px 16px; border-radius: 99px;
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  transition: transform 0.35s var(--ease), opacity 0.3s; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.muted { color: var(--muted); }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.flex { display: flex; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- login ---------- */
body.locked #app, body.locked .rest { display: none; }
.login { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow: hidden; transition: opacity 0.35s ease, transform 0.35s var(--ease); }
.login.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.lg-view {
  position: absolute; inset: 0; margin: 0 auto; max-width: 420px;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bottom) + 22px);
  opacity: 0; transform: translateX(28px); pointer-events: none;
  transition: opacity 0.32s ease, transform 0.42s var(--ease);
}
.lg-view.on { opacity: 1; transform: none; pointer-events: auto; }
.lg-view.left { transform: translateX(-28px); }
.lg-top { display: flex; justify-content: center; align-items: center; height: 44px; position: relative; }
.lg-top .icon-btn { position: absolute; left: 0; }
.lg-mark { width: 30px; height: 30px; border-radius: 9px; }
.lg-art { flex: 1; display: grid; place-items: center; min-height: 0; }
.lg-art canvas { width: min(94vw, 400px, 50vh); height: min(94vw, 400px, 50vh); touch-action: none; cursor: crosshair; }
.lg-welcome h1 { text-align: center; font-size: 46px; font-weight: 700; letter-spacing: -0.035em; margin: 0; }
.lg-welcome .lg-tagline { text-align: center; color: var(--muted); margin: 6px 0 28px; font-size: 15px; }
.lg-welcome .btn { height: 54px; margin-top: 10px; }
.lg-foot { text-align: center; color: var(--dim); font-size: 11.5px; margin-top: 18px; line-height: 1.5; }
.lg-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 26px 0 4px; }
.lg-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.pw { position: relative; }
.pw .field { padding-right: 50px; }
.pw-eye { position: absolute; right: 6px; top: 5px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.login-err { color: var(--down); font-size: 13px; min-height: 20px; margin: 10px 2px 8px; text-align: inherit; }
.lg-user .btn { margin-top: 18px; }
.lg-pin { align-items: center; text-align: center; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin: 34px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #555; transition: background 0.15s, border-color 0.15s, transform 0.2s var(--ease); }
.pin-dots i.on { background: #fff; border-color: #fff; transform: scale(1.1); }
.pin-dots.ok i { background: #fff; border-color: #fff; }
.keypad { display: grid; grid-template-columns: repeat(3, 96px); gap: 6px 14px; justify-content: center; margin-top: auto; }
/* plain numbers, no circles: the whole cell is the tap target, a press just dims the digit */
.key {
  width: 96px; height: 68px; border: 0; border-radius: 0; background: transparent; color: #fff;
  font-size: 30px; font-weight: 400; display: grid; place-items: center;
  transition: opacity 0.12s, transform 0.12s var(--ease);
}
.key:active { opacity: 0.4; transform: scale(0.9); }
.key.ghost { color: var(--muted); }
.key svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shake { animation: shake 0.4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (max-height: 680px) { .key { width: 84px; height: 58px; } .keypad { grid-template-columns: repeat(3, 84px); gap: 4px 12px; } .lg-welcome h1 { font-size: 38px; } }

/* ---------- past-workout logging ---------- */
.wo-log .set-head, .wo-log .set-row { grid-template-columns: 26px 1fr 1fr; }
.log-dur { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-top: 14px; }
.log-dur .stp { width: 150px; flex: 0 0 auto; }

/* login keeps its black & white look */
.login .btn:not(.ghost) { background: #fff; color: #000; box-shadow: none; }
/* "Enter username" on the Welcome screen uses the lime accent */
.login .lg-welcome .btn[data-lg="user"] { background: var(--lime-grad); color: #000; box-shadow: 0 10px 30px -14px var(--lime-glow); }

/* ---------- center tab: green button, white app logo ---------- */
.tabbar .tab-center { flex: 0 0 auto; width: 60px; background: none; box-shadow: none; }
.tabbar .tab-center > span:not(.fab) { display: none; }
.tabbar .tab-center .fab {
  position: relative; width: 58px; height: 40px; border-radius: 99px; display: grid; place-items: center;
  background: var(--lime-grad); color: #000; /* same as the Start button on Home */
  box-shadow: none;
  transition: transform 0.2s var(--ease);
}
.tabbar .tab-center .fab svg.play-mark { width: 18px; height: 18px; fill: none; stroke: #000; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .tab-center:active .fab { transform: scale(0.9); }

.set-row .n small { display: block; font-size: 9.5px; color: var(--muted); font-weight: 500; line-height: 1; margin-top: 2px; }


/* ---------- mobile touch fixes ---------- */
/* no double-tap-to-zoom: quick repeated taps (passcode keypad, steppers) made the page jump */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, .key, .tabbar, .keypad { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* while the login is showing, the page behind it can't scroll, so the keyboard can't shove it around */
body.locked { position: fixed; inset: 0; overflow: hidden; }
.login { overscroll-behavior: none; }


/* Safari: let the login backdrop run under the status bar and the floating toolbar
   (largest viewport, lvh), while the buttons stay in the visible area (dvh). */
.login { inset: 0 0 auto 0; height: 100vh; height: 100lvh; }
.lg-view { bottom: auto; height: 100vh; height: 100dvh; }

/* ---------- keyboard-aware sheets ---------- */
/* sheets sit on top of the on-screen keyboard and never get taller than what's still visible */
.sheet { bottom: var(--kb, 0px); max-height: min(88vh, calc(var(--vvh, 100vh) - 16px)); transition: bottom 0.22s ease, max-height 0.22s ease; }
.kb-open .sheet { padding-bottom: 12px; }
.pk-list { max-height: min(46vh, calc(var(--vvh, 100vh) - 250px)); min-height: 120px; overflow-y: auto; }
.pk-item { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.pk-item .check-row { border-bottom: 0; flex: 1; min-width: 0; }
.pk-item .mini-btn { background: transparent; }
.pk-item .mini-btn:active { color: var(--down); }

/* ---------- library: quick add + delete ---------- */
.lib-add { display: flex; gap: 8px; margin-bottom: 6px; }
.lib-add .field { flex: 1; min-width: 0; }
.lib-add .btn { width: 50px; height: 50px; flex: 0 0 auto; padding: 0; border-radius: 14px; }
.lib-row { gap: 8px; }
.lib-row .row-hit { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; text-align: left; }
.lib-row .mini-btn:last-child:active { color: var(--down); }

/* ---------- profile photo ---------- */
.avatar { position: relative; padding: 0; color: #fff; cursor: pointer; transition: transform 0.15s var(--ease); }
.avatar:active { transform: scale(0.92); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.has-photo { border-color: rgba(200, 240, 60, 0.35); }
.avatar-cam {
  position: absolute; right: -3px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--lime-grad); color: #000; display: grid; place-items: center; border: 2px solid #000;
}
.avatar-cam svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.avatar-preview { width: 112px; height: 112px; margin: 4px auto 12px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(200, 240, 60, 0.4); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- accounts ---------- */
.lg-new { text-align: center; color: var(--muted); font-size: 13.5px; margin: 16px 0 0; }
.lg-link { color: var(--lime); font-weight: 600; font-size: inherit; padding: 2px 0; background: none; }
.lg-link:active { opacity: 0.6; }
.lg-switch { margin-top: 14px; }
.lg-form { overflow-y: auto; overscroll-behavior: contain; }
.lg-form .lg-new { margin-top: 14px; }
.lg-welcome .lg-new { margin-top: 18px; }

/* ---------- no flash before login ---------- */
.no-session #app { visibility: hidden; }

/* ---------- day colour picker ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); transition: transform 0.15s var(--ease); }
.swatch:active { transform: scale(0.9); }
.swatch.on { border-color: var(--text); transform: scale(1.08); }
.wd-pick { display: flex; flex-direction: column; gap: 6px; }
.wd-pick .btn { justify-content: flex-start; padding: 0 16px; }

/* chart lines that need to read in both themes */
:root { --chart-grid: rgba(255, 255, 255, 0.06); --chart-guide: rgba(255, 255, 255, 0.35); }

/* ---------- light mode ---------- */
html[data-theme="light"] {
  --bg: #f4f4f5; --card: #ffffff; --card-2: #f0f0f2; --card-3: #e6e6ea;
  --line: rgba(0, 0, 0, 0.08); --line-2: rgba(0, 0, 0, 0.13);
  --text: #0b0b0b; --muted: #6b6b72; --dim: #9b9ba2;
  --accent: #0b0b0b; --on-accent: #fff; --accent-soft: rgba(0, 0, 0, 0.07);
  --up: #3f7d0a; --up-soft: rgba(110, 170, 20, 0.16);
  --chart-grid: rgba(0, 0, 0, 0.07); --chart-guide: rgba(0, 0, 0, 0.3);
  color-scheme: light;
}
html[data-theme="light"] .card { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
html[data-theme="light"] .card::before { display: none; }
html[data-theme="light"] .hero { background: radial-gradient(110% 85% at 100% 0%, rgba(200, 240, 60, 0.35), transparent 58%), #fff; border-color: rgba(120, 170, 20, 0.25); }
html[data-theme="light"] .avatar { background: linear-gradient(135deg, #ececef, #d9d9de); color: #0b0b0b; }
html[data-theme="light"] .avatar-cam { border-color: var(--bg); }
html[data-theme="light"] .action { color: #333; }
html[data-theme="light"] .sec-head .link { color: #222; }
html[data-theme="light"] .mono { background: #fff; }
html[data-theme="light"] .chip { color: #333; }
html[data-theme="light"] .day.out { color: #c6c6cc; }
html[data-theme="light"] .day.trained { color: var(--text); }
html[data-theme="light"] .day.today { box-shadow: inset 0 0 0 1.5px #0b0b0b; }
html[data-theme="light"] .round:active { background: #ddd; }
html[data-theme="light"] .btn.ghost { color: var(--text); }
html[data-theme="light"] .stp button:active { color: var(--text); }
html[data-theme="light"] .last-hint b { color: #333; }
html[data-theme="light"] .check-row .box { border-color: #bbb; }
html[data-theme="light"] .grab { background: #c8c8cd; }
html[data-theme="light"] .backdrop { background: rgba(0, 0, 0, 0.3); }
html[data-theme="light"] .sheet { background: rgba(255, 255, 255, 0.78); }
html[data-theme="light"] .wo-bar { background: linear-gradient(180deg, transparent, var(--bg) 35%); }
html[data-theme="light"] .tabbar, html[data-theme="light"] .tabbar::after { background: #fff; }
html[data-theme="light"] .tabbar button { color: rgba(0, 0, 0, 0.42); }
html[data-theme="light"] .tabbar button.active { color: #0b0b0b; }
html[data-theme="light"] .tabbar button.active svg { stroke: #4d8a0c; }
html[data-theme="light"] .tag { color: #222; }
html[data-theme="light"] .swatch.on { border-color: #0b0b0b; }
/* the login screen stays black in both modes */
html[data-theme="light"] .login {
  --bg: #000; --card-2: #1d1d1d; --card-3: #262626; --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.12);
  --text: #fff; --muted: #8b8b8b; --dim: #5a5a5a; color: #fff; color-scheme: dark;
}
html[data-theme="light"] .login .btn.ghost { color: #fff; }
/* light mode: green buttons are a flat colour, no gradient or glow */
html[data-theme="light"] { --lime-grad: #c8f03c; --lime-glow: transparent; }
/* light mode: the weekly volume card is the brightest thing on the page */
html[data-theme="light"] .hero {
  background:
    radial-gradient(120% 95% at 100% 0%, rgba(200, 240, 60, 0.95) 0%, rgba(200, 240, 60, 0.45) 38%, transparent 70%),
    radial-gradient(90% 70% at 0% 100%, rgba(170, 225, 40, 0.30), transparent 70%),
    linear-gradient(160deg, #ffffff 0%, #f3fbdc 100%);
  border-color: rgba(140, 195, 20, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .hero .action .btn-circ { background: rgba(255, 255, 255, 0.75); border-color: rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .hero .action.primary .btn-circ { background: var(--lime-grad); box-shadow: 0 8px 20px -8px rgba(120, 175, 10, 0.7); }
html[data-theme="light"] .hero .pill { background: rgba(255, 255, 255, 0.7); }
html[data-theme="light"] .hero .pill.up { background: rgba(110, 170, 20, 0.18); }
html[data-theme="light"] .hero .pill.down { background: rgba(255, 91, 74, 0.14); }
html[data-theme="light"] .hero .divider { background: rgba(0, 0, 0, 0.08); }
/* dark mode: the weekly volume card carries much more green */
html:not([data-theme="light"]) .hero {
  background:
    radial-gradient(120% 95% at 100% 0%, rgba(200, 240, 60, 0.55) 0%, rgba(160, 215, 30, 0.22) 40%, transparent 72%),
    radial-gradient(80% 70% at 0% 100%, rgba(120, 180, 20, 0.22), transparent 70%),
    linear-gradient(160deg, #1a2410 0%, #0e1409 100%);
  border-color: rgba(200, 240, 60, 0.32);
}
html:not([data-theme="light"]) .hero .action .btn-circ { background: rgba(0, 0, 0, 0.35); border-color: rgba(200, 240, 60, 0.18); }
html:not([data-theme="light"]) .hero .action.primary .btn-circ { background: var(--lime-grad); border-color: transparent; }
html:not([data-theme="light"]) .hero .pill { background: rgba(0, 0, 0, 0.35); }
html:not([data-theme="light"]) .hero .pill.up { background: rgba(200, 240, 60, 0.18); }
html:not([data-theme="light"]) .hero .pill.down { background: rgba(255, 91, 74, 0.18); }
html:not([data-theme="light"]) .hero .divider { background: rgba(200, 240, 60, 0.14); }
/* the card's gradient used to show through its translucent border (brighter near the lime corner),
   so the line looked uneven: keep the background inside the border and use one solid border colour */
.hero, html:not([data-theme="light"]) .hero, html[data-theme="light"] .hero { background-clip: padding-box !important; }
html:not([data-theme="light"]) .hero { border-color: #3a4a16; }
html[data-theme="light"] .hero { border-color: #cfe58a; }

/* ---------- reorder workout cards ---------- */
.ex-card { padding-left: 28px; }
.ex-grip { position: absolute; left: 0; top: 0; bottom: 0; width: 24px; display: grid; place-items: center; color: var(--dim); touch-action: none; cursor: grab; border-radius: var(--radius) 0 0 var(--radius); }
.ex-grip svg { width: 10px; height: 22px; fill: currentColor; }
.ex-grip:active { color: var(--text); background: var(--accent-soft); }
.ex-card.dragging { z-index: 5; box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.7); opacity: 0.96; transition: none; }
.ex-card.dragging .ex-grip { color: var(--lime); cursor: grabbing; }

/* ---------- exercise library: search + sort + groups ---------- */
.lib-search { display: flex; gap: 8px; margin-bottom: 10px; }
.lib-search .field { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; }
.lib-search .btn { width: 50px; height: 50px; flex: 0 0 auto; padding: 0; border-radius: 14px; }
.lib-sort { margin-bottom: 4px; }
.lib-group { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 16px 2px 6px; border-bottom: 1px solid var(--line); }
.lib-group span { font-weight: 500; color: var(--dim); }
.lib-add-row { color: var(--text); }
.lib-add-row .mono { background: var(--accent-soft); color: var(--lime); border-color: transparent; }
.lib-add-row .mono svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.lib-add-row .r-title, .lib-add-row .r-sub { display: block; }
.grp-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- muscle group editing ---------- */
.grp-head { display: flex; justify-content: space-between; align-items: center; margin: -26px 2px 8px; }
.grp-edit { font-size: 13px; }
.grp-chip { position: relative; }
.grp-chip.removable { padding-right: 30px; border-color: rgba(255, 91, 74, 0.35); }
.grp-x { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 16px; line-height: 1; color: var(--down); }
.grp-new-btn { border-style: dashed; color: var(--muted); background: transparent; }
.grp-add { display: flex; gap: 8px; margin-top: 10px; }
.grp-add[hidden] { display: none; }
.grp-add .field { flex: 1; min-width: 0; height: 44px; }
.grp-add .btn { width: auto; padding: 0 18px; height: 44px; }

/* ---------- home: weekly volume mini graph ---------- */
.hero-spark { width: 112px; height: 46px; position: relative; flex: 0 0 auto; margin-left: 12px; }
.hero-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hero-spark span { position: absolute; right: 0; bottom: -14px; font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- home: glowing day dots ---------- */
.day-dot-wrap { width: 40px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.day-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dc); }
.day-dot.s-done { box-shadow: 0 0 8px 1px color-mix(in srgb, var(--dc) 55%, transparent); }
.day-dot.s-today { box-shadow: 0 0 14px 4px color-mix(in srgb, var(--dc) 70%, transparent); animation: dotPulse 1.8s ease-in-out infinite; }
.day-dot.s-dim { opacity: 0.4; }
@keyframes dotPulse {
  50% { transform: scale(1.15); box-shadow: 0 0 22px 8px color-mix(in srgb, var(--dc) 45%, transparent); }
}
.day-dot-label { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Progress → All Lifts sort switch */
.lift-sort { margin-bottom: 4px; }

/* nothing in the app can be text-selected or long-pressed into a copy menu (annoying on phones);
   text fields still work normally */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg { -webkit-user-drag: none; }

/* ---------- in-page transitions ---------- */
@keyframes softIn { from { opacity: 0.35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view.soft .list > *, .view.soft .cal-grid > .day, .view.soft .card > .empty, .view.soft .lift-card,
.view.soft .day-card, .view.soft .stat, .view.soft .chart-card .big-row, .view.soft .ex-tags > .tag,
.soft-list > * { animation: softIn 0.28s var(--ease) both; }
.view.soft .list > *:nth-child(2), .soft-list > *:nth-child(2) { animation-delay: 0.02s; }
.view.soft .list > *:nth-child(3), .soft-list > *:nth-child(3) { animation-delay: 0.04s; }
.view.soft .list > *:nth-child(4), .soft-list > *:nth-child(4) { animation-delay: 0.06s; }
.view.soft .list > *:nth-child(n+5), .soft-list > *:nth-child(n+5) { animation-delay: 0.08s; }
/* calendar month slide */
@keyframes slideFromRight { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes slideFromLeft { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.cal-grid.slide-next, .cal-head .m.slide-next { animation: slideFromRight 0.3s var(--ease) both; }
.cal-grid.slide-prev, .cal-head .m.slide-prev { animation: slideFromLeft 0.3s var(--ease) both; }
.cal-grid.slide-next > .day, .cal-grid.slide-prev > .day { animation: none; }
/* nav bar: selected icon pops */
@keyframes tabPop { 0% { transform: scale(0.8); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
.tabbar button.pop svg { animation: tabPop 0.36s var(--ease); }
.tabbar button { transition: color 0.25s, background 0.3s, transform 0.15s var(--ease); }
/* Plan tab: the day dot is a button (opens colour + weekday) */
.day-dot-btn { padding: 8px 0; border-radius: 12px; transition: background 0.2s, transform 0.15s var(--ease); }
.day-dot-btn:active { transform: scale(0.92); background: var(--accent-soft); }

/* ---------- exercise picker: muscle-group menu ---------- */
.pk-group { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 2px; border-bottom: 1px solid var(--line); text-align: left; transition: transform 0.15s var(--ease); }
.pk-group:active { transform: scale(0.985); }
.pk-group .mono { width: 38px; height: 38px; border-radius: 12px; font-size: 12px; }
.pk-group .cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-group .pg-name { font-weight: 600; font-size: 15px; }
.pk-group .pg-chev svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.pk-back { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 2px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pk-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.pk-back b { margin-left: auto; color: var(--text); font-size: 15px; }

/* ---------- sets slide open / fold shut ---------- */
@keyframes rowIn { from { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; transform: translateY(-6px); } to { max-height: 64px; opacity: 1; transform: none; } }
@keyframes rowOut { from { max-height: 64px; opacity: 1; } to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; transform: translateY(-4px); } }
.set-row.row-in { overflow: hidden; animation: rowIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.set-row.row-out { overflow: hidden; pointer-events: none; animation: rowOut 0.26s ease-in forwards; }
