:root {
  --bg: #060606;
  --panel: #0e0e0e;
  --panel-2: #131313;
  --line: #1d1d1d;
  --line-2: #262626;
  --text: #f3f3f1;
  --muted: #8b8b86;
  --faint: #55554f;
  --lime: #45ff00;
  --lime-soft: rgba(69, 255, 0, 0.12);
  --lime-glow: rgba(69, 255, 0, 0.35);
  --warn: #ffb547;
  --bad: #ff5f57;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; }

/* ---------- Header / nav ---------- */
header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; background: rgba(6,6,6,.85); backdrop-filter: blur(14px);
}
.logo { font-size: 22px; font-weight: 700; letter-spacing: -0.04em; text-decoration: none; }
.logo span { color: var(--lime); }
.logo svg { display: block; height: 26px; width: auto; aspect-ratio: 212 / 81; }
.tabs {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
}
.tabs a {
  padding: 8px 18px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 500; color: var(--muted); transition: color .15s, background .15s;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--lime); color: #0a0a0a; }
.tabs svg { display: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Phone layout: app-style header + bottom tab bar ---------- */
@media (max-width: 720px) {
  header {
    grid-template-columns: 1fr; padding: calc(env(safe-area-inset-top) + 14px) 18px 12px;
    backdrop-filter: none; background: rgba(6,6,6,.96);
  }
  .header-spacer { display: none; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    padding: 6px 6px calc(env(safe-area-inset-bottom) + 8px);
    border: none; border-top: 1px solid var(--line); border-radius: 0;
    background: rgba(9,9,9,.94); backdrop-filter: blur(18px);
  }
  .tabs a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 0 2px; font-size: 10.5px; color: var(--faint); background: none !important;
  }
  .tabs a.active { color: var(--lime); }
  .tabs svg { display: block; width: 23px; height: 23px; }
  body { padding-bottom: calc(env(safe-area-inset-bottom) + 72px); }
  footer { display: none; }
  .toast { bottom: calc(env(safe-area-inset-bottom) + 86px); }
}

/* ---------- Views ---------- */
.view { display: none; max-width: 1240px; margin: 0 auto; padding: 32px 32px 48px; }
.view.active { display: block; animation: fade .25s ease; }
.view.narrow { max-width: 760px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

h1 { font-size: 34px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.15; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--lime); margin-bottom: 8px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.col { display: flex; flex-direction: column; gap: 16px; }
.label {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.label b { color: var(--text); font-weight: 500; letter-spacing: .02em; text-transform: none; font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--panel-2);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: #3a3a3a; background: #181818; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--lime); color: #0a0a0a; border-color: var(--lime); font-weight: 600; }
.btn.primary:hover { background: #d4ff66; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.on { border-color: rgba(69, 255, 0,.5); color: var(--lime); }
.btn.danger:hover { border-color: rgba(255,95,87,.5); color: var(--bad); }
.actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Today ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 26px 0 18px; }
.day {
  padding: 12px 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  min-width: 0;
}
.day .dn { font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.day .dd { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; margin: 2px 0 10px; }
.day .tag { font-size: 12px; display: flex; gap: 7px; align-items: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .tag i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.day.trainer .tag i { background: var(--lime); box-shadow: 0 0 8px var(--lime-glow); }
.day.trainer .tag { color: var(--text); }
.day.workout .tag i { background: #fff; }
.day.workout .tag { color: var(--text); }
.day.active .tag i { background: #7aa7ff; }
.day.past:not(.today) { opacity: .55; }
.day.today { border-color: var(--lime); background: linear-gradient(180deg, rgba(69, 255, 0,.09), rgba(69, 255, 0,0) 80%), var(--panel); }
.day.today .dn { color: var(--lime); }
.day .check { color: var(--lime); margin-left: auto; font-weight: 600; }
@media (max-width: 720px) {
  .week { gap: 4px; }
  .day { padding: 8px 6px 10px; text-align: center; }
  .day .dd { font-size: 17px; margin-bottom: 6px; }
  .day .tag { justify-content: center; font-size: 0; gap: 0; }
  .day .tag i { width: 8px; height: 8px; }
  .day .check { display: none; }
}

.today-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 920px) { .today-grid { grid-template-columns: 1fr; } }

.plan { padding: 26px 28px; }
.plan h2 { margin-top: 14px; }
.plan .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.items { list-style: none; margin-top: 20px; border-top: 1px solid var(--line); }
.items li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.items .num { color: var(--faint); font-size: 12px; }
.items .nm { font-weight: 500; font-size: 15px; }
.items .dt { font-size: 13px; color: var(--muted); margin-top: 3px; }
.formlink {
  font-size: 12px; color: var(--lime); text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(69, 255, 0,.35); padding: 6px 11px; border-radius: 999px;
  transition: background .15s;
}
.formlink:hover { background: var(--lime-soft); }
.why { margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.why ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.why li { font-size: 13.5px; color: #cfcfca; line-height: 1.5; padding-left: 16px; position: relative; }
.why li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.logged {
  margin-top: 18px; padding: 14px 16px; border-radius: 14px;
  background: var(--lime-soft); border: 1px solid rgba(69, 255, 0,.3); font-size: 14px; line-height: 1.5;
}
.logged b { color: var(--lime); font-weight: 600; }

.recovery { margin-top: 10px; }
.rec-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 104px; gap: 12px; align-items: center; padding: 7px 0; font-size: 13px; }
.rec-row .st { text-align: right; font-size: 12px; color: var(--muted); }
.rec-row .st.ok { color: var(--lime); }
.mini { height: 6px; background: #1a1a1a; border-radius: 999px; overflow: hidden; }
.mini div { height: 100%; border-radius: 999px; background: var(--lime); transition: width .4s ease; }
.mini div.mid { background: var(--warn); }
.mini div.low { background: var(--bad); }

.wk { margin-top: 12px; }
.wk-row { padding: 10px 0; border-top: 1px solid var(--line); }
.wk-row:first-child { border-top: none; }
.wk-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.wk-row .top span:last-child { color: var(--muted); }
.wk-row .top b { color: var(--text); font-weight: 600; }

/* ---------- Log ---------- */
.log-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 26px; align-items: start; }
@media (max-width: 920px) { .log-grid { grid-template-columns: 1fr; } }
.seg { display: flex; padding: 4px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); gap: 4px; }
.seg button { flex: 1; padding: 10px 8px; border-radius: 9px; font-size: 13px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: #1e1e1e; color: var(--text); box-shadow: inset 0 0 0 1px rgba(69, 255, 0,.4); }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field > span, .field-label { font-size: 12px; color: var(--muted); }
.field-label { margin: 22px 0 10px; }
.field-label small { color: var(--faint); font-size: 12px; }
.field-row { display: flex; gap: 10px; margin-top: 16px; }
input, select {
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; outline: none; width: 100%;
  transition: border-color .15s;
}
input::placeholder { color: var(--faint); }
input:focus { border-color: rgba(69, 255, 0,.6); }
input[type=date] { color-scheme: dark; }
input[type=number]::-webkit-inner-spin-button { opacity: .3; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 13px; color: var(--muted); background: var(--panel-2); transition: all .15s;
}
.pill:hover { color: var(--text); border-color: #3a3a3a; }
.pill.on { border-color: var(--lime); color: var(--lime); background: var(--lime-soft); }
.effort { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.effort .pill { border-radius: 10px; text-align: center; padding: 10px 4px; }
.effort .pill small { display: block; font-size: 10px; color: var(--faint); margin-top: 2px; }
.effort .pill.on small { color: rgba(69, 255, 0,.7); }

.exrow { display: grid; grid-template-columns: minmax(0, 1fr) 62px 62px 76px 30px; gap: 6px; margin-bottom: 6px; }
.exrow .x { color: var(--faint); font-size: 18px; border-radius: 8px; }
.exrow .x:hover { color: var(--bad); }
.exhead { display: grid; grid-template-columns: minmax(0, 1fr) 62px 62px 76px 30px; gap: 6px; font-size: 11px; color: var(--faint); margin-bottom: 6px; padding-left: 2px; }
#view-log .act, #view-log .sess { display: none; }
#view-log.t-activity .act { display: block; }
#view-log.t-trainer .sess, #view-log.t-solo .sess { display: block; }
#view-log.t-activity label.sess { display: none; }
#view-log.t-trainer label.sess, #view-log.t-solo label.sess { display: flex; }

.hist-day { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }
.hist-day:first-child { margin-top: 12px; }
.entry {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 6px;
}
.badge { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; }
.badge.trainer { color: #0a0a0a; background: var(--lime); border-color: var(--lime); }
.badge.solo { color: var(--text); border-color: #3a3a3a; }
.entry .t { font-size: 14px; font-weight: 500; }
.entry .d { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .del { color: var(--faint); font-size: 18px; padding: 2px 8px; border-radius: 8px; }
.entry .del:hover { color: var(--bad); }
.empty-note { color: var(--faint); font-size: 13px; margin-top: 14px; line-height: 1.5; }

/* ---------- Settings ---------- */
.welcome, .settings-head { margin-bottom: 22px; }
.welcome p { color: var(--muted); margin-top: 10px; font-size: 15px; line-height: 1.55; }
.welcome { display: none; }
body.onboarding .welcome { display: block; }
body.onboarding .settings-head { display: none; }
/* No tabs until setup is finished — they'd only bounce back here. */
body.onboarding .tabs { display: none; }
@media (max-width: 720px) { body.onboarding { padding-bottom: 24px; } }
.sg { padding: 20px 0; border-top: 1px solid var(--line); }
.sg:first-child { border-top: none; padding-top: 4px; }
.sg h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sg p { font-size: 13px; color: var(--muted); margin: 4px 0 14px; line-height: 1.5; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days .pill { border-radius: 10px; text-align: center; padding: 10px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 50;
  background: #151515; border: 1px solid rgba(69, 255, 0,.4); box-shadow: 0 10px 40px rgba(0,0,0,.6);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); margin-right: 10px; vertical-align: 1px; }

footer { color: var(--faint); font-size: 12px; text-align: center; padding: 8px 32px 32px; }
@media (max-width: 720px) {
  html { scrollbar-width: none; }
  ::-webkit-scrollbar { display: none; }
  footer { display: none; }
  .toast { bottom: calc(env(safe-area-inset-bottom) + 86px); white-space: nowrap; }
}

/* ======================= Form check: setup screen ======================= */
.hidden { display: none !important; }
.form-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 12px; color: var(--muted); letter-spacing: 0.02em;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.loading i { background: var(--warn); animation: pulse 1.2s infinite; }
.status.ready i { background: var(--lime); box-shadow: 0 0 10px var(--lime-glow); }
.status.error i { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.chip { text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); transition: border-color .15s, background .15s; }
.chip:hover { border-color: #383838; }
.chip .t { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.chip .s { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chip.active { border-color: var(--lime); background: var(--lime-soft); }
.chip.active .t { color: var(--lime); }
.tip { margin: 16px 2px 18px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.tip strong { color: var(--text); font-weight: 500; }
.btn.block { width: 100%; justify-content: center; padding: 16px; font-size: 16px; border-radius: 14px; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; }
.err:empty { display: none; }
.form-opts { display: flex; justify-content: space-between; margin-top: 14px; gap: 10px; flex-wrap: wrap; }
.linkbtn { font-size: 13px; color: var(--muted); padding: 4px 2px; }
.linkbtn:hover { color: var(--text); }
.linkbtn.on { color: var(--lime); }
.linkbtn:disabled { opacity: .4; pointer-events: none; }
.form-opts span { display: flex; gap: 14px; }

.sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.sum .v { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; }
.sum .v.lime { color: var(--lime); }
.sum .k { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sum-issues { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.sum-issues li { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.sum-issues li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); margin-right: 10px; }
.sum-issues li span { flex: 1; }
.sum-issues li b { color: var(--muted); font-weight: 500; }
.sum-clean { margin-top: 16px; font-size: 13px; color: var(--lime); }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.set-row:first-child { border-top: none; margin-top: 6px; }
.set-row b { font-weight: 600; }
.set-row .q { color: var(--lime); font-size: 12px; min-width: 64px; text-align: right; }

/* ======================= Form check: live (full-screen) ======================= */
.live { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; color: #fff; }
.live[hidden] { display: none; }
/* Size and position are set in form.js (layoutStage) so video and skeleton always share one box. */
.live video, .live canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: fill; max-width: none; }
.live.mirror video, .live.mirror canvas { transform: scaleX(-1); }
.live::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .6s ease;
}
.live.good::after { box-shadow: inset 0 0 90px 14px rgba(69, 255, 0,.5); transition: none; }
.live.bad::after { box-shadow: inset 0 0 90px 14px rgba(255,95,87,.55); transition: none; }

.live-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  padding: calc(env(safe-area-inset-top) + 16px) 18px 50px;
  background: linear-gradient(rgba(0,0,0,.6), transparent);
}
.live-ex {
  justify-self: start; margin-top: 8px; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.4); backdrop-filter: blur(10px);
}
.live-count { text-align: center; }
.live-count .n { font-size: 92px; font-weight: 700; line-height: .95; letter-spacing: -0.06em; transition: transform .16s ease; }
.live-count .n.bump { transform: scale(1.1); }
.live-count .l { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.live-dot {
  justify-self: end; margin-top: 14px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 14px var(--lime-glow); transition: background .2s, box-shadow .2s;
}
.live-dot.bad { background: var(--bad); box-shadow: 0 0 14px rgba(255,95,87,.6); }
.live-dot.idle { background: #5a5a5a; box-shadow: none; }

.mark {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 132px; height: 132px; margin: -66px 0 0 -66px;
  border-radius: 50%; opacity: 0; pointer-events: none;
}
.mark::before, .mark::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 11px; margin: -5.5px 0 0 -28px;
  border-radius: 6px; background: currentColor;
}
.mark::after { transform: rotate(90deg); }
.mark.good { color: #0a0a0a; background: var(--lime); box-shadow: 0 0 60px rgba(69, 255, 0,.55); animation: pop .8s ease forwards; }
.mark.bad { color: #fff; background: var(--bad); box-shadow: 0 0 60px rgba(255,95,87,.55); animation: pop .8s ease forwards; }
.mark.bad::after { display: none; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.55); }
  14% { opacity: .96; transform: scale(1.06); }
  28% { transform: scale(1); }
  65% { opacity: .96; }
  100% { opacity: 0; transform: scale(1.08); }
}

.live-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 50px 20px calc(env(safe-area-inset-bottom) + 26px);
  background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.live-cue {
  font-size: 19px; font-weight: 600; padding: 10px 20px; border-radius: 999px; text-align: center;
  background: rgba(0,0,0,.5); backdrop-filter: blur(10px); max-width: 92%;
}
.live-cue:empty { visibility: hidden; }
.live-cue.bad { background: rgba(255,95,87,.9); }
.live-cue.warn { color: var(--warn); font-size: 15px; font-weight: 500; }
.live-cue.muted { color: rgba(255,255,255,.75); font-size: 15px; font-weight: 500; }
.stop {
  width: 70px; height: 70px; border-radius: 50%; border: 3px solid rgba(255,255,255,.92);
  display: grid; place-items: center; transition: transform .1s;
}
.stop:active { transform: scale(.94); }
.stop span { width: 24px; height: 24px; border-radius: 6px; background: var(--bad); }
.live-ctrls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; max-width: 360px; }
.flip {
  justify-self: center; width: 46px; height: 46px; border-radius: 50%; color: #fff;
  background: rgba(0,0,0,.45); backdrop-filter: blur(10px); display: grid; place-items: center;
}
.flip svg { width: 22px; height: 22px; }
.flip:active { transform: scale(.94); }
.live.from-file .flip { visibility: hidden; }
.live-hint { font-size: 10px; color: rgba(255,255,255,.6); letter-spacing: .18em; text-transform: uppercase; margin-top: -6px; }

/* ======================= Muscle groups ======================= */
.rec-row { grid-template-columns: 92px minmax(0, 1fr) 70px; padding: 5px 0; }
.rec-area {
  display: flex; justify-content: space-between; margin: 16px 0 4px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.rec-area:first-child { margin-top: 8px; }
.rec-area .ok { color: rgba(69, 255, 0,.7); }

#fMuscles { display: flex; flex-direction: column; gap: 10px; }
.mgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill.area { font-weight: 600; color: var(--text); min-width: 64px; text-align: center; border-style: dashed; }
.pill.area.on { border-style: solid; }

/* ======================= Phone overrides (keep last) ======================= */
@media (max-width: 720px) {
  .rec-row { grid-template-columns: 86px minmax(0, 1fr) 66px; }
  .mgroup { gap: 5px; }
  .mgroup .pill { padding: 7px 11px; font-size: 12.5px; }
  .pill.area { min-width: 0; }
  /* phone.html preview: mimic the iPhone's 34px home-indicator safe area */
  .in-phone .tabs { padding-bottom: 34px; }
  .in-phone body { padding-bottom: 104px; }
  .in-phone .toast { bottom: 118px; }
  .in-phone .live-bottom { padding-bottom: 50px; }
  .view { padding: 20px 16px 28px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .card { padding: 16px; border-radius: 16px; }
  .plan { padding: 20px 18px; }
  .items li { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; }
  .exhead { display: none; }
  .exrow {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 32px; gap: 6px;
    padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
  }
  .exrow .n { grid-column: 1 / -1; }
  .field-row { flex-wrap: wrap; }
  .field-row .field { min-width: 30%; }
  .effort .pill small { font-size: 9px; }
  .seg button { font-size: 12.5px; }
  .days .pill { font-size: 12px; }
}

