/* FitPilot MVP · tema oscuro / verde lima (referencias verdes del 10/10).
   Decisión reversible: estructura de escritorio de la opción 1, móvil de la opción 2, componentes de la opción 3. */
:root {
  --bg: #090c09;
  --bg-2: #0e130e;
  --surface: #131913;
  --surface-2: #19211a;
  --surface-3: #212b22;
  --border: #263226;
  --border-strong: #35453a;
  --text: #f3f6f1;
  --muted: #a9b4a5;
  --faint: #7f8a7c;
  --lime: #c6f432;
  --lime-strong: #d6ff4a;
  --lime-dim: rgba(198, 244, 50, 0.12);
  --on-lime: #0b0f05;
  --danger: #ff8a7a;
  --danger-bg: rgba(255, 112, 92, 0.12);
  --warn: #ffd166;
  --warn-bg: rgba(255, 209, 102, 0.12);
  --info: #8fd3ff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--lime);
  /* Ronda 23: Plus Jakarta Sans (fuente oficial, SIL OFL 1.1, servida desde la propia app) en toda la interfaz. */
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --type-title: 1.5rem;
  --type-hero: 1.75rem;
  color-scheme: dark;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
/* Formularios, botones y diálogos con la misma fuente (los navegadores ponen la suya en campos y áreas de texto). */
button, input, select, textarea, dialog { font-family: inherit; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
/* Iconos en línea: tamaño relativo al texto salvo que el componente indique otro. */
svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
a { color: var(--lime); text-underline-offset: 3px; }
a:hover { color: var(--lime-strong); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -0.015em; overflow-wrap: anywhere; }
h1 { font-size: var(--type-title); font-weight: 750; line-height: 1.25; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.lime { color: var(--lime); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: 10px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--lime); color: var(--on-lime); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.sidebar { display: none; }
.main { padding: 16px 16px 112px; max-width: 1360px; width: 100%; margin: 0 auto; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; position: sticky; top: 0; z-index: 20; background: rgba(9, 12, 9, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { min-width: 0; }
.topbar .who .who-name, .topbar .logout-label { display: none; }
@media (min-width: 640px) { .topbar .who .who-name, .topbar .logout-label { display: inline; } }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); background: var(--surface-2); flex: none; display: grid; place-items: center; font-weight: 800; color: var(--lime); font-size: 0.85rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand:hover { color: var(--text); }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(12, 16, 12, 0.97); border-top: 1px solid var(--border); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border-radius: 16px; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 600; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { background: var(--lime); color: var(--on-lime); }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nav-list a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; color: var(--muted); text-decoration: none; font-weight: 600; min-height: 48px; }
.nav-list a:hover { color: var(--text); background: var(--surface-2); }
.nav-list a .ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.nav-list a svg { width: 22px; height: 22px; }
.nav-list a[aria-current="page"] { background: linear-gradient(90deg, rgba(198,244,50,0.18), rgba(198,244,50,0.04)); color: var(--text); border: 1px solid rgba(198,244,50,0.25); }
.nav-list a[aria-current="page"] .ico { background: var(--lime); color: var(--on-lime); }

@media (min-width: 1024px) {
  :root { --type-title: 1.75rem; --type-hero: 2rem; }
  .shell { grid-template-columns: 260px minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; padding: 26px 18px; border-right: 1px solid var(--border); background: var(--bg-2); }
  .sidebar .side-foot { margin-top: auto; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
  .bottom-nav { display: none; }
  .topbar .brand { display: none; }
  .topbar { padding: 14px 28px; }
  .main { padding: 24px 28px 48px; }
}

/* ---------- Componentes ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 4px 0 16px; }
.page-head .eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; color: var(--lime); font-weight: 700; margin-bottom: 6px; }
.grid { display: grid; gap: 16px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.span-2 { grid-column: 1 / -1; }
@media (min-width: 1200px) { .span-2 { grid-column: span 2; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.tint { background: linear-gradient(160deg, #182316 0%, var(--surface) 60%); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 10px; }
.card-head h2 svg, .card-head h3 svg { width: 22px; height: 22px; color: var(--lime); flex: none; }
.card-link { font-size: 0.875rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--lime); color: var(--on-lime); border-color: var(--lime); font-weight: 750; }
.btn.primary:hover { background: var(--lime-strong); }
.btn.primary:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #ffffff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255,138,122,0.4); background: transparent; }
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: 0.9rem; }
.btn.lg { min-height: 56px; padding: 12px 26px; font-size: 1.08rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.icon-only { width: 44px; padding: 0; }
.btn .play { width: 30px; height: 30px; border-radius: 50%; background: var(--on-lime); color: var(--lime); display: grid; place-items: center; }
.btn .play svg { width: 16px; height: 16px; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.93rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.pill[aria-pressed="true"], .pill[aria-selected="true"], .pill.active { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.pill[aria-disabled="true"] { opacity: 0.55; border-style: dashed; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border-strong); white-space: nowrap; }
.badge.lime { background: var(--lime-dim); color: var(--lime); border-color: rgba(198,244,50,0.35); }
.badge.solid { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(255,209,102,0.35); }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255,138,122,0.35); }
.badge.info { background: rgba(143,211,255,0.1); color: var(--info); border-color: rgba(143,211,255,0.3); }
.badge.demo { background: #2a2312; color: #ffd98a; border-color: #5c4a1c; letter-spacing: 0.06em; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-strong); }
.notice svg { width: 22px; height: 22px; flex: none; color: var(--lime); margin-top: 1px; }
.notice.warn { background: var(--warn-bg); border-color: rgba(255,209,102,0.35); }
.notice.warn svg { color: var(--warn); }
.notice.danger { background: var(--danger-bg); border-color: rgba(255,138,122,0.35); }
.notice.danger svg { color: var(--danger); }
.demo-banner { background: #1d180b; color: #ffd98a; border-bottom: 1px solid #4b3d17; text-align: center; padding: 6px 12px; font-size: 0.82rem; font-weight: 600; }

.empty { text-align: center; padding: 26px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty svg { width: 34px; height: 34px; color: var(--faint); }

.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.stat .v { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat .v small { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .l { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 24px; border: 1px solid var(--border); background: radial-gradient(120% 120% at 80% 10%, #1b2a13 0%, #0d120c 55%, #090c09 100%); min-height: 240px; display: grid; grid-template-columns: 1fr; }
.hero-body { position: relative; z-index: 2; padding: 22px; display: grid; gap: 14px; align-content: end; }
.hero h1 { font-size: var(--type-hero); line-height: 1.15; font-weight: 750; letter-spacing: -0.02em; }
.hero h1 .lime { display: block; }
.hero-portrait { position: absolute; inset: 0; z-index: 1; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; opacity: 0.5; }
.hero-portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9,12,9,0.96) 18%, rgba(9,12,9,0.55) 60%, rgba(9,12,9,0.2) 100%); }
.hero .session-chip { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 0.92rem; }
.hero .hero-note { display: flex; gap: 8px; align-items: flex-start; max-width: 46ch; color: var(--text); font-size: 0.92rem; line-height: 1.45; }
.hero .hero-note svg { flex: none; width: 18px; height: 18px; color: var(--warn); margin-top: 2px; }
.hero .caption { position: absolute; right: 12px; top: 12px; z-index: 3; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 260px; }
  .hero-body { padding: 28px; align-content: center; }
  .hero-portrait { position: relative; inset: auto; grid-column: 2; grid-row: 1; }
  .hero-portrait img { opacity: 1; object-position: 50% 15%; }
  .hero-portrait::after { background: linear-gradient(90deg, rgba(13,18,12,1) 0%, rgba(13,18,12,0.2) 35%, rgba(9,12,9,0) 70%); }
  .hero-body { grid-column: 1; grid-row: 1; }
}

/* Semana */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 8px 4px; text-align: center; min-width: 0; display: grid; gap: 4px; justify-items: center; }
.day .dn { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.day .dd { font-weight: 800; font-size: 1rem; }
.day.today { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); }
.dot svg { width: 13px; height: 13px; }
.dot.completado { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.dot.parcial { border-color: var(--warn); color: var(--warn); }
.dot.en_curso { border-color: var(--info); color: var(--info); }
.dot.planificado { border-color: var(--lime); }
.dot.sin_registro { border-style: dashed; }
.dot.reprogramado { border-color: var(--faint); color: var(--faint); }
.dot.descanso { border-color: transparent; background: var(--surface-3); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 16px; height: 16px; }
.week-list { display: grid; gap: 10px; }
.week-day { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.week-day.today { border-color: var(--lime); }
.week-day .date { font-weight: 800; }
.week-day .date small { display: block; color: var(--muted); font-weight: 600; }

/* Ejercicios */
.ex-list { display: grid; gap: 10px; }
.ex { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.ex-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; color: var(--lime); }
.ex-ico svg { width: 26px; height: 26px; }
.ex h3 { font-size: 1.02rem; }
.dose { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dose .chip { background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 6px 10px; text-align: center; min-width: 64px; }
.dose .chip b { display: block; font-size: 1.05rem; }
.dose .chip span { font-size: 0.72rem; color: var(--muted); }
.superset { border-left: 3px solid var(--lime); padding-left: 12px; display: grid; gap: 10px; }
.superset-label { font-size: 0.8rem; color: var(--lime); font-weight: 700; }

/* Registro de series */
.set-row { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border); }
.set-row.saved { border-color: rgba(198,244,50,0.45); }
.set-row.skipped { border-style: dashed; }
.set-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .set-fields { grid-template-columns: 0.8fr 1fr 1fr; } }
.timer { position: sticky; top: 64px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 18px; background: #101810; border: 1px solid rgba(198,244,50,0.35); box-shadow: var(--shadow); }
.timer .time { font-size: 2rem; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer.done .time { color: var(--lime); }
@media (min-width: 1024px) { .timer { top: 74px; } }

/* Formularios */
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label, legend { font-size: 0.88rem; font-weight: 650; color: var(--text); }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field .err { font-size: 0.84rem; color: var(--danger); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: #0c110c; color: var(--text); font: inherit; font-size: 1rem;
}
textarea { min-height: 92px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(198,244,50,0.35); border-radius: 12px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
fieldset { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 0; min-width: 0; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.choice input:checked + span { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.choice input:focus-visible + span { box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--lime); flex: none; margin-top: 2px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-status { font-size: 0.9rem; font-weight: 600; }
.form-status.ok { color: var(--lime); }
.form-status.err { color: var(--danger); }
details { border-radius: 12px; }
details > summary { cursor: pointer; font-weight: 650; color: var(--muted); min-height: 40px; display: flex; align-items: center; gap: 6px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; color: var(--lime); }
details[open] > summary::before { content: "▾"; }

/* Alimentación */
.meal { display: grid; gap: 10px; }
.food-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.food-item .kcal { font-weight: 800; text-align: right; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photo { position: relative; width: 132px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface-3); }
.photo img { width: 132px; height: 100px; object-fit: cover; }
.photo .acts { display: flex; gap: 4px; padding: 6px; flex-wrap: wrap; }
.photo .acts .btn { min-height: 34px; padding: 4px 10px; font-size: 0.8rem; }
.preview img { max-height: 240px; border-radius: 14px; border: 1px solid var(--border-strong); }

/* Tablas */
.table-wrap { position: relative; overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: 0.8rem; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* Mensajes */
.thread { display: grid; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.msg.mine { margin-left: auto; background: #1b2614; border-color: rgba(198,244,50,0.3); }
.msg .meta { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* Barras */
.bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.chart svg { width: 100%; height: auto; display: block; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-visual { position: relative; min-height: 260px; overflow: hidden; background: #0b100a; }
.auth-visual img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; position: absolute; inset: 0; opacity: 0.85; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 4%, rgba(9,12,9,0.35) 55%, rgba(9,12,9,0.15) 100%); }
/* Ronda 23: en móvil el texto va en el flujo, bajo la marca (antes, absoluto desde abajo, subía sobre el logo). */
.auth-visual { display: flex; flex-direction: column; justify-content: flex-end; padding: 68px 20px 20px; }
.auth-visual .overlay { position: relative; z-index: 2; display: grid; gap: 10px; }
.auth-claim { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.1; font-weight: 750; letter-spacing: -0.04em; text-transform: uppercase; }
.auth-visual .brand-top { position: absolute; z-index: 2; top: 18px; left: 20px; }
.auth-form { padding: 24px 16px 40px; display: grid; align-content: center; justify-items: center; }
.auth-form .box { width: 100%; max-width: 440px; display: grid; gap: 18px; }
@media (min-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr); }
  .auth-visual { min-height: 100vh; display: block; padding: 0; }
  .auth-visual .overlay { position: absolute; }
  .auth-visual::after { background: linear-gradient(90deg, rgba(9,12,9,0) 50%, var(--bg) 100%), linear-gradient(0deg, rgba(9,12,9,0.9) 5%, rgba(9,12,9,0) 50%); }
  .auth-visual .overlay { left: 40px; bottom: 44px; right: 30%; }
  .auth-visual .brand-top { top: 32px; left: 40px; }
}

/* Toasts */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: 92px; display: grid; gap: 8px; width: min(92vw, 460px); }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: #1c251b; border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-weight: 600; }
.toast.err { border-color: rgba(255,138,122,0.5); }

/* Diálogo */
dialog { border: 1px solid var(--border-strong); border-radius: 20px; background: var(--surface); color: var(--text); padding: 22px; width: min(92vw, 480px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 6px 14px; font-size: 0.93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.review-block { display: grid; gap: 10px; }
.review-block h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--lime); }
.editor-section { border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: grid; gap: 12px; background: var(--bg-2); }
.editor-line { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.editor-line .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .editor-line .form-grid { grid-template-columns: 2.2fr repeat(4, minmax(0, 1fr)) 0.8fr; } }

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

.kicker { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.75rem; font-weight: 700; color: var(--lime); }
.portrait-slot { position: absolute; inset: 0; }
.portrait-slot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.hero-h1 { font-size: var(--type-hero); line-height: 1.15; font-weight: 750; letter-spacing: -0.02em; }
.hero-h1 .lime { display: block; }
.chart .pt { fill: var(--lime); stroke: var(--bg); stroke-width: 2; }
.chart .ln { stroke: var(--lime); stroke-width: 2.5; }
.chart .gl { stroke: var(--border); stroke-width: 1; }
.chart .tx { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.topbar .row { flex-wrap: nowrap; gap: 6px; }
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { box-shadow: none; outline: none; }
.check { min-height: 44px; align-items: center; }
.card-link { white-space: nowrap; }
@media (min-width: 900px) {
  .hero { min-height: 380px; max-height: 460px; }
  .hero-portrait { overflow: hidden; }
  .hero-portrait img { position: absolute; inset: 0; }
}
@media (min-width: 1024px) {
  :root { --type-title: 1.75rem; --type-hero: 2rem; }
  .shell { background: linear-gradient(90deg, var(--bg-2) 0, var(--bg-2) 259px, var(--border) 259px, var(--border) 260px, transparent 260px); }
}
.stack, .stack-sm { align-content: start; }
[data-date-nav] { flex-wrap: nowrap; }
[data-date-nav] input { min-width: 0; width: auto; flex: 1 1 140px; }
.stack > .btn:not(.block), .stack-sm > .btn:not(.block), .stack > a.btn:not(.block) { justify-self: start; }
.bottom-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
@media (max-width: 639px) { [data-date-nav] { width: 100%; } [data-date-nav] input { flex: 1 1 0; } }

/* ---------- Ronda 2: diálogo, esqueletos y movimiento optativo ---------- */
.fp-dialog h2 { font-size: 1.2rem; }
.dialog-actions { justify-content: flex-end; }
.btn.discard { background: transparent; color: var(--danger); border-color: rgba(255,138,122,0.45); }
.btn.danger.primary, .btn.danger-fill { background: #ff8a7a; color: #1a0703; border-color: #ff8a7a; }
.ui-skeleton { display: block; border-radius: 14px; background: linear-gradient(100deg, var(--surface-2) 42%, var(--surface-3) 50%, var(--surface-2) 58%); background-size: 200% 100%; background-position: 200% 0; }
.sk-title { height: 40px; width: min(420px, 70%); margin: 8px 0 14px; }
.sk-line { height: 16px; width: min(560px, 90%); margin-bottom: 20px; }
.sk-card { height: 180px; }
@keyframes ui-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ui-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Movimiento por opt-in: con reduced motion el estado final queda legible y estático. */
@media (prefers-reduced-motion: no-preference) {
  .ui-skeleton { animation: ui-shimmer 1.4s ease-in-out infinite; }
  .view-enter { animation: ui-fade-in 180ms ease-out both; }
  .toast { animation: ui-fade-in 160ms ease-out both; }
}
.unsaved-note { color: var(--warn); font-size: 0.85rem; font-weight: 600; }

/* ---------- Ronda 3: guías animadas ---------- */
.guide { display: grid; gap: 14px; }
.guide-stage { margin: 0; border-radius: 18px; overflow: hidden; background: #121214; }
.guide-stage figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 14px; font-size: 0.86rem; color: var(--muted); background: #161719; }
.guide-focus { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.guide-focus .swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(198,244,50,0.7); }
.guide-svg { width: 100%; height: auto; display: block; }
.guide-svg .g-trace { fill: none; stroke: rgba(255,255,255,0.22); stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.guide-svg .g-callout polyline { fill: none; stroke: rgba(240,244,238,0.7); stroke-width: 1; }
.guide-svg .g-callout circle { fill: #f0f4ee; }
.guide-svg .g-callout text { fill: #f0f4ee; font-family: var(--font); font-weight: 500; letter-spacing: 0.01em; }
.guide-draft { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--warn); font-weight: 600; font-size: 0.88rem; }
.guide-now { display: grid; gap: 4px; }
.guide-step { margin: 0; color: var(--muted); font-size: 0.9rem; }
.guide-step strong { color: var(--text); }
.guide-cue { margin: 0; font-size: 1rem; min-height: 3em; }
.guide-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.guide-phases { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 8px; border-top: 1px solid var(--border); }
@media (max-width: 520px) { .guide-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide-phases button { all: unset; box-sizing: border-box; display: flex; gap: 8px; align-items: baseline; width: 100%; min-height: 44px; padding: 10px 4px; cursor: pointer; color: var(--muted); font-size: 0.9rem; border-bottom: 2px solid transparent; }
.guide-phases button span { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 700; }
.guide-phases button:hover { color: var(--text); }
.guide-phases button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
.guide-phases button[aria-current="step"] { color: var(--text); border-bottom-color: var(--lime); font-weight: 650; }
.guide-phases button[aria-current="step"] span { color: var(--lime); }
.guide-sheet { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.guide-sheet-item { display: grid; gap: 6px; }
.guide-sheet-item .guide-svg { border-radius: 12px; }
.checklist-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.live-banner { position: sticky; top: 64px; z-index: 18; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 14px; border-radius: 16px; background: #15210f; border: 1px solid rgba(198,244,50,0.45); }
@media (min-width: 1024px) { .live-banner { top: 74px; } }
.private-field label::after { content: " · privado, solo coach"; color: var(--warn); font-weight: 600; font-size: 0.8rem; }
.estimate-form { border: 1px solid rgba(143,211,255,0.3); border-radius: 14px; padding: 12px; background: #0f1714; }
.estimate-row { grid-template-columns: 1fr; }
@media (min-width: 640px) { .estimate-row { grid-template-columns: 2fr 1fr 1fr 1.2fr; align-items: end; } .estimate-row .check { grid-column: 1 / -1; } }

/* Biblioteca: filas sin tarjetas anidadas, separadas por líneas. */
.lead-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; color: var(--muted); max-width: 70ch; }
.lead-note svg { color: var(--lime); flex: none; margin-top: 3px; }
.lib-list { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--border); }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.lib-row.inactive { opacity: 0.6; }
.lib-name { font-size: 1.02rem; margin: 0 0 2px; letter-spacing: -0.01em; }
.lib-row p { margin: 0; }
.lib-guide { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; border-radius: 12px; padding: 4px; }
.lib-guide:hover .lib-thumb, .lib-guide:focus-visible .lib-thumb { outline: 2px solid var(--lime); outline-offset: 2px; }
.lib-guide:hover .lib-guide-text span:last-child { text-decoration: underline; }
.lib-thumb { width: 112px; border-radius: 10px; overflow: hidden; flex: none; display: block; }
.lib-thumb .guide-svg { display: block; }
.lib-guide-text { display: grid; gap: 4px; justify-items: start; font-weight: 600; font-size: 0.92rem; }
.lib-guide-cell { justify-self: end; }
.lib-form { margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
@media (max-width: 640px) {
  .lib-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lib-guide-cell { grid-column: 1 / -1; justify-self: start; grid-row: 2; }
  .lib-thumb { width: 96px; }
}
.guide-state { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: var(--muted); }
.guide-state svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.guide-details > summary { display: flex; gap: 14px; align-items: center; min-height: 44px; padding: 0; color: var(--text); font-weight: 600; cursor: pointer; list-style: none; border-radius: 12px; }
.guide-details > summary::-webkit-details-marker { display: none; }
.guide-details > summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.guide-thumb { width: 128px; flex: none; border-radius: 10px; overflow: hidden; display: block; }
.guide-thumb .guide-svg { display: block; }
.guide-sum { display: grid; gap: 4px; min-width: 0; }
.guide-sum-cta { display: inline-flex; align-items: center; gap: 8px; color: var(--lime); font-weight: 700; }
.guide-sum-cta svg { width: 14px; height: 14px; }
.guide-details > summary:hover .guide-thumb { outline: 2px solid var(--lime); outline-offset: 2px; }
.guide-preview-tag { font-size: 0.8rem; font-weight: 600; color: var(--warn); }
.guide-details[open] > summary { margin-bottom: 12px; }
.guide-details[open] > summary .guide-thumb { display: none; }
.guide-details[open] > summary .guide-sum-cta::after { content: " · ocultar"; color: var(--muted); font-weight: 500; }
@media (max-width: 420px) { .guide-thumb { width: 104px; } }

/* Página de guía del coach: reproductor sin tarjeta y revisión en líneas, no en cajas. */
.guide-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .guide-layout { grid-template-columns: 1fr; gap: 24px; } }
.review-panel { padding-left: 32px; border-left: 1px solid var(--border); }
@media (max-width: 900px) { .review-panel { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 1px solid var(--border); } }
.h-sub { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; }
.plain-list { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.plain-details > summary { cursor: pointer; color: var(--muted); font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.check-table { border-top: 1px solid var(--border); }
.check-line { border: 0; border-radius: 0; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; background: none; }
.check-line legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
.check-line .seg { clear: both; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 0.86rem; color: var(--muted); }
.seg input:checked + span { background: var(--surface-2, #232a24); color: var(--text); font-weight: 650; }
.seg input[value="ok"]:checked + span { background: var(--lime); color: var(--on-lime); }
.seg input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 1px; }
.history { padding-top: 8px; }

/* ---------- Depuración visual (ronda 4): una superficie por sección, menos cajas, más jerarquía ----------
   Dentro de una tarjeta, los elementos se separan con líneas finas y espacio, no con más tarjetas. */
.grid-2, .grid-3 { align-items: start; }
.ex-list { gap: 0; }
.ex { grid-template-columns: minmax(0, 1fr); padding: 18px 0; background: none; border: 0; border-radius: 0; border-top: 1px solid var(--border); }
.ex-ico { display: none; }
.ex h3 { font-size: 1.08rem; margin: 0 0 2px; }
.dose { gap: 20px; margin-top: 6px; }
.dose .chip { background: none; border: 0; border-radius: 0; padding: 0; min-width: 0; text-align: left; display: inline-flex; align-items: baseline; gap: 5px; }
.dose .chip b { display: inline; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }
.dose .chip span { font-size: 0.82rem; }
.superset { gap: 0; }
.card .stat { background: none; border: 0; border-radius: 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--border-strong); }
.card .stats { gap: 14px 18px; }
.card .week-day { background: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); padding: 12px 0; }
.card .week-day.today { border-bottom-color: var(--lime); }
.sidebar .side-foot { background: none; border: 0; padding: 0 8px; }
#home-grid { align-items: stretch; } /* fila del Inicio: alturas iguales como en el mockup */
.todo-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.todo-list li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.todo-list li > svg { width: 18px; height: 18px; color: var(--lime); flex: none; }
.todo-list li > span { flex: 1 1 260px; min-width: 0; }
.guide-details > summary::before { content: none; }
.topbar .who .badge { overflow: visible; text-overflow: clip; flex: none; } /* la insignia DEMO no se recorta a 360 px */
/* Dentro de tarjetas: grupos de opciones y tablas sin marco propio; acciones de fila discretas. */
.card fieldset { border: 0; border-radius: 0; padding: 0; }
.card fieldset > legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.card .table-wrap { border: 0; border-radius: 0; }
.card th { background: none; border-bottom-color: var(--border-strong); }
.card th:first-child, .card td:first-child { padding-left: 0; }
td .btn.sm, li .btn.sm.ghost { background: none; border-color: transparent; color: var(--muted); }
td .btn.sm:hover, li .btn.sm.ghost:hover { color: var(--text); border-color: var(--border-strong); }
/* Comidas: un solo bloque con las tomas separadas por líneas (antes, una tarjeta por toma). */
.meal-list { display: grid; padding-top: 4px; padding-bottom: 4px; }
.meal-list .meal { padding: 16px 0; border-top: 1px solid var(--border); }
.meal-list .meal:first-child { border-top: 0; }
.meal-list .meal .card-head { margin-bottom: 4px; }
.meal-list .meal h2 { font-size: 1.1rem; }
.card .stats { margin-bottom: 8px; }

/* ---------- Inicio del alumno (ronda 5): la sesión que toca en primer plano, el resto en una columna ---------- */
.home-layout { display: grid; gap: 28px; margin-top: 22px; }
@media (min-width: 1000px) { .home-layout { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 40px; align-items: start; } }
.home-main, .home-side > section { min-width: 0; }
.home-side { display: grid; gap: 28px; }
@media (min-width: 1000px) { .home-side { padding-left: 32px; border-left: 1px solid var(--border); } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.section-head h2, .section-title { font-size: 1.15rem; letter-spacing: -0.01em; margin: 0; }
.section-title { margin-bottom: 8px; }
.today-list { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--border); }
.today-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.today-item > svg { width: 18px; height: 18px; color: var(--faint); }
.today-item:hover > svg, .today-item:focus-visible > svg { color: var(--lime); }
.today-item:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 8px; }
.today-thumb { width: 104px; border-radius: 10px; overflow: hidden; display: block; }
.today-thumb .guide-svg { display: block; }
.today-thumb.empty { height: 78px; display: grid; place-items: center; background: var(--surface-2); color: var(--lime); }
.today-thumb.empty svg { width: 26px; height: 26px; }
.today-text { display: grid; gap: 2px; min-width: 0; }
.today-text strong { font-size: 1.02rem; }
.today-guide { display: inline-flex; align-items: center; gap: 6px; color: var(--lime); font-weight: 600; }
.today-guide svg { width: 12px; height: 12px; }
@media (max-width: 420px) { .today-thumb { width: 84px; } .today-thumb.empty { height: 63px; } }
.quick-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.quick-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 2px; min-height: 52px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.quick-list a > svg:first-child { width: 20px; height: 20px; color: var(--lime); }
.quick-list a > svg:last-child { width: 18px; height: 18px; color: var(--muted); }
.quick-list a:hover > svg:last-child { color: var(--lime); }
.quick-list a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 8px; }
.quick-list a > span { display: grid; gap: 1px; }
.review-short h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--lime); margin: 10px 0 2px; }
.review-short p { margin: 0; }
.checkin-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; }
.checkin-line svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--lime); }
.hero .hero-h1 { margin: 0; }

/* ---------- Guías · figura renovada (ronda 7): cuerpo mate sombreado, sin brillo sobre el movimiento ---------- */
.guide-svg path { stroke-linejoin: round; stroke-linecap: round; }
.guide-svg .m-body { stroke: #262a26; stroke-width: 1.1; }
.guide-svg .m-body-far { stroke: #1a1d1a; stroke-width: 1; }
.guide-svg .m-mus { stroke: rgba(52, 58, 53, 0.42); stroke-width: 0.55; }
.guide-svg .m-mus-far { stroke: rgba(26, 29, 26, 0.45); stroke-width: 0.5; }
.guide-svg .m-ghost { stroke: none; opacity: 0.42; }
.guide-svg .m-shade { stroke: none; }
.guide-svg .m-body-fill { stroke: none; }
.guide-svg .m-edge { fill: none; stroke: #262a26; stroke-width: 1.1; }
.guide-svg .m-rim { fill: none; stroke: rgba(0, 0, 0, 0.3); stroke-width: 4.2; }
.guide-svg .m-rim-far { fill: none; stroke: rgba(0, 0, 0, 0.35); stroke-width: 3.6; }
.guide-svg .m-ten { stroke: #5d635c; stroke-width: 0.55; }
.guide-svg .m-ten-far { stroke: #2e322e; stroke-width: 0.55; }
.guide-svg .m-ten-line { fill: none; stroke: #4a504a; stroke-width: 0.7; }
.guide-svg .m-fiber { fill: none; stroke: rgba(60, 66, 61, 0.28); stroke-width: 0.4; }
.guide-svg .m-far { fill: #545a55; stroke: #2a2e2a; stroke-width: 0.8; }
.guide-svg .m-equip { stroke: #3f4641; stroke-width: 0.9; }
.guide-svg .m-pad { stroke: #171a17; stroke-width: 0.9; }
.guide-svg .m-rubber { stroke: #121512; stroke-width: 0.9; }
.guide-svg .m-band { fill: #8d9a94; stroke: none; }
.guide-svg .m-band-far { fill: #56605b; stroke: none; }
.guide-svg .m-cable { fill: #9aa39d; stroke: none; }
.guide-svg .m-ground { fill: #2a2e2b; stroke: none; }
.guide-svg .m-mat { fill: #262b27; stroke: #323833; stroke-width: 0.8; }
.guide-svg .m-accent { stroke: #4f6c08; stroke-width: 0.75; opacity: 0.9; }

/* ---------- Tu día (ronda 7) ---------- */
a.day { color: inherit; text-decoration: none; }
a.day:hover, a.day:focus-visible { border-color: var(--lime); outline: none; box-shadow: inset 0 0 0 1px rgba(198,244,50,0.6); }
.day .day-place { font-size: 0.62rem; font-weight: 700; color: var(--lime); letter-spacing: 0.04em; }
.day-layout { display: grid; gap: 28px; }
@media (min-width: 1000px) { .day-layout { grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.6fr); gap: 40px; align-items: start; } }
.day-form { display: grid; gap: 20px; }
@media (min-width: 1000px) { .day-form { position: sticky; top: 90px; } }
.day-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.day-field > legend, .day-legend { font-weight: 700; margin: 0 0 8px; padding: 0; font-size: 0.95rem; }
.seg-lg span { min-height: 46px; padding: 0 20px; font-size: 1rem; gap: 8px; }
.seg-lg span svg { width: 18px; height: 18px; }
.seg-wrap { display: flex; flex-wrap: wrap; border-radius: 16px; }
.seg input[value="casa"]:checked + span, .seg input[value="gimnasio"]:checked + span, .seg-wrap input:checked + span { background: var(--lime); color: var(--on-lime); font-weight: 700; }
.day-result { min-width: 0; display: grid; gap: 10px; align-content: start; }
.day-result h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; }
.day-actions { margin-top: 8px; align-items: center; }
.day-others { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.week-day .date a { display: block; margin-top: 4px; font-weight: 600; }

/* Ronda 8: catálogo FitPilot pendiente de añadir a la biblioteca del coach */
.lib-catalog { margin-bottom: 1rem; border-color: var(--border-strong); }
.lib-catalog h2 { font-size: 1.05rem; }
.cat-list { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.25rem 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.cat-list li { padding: 0.15rem 0; }

/* Ronda 9: opciones no realizables visibles en modo consulta, progreso por ejercicio, restricciones */
.pill.pill-off { border-style: dashed; color: var(--muted); }
.pill.pill-off[aria-pressed="true"] { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.ref-line { color: var(--muted); }
.ref-line strong { color: var(--text); }
.limit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.limit-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--border); padding-top: 8px; }

/* ---------- Ronda 12: ayudas «?», barras de avance, seguimiento y chat ---------- */
.help { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; }
.help-btn { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 800; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.help-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.help-pop { position: absolute; z-index: 40; top: calc(100% + 8px); left: 50%; transform: translateX(calc(-50% + var(--dx, 0px))); width: max-content; max-width: min(300px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); color: var(--text); font-size: 0.85rem; font-weight: 450; line-height: 1.45; letter-spacing: 0; text-align: left; white-space: normal; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lime); transition: width .3s ease; }
.meter.time > span { background: repeating-linear-gradient(45deg, #6f7f6a 0 6px, #5b6956 6px 12px); }
.meter.contra > span { background: var(--warn); }
@media (prefers-reduced-motion: reduce) { .meter > span { transition: none; } }
.goal { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--border); }
.goal:first-of-type { border-top: 0; padding-top: 0; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.goal-head strong { font-size: 1.02rem; }
.goal-nums { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.goal-nums b { color: var(--text); font-weight: 700; }
.spark { width: 100%; height: 44px; display: block; }
.spark .ln { stroke: var(--lime); stroke-width: 2; fill: none; }
.spark .tg { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 4; }
.spark .pt { fill: var(--lime); }
.week-table td, .week-table th { text-align: center; white-space: nowrap; }
.week-table td:first-child, .week-table th:first-child { text-align: left; }
.week-table .cur { color: var(--lime); font-weight: 700; }
.timeline { display: grid; gap: 6px; }
.timeline .row { font-size: 0.85rem; }
.count-badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: 0.72rem; font-weight: 800; align-items: center; justify-content: center; line-height: 1; }
.nav-list a .count-badge { margin-left: auto; }
.bottom-nav a { position: relative; }
.bottom-nav a .count-badge { position: absolute; top: 4px; right: calc(50% - 22px); }
.bottom-nav a[aria-current="page"] .count-badge { background: var(--on-lime); color: var(--lime); }
.icon-badge { position: relative; }
.icon-badge .count-badge { position: absolute; top: -4px; right: -4px; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; overscroll-behavior: contain; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.mine { align-self: flex-end; background: var(--lime-dim); border-color: rgba(198,244,50,0.3); }
.chat-msg .meta { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--faint); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 48px; max-height: 160px; resize: vertical; }
.est-table { display: grid; gap: 10px; }
.est-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.est-row .field label { font-size: 0.78rem; }
@media (min-width: 720px) { .est-row { grid-template-columns: 2fr 0.9fr 0.9fr 0.9fr auto; align-items: end; } .est-row .macros { grid-column: 1 / -1; } }
.est-row .macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.est-row.off { opacity: 0.55; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.warn-text { color: var(--warn); }
/* Cabecera móvil: el avatar abre el perfil; el icono aparte solo desde 640 px. */
.topbar a.who { color: var(--text); text-decoration: none; border-radius: 999px; }
.topbar a.who:focus-visible { outline: none; box-shadow: var(--focus); }
.topbar .profile-link { display: none; }
@media (min-width: 640px) { .topbar .profile-link { display: inline-flex; } }
@media (max-width: 520px) {
  .week-table { font-size: 0.82rem; }
  .week-table th, .week-table td { padding: 8px 5px; }
  /* Ronda 20: las cinco columnas caben a 390 px sin desplazamiento lateral oculto: «actual» y «revisada» bajan de línea. */
  .week-table .wk-now, .week-table .wk-rev { display: block; font-size: 0.72rem; }
}
/* Sustituciones preparadas: cada una con su guía animada, sangrada bajo el ejercicio principal. */
.subs { border-left: 2px solid var(--border-strong); padding-left: 12px; }
.subs .sub + .sub { margin-top: 6px; }
/* Guía escrita por el coach (sin animación). */
.guide-written { display: grid; gap: 10px; }
.guide-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.guide-thumb.empty { height: 72px; display: grid; place-items: center; background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--muted); }
.guide-thumb.empty svg { width: 28px; height: 28px; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-pick label { display: grid; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.tpl-pick label:has(input:checked) { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.tpl-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-pick label:focus-within { outline: 2px solid var(--lime); outline-offset: 2px; }
.tpl-pick .guide-svg { width: 100%; height: auto; border-radius: 8px; }

/* ---------- Ronda 24: bienvenida, semana disponible y encaje del calendario ---------- */
.onb { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.onb fieldset { border: 0; border-radius: 0; padding: 0; }
.onb legend { font-weight: 700; margin-bottom: 8px; }
.onb-head { display: grid; gap: 8px; }
.onb-head h1 { font-size: var(--type-title); }
.onb-kicker { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime); font-weight: 700; margin-bottom: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--muted); font-weight: 600; text-decoration: none; width: fit-content; }
.back-link:hover { color: var(--text); }
.onb-steps { display: flex; gap: 6px; }
.onb-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--border-strong); }
.onb-steps span.done { background: var(--lime); opacity: 0.55; }
.onb-steps span.now { background: var(--lime); }
.option-cards { display: grid; gap: 10px; }
.option-card { position: relative; display: block; }
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-card span { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; }
.option-card small { color: var(--muted); font-size: 0.88rem; }
.option-card input:checked + span { border-color: var(--lime); background: var(--lime-dim); box-shadow: inset 0 0 0 1px var(--lime); }
.option-card input:focus-visible + span { box-shadow: var(--focus); }
.day-toggles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-toggle { min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.day-toggle[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.day-toggle:focus-visible, .seg-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.avail-rows { display: grid; gap: 10px; }
.avail-row { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.avail-day { font-weight: 700; text-transform: capitalize; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { min-height: 40px; min-width: 48px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.seg-btn[aria-checked="true"] { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.slot-select { max-width: 220px; }
@media (min-width: 720px) {
  .avail-row { grid-template-columns: 96px auto auto 1fr; align-items: center; }
  .slot-select { justify-self: end; }
}
.avail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.avail-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.avail-list strong { text-transform: capitalize; }
.check-list { display: grid; gap: 0; margin: 0; }
.check-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.check-row dt { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.check-row dd { margin: 0; }
.check-row dd:last-child { align-self: start; }
.fit-line { display: flex; gap: 6px; align-items: flex-start; }
.fit-line.warn { color: var(--warn); }
.day-avail { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.route-phases { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.route-phases li { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.route-phases li.current { border-color: var(--lime); background: var(--lime-dim); }
.route-phases .ph-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* Same-account coach/personal navigation. No change of authorization. */
.experience-switch { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }

/* Product headings stay compact; fields remain16px and touch targets unchanged. */
.page-head > div { min-width: 0; }
.page-head .muted { max-width: 72ch; margin-top: 4px; }
.device-code { font-size: 1.75rem; font-weight: 700; line-height: 1.3; letter-spacing: .035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; user-select: all; }
