/* Platy 4 PT — Swiss International Style, iOS-first.
   Palette: Swiss red, paper white, anthracite, steel. One accent, used hard. */
:root {
  --red: #DA291C;
  --red-dark: #B22217;
  --paper: #FAFAF8;
  --ink: #1C1C1E;
  --steel: #8E8E93;
  --line: #E3E3E0;
  --card: #FFFFFF;
  --ok: #2E7D32;
  --subtle: #F0F0EE;        /* light grey surfaces: seg, icon btns, pressed */
  --field: #FFFFFF;         /* input fields */
  --field-done: #F7F7F5;    /* completed-set inputs */
  --placeholder: #C9C9C6;
  --note-bg: #FFF6E8;       /* exercise note callout */
  --topbar: rgba(250,250,248,0.92);
  --accent: #2F80ED;        /* rest-bar blue */
  --accent-d: #2567c4;
  --btn-solid: #1C1C1E;     /* secondary button bg */
  --btn-solid-fg: #FFFFFF;  /* secondary button text */
  --btn-border: #1C1C1E;    /* ghost button border */
  --inverse: #1C1C1E;       /* dark pill/chip/toast bg (stays dark both themes) */
  --inverse-fg: #FFFFFF;
  --radius: 12px;
  --pad: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  --paper: #121214;
  --ink: #F2F2F3;
  --steel: #9A9AA0;
  --line: #2C2C30;
  --card: #1C1C1F;
  --ok: #4CAF50;
  --subtle: #2A2A2E;
  --field: #232327;
  --field-done: #1A1A1D;
  --placeholder: #5A5A60;
  --note-bg: #2E2616;
  --topbar: rgba(18,18,20,0.92);
  --accent: #4A90E2;
  --accent-d: #3A78C4;
  --btn-solid: #E8E8EA;     /* light button on dark bg */
  --btn-solid-fg: #1C1C1E;  /* dark text */
  --btn-border: #4A4A50;    /* visible ghost border on dark */
  --inverse: #34343A;       /* dark pill/chip/toast stays dark, light text */
  --inverse-fg: #F2F2F3;
  /* red stays the brand red; it reads well on dark too */
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--paper); color: var(--ink);
  font-size: 16px; line-height: 1.45;
  padding-bottom: calc(64px + var(--safe-b));
  overscroll-behavior-y: contain;
}
body.login-mode { padding-bottom: 0; }

h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
h3 { font-size: 15px; font-weight: 600; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--steel);
}
.num { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -1px; }
.muted { color: var(--steel); font-size: 13px; }

/* ---------- layout */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--topbar); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + var(--safe-t)) var(--pad) 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar img.logo { height: 26px; display: block; }
.view { padding: var(--pad); max-width: 680px; margin: 0 auto; }
.section { margin-bottom: 24px; }
.section > .eyebrow { display: block; margin-bottom: 8px; }

/* ---------- cards: signature element = red baseline rule + big numerals */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px var(--pad);
  margin-bottom: 10px; position: relative; overflow: hidden;
}
.card.rule::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--red);
}
.card .big { font-size: 34px; line-height: 1.05; }
.card .unit { font-size: 14px; font-weight: 600; color: var(--steel); margin-left: 2px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid .card { margin-bottom: 0; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px var(--pad);
  margin-bottom: 8px; display: flex; justify-content: space-between;
  align-items: center; gap: 10px; cursor: pointer;
}
.list-item:active { background: var(--subtle); }
.chip {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  background: var(--inverse); color: var(--inverse-fg);
}
.chip.red { background: var(--red); }
.chip.ghost { background: transparent; color: var(--steel); border: 1px solid var(--line); }

/* ---------- buttons & inputs */
button, .btn {
  font: inherit; border: none; cursor: pointer;
  border-radius: var(--radius); font-weight: 700;
}
.btn-primary {
  background: var(--red); color: #fff; width: 100%;
  padding: 15px; font-size: 17px;
}
.btn-primary:active { background: var(--red-dark); }
.btn-secondary {
  background: var(--btn-solid); color: var(--btn-solid-fg); padding: 12px 16px; font-size: 15px;
}
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--btn-border); padding: 11px 16px; font-size: 15px;
}
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn-icon {
  background: var(--subtle); color: var(--ink); width: 38px; height: 38px;
  border-radius: 10px; font-size: 19px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
button:disabled { opacity: 0.45; }

input, select, textarea {
  font: inherit; width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--ink); font-size: 16px; /* 16px stops iOS zoom */
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); }
label { display: block; margin-bottom: 14px; }
label > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--steel); }

/* ---------- exercise card: a trainer's worksheet line */
.ex-card { padding: 0; overflow: hidden; position: relative; }
/* signature: progress spine fills as sets complete */
.ex-card { --done: 0; }
.ex-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(to bottom, var(--red) calc(var(--done) * 100%),
    var(--line) calc(var(--done) * 100%));
  transition: background 0.35s ease;
}
.ex-head { padding: 14px var(--pad) 12px; padding-left: calc(var(--pad) + 4px);
  border-bottom: 1px solid var(--line); }
.ex-head .row { align-items: flex-start; }
.ex-name { font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -0.2px; }
.ex-meta { font-size: 12px; color: var(--steel); margin-top: 4px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ex-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }
.ex-note { font-size: 13px; color: var(--ink); background: var(--note-bg);
  border-left: 3px solid #E8A33D; padding: 8px 10px;
  margin: 10px var(--pad) 0; border-radius: 8px; line-height: 1.4; }

.set-head { display: grid; grid-template-columns: 34px 1fr 1fr 48px;
  gap: 10px; padding: 10px var(--pad) 6px; padding-left: calc(var(--pad) + 4px);
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--steel); }
.set-head span:nth-child(2), .set-head span:nth-child(3) { text-align: center; }
.set-head span:last-child { text-align: center; }

/* 5-column variant: Série / Anterior / kg / Reps / ✓ */
.set-head.set5, .set-row.set5 { grid-template-columns: 30px 1.1fr 1fr 0.8fr 44px; }
.set-head.set5 span { text-align: center; }
.set-head.set5 span:first-child { text-align: left; }
.prev-col { font-size: 13px; color: var(--steel); text-align: center;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.set-row.done .prev-col { color: #C9C9C6; }

.set-row {
  display: grid; grid-template-columns: 34px 1fr 1fr 48px;
  gap: 10px; align-items: center; padding: 6px var(--pad);
  padding-left: calc(var(--pad) + 4px);
}
.set-row .set-n {
  font-weight: 800; color: var(--steel); font-size: 15px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.set-row .field { position: relative; }
.set-row input {
  padding: 12px 8px; text-align: center; font-weight: 700; font-size: 19px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--field);
  font-variant-numeric: tabular-nums; transition: border-color 0.15s, background 0.15s;
}
.set-row input:focus { border-color: var(--red); background: var(--field); }
.set-row input::placeholder { color: var(--placeholder); font-weight: 600; }
.set-row .done-btn {
  width: 100%; height: 44px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--field); color: var(--placeholder);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s, color 0.15s;
}
.set-row .done-btn:active { transform: scale(0.9); }
.set-row.done .done-btn {
  background: var(--ok); border-color: var(--ok); color: #fff;
}
.set-row.done input { color: var(--steel); border-color: transparent; background: var(--field-done); }
.set-row.done .set-n { color: var(--ok); }
@keyframes set-pop { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.set-row.done .done-btn { animation: set-pop 0.25s ease; }

/* inline rest timer slot between set rows */
.rest-slot { padding: 0 var(--pad); padding-left: calc(var(--pad) + 4px); }
.rest-slot.active { padding-top: 6px; padding-bottom: 6px; }
.rest-bar-inline {
  width: 100%; display: flex; align-items: stretch; gap: 6px;
  border-radius: 10px; overflow: hidden;
  background: var(--accent); animation: rest-in 0.2s ease;
}
.rest-bar-inline .rest-skip {
  flex: 1; border: none; background: transparent; color: #fff;
  padding: 13px; font-size: 18px; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: 0.5px; cursor: pointer;
}
.rest-bar-inline .rest-skip:active { background: var(--accent-d); }
.rest-bar-inline .rest-adj {
  border: none; background: rgba(255,255,255,0.18); color: #fff;
  width: 56px; flex: 0 0 auto; font-size: 14px; font-weight: 800; cursor: pointer;
}
.rest-bar-inline .rest-adj:active { background: rgba(255,255,255,0.34); }
@keyframes rest-in { from { opacity: 0; transform: scaleY(0.6); } }

.ex-actions { display: flex; gap: 8px; padding: 4px var(--pad) 14px;
  padding-left: calc(var(--pad) + 4px); }

/* ---------- rest timer */
.rest-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(72px + var(--safe-b)); z-index: 30;
  background: var(--inverse); color: var(--inverse-fg); border-radius: 14px;
  padding: 12px 16px; display: flex; align-items: center;
  justify-content: space-between; box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}
.rest-bar .t { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- bottom tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  background: rgba(255,255,255,0.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar a {
  text-decoration: none; color: var(--steel); text-align: center;
  font-size: 10.5px; font-weight: 600; padding: 4px 0;
}
.tabbar a .ic { display: block; font-size: 21px; line-height: 1.2; }
.tabbar a.active { color: var(--red); }

/* ---------- login */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; padding: 32px 24px; max-width: 420px; margin: 0 auto;
}
.login-wrap .logo-big { width: 240px; margin: 0 auto 14px; display: block; }
.login-tag { text-align: center; margin-bottom: 36px; }
.swiss-rule { width: 46px; height: 4px; background: var(--red); margin: 18px auto; }
.user-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.user-pick button {
  padding: 18px 10px; background: var(--card); border: 1.5px solid var(--line);
  font-size: 17px; font-weight: 700;
}
.user-pick button.sel { border-color: var(--red); color: var(--red); }

/* ---------- charts (see SVG charts block below) */

/* ---------- misc */
.hint-card { display: flex; gap: 12px; align-items: flex-start; }
.hint-day {
  min-width: 46px; text-align: center; background: var(--inverse); color: var(--inverse-fg);
  border-radius: 10px; padding: 6px 4px; font-size: 11px; font-weight: 700;
}
.hint-day.rest { background: var(--steel); }
.hint-day.ride, .hint-day.train { background: var(--red); }
.toast {
  position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  background: var(--inverse); color: var(--inverse-fg); padding: 11px 18px; border-radius: 100px;
  font-size: 14px; font-weight: 600; z-index: 99; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
.empty { text-align: center; color: var(--steel); padding: 36px 16px; }
.spin { text-align: center; padding: 40px; color: var(--steel); }
a { color: var(--red); }
.seg { display: flex; background: var(--subtle); border-radius: 11px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 9px; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 600; color: var(--steel); }
.seg button.sel, .seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- exercise icons (silhouette + equipment badge) */
.ex-vis { display: inline-flex; flex: 0 0 auto; line-height: 0; }
.ex-vis .ex-ic, .ex-vis .ex-img { border-radius: 12px; display: block; flex: 0 0 auto; }
.ex-vis .ex-img { object-fit: cover; background: var(--card); border: 1.5px solid var(--line); }
.ex-head-main { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.ex-head-main > div { min-width: 0; }
.ex-head-main .ex-name { line-height: 1.2; }
.ex-pick { display: flex; align-items: center; gap: 13px; min-width: 0; }
.ex-pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---------- in-app video overlay */
.video-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.video-box {
  background: #000; border-radius: 16px; overflow: hidden;
  width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.video-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; background: var(--inverse); color: var(--inverse-fg);
}
.video-title { font-size: 15px; font-weight: 700; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-close {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.video-close:active { background: rgba(255,255,255,0.28); }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- admin bottom-sheet (user edit / video link) */
.video-overlay .sheet {
  background: var(--paper); width: 100%; max-width: 520px;
  border-radius: 18px; max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--pad); border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.sheet-head .video-title { color: var(--ink); }
.sheet-head .video-close { background: var(--subtle); color: var(--ink); }
.sheet-body { padding: var(--pad); overflow-y: auto; }
.sheet-body label { margin-bottom: 14px; }
.sheet-body .row { display: flex; }
#v_preview:not(:empty) { margin-bottom: 12px; }

/* ---------- SVG charts */
.chart-box { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.chart-box svg { display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.chart-legend .leg { display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--steel); font-weight: 600; }
.chart-legend .leg-swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-empty { text-align: center; color: var(--steel); padding: 30px 0; }

/* ---------- top bar actions (username / admin / logout) */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: none; padding: 4px 6px 4px 4px;
  border-radius: 100px; cursor: pointer; max-width: 52vw;
}
.topbar-user:active { background: var(--subtle); }
.topbar-user .tb-name {
  font-size: 14px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .btn-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  background: var(--subtle); color: var(--ink); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.topbar .btn-icon:active { background: #E3E3E0; }
@media (max-width: 380px) { .topbar-user .tb-name { display: none; } }

/* ---------- avatar upload + cropper */
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar-edit { position: relative; background: none; border: none; padding: 0; cursor: pointer; flex: 0 0 auto; }
.avatar-edit.center { display: block; }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--inverse); color: var(--inverse-fg); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--paper);
}
.avatar-img { object-fit: cover; }
.crop-stage { position: relative; border-radius: 14px; overflow: hidden;
  background: #000; touch-action: none; margin: 0 auto; }
.crop-stage canvas { display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35); border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85); }
#crop-zoom { width: 100%; }

/* ---------- session timer bar */
.timerbar { margin: 0 0 14px; display: flex; align-items: center; gap: 4px; }
.timer-live { display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--ink); }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red);
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.timer-label { margin-left: 10px; font-size: 13px; color: var(--steel);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.timer-kcal { margin-left: auto; font-size: 15px; font-weight: 800;
  color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- grouped exercise picker */
.pick-group { margin-bottom: 6px; }
.pick-ghead {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: var(--subtle); border: none; border-radius: 10px; cursor: pointer;
  padding: 11px 14px; margin: 8px 0 4px; font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px; color: var(--ink);
}
.pick-ghead:active { background: #E3E3E0; }
.pick-count { color: var(--steel); font-weight: 700; letter-spacing: 0; }
.pick-caret { margin-left: 6px; }

/* ---------- per-set type badge (T/W/D/F) + note */
.set-type {
  width: 26px; height: 26px; border-radius: 7px; border: none;
  font-weight: 800; font-size: 13px; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  justify-self: center;
}
.set-type.type-T { background: #1C6E8C; }   /* Training - steel blue */
.set-type.type-W { background: #C46210; }   /* Warm up - amber */
.set-type.type-D { background: #8E44AD; }   /* Drop set - purple */
.set-type.type-F { background: #DA291C; }   /* Failure - red */
.set-note-row { padding: 0 var(--pad) 6px; padding-left: calc(var(--pad) + 4px); }
.set-note {
  width: 100%; border: none; border-bottom: 1px dashed var(--line);
  background: transparent; font-size: 13px; color: var(--steel);
  padding: 2px 0; border-radius: 0;
}
.set-note:focus { border-bottom-color: var(--red); color: var(--ink); outline: none; }

/* ---------- home quick-start shortcuts + nutrition card */
.quick-start { display: flex; gap: 10px; }
.qs-card {
  flex: 1; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; transition: transform 0.06s ease;
}
.qs-card:active { transform: scale(0.98); }
.qs-card.qs-primary { background: var(--red); border-color: var(--red); }
.qs-card.qs-primary .qs-txt strong, .qs-card.qs-primary .qs-ic { color: #fff; }
.qs-card.qs-primary .qs-txt small { color: rgba(255,255,255,0.85); }
.qs-ic { font-size: 22px; font-weight: 800; color: var(--ink); flex: 0 0 auto; }
.qs-txt { display: flex; flex-direction: column; min-width: 0; }
.qs-txt strong { font-size: 15px; color: var(--ink); }
.qs-txt small { font-size: 12px; color: var(--steel); }
.nutri-card { display: flex; gap: 12px; align-items: flex-start; }
.nutri-ic { font-size: 26px; flex: 0 0 auto; }
.nutri-text { margin: 4px 0 0; font-size: 15px; line-height: 1.4; color: var(--ink); }

/* ---------- rest-finished pop-up (3s) */
.rest-done-pop {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%);
  z-index: 200; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 22px 30px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  animation: rest-done-in 0.25s cubic-bezier(0.2,0.9,0.3,1.2);
}
.rest-done-pop.out { animation: rest-done-out 0.25s ease forwards; }
.rest-done-ic {
  width: 56px; height: 56px; display: flex; align-items: center;
  justify-content: center; color: var(--accent);
}
.rest-done-ic svg { display: block; }
.rest-done-txt { font-size: 17px; font-weight: 800; color: var(--ink); }
@keyframes rest-done-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes rest-done-out {
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

/* ---------- rested-time marker (left after a rest timer runs out) */
.rest-slot.rested { padding-top: 4px; padding-bottom: 4px; }
.rest-rested {
  display: flex; align-items: center; gap: 8px;
  color: var(--accent); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; opacity: 0.85;
}
.rest-rested::before, .rest-rested::after {
  content: ""; flex: 1; height: 0;
  border-top: 1px dashed var(--accent); opacity: 0.5;
}

/* ---------- suggested-by-body-part */
.qs-card.qs-wide { width: 100%; }
.bp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bp-chip {
  padding: 16px 12px; border-radius: 12px; font-size: 15px; font-weight: 700;
  background: var(--subtle); color: var(--ink);
  border: 1.5px solid transparent; transition: all 0.12s ease;
}
.bp-chip.on {
  background: var(--red); color: #fff; border-color: var(--red);
}
.bp-chip:active { transform: scale(0.97); }

/* ---------- session locked until "Start session" is hit */
#items.locked .set-type,
#items.locked .done-btn,
#items.locked .ex-actions [data-add-set] { opacity: 0.4; pointer-events: none; }
#items.locked .set-row input,
#items.locked .set-note { opacity: 0.55; }
#items.locked .ex-card { position: relative; }

/* ---------- profile completion banner */
.profile-incomplete { border-left: 4px solid var(--red); }
.profile-incomplete strong { color: var(--ink); }

/* ---------- coaching: feedback card + client list */
.coach-fb-card { border-left: 4px solid var(--accent); }
.coach-fb-card .eyebrow { color: var(--accent); }

/* ---------- Phase 3: auto-regulation + program builder */
.autoreg-card { border-left: 4px solid var(--accent); }
.autoreg-card .eyebrow { color: var(--accent); }
.autoreg-sug { display: flex; gap: 8px; align-items: flex-start;
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--note-bg); font-size: 14px; line-height: 1.35; }
.autoreg-sug .ar-arrow { font-size: 18px; font-weight: 800; line-height: 1; }
.autoreg-sug.up .ar-arrow { color: #1C8E3C; }
.autoreg-sug.down .ar-arrow { color: var(--red); }
.prog-ex { border-top: 1px solid var(--line); padding: 10px 0; }
.prog-grid { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 6px; }
.prog-grid label { display: flex; flex-direction: column; }
.prog-grid label span { font-size: 11px; color: var(--steel); margin-bottom: 2px; }
.prog-grid input { padding: 8px; }
