/* Barlow and Barlow Condensed, self-hosted (SIL Open Font License, fonts/OFL.txt), DECISIONS #40 */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/barlow-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-700.woff2') format('woff2'); }

/* "Steel & orange" theme (DECISIONS #40): slate greys with one accent colour, now the plate blue (DECISIONS #48) */
:root {
  --bg: #15181c;
  --card: #1e2329;
  --card2: #29303a;
  --card3: #343c47;
  --dialog: #1b2026;
  --sheet: #1b2026;
  --line: #2f3741;
  --line2: #46505c;
  --card-edge: #2a313a;
  --text: #eef1f4;
  --text2: #c3cad2;
  --muted: #8e98a4;
  --muted2: #6b7580;
  --faint: #3c4450;
  --accent: #2c5aa8;     /* plate blue from the app icon (DECISIONS #48): fills, buttons */
  --accent-hi: #6b97e0;  /* the same blue, lighter: text, icons and thin lines on dark backgrounds */
  --accent-ink: #ffffff; /* text on --accent */
  --red: #e53935;
  --gold: #f2b705;
  --blue: #3d8bff;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --fs: 1; /* text size scale, set from Settings (DECISIONS #24) */
  --f-ui: 'Barlow', Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-num: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --tabbar-h: 0px; /* set when the bottom tab bar is shown */
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: calc(15px * var(--fs))/1.45 var(--f-ui);
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 500; }
h2 { font-size: calc(20px * var(--fs)); }
h3 { font-size: calc(16px * var(--fs)); }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -5px; }
.group-ico { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.group-ico .f { fill: currentColor; stroke: none; }
.group-ico .s { fill: currentColor; fill-opacity: .22; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: calc(13px * var(--fs)); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.between { justify-content: space-between; gap: 10px; }
.center-row { justify-content: center; margin: 18px 0; }
.mt { margin-top: 18px; }
.sub { display: block; color: var(--muted); font-size: calc(13px * var(--fs)); }
.title { display: block; font-weight: 500; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.desc { color: var(--muted); margin: 0 0 6px; }

.main {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 8px calc(110px + var(--safe-b));
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-t)) 8px 8px;
  margin: 0 -8px 4px;
  background: var(--bg);
}
.topbar-title { flex: 1; font-size: calc(22px * var(--fs)); font-weight: 400; padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.date-pill { background: var(--accent); color: var(--accent-ink); font-size: calc(20px * var(--fs)); padding: 6px 16px; border-radius: 12px; margin-left: 10px; }
.date-text { font-size: calc(22px * var(--fs)); margin-left: 10px; padding: 6px 4px; }
.topbar .spacer { flex: 1; }

/* ---------- Drawer ---------- */
.drawer {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-panel {
  position: absolute; inset: 0 auto 0 0; width: min(300px, 82vw); background: var(--sheet);
  padding: calc(18px + var(--safe-t)) 10px 18px; display: flex; flex-direction: column; gap: 2px;
  transform: translateX(-100%); transition: transform .22s ease;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; }
.drawer-head img { border-radius: 10px; }
.drawer-panel button { display: flex; align-items: center; gap: 16px; padding: 13px 12px; border-radius: 10px; text-align: left; font-size: calc(15px * var(--fs)); }
.drawer-panel button.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-hi); }
.drawer-panel hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; width: calc(100% - 8px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 16px; border-radius: 12px; font-weight: 500;
  background: var(--card2); transition: transform .08s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--card2); }
.btn.danger { background: color-mix(in srgb, var(--red) 18%, transparent); color: #ff6b6b; }
.btn.sm { padding: 7px 12px; font-size: calc(13px * var(--fs)); border-radius: 10px; }
.btn.sm .ico { width: 16px; height: 16px; vertical-align: -3px; }
.btn.big { padding: 14px 30px; font-size: calc(17px * var(--fs)); border-radius: 16px; min-width: 150px; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; color: var(--text); }
.icon-btn:active { background: var(--card2); }
.icon-btn.sm { width: 34px; height: 34px; font-size: calc(18px * var(--fs)); font-weight: 700; }
.icon-btn.sm .ico { width: 18px; height: 18px; }
.text-btn { padding: 10px 14px; border-radius: 8px; text-transform: uppercase; font-weight: 500; letter-spacing: .03em; color: var(--muted); }
.text-btn.accent { color: var(--accent-hi); }
.text-btn:active { background: var(--card2); }
.danger-text { color: #ff6b6b !important; }

.fab-wrap {
  position: fixed; right: max(16px, calc(50% - 324px)); bottom: calc(18px + var(--safe-b)); z-index: 20;
  display: flex; align-items: center; gap: 14px; transition: transform .25s;
}
body.resting .fab-wrap { transform: translateY(-64px); }
.fab {
  width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.fab .ico { width: 30px; height: 30px; }
.fab-round { width: 48px; height: 48px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; }
.close-float {
  position: fixed; right: max(16px, calc(50% - 324px)); bottom: calc(18px + var(--safe-b)); z-index: 5;
  background: var(--card); padding: 16px 22px; border-radius: 16px; text-transform: uppercase; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
}

/* ---------- Inputs ---------- */
.input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  background: var(--card2); border: 1px solid transparent; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; }
.input.tiny { width: 58px; padding: 7px 6px; text-align: center; }
.search { margin: 4px 0 10px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.form label.switch { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: calc(14px * var(--fs)); }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.file-btn { cursor: pointer; color: var(--text) !important; font-size: calc(15px * var(--fs)) !important; }
.form label.file-btn { flex-direction: row; align-items: center; justify-content: center; }

/* ---------- Cards and lists ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card > h3 { margin-bottom: 10px; }
.section-title { margin: 20px 4px 10px; font-size: calc(12px * var(--fs)); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--card2); font-size: calc(13px * var(--fs)); margin: 2px 4px 2px 0; }
.list { display: flex; flex-direction: column; }
.list-heading { font-size: calc(12px * var(--fs)); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 6px 6px; }
.list-item { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 8px; border-radius: 12px; }
.list-item:not(.static):active, .list-item.selected { background: var(--card2); }
.list-item .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item > .ico { color: var(--muted); }
.check { display: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); place-items: center; flex: none; }
.check .ico { width: 16px; height: 16px; stroke-width: 3; }
.list-item.selected .check { display: grid; }
.avatar { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--card2); color: var(--accent-hi); font-weight: 700; }
.avatar.gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }

.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 13px; border-radius: 99px; background: var(--card2); font-size: calc(13px * var(--fs)); white-space: nowrap; }
.chip.active { background: var(--accent); color: var(--accent-ink); }

.seg { display: flex; background: var(--card); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.seg button.active { background: var(--card2); color: var(--text); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 560px) { .tiles.four { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.modal .tile { background: var(--card2); }
.tile-val { font-size: calc(20px * var(--fs)); font-weight: 700; }
.tile-label { font-size: calc(12px * var(--fs)); color: var(--muted); }
.chart-box { width: 100%; margin: 6px 0; }
.chart-box canvas { display: block; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: calc(13px * var(--fs)); }
.hbar-label { width: 110px; flex: none; display: flex; align-items: center; gap: 8px; }
.hbar-track { flex: 1; height: 10px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.hbar-val { width: 28px; text-align: right; font-weight: 700; }

/* ---------- Day view ---------- */
.day-summary { text-align: center; color: var(--muted2); font-size: calc(12px * var(--fs)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 6px 0 8px; }
.group-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font-size: calc(15px * var(--fs)); margin-bottom: 14px; }
.day-comment { display: block; width: 100%; text-align: center; color: var(--text2); padding: 6px 12px 14px; }

.ex-card { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 12px 4px 14px 12px; margin-bottom: 10px; }
.thumb {
  width: 60px; height: 60px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--g) 16%, #f3f3ef); color: #3b3b3b;
  border-left: 4px solid var(--g);
  align-self: flex-start;
}
.thumb svg { width: 44px; height: 44px; }
.thumb.photo { background: #fff; overflow: hidden; }
.thumb.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-photo { position: relative; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: #fff; margin: 4px 0 12px; }
.ex-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-photo img + img { animation: frame 2.4s steps(1) infinite; }
@keyframes frame { 0% { opacity: 0; } 50% { opacity: 1; } }
.prog-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 0 0 4px; }
.prog-row > .ico { color: var(--muted); }
.scale-row { display: flex; align-items: center; gap: 12px; }
.scale-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 28px; }
.scale-val { min-width: 48px; text-align: right; font-weight: 700; color: var(--text); }
.scale-preview { background: var(--card2); border-radius: 10px; padding: 10px 12px; color: var(--text); }
.scale-preview .v { font-size: calc(16px * var(--fs)); font-weight: 700; }
.scale-preview .u { font-size: calc(10px * var(--fs)); font-weight: 700; color: var(--muted2); margin-left: 2px; }
.credit { font-size: calc(11px * var(--fs)); color: var(--muted); }
.ex-card > button:first-child { align-self: flex-start; }
.ex-body { flex: 1; min-width: 0; }
.ex-head { display: flex; align-items: flex-start; gap: 0; }
.ex-title { flex: 1; min-width: 0; font-size: calc(17px * var(--fs)); font-weight: 500; text-align: left; padding: 6px 0; }
.ex-head .icon-btn { width: 40px; height: 40px; }
.ex-head .icon-btn .ico { width: 26px; height: 26px; stroke-width: 2.4; }
.sets { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 2px; }
.set-col { min-width: 54px; text-align: left; position: relative; padding: 12px 2px 0; border-radius: 8px; }
.set-col:active { background: var(--card2); }
.set-col .dot { position: absolute; top: 2px; left: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.set-col .dot.hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.set-col .line { display: block; white-space: nowrap; line-height: 1.35; }
.set-col .v { font-size: calc(16px * var(--fs)); font-weight: 700; color: var(--text); }
.set-col .u { font-size: calc(10px * var(--fs)); font-weight: 700; color: var(--muted2); text-transform: uppercase; margin-left: 2px; }
.set-col.planned .v { color: var(--muted2); }
.set-col.pr .v { color: var(--gold); }
.set-delta { display: block; font-size: calc(10.5px * var(--fs)); font-weight: 700; color: var(--accent-hi); white-space: nowrap; }
.se-compare { width: 100%; border-collapse: collapse; margin: 0 0 10px; background: var(--card2); border-radius: 10px; overflow: hidden; font-size: calc(14px * var(--fs)); }
.se-compare th { text-align: left; font-weight: 500; color: var(--muted); font-size: calc(12px * var(--fs)); padding: 8px 12px 2px; }
.se-compare td { padding: 2px 12px 9px; font-weight: 600; }
.se-compare .delta { color: var(--accent-hi); font-size: calc(12px * var(--fs)); font-weight: 700; margin-left: 4px; }
.set-note { display: block; font-size: calc(11px * var(--fs)); color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 12px 6px 8px; border-radius: 99px;
  background: var(--card2); color: var(--accent-hi); font-size: calc(13px * var(--fs)); font-weight: 700; }
.log-all .ico { width: 18px; height: 18px; }
.stall { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 6px 4px 6px 12px;
  border-radius: 10px; background: rgba(242, 183, 5, .1); color: var(--gold); font-size: calc(13px * var(--fs)); }

.empty-day { text-align: center; padding: 20vh 16px 0; }
.empty-day h2 { color: var(--faint); font-size: calc(30px * var(--fs)); font-weight: 700; margin-top: 8px; }
.log-empty h2 { font-family: var(--f-num); font-weight: 600; font-size: calc(30px * var(--fs)); line-height: 1.15; color: var(--text); }
.log-empty p { color: var(--muted); font-size: calc(15px * var(--fs)); margin-top: 8px; }
.log-empty::before { content: ""; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--accent-hi); margin: 0 auto 18px; }

/* ---------- Add-exercise sheet ---------- */
.quick-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 104px; border-radius: 14px; font-size: calc(16px * var(--fs)); text-align: center; padding: 10px;
}
.quick-tile .ico { width: 34px; height: 34px; }
.qt-program { background: #1c0f20; color: #b54fd6; }
.qt-day { background: #10200f; color: #3fbf55; }
.qt-recent { background: #0c1233; color: #4d6bff; }
.qt-comment { background: #161c22; color: #8aa2b3; }
.group-row { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--card); border-radius: 14px; padding: 12px 4px 12px 16px; margin-bottom: 8px; min-height: 64px; }
.group-row .name { flex: 1; font-size: calc(17px * var(--fs)); font-weight: 500; }
.group-row .days { color: var(--muted); font-size: calc(13px * var(--fs)); }
.group-row .icon-btn { color: var(--text); }
.group-row:active { background: var(--card2); }
.ex-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 8px; border-radius: 12px; }
.ex-row .thumb { width: 48px; height: 48px; border-radius: 10px; }
.ex-row .thumb svg { width: 34px; height: 34px; }
.ex-row:active, .ex-row.selected { background: var(--card2); }
.ex-row .check { margin-left: auto; }
.ex-row.selected .check { display: grid; }

/* Exercise list rows */
.ex-item { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--card); border-radius: 12px; padding: 6px 2px 6px 6px; margin-bottom: 6px; cursor: pointer; }
.ex-item:active { background: var(--card2); }
.ex-item .name { flex: 1; min-width: 0; font-size: calc(15px * var(--fs)); font-weight: 500; line-height: 1.25; }
.ex-item .days { font-size: calc(12px * var(--fs)); color: var(--muted); white-space: nowrap; }
.ex-item .days.old { color: var(--faint); }
.thumb-wrap { position: relative; flex: none; }
.ex-item .thumb { width: 52px; height: 52px; border-radius: 10px; }
.ex-item .thumb svg { width: 36px; height: 36px; }
.fav-star { position: absolute; top: -5px; right: -5px; color: #f5b400; font-size: calc(15px * var(--fs)); line-height: 1; text-shadow: 0 1px 2px #000; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 12px 40px; }
.fchip { padding: 4px 10px; border-radius: 99px; background: var(--card); color: var(--muted); font-size: calc(13px * var(--fs)); }
.fchip.sub { color: var(--c); font-weight: 500; }
.fchip.star { color: #f5b400; background: #2a2208; padding: 4px 14px; }
.fchip.on { background: var(--card3); color: #fff; outline: 1px solid var(--line2); }
.fchip.sub.on { background: color-mix(in srgb, var(--c) 28%, transparent); color: var(--c); outline-color: var(--c); }
.fchip.star.on { background: #f5b400; color: #221a00; }

/* ---------- Programs ---------- */
.prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prog-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #111; text-align: center; }
.prog-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.prog-name {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px 14px;
  font-size: calc(17px * var(--fs)); font-weight: 700; line-height: 1.2; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.9);
}
.prog-more { position: absolute; top: 4px; right: 2px; color: #fff; }
.lvl-badge {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 10px; border-radius: 99px;
  font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.lvl-beginner { background: #3fbf55; color: #0b2a10; }
.lvl-intermediate { background: #d4a514; color: #2b2000; }
.lvl-advanced { background: #d23a30; color: #3b0905; }
.lvl-other { background: var(--line2); color: #eee; }
.workout-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 8px; width: 100%; text-align: left; }
.workout-row .title { font-size: calc(16px * var(--fs)); }
.workout-row .add { color: var(--accent-hi); font-weight: 500; text-transform: uppercase; font-size: calc(13px * var(--fs)); }
.ed-ex { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: calc(14px * var(--fs)); }
.ed-ex:last-of-type { border-bottom: 0; }
.workout > .row { margin-bottom: 6px; }
.workout > .btn { margin-top: 8px; }
.modal .card { background: var(--card); }

/* ---------- Blocks ---------- */
.block-banner { display: flex; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.block-banner .sub { white-space: normal; }
.banner-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-hi); }
.block-card .bar { height: 6px; border-radius: 99px; background: var(--card2); margin: 10px 0 8px; overflow: hidden; }
.block-card .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.block-next { margin: 8px 0 4px; font-size: calc(14px * var(--fs)); }
.tpl-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.tpl-row > .ico { color: var(--muted); }
.lift-row { display: flex; align-items: flex-end; gap: 10px; }
.lift-row .lift-pick { justify-content: flex-start; text-align: left; white-space: normal; min-height: 44px; }
.lift-row .max-input { width: 110px; flex: none; }
.sched { display: grid; grid-template-columns: 62px repeat(var(--days), minmax(0, 1fr)); gap: 4px; font-size: calc(12.5px * var(--fs)); }
.sched-h { color: var(--muted); font-size: calc(11px * var(--fs)); font-weight: 700; text-transform: uppercase; padding: 6px 2px; align-self: center; }
.sched-cell { background: var(--card); border-radius: 8px; padding: 7px 6px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 44px; }
.sched-cell.next { outline: 2px solid var(--accent-hi); }
.sched-cell.past { opacity: .45; }
.sc-line { display: block; line-height: 1.3; }
.be-week { border-top: 1px solid var(--line); padding-top: 12px; }
.be-week > .row { margin-bottom: 8px; }
.be-day { display: flex; flex-direction: column; gap: 8px; }
.be-item { background: var(--card2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.be-fields { flex-wrap: wrap; gap: 6px; }
.be-kind { width: auto; flex: 1 1 150px; padding: 7px 8px; }
.be-item .input.tiny { background: var(--card); }
.form .switch.small { font-size: calc(13px * var(--fs)); }

/* ---------- History ---------- */
.hist-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist-date { font-size: calc(13px * var(--fs)); margin-bottom: 4px; color: var(--muted); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; text-align: center; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid.wk span { font-size: calc(11px * var(--fs)); color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; border-radius: 50%; position: relative; }
.cal-day.has::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.cal-day.today { color: var(--accent-hi); font-weight: 700; }
.cal-day.sel { background: var(--accent); color: var(--accent-ink); }
.cal-day.sel::after { background: var(--accent-ink); }

/* ---------- Modals: full-screen sheets and centred dialogs ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: 100%; max-width: 680px; max-height: 94vh; display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 20px 20px 0 0; padding: 18px 12px calc(16px + var(--safe-b));
  transform: translateY(40px); transition: transform .22s ease;
}
.modal-backdrop.open .modal { transform: none; }
.modal.tall { height: 94vh; }
.modal.sheet { height: 100%; max-height: none; border-radius: 0; background: var(--bg); padding: calc(10px + var(--safe-t)) 8px 0; }
.modal.dialog {
  align-self: center; width: calc(100% - 40px); max-width: 420px; border-radius: 16px; background: var(--dialog);
  padding: 22px 20px 12px; transform: scale(.96); max-height: 92vh; overflow-y: auto;
}
.modal-backdrop.open .modal.dialog { transform: none; }
.dialog-title { font-size: calc(20px * var(--fs)); font-weight: 500; margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.modal .scroll, .modal .list.scroll { overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px 90px; -webkit-overflow-scrolling: touch; }
.modal .editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 44px; }
.modal-head h2 { font-size: calc(22px * var(--fs)); font-weight: 400; padding-left: 6px; }
.modal-head .actions { display: flex; gap: 2px; }
.confirm-text { font-size: calc(16px * var(--fs)); margin: 0 0 8px; }
.menu { display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 14px; padding: 13px 8px; border-radius: 10px; text-align: left; }
.menu button:active { background: var(--card2); }
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; }
  .modal.tall { height: 86vh; }
}

/* ---------- Set editor ---------- */
.modal.dialog.set-dialog { padding: 22px 16px 10px; }
.se-head { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.se-head h2 { font-size: calc(22px * var(--fs)); font-weight: 400; }
.se-head .sub { font-size: calc(15px * var(--fs)); margin-top: 2px; }
.se-tools { display: flex; margin-left: auto; margin-top: -6px; }
.se-tools .icon-btn { width: 40px; height: 40px; }
.se-tools .icon-btn .ico { width: 24px; height: 24px; }
.se-tools .icon-btn.on { color: var(--accent-hi); }
.se-row { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.se-row label { width: 50px; text-align: right; color: var(--muted); font-size: calc(15px * var(--fs)); flex: none; }
.se-row input {
  flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 2px solid var(--line2); outline: none;
  font-size: calc(22px * var(--fs)); padding: 6px 2px; border-radius: 0;
}
.se-row input:focus { border-bottom-color: var(--accent); }
.se-row .icon-btn { width: 42px; height: 42px; font-size: calc(28px * var(--fs)); font-weight: 300; }
.se-comment { display: flex; align-items: center; gap: 14px; width: 100%; color: var(--muted); padding: 8px 6px 8px 22px; }
.se-comment input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-size: calc(15px * var(--fs)); }
.se-comment input::placeholder { color: var(--muted); }
.lvl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0 4px; }
.lvl-btn { padding: 9px 2px; border-radius: 8px; font-size: calc(13px * var(--fs)); font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.lvl-btn .dot { width: 8px; height: 8px; border-radius: 50%; }
.lvl-btn.active { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.se-tool-panel { background: var(--card2); border-radius: 10px; padding: 10px 12px; margin: 6px 0; font-size: calc(14px * var(--fs)); max-height: 190px; overflow-y: auto; }
.se-tool-panel table { width: 100%; border-collapse: collapse; }
.se-tool-panel td { padding: 3px 0; }
.se-tool-panel td:last-child { text-align: right; }
.se-tool-panel .pill { background: var(--card3); }

/* ---------- Rest timer bar ---------- */
.restbar {
  position: fixed; left: 50%; bottom: calc(10px + var(--safe-b)); z-index: 30;
  width: min(640px, calc(100% - 20px)); transform: translate(-50%, 150%);
  background: var(--card2); border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.6); transition: transform .25s ease, visibility .25s;
  visibility: hidden; pointer-events: none;
}
.restbar.show { transform: translate(-50%, 0); visibility: visible; pointer-events: auto; }
.rest-progress { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--accent) 25%, transparent); transition: width .25s linear; }
.rest-inner { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.rest-label { font-size: calc(12px * var(--fs)); color: var(--muted); text-transform: uppercase; }
.rest-time { font-size: calc(22px * var(--fs)); font-weight: 700; font-variant-numeric: tabular-nums; flex: 1; }
.rest-btn { padding: 7px 10px; border-radius: 9px; background: var(--card3); font-weight: 500; font-size: calc(13px * var(--fs)); }
.rest-btn.skip { background: var(--accent); color: var(--accent-ink); }

/* ---------- Timers ---------- */
.big-time { font-size: calc(64px * var(--fs)); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-align: center; line-height: 1; }
.big-time small { font-size: .45em; color: var(--muted); }
.sw { margin: 40px 0 10px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: 16px 0; }
.preset { padding: 16px 0; border-radius: 14px; background: var(--card); font-size: calc(18px * var(--fs)); font-weight: 700; }
.preset:active { background: var(--accent); color: var(--accent-ink); }
.ring {
  --p: 0; width: min(260px, 70vw); aspect-ratio: 1; margin: 26px auto 0; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--card2) 0); position: relative;
}
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
.ring .big-time { position: relative; font-size: calc(56px * var(--fs)); }
.tabata-box { margin: 14px 0 0; padding: 32px 16px; border-radius: 22px; text-align: center; background: var(--card); transition: background .3s; }
.tabata-box[data-kind="work"] { background: #1f7a33; color: #fff; }
.tabata-box[data-kind="rest"] { background: #1c3f80; color: #fff; }
.tabata-box[data-kind="prep"] { background: #7a6010; color: #fff; }
.tabata-box .big-time { font-size: calc(84px * var(--fs)); margin: 6px 0; }
.tb-phase { font-size: calc(22px * var(--fs)); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tb-round { opacity: .8; }
.steppers { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .steppers { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
.steppers.disabled { opacity: .45; pointer-events: none; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper span { flex: 1; font-size: calc(14px * var(--fs)); color: var(--muted); }
.stepper strong { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { background: var(--card2); }
.laps { margin-top: 10px; }
.lap { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 10px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lap span:not(:first-child) { text-align: right; }
.timer-body label.form { margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); z-index: 100;
  transform: translate(-50%, -200%); padding: 10px 18px; border-radius: 12px;
  background: #eee; color: #111; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.5);
  transition: transform .25s ease; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: calc(12px * var(--fs)); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; }
.measure-grid .row-start { grid-column: 1; }
.measure-grid label { font-size: calc(13px * var(--fs)); color: var(--muted); }
[data-measures] { margin: 4px 0 10px; }
.backup-banner { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; padding: 6px 4px 6px 12px; border-radius: 12px;
  background: var(--card); color: var(--muted); font-size: calc(13px * var(--fs)); }
.backup-banner > .ico { width: 20px; height: 20px; color: var(--accent-hi); flex: none; }
.body-list .sub { white-space: normal; overflow: visible; }

/* ---------- Progress photos (DECISIONS #34) ---------- */
.photo-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.photo-date { font-size: calc(13px * var(--fs)); color: var(--muted); }
.photo-poses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-poses .btn { justify-content: center; padding-left: 6px; padding-right: 6px; }
.photo-timeline { margin-top: 16px; }
.photo-day { margin-bottom: 14px; }
.photo-day-head { font-weight: 600; margin-bottom: 6px; }
.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--card2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb span { position: absolute; left: 6px; bottom: 5px; padding: 1px 7px; border-radius: 99px; background: rgba(0, 0, 0, .6);
  font-size: calc(11px * var(--fs)); color: #fff; }
.photo-full { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.photo-full img { max-width: 100%; max-height: 70vh; border-radius: 12px; }
.compare { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.compare .chips { align-items: center; margin-bottom: 8px; }
.small-seg { margin: 0; flex: none; }
.small-seg button { flex: none; padding: 6px 10px; }
.compare-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.compare-info { text-align: center; color: var(--muted); font-size: calc(13px * var(--fs)); margin: 8px 0; }
.compare-side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.compare-side figure { margin: 0; }
.compare-side img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; background: var(--card2); }
.compare-side figcaption { text-align: center; font-size: calc(12px * var(--fs)); color: var(--muted); margin-top: 4px; }
.compare-slider { position: relative; aspect-ratio: 3 / 4; max-height: 64vh; margin: 0 auto; width: 100%; border-radius: 12px; overflow: hidden; background: var(--card2); }
.compare-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-slider .after { clip-path: inset(0 0 0 var(--pos)); }
.cs-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .6); pointer-events: none; }
.cs-tag { position: absolute; top: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #fff; font-size: calc(11px * var(--fs)); }
.cs-tag.l { left: 8px; }
.cs-tag.r { right: 8px; }
.compare-slider input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: ew-resize; }
.file-icon { cursor: pointer; }

/* ---------- History (DECISIONS #36) ---------- */
.h-list { padding-bottom: 96px; }
.h-month { font-size: calc(13px * var(--fs)); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 4px 8px; }
.h-card { background: var(--card); border-radius: var(--radius); padding: 14px 16px 12px; margin-bottom: 12px; cursor: pointer; }
.h-card:active { background: var(--card2); }
.h-head { display: flex; align-items: flex-start; gap: 8px; }
.h-head h3 { font-size: calc(17px * var(--fs)); font-weight: 600; margin: 0; }
.h-comment { font-size: calc(14px * var(--fs)); color: var(--text2); margin-top: 1px; }
.h-more { margin: -6px -8px 0 0; }
.h-stats { display: flex; gap: 18px; margin: 8px 0 10px; color: var(--text2); font-size: calc(14px * var(--fs)); flex-wrap: wrap; }
.h-stats span { display: inline-flex; align-items: center; gap: 5px; }
.h-stats .ico { width: 17px; height: 17px; color: var(--muted); }
.h-stats .gold, .h-stats .gold .ico { color: var(--gold); }
.h-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; font-size: calc(14px * var(--fs)); line-height: 1.6; color: var(--text2); }
.h-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-th { color: var(--text); font-weight: 600; }
.fab-ext {
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px 0 16px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink); font-size: calc(16px * var(--fs)); font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.fab-ext .ico { width: 26px; height: 26px; }

/* ---------- "Steel & orange" shapes and type (DECISIONS #40) ---------- */
.card, .ex-card, .h-card, .tile, .block-card { border: 1px solid var(--card-edge); }
.modal .card, .modal .tile { border-color: var(--line); }
.topbar-title { font-family: var(--f-num); font-weight: 700; font-size: calc(26px * var(--fs)); text-transform: uppercase; letter-spacing: .04em; }
.modal-head h2, .dialog-title { font-family: var(--f-num); font-weight: 700; letter-spacing: .02em; }
.date-pill { font-family: var(--f-num); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 999px; padding: 4px 18px; }
.date-text { font-family: var(--f-num); font-weight: 700; font-size: calc(24px * var(--fs)); text-transform: uppercase; letter-spacing: .03em; }
.set-col .v { font-family: var(--f-num); font-size: calc(20px * var(--fs)); }
.tile-val, .rest-time, .big-time, .hbar-val, .h-stats, .scale-preview .v, .se-row input, .scale-val { font-family: var(--f-num); }
.tile-val { font-size: calc(24px * var(--fs)); }
.h-stats { font-size: calc(16px * var(--fs)); font-weight: 600; }
.h-head h3 { font-weight: 700; }
.day-summary { color: var(--muted2); }
.fab { border-radius: 50%; box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 1px rgba(44, 90, 168, .35); }
.fab-ext { border-radius: 999px; font-weight: 700; }

/* Bottom tab bar for the four main pages; the drawer keeps the rest */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + var(--safe-b)); background: var(--card); border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; max-width: 120px; display: grid; justify-items: center; gap: 2px; padding: 4px 0;
  color: var(--muted); font-size: calc(11px * var(--fs)); font-weight: 600; letter-spacing: .02em;
}
.tabbar button .ico { width: 24px; height: 24px; }
.tabbar button.active { color: var(--accent-hi); }
body.has-tabbar { --tabbar-h: calc(62px + var(--safe-b)); }
body.has-tabbar .main { padding-bottom: calc(120px + var(--tabbar-h)); }
body.has-tabbar .fab-wrap { bottom: calc(14px + var(--tabbar-h)); }
body.has-tabbar .restbar { bottom: calc(8px + var(--tabbar-h)); }
.storage-status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--card2); font-size: calc(13px * var(--fs)); color: var(--text2); }
.storage-status .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.storage-status.ok .ico { color: #43c463; }
.storage-status.warn { background: rgba(242, 183, 5, .1); color: var(--gold); }

/* ---------- Exercise muscle maps (DECISIONS #42) ---------- */
.thumb.mmap { background: linear-gradient(160deg, var(--card3), var(--card2)); border-left: 0; overflow: hidden; }
.thumb.mmap svg.mm { width: 100%; height: 100%; }
.mm { --mm-body: #8a94a2; --mm-line: #c9d0d8; }
.mm-sil { fill: var(--mm-line); }
.mm-muscles path { stroke: var(--mm-line); stroke-width: .8; stroke-linejoin: round; }
.mm .mn { fill: var(--mm-body); }
.mm .ms { fill: color-mix(in srgb, var(--accent-hi) 50%, var(--mm-body)); }
.mm .mp { fill: var(--accent-hi); }
.mm .mm-line { fill: none; stroke-width: .6; }
.mm-detail .mm-muscles path { stroke-width: .7; }
.mm-detail .mf { stroke: none; pointer-events: none; }
.mm-detail pattern path { stroke: rgba(22, 26, 32, .3); stroke-width: .26; }
.muscle-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; }
.mc-art { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, var(--card3), var(--card2)); }
.mc-art svg { width: 100%; height: 100%; display: block; }
.mc-info { display: grid; gap: 12px; align-content: center; min-width: 0; }
.mc-row { display: grid; gap: 5px; }
.mc-label { font-size: calc(11px * var(--fs)); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mc-val { display: flex; flex-wrap: wrap; gap: 5px; }
.mc-chip { padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 22%, var(--card2)); color: var(--text); font-size: calc(13px * var(--fs)); font-weight: 600; }
.mc-chip.p { background: var(--accent); color: var(--accent-ink); }
.mc-equip { font-family: var(--f-num); font-weight: 700; font-size: calc(20px * var(--fs)); text-transform: uppercase; letter-spacing: .03em; }
.group-row .group-fig { width: 52px; height: 52px; align-self: center; }
.gdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

/* ---------- Own button and control shapes (DECISIONS #44) ---------- */
/* 1. Sets as chips: solid edge = done, dashed = suggested, coloured by the set level */
.sets { gap: 8px; margin-top: 8px; }
.set-col {
  min-width: 62px; padding: 6px 10px 6px; border-radius: 14px; text-align: center;
  border: 1.6px solid var(--c, var(--line2)); background: color-mix(in srgb, var(--c, var(--line2)) 12%, var(--card2));
}
.set-col.planned { border-style: dashed; background: transparent; }
.set-col .dot { display: none; }
.set-col .line { line-height: 1.2; }
.set-col .set-delta, .set-col .set-note { text-align: center; margin: 2px auto 0; }
.set-col.add-chip {
  display: grid; place-items: center; align-content: center; gap: 2px; min-height: 58px; color: var(--accent-hi);
  border: 1.6px dashed color-mix(in srgb, var(--accent-hi) 60%, transparent); background: transparent;
  font-size: calc(12px * var(--fs)); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.set-col.add-chip .ico { width: 20px; height: 20px; }

/* 2. Set editor: big round steppers, one row of level chips, one full-width save button */
.se-fields { display: grid; gap: 10px; margin: 10px 0 12px; }
.se-row { display: grid; gap: 4px; margin: 0; }
.se-row label { width: auto; text-align: center; font-size: calc(12px * var(--fs)); font-weight: 600; letter-spacing: .08em; }
.se-stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 10px; }
.se-stepper input {
  text-align: center; font-size: calc(34px * var(--fs)); font-weight: 700; border: 0; border-radius: 14px;
  background: var(--card2); padding: 6px 4px; min-width: 0; width: 100%;
}
.se-stepper input:focus { outline: 2px solid var(--accent); }
.step-btn {
  width: 56px; height: 56px; border-radius: 50%; background: var(--card3); color: var(--text);
  font-size: calc(30px * var(--fs)); font-weight: 400; line-height: 1; display: grid; place-items: center;
}
.step-btn:active { background: var(--accent); color: var(--accent-ink); }
.lvl-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px -2px 14px; padding: 2px; }
.lvl-row::-webkit-scrollbar { display: none; }
.lvl-btn { flex: none; padding: 8px 12px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent); }
.lvl-btn.active { background: var(--c); color: var(--bg); border-color: var(--c); }
.lvl-btn.active .dot { background: var(--bg) !important; }
.save-set { height: 54px; border-radius: 16px; font-size: calc(17px * var(--fs)); font-weight: 700; gap: 8px; }

/* 3. Wide "Add exercise" bar instead of the round add button */
.fab-wrap.wide { left: 16px; right: 16px; justify-content: stretch; max-width: 648px; margin: 0 auto; }
.add-bar {
  flex: 1; height: 54px; border-radius: 16px; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: calc(17px * var(--fs)); font-weight: 700; box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}
.add-bar .ico { width: 24px; height: 24px; stroke-width: 2.6; }

/* 4. "+" sheet: small action pills and a two-column grid of muscle-group cards */
.quick-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; padding-bottom: 2px; }
.quick-pills::-webkit-scrollbar { display: none; }
.quick-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--line); font-size: calc(14px * var(--fs)); font-weight: 600;
}
.quick-pill .ico { width: 18px; height: 18px; color: var(--accent-hi); }
.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group-card {
  position: relative; display: grid; grid-template-rows: auto auto; border-radius: 18px; overflow: hidden; cursor: pointer;
  background: var(--card); border: 1px solid var(--card-edge);
}
.group-card:active { background: var(--card2); }
.group-card-fig { display: block; aspect-ratio: 4 / 3; background: linear-gradient(160deg, var(--card3), var(--card2)); }
.group-card-fig svg { width: 100%; height: 100%; display: block; }
.group-card-text { display: grid; padding: 8px 12px 10px; }
.group-card .name { font-family: var(--f-num); font-weight: 700; font-size: calc(18px * var(--fs)); text-transform: uppercase; letter-spacing: .03em; }
.group-card .days { color: var(--muted); font-size: calc(12px * var(--fs)); min-height: 1.2em; }
.group-card [data-gmenu] { position: absolute; top: 4px; right: 4px; background: rgba(21, 24, 28, .55); border-radius: 50%; }

/* 5. Sheets close with ✕ in the header; a grip shows they can be pulled down */
.sheet-grip { width: 42px; height: 5px; border-radius: 99px; background: var(--line2); margin: 0 auto 6px; flex: none; }

/* 6. Day navigation in the log's top bar */
.day-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.day-label {
  font-family: var(--f-num); font-weight: 700; font-size: calc(22px * var(--fs)); text-transform: uppercase; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 10px; white-space: nowrap;
}
.day-label.today { color: var(--accent-hi); }

/* 7. Rest timer: a ring that empties */
.rest-ring { position: relative; width: 52px; height: 52px; flex: none; }
.rest-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rest-ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--card3); }
.ring-fg { stroke: var(--accent-hi); stroke-linecap: round; stroke-dasharray: 131.95; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear; }
.rest-ring .rest-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(14px * var(--fs)); flex: none; }
.rest-inner .rest-label { flex: 1; font-size: calc(13px * var(--fs)); letter-spacing: .08em; }
.rest-btn { border-radius: 999px; padding: 8px 12px; }

/* ---------- Calmer, minimal version of the controls above (DECISIONS #44, user feedback 2026-10-02) ---------- */
/* Sets: hairline chips, the level as a thin coloured line at the bottom */
.sets { gap: 6px; }
.set-col {
  min-width: 52px; padding: 5px 8px 4px; border-radius: 10px; background: transparent;
  border: 1px solid var(--line); box-shadow: inset 0 -2px 0 var(--c, transparent);
}
.set-col .v { font-size: calc(17px * var(--fs)); }
.set-col.planned { border-style: dashed; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--c, transparent) 45%, transparent); }
.set-col.add-chip { min-height: 0; align-self: stretch; color: var(--muted); border: 1px dashed var(--line2); font-size: 0; padding: 0 12px; }
.set-col.add-chip .ico { width: 18px; height: 18px; }
.set-col.add-chip span { display: none; }
.log-all { background: none; padding: 4px 0; margin-top: 6px; font-weight: 600; font-size: calc(13px * var(--fs)); }

/* Smaller add button in the corner */
.fab-wrap.wide { left: auto; right: max(16px, calc(50% - 324px)); margin: 0; }
.add-bar { flex: none; height: 44px; padding: 0 18px 0 14px; border-radius: 999px; font-size: calc(15px * var(--fs)); font-weight: 600; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.add-bar .ico { width: 20px; height: 20px; }

/* Day label: smaller and white */
.day-label { font-size: calc(18px * var(--fs)); padding: 4px 6px; }
.day-label.today { color: var(--text); }
.day-nav .icon-btn { color: var(--muted); }

/* Set editor: smaller steppers, text-only levels, a quieter save button */
.se-fields { gap: 6px; margin: 6px 0 8px; }
.se-stepper { grid-template-columns: 44px 1fr 44px; gap: 8px; }
.se-stepper input { font-size: calc(26px * var(--fs)); padding: 4px; background: transparent; border-bottom: 1px solid var(--line2); border-radius: 0; }
.se-stepper input:focus { outline: none; border-bottom-color: var(--accent); }
.step-btn { width: 44px; height: 44px; font-size: calc(22px * var(--fs)); background: transparent; border: 1px solid var(--line2); color: var(--muted); }
.lvl-row { gap: 2px; margin: 6px -2px 10px; }
.lvl-btn { border: 0; padding: 6px 10px; font-size: calc(12px * var(--fs)); }
.lvl-btn.active { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.lvl-btn.active .dot { background: var(--c) !important; }
.save-set { height: 46px; border-radius: 12px; font-size: calc(15px * var(--fs)); font-weight: 600; }

/* "+" sheet: plain text shortcuts, compact three-column group grid */
.quick-pills { gap: 4px; margin-bottom: 10px; }
.quick-pill { background: none; border: 0; padding: 6px 10px 6px 4px; font-weight: 500; color: var(--text2); }
.quick-pill .ico { width: 16px; height: 16px; }
.group-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.group-card { border-radius: 14px; border-color: transparent; }
.group-card-fig { aspect-ratio: 1; background: var(--card2); }
.group-card-text { padding: 6px 8px 8px; }
.group-card .name { font-family: var(--f-ui); font-weight: 600; font-size: calc(14px * var(--fs)); text-transform: none; letter-spacing: 0; }
.group-card .days { font-size: calc(11px * var(--fs)); }
.group-card [data-gmenu] { width: 28px; height: 28px; top: 2px; right: 2px; background: none; color: var(--muted); }
.group-card [data-gmenu] .ico { width: 18px; height: 18px; }

/* Rest timer: smaller ring, text buttons */
.rest-ring { width: 42px; height: 42px; }
.rest-ring .rest-time { font-size: calc(12px * var(--fs)); }
.ring-fg, .ring-bg { stroke-width: 3; }
.rest-btn { background: none; padding: 6px 8px; color: var(--text2); }
.rest-btn.skip { background: none; color: var(--accent-hi); }
.set-col.add-chip { min-width: 40px; width: 40px; min-height: 52px; padding: 0; display: grid; place-items: center; }

/* Muscle groups as a plain list (figures only on exercises; user 2026-10-02) */
.group-list { background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px; overflow: hidden; }
.group-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px 12px 16px; min-height: 52px; cursor: pointer; }
.group-item + .group-item { border-top: 1px solid var(--line); }
.group-item:active { background: var(--card2); }
.group-item .name { flex: 1; font-size: calc(16px * var(--fs)); font-weight: 500; }
.group-item .days { color: var(--muted); font-size: calc(13px * var(--fs)); }
.group-item [data-gmenu] { color: var(--muted); }
/* Log cards without the figure (user 2026-10-02): the exercise name opens the detail page with the muscle map */
.ex-card { padding: 10px 4px 12px 14px; }

/* ---------- Profile: greeting on History, sign-in screens, editor (DECISIONS #45) ---------- */
.hello { padding: 6px 6px 4px; margin-bottom: 6px; }
.hello-greet { color: var(--muted); font-size: calc(13px * var(--fs)); letter-spacing: .08em; text-transform: uppercase; }
.hello-title { font-family: var(--f-num); font-weight: 600; font-size: calc(26px * var(--fs)); line-height: 1.15; margin: 4px 0 8px; }
.hello-title span { color: var(--accent-hi); }
.hello-stats { display: flex; gap: 16px; color: var(--muted); font-size: calc(13px * var(--fs)); }
.hello-stats b { font-family: var(--f-num); font-weight: 600; font-size: calc(17px * var(--fs)); color: var(--text); margin-right: 4px; }
.mix { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.mix-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: calc(12px * var(--fs));
  text-transform: uppercase; letter-spacing: .08em; }
.hello-range { padding: 4px 6px; margin-right: -6px; font-size: calc(12px * var(--fs)); text-transform: none; letter-spacing: 0; color: var(--text2); }
.mix-body { display: flex; align-items: center; gap: 22px; margin-top: 12px; }
.mix-pie { width: 124px; height: 124px; flex: none; }
.mix-pie path { stroke: var(--bg); stroke-width: 1.6; stroke-linejoin: round; }
.mix-legend { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: calc(13px * var(--fs)); color: var(--text2); }
.mix-legend span { display: flex; align-items: center; gap: 8px; }
.mix-legend .gdot { width: 7px; height: 7px; }
.mix-legend b { margin-left: auto; font-weight: 500; color: var(--muted); }
.mix-empty { font-size: calc(13px * var(--fs)); margin-top: 6px; }

.auth { position: fixed; inset: 0; z-index: 45; background: var(--bg); overflow-y: auto; display: flex; justify-content: center;
  padding: calc(48px + var(--safe-t)) 24px calc(24px + var(--safe-b)); }
body.auth-open { overflow: hidden; }
.auth-panel { width: 100%; max-width: 380px; }
.auth-logo { border-radius: 12px; margin-bottom: 22px; }
.auth-title { font-family: var(--f-num); font-weight: 600; font-size: calc(28px * var(--fs)); line-height: 1.15; }
.auth-sub { color: var(--muted); font-size: calc(14px * var(--fs)); margin: 6px 0 22px; }
.auth-error { color: #ff6b6b; font-size: calc(13px * var(--fs)); }
.auth-skip { align-self: center; text-transform: none; letter-spacing: 0; font-size: calc(14px * var(--fs)); }
.profile-sum { display: flex; align-items: center; gap: 12px; margin: 2px 0 16px; }
.profile-sum strong { font-size: calc(16px * var(--fs)); font-weight: 500; }
.profile-sum .muted { font-size: calc(13px * var(--fs)); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--accent-hi);
  color: var(--accent-hi); font-family: var(--f-num); font-weight: 600; font-size: calc(20px * var(--fs)); flex: none; }
.profile-links { display: flex; justify-content: space-between; }
.profile-links .text-btn { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; }
.profile-links .ico { width: 16px; height: 16px; }
.text-btn.danger { color: #ff6b6b; }
.small-note { font-size: calc(12px * var(--fs)); margin-top: 16px; line-height: 1.45; }

/* ---------- What's new (DECISIONS #47) ---------- */
.whatsnew { max-height: 58vh; overflow-y: auto; overscroll-behavior: contain; }
.whatsnew section { padding: 4px 0 12px; }
.whatsnew section + section { border-top: 1px solid var(--line); padding-top: 12px; }
.whatsnew h3 { font-family: var(--f-num); font-weight: 600; font-size: calc(16px * var(--fs)); display: flex; justify-content: space-between; align-items: baseline; }
.whatsnew h3 span { font-family: var(--f-ui); font-weight: 400; font-size: calc(12px * var(--fs)); color: var(--muted); }
.whatsnew ul { margin: 6px 0 0; padding-left: 18px; color: var(--text2); font-size: calc(14px * var(--fs)); line-height: 1.45; }
.whatsnew li + li { margin-top: 4px; }

/* ---------- Records page (DECISIONS #49) ---------- */
.rec-top { padding: 6px 6px 2px; }
.rec-head { color: var(--muted); font-size: calc(12px * var(--fs)); text-transform: uppercase; letter-spacing: .08em; font-weight: 500; margin: 18px 0 6px; }
.rec-latest { display: flex; flex-direction: column; }
.rec-new { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rec-new:last-child { border-bottom: 0; }
.rec-new > .ico { width: 18px; height: 18px; color: var(--gold); flex: none; }
.rec-new strong { font-family: var(--f-num); font-weight: 600; font-size: calc(16px * var(--fs)); white-space: nowrap; }
.rec-search { margin: 16px 0 4px; }
.rec-group { display: flex; align-items: center; gap: 8px; margin: 20px 4px 6px; color: var(--muted); font-size: calc(12px * var(--fs));
  text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.rec-group .gdot { width: 7px; height: 7px; }
.rec-group span { margin-left: auto; }
.rec-list { background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 0 14px; }
.rec-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 0; }
.rec-row + .rec-row { border-top: 1px solid var(--line); }
.rec-row .sub { font-size: calc(12.5px * var(--fs)); }
.rec-rms { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--muted); font-size: calc(12px * var(--fs)); }
.rec-rms b { color: var(--text2); font-weight: 500; }
.rec-val { text-align: right; white-space: nowrap; }
.rec-val b { display: block; font-family: var(--f-num); font-weight: 600; font-size: calc(20px * var(--fs)); color: var(--text); }
.rec-val small { color: var(--muted); font-size: calc(11px * var(--fs)); }

/* ---------- Set variants as tags (DECISIONS #51) ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tag-btn { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); font-size: calc(12px * var(--fs)); font-weight: 500; }
.tag-btn.active { border-color: var(--accent-hi); color: var(--accent-hi); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.set-tags { display: block; margin: 1px auto 0; font-size: calc(10px * var(--fs)); font-weight: 600; color: var(--accent-hi);
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.rec-vars { margin-top: 2px; }
.rec-vars b { color: var(--accent-hi); }

/* ---------- Automatic backup folder, Android app (DECISIONS #52) ---------- */
.auto-backup { margin: 8px 0 4px; }
.auto-backup-head { display: flex; gap: 10px; align-items: flex-start; font-size: calc(14px * var(--fs)); margin-bottom: 8px; }
.auto-backup-head .ico { width: 18px; height: 18px; color: var(--accent-hi); flex: none; margin-top: 2px; }
.auto-backup-head .small { display: block; margin-top: 2px; }
.auto-backup .row { flex-wrap: wrap; align-items: center; }

/* ---------- Home: greeting + three big buttons (DECISIONS #57) ---------- */
.home-hello { padding: 18px 6px 8px; }
.home-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.home-btn { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; min-height: 96px; padding: 18px;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); }
.home-btn:active { background: var(--card2); }
.home-btn > .ico:first-child { width: 30px; height: 30px; color: var(--accent-hi); flex: none; }
.home-btn > .ico:last-child { width: 20px; height: 20px; color: var(--muted); flex: none; }
.home-btn span { flex: 1; min-width: 0; }
.home-btn b { display: block; font-family: var(--f-num); font-weight: 600; font-size: calc(24px * var(--fs)); letter-spacing: .02em; }
.home-btn small { display: block; color: var(--muted); font-size: calc(13px * var(--fs)); margin-top: 2px; }
