:root {
  --bg: #06090f; /* Atomic Night: negro azulado */
  --bg-2: #0c1119;
  --surface: #14171e;
  --surface-2: #1b1f28;
  --line: #262b36;
  --text: #f2f5f9;
  --text-2: #a7afbd;
  --muted: #6e7686;
  --accent: #00e676;
  --accent-text: #00e676; /* color principal para textos (en modo claro, una variante más oscura legible) */
  --accent-2: #00b248;
  --accent-ink: #00160a;
  --good: #22d39a;
  --warn: #ffb300;
  --danger: #ff4d6d;
  --gold: #ffd36b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 68px;
  --side-w: 236px;
  --accent-rgb: 0, 230, 118;
  --accent2-rgb: 0, 178, 72;
  --bg-rgb: 6, 9, 15;
  --stage: #0f1318; /* fondo de las ilustraciones de ejercicios (siempre oscuro) */
  color-scheme: dark;
}
/* Tema claro (el color principal lo calcula theme.js para mantener buen contraste) */
:root[data-theme="light"] {
  --bg: #f6f5f1; /* Atomic Light: blanco perla (nunca blanco puro) */
  --bg-2: #eceae4;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --line: #d9dfe7;
  --text: #10141b;
  --text-2: #4a5463;
  --muted: #7a8495;
  --good: #0f9f6e;
  --warn: #b77400;
  --danger: #e0244c;
  --gold: #b88400;
  --shadow: 0 10px 30px rgba(20, 30, 50, .12);
  --bg-rgb: 246, 245, 241;
  color-scheme: light;
}
/* Entrenamiento en marcha: se queda exactamente como estaba (sin fondo Atomic). */
:root[data-route="session"] { --bg: #07080b; --bg-2: #0e1015; --bg-rgb: 7, 8, 11; }
:root[data-theme="light"][data-route="session"] { --bg: #f3f5f8; --bg-2: #e9edf2; --bg-rgb: 243, 245, 248; }

/* ---------- Fondo Atomic (Night / Light) ----------
   Capa fija y estática detrás de todo el contenido: luz ambiental, degradados radiales del color elegido
   y órbitas atómicas finas. No se anima ni se repinta al desplazarse. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    var(--atom-orbits, none) no-repeat calc(100% + 34vmax) -30vmax / 92vmax 92vmax,
    var(--atom-orbits, none) no-repeat -26vmax calc(100% + 24vmax) / 64vmax 64vmax,
    radial-gradient(60% 42% at 92% -4%, rgba(var(--accent-rgb), .15), transparent 72%),
    radial-gradient(52% 40% at -8% 42%, rgba(var(--accent2-rgb), .08), transparent 70%),
    radial-gradient(70% 45% at 40% 112%, rgba(var(--accent-rgb), .07), transparent 70%),
    radial-gradient(130% 70% at 50% -10%, rgba(52, 78, 140, .16), transparent 62%);
}
:root[data-theme="light"] body::before {
  background:
    var(--atom-orbits, none) no-repeat calc(100% + 34vmax) -30vmax / 92vmax 92vmax,
    var(--atom-orbits, none) no-repeat -26vmax calc(100% + 24vmax) / 64vmax 64vmax,
    radial-gradient(60% 42% at 92% -4%, rgba(var(--accent-rgb), .13), transparent 72%),
    radial-gradient(52% 40% at -8% 42%, rgba(var(--accent2-rgb), .07), transparent 70%),
    radial-gradient(70% 45% at 40% 112%, rgba(var(--accent-rgb), .08), transparent 70%),
    radial-gradient(130% 70% at 50% -10%, rgba(255, 255, 255, .7), transparent 62%);
}
:root[data-route="session"] body::before { display: none; }
* { box-sizing: border-box; }
svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.card-head > svg { width: 20px; height: 20px; color: var(--muted); }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent-text); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
#app { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar .back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.page-title { display: flex; flex-direction: column; gap: 4px; }
.page-title .sub { color: var(--text-2); font-size: .92rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Navigation ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(var(--bg-rgb), .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .64rem; min-width: 0; white-space: nowrap; font-weight: 600; }
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav a.active { color: var(--accent-text); }
.bottom-nav a.train { position: relative; }
.bottom-nav a.train .fab { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); margin-top: -22px; box-shadow: 0 6px 22px rgba(var(--accent-rgb), .35); }
.bottom-nav a.train .fab svg { width: 24px; height: 24px; }
.side-nav { display: none; }
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .main { padding: 28px 36px 48px; }
  .side-nav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
    padding: 22px 14px; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto;
  }
  .side-nav .brand { margin: 0 8px 22px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; }
  .side-nav a svg { width: 20px; height: 20px; }
  .side-nav a:hover { background: var(--surface); color: var(--text); }
  .side-nav a.active { background: rgba(var(--accent-rgb), .1); color: var(--accent-text); }
  .side-nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .side-nav .grow { flex: 1; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; font-size: 1rem; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.brand b { color: var(--accent-text); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: relative; }
.card.flat { background: var(--bg-2); }
.card.link { cursor: pointer; transition: border-color .15s, transform .15s; display: block; color: inherit; }
.card.link:hover { border-color: var(--muted); }
.card.link:active { transform: scale(.99); }
.card.hero { background: radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), .16), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(var(--accent2-rgb), .18), transparent 55%), var(--surface); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head .more { font-size: .85rem; font-weight: 600; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.muted { color: var(--text-2); }
.faint { color: var(--muted); }
.small { font-size: .84rem; }
.big-num { font-size: 1.8rem; font-weight: 850; letter-spacing: -.03em; }
.stat, .card.link.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: .78rem; color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #4beeff; }
.btn.grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: var(--accent-ink); font-weight: 800; }
.btn.danger { background: transparent; border-color: rgba(255, 77, 109, .5); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .86rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { background: none; border: 0; color: var(--text-2); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.on { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .84rem; color: var(--text-2); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.input.sm { min-height: 38px; padding: 7px 10px; border-radius: 10px; font-size: .9rem; }
.hint { font-size: .78rem; color: var(--muted); }
.form-error { color: var(--danger); font-size: .88rem; font-weight: 600; min-height: 1.2em; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 40px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters select { flex: none; width: auto; min-width: 130px; }
.filters.wrap { flex-wrap: wrap; overflow: visible; } /* Historial: con las fechas, todo a la vista (sin desplazamiento oculto) */
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip.on { background: rgba(var(--accent-rgb), .12); border-color: var(--accent); color: var(--accent-text); }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; overflow-x: auto; }
.seg a, .seg button { flex: 1; text-align: center; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 650; font-size: .88rem; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.seg .on { background: var(--surface-2); color: var(--text); }

/* ---------- Tags / badges ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tag svg { width: 13px; height: 13px; }
.tag.d1 { color: var(--good); border-color: rgba(34, 211, 154, .35); }
.tag.d2 { color: var(--warn); border-color: rgba(255, 179, 0, .35); }
.tag.d3 { color: var(--danger); border-color: rgba(255, 77, 109, .35); }
.tag.system { color: var(--accent-text); border-color: rgba(var(--accent-rgb), .3); }
.tag.own { color: #c6ff4d; border-color: rgba(var(--accent2-rgb), .4); }
.tag.premium { color: var(--gold); border-color: rgba(255, 211, 107, .4); }
.tag.soon { color: var(--text-2); }

/* ---------- Progress ---------- */
.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.thin { height: 6px; }
.bar.good > i { background: var(--good); }

/* ---------- Avatar & rank ---------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); position: relative; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(var(--accent-rgb), .55); }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; image-rendering: auto; }
/* Avatar de icono: el color elegido rellena todo el círculo y el icono va en oscuro para que se lea nítido. */
.avatar.preset .av-in { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--av); background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--av) 70%, #fff) 0%, var(--av) 55%, color-mix(in srgb, var(--av) 70%, #000) 100%); color: #07120b; }
/* Estilos del avatar predeterminado */
.avatar.preset.st-flat .av-in { background: var(--av); }
.avatar.preset.st-ring .av-in { background: #0d1117; color: var(--av); box-shadow: inset 0 0 0 3px var(--av); }
.avatar.preset.st-glow .av-in { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--av) 45%, #0d1117) 0%, #0d1117 75%); color: var(--av); }
.avatar.preset.st-glow svg { filter: drop-shadow(0 0 6px var(--av)); }
.avatar.preset svg { width: 64%; height: 64%; stroke-width: 2.4; }
.avatar.md { width: 64px; height: 64px; }
.avatar.lg { width: 84px; height: 84px; }
.avatar.xl { width: 116px; height: 116px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(var(--accent-rgb), .6); }
.avatar.sm { width: 36px; height: 36px; }
.rank-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(var(--accent-rgb), .1); color: var(--accent-text); font-weight: 750; font-size: .8rem; border: 1px solid rgba(var(--accent-rgb), .3); }
.rank-badge svg { width: 14px; height: 14px; }
/* Solo el rango Leyenda tiene efectos visuales especiales */
.legend .avatar, .avatar.legend { border: 0; box-shadow: none; padding: 3px; background: conic-gradient(from 0deg, #ffd36b, #ff8a00, #fff1b8, #ffd36b, #ff8a00, #ffd36b); animation: legendSpin 6s linear infinite; }
.avatar.legend > * { border-radius: 50%; background: var(--surface-2); animation: legendSpin 6s linear infinite reverse; }
.avatar.legend > img, .avatar.legend > .av-in { width: 100%; height: 100%; display: grid; place-items: center; }
.rank-badge.legend { background: linear-gradient(90deg, #ffd36b, #ff8a00, #ffd36b); background-size: 200% 100%; color: #2a1600; border: 0; animation: shimmer 3s linear infinite; box-shadow: 0 0 18px rgba(255, 190, 80, .45); }
@keyframes legendSpin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--text-2); font-size: .82rem; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 14px; height: 14px; }

/* ---------- Routine card ---------- */
.routine-card { display: flex; flex-direction: column; gap: 10px; }
.routine-card .rc-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.routine-card h3 { font-size: 1.02rem; }
.routine-card .desc { color: var(--text-2); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-dot { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .1); color: var(--accent-text); flex: none; }
.cat-dot svg { width: 19px; height: 19px; }

/* ---------- Exercises ---------- */
.ex { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ex:last-child { border-bottom: 0; }
.ex .num { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 750; font-size: .85rem; color: var(--text-2); flex: none; }
.ex-edit { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ex-edit .ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .ex-edit .ex-grid { grid-template-columns: repeat(5, 1fr); } }
.ex-edit .field label { font-size: .74rem; }

/* ---------- Workout player ---------- */
.player-head { position: sticky; top: 0; z-index: 20; margin: -18px -16px 14px; padding: 14px 16px; background: rgba(var(--bg-rgb), .94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .player-head { margin: -28px -36px 18px; padding: 16px 36px; } }
.timer { font-variant-numeric: tabular-nums; font-size: 2.1rem; font-weight: 850; letter-spacing: -.02em; }
.timer.paused { color: var(--warn); }
.wx { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; }
.wx.current { border-color: rgba(var(--accent-rgb), .55); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .2) inset; }
.wx.done { opacity: .62; }
.wx .wx-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.sets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.set-btn { min-width: 74px; min-height: 52px; padding: 6px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg-2); color: var(--text-2); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; line-height: 1.15; transition: all .15s; }
.set-btn small { font-size: .72rem; font-weight: 600; color: var(--muted); }
.set-btn.done { background: rgba(34, 211, 154, .14); border-color: var(--good); color: var(--good); }
.set-btn.done small { color: var(--good); }
.set-btn[disabled] { opacity: .5; cursor: not-allowed; }
.rest-sheet { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 45; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; animation: up .25s ease; max-width: 560px; margin: 0 auto; }
@media (min-width: 900px) { .rest-sheet { bottom: 24px; left: calc(var(--side-w) + 24px); } }
.rest-sheet { flex-wrap: wrap; row-gap: 8px; }
.rest-sheet > div:first-child { flex: 1 1 100% !important; }
.rest-sheet .timer { font-size: 1.8rem; flex: 1; }
.rest-sheet.work { border-color: var(--accent); }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .bar-rect { fill: var(--accent); }
.chart .bar-rect.cur { fill: #7ff2ff; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar-rect, .chart g.b:hover .bar-rect { fill: #9ff6ff; }
.chart .val { fill: var(--text-2); font-size: 11px; font-weight: 700; }
.chart-wrap { position: relative; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: .78rem; white-space: nowrap; transform: translate(-50%, -110%); z-index: 5; box-shadow: var(--shadow); }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: .86rem; }
.hbar .track { height: 10px; border-radius: 0 4px 4px 0; background: transparent; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 3px; }
table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th, table.data td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 600; }
details.table-toggle summary { cursor: pointer; color: var(--text-2); font-size: .82rem; margin-top: 8px; }

/* ---------- Medals ---------- */
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 12px; }
.medal .m-icon { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 2px solid var(--line); color: var(--muted); }
.medal .m-icon svg { width: 34px; height: 34px; }
.medal.locked .m-icon { filter: grayscale(1); opacity: .55; }
.medal.unlocked.r-comun .m-icon { color: #cfd6e2; border-color: #8d97a8; }
.medal.unlocked.r-poco_comun .m-icon { color: var(--good); border-color: var(--good); }
.medal.unlocked.r-rara .m-icon { color: #82b1ff; border-color: #2979ff; box-shadow: 0 0 16px rgba(41, 121, 255, .22); }
.medal.unlocked.r-epica .m-icon { color: #e08cff; border-color: #b23cff; box-shadow: 0 0 16px rgba(178, 60, 255, .25); }
.medal.unlocked.r-legendaria .m-icon { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 20px rgba(255, 211, 107, .25); }
.rarity { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.r-comun .rarity { color: #aab3c2; } .r-poco_comun .rarity { color: var(--good); } .r-rara .rarity { color: #5b9bff; } .r-epica .rarity { color: #c45cff; } .r-legendaria .rarity { color: var(--gold); }

/* ---------- Notifications / toasts / modal ---------- */
.notif { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: linear-gradient(90deg, rgba(255, 211, 107, .14), rgba(var(--accent2-rgb), .12)); border: 1px solid rgba(255, 211, 107, .35); animation: up .3s ease; }
.notif .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 211, 107, .15); color: var(--gold); flex: none; }
.notif .ic svg { width: 20px; height: 20px; }
#toasts { position: fixed; z-index: 100; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 15px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; animation: up .25s ease; }
.toast.error { border-color: rgba(255, 77, 109, .6); }
.toast.ok { border-color: rgba(34, 211, 154, .6); }
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
@media (min-width: 640px) { .modal-back { align-items: center; } }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); animation: up .25s ease; max-height: 92vh; overflow-y: auto; }
@media (min-width: 640px) { .modal { border-radius: 22px; padding: 24px; } }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Level up ---------- */
.levelup { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(var(--accent-rgb), .22), rgba(0, 0, 0, .88) 60%); animation: fade .3s ease; cursor: pointer; }
.levelup .lu-inner { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 24px; }
.levelup .lu-num { font-size: 6rem; font-weight: 900; line-height: 1; background: linear-gradient(135deg, #fff, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.levelup .ring { width: 190px; height: 190px; border-radius: 50%; border: 3px solid var(--accent); position: absolute; animation: ring 1.2s ease-out infinite; opacity: 0; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes ring { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; } /* usa el fondo Atomic */
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-box .brand { justify-content: center; font-size: 1.35rem; }
.auth-box .brand .logo { width: 56px; height: 56px; }
.tagline { text-align: center; color: var(--text-2); }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: 34px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .e-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); }
.empty .e-ic svg { width: 28px; height: 28px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius); }
.loader { display: grid; place-items: center; padding: 60px 0; }
.loader::after { content: ""; width: 30px; height: 30px; border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.lock-overlay { position: absolute; inset: 0; border-radius: var(--radius); background: rgba(var(--bg-rgb), .55); display: grid; place-items: center; }
.avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-pick .avatar { width: 44px; height: 44px; }
.av-preview { display: grid; place-items: center; margin: 4px 0 14px; }
.av-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.av-styles button { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 2px solid transparent; border-radius: 12px; padding: 6px 2px; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.av-styles button.on { border-color: var(--accent); color: var(--text); }
.av-styles .avatar { width: 40px; height: 40px; }
.color-pick .custom-color { position: relative; overflow: hidden; background: conic-gradient(#ff3d71, #ffb300, #76ff03, #00e5ff, #7c4dff, #ff3d71); }
.color-pick .custom-color input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
@media (max-width: 380px) { .avatar-pick { grid-template-columns: repeat(5, 1fr); } }
.avatar-pick button { background: none; border: 2px solid transparent; border-radius: 50%; padding: 2px; cursor: pointer; justify-self: center; }
.avatar-pick button.on { border-color: var(--accent); }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-pick button.on { border-color: #fff; }

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

/* ---------- Etiqueta (Opcional) ---------- */
.opt { color: var(--muted); font-weight: 500; font-size: .85em; }
.goal-custom { margin-top: 8px; }

/* ---------- Modal a pantalla completa (fichas y selector de ejercicios) ---------- */
.modal-back.full { align-items: stretch; background: var(--bg); }
.modal.full { max-width: 760px; max-height: none; height: 100%; border-radius: 0; border: 0; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--bg); animation: slideIn .22s ease; }
@media (min-width: 640px) { .modal-back.full { align-items: stretch; } .modal.full { border-radius: 0; padding: 20px 24px 32px; } }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; min-height: 40px; }
.sheet-top .back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; background: none; border: 0; padding: 6px 0; cursor: pointer; font-size: 1rem; }
.sheet-bottom { position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom)); margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }

/* ---------- Ilustraciones de ejercicios ---------- */
.fig { display: block; width: 100%; height: auto; }
.fig-main { margin: 14px auto 8px; max-width: 360px; aspect-ratio: 200 / 210; background: radial-gradient(70% 60% at 50% 40%, rgba(var(--accent-rgb), .08), transparent), var(--stage); border: 1px solid var(--line); border-radius: 18px; padding: 6px; }
.fig-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 360px; margin: 0 auto 6px; }
.fig-steps figure { margin: 0; background: var(--stage); color: #c9d1dc; border: 1px solid var(--line); border-radius: 14px; padding: 4px 4px 8px; text-align: center; }
.fig-steps figcaption { font-size: .78rem; color: var(--text-2); font-weight: 650; }
.ex-sec { margin-top: 12px; }
.ex-sec h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ex-sec h3 svg { color: var(--accent-text); }
.steps, .tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.steps li::marker { color: var(--accent-text); font-weight: 800; }
.tips li::marker { color: var(--accent-text); }
.tips.bad li::marker { color: var(--danger); }

/* Lista de ejercicios */
.group-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; padding: 2px 0 6px; }
.group-tabs::-webkit-scrollbar { display: none; }
.group-tab { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 10px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-weight: 700; font-size: .8rem; cursor: pointer; }
.group-tab svg { width: 26px; height: 26px; }
.group-tab.on { background: rgba(var(--accent-rgb), .12); border-color: var(--accent); color: var(--accent-text); }
.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 8px 8px; }
.ex-row .chev { color: var(--muted); }
.ex-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.ex-open.lib { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 6px 6px; }
.ex-open.lib > svg:last-child { color: var(--muted); }
.ex-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-txt b { overflow: hidden; text-overflow: ellipsis; }
.ex-thumb { flex: none; width: 58px; height: 58px; border-radius: 12px; background: var(--stage); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.ex-thumb .fig { width: 100%; height: 100%; }
.ex-thumb-btn { background: none; border: 0; padding: 0; cursor: pointer; flex: none; }
.ex-name-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.ex-name-link svg { width: 16px; height: 16px; color: var(--accent-text); }

/* ---------- Recorte de foto ---------- */
.crop-stage { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 16px; background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-img { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; max-width: none; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 16px; background: radial-gradient(circle closest-side, transparent calc(100% - 1px), rgba(0, 0, 0, .62) 100%); }
.crop-mask::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .9); }
.crop-tools { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.crop-tools input[type=range] { flex: 1; accent-color: var(--accent); }

/* El atributo hidden siempre oculta, aunque el componente tenga su propio display */
[hidden] { display: none !important; }
/* Accesos a Progreso (Inicio y Perfil) */
.progress-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.plink { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); color: inherit; text-align: center; font-size: .78rem; }
.plink:active { transform: scale(.97); }

/* Deslizador (volumen de avisos) */
.range { accent-color: var(--accent); height: 28px; }

/* Selector de idioma en las pantallas de acceso */
.auth-lang { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 18px auto 0; color: var(--muted); }
.auth-lang svg { width: 18px; height: 18px; flex: none; }
.auth-lang select { width: auto; min-width: 150px; }
/* Historial: visibilidad y borrar */
.hist-item { position: relative; }
.vis-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.vis-ic svg { width: 14px; height: 14px; }
.vis-ic.pub { color: var(--accent); background: rgba(var(--accent-rgb), .14); }
.impact-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.impact-list li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 83, 112, .08); }
.impact-list svg { width: 18px; height: 18px; color: #ff5370; flex: none; }

/* Colores de rareza (Rara: azul · Épica: morado) usados en animaciones y avisos */
.r-comun { --rc: #cfd6e2; --rc2: #8d97a8; } .r-poco_comun { --rc: #69f0ae; --rc2: #00c853; }
.r-rara { --rc: #82b1ff; --rc2: #2962ff; } .r-epica { --rc: #e08cff; --rc2: #9c27ff; } .r-legendaria { --rc: #ffe08a; --rc2: #ff8f00; }

/* Estadísticas: controles de métrica y vista (gráfico o tabla) */
.chart-ctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.seg.mini { padding: 3px; flex: none; }
.seg.mini button { flex: none; padding: 5px 12px; font-size: .8rem; }
.view-tog { flex: none; }
.month-sum { margin: -4px 0 8px; color: var(--text-2); }
.chart-unit { text-align: right; margin-top: -4px; }
table.data th.hi, table.data td.hi { color: var(--accent-text); font-weight: 700; }
.table-wrap { overflow-x: auto; }
#st-month .chart-wrap { max-width: 560px; margin: 0 auto; }

/* Objetivo: botón y lista agrupada con títulos bien separados */
.goal-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.goal-btn svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.goal-btn-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 12px; }
.goal-sec + .goal-sec { border-top: 1px solid var(--line); padding-top: 16px; }
.goal-title { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 10px; }
.goal-opts { display: flex; flex-direction: column; gap: 6px; }
.goal-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid transparent; color: var(--text); font: inherit; font-size: .92rem; cursor: pointer; }
.goal-opt svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.goal-opt.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); font-weight: 650; }
.goal-opt.alt { color: var(--text-2); }

/* Premium: comparativa gratis / Premium */
.cmp-table th.c, .cmp-table td.c { text-align: center; width: 84px; }
.cmp-table th.prem { color: var(--gold); }
.cmp-table th.prem svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.cmp-table td { padding: 9px 6px; }
.cmp-table tr.only-prem td:first-child { font-weight: 650; }
.cmp-yes, .cmp-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.cmp-yes { color: var(--good); background: rgba(0, 230, 118, .12); }
.cmp-no { color: var(--muted); background: var(--surface-2); }
.cmp-yes svg, .cmp-no svg { width: 14px; height: 14px; }

/* v1.13: límite de rutinas del plan gratuito */
.quota-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .85rem; color: var(--muted); }
.quota-line svg { flex: none; width: 16px; height: 16px; }
.quota-line span { flex: 1; min-width: 0; }
.quota-line.full { color: var(--text); border: 1px solid rgba(255,211,107,.45); }
.quota-line.full svg { color: var(--gold); }

/* v1.13: botón «ojo» de las contraseñas */
.pw-wrap { position: relative; display: block; }
.pw-wrap > .input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye[aria-pressed="true"] { color: var(--accent-text); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* v1.13: comparativa Premium con textos y reglas */
.cmp-table .cmp-txt { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.cmp-table td:last-child .cmp-txt { color: var(--gold); }
.rules-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: .9rem; color: var(--muted); }

/* v1.13: Evolución, resumen Premium y accesos */
.progress-links { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.plink { font-size: .72rem; padding: 10px 2px; }
.plink b { overflow-wrap: anywhere; }
.evo-public { gap: 12px; align-items: center; }
.evo-title::first-letter, .report-label::first-letter { text-transform: uppercase; }
.prog-tabs { scrollbar-width: none; }
.prog-tabs::-webkit-scrollbar { display: none; }
.prog-tabs a { padding: 8px 10px; font-size: .84rem; }
.evo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.evo-item { position: relative; }
.evo-item .media-item { aspect-ratio: 3 / 4; }
.evo-priv { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 6px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; cursor: pointer; }
.evo-priv svg { width: 14px; height: 14px; }
.evo-priv.on { color: var(--accent-text); border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .1); }
.evo-month.cur { border-color: rgba(var(--accent-rgb), .45); }
.evo-notif { border-color: rgba(var(--accent-rgb), .45); }
.report-nav { align-items: center; }
.report-label { font-size: 1.15rem; text-align: center; }
.report-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.report-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 6px; }
.report-tile b { font-size: 1.05rem; }
.rank-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-weight: 800; font-size: .8rem; }
.report-link { border-color: rgba(255,211,107,.45); }

/* v1.13.1: resumen mensual en Estadísticas, categorías por mes y visor de fotos */
.month-nav { align-items: center; margin: 4px 0 8px; }
.month-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.month-nav .flip svg { transform: scaleX(-1); }
.month-label::first-letter { text-transform: uppercase; }
.report-tile { background: var(--surface-2); border-radius: 14px; }
.report-sec { margin-top: 6px; }
.report-sec h3 { font-size: 1rem; margin-bottom: 4px; }
.annual-link { border-top: 1px solid var(--line); padding-top: 12px; color: inherit; }
.evo-item .media-item img, .evo-item .media-item video { cursor: zoom-in; }
.modal-back.lightbox { z-index: 1000; background: #000; align-items: stretch; padding: 0; animation: fadeIn .2s ease; }
.modal.lb-box { max-width: none; width: 100%; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; animation: none; }
.lightbox .lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: #fff; font-size: .9rem; }
.lightbox .lb-stage { display: grid; place-items: center; min-height: 0; padding: 0 8px; touch-action: pan-y pinch-zoom; }
.lightbox .lb-stage img, .lightbox .lb-stage video { width: 100%; height: 100%; object-fit: contain; }
.lightbox .lb-title::first-letter { text-transform: uppercase; }
.lightbox .lb-nav { display: flex; justify-content: center; gap: 24px; padding: 12px 16px 24px; }
.lightbox button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox button:disabled { opacity: .3; cursor: default; }
.lightbox button svg { width: 20px; height: 20px; }
.lightbox .lb-next svg { transform: scaleX(-1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* v1.15: zona Premium en Estadísticas */
.premium-zone { margin-top: 6px; }
.pz-title { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; color: var(--gold); }
.pz-item { display: flex; align-items: center; gap: 12px; color: inherit; }
.pz-dot { color: var(--gold); background: rgba(255, 211, 107, .12); }

/* v1.15: funciones Premium */
.sb-entry { display: flex; align-items: center; gap: 12px; color: inherit; border-color: rgba(255, 211, 107, .35); }
.prem-intro .rules-list { margin-top: 2px; }
.prem-lock svg { flex: none; color: var(--gold); margin-top: 2px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.opt-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--line); cursor: pointer; font-size: .88rem; }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.opt-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip-check input:checked + span { border-color: var(--accent); background: rgba(var(--accent-rgb), .14); color: var(--text); }
.chip-check input:disabled + span { opacity: .75; cursor: default; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sb-list { display: flex; flex-direction: column; gap: 2px; }
.sb-ex { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.sb-ex:last-child { border-bottom: 0; }
.delta { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--danger); }
.hbar:has(.delta) { grid-template-columns: minmax(80px, 34%) 1fr auto auto; }
.an-ex { border-top: 1px solid var(--line); padding: 8px 0; }
.an-ex summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.an-ex summary::-webkit-details-marker { display: none; }
.stall { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.stall svg { flex: none; color: var(--warn); margin-top: 3px; }
.cmp-ex { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.cmp-ex.better .tag { color: var(--good); }
.cmp-ex.worse .tag { color: var(--danger); }
.prog-change { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.prog-change b { color: var(--accent-text); }
.tag.up { color: var(--good); }
.tag.down { color: var(--warn); }
.plan-status { align-items: center; }

/* ---------- v1.16: aspecto Premium exclusivo (marco dorado + insignia del diamante) ---------- */
.av-frame { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; padding: 3px; vertical-align: middle;
  background: conic-gradient(from 200deg, #8a5a12, #ffd36b, #fff1b8, #e0a526, #8a5a12, #ffd36b, #fff6d0, #b9821c, #8a5a12);
  box-shadow: 0 0 0 1px rgba(255, 211, 107, .55), 0 0 14px rgba(255, 190, 70, .35); }
.av-frame > .avatar { box-shadow: 0 0 0 2px #0b0d12; }
.av-frame.sm { padding: 2px; }
.av-frame.xl, .av-frame.huge { padding: 5px; }
.av-diamond { position: absolute; right: -3%; bottom: -3%; width: 36%; min-width: 16px; max-width: 40px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2a3442, #0b0f17 70%); box-shadow: 0 0 0 2px #e9b949, 0 0 0 3px rgba(11, 13, 18, .9), 0 2px 8px rgba(0, 0, 0, .45); }
.av-diamond svg { width: 72%; height: 72%; filter: drop-shadow(0 0 3px rgba(150, 230, 255, .55)); }
.pc-avatar.prem { background: none; padding: 0; }
.pc-avatar.prem .avatar { box-shadow: 0 0 0 3px #0d1117; }
.pc-main.prem .pc-ins { right: auto; left: -26px; }

/* v1.16: retos Premium e insignia Xtreme */
.ch-card.done { border-color: rgba(34, 211, 154, .5); }
.ch-card.xtreme { border-color: rgba(255, 60, 110, .45); background: linear-gradient(160deg, rgba(255, 45, 111, .10), transparent 55%), var(--surface); }
.ch-card.monthly { border-color: rgba(255, 211, 107, .4); }
.ch-prem { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); }
.ch-prem svg { width: 12px; height: 12px; }
.ch-sec { margin-top: 6px; }
.ch-sec h2 { font-size: 1.25rem; }
.ch-card .cat-dot .xt-badge { width: 30px; height: 30px; }
.xt-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.xt-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: .82rem; }
.xt-item .xt-badge { width: 54px; height: 54px; filter: drop-shadow(0 3px 8px rgba(255, 45, 111, .35)); }

/* v1.16: Comunidad */
.cm-note { display: flex; gap: 10px; align-items: flex-start; }
.cm-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent); }
.card.cm-me { display: flex; flex-direction: row; align-items: center; gap: 12px; text-align: left; }
.cm-counts { display: flex; gap: 14px; text-align: center; }
.cm-counts > * { display: flex; flex-direction: column; font-size: .74rem; color: var(--text-2); background: none; border: 0; padding: 0; font-family: inherit; }
.cm-counts b { font-size: 1.05rem; color: var(--text); }
.cm-counts.big { justify-content: center; gap: 22px; margin: 4px 0 2px; flex-wrap: wrap; }
.cm-counts.big button { cursor: pointer; }
.cm-counts.big b { font-size: 1.25rem; }
.cm-search-box { position: relative; }
.cm-search-box > svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3, #8a93a0); pointer-events: none; }
.cm-search-box .input { padding-left: 40px; }
.cm-row { gap: 10px; }
.cm-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.cm-nick { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-xt { color: #ff4f8b; font-weight: 650; }
.cm-xt svg { width: 12px; height: 12px; vertical-align: -1px; }
.cm-follow { flex: none; }
.cm-empty { padding: 6px 2px; }
.cm-tabs { margin-bottom: 10px; }
.cm-toggle { gap: 12px; cursor: pointer; }
.cm-profile { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 22px; }
.cm-pname { font-size: 1.6rem; letter-spacing: -.02em; }
.cm-profile .evo-title { margin: 6px 0; }

/* v1.16.1: retos en Inicio (los Premium, bloqueados y difuminados para usuarios gratuitos) */
.home-ch.prem { border-color: rgba(255, 211, 107, .35); }
.home-ch.locked { position: relative; overflow: hidden; }
.hc-blur { filter: blur(5px); opacity: .55; pointer-events: none; user-select: none; }
.hc-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: var(--text);
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .25)); }
.hc-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #1a1205; background: linear-gradient(145deg, #fff1b8, #ffc23d); box-shadow: 0 4px 14px rgba(255, 190, 70, .35); margin-bottom: 4px; }
.hc-ic svg { width: 20px; height: 20px; }
.hc-lock b { color: var(--gold); }

/* v1.16.1: perfil público con el recuadro del perfil personal, entrenos públicos y destacado */
.pc-stats.cm-pcs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pc-stats.cm-pcs > * { padding: 10px 2px; min-width: 0; }
.pc-note { position: relative; color: rgba(242, 245, 249, .7); margin-top: 12px; }
.pc-actions { position: relative; justify-content: center; gap: 8px; margin-top: 14px; }
.cm-sort { margin: 10px 0 6px; }
.cm-fav-l { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); margin-bottom: 4px; }
.cm-fav-l svg { width: 14px; height: 14px; }
.cm-w.fav { border: 1px solid rgba(255, 211, 107, .45); border-radius: 12px; padding-left: 8px; padding-right: 8px; background: rgba(255, 211, 107, .06); }
.cm-sub svg { width: 12px; height: 12px; vertical-align: -1px; }
.cm-star { color: var(--text-3, #8a93a0); flex: none; }
.cm-star.on { color: var(--gold); }
.cm-star.on svg { fill: currentColor; }
.card.cm-wuser { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.cm-wstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cm-wstats div { display: flex; flex-direction: column; gap: 2px; }
.cm-wstats span { font-size: .74rem; color: var(--text-2); }
.cm-wstats b { font-size: 1.05rem; }
.cm-gym { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--text-2); }
.cm-gym svg { width: 16px; height: 16px; }
.cm-sets { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.cm-set { display: flex; align-items: center; gap: 10px; font-size: .9rem; padding: 4px 8px; border-radius: 8px; background: var(--bg-2); }
.cm-set .n { width: 22px; color: var(--text-2); font-weight: 700; }
.cm-set.is-pr { background: rgba(255, 211, 107, .12); }
.cm-set .wk-pr { position: static; transform: none; margin-left: auto; display: inline-flex; background: none; box-shadow: none; }
.cm-set .wk-pr svg { width: 15px; height: 15px; color: var(--gold); }

/* v1.16.1: selección múltiple de rutinas y rutinas compartidas */
.routine-card { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.rc-check { display: none; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); place-items: center; color: transparent; z-index: 1; }
.rc-check svg { width: 16px; height: 16px; }
#results.selecting .rc-check { display: grid; }
#results.selecting .routine-card:not([data-own]) { opacity: .45; }
#results.selecting .routine-card.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
#results.selecting .routine-card.picked .rc-check { background: var(--accent); border-color: var(--accent); color: #07120b; }
#sel-start.on { border-color: var(--accent); color: var(--accent-text); }
.sel-bar { position: sticky; bottom: calc(var(--bottom-nav-h, 72px) + 10px); z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.sel-bar #sel-n { flex: 1; font-weight: 650; }
.sel-bar[hidden] { display: none; }
.shared-box { border-color: rgba(var(--accent-rgb), .45); }
.share-user { width: 100%; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; gap: 12px; }
.share-user > svg { width: 18px; height: 18px; color: var(--text-2); }

/* v1.16.2: ficha técnica desde los ejercicios de un entreno público */
.cm-exhead { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.cm-exhead .ex-thumb { width: 46px; height: 46px; }

/* v1.17: Atom Leagues y Atom Clans */
.comp-entry .card { display: flex; flex-direction: column; gap: 8px; }
.comp-lock { min-height: 120px; }
.lg-row { color: inherit; gap: 10px; }
.lg-row > svg { width: 16px; height: 16px; color: var(--text-2); }
.lg-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.lg-meta > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--bg-2); }
.lg-meta span { font-size: .72rem; color: var(--text-2); }
.lg-code { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); }
.lg-code b { flex: 1; font-size: 1.2rem; letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.lg-pos { color: inherit; gap: 10px; }
.lg-pos.me { background: rgba(var(--accent-rgb), .08); border-radius: 12px; }
.lg-n { width: 26px; text-align: center; font-weight: 800; color: var(--text-2); }
.lg-score { font-variant-numeric: tabular-nums; }
.lg-medal { display: inline-grid; place-items: center; color: var(--mc); }
.lg-medal svg { width: 20px; height: 20px; }
.lg-medal.big svg { width: 42px; height: 42px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.lf-modes { display: grid; gap: 8px; }
.lf-mode { display: block; cursor: pointer; }
.lf-mode input { position: absolute; opacity: 0; }
.lf-mode span { display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.lf-mode span svg { grid-row: span 2; width: 20px; height: 20px; color: var(--accent-text); align-self: center; }
.lf-mode small { color: var(--text-2); }
.lf-mode input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lf-mode input:disabled + span { opacity: .55; }
/* Emblemas de clan: forma (sh-*) y diseño (st-*) con dos colores. La forma se recorta con clip-path y la sombra sigue la forma. */
.clan-emblem { --clip: inset(0 round 30%); position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--ink, #0b0d12);
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--ce) 40%, transparent)); }
.clan-emblem::before, .clan-emblem::after { content: ''; position: absolute; inset: 0; clip-path: var(--clip); }
.clan-emblem::before { background: linear-gradient(145deg, color-mix(in srgb, var(--ce) 80%, #fff), var(--ce)); }
.clan-emblem svg { position: relative; z-index: 1; width: 22px; height: 22px; stroke-width: 2.4; }
.clan-emblem.lg { width: 64px; height: 64px; }
.clan-emblem.lg svg { width: 34px; height: 34px; }
.clan-emblem.xl { width: 96px; height: 96px; }
.clan-emblem.xl svg { width: 50px; height: 50px; stroke-width: 2.2; }
.clan-emblem.sh-circle { --clip: circle(50%); }
.clan-emblem.sh-shield { --clip: polygon(50% 0, 96% 13%, 93% 56%, 75% 83%, 50% 100%, 25% 83%, 7% 56%, 4% 13%); }
.clan-emblem.sh-hexagon { --clip: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.clan-emblem.sh-diamond { --clip: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.clan-emblem.sh-octagon { --clip: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.clan-emblem.sh-shield svg { transform: translateY(-6%) scale(.9); }
.clan-emblem.sh-diamond svg { transform: scale(.72); }
.clan-emblem.st-duo::before { background: linear-gradient(145deg, var(--ce), var(--ce2)); }
.clan-emblem.st-split::before { background: linear-gradient(120deg, var(--ce) 50%, var(--ce2) 50%); }
.clan-emblem.st-stripes::before { background: repeating-linear-gradient(135deg, var(--ce) 0 14%, var(--ce2) 14% 24%); }
.clan-emblem.st-ring::before { background: var(--ce); }
.clan-emblem.st-ring::after { inset: 9%; background: color-mix(in srgb, var(--ce2) 22%, #0d1117); }
.clan-emblem svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.clan-row { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.card.cm-clan { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.cm-clan .eyebrow { display: block; }
.cf-emblem .eyebrow { display: block; margin: 12px 0 6px; }
.cf-preview { display: grid; place-items: center; padding: 14px 0 4px; }
.cf-opt { position: relative; }
.cf-opt input, .cf-col input { position: absolute; opacity: 0; }
.cf-ems { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cf-shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.cf-cell { display: grid; place-items: center; gap: 4px; min-height: 42px; padding: 6px 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; text-align: center; }
.cf-ems .cf-cell svg { width: 22px; height: 22px; }
.cf-cell .clan-emblem { width: 32px; height: 32px; }
.cf-cell .clan-emblem svg { width: 18px; height: 18px; }
.cf-cell small { font-size: .7rem; color: var(--text-2); }
.cf-opt input:checked + .cf-cell { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent); }
.cf-opt input:focus-visible + .cf-cell, .cf-col input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-col { position: relative; }
.cf-col span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid var(--line); cursor: pointer; }
.cf-col input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.war-card { display: flex; flex-direction: column; gap: 10px; }
.war-card.active { border-color: rgba(var(--accent-rgb), .5); }
.war-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.war-vs > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.war-vs b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-x { font-weight: 900; color: var(--text-2); }
.war-awp { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.war-awp.big { font-size: 1.1rem; }
.war-side.won { border-color: rgba(255, 211, 107, .55); }

/* v1.18: invitaciones a ligas y clanes (se pueden tocar) y aviso de Premium */
.inv-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.inv-open .grow { min-width: 0; }
.cm-note .btn { margin-left: auto; flex: none; }
.card.link.prem-note { color: inherit; border-color: rgba(255, 211, 107, .45); background: linear-gradient(90deg, rgba(255, 211, 107, .10), transparent); }
.prem-note > svg:first-child { color: var(--gold); }
.prem-note > svg:last-child { margin-left: auto; color: var(--text-2); }
.prem-invite { display: grid; justify-items: center; gap: 8px; text-align: center; }
.prem-invite .hc-ic svg { width: 22px; height: 22px; }
.inv-prem { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .75rem; font-weight: 700; color: var(--gold); }
.inv-prem svg { width: 12px; height: 12px; }

/* v1.19: medallas por categorías */
.medal-cat { display: grid; gap: 10px; }
.medal-cat-head { display: flex; align-items: center; gap: 10px; }
.medal-cat-head h2 { font-size: 1.1rem; flex: 1; min-width: 0; }
.medal.unavailable { opacity: .6; }
.medal-na { display: flex; gap: 6px; align-items: flex-start; text-align: left; }
.medal-na svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

/* v1.20: categorías de medallas plegables */
.medal-cats { display: grid; gap: 10px; }
details.medal-cat { padding: 0; overflow: hidden; }
details.medal-cat > summary { list-style: none; cursor: pointer; padding: 14px 16px; }
details.medal-cat > summary::-webkit-details-marker { display: none; }
details.medal-cat > summary > svg:last-child { width: 18px; height: 18px; color: var(--text-2); transition: transform .2s ease; }
details.medal-cat[open] > summary > svg:last-child { transform: rotate(180deg); }
details.medal-cat .medal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 0 12px 14px; }
.modal details.medal-cat .medal-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* v1.20: Retos Atom Xtreme por niveles */
.xt-lv { display: inline-block; font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.lv-xtreme .xt-lv, .xt-lg.lv-xtreme { color: #ff4d7d; }
.lv-elite .xt-lv, .xt-lg.lv-elite { color: #3cc8ff; }
.lv-legendario .xt-lv, .xt-lg.lv-legendario { color: #ffc23d; }
.ch-card.xtreme.lv-elite { border-color: rgba(60, 200, 255, .45); background: linear-gradient(160deg, rgba(0, 184, 255, .10), transparent 55%), var(--surface); }
.ch-card.xtreme.lv-legendario { border-color: rgba(255, 194, 61, .55); background: linear-gradient(160deg, rgba(255, 194, 61, .14), transparent 55%), var(--surface); box-shadow: 0 0 22px rgba(255, 194, 61, .10); }
.ch-card.xtreme.xt-off { opacity: .78; }
.ch-card.xtreme .cat-dot { background: none; }
.ch-card.xtreme .cat-dot .xt-badge { width: 34px; height: 34px; }
.xt-item .xt-lv { margin-top: 2px; }
.xt-item.lv-elite .xt-badge { filter: drop-shadow(0 3px 8px rgba(0, 184, 255, .35)); }
.xt-item.lv-legendario .xt-badge { filter: drop-shadow(0 3px 10px rgba(255, 194, 61, .45)); }
.xt-gate b { font-size: 1rem; }
.xt-on svg { color: #ff4d7d; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; }
.xt-lg { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.xt-lg .xt-badge { width: 20px; height: 20px; }
details.xt-block { display: grid; gap: 10px; }
details.xt-block > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
details.xt-block > summary::-webkit-details-marker { display: none; }
details.xt-block > summary b { flex: 1; min-width: 0; }
details.xt-block > summary > svg:last-child { width: 18px; height: 18px; color: var(--text-2); transition: transform .2s ease; }
details.xt-block[open] > summary > svg:last-child { transform: rotate(180deg); }
.xt-bn { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

/* v1.21: Atom Admin, insignia Creador, comunicados */
.creator-tag { display: inline-flex; align-items: center; gap: 6px; margin: 4px auto 2px; padding: 4px 12px 4px 6px; border-radius: 999px; font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: #ffd36b; background: linear-gradient(90deg, rgba(255, 194, 61, .18), rgba(255, 194, 61, .06)); border: 1px solid rgba(255, 211, 107, .55); box-shadow: 0 0 18px rgba(255, 194, 61, .18); }
.creator-tag.team { color: var(--accent-text); border-color: rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .10); box-shadow: none; padding-left: 10px; }
.creator-tag .creator-badge { width: 22px; height: 22px; }
.creator-tag svg:not(.creator-badge) { width: 14px; height: 14px; }
.creator-mini svg { width: 14px; height: 14px; color: #ffc23d; vertical-align: -2px; }
.card.announce { border-color: rgba(var(--accent-rgb), .45); background: linear-gradient(160deg, rgba(var(--accent-rgb), .10), transparent 60%), var(--surface); }
.card.announce h3 { margin-top: 4px; }
.card.announce.personal-msg .icon-btn { width: 32px; height: 32px; margin: -6px -6px 0 auto; flex: none; }
.card.announce .msg-body { white-space: pre-line; overflow-wrap: anywhere; } /* mensaje personal: respeta los saltos de línea */
.ad-msg-body { white-space: pre-line; overflow-wrap: anywhere; }
.ad-title { display: flex; align-items: center; gap: 12px; }
.ad-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #ffd36b; background: linear-gradient(145deg, rgba(255, 194, 61, .22), rgba(255, 194, 61, .06)); border: 1px solid rgba(255, 211, 107, .45); flex: none; }
.ad-logo svg { width: 22px; height: 22px; }
.card.link.ad-entry { display: flex; flex-direction: row; align-items: center; gap: 12px; border-color: rgba(255, 211, 107, .45); }
.ad-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.ad-tabs a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; color: inherit; text-decoration: none; }
.ad-tabs a svg { width: 16px; height: 16px; }
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ad-tiles .stat { padding: 10px; border-radius: 12px; background: var(--bg-2); }
.ad-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 120px; }
.ad-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: .7rem; color: var(--text-2); }
.ad-bar i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); }
.ad-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.ad-kv span { color: var(--text-2); }
.ad-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.ad-custom { display: inline-flex; gap: 6px; align-items: center; }
.ad-custom .input { width: 90px; }
.ad-user .tag, .ad-org .tag { flex: none; }
.ad-org { flex-wrap: wrap; }
.ad-error { display: flex; gap: 12px; align-items: center; }
.ad-error > svg { width: 22px; height: 22px; color: var(--warn, #ffb300); flex: none; }
.ad-error > div { flex: 1; }
.ad-audit.bad b { color: var(--warn, #ffb300); }
.mfa-secret { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-size: 1.05rem; letter-spacing: .12em; word-break: break-all; user-select: all; }
.mfa-input { font-size: 1.4rem; letter-spacing: .4em; text-align: center; max-width: 220px; }
.tag.danger { color: #ff6b6b; border-color: rgba(255, 107, 107, .45); }
.ad-role { display: inline-flex; align-items: center; gap: 6px; }
.ad-role .input { width: auto; padding: 6px 10px; }

/* v1.22: app conectada (aviso sin conexión), confirmar correo e importar datos del móvil */
.net-bar { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 900; max-width: calc(100% - 32px);
  padding: 8px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #1a1205; background: #ffc23d; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); text-align: center; }
@media (min-width: 900px) { .net-bar { bottom: 20px; } }
.verify-note { align-items: center; }
.verify-note .btn { flex: none; margin-left: auto; }
.card.import-card { border-color: rgba(var(--accent-rgb), .45); }

/* v1.23: campo de nombre de usuario con «@» delante */
.at-input { position: relative; display: flex; align-items: center; }
.at-input > span { position: absolute; left: 12px; color: var(--text-2); font-weight: 600; pointer-events: none; }
.at-input > .input { padding-left: 28px; width: 100%; }

/* v1.23: Smart Builder — rutina pulsable y diálogo «¿Qué quieres cambiar?» */
.sb-open { display: block; color: inherit; text-decoration: none; }
.sb-open:active { opacity: .85; }
.sb-open h3 { margin-bottom: 2px; }
.adj-sec summary { display: flex; flex-direction: column; gap: 2px; cursor: pointer; padding: 6px 0; }
.adj-routine { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.adj-routine .eyebrow { flex-basis: 100%; }
.adj-ex span { font-size: .82rem; }

/* v1.24: estadísticas de carrera */
.run-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.run-tiles > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface-2, rgba(255,255,255,.03)); border: 1px solid var(--line); }
.run-tiles b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.run-tiles span { font-size: .72rem; color: var(--text-2); }
#st-run .list-item { gap: 10px; }
@media (max-width: 360px) { .run-tiles { grid-template-columns: repeat(2, 1fr); } }

/* v1.25: buscador de ejercicios */
.ex-search { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ex-search svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.ex-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; padding: 12px 0; outline: none; }
.ex-search:focus-within { border-color: var(--accent); }

/* v1.25: permisos del teléfono */
.perm-list { display: flex; flex-direction: column; gap: 4px; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.perm-dot svg { width: 16px; height: 16px; }
.perm-dot.ok { background: rgba(var(--accent-rgb), .15); color: var(--accent); }
.perm-dot.warn { background: rgba(255, 179, 0, .14); color: var(--warn, #ffb300); }
.perm-dot.bad { background: rgba(255, 61, 113, .14); color: var(--danger); }

/* Atom Smart Builder v1.26: resumen del plan */
.sb-plan h3 { font-size: 1.05rem; }
.sb-weekly { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.sb-vol { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; background: var(--bg-2); }
.sb-vol b { font-variant-numeric: tabular-nums; }
.sb-vol.ok b { color: var(--accent); }
.sb-vol.low { border-style: dashed; color: var(--muted); }
.sb-limits { border: 1px solid var(--line); border-left: 3px solid var(--warn, #e0a100); border-radius: 12px; padding: 10px 12px; background: var(--bg-2); }
.sb-limits b { display: inline-flex; gap: 6px; align-items: center; }
.sb-limits ul { margin: 6px 0 0 18px; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.tag.ok { color: var(--accent); }

/* v1.27: casillas de consentimiento (registro, altura y peso) */
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; line-height: 1.45; color: var(--text); cursor: pointer; }
.consent-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.consent-links { margin: -4px 0 0 30px; }
.consent-links a { color: var(--accent); }
.consent-warn { margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }

/* v1.27: mensaje del equipo al regalar Premium (aviso de Inicio y pantalla Premium) */
.gift-msg { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--gold); border-radius: 8px; background: rgba(255, 211, 107, .08); color: var(--text); font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.gift-card .eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.gift-card .eyebrow svg { width: 16px; height: 16px; }

/* v1.27: «Instalar la app» (descarga del APK en Android, pantalla de inicio en iPhone) */
.install-link { margin: 14px auto 0; display: flex; }
.install-steps { margin: 4px 0 6px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.install-steps li::marker { color: var(--accent); font-weight: 700; }
.ios-ico { display: inline-flex; vertical-align: -3px; color: var(--accent); }
.ios-ico svg { width: 18px; height: 18px; }
.install-card .eyebrow svg { width: 16px; height: 16px; vertical-align: -3px; }
code.sha { font-size: 10px; word-break: break-all; opacity: .8; }
