/* ToneTablet — iOS-style grayscale design system.
   Light + dark from tokens; everything below the tokens uses only the tokens. */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-2: #f2f2f7;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.76);
  --label-3: rgba(60, 60, 67, 0.6);
  --sep: rgba(60, 60, 67, 0.22);
  --fill: rgba(120, 120, 128, 0.2);
  --fill-2: rgba(120, 120, 128, 0.12);
  --accent: #000000;
  --on-accent: #ffffff;
  --danger: #ff3b30;
  --blur: rgba(249, 249, 249, 0.82);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  --backdrop: rgba(0, 0, 0, 0.4);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tab-h: 49px;
  --side-w: 240px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.5);
  --sep: rgba(84, 84, 88, 0.65);
  --fill: rgba(120, 120, 128, 0.36);
  --fill-2: rgba(120, 120, 128, 0.24);
  --accent: #ffffff;
  --on-accent: #000000;
  --danger: #ff453a;
  --blur: rgba(22, 22, 24, 0.82);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  --backdrop: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.5);
    --sep: rgba(84, 84, 88, 0.65);
    --fill: rgba(120, 120, 128, 0.36);
    --fill-2: rgba(120, 120, 128, 0.24);
    --accent: #ffffff;
    --on-accent: #000000;
    --danger: #ff453a;
    --blur: rgba(22, 22, 24, 0.82);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    --backdrop: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font: 17px/1.3 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; letter-spacing: inherit; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
input, textarea { -webkit-appearance: none; appearance: none; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--label-2); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--label); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.main { overflow-x: clip; min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--sab) + 28px); }
.page { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.view-enter { animation: viewIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.view-back { animation: viewBack 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes viewIn { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes viewBack { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .view-enter, .view-back { animation: none; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + var(--sab)); padding-bottom: var(--sab);
  display: flex; background: var(--blur); border-top: 0.5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
}
.tabbar .brand { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--label-2); font-size: 10px; font-weight: 500; min-width: 0; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--label); }
.tab span { letter-spacing: 0; }

/* ---------- nav bar + large title ---------- */
.navbar {
  position: sticky; top: 0; z-index: 30; margin: 0 -16px;
  padding: var(--sat) 8px 0; min-height: calc(44px + var(--sat));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: transparent; transition: background 0.2s;
}
.navbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0.5px; background: var(--sep); opacity: 0; transition: opacity 0.2s; }
.navbar.scrolled { background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); }
.navbar.scrolled::after { opacity: 1; }
.nav-title { font-weight: 600; font-size: 17px; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity 0.15s; text-align: center; }
.navbar.scrolled .nav-title, .navbar.always-title .nav-title { opacity: 1; }
.nav-left, .nav-right { display: flex; align-items: center; min-width: 0; }
.nav-right { justify-content: flex-end; gap: 4px; }
.nav-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px; font-size: 17px; color: var(--label); font-weight: 400; }
.nav-btn.bold { font-weight: 600; }
.nav-btn:active { opacity: 0.4; }
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn.back { padding-left: 2px; }
.nav-btn.back svg { width: 22px; height: 22px; }
.large-title { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; padding: 2px 0 12px; }
.subtitle { color: var(--label-2); font-size: 15px; margin: -6px 0 14px; }

/* ---------- grouped lists ---------- */
.section { margin: 0 0 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 16px 6px; font-size: 13px; text-transform: uppercase; color: var(--label-2); letter-spacing: 0; }
.section-head .link { text-transform: none; font-size: 15px; color: var(--label); font-weight: 600; }
.section-foot { padding: 6px 16px 0; font-size: 13px; color: var(--label-2); letter-spacing: 0; }
.group { background: var(--card); border-radius: 12px; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 16px; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--fill-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title.wrap { white-space: normal; }
.row .sub { font-size: 13px; color: var(--label-2); margin-top: 1px; letter-spacing: 0; }
.row .val { color: var(--label-2); font-size: 17px; white-space: nowrap; }
.row .chev, .ex-row .chev { width: 8px; height: 14px; color: var(--label-3); flex: none; }
.row.danger .title { color: var(--danger); }
.row.center { justify-content: center; }
.row.center .title { font-weight: 500; }
.row .lead { width: 30px; height: 30px; border-radius: 7px; background: var(--fill); display: grid; place-items: center; flex: none; }
.row .lead svg { width: 18px; height: 18px; }
.row > svg { width: 22px; height: 22px; flex: none; color: var(--label-2); }
.row > span > svg { width: 20px; height: 20px; flex: none; }
.row input.plain, .row textarea.plain { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 8px 0; font-size: 17px; }
.row input.plain.right { text-align: right; }
.row input.plain::placeholder, .row textarea.plain::placeholder { color: var(--label-3); }
textarea.plain { resize: none; display: block; width: 100%; line-height: 1.35; padding: 10px 0; overflow: hidden; }
.toggle { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); flex: none; transition: background 0.2s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.toggle.on { background: var(--accent); }
:root[data-theme="dark"] .toggle.on::after { background: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toggle.on::after { background: #000; } }
.toggle.on::after { transform: translateX(20px); }

/* ---------- controls ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 13px; font-size: 17px; font-weight: 600; background: var(--fill-2); text-align: center; transition: opacity 0.15s, transform 0.1s; }
.btn:active { opacity: 0.6; transform: scale(0.99); }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.gray { background: var(--fill-2); }
.btn.danger { color: var(--danger); }
.btn.small { height: 36px; border-radius: 10px; font-size: 15px; width: auto; padding: 0 16px; }
.btn.inline { width: auto; padding: 0 20px; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 16px; font-size: 15px; font-weight: 600; background: var(--accent); color: var(--on-accent); }
.pill-btn.gray { background: var(--fill); color: var(--label); }
.pill-btn:active { opacity: 0.6; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:active { background: var(--fill-2); }
.icon-btn svg { width: 22px; height: 22px; }
.stack > * + * { margin-top: 10px; }

.seg { display: flex; background: var(--fill-2); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { flex: 1; height: 28px; border-radius: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; padding: 0 8px; letter-spacing: 0; }
.seg button.on { background: var(--card); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04); }
:root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }

.search { position: relative; }
.search input { width: 100%; height: 36px; border: 0; border-radius: 10px; background: var(--fill-2); padding: 0 32px 0 34px; font-size: 17px; outline: 0; }
.search input::placeholder { color: var(--label-2); }
.search svg.mag { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; color: var(--label-2); }
.search .clr { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; display: grid; place-items: center; color: var(--label-2); }
.search .clr svg { width: 16px; height: 16px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--fill-2); font-size: 15px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--on-accent); }

.field-input { width: 100%; height: 44px; border: 0; border-radius: 10px; background: var(--card); padding: 0 14px; font-size: 17px; outline: 0; }
.input-fill { width: 100%; height: 44px; border: 0; border-radius: 10px; background: var(--fill-2); padding: 0 14px; font-size: 17px; outline: 0; }

.empty { text-align: center; color: var(--label-2); padding: 40px 24px; }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--label-3); }
.empty h3 { font-size: 20px; color: var(--label); margin-bottom: 6px; font-weight: 600; }
.empty p { font-size: 15px; margin-bottom: 16px; }
.empty .btn svg { width: 20px; height: 20px; margin: 0; color: inherit; }

.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 22px; font-weight: 600; flex: none; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--label-2); letter-spacing: 0.02em; text-transform: uppercase; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .n small { font-size: 15px; font-weight: 500; color: var(--label-2); margin-left: 3px; }
.stat .l { font-size: 13px; color: var(--label-2); margin-top: 3px; letter-spacing: 0; }
.card { background: var(--card); border-radius: 12px; padding: 16px; }

/* ---------- sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: var(--backdrop); opacity: 0; transition: opacity 0.25s; }
.sheet-backdrop.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: calc(100dvh - var(--sat) - 12px);
  display: flex; flex-direction: column; background: var(--bg); border-radius: 14px 14px 0 0;
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1); box-shadow: var(--shadow);
}
.sheet.in { transform: none; }
.sheet.dragging { transition: none; }
.sheet-grab { height: 22px; display: grid; place-items: center; flex: none; touch-action: none; cursor: grab; }
.sheet-grab::after { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); }
.sheet-head { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; padding: 0 8px; flex: none; touch-action: none; }
.sheet-head .t { font-weight: 600; font-size: 17px; text-align: center; }
.sheet-head .l { justify-self: start; } .sheet-head .r { justify-self: end; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(20px + var(--sab)); flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 16px calc(12px + var(--sab)); border-top: 0.5px solid var(--sep); background: var(--blur); flex: none; }
.sheet.tall { height: calc(100dvh - var(--sat) - 12px); }

.action-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; padding: 8px 8px calc(8px + var(--sab)); transform: translateY(110%); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.25, 1); max-width: 520px; margin: 0 auto; }
.action-sheet.in { transform: none; }
.action-group { background: var(--card); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
:root[data-theme="dark"] .action-group { background: #2c2c2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .action-group { background: #2c2c2e; } }
.action-group .msg { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--label-2); letter-spacing: 0; }
.action-btn { display: block; width: 100%; height: 56px; font-size: 20px; text-align: center; position: relative; }
.action-btn + .action-btn::before, .action-group .msg + .action-btn::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 0.5px; background: var(--sep); }
.action-btn:active { background: var(--fill-2); }
.action-btn.danger { color: var(--danger); }
.action-btn.bold { font-weight: 600; }
.action-btn[disabled] { opacity: 0.35; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--sab) + 70px); transform: translate(-50%, 20px); z-index: 120; background: rgba(40, 40, 42, 0.95); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 15px; opacity: 0; transition: opacity 0.25s, transform 0.25s; max-width: 90vw; text-align: center; pointer-events: none; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

.banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--fill-2); font-size: 14px; color: var(--label-2); }
.banner svg { width: 16px; height: 16px; flex: none; }

/* ---------- workout logger ---------- */
.ex-card { background: var(--card); border-radius: 12px; padding: 12px 12px 10px; margin-bottom: 12px; position: relative; }
.ex-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.ex-head .name { flex: 1; min-width: 0; text-align: left; font-size: 17px; font-weight: 700; padding: 6px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-head .drag { width: 34px; height: 36px; display: grid; place-items: center; color: var(--label-3); cursor: grab; touch-action: none; flex: none; }
.ex-head .drag svg { width: 18px; height: 18px; }
.ex-head .more { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.ex-head .more:active { background: var(--fill-2); }
.ex-head .more svg { width: 22px; height: 22px; }
.ex-note { width: 100%; border: 0; background: none; outline: 0; font-size: 15px; padding: 2px 4px 8px; color: var(--label-2); resize: none; display: block; line-height: 1.35; }
.sets { --cols: 30px 1fr 84px 72px 40px; }
.sets.kind-r { --cols: 30px 1fr 96px 40px; }
.sets.kind-t { --cols: 30px 1fr 110px 40px; }
.sets.kind-dt { --cols: 30px 1fr 84px 84px 40px; }
.sets.editing.kind-wr { --cols: 30px 1fr 84px 72px 40px; }
.set-head, .set-row { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: center; }
.set-head { font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; text-align: center; padding: 2px 0 4px; letter-spacing: 0.02em; }
.set-row { position: relative; padding: 3px 0; border-radius: 10px; transition: background 0.2s; touch-action: pan-y; }
.set-row.done { background: var(--fill-2); }
.set-row .n { text-align: center; font-weight: 600; color: var(--label-2); font-size: 15px; }
.set-row .prev { text-align: center; color: var(--label-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
.cell { width: 100%; min-width: 0; height: 36px; border: 0; border-radius: 8px; background: var(--fill-2); text-align: center; font-size: 17px; font-weight: 600; outline: 0; padding: 0 4px; }
.cell::placeholder { color: var(--label-3); font-weight: 500; }
.cell:focus { background: var(--fill); }
.set-row.done .cell { background: transparent; }
.chk { width: 36px; height: 36px; border-radius: 8px; background: var(--fill-2); display: grid; place-items: center; justify-self: center; color: transparent; transition: background 0.15s, transform 0.15s; }
.chk svg { width: 18px; height: 18px; }
.chk:active { transform: scale(0.9); }
.set-row.done .chk { background: var(--accent); color: var(--on-accent); }
.set-del { visibility: hidden; position: absolute; right: 0; top: 0; bottom: 0; width: 84px; background: var(--danger); color: #fff; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 15px; z-index: 0; }
.set-swipe { position: relative; z-index: 1; background: var(--card); border-radius: 10px; }
.set-swipe .set-row.done { background: var(--fill-2); }
.set-wrap { position: relative; border-radius: 10px; overflow: hidden; }
.set-x { display: none; }
@media (hover: hover) and (pointer: fine) {
  .set-x { display: grid; position: absolute; right: -2px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; place-items: center; color: var(--label-3); opacity: 0; border-radius: 50%; }
  .set-wrap:hover .set-x { opacity: 1; }
  .set-x:hover { color: var(--danger); }
  .set-x svg { width: 14px; height: 14px; }
  .set-row { padding-right: 0; }
}
.add-set { width: 100%; height: 34px; margin-top: 6px; border-radius: 9px; background: var(--fill-2); font-size: 15px; font-weight: 600; }
.add-set:active { opacity: 0.6; }
.ex-foot { display: flex; gap: 8px; align-items: center; }
.ex-foot .add-set { flex: 1; }
.rest-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--label-2); padding: 0 4px; }

.log-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.log-top .nm { flex: 1; min-width: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; border: 0; background: none; outline: 0; padding: 0; width: 100%; }
.log-meta { display: flex; gap: 16px; color: var(--label-2); font-size: 15px; margin: -6px 0 14px; letter-spacing: 0; }
.log-meta b { color: var(--label); font-weight: 600; }
.log-actions { position: sticky; z-index: 25; }

/* exercise browse rows */
.ex-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; min-height: 52px; text-align: left; position: relative; }
.ex-row + .ex-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.ex-row:active { background: var(--fill-2); }
.ex-row .grow { flex: 1; min-width: 0; }
.ex-row .nm { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-row .meta { font-size: 13px; color: var(--label-2); letter-spacing: 0; }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--label-3); display: grid; place-items: center; flex: none; color: transparent; }
.tick svg { width: 14px; height: 14px; }
.ex-row.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ex-row .plus { width: 28px; height: 28px; border-radius: 50%; background: var(--fill-2); display: grid; place-items: center; flex: none; }
.ex-row .plus svg { width: 16px; height: 16px; }
.alpha-head { position: sticky; top: 0; padding: 4px 16px; font-size: 13px; font-weight: 600; color: var(--label-2); background: var(--fill-2); backdrop-filter: blur(10px); z-index: 2; }
.ex-row[draggable="true"] { cursor: grab; }

/* drag & drop + reorder */
.sorting { position: relative; z-index: 60 !important; box-shadow: var(--shadow); transition: none !important; opacity: 0.98; }
.sort-ph { border-radius: 12px; background: var(--fill-2); margin-bottom: 12px; }
.drop-line { height: 3px; border-radius: 2px; background: var(--accent); margin: -8px 0 5px; }
.dropzone-empty { border: 1.5px dashed var(--label-3); border-radius: 12px; padding: 28px 16px; text-align: center; color: var(--label-2); font-size: 15px; margin-bottom: 12px; }
.dropzone-empty.over { border-color: var(--label); color: var(--label); background: var(--fill-2); }

/* library side panel (wide desktop only) */
.work-grid { display: block; }
.side-panel { display: none; }
.stepper { display: inline-flex; align-items: center; background: var(--fill-2); border-radius: 9px; height: 34px; }
.stepper button { width: 30px; height: 34px; display: grid; place-items: center; font-size: 20px; font-weight: 500; }
.stepper button:active { opacity: 0.4; }
.stepper .v { min-width: 34px; padding: 0 3px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- rest timer ---------- */
.rest-pill { position: fixed; z-index: 45; left: 50%; bottom: calc(var(--tab-h) + var(--sab) + 12px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 16px; border-radius: 23px; background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; animation: pillIn 0.3s cubic-bezier(0.2, 0.9, 0.25, 1); }
.rest-pill .rp-ring { width: 22px; height: 22px; }
.rest-pill .rp-x { width: 32px; height: 32px; border-radius: 50%; background: rgba(128, 128, 128, 0.35); display: grid; place-items: center; }
.rest-pill .rp-x svg { width: 14px; height: 14px; }
.rest-pill .rp-t { min-width: 40px; }
@keyframes pillIn { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.rest-pill.done { animation: pillPulse 0.6s ease-in-out 3; }
@keyframes pillPulse { 50% { transform: translateX(-50%) scale(1.08); } }
.ring-wrap { position: relative; width: 240px; height: 240px; margin: 8px auto 20px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { stroke: var(--fill); }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.25s linear; }
.ring-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 60px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring-sub { position: absolute; left: 0; right: 0; bottom: 60px; text-align: center; font-size: 13px; color: var(--label-2); }
.timer-btns { display: flex; gap: 10px; margin-bottom: 14px; }
.timer-btns .btn { height: 46px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.presets .chip { height: 40px; border-radius: 10px; text-align: center; }

/* ---------- calendar ---------- */
.cal { background: var(--card); border-radius: 12px; padding: 8px 8px 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px; }
.cal-head .m { font-size: 17px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
.cal-dow { font-size: 11px; font-weight: 600; color: var(--label-2); padding: 4px 0; }
.cal-day { height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 17px; position: relative; }
.cal-day .d { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.cal-day.today .d { font-weight: 700; background: var(--fill); }
.cal-day.sel .d { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-day.out { color: var(--label-3); }
.cal-day .dot { position: absolute; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--label); }
.cal-day.sel .dot { background: var(--label); }
.cal-day.out .dot { background: var(--label-3); }
.cal-day.has .d { font-weight: 600; }

/* ---------- charts ---------- */
.chart { position: relative; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--sep); stroke-width: 0.5; }
.chart .axis { fill: var(--label-2); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--label); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--label); opacity: 0.06; }
.chart .pt { fill: var(--card); stroke: var(--label); stroke-width: 2; }
.chart .cursor { stroke: var(--label-3); stroke-width: 1; }
.chart .bar { fill: var(--label); }
.chart .bar.dim { fill: var(--fill); }
.chart-tip { position: absolute; top: 0; pointer-events: none; background: var(--card); color: var(--label); border-radius: 10px; padding: 6px 10px; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; letter-spacing: 0; }
.chart-tip b { font-size: 15px; display: block; }
.chart-tip span { color: var(--label-2); }
.chart-empty { height: 160px; display: grid; place-items: center; color: var(--label-2); font-size: 15px; text-align: center; padding: 0 20px; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--sat)) 20px calc(24px + var(--sab)); }
.auth-card { width: 100%; max-width: 380px; }
.auth-logo { display: block; width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 20px; }
.auth h1 { font-size: 34px; font-weight: 700; text-align: center; letter-spacing: -0.02em; }
.auth .tag { text-align: center; color: var(--label-2); margin: 4px 0 26px; font-size: 17px; }
.auth .group { margin-bottom: 12px; }
.auth .err { color: var(--danger); font-size: 14px; padding: 4px 4px 10px; text-align: center; }
.auth .ok { font-size: 14px; padding: 4px 4px 10px; text-align: center; color: var(--label-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--label-2); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 0.5px; background: var(--sep); }
.linkbtn { color: var(--label); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--label-3); }
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash img { width: 96px; height: 96px; border-radius: 22px; animation: fadeIn 0.4s; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--fill); border-top-color: var(--label); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* PR celebration */
.pr-hero { text-align: center; padding: 8px 0 18px; }
.pr-hero .big { margin-bottom: 10px; }
.pr-hero .big svg { width: 54px; height: 54px; margin: 0 auto; }
.pr-hero h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.pr-item { display: flex; align-items: center; gap: 10px; }
.pr-item svg { width: 22px; height: 22px; flex: none; }

/* ---------- wide screens ---------- */
@media (min-width: 900px) {
  .main { margin-left: var(--side-w); padding-bottom: 60px; }
  .tabbar { top: 0; right: auto; bottom: 0; width: var(--side-w); height: auto; flex-direction: column; justify-content: flex-start; align-items: stretch; padding: calc(20px + var(--sat)) 12px 20px; border-top: 0; border-right: 0.5px solid var(--sep); }
  .tabbar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
  .tabbar .brand img { height: 40px; width: auto; }
  :root[data-theme="dark"] .tabbar .brand img { filter: invert(1); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar .brand img { filter: invert(1); } }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 17px; font-weight: 500; margin-bottom: 2px; }
  .tab svg { width: 24px; height: 24px; }
  .tab:hover { background: var(--fill-2); }
  .tab.on { background: var(--fill); font-weight: 600; }
  .navbar { margin: 0 -16px; }
  .rest-pill { left: calc(50% + var(--side-w) / 2); bottom: 24px; }
  .toast { left: calc(50% + var(--side-w) / 2); bottom: 90px; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 540px; max-height: 86dvh; border-radius: 14px; transform: translate(-50%, -46%); opacity: 0; transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.2s; }
  .sheet.in { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.tall { height: 86dvh; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 6px; }
  .action-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 340px; padding: 0; transform: translate(-50%, -46%); opacity: 0; transition: transform 0.25s, opacity 0.2s; }
  .action-sheet.in { transform: translate(-50%, -50%); opacity: 1; }
  .action-btn { height: 48px; font-size: 17px; }
  .action-btn:hover { background: var(--fill-2); }
  .ex-row:hover, .row.tap:hover { background: var(--fill-2); }
}
@media (min-width: 1240px) {
  .page.wide { max-width: 1040px; }
  .work-grid { display: grid; grid-template-columns: minmax(0, 640px) 360px; gap: 28px; justify-content: center; align-items: start; }
  .side-panel { display: block; position: sticky; top: calc(56px + var(--sat)); max-height: calc(100dvh - 72px - var(--sat)); display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; }
  .side-panel .sp-head { padding: 14px 16px 10px; flex: none; }
  .side-panel .sp-head h3 { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
  .side-panel .sp-head p { font-size: 13px; color: var(--label-2); margin-bottom: 10px; }
  .side-panel .sp-list { overflow-y: auto; flex: 1; border-top: 0.5px solid var(--sep); }
  .picker-btn-mobile { display: none !important; }
}
@media (max-width: 899px) {
  .desk-only { display: none !important; }
}
@media (min-width: 900px) {
  .mobile-only { display: none !important; }
}

/* ---------- small additions ---------- */
.side-panel .picker-top { background: var(--card) !important; }
.resume-bar { position: fixed; z-index: 39; left: 8px; right: 8px; bottom: calc(var(--tab-h) + var(--sab) + 8px); height: 48px; border-radius: 14px; background: var(--blur); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); display: flex; align-items: center; gap: 10px; padding: 0 14px; text-align: left; border: 0.5px solid var(--sep); max-width: 620px; margin: 0 auto; }
.resume-bar .dotlive { width: 8px; height: 8px; border-radius: 50%; background: var(--label); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.resume-bar .t { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-bar .e { color: var(--label-2); font-variant-numeric: tabular-nums; }
.resume-bar svg { width: 16px; height: 16px; color: var(--label-2); }
@media (min-width: 900px) { .resume-bar { left: calc(var(--side-w) + 16px); right: 16px; bottom: 16px; max-width: 420px; margin: 0; } }
.routine-card { display: flex; align-items: center; gap: 12px; }
.ex-card.rt .rt-controls { display: flex; gap: 8px 10px; padding: 6px 4px 4px; flex-wrap: wrap; }
.rt-controls .ctl, .sg-item .ctl { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--label-2); }

.set-wrap.swiping .set-del { visibility: visible; }

/* ---------- suggest a workout ---------- */
.row.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.row[disabled], .row.off { opacity: 0.45; pointer-events: none; }
.callout { background: var(--card); border-radius: 12px; padding: 16px; font-size: 15px; line-height: 1.45; }
.callout p + p { margin-top: 10px; }
.callout .hd { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; margin-bottom: 10px; }
.callout .hd svg { width: 26px; height: 26px; flex: none; }
.fine { font-size: 12.5px; color: var(--label-2); line-height: 1.4; margin: 10px 4px 0; }
.q-bar { height: 4px; border-radius: 2px; background: var(--fill); margin: 4px 0 14px; overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.25s; }
.q-count { font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: 0; margin-bottom: 6px; }
.q-text { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 6px; }
.q-hint { font-size: 14px; color: var(--label-2); margin-bottom: 14px; }
.q-opt .num { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.q-opt.sel .num { background: var(--accent); color: var(--on-accent); }
.sg-item { background: var(--card); border-radius: 12px; padding: 12px 12px 10px; margin-bottom: 10px; }
.sg-item .top { display: flex; align-items: center; gap: 6px; }
.sg-item .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; text-align: left; padding: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-item .controls { display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 4px 4px 2px; }
.sg-item .note { font-size: 13px; color: var(--label-2); padding: 6px 4px 2px; }
.sg-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--label-2); font-size: 14px; margin: -2px 0 12px; }
.sg-meta b { color: var(--label); font-weight: 600; }
.badge.new { background: var(--accent); color: var(--on-accent); margin-left: 6px; }
.area-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.area-chips .chip { height: 38px; padding: 0 16px; font-size: 16px; }

/* ---------- picker filter chips: two rows, scroll sideways; wrap fully where there is room ---------- */
.picker { container-type: inline-size; }
.picker .chips { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: max-content; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 16px; margin: 0 -16px; scrollbar-width: none; cursor: grab; }
.picker .chips.dragging { cursor: grabbing; }
.picker .chips.dragging .chip { pointer-events: none; }
.picker .chips.more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); }
.picker .chip { cursor: pointer; }
@container (min-width: 440px) {
  .picker .chips { display: flex; flex-wrap: wrap; overflow: visible; padding-left: 16px; padding-right: 16px; cursor: default; }
  .picker .chips.more { -webkit-mask-image: none; mask-image: none; }
}

/* ---------- photos ---------- */
.avatar.edit { position: relative; overflow: visible; cursor: pointer; }
.avatar.edit img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .cam { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--label); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.avatar .cam svg { width: 13px; height: 13px; }
.callout.priv .hd { font-size: 17px; margin-bottom: 6px; }
.callout.priv .hd svg { width: 20px; height: 20px; }
.callout .linkbtn { font-size: 15px; }
.ph-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ph { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--fill); padding: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .tag { position: absolute; left: 6px; top: 6px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.ph .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 7px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); color: #fff; font-size: 11px; font-weight: 500; text-align: left; letter-spacing: 0; }
.then-now { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; text-align: left; padding: 12px; position: relative; }
.then-now .tn { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.then-now .tn img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 9px; background: var(--fill); }
.then-now .tn span { font-size: 12px; color: var(--label-2); letter-spacing: 0; }
.then-now .tn-days { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--label-2); }
.ph-preview { background: #000; border-radius: 12px; overflow: hidden; margin: 2px 0 16px; text-align: center; }
.ph-preview img { max-width: 100%; max-height: min(52vh, 460px); object-fit: contain; display: inline-block; vertical-align: top; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-col img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--fill); display: block; }
.cmp-cap { display: flex; flex-direction: column; margin-top: 8px; font-size: 13px; }
.cmp-cap span { color: var(--label-2); }
a.row { text-decoration: none; }

/* ---------- complete exercise + guided workout ---------- */
.ex-complete { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 40px; margin-top: 8px; border-radius: 10px; background: var(--fill-2); font-size: 15px; font-weight: 600; }
.ex-complete svg { width: 16px; height: 16px; }
.ex-complete:active { opacity: 0.6; }
.ex-card.complete .ex-complete { display: none; }
.ex-card.complete .ex-head .name { color: var(--label-2); }
.ex-card.complete .ex-head .name::before { content: "\2713"; margin-right: 8px; }
.ex-card.is-next { box-shadow: inset 0 0 0 2px var(--accent); }
.guide-btn[hidden] { display: none; }

.guide { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; padding-top: var(--sat); }
.g-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 8px; max-width: 560px; width: 100%; margin: 0 auto; }
.g-clock { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-prog { height: 3px; background: var(--fill-2); }
.g-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.g-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.g-foot { padding: 10px 16px calc(14px + var(--sab)); max-width: 560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.g-big { height: 56px; font-size: 18px; }
.g-center { text-align: center; margin-bottom: 18px; }
.g-eyebrow { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.04em; }
.g-h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 6px 0 4px; overflow-wrap: anywhere; }
.g-set { font-size: 20px; font-weight: 600; margin-top: 2px; }
.g-hint, .g-muted { color: var(--label-2); font-size: 15px; margin-top: 6px; }
.g-note { background: var(--card); border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--label-2); margin-bottom: 16px; white-space: pre-wrap; }
.g-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.g-lab { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; margin-bottom: 6px; }
.g-box { display: flex; align-items: center; gap: 10px; }
.g-in { flex: 1; min-width: 0; height: 72px; border: 0; border-radius: 16px; background: var(--card); text-align: center; font-size: 40px; font-weight: 600; outline: 0; font-variant-numeric: tabular-nums; }
.g-in:focus { background: var(--fill-2); }
.g-step { width: 64px; height: 72px; border-radius: 16px; background: var(--fill-2); display: grid; place-items: center; flex: none; }
.g-step svg { width: 24px; height: 24px; }
.g-step:active { opacity: 0.6; }
.g-ring { margin-top: 4px; }
.g-up { text-align: center; }
.g-up-name { font-size: 22px; font-weight: 700; margin-top: 4px; }
.g-next { text-align: center; color: var(--label-2); font-size: 14px; }
.g-check { width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: 12px auto 8px; }
.g-check svg { width: 38px; height: 38px; }
@media (max-height: 640px) { .g-in, .g-step { height: 58px; } .g-in { font-size: 32px; } .ring-wrap.g-ring { width: 180px; height: 180px; } .g-ring .ring-time { font-size: 46px; } }

/* ---------- workout clock + Begin / Pause / Resume / Stop ---------- */
.wk-wrap { margin: 18px 0 12px; }
.wk-wrap[hidden] { display: none; }
.wk-time { text-align: center; font-size: 56px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.wk-time.paused { color: var(--label-2); }
.wk-btn { height: 56px; font-size: 18px; }
.wk-split { gap: 10px; }

/* ---------- cardio session card ---------- */
.sess { padding: 2px 0 2px; }
.sess-target { font-size: 13px; color: var(--label-2); padding: 0 4px 8px; }
.sess-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sess-lab { font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; text-align: center; letter-spacing: 0.02em; margin-bottom: 4px; }
.sess .cell { height: 44px; font-size: 19px; }
.sess-log { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 44px; margin-top: 10px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 600; }
.sess-log.done { background: var(--fill-2); color: var(--label); }
.sess-log svg { width: 16px; height: 16px; }
.sess-log:active { opacity: 0.6; }
.sess-hint { font-size: 12px; color: var(--label-2); text-align: center; padding: 8px 4px 2px; }
.g-fields.tri .g-in { height: 60px; font-size: 32px; }
.g-fields.tri { gap: 10px; }

/* cardio session card: just a button (and a summary once logged); the numbers go in a popup */
.sess-btn { height: 46px; font-size: 16px; margin-top: 4px; }
.sess-done { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; font-size: 16px; font-weight: 600; }
.sess-done svg { width: 18px; height: 18px; flex: none; }
.sess-in { width: 130px; min-width: 0; height: 40px; border: 0; border-radius: 10px; background: var(--fill-2); text-align: right; padding: 0 12px; font-size: 19px; font-weight: 600; outline: 0; }
.sess-in:focus { background: var(--fill); }
.sess-in::placeholder { color: var(--label-3); font-weight: 500; }
.log-meta span[hidden] { display: none; }
.log-meta { flex-wrap: wrap; row-gap: 2px; }

/* toast with an Undo button */
.toast.act { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.toast-act { height: 30px; padding: 0 14px; border-radius: 15px; background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 600; font-size: 14px; }
/* small dot on the Me tab when changes are not yet saved to the cloud */
.tab { position: relative; }
.tab.attn::after { content: ""; position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger, #ff453a); box-shadow: 0 0 0 2px var(--bg); }
@media (min-width: 900px) { .tab.attn::after { top: 17px; left: 32px; } }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: #30d158; flex: none; }
.sync-dot.warn { background: #ff9f0a; }
.sync-dot.bad { background: #ff453a; }

/* ---------- accessibility ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* bigger touch areas on phones without changing how things look */
.chk, .ex-head .more, .ex-head .drag, .pill-btn, .stepper button, .add-set, .set-row .n, .nav-btn { position: relative; }
.chk::before, .ex-head .more::before, .ex-head .drag::before, .pill-btn::before, .stepper button::before, .add-set::before, .set-row .n::before, .nav-btn::before { content: ""; position: absolute; inset: -6px; }
.set-x::before { content: ""; position: absolute; inset: -8px; }
@media (pointer: coarse) { .cell { height: 44px; } .sess .cell { height: 48px; } }
.set-row .n { min-width: 30px; height: 36px; display: grid; place-items: center; }
.set-row .n.warm { color: var(--label); font-weight: 700; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible, summary:focus-visible { outline: 2px solid var(--label); outline-offset: 2px; }

/* ---------- consistency ---------- */
.btn.outline { background: transparent; box-shadow: inset 0 0 0 2px var(--label); color: var(--label); }
.g-cue { margin-top: 12px; background: var(--card); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.g-cue summary { cursor: pointer; font-weight: 600; }
.g-cue p { margin: 8px 0 2px; color: var(--label-2); line-height: 1.4; }

/* ---------- weekly goal ---------- */
.goal-card { background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 22px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal-title { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.04em; }
.goal-num { font-size: 17px; font-weight: 700; }
.goal-dots { display: flex; gap: 8px; margin: 10px 0 8px; }
.goal-dot { flex: 1; height: 8px; border-radius: 4px; background: var(--fill); max-width: 56px; }
.goal-dot.on { background: var(--accent); }
.goal-sub { font-size: 14px; color: var(--label-2); }

/* sign-in screen: what the app gives you */
.auth-points { list-style: none; padding: 0; margin: 4px auto 18px; max-width: 320px; text-align: left; font-size: 14px; color: var(--label-2); }
.auth-points li { position: relative; padding: 3px 0 3px 22px; }
.auth-points li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--label); }
