/* ════════════════════════════════════════════════════════════════
   TOTAL — in-app device mockups (phone + watch)
   Always dark. Accent (--accent) is inherited from the page theme,
   so the in-app accent switches red ↔ blue with the landing toggle.
   Screens are authored once as <template>s and cloned by total.js.
   ════════════════════════════════════════════════════════════════ */

.phone-scaler {
  width: calc(390px * var(--scale, 1));
  height: calc(844px * var(--scale, 1));
  position: relative;
  flex-shrink: 0;
}
.phone {
  width: 390px;
  height: 844px;
  transform: scale(var(--scale, 1));
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
  background: #050506;
  border-radius: 54px;
  padding: 11px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7), inset 0 0 0 2px rgba(255, 255, 255, .06);
}
.phone .island {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 34px;
  background: #000;
  border-radius: 99px;
  z-index: 6;
}
.phone .home-ind {
  position: absolute;
  bottom: 19px;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .45);
  z-index: 6;
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  position: relative;
}

/* ── screen color system (always dark) ── */
.screen {
  --s-bg: #0c0c0e;
  --s-surface: #161619;
  --s-surface-hi: #1f1f24;
  --s-line: rgba(255, 255, 255, .08);
  --s-line-strong: rgba(255, 255, 255, .15);
  --s-text: #f4f2ee;
  --s-dim: rgba(244, 242, 238, .60);
  --s-mute: rgba(244, 242, 238, .38);
  --s-record: #e5484d;
  --s-goal: #43b581;
  --s-last: #e6b53c;
  width: 100%;
  height: 100%;
  background: var(--s-bg);
  color: var(--s-text);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.3;
}
.screen .num { font-family: var(--font-display); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.screen .mono { font-family: var(--font-mono); }
/* template wrapper collapses so .scr-body / .scr-tabbar are direct flex children of .screen */
.screen-inner { display: contents; }

/* status bar (built by JS) */
.scr-status {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 30px 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--s-text);
}
.scr-status .sb-icons { display: flex; align-items: center; gap: 6px; }
.scr-status .sb-icons svg { display: block; }

/* scrollable body + tab bar */
.scr-body { flex: 1; padding: 4px 16px 90px; overflow: hidden; }
.scr-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 76px;
  display: flex;
  padding: 8px 12px 16px;
  gap: 4px;
  background: rgba(12, 12, 14, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--s-line);
}
.scr-tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--s-mute);
}
.scr-tabbar .tab .ti { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--s-mute); }
.scr-tabbar .tab.on { color: var(--accent); }
.scr-tabbar .tab.on .ti { border-color: var(--accent); background: var(--accent); }

/* generic screen header */
.scr-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 14px; }
.scr-head .scr-title { font-family: var(--font-display); font-size: 32px; letter-spacing: 1px; text-transform: uppercase; color: var(--s-text); }
.scr-head .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--s-mute); margin-bottom: 2px; }
.scr-iconbtn { width: 34px; height: 34px; border-radius: 50%; background: var(--s-surface); display: flex; align-items: center; justify-content: center; color: var(--s-dim); font-size: 16px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 20px; }

/* cards */
.card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 18px; padding: 14px; }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-h .lbl { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--s-mute); }

.legend { display: flex; gap: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 600; color: var(--s-mute); text-transform: uppercase; letter-spacing: .5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.rec { background: var(--s-record); }
.dot.goal { background: var(--s-goal); }
.dot.last { background: var(--s-last); }

/* ── SBD hero block (Home) ── */
.sbd { display: flex; gap: 10px; }
.sbd-cols { display: flex; gap: 16px; flex: 1; }
.sbd-col .cn { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--s-dim); margin-bottom: 4px; }
.sbd-col .v { font-family: var(--font-display); font-size: 22px; line-height: 1.04; }
.sbd-col .v.rec { color: var(--s-record); }
.sbd-col .v.goal { color: var(--s-goal); }
.sbd-col .v.last { color: var(--s-last); }
.sbd-total { text-align: right; padding-left: 14px; border-left: 1px solid var(--s-line); }
.sbd-total .tl { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--s-mute); }
.sbd-total .tv { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--accent); }
.sbd-total .tw { font-family: var(--font-mono); font-size: 11px; color: var(--s-dim); margin-top: 2px; }

.subline { display: flex; align-items: center; justify-content: space-between; margin: 12px 2px 0; font-size: 12px; }
.subline .l { color: var(--s-dim); font-weight: 600; }
.subline .r { color: var(--accent); font-weight: 700; }

/* exercise rows */
.ex { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--s-line); }
.ex:first-of-type { border-top: 0; }
.ex .tag { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 13px; flex-shrink: 0; background: var(--s-surface-hi); color: var(--s-dim); }
.ex .tag.s { color: var(--s-record); } .ex .tag.b { color: var(--s-goal); } .ex .tag.d { color: var(--s-last); }
.ex .en { flex: 1; min-width: 0; }
.ex .en .n { font-size: 13px; font-weight: 600; color: var(--s-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex .en .s { font-size: 11px; color: var(--s-mute); font-family: var(--font-mono); }
.ex .setdots { display: flex; gap: 3px; }
.ex .setdots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--s-line-strong); }
.ex .setdots i.done { background: var(--s-goal); border-color: var(--s-goal); }

.btn-go {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; height: 46px; border-radius: 13px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-size: 19px; letter-spacing: 1px;
}

/* progress bar */
.pbar { height: 7px; border-radius: 99px; background: var(--s-surface-hi); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* program preview */
.prog-prev { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.prog-prev .pn { font-size: 13px; font-weight: 700; color: var(--s-text); }
.prog-prev .ps { font-size: 11px; color: var(--s-mute); }

/* ── Profile ── */
.athlete { display: flex; align-items: center; gap: 12px; }
.athlete .avatar { width: 56px; height: 56px; font-size: 26px; }
.athlete .nm { font-family: var(--font-display); font-size: 26px; letter-spacing: .5px; }
.athlete .cat { font-size: 11px; color: var(--s-dim); }
.badge-rank { margin-left: auto; padding: 5px 10px; border-radius: 99px; background: var(--accent); color: #fff; font-family: var(--font-display); font-size: 14px; letter-spacing: .5px; align-self: flex-start; }
.stat3 { display: flex; margin-top: 14px; }
.stat3 > div { flex: 1; text-align: center; }
.stat3 > div + div { border-left: 1px solid var(--s-line); }
.stat3 .k { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--s-mute); }
.stat3 .v { font-family: var(--font-mono); font-size: 16px; color: var(--s-text); margin-top: 3px; font-weight: 600; }

.lift-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--s-line); }
.lift-row:first-of-type { border-top: 0; }
.lift-row .ln { width: 54px; font-family: var(--font-display); font-size: 18px; color: var(--s-dim); letter-spacing: .5px; }
.lift-row .lv { font-family: var(--font-display); font-size: 30px; color: var(--s-record); width: 64px; }
.lift-row .lp { flex: 1; }
.lift-row .lp .lpb { height: 6px; border-radius: 99px; background: var(--s-surface-hi); overflow: hidden; }
.lift-row .lp .lpb > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lift-row .lp .lpt { font-family: var(--font-mono); font-size: 10px; color: var(--s-mute); margin-top: 4px; display: flex; justify-content: space-between; }
.lift-total { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--s-line-strong); }
.lift-total .lt { font-family: var(--font-display); font-size: 16px; color: var(--s-dim); letter-spacing: 1px; }
.lift-total .ltv { font-family: var(--font-display); font-size: 24px; color: var(--accent); }

.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-top: 1px solid var(--s-line); font-size: 13px; }
.setting-row:first-of-type { border-top: 0; }
.setting-row .sk { color: var(--s-text); }
.setting-row .sv { color: var(--s-mute); font-family: var(--font-mono); font-size: 11px; }

/* ── Active workout ── */
.aw-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; }
.aw-timer { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--s-text); }
.stepper { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.stepper i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--s-line-strong); }
.stepper i.done { background: var(--s-goal); border-color: var(--s-goal); }
.stepper i.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); position: relative; }
.stepper i.cur::after { content: ""; position: absolute; inset: 1px; border-radius: 50%; background: var(--accent); }
.aw-name { font-family: var(--font-display); font-size: 38px; letter-spacing: 1px; text-transform: uppercase; text-align: center; }
.aw-sub { text-align: center; font-size: 11px; color: var(--s-mute); margin-top: 2px; }
.aw-ctx { display: flex; margin: 14px 0; }
.aw-ctx > div { flex: 1; text-align: center; }
.aw-ctx > div + div { border-left: 1px solid var(--s-line); }
.aw-ctx .k { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--s-mute); }
.aw-ctx .v { font-family: var(--font-display); font-size: 19px; color: var(--s-dim); margin-top: 2px; }
.aw-inputs { display: flex; gap: 10px; }
.aw-field { flex: 1; background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 14px; padding: 12px; text-align: center; }
.aw-field.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.aw-field .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--s-mute); }
.aw-field .big { font-family: var(--font-display); font-size: 56px; line-height: 1; color: var(--s-text); }
.aw-field .cur { display: inline-block; width: 3px; height: 44px; background: var(--accent); vertical-align: middle; margin-left: 3px; animation: blink 1s steps(1) infinite; }
.aw-field .unit { font-family: var(--font-mono); font-size: 11px; color: var(--s-mute); }
.chips { display: flex; gap: 6px; margin-top: 12px; }
.chips .chip { flex: 1; text-align: center; padding: 8px 0; border-radius: 10px; border: 1px solid var(--s-line); font-family: var(--font-mono); font-size: 12px; color: var(--s-dim); }
.chips .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.aw-actions { display: flex; gap: 10px; margin-top: 12px; }
.aw-actions .skip { width: 110px; height: 46px; border-radius: 13px; border: 1px solid var(--s-line-strong); display: flex; align-items: center; justify-content: center; color: var(--s-dim); font-weight: 600; font-size: 13px; }
.aw-actions .log { flex: 1; height: 46px; border-radius: 13px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-size: 19px; letter-spacing: 1px; }
.rest { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--s-line-strong); border-radius: 14px; }
.rest .rl { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--s-mute); }
.rest .rv { font-family: var(--font-display); font-size: 26px; color: var(--s-goal); }

/* ── Progress ── */
.seg { display: flex; gap: 4px; background: var(--s-surface); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg span { flex: 1; text-align: center; padding: 7px 0; border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--s-mute); }
.seg span.on { background: var(--s-surface-hi); color: var(--s-text); }
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi .k { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 14px; padding: 12px; }
.kpi .k .kl { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--s-mute); }
.kpi .k .kv { font-family: var(--font-display); font-size: 30px; color: var(--s-text); margin-top: 4px; }
.kpi .k .kd { font-family: var(--font-mono); font-size: 11px; color: var(--s-goal); }
.kpi .k .kd.down { color: var(--s-record); }
.chart { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 14px; padding: 14px; margin-top: 12px; }
.chart .ch-h { font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--s-mute); margin-bottom: 8px; }
.chart svg { width: 100%; height: 92px; display: block; }
.chart .xax { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--s-mute); margin-top: 6px; }
.pr-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--s-line); }
.pr-row .pn { flex: 1; font-size: 12px; font-weight: 600; }
.pr-row .pv { font-family: var(--font-display); font-size: 20px; color: var(--s-record); }
.pr-row .pd { font-family: var(--font-mono); font-size: 10px; color: var(--s-goal); width: 40px; text-align: right; }
.pr-row .pdt { font-family: var(--font-mono); font-size: 9px; color: var(--s-mute); width: 48px; text-align: right; }

/* ── Programs ── */
.seg-add { display: flex; align-items: center; gap: 8px; }
.card.active-prog { border-color: var(--accent); }
.week-strip { display: flex; gap: 5px; margin-top: 12px; }
.week-strip .wd { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; background: var(--s-surface-hi); font-size: 10px; color: var(--s-mute); }
.week-strip .wd.has { color: var(--s-text); }
.week-strip .wd.today { background: var(--accent); color: #fff; }
.week-strip .wd b { display: block; font-family: var(--font-display); font-size: 14px; }
.prog-list .card { display: flex; align-items: center; justify-content: space-between; }
.prog-list .card .pn { font-family: var(--font-display); font-size: 18px; letter-spacing: .5px; }
.prog-list .card .ps { font-size: 11px; color: var(--s-mute); }
.prog-list .card .chev { color: var(--s-mute); font-size: 18px; }

/* ── Calendar ── */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head .cm { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; }
.cal-head .cnav { display: flex; gap: 8px; color: var(--s-dim); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 9px; color: var(--s-mute); text-align: center; text-transform: uppercase; margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .cd { aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; color: var(--s-dim); background: transparent; position: relative; }
.cal-grid .cd.mut { color: var(--s-mute); opacity: .4; }
.cal-grid .cd.has { background: var(--s-surface); color: var(--s-text); }
.cal-grid .cd.today { background: var(--accent); color: #fff; }
.cal-grid .cd .cdt { position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; }
.cal-grid .cd .cdt.s { background: var(--s-record); } .cal-grid .cd .cdt.b { background: var(--s-goal); } .cal-grid .cd .cdt.d { background: var(--s-last); }
.cal-up { margin-top: 14px; }
.cal-up .card { display: flex; align-items: center; gap: 12px; }
.cal-up .when { text-align: center; flex-shrink: 0; }
.cal-up .when .d { font-family: var(--font-display); font-size: 22px; color: var(--accent); }
.cal-up .when .m { font-size: 9px; text-transform: uppercase; color: var(--s-mute); }
.cal-up .what .n { font-size: 13px; font-weight: 600; }
.cal-up .what .s { font-size: 11px; color: var(--s-mute); font-family: var(--font-mono); }

/* ════════════════════════════════════════════════════════════════
   WATCH
   ════════════════════════════════════════════════════════════════ */
.watch-scaler {
  width: calc(198px * var(--scale, 1));
  height: calc(238px * var(--scale, 1));
  position: relative;
  flex-shrink: 0;
}
.watch-dev {
  width: 198px;
  height: 238px;
  transform: scale(var(--scale, 1));
  transform-origin: top left;
  position: absolute;
  top: 0; left: 0;
  background: linear-gradient(160deg, #2a2a2e, #0d0d0f);
  border-radius: 56px;
  padding: 22px 20px;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .7);
}
.watch-dev .crown { position: absolute; right: -3px; top: 84px; width: 6px; height: 34px; border-radius: 4px; background: #3a3a3e; }
.watch-screen {
  --s-record: #e5484d; --s-goal: #43b581; --s-last: #e6b53c;
  width: 100%; height: 100%;
  background: #000;
  border-radius: 38px;
  overflow: hidden;
  color: #f4f2ee;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  font-family: var(--font-body);
}
.watch-screen .wtime { text-align: center; font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.7); margin-bottom: 6px; }
.watch-screen .weyebrow { font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.watch-screen .wbig { font-family: var(--font-display); line-height: .92; }
.watch-screen .wcta { margin-top: auto; height: 34px; border-radius: 11px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-display); font-size: 15px; letter-spacing: .8px; }
.watch-sbd { display: flex; gap: 8px; margin: 6px 0; }
.watch-sbd > div { flex: 1; }
.watch-sbd .k { font-size: 8px; color: rgba(255,255,255,.5); text-transform: uppercase; }
.watch-sbd .v { font-family: var(--font-display); font-size: 19px; }
.watch-sbd .v.rec { color: var(--s-record); } .watch-sbd .v.goal { color: var(--s-goal); } .watch-sbd .v.last { color: var(--s-last); }
.watch-dots { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.watch-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.25); }
.watch-dots i.on { background: var(--accent); }
.watch-ring { position: relative; width: 120px; height: 120px; margin: 4px auto; }
.watch-ring svg { transform: rotate(-90deg); }
.watch-ring .rc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.watch-ring .rc .rl { font-size: 8px; text-transform: uppercase; color: rgba(255,255,255,.5); }
.watch-ring .rc .rv { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.watch-ring .rc .rn { font-size: 9px; color: var(--s-goal); font-family: var(--font-mono); }
.watch-aw { text-align: center; display: flex; flex-direction: column; height: 100%; }
.watch-aw .wlift { font-family: var(--font-display); font-size: 13px; color: var(--accent); letter-spacing: 1px; }
.watch-aw .wweight { font-family: var(--font-display); font-size: 70px; line-height: .9; }
.watch-aw .wreps { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.6); }
.watch-aw .wchips { display: flex; gap: 5px; justify-content: center; margin: 6px 0; }
.watch-aw .wchips span { padding: 3px 7px; border-radius: 7px; border: 1px solid rgba(255,255,255,.15); font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,.7); }
