/* ============================================================
 *  Gym Log — tema oscuro, mobile first
 * ============================================================ */
:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --surface-3: #252a33;
  --border: #2a3039;
  --text: #eef0f3;
  --muted: #8a93a3;
  --faint: #566070;
  --accent: #4f8cff;
  --success: #22c55e;
  --success-ink: #03200d;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-border: rgba(34, 197, 94, 0.4);
  --warn: #f5a524;
  --danger: #f05252;
  --radius: 18px;
  --tap: 56px;
  --tabbar: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body { min-height: 100dvh; overscroll-behavior-y: none; }

button {
  font: inherit; color: inherit; background: none; border: 0;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Cabecera ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 10px) 16px 12px;
  background: rgba(10, 11, 13, 0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 640px; margin: 0 auto; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand b { color: var(--accent); }

.segmented { display: flex; padding: 3px; background: var(--surface); border-radius: 12px; }
.segmented button {
  min-height: 40px; padding: 0 11px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.segmented button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }

.day-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px auto 0; max-width: 640px; }
body:not([data-view="session"]) .day-tabs { display: none; }
.day-tab {
  position: relative; height: 56px; border-radius: 14px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 17px; font-weight: 700;
}
.day-tab small { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.day-tab.is-today small { color: var(--accent); }
.day-tab[aria-selected="true"] { background: var(--accent); color: #fff; }
.day-tab[aria-selected="true"] small { color: rgba(255, 255, 255, 0.85); }
.day-tab .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* ---------- Layout ---------- */
main {
  max-width: 640px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar) + 32px + var(--safe-b));
  transition: padding-bottom 0.25s;
}
body.timer-open main { padding-bottom: calc(var(--tabbar) + 200px + var(--safe-b)); }

.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 10px; }
.day-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.day-stats { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; }
.day-stats strong { font-size: 16px; }

.rest-banner {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 12px;
  background: rgba(79, 140, 255, 0.12); color: var(--accent); font-size: 14px; font-weight: 600;
}

.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-bottom: 16px; }
.progress i { display: block; height: 100%; background: var(--success); transform: scaleX(0); transform-origin: left; transition: transform 0.3s; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}

/* ---------- Ejercicio ---------- */
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ex-head h2 { font-size: 17px; font-weight: 700; line-height: 1.25; }
.meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.badge {
  flex-shrink: 0; min-width: 44px; padding: 4px 8px; border-radius: 999px; text-align: center;
  font-size: 13px; font-weight: 700; background: var(--surface-3); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ex.complete { border-color: var(--success-border); }
.ex.complete .badge { background: var(--success); color: var(--success-ink); }

.last {
  display: block; width: 100%; text-align: left; padding: 0;
  font-size: 13px; color: var(--muted); margin: 10px 0 4px; line-height: 1.6; font-variant-numeric: tabular-nums;
}
.last-more { margin-left: 8px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.last-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px;
  background: var(--surface-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.last .sep { margin: 0 5px; color: var(--faint); }
.last-note { font-size: 13px; color: var(--muted); font-style: italic; margin: 2px 0 4px; }

.sets { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.set-row { display: grid; grid-template-columns: 28px 1fr var(--tap); gap: 8px; align-items: center; }
.set-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font-size: 13px; font-weight: 700;
}
.fields { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; }
.field {
  position: relative; display: block; height: var(--tap);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.field:focus-within { border-color: var(--accent); }
.field span {
  position: absolute; top: 6px; left: 10px; right: 6px; pointer-events: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.field input {
  position: absolute; inset: 0; width: 100%; padding: 17px 10px 0;
  background: transparent; border: 0; outline: 0;
  font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.field input::placeholder { color: var(--faint); font-weight: 600; }

.check {
  width: var(--tap); height: var(--tap); border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-3); border: 2px solid var(--border); color: var(--faint);
  transition: background 0.15s, transform 0.1s;
}
.check:active { transform: scale(0.92); }
.check svg { width: 28px; height: 28px; }
.set-row.done .check { background: var(--success); border-color: var(--success); color: var(--success-ink); }
.set-row.done .field { background: var(--success-bg); border-color: var(--success-border); }
.set-row.done .set-num { background: var(--success); color: var(--success-ink); }

.ex-actions { display: flex; gap: 8px; margin-top: 12px; }
.chip {
  flex: 1; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.chip:active { background: var(--surface-3); }
.chip.active { color: var(--accent); border-color: var(--accent); }

.note {
  display: block; width: 100%; margin-top: 10px; padding: 12px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  font-size: 16px; outline: 0;
}
.note:focus { border-color: var(--accent); }
.note[hidden] { display: none; }
.section-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Botones ---------- */
.btn { display: block; width: 100%; border-radius: 16px; font-weight: 700; }
.btn:active { transform: scale(0.98); }
.btn-finish { height: 64px; margin-top: 8px; font-size: 18px; background: var(--success); color: var(--success-ink); }
.btn-ghost { height: 48px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.btn-secondary { height: 50px; background: var(--surface-3); font-size: 15px; }
.btn-danger { height: 46px; margin-top: 12px; background: rgba(240, 82, 82, 0.12); color: var(--danger); font-size: 14px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 10px; }

/* ---------- Historial ---------- */
.empty { color: var(--muted); text-align: center; padding: 40px 20px; }
.session summary { list-style: none; cursor: pointer; }
.session summary::-webkit-details-marker { display: none; }
.session-title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.session-title .muted { font-size: 13px; }
.session-stats { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.session-stats span { padding: 3px 9px; border-radius: 8px; background: var(--surface-3); font-size: 13px; font-weight: 600; }
.session[open] summary { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.session-body { padding-top: 6px; }
.session-ex { padding: 8px 0; }
.session-ex h3 { font-size: 15px; font-weight: 700; }
.session-ex ol { margin: 4px 0 0; padding-left: 22px; font-size: 14px; font-variant-numeric: tabular-nums; }
.session-note { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; white-space: pre-wrap; }

.settings h2 { font-size: 17px; margin-bottom: 6px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--border); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { flex-shrink: 0; position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--surface-3); transition: background 0.2s; }
.toggle i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.toggle input:checked + i { background: var(--success); }
.toggle input:checked + i::after { transform: translateX(20px); }

/* ---------- Temporizador flotante ---------- */
.timer {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(var(--tabbar) + 10px + var(--safe-b));
  max-width: 616px; margin: 0 auto; padding: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  transform: translateY(calc(100% + var(--tabbar) + var(--safe-b) + 40px)); visibility: hidden;
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), visibility 0s 0.28s;
}
.timer.open { transform: none; visibility: visible; transition: transform 0.28s cubic-bezier(.2, .8, .2, 1); }
.timer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timer-info { display: flex; flex-direction: column; min-width: 0; }
.timer-label { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-time { font-size: 46px; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.timer-close { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); font-size: 18px; color: var(--muted); }
.timer-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 10px 0 12px; }
.timer-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform 0.2s linear; }
.timer-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.timer-actions button { height: 52px; border-radius: 12px; background: var(--surface-3); font-weight: 700; font-size: 15px; }
.timer-actions button:active { background: var(--accent); }
.timer.finished { border-color: var(--success); animation: flash 0.6s ease-in-out 3; }
.timer.finished .timer-time, .timer.finished .timer-label { color: var(--success); }
@keyframes flash { 50% { background: rgba(34, 197, 94, 0.28); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; top: calc(var(--safe-t) + 14px);
  transform: translate(-50%, -150%); opacity: 0;
  padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg);
  font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s, opacity 0.25s; pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Etiquetas RIR / progresión ---------- */
.ex-head-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.info-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border);
  font: italic 700 17px/1 Georgia, serif; color: var(--accent); background: var(--surface-2);
}
.info-btn:active { background: var(--surface-3); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 8px;
  background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 700;
}
.tag-warn { background: rgba(245, 165, 36, 0.14); color: var(--warn); }
.tag-up { background: var(--success-bg); color: var(--success); }
.tag-info { background: rgba(79, 140, 255, 0.14); color: var(--accent); }

.meso-pill {
  margin-top: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: rgba(79, 140, 255, 0.14); color: var(--accent);
}
.meso-pill.deload { background: rgba(245, 165, 36, 0.14); color: var(--warn); }

/* ---------- Pestaña Guía ---------- */
.card-title { font-size: 17px; font-weight: 700; }
.week-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 10px; }
.week-picker button { height: 48px; border-radius: 12px; background: var(--surface-3); font-weight: 800; font-size: 17px; }
.week-picker button.deload { color: var(--warn); }
.week-picker button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.week-name { font-weight: 700; margin-bottom: 2px; }
.rir-table { width: 100%; border-collapse: collapse; margin: 12px 0 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rir-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 4px; }
.rir-table td { padding: 8px 4px; border-top: 1px solid var(--border); }
.rir-table tr.current td { color: var(--accent); font-weight: 700; }
.rule summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.rule summary::-webkit-details-marker { display: none; }
.rule summary::after { content: "›"; font-size: 22px; color: var(--muted); transition: transform 0.2s; }
.rule[open] summary::after { transform: rotate(90deg); }
.rule ul, .sheet ul { margin: 10px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.rule li, .sheet li { margin-bottom: 8px; }
.guide-day { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 16px 0 6px; }
.guide-list { display: flex; flex-direction: column; gap: 6px; }
.guide-item {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; text-align: left;
  border-radius: 12px; background: var(--surface-2); font-size: 15px; font-weight: 600;
}
.guide-item > span:first-child { flex: 1; }
.guide-item .chev { font-size: 22px; color: var(--muted); }

/* ---------- Ficha (bottom sheet) ---------- */
.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 1px solid var(--border); border-bottom: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); }
.sheet[open] { animation: sheet-in 0.25s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(40%); opacity: 0; } }
.sheet-body { max-height: 92dvh; overflow-y: auto; padding: 0 18px calc(24px + var(--safe-b)); overscroll-behavior: contain; }
.sheet-head {
  position: sticky; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 0 12px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.sheet-head h2 { font-size: 19px; line-height: 1.25; }
.sheet-close { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); color: var(--muted); font-size: 18px; }
.sheet section { padding: 14px 0 4px; }
.sheet section > p { font-size: 15px; line-height: 1.5; }
.sheet h3 { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sheet .warn { margin-top: 10px; padding: 12px 14px 4px; border-radius: 14px; background: rgba(245, 165, 36, 0.08); border: 1px solid rgba(245, 165, 36, 0.25); }
.sheet .warn h3 { color: var(--warn); }
.video-links { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 8px; }
.video-links a {
  display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px;
  border-radius: 14px; background: rgba(240, 82, 82, 0.12); color: #ff7b7b; font-weight: 700; text-decoration: none;
}
.sheet li { white-space: pre-line; }

/* ---------- Temporizador guiado (Air Bike) ---------- */
.btn-protocol {
  height: 56px; margin-top: 10px; font-size: 16px;
  background: rgba(255, 90, 79, 0.14); color: #ff7a70; border: 1px solid rgba(255, 90, 79, 0.35);
}
.interval {
  --iv: var(--accent);
  position: fixed; inset: 0; z-index: 70; display: none; flex-direction: column;
  padding: calc(var(--safe-t) + 12px) 20px calc(var(--safe-b) + 16px);
  background: radial-gradient(120% 70% at 50% 30%, color-mix(in srgb, var(--iv) 22%, var(--bg)), var(--bg));
  transition: background 0.3s; overflow-y: auto;
}
.interval.open { display: flex; }
body.iv-open { overflow: hidden; }
.interval[data-kind="easy"] { --iv: #4f8cff; }
.interval[data-kind="sprint"] { --iv: #ff4d3d; }
.interval[data-kind="cool"] { --iv: #2dd4bf; }
.interval[data-kind="done"] { --iv: var(--success); }

.iv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; color: var(--muted); }
.iv-head button { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-3); font-size: 18px; color: var(--muted); }

.iv-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 300px; }
.iv-phase { font-size: 26px; font-weight: 800; color: var(--iv); text-transform: uppercase; letter-spacing: 0.02em; }
.iv-time { font-size: clamp(96px, 30vw, 160px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin: 8px 0 16px; }
.interval[data-kind="sprint"] .iv-time { color: var(--iv); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.iv-bar { width: 100%; max-width: 420px; height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.iv-bar i { display: block; height: 100%; background: var(--iv); transform-origin: left; transform: scaleX(0); transition: transform 0.2s linear; }
.iv-next { margin-top: 14px; font-size: 16px; color: var(--muted); }

.iv-steps { display: flex; gap: 5px; list-style: none; margin: 16px 0 6px; padding: 0; }
.iv-steps li {
  flex: 1; padding: 7px 0; border-radius: 8px; text-align: center; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
.iv-steps li.sprint { color: #ff7a70; }
.iv-steps li.done { opacity: 0.35; }
.iv-steps li.current { border-color: var(--iv); color: var(--text); background: color-mix(in srgb, var(--iv) 25%, var(--surface-2)); }
.iv-total { text-align: center; font-size: 14px; color: var(--muted); min-height: 20px; }

.iv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.iv-actions:empty { display: none; }
.iv-actions button { height: 64px; border-radius: 16px; background: var(--surface-3); font-size: 17px; font-weight: 700; }
.iv-actions button:active { background: var(--iv); }

.iv-form { display: none; }
.interval.finished .iv-form { display: block; margin-top: 12px; }
.interval.finished .iv-main { min-height: 0; flex: 0 0 auto; padding: 24px 0 8px; }
.interval.finished .iv-time { font-size: 72px; margin: 4px 0 12px; }
.iv-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }

/* ============================================================
 *  v5 — Navegación inferior, dashboard, progreso y nutrición
 * ============================================================ */
.header-date { display: inline-block; font-size: 13px; color: var(--muted); }
.header-date::first-letter { text-transform: uppercase; }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(14, 16, 20, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--faint);
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button[aria-selected="true"] { color: var(--accent); }

/* ---------- Dashboard ---------- */
.goal-card {
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(240, 82, 82, 0.16), rgba(79, 140, 255, 0.12));
  border: 1px solid rgba(240, 82, 82, 0.3);
}
.goal-text { font-size: 15px; line-height: 1.45; }
.goal-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 8px; font-size: 14px; }
.goal-meta span:last-child { color: #ff8a8a; font-weight: 700; }
.quote-card {
  padding: 12px 16px 14px 18px; margin-bottom: 18px; border-radius: 14px;
  background: var(--surface); border-left: 3px solid var(--accent);
}
.quote-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.quote-card p { margin-top: 4px; font-size: 15px; line-height: 1.45; font-style: italic; }

/* ---------- Notas de máquina ---------- */
.ex-note-wrap { display: block; margin-top: 10px; }
.ex-note-wrap[hidden] { display: none; }
.ex-note-wrap > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.ex-note-wrap .note { margin-top: 6px; }

/* ---------- Historial por ejercicio (ficha) ---------- */
.hx { padding: 12px 0; border-bottom: 1px solid var(--border); }
.hx-date { display: flex; justify-content: space-between; font-size: 14px; }
.hx-date span { color: var(--muted); }
.sheet .hx-sets { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sheet .hx-sets li { margin: 0; padding: 5px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hx-n { margin-right: 6px; color: var(--muted); font-size: 12px; }

/* ---------- Progreso corporal ---------- */
.body-stats .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.body-stats .stat-row.compact { grid-template-columns: 1fr 1fr; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.stat span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat em { font-style: normal; font-size: 13px; color: var(--muted); }
.goal-progress { height: 8px; margin: 14px 0 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.goal-progress i { display: block; height: 100%; background: var(--success); transform-origin: left; }

.body-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.field-date { grid-column: 1 / -1; }
.field-date input { font-size: 18px; color-scheme: dark; }
.body-form .btn-finish { height: 56px; font-size: 17px; }

.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented.mini button { min-height: 34px; padding: 0 10px; font-size: 13px; }
.chart { position: relative; margin-top: 10px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.c-goal { fill: rgba(34, 197, 94, 0.13); }
.c-goal-label { fill: var(--success); font-size: 10px; font-weight: 700; }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.c-last { fill: var(--text); font-size: 11px; font-weight: 700; }
.c-xhair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.c-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none;
  padding: 6px 10px; border-radius: 10px; background: var(--text); color: var(--bg);
  font-size: 13px; text-align: center; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.c-tip[hidden] { display: none; }
.c-tip b { display: block; font-size: 15px; }
.c-tip span { font-size: 12px; opacity: 0.7; }

.body-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.body-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 4px; }
.body-table td { padding: 6px 4px; border-top: 1px solid var(--border); height: 44px; }
.row-del { width: 36px; height: 36px; border-radius: 10px; color: var(--faint); }
.row-del:active { background: rgba(240, 82, 82, 0.15); color: var(--danger); }

/* ---------- Nutrición ---------- */
.protein-card {
  padding: 18px; margin-bottom: 12px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.06));
  border: 1px solid var(--success-border);
}
.nut-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--success); }
.protein-num { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.protein-num small { font-size: 22px; color: var(--muted); }
.nut-grid { display: grid; gap: 10px; }
@media (min-width: 560px) { .nut-grid { grid-template-columns: 1fr 1fr; } }
.nut-card { --tone: var(--accent); padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--tone); }
.nut-card h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.nut-card h2 span { font-size: 20px; }
.nut-card ul { margin: 8px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.nut-card li::marker { color: var(--tone); }
.tone-blue { --tone: #4f8cff; }
.tone-green { --tone: #22c55e; }
.tone-violet { --tone: #a78bfa; }
.tone-amber { --tone: #f5a524; }
.tone-teal { --tone: #2dd4bf; }
