/* ============================================================
   Sistema Vitrubiano · App de entrenamiento
   Los colores de marca se sobrescriben desde js/brand.js
   ============================================================ */
:root {
  --bg: #070708;
  --bg-2: #0b0b0d;
  --surface: #111114;
  --surface-2: #16161a;
  --surface-3: #1f1f25;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.22);
  --text: #f5f5f4;
  --muted: #a3a3aa;
  --dim: #6b6b73;
  --red: #e3121b;
  --red-2: #ff3b30;
  --red-ink: #ff6b63;
  --red-deep: #6f070d;
  --red-soft: rgba(227, 18, 27, 0.14);
  --red-line: rgba(227, 18, 27, 0.45);
  --radius: 18px;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --brand: 'Michroma', 'Inter', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --side-w: 264px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(227, 18, 27, 0.13), transparent 62%),
    radial-gradient(700px 420px at -12% 112%, rgba(227, 18, 27, 0.07), transparent 60%);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.red { color: var(--red-ink); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Arranque ---------- */
.boot { min-height: 80dvh; display: grid; place-items: center; }
.boot img { width: 120px; opacity: 0.9; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); opacity: 0.6; } }

/* ---------- Estructura ---------- */
.shell { position: relative; z-index: 1; min-height: 100dvh; }
.main {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 32px);
}
.page { animation: pageIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.bare .sidebar, body.bare .tabbar { display: none !important; }
body.bare .main { max-width: none; margin: 0; padding: 0; }

/* Barra superior (móvil) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -16px 4px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: linear-gradient(var(--bg) 55%, rgba(7, 7, 8, 0));
}
.brand-mini { display: flex; align-items: center; gap: 10px; }
.brand-mini img { width: 36px; height: 36px; }
.wm { font-family: var(--brand); font-size: 9.5px; letter-spacing: 0.16em; line-height: 1.35; text-transform: uppercase; color: var(--muted); }
.wm b { display: block; font-weight: 400; color: var(--text); font-size: 11px; }
.spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #2a0b0e, #141417);
  border: 1px solid rgba(227, 18, 27, 0.4);
  font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
}
.sync {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
}
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.sync.ok i { background: var(--red-2); box-shadow: 0 0 8px var(--red-2); }
.sync.busy i { background: var(--red-2); animation: blink 0.9s infinite; }
.sync.err i { background: #777; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Barra de pestañas (móvil) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 4px 6px var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(9, 9, 11, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; font-size: 10.5px; font-weight: 650; color: var(--dim); }
.tab .ico { width: 22px; height: 22px; }
.tab.on { color: var(--text); }
.tab.on .ico { color: var(--red-2); }
.tab-fab {
  justify-self: center; position: relative;
  width: 60px; height: 60px; margin-top: -28px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 32% 26%, #ff5a4f, var(--red) 55%, #9e0b12);
  box-shadow: 0 12px 30px -6px rgba(227, 18, 27, 0.75), 0 0 0 6px var(--bg);
}
.tab-fab .ico { width: 26px; height: 26px; stroke-width: 2.3; }
.tab-fab.live::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--red-2); animation: ring 1.8s ease-out infinite;
}
.tab-fab small { position: absolute; bottom: -17px; font-size: 10px; font-weight: 800; color: var(--red-ink); font-variant-numeric: tabular-nums; }
@keyframes ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }
body.in-workout .tabbar { display: none; }
body.in-workout .main { padding-bottom: calc(var(--safe-b) + 110px); }

/* Barra lateral (escritorio) */
.sidebar {
  display: none;
  position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--side-w);
  flex-direction: column; padding: 26px 18px 18px;
  background: linear-gradient(180deg, #0d0d10, #08080a);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 24px; }
.side-brand img { width: 54px; height: 54px; filter: drop-shadow(0 0 14px rgba(227, 18, 27, 0.35)); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label { font-family: var(--brand); font-size: 9px; letter-spacing: 0.2em; color: var(--dim); padding: 16px 12px 8px; text-transform: uppercase; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 650; font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.on { color: var(--text); background: linear-gradient(90deg, rgba(227, 18, 27, 0.18), rgba(227, 18, 27, 0.02)); }
.side-link.on::before { content: ''; position: absolute; left: -18px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red-2); }
.side-link.on .ico { color: var(--red-2); }
.side-link .badge { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.side-cta { margin: 18px 0 6px; }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.side-user .grow { min-width: 0; flex: 1; }
.side-user .t { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 1024px) {
  .topbar, .tabbar { display: none !important; }
  .sidebar { display: flex; }
  .main { margin-left: var(--side-w); max-width: none; padding: 34px 44px 60px; }
  body.in-workout .main { padding-bottom: 120px; }
  .page { max-width: 1240px; margin: 0 auto; }
  .page.narrow { max-width: 760px; }
}

/* ---------- Tipografía ---------- */
.kicker { font-family: var(--brand); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red-ink); }
.h1 { margin: 6px 0 0; font-size: 30px; line-height: 1.04; font-weight: 850; letter-spacing: -0.035em; }
.h2 { margin: 0; font-size: 17px; font-weight: 780; letter-spacing: -0.02em; }
.sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
@media (min-width: 1024px) { .h1 { font-size: 40px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 16px; margin: 6px 0 18px; }
.page-head > div:first-child { flex: 1 1 280px; min-width: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.link { color: var(--red-ink); font-weight: 650; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }
.link .ico { width: 16px; height: 16px; }

/* ---------- Tarjetas ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title .sub { margin: 2px 0 0; font-size: 12.5px; }
.card + .card { margin-top: 12px; }

/* Tarjeta principal: siguiente entreno */
.hero {
  overflow: hidden; padding: 20px;
  border-color: rgba(227, 18, 27, 0.38);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(227, 18, 27, 0.34), rgba(227, 18, 27, 0) 56%),
    linear-gradient(180deg, #180a0c, #0f0f12);
  box-shadow: 0 30px 60px -40px rgba(227, 18, 27, 0.7);
}
.hero .art { position: absolute; right: -56px; top: -50px; width: 250px; height: 250px; color: var(--red-2); opacity: 0.2; pointer-events: none; }
.hero-title { position: relative; font-size: 32px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; margin-top: 10px; }
.hero-meta { position: relative; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero-list { position: relative; margin: 18px 0; display: grid; gap: 2px; }
.hero-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px dashed rgba(255, 255, 255, 0.08); font-size: 14px; }
.hero-row:first-child { border-top: 0; }
.hero-row .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hero-row .v { color: var(--muted); white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.hero-row .v.up { color: var(--red-ink); font-weight: 700; }
.hero-actions { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 10px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 14px;
  font-weight: 750; font-size: 15px; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.12s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ff2d24, var(--red) 58%, #c00c14);
  box-shadow: 0 12px 28px -12px rgba(227, 18, 27, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { box-shadow: 0 16px 34px -12px rgba(227, 18, 27, 1), inset 0 1px 0 rgba(255, 255, 255, 0.26); }
.btn-ghost { background: var(--surface-3); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: #26262d; }
.btn-outline { border: 1px solid var(--red-line); color: var(--red-ink); background: rgba(227, 18, 27, 0.06); }
.btn-outline:hover { background: rgba(227, 18, 27, 0.12); }
.btn-danger { color: var(--red-ink); background: rgba(227, 18, 27, 0.1); border: 1px solid rgba(227, 18, 27, 0.3); }
.btn-text { height: auto; padding: 8px 6px; color: var(--muted); font-weight: 650; }
.btn-text:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.btn-lg { height: 56px; border-radius: 16px; font-size: 16px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-icon.sm { width: 34px; height: 34px; border-radius: 10px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ---------- Etiquetas y chips ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.tag .ico { width: 13px; height: 13px; }
.tag.red { background: var(--red-soft); border-color: rgba(227, 18, 27, 0.32); color: var(--red-ink); }
.tag.solid { background: var(--red); border-color: var(--red); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 650; font-size: 13px; color: var(--muted);
}
.chip.on { background: var(--red-soft); border-color: var(--red); color: #fff; }

/* Control segmentado */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg > * { flex: 1; height: 36px; display: grid; place-items: center; border-radius: 10px; font-weight: 680; font-size: 13.5px; color: var(--muted); }
.seg .on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- Cifras ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } .dash .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 14px; }
.stat .lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.stat .lbl .ico { width: 15px; height: 15px; color: var(--red-ink); }
.stat .val { margin-top: 8px; font-size: 27px; font-weight: 850; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .val small { margin-left: 3px; font-size: 13px; font-weight: 650; letter-spacing: 0; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; margin-top: 7px; font-size: 12px; font-weight: 750; color: var(--dim); }
.delta .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.delta.up { color: var(--red-ink); }

/* Semana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11px; font-weight: 750; color: var(--dim); }
.wd i {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-style: normal; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line-2); background: var(--bg-2);
}
.wd.done i { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 0 18px -3px rgba(227, 18, 27, 0.8); }
.wd.today { color: var(--text); }
.wd.today i { border-color: #fff; }
.wd.done.today i { border-color: #fff; }
.week-note { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--red-deep), var(--red-2)); }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 680; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .end b { display: block; color: var(--text); font-size: 14px; }
.row.tap { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 12px; transition: background 0.15s; }
.row.tap:hover { background: rgba(255, 255, 255, 0.03); }
.row.tap + .row.tap { border-top-color: var(--line); }
.row .chev { color: var(--dim); }
.ibox {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line);
}
.ibox.red { background: var(--red-soft); color: var(--red-ink); border-color: rgba(227, 18, 27, 0.3); }
.ibox.solid { background: var(--red); color: #fff; border-color: var(--red); }
.ibox .ico { width: 19px; height: 19px; }

/* Estado de sobrecarga */
.ov { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; }
.ov .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.ov.up { background: var(--red); color: #fff; box-shadow: 0 0 14px -3px rgba(227, 18, 27, 0.8); }
.ov.hold { background: var(--red-soft); color: var(--red-ink); }
.ov.down { background: var(--surface-3); color: var(--muted); }
.ov.new { background: var(--surface-3); color: var(--dim); }

/* ---------- Rutina ---------- */
.routine-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1024px) { .routine-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); align-items: start; } }
.day-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.day-head .grow { flex: 1; min-width: 0; }
.day-num { display: flex; align-items: center; gap: 8px; font-family: var(--brand); font-size: 9.5px; letter-spacing: 0.18em; color: var(--red-ink); text-transform: uppercase; }
.day-name { margin-top: 6px; font-size: 21px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; }
.day-focus { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.day-card.next { border-color: rgba(227, 18, 27, 0.45); box-shadow: 0 24px 50px -36px rgba(227, 18, 27, 0.8); }
.ex-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; transition: background 0.15s; }
.ex-row:first-child { border-top: 0; }
.ex-row:hover { background: rgba(255, 255, 255, 0.025); }
.ex-idx { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 800; color: var(--muted); }
.ex-name { font-weight: 680; font-size: 14.5px; line-height: 1.25; }
.ex-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ex-next { margin-top: 4px; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--red-ink); }
.ex-next .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.ex-next.hold { color: var(--muted); font-weight: 600; }
.day-foot { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }

/* ---------- Entreno activo ---------- */
.wk-head {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(var(--safe-t) + 10px) 16px 12px;
  background: rgba(7, 7, 8, 0.9);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1024px) { .wk-head { margin: -34px -44px 0; padding: 18px 44px; } }
.wk-title { flex: 1; min-width: 0; }
.wk-title .t { font-weight: 850; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-clock { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 750; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.wk-clock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--red-2); animation: blink 1.4s infinite; }
.wk-progress { height: 3px; margin: 0 -16px; background: var(--surface-3); }
.wk-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--red-2)); transition: width 0.4s; }
@media (min-width: 1024px) { .wk-progress { margin: 0 -44px; } }
.wk-body { max-width: 760px; margin: 0 auto; }

.wx { margin-top: 14px; padding: 14px 0 10px; }
.wx-head { display: flex; align-items: flex-start; gap: 10px; padding: 0 14px; }
.wx-head .grow { flex: 1; min-width: 0; }
.wx-name { font-weight: 850; font-size: 16.5px; letter-spacing: -0.02em; line-height: 1.2; color: #fff; cursor: pointer; }
.wx-sub { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.wx-target {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 14px 8px; padding: 9px 12px; border-radius: 12px;
  background: var(--red-soft); border: 1px solid rgba(227, 18, 27, 0.28);
  font-size: 12.5px; line-height: 1.35;
}
.wx-target b { color: #fff; }
.wx-target .ico { width: 16px; height: 16px; color: var(--red-ink); stroke-width: 2.4; }
.wx-target.hold, .wx-target.new { background: rgba(255, 255, 255, 0.03); border-color: var(--line-2); }
.wx-target.down { background: rgba(255, 255, 255, 0.03); border-color: var(--line-2); }
.wx-done .wx-name::after { content: ' ✓'; color: var(--red-ink); }
.sets { padding: 0 8px; }
.set-h, .set { display: grid; grid-template-columns: 34px minmax(0, 1fr) 76px 64px 44px; gap: 6px; align-items: center; }
.set-h.time, .set.time { grid-template-columns: 34px minmax(0, 1fr) 96px 44px; }
.set-h { padding: 4px 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.09em; color: var(--dim); text-transform: uppercase; }
.set-h span:nth-child(n+3) { text-align: center; }
.set { padding: 4px 6px; border-radius: 12px; transition: background 0.25s; }
.set .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 850; color: var(--muted); background: var(--surface-3); }
.set .n.warm { color: #ffb0aa; background: rgba(255, 176, 170, 0.08); font-size: 11px; }
.set .prev { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.set input {
  width: 100%; height: 42px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--bg-2);
  text-align: center; font-weight: 780; font-size: 16px; font-variant-numeric: tabular-nums;
  outline: none; transition: border-color 0.15s, background 0.15s; -moz-appearance: textfield;
}
.set input::placeholder { color: #5e5e66; font-weight: 650; }
.set input:focus { border-color: var(--red); background: #140709; }
.set .ck { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--dim); transition: all 0.2s; }
.set .ck .ico { width: 20px; height: 20px; stroke-width: 2.8; }
.set.done { background: linear-gradient(90deg, rgba(227, 18, 27, 0.24), rgba(227, 18, 27, 0.07)); }
.set.done .ck { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 18px -4px rgba(227, 18, 27, 0.95); }
.set.done input { background: transparent; border-color: transparent; }
.set.done .n { background: rgba(255, 255, 255, 0.1); color: #fff; }
.set.pop { animation: pop 0.35s; }
@keyframes pop { 40% { transform: scale(1.025); } }
.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.wx-actions { display: flex; gap: 8px; padding: 8px 14px 4px; }
.wx-actions .btn { flex: 1; height: 38px; font-size: 13px; border-radius: 11px; }
.wx-note { margin: 8px 14px 4px; width: calc(100% - 28px); min-height: 40px; resize: vertical; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 14px; outline: none; }
.wx-note:focus { border-color: var(--red); }
.wk-foot { display: grid; gap: 10px; margin-top: 18px; }

/* Temporizador de descanso */
.rest-pill {
  position: fixed; z-index: 45; left: 50%; bottom: calc(var(--safe-b) + 16px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  height: 54px; padding: 0 6px 0 8px; border-radius: 999px; overflow: hidden;
  background: #150709; border: 1px solid rgba(227, 18, 27, 0.55);
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.9), 0 0 34px -12px rgba(227, 18, 27, 0.8);
  animation: pillIn 0.3s cubic-bezier(0.2, 0.9, 0.25, 1);
}
body:not(.in-workout) .rest-pill { bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); }
@media (min-width: 1024px) { .rest-pill, body:not(.in-workout) .rest-pill { bottom: 26px; left: calc(50% + var(--side-w) / 2); } }
@keyframes pillIn { from { transform: translate(-50%, 20px); opacity: 0; } }
.rest-pill .rp-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(227, 18, 27, 0.28), rgba(227, 18, 27, 0.12)); pointer-events: none; transition: width 0.25s linear; }
.rest-pill > * { position: relative; }
.rest-pill .rp-time { min-width: 84px; padding: 0 8px; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.rest-pill .rp-time .ico { width: 18px; height: 18px; color: var(--red-ink); }
.rest-pill button { height: 40px; min-width: 44px; padding: 0 10px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--muted); }
.rest-pill button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.rest-pill .rp-skip { background: rgba(255, 255, 255, 0.08); color: #fff; }
.rest-pill.ended { border-color: var(--red-2); animation: restEnd 0.6s 3; }
@keyframes restEnd { 50% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0.25); } }

/* ---------- Hojas modales ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.25s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: min(90dvh, 860px);
  display: flex; flex-direction: column;
  background: #111114; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding-bottom: var(--safe-b);
  transform: translateY(100%); transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.25, 1);
  box-shadow: 0 -20px 60px -20px #000;
}
.sheet.wide { max-width: 720px; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-handle { width: 40px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: var(--line-3); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 10px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 850; letter-spacing: -0.02em; }
.sheet-body { overflow-y: auto; padding: 4px 18px 22px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line-2); padding-bottom: 0; transform: translateY(16px) scale(0.98); opacity: 0; transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.2s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-handle { display: none; }
}
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu button { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; font-weight: 650; text-align: left; }
.menu button:hover { background: var(--surface-3); }
.menu button .ico { color: var(--muted); }
.menu button.danger { color: var(--red-ink); }
.menu button.danger .ico { color: var(--red-ink); }

/* Avisos */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 12px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 14px;
  background: #1b1b20; border: 1px solid var(--line-2); box-shadow: 0 18px 40px -16px #000;
  font-weight: 650; font-size: 14px;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.toast .ico { color: var(--red-2); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all 0.25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.97); } }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > label, .label { font-size: 12.5px; font-weight: 680; color: var(--muted); }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 16px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 18, 27, 0.15); }
.input::placeholder { color: var(--dim); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23a3a3aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-row.three { grid-template-columns: repeat(3, 1fr); }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search .input { padding-left: 44px; height: 46px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.switch-row:first-child { border-top: 0; }
.switch-row .grow { flex: 1; }
.switch-row .t { font-weight: 650; font-size: 14.5px; }
.switch-row .s { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 48px; height: 28px; flex: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #d4d4d8; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.25, 1); }
.switch.on { background: var(--red); border-color: var(--red); }
.switch.on::after { transform: translateX(20px); background: #fff; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); display: grid; place-items: center; }
.stepper input { width: 64px; height: 40px; text-align: center; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 800; font-size: 16px; outline: none; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.45; }
.note .ico { width: 18px; height: 18px; color: var(--red-ink); margin-top: 1px; }
.err { color: var(--red-ink); font-size: 13px; font-weight: 600; min-height: 18px; }

/* ---------- Bienvenida ---------- */
.welcome {
  position: relative; min-height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: 1fr auto;
  padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px);
}
.welcome-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome .geo { position: absolute; left: 50%; top: 34%; width: 760px; height: 760px; transform: translate(-50%, -50%); color: var(--red-2); opacity: 0.12; pointer-events: none; animation: spin 120s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.logo-big { position: relative; width: min(64vw, 290px); aspect-ratio: 1; filter: drop-shadow(0 0 46px rgba(227, 18, 27, 0.5)); animation: logoIn 1.1s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes logoIn { from { opacity: 0; transform: scale(0.82) rotate(-12deg); } }
.welcome h1 { position: relative; margin: 26px 0 10px; font-size: clamp(36px, 9vw, 64px); font-weight: 900; letter-spacing: -0.045em; line-height: 0.96; animation: up 0.8s 0.15s both; }
.welcome h1 em { font-style: normal; color: var(--red-2); }
.welcome .lead { position: relative; max-width: 440px; margin: 0 auto; color: var(--muted); font-size: 15.5px; animation: up 0.8s 0.25s both; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
.welcome-actions { position: relative; width: 100%; max-width: 420px; margin: 26px auto 0; display: grid; gap: 10px; animation: up 0.8s 0.35s both; }
.welcome-foot { position: relative; margin-top: 16px; text-align: center; font-family: var(--brand); font-size: 9.5px; letter-spacing: 0.24em; color: var(--dim); text-transform: uppercase; }
.feat { display: none; }
@media (min-width: 1024px) {
  .welcome { grid-template-columns: 1.1fr 1fr; grid-template-rows: 1fr; align-items: center; gap: 40px; padding: 60px 8vw; }
  .welcome-hero { align-items: flex-start; text-align: left; order: 0; }
  .welcome .lead { margin: 0; }
  .welcome-actions { margin: 32px 0 0; grid-template-columns: 1fr 1fr; max-width: 460px; }
  .welcome-actions .full { grid-column: 1 / -1; }
  .welcome .geo { left: 74%; top: 50%; }
  .welcome-side { display: flex; flex-direction: column; align-items: center; gap: 26px; }
  .logo-big { width: 340px; }
  .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 480px; }
  .feat .card { padding: 14px; }
  .feat b { display: block; font-size: 14px; margin: 8px 0 2px; }
  .feat span { font-size: 12.5px; color: var(--muted); }
  .feat .ico { color: var(--red-ink); }
  .welcome-foot { position: absolute; bottom: 24px; left: 8vw; }
}
.welcome-side { position: relative; display: flex; justify-content: center; order: -1; }
@media (max-width: 1023px) { .welcome-hero { order: 1; } .welcome-side { order: 0; padding-top: 4vh; } .welcome-foot { order: 2; } .welcome { grid-template-rows: auto 1fr auto; } }

/* ---------- Registro / cuestionario ---------- */
.ob { position: relative; min-height: 100dvh; max-width: 580px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 20px calc(var(--safe-b) + 18px); }
.ob-top { display: flex; align-items: center; gap: 12px; height: 44px; }
.ob-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.ob-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--red-deep), var(--red-2)); transition: width 0.45s cubic-bezier(0.2, 0.9, 0.25, 1); }
.ob-step { font-size: 12px; font-weight: 750; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.ob-body { flex: 1; padding: 22px 0 18px; animation: pageIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ob-body.still { animation: none; }
.ob-title { margin: 10px 0 8px; font-size: 31px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.04; }
.ob-sub { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.ob-foot { position: sticky; bottom: 0; padding-top: 14px; background: linear-gradient(rgba(7, 7, 8, 0), var(--bg) 26%); }
.ob-q { margin: 22px 0 10px; font-size: 13px; font-weight: 750; color: var(--muted); }
.opt-grid { display: grid; gap: 10px; }
.opt {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 15px 16px; border-radius: 16px;
  border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.opt:active { transform: scale(0.99); }
.opt:hover { border-color: var(--line-3); }
.opt .oi { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); transition: all 0.15s; }
.opt .grow { flex: 1; min-width: 0; }
.opt .ot { font-weight: 780; font-size: 15.5px; letter-spacing: -0.01em; }
.opt .od { margin-top: 2px; font-size: 13px; color: var(--muted); }
.opt .radio { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-3); transition: all 0.15s; }
.opt.on { border-color: var(--red); background: linear-gradient(90deg, rgba(227, 18, 27, 0.17), rgba(227, 18, 27, 0.04)); }
.opt.on .oi { background: var(--red); color: #fff; box-shadow: 0 0 20px -4px rgba(227, 18, 27, 0.8); }
.opt.on .radio { border-color: var(--red-2); background: var(--red-2); box-shadow: inset 0 0 0 4px #1c0809; }
.place-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.place { flex-direction: column; align-items: flex-start; padding: 18px 16px; min-height: 150px; }
.place .oi { width: 52px; height: 52px; }
.place .oi .ico { width: 26px; height: 26px; }
.num-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.num-pick button { height: 58px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-size: 21px; font-weight: 850; font-variant-numeric: tabular-nums; transition: all 0.15s; }
.num-pick button small { display: block; font-size: 10.5px; font-weight: 650; color: var(--dim); margin-top: -2px; }
.num-pick button.on { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 10px 24px -10px rgba(227, 18, 27, 0.9); }
.num-pick button.on small { color: rgba(255, 255, 255, 0.8); }
.eq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eq { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; font-size: 13.5px; text-align: left; line-height: 1.2; transition: all 0.15s; }
.eq .box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--line-3); display: grid; place-items: center; color: transparent; }
.eq .box .ico { width: 13px; height: 13px; stroke-width: 3.2; }
.eq.on { border-color: rgba(227, 18, 27, 0.6); background: rgba(227, 18, 27, 0.1); }
.eq.on .box { background: var(--red); border-color: var(--red); color: #fff; }
.eq.locked { opacity: 0.6; pointer-events: none; }

/* Generando la rutina */
.gen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.gen svg { width: 220px; height: 220px; color: var(--red-2); }
.gen .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s cubic-bezier(0.6, 0, 0.3, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.gen h2 { margin: 26px 0 6px; font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.gen p { margin: 0; min-height: 22px; color: var(--muted); }

/* ---------- Gráficas ---------- */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart svg text { font-family: var(--sans); font-size: 11px; fill: var(--dim); font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 7px 10px; border-radius: 10px;
  background: #1c1c22; border: 1px solid var(--line-2);
  font-size: 12px; color: var(--muted); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  box-shadow: 0 12px 30px -10px #000; opacity: 0; transition: opacity 0.12s;
}
.chart-tip b { display: block; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-tip.on { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.heat-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: 10px; color: var(--dim); font-weight: 700; }
.heat-days span { display: flex; align-items: center; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, 0.045); }
.heat i.l1 { background: rgba(227, 18, 27, 0.3); }
.heat i.l2 { background: rgba(227, 18, 27, 0.55); }
.heat i.l3 { background: rgba(227, 18, 27, 0.8); }
.heat i.l4 { background: var(--red-2); box-shadow: 0 0 8px -1px rgba(255, 59, 48, 0.7); }
.heat i.fut { background: transparent; }
.heat i.today { outline: 1px solid rgba(255, 255, 255, 0.6); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--dim); }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; }
.mbars { display: grid; gap: 11px; }
.mbar { display: grid; grid-template-columns: 92px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.mbar .l { color: var(--muted); font-weight: 650; }
.mbar .v { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.mbar .track { position: relative; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.mbar .band { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.06); border-left: 1px dashed rgba(255, 255, 255, 0.25); border-right: 1px dashed rgba(255, 255, 255, 0.25); }
.mbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--red-deep), var(--red-2)); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.table tr.click { cursor: pointer; }
.table .r { text-align: right; }
.table .name { font-weight: 680; }

/* ---------- Composición ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.grid > *, .routine-grid > * { min-width: 0; }
.desk-only { display: none !important; }
@media (min-width: 1024px) {
  .desk-only { display: block !important; }
  .mob-only { display: none !important; }
  .dash { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
  .dash > div { min-width: 0; }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span2 { grid-column: span 2; }
}
@media (min-width: 720px) and (max-width: 1023px) { .g2.tab2 { grid-template-columns: 1fr 1fr; } }

/* Vacíos */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .art { width: 110px; height: 110px; margin: 0 auto 14px; color: var(--red-2); opacity: 0.55; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; font-weight: 800; }
.empty p { margin: 0 auto 16px; max-width: 340px; font-size: 14px; }

/* PRs */
.pr { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: linear-gradient(180deg, #ff3b30, #c40d15); color: #fff; font-size: 10.5px; font-weight: 850; letter-spacing: 0.04em; }
.pr .ico { width: 11px; height: 11px; stroke-width: 2.6; }

/* Resumen final */
.done-hero { text-align: center; padding: 18px 0 8px; }
.done-hero svg { width: 150px; height: 150px; margin: 0 auto; color: var(--red-2); filter: drop-shadow(0 0 24px rgba(227, 18, 27, 0.6)); }
.done-hero h1 { margin: 16px 0 4px; font-size: 32px; font-weight: 900; letter-spacing: -0.04em; }

/* Historial */
.month { margin: 22px 2px 10px; font-family: var(--brand); font-size: 10px; letter-spacing: 0.2em; color: var(--dim); text-transform: uppercase; }
.sess { cursor: pointer; transition: border-color 0.15s, transform 0.12s; }
.sess:hover { border-color: var(--line-2); }
.sess-top { display: flex; align-items: flex-start; gap: 12px; }
.sess-date { width: 48px; flex: none; text-align: center; padding: 6px 0; border-radius: 12px; background: var(--surface-3); line-height: 1.1; }
.sess-date b { display: block; font-size: 19px; font-weight: 900; letter-spacing: -0.03em; }
.sess-date span { font-size: 10.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; }
.sess-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sess-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sess-meta .ico { width: 13px; height: 13px; }
.sess-ex { margin-top: 10px; display: grid; gap: 4px; font-size: 13px; }
.sess-ex div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.sess-ex div span:first-child { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-ex div span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Detalle de sesión */
.dset { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 7px 0; font-size: 14px; font-variant-numeric: tabular-nums; border-top: 1px dashed var(--line); }
.dset:first-of-type { border-top: 0; }
.dset .n { color: var(--dim); font-weight: 800; }

/* Biblioteca */
.pick-list { margin-top: 12px; }
.pick-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 8px; border-radius: 12px; text-align: left; }
.pick-row:hover { background: var(--surface-3); }
.pick-row .grow { flex: 1; min-width: 0; }
.pick-row .t { font-weight: 680; font-size: 14.5px; }
.pick-row .s { font-size: 12px; color: var(--muted); }
.pick-row.off { opacity: 0.45; }

/* Perfil */
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card .avatar { width: 58px; height: 58px; font-size: 20px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv > div { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.kv span { display: block; font-size: 11.5px; color: var(--dim); font-weight: 650; }
.kv b { display: block; margin-top: 3px; font-size: 14px; font-weight: 750; }

/* Ilustración vitrubiana decorativa */
.vit { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
