/* Maromba: una columna de lectura, pensada primero para el celular en el gimnasio.
   Grafito frío como fondo, tiza para el texto, latón como único acento (marcas de los discos). */
:root {
  --bg: #0f1113;
  --surface: #16191c;
  --surface-2: #1d2125;
  --line: #2a2f34;
  --line-strong: #3a4046;
  --text: #e6e3dc;
  --muted: #959ba1;
  --faint: #646b72;
  --accent: #c9a45c;
  --accent-soft: rgba(201, 164, 92, 0.14);
  --accent-ink: #1b1508;
  --ok: #8dbb94;
  --ok-soft: rgba(141, 187, 148, 0.13);
  --warn: #d8957a;
  --warn-soft: rgba(216, 149, 122, 0.13);

  --neon-pink: #ff3d8b;
  --neon-teal: #2ee6d6;
  --dusk: #1c1230;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --nav-h: 64px;
  color-scheme: dark;
  --text-soft: #c8c5be;
  --nav-bg: rgba(15, 17, 19, 0.96);
  --glass: rgba(22, 25, 28, 0.94);
  --ok-text: #c9dfcc;
  --warn-text: #ecc3b2;
  --pink: #ff7fb0;
}
/* Tema claro: papel cálido, tinta grafito y el mismo latón un poco más oscuro para que contraste. */
:root[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #eeebe4;
  --line: #e3dfd6;
  --line-strong: #cdc7bb;
  --text: #1c1e21;
  --text-soft: #3d4146;
  --muted: #5c6168;
  --faint: #868b92;
  --accent: #a87a2a;
  --accent-soft: rgba(168, 122, 42, 0.12);
  --accent-ink: #ffffff;
  --ok: #2f7d43;
  --ok-soft: rgba(47, 125, 67, 0.1);
  --ok-text: #24603a;
  --warn: #b4532f;
  --warn-soft: rgba(180, 83, 47, 0.1);
  --warn-text: #8e3f22;
  --neon-teal: #0f8f84;
  --neon-pink: #d6336c;
  --pink: #c2255c;
  --nav-bg: rgba(246, 244, 239, 0.96);
  --glass: rgba(255, 255, 255, 0.94);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-height: 100%; }
body {
  margin: 0;
  /* Ocupa siempre toda la pantalla: en iPhone, una página corta dejaba la barra inferior elevada. */
  min-height: 100vh;
  min-height: 100lvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 96px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Tipografía ---------- */
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 600; letter-spacing: 0.01em; text-wrap: balance; }
h1 { font-size: 2.25rem; line-height: 1.05; text-transform: uppercase; }
h2 { font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
h3 { font-size: 1.2rem; line-height: 1.2; font-weight: 600; }
p { margin: 0; }
.eyebrow {
  font-family: var(--f-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .meta { color: var(--muted); font-size: 0.95rem; }

.back {
  align-self: flex-start;
  background: none; border: 0; padding: 4px 0;
  color: var(--muted); font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.back:hover { color: var(--text); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-weight: 600; font-size: 0.95rem;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: none; }
.btn.danger { color: var(--warn); border-color: rgba(216, 149, 122, 0.35); background: none; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Inicio ---------- */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(201, 164, 92, 0.4);
  background: var(--accent-soft);
  border-radius: var(--r-md);
}
.banner strong { font-family: var(--f-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.03em; }

.days { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.days li { border-bottom: 1px solid var(--line); }
.day-row {
  width: 100%; background: none; border: 0; text-align: left;
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 4px 14px;
  padding: 16px 4px;
}
.day-row:hover .day-name { color: var(--accent); }
.day-n { grid-row: span 2; font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; color: var(--faint); line-height: 1; text-align: center; }
.day-name { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; text-transform: uppercase; line-height: 1; }
.day-focus { color: var(--muted); font-size: 0.92rem; grid-column: 2; }
.day-side { grid-row: 1 / span 2; grid-column: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.day-last { color: var(--faint); font-size: 0.85rem; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }

.week { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.92rem; }
.week-dots { display: flex; gap: 6px; }
.week-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.week-dots i.on { background: var(--accent); }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--faint); font-size: 0.85rem; padding-top: 8px; }

/* ---------- Ejercicios ---------- */
.block-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.block-title span { color: var(--faint); font-size: 0.85rem; }
.ex-list { display: flex; flex-direction: column; gap: 12px; }

.ex {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
}
.ex-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.ex-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ex-title { display: flex; align-items: baseline; gap: 8px; }
.tag {
  flex: none;
  font-family: var(--f-display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em;
  color: var(--accent); border: 1px solid rgba(201, 164, 92, 0.45);
  border-radius: 4px; padding: 0 5px; line-height: 1.35;
}
.rx { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 0.92rem; }
.rx b { color: var(--text); font-weight: 600; }
.ex-note { color: var(--muted); font-size: 0.9rem; border-left: 2px solid var(--line-strong); padding-left: 10px; }

.thumb {
  position: relative; width: 132px; aspect-ratio: 16 / 9; max-width: 100%;
  border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line);
  background: var(--surface-2); padding: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; }
.thumb:hover img { opacity: 1; }
.thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.thumb .play span {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15, 17, 19, 0.78); border: 1px solid rgba(230, 227, 220, 0.35);
  display: grid; place-items: center;
}
.thumb .play svg { width: 12px; height: 12px; margin-left: 2px; fill: var(--text); }
.thumb.empty { display: grid; place-items: center; color: var(--faint); font-size: 0.75rem; text-align: center; padding: 6px; }

.player { display: flex; flex-direction: column; gap: 8px; }
.player .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .player-bar { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; }
.player .player-bar a, .player .player-bar button { color: var(--muted); background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }

.prev { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.88rem; color: var(--muted); }
.prev .sets-txt { color: var(--text); }

/* ---------- Bloques alternados (A1, A2…) ---------- */
.superset {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 14px;
  border: 1px solid rgba(201, 164, 92, 0.28);
  background: rgba(201, 164, 92, 0.04);
}
.superset-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 2px 4px 4px; color: var(--muted); font-size: 0.85rem; }
.superset-t { font-family: var(--f-display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.edit-link { display: flex; justify-content: center; padding-top: 4px; }

/* ---------- Registro de series ---------- */
.sets { display: flex; flex-direction: column; gap: 6px; }
.sets-h, .set {
  display: grid;
  grid-template-columns: 34px repeat(3, minmax(0, 1fr)) 48px;
  gap: 8px; align-items: center;
}
.sets-h { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 2px; }
.sets-h span:not(:first-child) { text-align: center; }
.set-n { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; color: var(--muted); text-align: center; }
.set input {
  width: 100%; min-width: 0; height: 46px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  text-align: center; font-size: 1.1rem; font-weight: 600;
}
.set input::placeholder { color: var(--faint); font-weight: 500; }
.set input:focus { border-color: var(--accent); outline: none; }
.chk {
  height: 46px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  display: grid; place-items: center;
}
.chk svg { width: 20px; height: 20px; stroke: var(--faint); fill: none; stroke-width: 2.4; }
.set.done input { border-color: rgba(141, 187, 148, 0.45); background: rgba(141, 187, 148, 0.06); }
.set.done .chk { background: var(--ok); border-color: var(--ok); }
.set.done .chk svg { stroke: #102014; }
.set.done .set-n { color: var(--ok); }
.set-tools { display: flex; gap: 16px; padding-top: 4px; }
.set-tools button { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 0.88rem; }
.set-tools button:hover { color: var(--text); }

.session-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.save-state { font-size: 0.85rem; color: var(--faint); }
.save-state.err { color: var(--warn); }

/* ---------- Formularios ---------- */
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.f input, .f select, .f textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
.f textarea { min-height: 70px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--accent); outline: none; }

.edit-grid { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
.edit-grid .f-wide { grid-column: 1 / -1; }
.edit-grid .f-quad { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.edit-grid .f-pair { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.edit-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.edit-tools .btn { min-height: 38px; padding: 0 12px; font-size: 0.88rem; }
.edit-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.sticky-actions {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  display: flex; gap: 10px; padding: 10px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sticky-actions .btn { flex: 1; }

/* ---------- Segmentado ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; align-self: flex-start; max-width: 100%; }
.seg button { background: none; border: 0; padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- Historial ---------- */
.hist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hist > li { border-bottom: 1px solid var(--line); }
.hist-row {
  width: 100%; background: none; border: 0; text-align: left;
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline;
  padding: 14px 2px;
}
.hist-date { font-size: 0.9rem; color: var(--muted); text-transform: capitalize; }
.hist-day { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; text-transform: uppercase; }
.hist-stats { grid-column: 2 / -1; color: var(--faint); font-size: 0.85rem; }
.hist-detail { padding: 0 2px 16px; display: flex; flex-direction: column; gap: 10px; }
.hist-ex { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.hist-ex .n { font-weight: 600; }
.hist-ex .s { color: var(--muted); font-size: 0.9rem; }

.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .kpis { display: flex; gap: 22px; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; }
.kpi b { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.kpi span { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* ---------- Fotos ---------- */
.compare { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.compare-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compare-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compare-imgs figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.compare-imgs figcaption { font-size: 0.85rem; color: var(--muted); }
.photo {
  width: 100%; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--faint); font-size: 0.8rem;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }

.cps { display: flex; flex-direction: column; gap: 12px; }
.cp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cp-head h3 { text-transform: uppercase; }
.cp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cp-grid figure { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-grid figcaption { font-size: 0.75rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.cp-tools { display: flex; justify-content: flex-end; }

.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; cursor: pointer; }
.slot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.slot .photo { border-style: dashed; border-color: var(--line-strong); }
.slot:focus-within .photo { border-color: var(--accent); }
.slot span { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(8, 9, 10, 0.96); display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px); }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: var(--r-sm); }
.lightbox button { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: max(12px, env(safe-area-inset-right, 0px)); }

/* ---------- Estado vacío y login ---------- */
.empty { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; color: var(--muted); }
.empty h3 { color: var(--text); }
.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-size: 2.6rem; }
.err-msg { color: var(--warn); font-size: 0.9rem; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; overflow-x: auto; white-space: pre; }

/* ---------- Navegación inferior ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.nav-inner { position: relative; max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.nav-pill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 20%;
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0.24, 1.08);
  pointer-events: none;
}
.nav-pill::before {
  content: ""; position: absolute; inset: 7px 6px;
  border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line-strong);
}
.nav button {
  position: relative; z-index: 1;
  background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  min-width: 0; padding: 0 2px;
}
.nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button[aria-current="page"] { color: var(--text); }
.nav button[aria-current="page"] svg { stroke: var(--accent); }
.nav button { transition: color 0.2s ease; }
.nav button.pop svg { animation: tab-pop 0.34s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes tab-pop { 0% { transform: scale(0.82); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.wrap.enter { animation: page-in 0.24s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .nav-pill { transition: none; }
  .nav button.pop svg, .wrap.enter { animation: none; }
}

/* ---------- Temporizador de descanso ---------- */
.timer {
  position: fixed; z-index: 30;
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 736px; margin: 0 auto;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.timer-bar { height: 3px; background: var(--accent); transform-origin: left; }
.timer-body { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.timer-time { font-family: var(--f-display); font-size: 2rem; font-weight: 600; line-height: 1; min-width: 72px; }
.timer-label { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-btns { display: flex; gap: 6px; }
.timer-btns button { min-height: 38px; min-width: 44px; padding: 0 10px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line-strong); font-weight: 600; font-size: 0.85rem; }
.timer.over { border-color: var(--ok); }
.timer.over .timer-time { color: var(--ok); }

.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 0.92rem;
  padding: 10px 16px; border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.err { background: var(--warn); }

.loading { color: var(--faint); padding: 40px 0; }

@media (min-width: 640px) {
  .thumb { width: 220px; }
  h1 { font-size: 2.75rem; }
  .edit-grid { grid-template-columns: 90px minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .thumb { width: 104px; }
  .timer-label { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .timer-bar { transition: transform 0.25s linear; }
}

/* ---------- Chips y filtros ---------- */
body.locked { overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  font-size: 0.88rem; font-weight: 600; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--accent-soft); border-color: rgba(201, 164, 92, 0.55); color: var(--accent); }
.chip.big { min-height: 44px; padding: 0 18px; font-size: 0.98rem; }
.filters { display: flex; flex-direction: column; gap: 10px; }
.mini { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.mini:hover { color: var(--text); border-color: var(--faint); }
.ex-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 2px; }

/* ---------- Base de ejercicios ---------- */
.cat-groups { display: flex; flex-direction: column; gap: 12px; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cat-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cat-row.open { border-color: var(--line-strong); }
.cat-btn { width: 100%; background: none; border: 0; text-align: left; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; }
.cat-thumb { width: 64px; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-name { font-weight: 600; line-height: 1.25; }
.cat-meta { font-size: 0.82rem; color: var(--faint); }
.cat-detail { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cat-detail .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.cat-detail iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sim { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Selector (hoja inferior) ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 45; background: rgba(6, 7, 8, 0.72);
  display: flex; align-items: flex-end; justify-content: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
}
.sheet {
  width: 100%; max-width: 760px; max-height: 100%; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: 16px 16px 0 0; overflow: hidden;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.sheet-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(16px, env(safe-area-inset-left, 0px)); }
.btn-col { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Rutinas ---------- */
.r-section { display: flex; flex-direction: column; gap: 10px; }
.r-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.r-row {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
}
.r-row:hover { border-color: var(--line-strong); }
.r-name { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; text-transform: uppercase; line-height: 1.1; }
.r-meta { flex-basis: 100%; color: var(--faint); font-size: 0.85rem; }
.r-day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.r-day-head h3 { text-transform: uppercase; }
.r-ex { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.r-ex li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: 0.95rem; }
.r-ex li .tag { justify-self: start; }
.ghost-tag { color: var(--faint); border-color: var(--line); }
.r-ex-name { min-width: 0; }
.warn-box { border-color: rgba(216, 149, 122, 0.45); background: var(--warn-soft); }

/* ---------- Coach Rocco (estética retro, solo en este bloque) ---------- */
.coach-card, .coach-hero {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 16px; border-radius: 16px;
  background: linear-gradient(160deg, var(--dusk) 0%, #120d1c 70%);
  border: 1px solid rgba(255, 61, 139, 0.35);
}
.coach-hero { grid-template-columns: 150px minmax(0, 1fr); }
.coach-art svg { width: 100%; height: auto; display: block; }
.coach-talk { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.coach-name {
  font-family: var(--f-display); font-style: italic; font-weight: 700; font-size: 1.5rem;
  text-transform: uppercase; letter-spacing: 0.04em; line-height: 1;
  color: var(--neon-pink); text-shadow: 2px 2px 0 rgba(46, 230, 214, 0.55);
}
.bubble {
  position: relative; background: #f5f1e8; color: #17121f; font-weight: 500;
  padding: 10px 14px; border-radius: 12px; max-width: 46ch;
}
.btn.neon { background: var(--neon-pink); border-color: var(--neon-pink); color: #fff; }
.btn.neon:hover { filter: brightness(1.08); }
.coach-opts { gap: 8px; }
@media (max-width: 420px) {
  .coach-card { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .coach-hero { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .coach-hero .coach-art { width: 150px; }
  .coach-name { font-size: 1.3rem; }
}

/* ---------- Entrada en calor ---------- */
.warmup {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--neon-teal);
}
.warmup.complete { opacity: 0.72; }
.warmup-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px 12px; flex-wrap: wrap; }
.warmup-h .eyebrow { color: var(--neon-teal); }
.wu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wu { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.wu:first-child { border-top: 0; padding-top: 0; }
.wu-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.wu-thumb { position: relative; width: 56px; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); border: 0; padding: 0; display: block; }
.wu-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.wu-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; }
.wu-thumb .play span { width: 22px; height: 22px; border-radius: 50%; background: rgba(15, 17, 19, 0.78); display: grid; place-items: center; }
.wu-thumb .play svg { width: 8px; height: 8px; margin-left: 1px; fill: var(--text); }
.wu-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wu-name { font-weight: 600; line-height: 1.25; }
.wu-dose { font-size: 0.85rem; color: var(--muted); }
.rounds { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.round-row { display: flex; gap: 8px; }
.round {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--bg);
  font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; color: var(--muted);
}
.round.on { background: var(--neon-teal); border-color: var(--neon-teal); color: #0b1f1d; }
.warm-tag { color: var(--neon-teal); border-color: rgba(46, 230, 214, 0.5); }

/* ===== Casa o gimnasio ===== */
.place-grid { display: grid; gap: 12px; margin-top: 4px; }
.place-card {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px;
  text-align: left; width: 100%; padding: 20px 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.place-card:hover { border-color: var(--line-strong); }
.place-card:active { transform: scale(0.99); background: var(--accent-soft); border-color: rgba(201, 164, 92, 0.55); }
.place-k { font-family: var(--f-display); font-size: 1.05rem; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.place-t { font-family: var(--f-display); font-size: 1.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.place-d { color: var(--muted); font-size: 0.93rem; }
.gear-sum { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gear-sum p { margin: 0; }

.place-bar { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 0.86rem; padding: 6px 16px; border-radius: 999px; min-height: 32px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.pill.home { background: var(--accent-soft); color: var(--accent); }

.gear-grp { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gear-grp legend { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .06em; font-size: 0.8rem; color: var(--faint); padding: 8px 0 4px; }
.tg { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; border-bottom: 1px solid var(--line); }
.gear-grp .tg:last-child { border-bottom: 0; }
.filters .tg { border-bottom: 0; min-height: 36px; font-size: 0.92rem; color: var(--muted); }
.tg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg-ui { flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s ease; }
.tg-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .15s ease; }
.tg input:checked + .tg-ui { background: var(--accent); }
.tg input:checked + .tg-ui::after { transform: translateX(16px); background: var(--accent-ink); }
.tg input:focus-visible + .tg-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill.home { text-transform: none; letter-spacing: 0; font-size: 0.78rem; }
.ex-tools { flex-wrap: wrap; }

/* ===== Calendario ===== */
.cal { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 14px 12px 12px; margin-bottom: 14px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-h h2 { margin: 0; font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cal-h h2 span { color: var(--faint); }
.cal-nav { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.cal-nav:hover:not(:disabled) { color: var(--text); border-color: var(--faint); }
.cal-nav:disabled { opacity: .3; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-w { text-align: center; font-family: var(--f-display); font-size: .75rem; letter-spacing: .08em; color: var(--faint); padding-bottom: 4px; }
.cal-c { position: relative; min-height: 46px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; padding: 5px 1px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font: inherit; overflow: hidden; }
.cal-c.empty { visibility: hidden; }
.cal-c.future .cal-d { color: var(--faint); }
.cal-d { font-size: .88rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cal-c.today { border-color: var(--line-strong); }
.cal-c.today .cal-d { color: var(--text); font-weight: 700; }
.cal-c.on { background: var(--accent-soft); border-color: rgba(201, 164, 92, 0.45); cursor: pointer; }
.cal-c.on .cal-d { color: var(--accent); font-weight: 700; }
.cal-c.live { border-style: dashed; }
.cal-t { max-width: 100%; font-family: var(--f-display); font-size: .68rem; font-weight: 600; letter-spacing: 0; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.cal-home { position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--neon-teal); }
.cal-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.cal-f b { color: var(--text); }
.cal-key { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--faint); }
.cal-key .cal-home { position: static; }
.cal-more { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; color: var(--muted); font-size: .82rem; font-weight: 600; min-height: 32px; }
.cal-more:hover { color: var(--text); border-color: var(--faint); }
.cal-less { display: block; margin: 12px auto 0; }
.cal:not(.open) .cal-h { margin-bottom: 8px; }

/* Calendario compacto */
.cal { padding: 10px 10px 8px; margin-bottom: 10px; }
.cal-h { margin-bottom: 4px; }
.cal:not(.open) .cal-h { margin-bottom: 2px; }
.cal-h h2 { font-size: 1rem; }
.cal-nav { width: 28px; height: 28px; font-size: 1.05rem; }
.cal-more { padding: 2px 10px; min-height: 26px; font-size: .75rem; }
.cal-less { margin-top: 8px; }
.cal-g { gap: 3px; }
.cal-w { font-size: .66rem; padding-bottom: 1px; }
.cal-c { min-height: 34px; padding: 3px 1px 2px; gap: 0; }
.cal-d { font-size: .8rem; }
.cal-t { font-size: .6rem; }
.cal-home { top: 3px; right: 3px; width: 4px; height: 4px; }
.cal-f { margin-top: 8px; padding-top: 7px; font-size: .8rem; gap: 4px 14px; }
.cal-key { font-size: .72rem; }

/* ================= Rediseño v2 ================= */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tiny { font-size: 0.78rem; }
.ok-t { color: var(--ok); }
.warn-t { color: var(--warn); }
.center-t { text-align: center; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.btn.big { min-height: 52px; font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 12px; }
.btn-row.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.wide { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; align-self: stretch; }
.seg.wide button { min-height: 40px; }
.h-sec { font-size: 1.05rem; }
.h-sm { font-family: var(--f-body); font-size: 0.98rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.sum-sec { display: flex; flex-direction: column; gap: 10px; }
.chip.static { cursor: default; min-height: 26px; padding: 0 10px; font-size: 0.78rem; background: var(--surface-2); border-color: transparent; color: var(--muted); }

/* Inicio */
.today-date { color: var(--muted); font-size: 0.92rem; margin-bottom: -8px; }
.rt { display: flex; flex-direction: column; gap: 8px; }
.rt-top { display: flex; justify-content: space-between; align-items: baseline; }
.rt-name { font-size: 2.3rem; }
.rt-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.rt-weeks i { height: 5px; border-radius: 3px; background: var(--line); }
.rt-weeks i.on { background: var(--accent); }
.rt-weeks i.cur { background: var(--accent); opacity: 0.5; }
.rt .meta b { color: var(--text); font-weight: 600; }
.today { background: var(--surface); border: 1px solid rgba(201, 164, 92, 0.5); border-radius: 14px; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.today h2 { font-size: 2.9rem; line-height: 0.95; font-weight: 700; }
.today .link { align-self: flex-start; }
.t-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.t-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.t-ex { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-name { font-weight: 500; }
.t-rx, .t-last span { font-size: 0.82rem; color: var(--muted); }
.t-last { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex: none; }
.t-last b { font-size: 0.85rem; color: var(--muted); }
.t-last b.ok { color: var(--ok); }
.t-last b.warn { color: var(--warn); }
.t-place { display: flex; flex-direction: column; gap: 8px; }
.today.live { border-color: var(--ok); }
.sess-prog { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sess-prog .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sess-prog .bar i { display: block; height: 100%; background: var(--accent); transition: width 0.25s ease; }
.sess-prog span { font-size: 0.85rem; color: var(--muted); }
.days.compact .day-row { padding: 12px 4px; grid-template-columns: 40px 1fr auto; }
.days.compact .day-name { font-size: 1.35rem; }
.days.compact .day-n { font-size: 1.2rem; }
.start-opts { display: flex; flex-direction: column; gap: 10px; }
.start-opt { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: none; color: var(--text); }
.start-opt.hl { border-color: rgba(201, 164, 92, 0.6); background: var(--accent-soft); }
.so-t { font-weight: 600; font-size: 1.02rem; }
.so-d { grid-column: 1; font-size: 0.86rem; color: var(--muted); }
.so-go { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--muted); font-size: 1.2rem; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }

/* Sesión */
.sug { font-size: 0.88rem; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.sug.ok { background: var(--ok-soft); color: var(--ok-text); }
.sug.warn { background: var(--warn-soft); color: var(--warn-text); }
.cardio-set { grid-template-columns: 52px minmax(0, 1fr) 44px !important; }

/* Resumen */
.stats4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 0.8rem; color: var(--muted); }
.stat b { font-family: var(--f-display); font-size: 1.9rem; font-weight: 700; line-height: 1.05; }
.stat small { font-size: 0.78rem; color: var(--muted); }
.stat small.up, .cmp b.up { color: var(--ok); }
.stat small.down, .cmp b.down { color: var(--warn); }
.pr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(201, 164, 92, 0.5); background: var(--accent-soft); }
.pr span { display: flex; flex-direction: column; }
.pr small { font-size: 0.8rem; color: var(--muted); }
.pr strong { font-family: var(--f-display); font-size: 1.4rem; color: var(--accent); white-space: nowrap; }
.cmp { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cmp li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cmp b { font-weight: 600; color: var(--muted); white-space: nowrap; }
.feel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.feel button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: none; color: var(--muted); font-weight: 600; font-size: 0.8rem; padding: 0 2px; }
.feel button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sum-end { display: flex; flex-direction: column; gap: 10px; }

/* Lobby */
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.players.solo { grid-template-columns: minmax(0, 220px); }
.pl { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pl.lead { border-color: var(--c); }
.pl-rank { position: absolute; top: 10px; right: 10px; font-family: var(--f-display); font-size: 0.8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.pl.lead .pl-rank { background: var(--c); border-color: var(--c); color: #14161a; }
.pl-av { position: relative; background: none; border: 0; padding: 0; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pl-edit { font-size: 0.72rem; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.av { display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, #14161a); overflow: hidden; color: var(--c); font-family: var(--f-display); font-weight: 700; font-size: 1.8rem; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.pl-name { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; line-height: 1; }
.pl-n { font-family: var(--f-display); font-size: 2.8rem; font-weight: 700; line-height: 0.9; color: var(--c); }
.pl-l { font-size: 0.78rem; color: var(--muted); }
.live-pill { background: var(--ok-soft); color: var(--ok); }
.sheet-t { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.sheet-t th { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.sheet-t thead th:first-child { width: 64px; }
.sheet-t thead th:last-child { width: 34px; }
.sheet-t tbody th { text-align: left; font-family: var(--f-display); font-size: 0.98rem; font-weight: 700; text-transform: uppercase; color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-t td { height: 38px; border-radius: 6px; text-align: center; font-family: var(--f-display); font-size: 0.8rem; font-weight: 700; }
.sheet-t td.hit { background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid var(--c); color: var(--c); }
.sheet-t td.miss { background: var(--surface); border: 1px solid var(--line); }
.sheet-t td.fut { border: 1px dashed var(--line-strong); }
.sheet-t td.tot { font-size: 1.3rem; color: var(--text); }
.sheet-t + * { margin-top: 0; }
.table-wrap:has(.sheet-t) { border: 0; }
.tallies { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; }
.ty-name { font-family: var(--f-display); font-size: 1rem; font-weight: 700; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-marks svg { display: block; max-width: 100%; height: auto; }
.cmp-t { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cmp-t th, .cmp-t td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.cmp-t th:first-child { text-align: left; font-weight: 500; }
.cmp-t thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-t td { font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; color: var(--text-soft); }
.invite { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.code-big { font-family: var(--f-display); font-size: 2.4rem; font-weight: 700; letter-spacing: 0.18em; color: var(--accent); }
.team-form { margin-top: 4px; }
.av-prev { align-self: center; width: 200px; height: 200px; border-radius: 50%; overflow: hidden; border: 2px solid var(--accent); }
.av-prev img { width: 100%; height: 100%; object-fit: cover; }

/* Rutinas */
.inuse { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.inuse b { font-family: var(--f-display); font-size: 1.35rem; text-transform: uppercase; grid-column: 1; }
.inuse .small { grid-column: 1; }
.inuse .so-go { grid-row: 1 / span 3; }
.reco-card { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(201, 164, 92, 0.55); color: var(--text); }
.rc-top { display: flex; justify-content: space-between; align-items: baseline; }
.rc-t { font-family: var(--f-display); font-size: 1.7rem; line-height: 1.05; font-weight: 700; text-transform: uppercase; }
.rc-d { font-size: 0.9rem; color: var(--muted); line-height: 1.4; }
.rc-go { align-self: flex-start; margin-top: 4px; padding: 10px 18px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-family: var(--f-display); font-size: 1.1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.mk-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; min-height: 60px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: none; color: var(--text); }
.mk-btn > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.builder { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); }
.b-head { display: flex; justify-content: space-between; align-items: baseline; }
.b-name-in, .b-dayrow input { min-height: 44px; box-sizing: border-box; width: 100%; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); padding: 0 12px; font-family: var(--f-display); font-size: 1.25rem; font-weight: 700; text-transform: uppercase; }
.b-dayrow { display: flex; gap: 10px; align-items: center; }
.b-dayrow input { font-family: var(--f-body); font-size: 1rem; font-weight: 500; text-transform: none; min-height: 40px; }
.b-name-in:focus, .b-dayrow input:focus { border-color: var(--accent); outline: none; }
.danger-t { color: var(--warn); white-space: nowrap; }
.b-days { display: flex; gap: 6px; flex-wrap: wrap; }
.b-days button { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.b-days button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.b-days button.add { border-style: dashed; }
.b-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.b-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.b-ex-name { min-width: 0; }
.b-x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 1.1rem; }
.b-search { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.search-in { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); }
.search-in svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-in input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.search-in:focus-within { border-color: var(--accent); }
.b-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.b-filters select { min-height: 34px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); padding: 0 10px; font: inherit; font-size: 0.85rem; max-width: 150px; }
.chk-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.chk-chip input { accent-color: var(--accent); margin: 0; }
.chk-chip:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.b-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.b-item { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 10px; }
.b-item.open { border-color: var(--accent); }
.b-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.b-thumb { position: relative; width: 104px; height: 58px; border-radius: 8px; border: 0; padding: 0; overflow: hidden; background: var(--surface-2); }
.b-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; }
.b-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; }
.b-thumb .play span { width: 28px; height: 28px; border-radius: 50%; background: rgba(15, 17, 19, 0.75); display: grid; place-items: center; }
.b-thumb .play svg { width: 10px; height: 10px; fill: var(--text); margin-left: 2px; }
.b-thumb.none { display: block; }
.b-row:has(.b-thumb) .b-txt { grid-column: 2; }
.b-row:not(:has(.b-thumb)) { grid-template-columns: minmax(0, 1fr) auto; }
.b-txt { background: none; border: 0; padding: 0; text-align: left; color: var(--text); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.b-name { font-weight: 600; font-size: 0.95rem; }
.b-meta { font-size: 0.78rem; color: var(--muted); }
.b-plus { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: none; color: var(--text); font-size: 1.3rem; }
.b-frame { display: flex; flex-direction: column; gap: 4px; }
.b-frame iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }
.b-frame .link { align-self: flex-end; }
.b-cfg { display: grid; grid-template-columns: 70px 1fr 1.4fr; gap: 8px; align-items: end; }
.b-cfg .btn { grid-column: 1 / -1; }
.tpls summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
.tpls[open] summary { margin-bottom: 8px; }

/* Recomendador */
.steps { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin: 4px 0; }
.steps i { height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--accent); }
.q-t { font-size: 2.1rem; }
.r-body { display: flex; flex-direction: column; gap: 12px; }
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: none; color: var(--text); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt-t { font-weight: 600; }
.opt-d { font-size: 0.85rem; color: var(--muted); }
.fs { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.f-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.unit-in { display: flex; align-items: center; gap: 4px; min-height: 46px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 0.85rem; }
.unit-in input { width: 100%; min-width: 0; border: 0 !important; background: none !important; padding: 0 !important; font-size: 1.1rem !important; font-weight: 600; color: var(--text); outline: none; }
.unit-in:focus-within { border-color: var(--accent); }
.know { background: var(--surface); border: 1px solid rgba(201, 164, 92, 0.45); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; line-height: 1.45; color: var(--text-soft); }
.know b { color: var(--text); font-weight: 600; }
.know-lead { font-size: 1.1rem; color: var(--text); }
.know-imc { display: flex; justify-content: space-between; align-items: center; }
.know-imc > div { display: flex; flex-direction: column; }
.know-imc > b { font-family: var(--f-display); font-size: 3rem; line-height: 1; }
.imc-cat { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; text-transform: uppercase; }
.imc-cat.ok { color: var(--ok); }
.imc-cat.warn { color: var(--warn); }
.imc-scale { display: flex; flex-direction: column; gap: 4px; }
.imc-bar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6f8fb0 0 14%, var(--ok) 14% 40%, #d8b25a 40% 60%, var(--warn) 60%); }
.imc-bar i { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.imc-ticks { position: relative; height: 14px; font-size: 0.7rem; color: var(--muted); }
.imc-ticks span { position: absolute; transform: translateX(-50%); }
.read { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 0.93rem; line-height: 1.45; color: var(--text-soft); }
.kcal { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(201, 164, 92, 0.55); background: var(--accent-soft); }
.kcal > span { display: flex; flex-direction: column; }
.kcal b { font-family: var(--f-display); font-size: 2.2rem; color: var(--accent); }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mac { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.mac span, .mac small { font-size: 0.75rem; color: var(--muted); }
.mac b { font-family: var(--f-display); font-size: 1.6rem; }
.mac-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; }
.mac-bar i:nth-child(1) { background: var(--accent); }
.mac-bar i:nth-child(2) { background: #8a7444; }
.mac-bar i:nth-child(3) { background: #4d4330; }
.r-dcard { border: 1px solid var(--line); border-radius: 12px; }
.r-dcard.open { border-color: var(--line-strong); }
.r-dhead { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: none; border: 0; color: var(--text); text-align: left; font-size: 0.95rem; }
.r-dbody { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.blk { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; }
.blk-t { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.b-warm .blk-t { color: var(--neon-teal); }
.b-abs .blk-t { color: var(--ok); }
.b-cardio .blk-t { color: var(--warn); }
.blk-row { display: flex; justify-content: space-between; gap: 10px; }
.blk-txt { color: var(--text-soft); }
.why { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; color: var(--text-soft); line-height: 1.4; }

/* Progreso */
.const { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.const > div { display: flex; flex-direction: column; }
.const b { font-family: var(--f-display); font-size: 1.4rem; }
.const strong { font-family: var(--f-display); font-size: 2rem; }
.mu { display: grid; grid-template-columns: 92px 1fr 28px; gap: 10px 10px; align-items: center; font-size: 0.9rem; }
.mu-bar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-2); }
.mu-range { position: absolute; top: 0; bottom: 0; background: var(--ok-soft); }
.mu-bar i { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 3px; background: var(--accent); }
.mu-bar i.low { background: var(--warn); }
.mu b { text-align: right; }
.mu b.low { color: var(--warn); }
.block-title + .days { border-top: 0; }
.sheet-t thead th:first-child { width: 78px; }
.sheet-t tbody th { font-size: 0.9rem; }

/* ================= v3: seis pestañas, Plan, Cuerpo, Nutrición ================= */
.nav-inner { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nav-pill { width: calc(100% / 6); }
.nav-pill::before { inset: 7px 3px; }
.nav button { font-size: 0.6rem; letter-spacing: 0.02em; gap: 4px; }
.nav svg { width: 21px; height: 21px; }
.wk-tag { font-size: 0.86rem; color: var(--accent); }
.rt { gap: 6px; }

/* Plan */
.wk-now { background: var(--surface); border: 1px solid rgba(201, 164, 92, 0.5); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.wk-now h2 { font-size: 2rem; font-weight: 700; }
.wk-now > p:not(.eyebrow) { color: var(--text-soft); font-size: 0.93rem; line-height: 1.45; }
.wk-rir { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.wk-rir span { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.wk-rir small { font-size: 0.72rem; color: var(--muted); }
.wk-rir b { font-family: var(--f-display); font-size: 1.4rem; }
.pweeks, .rot { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pw { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.pw-n { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; color: var(--faint); text-align: center; }
.pw-main { display: flex; flex-direction: column; min-width: 0; }
.pw-main b { font-weight: 600; }
.pw-side { display: flex; align-items: center; gap: 8px; }
.pw.cur { background: var(--accent-soft); border-radius: 8px; border-bottom-color: transparent; }
.pw.cur .pw-n { color: var(--accent); }
.pw.past .pw-main b { color: var(--muted); }
.pw.dl .pw-main b { color: var(--neon-teal); }
.rot li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.rot-n { font-family: var(--f-display); font-weight: 700; color: var(--faint); text-align: center; }
.rot-name { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; text-transform: uppercase; }

/* Cuerpo */
.prof { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.prof > span { display: flex; flex-direction: column; }
.prof-form, .bform { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); }
.bf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.bf-f small { font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.body-t th, .body-t td { padding: 8px 8px; }
.body-t td:first-child { text-transform: capitalize; }

/* Nutrición */
.nut-t th[scope="row"] { font-size: 0.92rem; letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 500; background: none; }
.nut-t td b { font-family: var(--f-display); font-size: 1.2rem; }
.veg { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); border: 1px solid rgba(141, 187, 148, 0.35); }
.veg b { color: var(--ok); font-weight: 600; }
.wrap > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.nut-t th, .nut-t td { padding: 9px 8px; }
.nut-t td b { font-size: 1.1rem; }
.sum-sec > *, .table-wrap { min-width: 0; }
.table-wrap { position: relative; }

/* ================= v4: carga rápida de series ================= */
.cell {
  width: 100%; min-width: 0; height: 46px; padding: 0 2px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 1.1rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums;
}
.cell.plan { color: var(--muted); border-style: dashed; }
.cell.open { border-color: var(--accent); border-style: solid; color: var(--accent); }
.cell.none { border: 0; background: none; height: 46px; }
.set.done .cell:not(.none) { border-color: rgba(141, 187, 148, 0.45); background: rgba(141, 187, 148, 0.06); color: var(--text); border-style: solid; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 6px 42px; }
.pchip {
  min-width: 48px; min-height: 40px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums;
}
.pchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pchip.ghost { background: none; color: var(--muted); }
.pick-in {
  width: 96px; min-height: 40px; padding: 0 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--accent); text-align: center; font-size: 1rem; font-weight: 600;
}
.pick-in:focus { outline: none; }
@media (max-width: 380px) { .pick-row { padding-left: 0; } }

/* ================= v5 ================= */
.accs { display: flex; flex-direction: column; gap: 10px; }
.acc { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); overflow: hidden; }
.acc.open { border-color: rgba(201, 164, 92, 0.55); }
.acc-h { width: 100%; min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; color: var(--text); text-align: left; }
.acc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-t b { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.1; }
.acc-i { color: var(--muted); font-size: 0.9rem; flex: none; }
.acc-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.acc .builder { border: 0; padding: 0; background: none; }
.acc .b-head { display: none; }
.acc .r-row { background: var(--bg); }
.pill.pink { background: rgba(255, 61, 139, 0.14); color: var(--pink); text-transform: none; letter-spacing: 0; }
.link-chip { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--line-strong); background: var(--bg); color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.link-chip.on { border-style: solid; border-color: rgba(201, 164, 92, 0.6); color: var(--accent); }
.b-list li.b-link { display: flex; justify-content: center; border-bottom: 0; padding: 2px 0; grid-template-columns: none; }
.ed-link { display: flex; justify-content: center; margin: -4px 0; }
.const-r { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.const-r strong { font-family: var(--f-display); font-size: 2rem; line-height: 1; }
.remind { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(46, 230, 214, 0.45); background: rgba(46, 230, 214, 0.07); }
.remind > span { display: flex; flex-direction: column; }
.remind .btn { min-height: 38px; flex: none; }
.pins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pin { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pin.open { border-color: var(--line-strong); }
.pin-h { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 96px 58px; gap: 10px; align-items: center; padding: 12px 14px; background: none; border: 0; color: var(--text); text-align: left; }
.pin-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pin-t b { font-weight: 600; line-height: 1.25; }
.pin-d { text-align: right; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.pin-d.up { color: var(--ok); }
.pin-d.down { color: var(--warn); }
.mini-sp { width: 96px; height: 32px; display: block; }
.mini-sp.none { height: 32px; }
.pin-b { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pin-pick { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; }
.gap-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); vertical-align: middle; }
.foods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.food { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; }
.food-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.food-t b { font-weight: 600; }
.food-plus { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 1.2rem; color: var(--accent); }
.plate { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pl-it { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.pl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pl-ctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pl-g { width: 110px; min-height: 40px; }
.mini-seg button { padding: 4px 12px; min-height: 30px; font-size: 0.82rem; }
.pl-tot { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid rgba(201, 164, 92, 0.55); background: var(--accent-soft); }
.pl-tot .row b:last-child { font-family: var(--f-display); font-size: 1.6rem; color: var(--accent); }
.pl-tot .mac { background: var(--bg); }
.nut-t th small { display: block; font-size: 0.7rem; font-weight: 400; color: var(--faint); text-transform: none; letter-spacing: 0; white-space: normal; }
.how p { margin: 0; }

/* ================= v6: perfil ================= */
.wrap { position: relative; }
.me-btn { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--accent); font-family: var(--f-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.02em; display: grid; place-items: center; overflow: hidden; padding: 0; }
.me-btn img, .me-big img { width: 100%; height: 100%; object-fit: cover; }
.wrap.has-me > :nth-child(2) { padding-right: 52px; }
.wrap.has-me > :nth-child(2).remind, .wrap.has-me > :nth-child(2).today, .wrap.has-me > :nth-child(2).acc { margin-right: 52px; padding-right: 14px; }
.me-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.me-big { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--accent); color: var(--accent); font-family: var(--f-display); font-size: 2.6rem; font-weight: 700; cursor: pointer; }
.me-act { display: flex; gap: 14px; align-items: center; }
:root[data-theme="light"] .thumb .play span, :root[data-theme="light"] .wu-thumb .play span, :root[data-theme="light"] .b-thumb .play span { background: rgba(255, 255, 255, 0.85); }
:root[data-theme="light"] .thumb .play svg, :root[data-theme="light"] .wu-thumb .play svg, :root[data-theme="light"] .b-thumb .play svg { fill: #1c1e21; }
:root[data-theme="light"] .btn.primary, :root[data-theme="light"] .seg button.on, :root[data-theme="light"] .rc-go, :root[data-theme="light"] .pchip.on { color: #ffffff; }
:root[data-theme="light"] .toast { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
:root[data-theme="light"] .timer { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.lang-sw { display: flex; justify-content: center; gap: 10px; color: var(--faint); }
.lang-sw .link { color: var(--muted); text-decoration: none; font-weight: 500; }
.lang-sw .link.on { color: var(--accent); text-decoration: underline; }

/* v7: leyenda de etiquetas en la rutina y recorte de la foto de perfil */
.ca-tag { color: var(--pink); border-color: var(--pink); }
.tag-legend { list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: 0.82rem; color: var(--muted); }
.tag-legend li { display: flex; align-items: center; gap: 6px; }
.tag-legend .tag { font-size: 0.72rem; }
.crop-ov { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 16px; }
.crop-box { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.crop-box h3 { margin: 0; font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.4rem; }
.crop-box p { margin: 0; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-pic { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55); border: 2px solid var(--accent); pointer-events: none; z-index: 1; }
.crop-zoom { width: 100%; accent-color: var(--accent); }
.crop-btns { display: flex; justify-content: flex-end; gap: 10px; }
