/*
 * Brote · consultorio de nutrición (nombre provisional)
 * Mismo lenguaje que el área personal del gym (gym-hibrido/public/assets/css): oscuro por
 * defecto, tarjetas de negro cálido, lo que se toca con degradado y brillo, lo secundario en
 * gris Oxford y botones de 48 px. Aquí el dorado del gym se vuelve verde hoja; encima del
 * verde el texto va oscuro (--on-go), igual que en el gym va oscuro sobre el dorado.
 */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('assets/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('assets/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ───────────── 1. Tokens ───────────── */
:root {
  color-scheme: dark;
  --page: #070a07;
  --card: #111611;
  --card-2: #182018;
  --line: oklch(1 0 0 / 0.08);
  --line-strong: oklch(1 0 0 / 0.16);
  --ink: #f2f7ef;
  --muted: #a3ae9e;
  --soft: #1f281e;

  /* Verde hoja: lo que se toca (en el gym es el dorado) */
  --go-from: #d3f8a6;
  --go: #7ddc5e;
  --go-to: #36a548;
  --go-grad: linear-gradient(135deg, var(--go-from), var(--go) 50%, var(--go-to));
  --on-go: #06260b;
  --go-ink: #a6eb88;            /* texto verde sobre negro */
  --leaf-300: #9cdb8e;
  --leaf-500: #46b343;

  --honey: #e0b43a;             /* filos finos y eyebrows */
  --honey-ink: #ecc970;

  --gloss: radial-gradient(120% 85% at 18% 0%, oklch(1 0 0 / 0.55), oklch(1 0 0 / 0) 55%);
  --gloss-edge: inset 0 1px 0 oklch(1 0 0 / 0.55), inset 0 0 0 1px oklch(1 0 0 / 0.14);
  --gloss-soft: radial-gradient(120% 90% at 18% 0%, oklch(1 0 0 / 0.26), oklch(1 0 0 / 0) 58%);
  --oxford: linear-gradient(165deg, #646a74 0%, #3c4149 52%, #2a2d33 100%);
  --oxford-hi: linear-gradient(165deg, #717783 0%, #464c55 52%, #30343a 100%);
  --oxford-ink: #f4f5f7;
  --oxford-edge: inset 0 1px 0 oklch(1 0 0 / 0.3), inset 0 0 0 1px oklch(1 0 0 / 0.07), 0 8px 18px -10px oklch(0 0 0 / 0.7);
  /* Grafito metálico: lo que se toca y no está elegido. Lo elegido va en verde sólido. */
  --metal: linear-gradient(165deg, #434a42 0%, #272d26 52%, #181c18 100%);
  --metal-hi: linear-gradient(165deg, #50584f 0%, #2f362e 52%, #1d221c 100%);
  --metal-filo: linear-gradient(160deg, oklch(1 0 0 / 0.34), oklch(1 0 0 / 0.07) 42%, color-mix(in oklab, var(--go) 38%, transparent));
  --metal-filo-hi: linear-gradient(160deg, color-mix(in oklab, var(--go-from) 80%, transparent), oklch(1 0 0 / 0.1) 45%, color-mix(in oklab, var(--go) 70%, transparent));
  --metal-ink: #eef3eb;
  --metal-shadow: inset 0 1px 0 oklch(1 0 0 / 0.16), 0 8px 18px -10px oklch(0 0 0 / 0.8);

  /* Macros: los mismos del gym, siempre con su nombre */
  --mac-p: #ef4f6f;   /* proteína: rubí */
  --mac-c: #e2a514;   /* carbohidratos: dorado */
  --mac-f: #4b97ee;   /* grasa: azul */
  --mac-v: #5fcf6b;   /* verdura y fruta */

  --ok: #6ee787;   --ok-bg: rgb(70 179 67 / 0.17);
  --warn: #fdba74; --warn-bg: rgb(249 115 22 / 0.16);
  --bad: #fca5a5;  --bad-bg: rgb(239 68 68 / 0.15);
  --info: #7dd3fc; --info-bg: rgb(14 165 233 / 0.15);

  --glass-glow: oklch(1 0 0 / 0.05);
  --shadow-card: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 8px 24px -12px oklch(0 0 0 / 0.6);
  --shadow-pop: 0 24px 60px -20px oklch(0 0 0 / 0.8);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --radius-card: 1.25rem;
  --radius-field: 0.875rem;
  --radius-full: 999px;
  --tap: 48px;
  --tap-lg: 56px;
  --text-sm: 0.8125rem;
}

[data-theme="light"] {
  --metal: linear-gradient(165deg, #ffffff 0%, #eef3ec 55%, #dde6da 100%);
  --metal-hi: linear-gradient(165deg, #ffffff 0%, #e6efe2 55%, #d2dfcd 100%);
  --metal-filo: linear-gradient(160deg, oklch(0 0 0 / 0.07), oklch(0 0 0 / 0.17) 55%, color-mix(in oklab, var(--go-to) 50%, transparent));
  --metal-filo-hi: linear-gradient(160deg, color-mix(in oklab, var(--go) 60%, transparent), oklch(0 0 0 / 0.12) 50%, var(--go-to));
  --metal-ink: #1a2419;
  --metal-shadow: inset 0 1px 0 #fff, 0 6px 14px -9px oklch(0 0 0 / 0.35);
  color-scheme: light;
  --page: #f3f6f1;
  --card: #ffffff;
  --card-2: #f4f8f2;
  --line: oklch(0 0 0 / 0.07);
  --line-strong: oklch(0 0 0 / 0.14);
  --ink: #111611;
  --muted: #5b6656;
  --soft: #e8eee5;
  --go-ink: #23772f;
  --honey-ink: #85650f;
  --ok: #1d6b2a;   --ok-bg: #dcf5d3;
  --warn: #9a3412; --warn-bg: #ffedd5;
  --bad: #b91c1c;  --bad-bg: #fee2e2;
  --info: #075985; --info-bg: #e0f2fe;
  --glass-glow: oklch(1 0 0 / 0.6);
  --shadow-card: 0 1px 2px oklch(0 0 0 / 0.04), 0 14px 34px -18px oklch(0.3 0.06 145 / 0.25);
  --mac-p: #d42a4f; --mac-c: #b07d00; --mac-f: #2a78d6; --mac-v: #2f963a;
}

/* ───────────── 2. Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--page); color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif; font-optical-sizing: auto;
  font-size: 1rem; line-height: 1.5; letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; isolation: isolate;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 100% 0%, color-mix(in oklab, var(--go) 14%, transparent), transparent 70%),
    radial-gradient(45% 40% at 0% 100%, color-mix(in oklab, var(--honey) 8%, transparent), transparent 70%);
}
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, video { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.tnum { font-variant-numeric: tabular-nums; }

/* ───────────── 3. Piezas ───────────── */
.card {
  border-radius: var(--radius-card); background-color: var(--card);
  background-image: linear-gradient(180deg, var(--glass-glow), transparent 40%);
  border: 1px solid var(--line); box-shadow: var(--shadow-card); padding: 16px;
}
.card-glow { box-shadow: var(--shadow-card), 0 0 0 1px color-mix(in oklab, var(--go) 35%, transparent), 0 18px 50px -24px color-mix(in oklab, var(--go) 60%, transparent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--honey-ink); }
.h-xl { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.035em; }
.h-lg { font-size: 1.3rem; font-weight: 800; }
.h-md { font-size: 1.05rem; font-weight: 750; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.stack-lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: 0 1.25rem; border: 0; border-radius: var(--radius-full);
  font-weight: 650; font-size: 1rem; white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 300ms var(--ease-spring), filter 200ms, background-color 200ms, box-shadow 200ms;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform 300ms var(--ease-spring); }
.btn:hover svg { transform: scale(1.1); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn:focus-visible, .pill:focus-visible, .chip:focus-visible, .tick:focus-visible, .react:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--go); outline-offset: 2px; }
.btn-lg { min-height: var(--tap-lg); font-size: 1.0625rem; padding: 0 1.5rem; }
.btn-sm { min-height: 40px; padding: 0 1rem; font-size: var(--text-sm); }
.btn-block { width: 100%; }
.btn-primary { background-image: var(--gloss), var(--go-grad); color: var(--on-go); box-shadow: var(--gloss-edge), 0 10px 24px -12px var(--go); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background-image: var(--gloss-soft), var(--oxford); color: var(--oxford-ink); box-shadow: var(--oxford-edge); }
.btn-secondary:hover { background-image: var(--gloss-soft), var(--oxford-hi); }
.btn-ghost { background: transparent; color: var(--go-ink); }
.btn-ghost:hover { background: color-mix(in oklab, var(--go) 10%, transparent); }
/* Botón principal con el ícono en un círculo oscuro a la derecha (el «Siguiente ejercicio» del gym) */
.btn-cta { justify-content: space-between; padding: 0 .35rem 0 1.5rem; }
.btn-cta .cta-dot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--on-go); color: var(--go-from); }

.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 22px; height: 22px; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: .25rem 1rem .25rem .3rem;
  border: 0; border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 650; cursor: pointer; white-space: nowrap;
  background-image: var(--gloss-soft), var(--oxford); color: var(--oxford-ink); box-shadow: var(--oxford-edge);
  transition: transform 300ms var(--ease-spring);
}
.pill:hover { background-image: var(--gloss-soft), var(--oxford-hi); }
.pill:active { transform: scale(.96); }
.pill-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; transition: transform 300ms var(--ease-spring); background: oklch(1 0 0 / .12); }
.pill:hover .pill-icon { transform: rotate(-12deg) scale(1.08); }
.pill-icon svg { width: 16px; height: 16px; }
.pill-go { background-image: var(--gloss), var(--go-grad); color: var(--on-go); box-shadow: var(--gloss-edge), 0 8px 18px -10px var(--go); }
.pill-go .pill-icon { background: oklch(0 0 0 / .14); }
.pill-quiet { background: color-mix(in oklab, var(--go) 14%, var(--card)); background-image: none; color: var(--go-ink); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--go) 30%, transparent); }
.pill-quiet .pill-icon { background: color-mix(in oklab, var(--go) 20%, transparent); }
.pill-danger { background: var(--bad-bg); background-image: none; color: var(--bad); box-shadow: inset 0 0 0 1px rgb(239 68 68 / .3); }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; padding: 0 1rem;
  border-radius: var(--radius-full); border: 1px solid var(--line-strong); background: var(--card-2);
  color: var(--muted); font-size: var(--text-sm); font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: transform 300ms var(--ease-spring), background-color 200ms, color 200ms;
}
.chip:hover { color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"], .chip.is-on { color: var(--on-go); border-color: transparent; background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge), 0 8px 18px -12px var(--go); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips-scroll { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }

.input {
  display: block; width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-field);
  border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ink); font-size: 1rem;
}
.input:focus { outline: none; border-color: var(--go); box-shadow: 0 0 0 3px color-mix(in oklab, var(--go) 22%, transparent); }
textarea.input { padding: 12px 14px; resize: vertical; min-height: 3.2rem; }
.input-sm { min-height: 40px; font-size: .9rem; }
.field { display: grid; gap: 6px; }
.field > label { font-size: var(--text-sm); font-weight: 600; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; border-radius: var(--radius-full); padding: .2rem .65rem; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.badge svg { width: 14px; height: 14px; flex-shrink: 0; }
.badge-wrap { white-space: normal; line-height: 1.3; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-gray { background: var(--soft); color: var(--muted); }
.tone-go { background-image: var(--gloss), var(--go-grad); color: var(--on-go); }

/* Ícono en caja con brillo (como el logo del gym) */
.gbox { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; color: #fff; background-image: var(--gloss), var(--tone, var(--go-grad)); box-shadow: var(--gloss-edge), 0 8px 16px -8px var(--tone-shadow, var(--go)); }
.gbox svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .25)); }
.gbox-sm { width: 34px; height: 34px; border-radius: 11px; }
.gbox-sm svg { width: 17px; height: 17px; }
.t-break  { --tone: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706); --tone-shadow: #f59e0b; color: #3a2100; }
.t-snack  { --tone: linear-gradient(135deg, #99f6e4, #14b8a6 55%, #0f766e); --tone-shadow: #14b8a6; }
.t-lunch  { --tone: var(--go-grad); --tone-shadow: var(--go); color: var(--on-go); }
.t-snack2 { --tone: linear-gradient(135deg, #fed7aa, #fb923c 55%, #ea580c); --tone-shadow: #fb923c; color: #3b1300; }
.t-dinner { --tone: linear-gradient(135deg, #c7d2fe, #818cf8 55%, #4f46e5); --tone-shadow: #818cf8; }
.t-blue   { --tone: linear-gradient(135deg, #bae6fd, #38bdf8 55%, #0284c7); --tone-shadow: #38bdf8; }
.t-ruby   { --tone: linear-gradient(135deg, #fecdd3, #fb7185 55%, #e11d48); --tone-shadow: #fb7185; }
.t-violet { --tone: linear-gradient(135deg, #ddd6fe, #a78bfa 55%, #7c3aed); --tone-shadow: #a78bfa; }

.mac-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.macros { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.macros strong { color: var(--ink); }
.macros span { display: inline-flex; align-items: center; gap: .3rem; }

/* Barras de una sola pieza con reflejo */
.bar { position: relative; display: flex; height: 12px; overflow: hidden; border-radius: 999px; background: var(--soft); box-shadow: inset 0 1px 2px rgb(0 0 0 / .25); }
.bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgb(255 255 255 / .35), transparent 55%); pointer-events: none; }
.bar > span { height: 100%; transition: width 600ms var(--ease-out-expo); }

.note { border-radius: 1rem; padding: 12px 14px; background: var(--card-2); box-shadow: inset 3px 0 0 var(--honey), inset 0 0 0 1px var(--line); font-size: .92rem; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.anim .enter { animation: rise 650ms var(--ease-out-expo) both; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
/* «Reducir movimiento» (también lo pide Windows en modo de mejor rendimiento): las entradas se quedan, pero cortas y sin desenfoque */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .3s !important; transition-duration: .3s !important; }
  .pm-img, .pm-word, .rcard.pm-stagger { filter: none !important; }
}

/* Capa premium (pulido.js pone estas clases; sin JS o con «reducir movimiento» no aparecen) */
.pm-img { opacity: 0; scale: 1.08; filter: blur(6px); transition: opacity .7s var(--ease-out-expo), scale 1.4s var(--ease-out-expo), filter .9s var(--ease-out-expo); }
.pm-img.pm-loaded { opacity: 1; scale: 1; filter: none; }
.pm-cur { clip-path: inset(100% 0 0 0); transition: clip-path 1.2s var(--ease-out-expo) var(--pm-d, 0ms); }
.pm-cur > img { scale: 1.14; transition: scale 1.6s var(--ease-out-expo) var(--pm-d, 0ms); }
.pm-cur.pm-in { clip-path: inset(0 0 0 0); }
.pm-cur.pm-in > img { scale: 1; }
.pm-up, .anim .enter.pm-up { opacity: 0; translate: 0 28px; animation: none; transition: opacity .8s var(--ease-out-expo) var(--pm-d, 0ms), translate 1s var(--ease-out-expo) var(--pm-d, 0ms), transform 300ms var(--ease-spring), box-shadow .4s; }
.pm-up.pm-in { opacity: 1; translate: 0 0; }
@keyframes pm-rise { from { opacity: 0; translate: 0 22px; scale: .97; filter: blur(4px); } to { opacity: 1; translate: 0 0; scale: 1; filter: none; } }
.rcard.pm-stagger, .anim .rcard.pm-stagger { animation: pm-rise .75s var(--ease-out-expo) var(--pm-d, 0ms) both; }
.pm-word { display: inline-block; animation: pm-word .9s var(--ease-out-expo) both; animation-delay: calc(var(--wi, 0) * 60ms + 120ms); }
@keyframes pm-word { from { opacity: 0; transform: translateY(.38em); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.pm-mag { translate: var(--pm-mx, 0px) var(--pm-my, 0px); transition: translate .3s var(--ease-spring), transform 300ms var(--ease-spring), filter 200ms, box-shadow 200ms; }
.card.pm-spot { background-image: radial-gradient(260px circle at var(--pm-sx, 50%) var(--pm-sy, 0), color-mix(in oklab, var(--go) 9%, transparent), transparent 70%), linear-gradient(180deg, var(--glass-glow), transparent 40%); }

/* ═════════════ Cascarón ═════════════ */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 8px clamp(16px, 3vw, 28px);
  background: color-mix(in oklab, var(--page) 80%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo .gbox { width: 40px; height: 40px; border-radius: 13px; color: var(--on-go); }
.logo-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.03em; line-height: 1.05; }
.logo-sub { font-size: .7rem; color: var(--muted); font-weight: 500; }
.switch { display: inline-flex; gap: 4px; padding: 4px; margin-left: auto; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.switch .chip { border: 0; background-color: transparent; min-height: 38px; }
.top-right { display: flex; align-items: center; gap: 6px; }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; font-weight: 750; font-size: .8rem; color: var(--on-go); background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge); }
.avatar-honey { color: #2a1d00; background-image: var(--gloss), linear-gradient(135deg, #fde68a, #e0b43a 55%, #a87b13); }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }

.wrap { max-width: 84rem; margin: 0 auto; padding: 20px clamp(16px, 3vw, 28px) 96px; }

/* ═════════════ Vista nutrióloga ═════════════ */
.pro { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr) 22rem; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 84px; }
.plist { display: grid; gap: 4px; }
.pitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 16px; background: transparent; text-align: left; cursor: pointer; }
.pitem:hover { background: var(--soft); }
.pitem[aria-current="true"] { background: color-mix(in oklab, var(--go) 12%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--go) 35%, transparent); }
.pitem b { display: block; font-size: .92rem; line-height: 1.2; }
.pitem small { color: var(--muted); font-size: .76rem; }
.pitem .ring { margin-left: auto; }

.phero { position: relative; overflow: hidden; padding: 20px; }
.phero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 120% at 100% 0%, color-mix(in oklab, var(--go) 22%, transparent), transparent 60%); pointer-events: none; }
.phero > * { position: relative; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stat { padding: 12px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .74rem; color: var(--muted); }
.stat .up { color: var(--ok); }

.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs .chip { border: 0; background-color: transparent; flex: 1; }

.meal-ed { padding: 0; overflow: hidden; }
.meal-ed-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.meal-ed-body { padding: 0 16px 16px; display: grid; gap: 10px; }
.opt-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dish-name { width: 100%; border: 0; background: transparent; font-weight: 750; font-size: 1.05rem; padding: 6px 8px; margin-left: -8px; border-radius: 10px; letter-spacing: -0.02em; }
.dish-name:hover, .dish-name:focus { outline: none; background: var(--card-2); box-shadow: inset 0 -2px 0 var(--go); }
.ed-grid { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 14px; align-items: start; }
.ing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ing { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 10px 8px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.ing-name { font-weight: 650; font-size: .92rem; line-height: 1.25; }
.ing-name small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.ing-amount { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; grid-column: 2 / -1; }
.ing-amount .chip { min-height: 32px; padding: 0 .7rem; font-size: .76rem; }
.ing-g { width: 5.2rem; min-height: 34px; text-align: center; font-weight: 700; padding: 0 6px; }
.ing-kcal { text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ing-kcal b { display: block; color: var(--ink); font-size: .9rem; }
.ing-tools { grid-column: 2 / -1; display: flex; gap: 2px; margin-left: -8px; }
.tool { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.tool svg { width: 16px; height: 16px; }
.tool:hover { background: var(--soft); color: var(--ink); }
.tool-danger:hover { background: var(--bad-bg); color: var(--bad); }
.tool:disabled { opacity: .3; cursor: default; }

.picker { border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); padding: 12px; display: grid; gap: 10px; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 18rem; overflow: auto; }
.res { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.res:hover { background: var(--soft); }
.res b { font-size: .9rem; font-weight: 650; }
.res small { display: block; color: var(--muted); font-size: .74rem; }
.res .cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.kcal-big { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge { display: grid; place-items: center; position: relative; }
.gauge-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.mrow { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; }
.mrow b { text-align: right; font-variant-numeric: tabular-nums; }
.mrow .bar { height: 10px; }

.follow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.follow-meal { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.follow-ings { display: flex; flex-wrap: wrap; gap: 4px; }
.follow-ings .badge { font-size: .7rem; }

/* ═════════════ Vista paciente ═════════════ */
.pt { max-width: 36rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pt-nav { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); position: sticky; top: 76px; z-index: 30; }
.pt-nav .chip { flex: 1; border: 0; background-color: transparent; min-height: 44px; }
.hello { padding: 20px; position: relative; overflow: hidden; }
.hello::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in oklab, var(--go) 35%, transparent), transparent 70%); pointer-events: none; }
.ring-wrap { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring-wrap .gauge-label { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; }
.ring-wrap .gauge-label small { display: block; font-size: .62rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }


.meal { padding: 0; overflow: hidden; }
.meal.is-done { box-shadow: var(--shadow-card), 0 0 0 1px color-mix(in oklab, var(--go) 40%, transparent); }
.meal-photo { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #050705; }
.meal-photo img { width: 100%; height: 100%; object-fit: cover; }
.meal-photo .plate-art { width: 100%; height: 100%; }
.meal-photo .photo-tag { position: absolute; left: 12px; bottom: 12px; }
.meal-photo .time-tag { position: absolute; right: 12px; top: 12px; background: rgb(0 0 0 / .55); color: #fff; backdrop-filter: blur(8px); }
.meal-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / .55)); pointer-events: none; }
.meal-photo > * { z-index: 1; }
.meal-body { padding: 16px; display: grid; gap: 14px; }
.meal-title { display: flex; align-items: center; gap: 12px; }
.prog-mini { display: flex; gap: 3px; }
.prog-mini i { width: 18px; height: 6px; border-radius: 99px; background: var(--soft); }
.prog-mini i.on { background-image: var(--go-grad); }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tick {
  display: grid; grid-template-columns: 1fr auto 40px; align-items: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 6px 8px 6px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card-2); text-align: left; cursor: pointer; transition: background 250ms, border-color 250ms, transform 300ms var(--ease-spring);
}
.tick:active { transform: scale(.98); }
.tick b { display: block; font-weight: 650; font-size: .95rem; line-height: 1.2; }
.tick small { color: var(--muted); font-size: .78rem; }
.tick .tick-kcal { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tick .box { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line-strong); color: transparent; transition: all 300ms var(--ease-spring); }
.tick .box svg { width: 20px; height: 20px; stroke-dasharray: 30; stroke-dashoffset: 30; }
.tick[aria-pressed="true"] { background: color-mix(in oklab, var(--go) 10%, var(--card-2)); border-color: color-mix(in oklab, var(--go) 40%, transparent); }
.tick[aria-pressed="true"] b { color: var(--go-ink); }
.tick[aria-pressed="true"] .box { border-color: transparent; color: var(--on-go); background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge), 0 6px 14px -6px var(--go); }
.tick[aria-pressed="true"] .box svg { animation: draw 400ms var(--ease-out-expo) forwards; }

.reacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.react { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; font-size: .76rem; font-weight: 650; color: var(--muted); transition: transform 300ms var(--ease-spring), background 200ms; }
.react svg { width: 46px; height: 46px; filter: grayscale(.55) brightness(.85); transition: filter 300ms, transform 300ms var(--ease-spring); }
.react:hover svg { filter: none; transform: translateY(-2px) rotate(-4deg); }
.react[aria-pressed="true"] { color: var(--ink); background: color-mix(in oklab, var(--react, var(--go)) 14%, var(--card-2)); border-color: color-mix(in oklab, var(--react, var(--go)) 55%, transparent); }
.react[aria-pressed="true"] svg { filter: none; animation: pop 450ms var(--ease-spring); }
.react-no { --react: #9ca3af; }
.react-ok { --react: #fbbf24; }
.react-love { --react: #fb7185; }

/* Actividad (del área personal del gym) */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; }
.week i { display: grid; place-items: center; margin: 4px auto 0; width: 34px; height: 34px; border-radius: 50%; background: var(--soft); font-style: normal; color: var(--muted); }
.week i.done { background-image: var(--gloss), var(--go-grad); color: var(--on-go); box-shadow: var(--gloss-edge); }
.week i.today { box-shadow: 0 0 0 2px var(--go); color: var(--ink); }
.week i svg { width: 16px; height: 16px; }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--card-2); text-align: left; cursor: pointer; }
.ex img { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; background: #000; }
.ex b { font-size: .95rem; }
.ex small { display: block; color: var(--muted); font-size: .78rem; }
.ex.is-done { border-color: color-mix(in oklab, var(--go) 40%, transparent); }
.muscles { display: flex; flex-wrap: wrap; gap: 4px; }
.mtag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: .72rem; font-weight: 650; background: color-mix(in oklab, var(--m) 16%, transparent); color: color-mix(in oklab, var(--m) 75%, white); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--m) 40%, transparent); }
[data-theme="light"] .mtag { color: color-mix(in oklab, var(--m) 80%, black); }
.mtag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--m); }

/* Recetario: tarjetas con foto (o el plato dibujado), calorías y botón «Usar» a la derecha */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 12px; }
.rcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform 450ms var(--ease-spring), box-shadow 400ms var(--ease-out-expo), opacity .8s var(--ease-out-expo) var(--pm-d, 0ms), translate 1s var(--ease-out-expo) var(--pm-d, 0ms); }
.rcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-card), 0 0 0 1px color-mix(in oklab, var(--go) 28%, transparent), 0 22px 44px -22px color-mix(in oklab, var(--go) 55%, transparent); }
.rcard-open { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
/* 4:3 para que el plato quepa completo, venga la foto cuadrada o ancha */
.rcard-open .meal-photo { display: block; aspect-ratio: 4 / 3; }
.rcard-body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.rcard-body b { font-size: .95rem; line-height: 1.25; }
.rcard-body small { font-size: .74rem; }
.rcard-open .meal-photo img, .rcard-open .plate-art { transition: transform 600ms var(--ease-out-expo); }
.rcard-open:hover .meal-photo img, .rcard-open:hover .plate-art { transform: scale(1.04); }
.rcard-use { margin: 0 14px 14px auto; }
.rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rlist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.rlist li .muted { text-align: right; }

/* Programas del gym para elegir */
.prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); text-align: left; cursor: pointer; }
.prog small { grid-column: 1; color: var(--muted); font-size: .76rem; }
.prog .badge { grid-row: 1 / span 2; grid-column: 2; }
.prog.is-on { box-shadow: inset 0 0 0 2px var(--go); }
.week i.plan { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--go) 60%, transparent); color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #000; }

/* Medidas */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.meas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.meas .stat b small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.body-art { width: 100%; max-width: 15rem; margin: 0 auto; border-radius: 18px; background: #000; }

/* Hoja (modal) */
.sheet-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; background: rgb(0 0 0 / .6); backdrop-filter: blur(4px); animation: rise 300ms var(--ease-out-expo); }
.sheet { width: min(100%, 34rem); max-height: 92dvh; overflow: auto; border-radius: 24px 24px 0 0; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.sheet video, .sheet .sheet-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.sheet-body { padding: 18px; display: grid; gap: 14px; }
@media (min-width: 700px) { .sheet-back { place-items: center; } .sheet { border-radius: 24px; } }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-weight: 600; display: flex; gap: 8px; align-items: center; animation: rise 400ms var(--ease-out-expo); }
.toast svg { width: 18px; height: 18px; color: var(--go-ink); }

.bottom-nav { display: none; }

/* ───────────── Pacientes y calendario ───────────── */
.pro-nav { display: flex; gap: .4rem; margin-bottom: 16px; }
.pro-nav .chip svg { width: 16px; height: 16px; }
.pro-nav .chip .badge { padding: .05rem .45rem; font-size: .7rem; }
.pro-nav .chip[aria-pressed="true"] .badge { background: oklch(0 0 0 / .16); background-image: none; color: inherit; }
.pitem-add { margin-top: 4px; border: 1.5px dashed color-mix(in oklab, var(--go) 40%, transparent); }
.pitem-add .avatar { background: color-mix(in oklab, var(--go) 16%, var(--card)); background-image: none; color: var(--go-ink); box-shadow: none; }
.pitem-add .avatar svg { width: 18px; height: 18px; }
.pitem-add:hover { background: color-mix(in oklab, var(--go) 8%, transparent); }
.badge-btn { border: 0; cursor: pointer; min-height: 30px; font: inherit; font-size: .75rem; font-weight: 650; transition: transform 300ms var(--ease-spring); }
.badge-btn:hover { transform: translateY(-1px); }

.agenda { display: grid; grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); gap: 20px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform 300ms var(--ease-spring), background 200ms; }
.cal-day:hover { background: var(--soft); }
.cal-day:active { transform: scale(.94); }
.cal-day.is-past { color: var(--muted); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--go); color: var(--go-ink); }
.cal-day.is-on { color: var(--on-go); background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge), 0 8px 18px -12px var(--go); }
.cal-dots { position: absolute; bottom: 5px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.cal-dots b { width: 5px; height: 5px; border-radius: 50%; background: currentColor; padding: 0; }
.cal-dots b.tone-ok { background: var(--ok); } .cal-dots b.tone-warn { background: var(--warn); }
.cal-dots b.tone-info { background: var(--info); } .cal-dots b.tone-gray { background: var(--muted); }
.cal-day.is-on .cal-dots b { background: var(--on-go); }
.appts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.appt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.appt-time { display: grid; min-width: 3.4rem; font-variant-numeric: tabular-nums; }
.appt-time b { font-size: 1rem; letter-spacing: -0.02em; }
.appt-time small, .appt .grow small { display: block; color: var(--muted); font-size: .76rem; }
.appt .grow b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt .grow small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 18px 8px; }
.empty .gbox { margin-bottom: 4px; }
.how { list-style: none; counter-reset: how; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; }
.how li::before { content: counter(how); grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; color: var(--on-go); background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge); }
.how b { font-size: .95rem; }

/* ───────────── Pasos y cardio ───────────── */
.moves .ring-wrap { width: 104px; height: 104px; }
.moves #steps { min-width: 0; flex: 1; }
.sbars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 140px; padding-bottom: 20px; }
.sbars::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(20px + (100% - 38px) * var(--goal) / 100%); border-top: 1.5px dashed color-mix(in oklab, var(--go) 60%, transparent); pointer-events: none; }
.sbars > span { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; padding-top: 18px; }
.sbars small { position: absolute; top: 0; font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sbars i { width: 100%; max-width: 30px; min-height: 3px; border-radius: 8px 8px 4px 4px; background: color-mix(in oklab, var(--go) 30%, var(--soft)); transition: height 600ms var(--ease-out-expo); }
.sbars .is-met i { background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge); }
.sbars em { position: absolute; bottom: -20px; font-style: normal; font-size: .7rem; font-weight: 650; color: var(--muted); text-transform: uppercase; }
.sbars .is-today em, .sbars .is-today small { color: var(--go-ink); font-weight: 750; }
.clist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.crow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.crow b { display: block; font-size: .9rem; }
.crow small { display: block; color: var(--muted); font-size: .76rem; }
.cardio-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: 10px; margin-top: 12px; align-items: end; }
.cardio-form .seg, .cardio-form .btn { grid-column: 1 / -1; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; border: 0; }
.seg legend { padding: 0 0 6px 2px; }
.seg label { padding: 4px 2px; background: var(--soft); }
.seg label:first-of-type { padding-left: 4px; border-radius: var(--radius-full) 0 0 var(--radius-full); }
.seg label:last-of-type { padding-right: 4px; border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; min-height: 40px; border-radius: var(--radius-full); font-size: .85rem; font-weight: 650; color: var(--muted); cursor: pointer; transition: background 200ms, color 200ms; }
.seg input:checked + span { color: var(--on-go); background-image: var(--gloss), var(--go-grad); box-shadow: var(--gloss-edge); }
.seg input:focus-visible + span { outline: 2px solid var(--go); outline-offset: 2px; }
.rx-row { gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }

/* ───────────── Editor de rutina ───────────── */
.day-ed { display: grid; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.ex-ed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex-ed { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.ex-ed-img { grid-row: span 2; align-self: start; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; }
.ex-ed-img img { display: block; width: 64px; height: 52px; object-fit: cover; transition: transform 300ms var(--ease-spring); }
.ex-ed-img:hover img { transform: scale(1.06); }
.ex-ed-main { min-width: 0; display: grid; gap: 4px; }
.ex-ed-main b { font-size: .92rem; line-height: 1.2; }
.ex-ed-nums { display: flex; gap: 6px; max-width: 20rem; }
.ex-ed-nums label { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ex-ed-nums label:nth-child(2) { flex: 1.5; }
.ex-ed-nums span { font-size: .66rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.ex-ed-nums .input { min-height: 38px; padding: 6px 8px; font-size: .9rem; text-align: center; }
.ex-ed .ing-tools { grid-column: 2; }
.btn-danger-text { color: var(--bad); }
.btn-danger-text:hover { background: var(--bad-bg); }

/* ───────────── Estadísticas avanzadas ───────────── */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); gap: 10px; }
.cstat { position: relative; display: grid; gap: 2px; padding: 12px 12px 8px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); overflow: hidden; }
.cstat-label { font-size: .74rem; font-weight: 650; color: var(--muted); }
.cstat b { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cstat b small { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.cstat-d { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cstat-d svg { width: 15px; height: 15px; }
.cstat.is-good { box-shadow: inset 3px 0 0 var(--ok); } .cstat.is-good .cstat-d { color: var(--ok); }
.cstat.is-bad { box-shadow: inset 3px 0 0 var(--warn); } .cstat.is-bad .cstat-d { color: var(--warn); }
.cstat.is-flat .cstat-d { color: var(--muted); }
.spark { display: block; width: 100%; height: 30px; margin-top: 4px; }
.lockcard { display: flex; align-items: flex-start; gap: 14px; box-shadow: var(--shadow-card), inset 3px 0 0 var(--honey); }
.lockcard b { font-size: 1rem; }
.lockcard p { margin: 4px 0 0; }
.ctable-wrap { margin-top: 14px; }
.ctable-wrap summary { cursor: pointer; font-weight: 650; font-size: .9rem; color: var(--go-ink); padding: 6px 0; }
.table-scroll { overflow-x: auto; margin-top: 8px; border-radius: 14px; border: 1px solid var(--line); }
.ctable { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.ctable th, .ctable td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.ctable thead th { font-size: .74rem; color: var(--muted); background: var(--card-2); text-transform: capitalize; }
.ctable tbody th { position: sticky; left: 0; text-align: left; font-weight: 650; background: var(--card); }
.ctable tbody th small { color: var(--muted); font-weight: 500; }
.ctable tr:last-child > * { border-bottom: 0; }
.meas-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ───────────── PDF con plantilla ───────────── */
.drop { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1.5px dashed color-mix(in oklab, var(--go) 45%, transparent); background: color-mix(in oklab, var(--go) 6%, var(--card-2)); cursor: pointer; transition: background 200ms; }
.drop:hover { background: color-mix(in oklab, var(--go) 11%, var(--card-2)); }
.drop:focus-within { outline: 2px solid var(--go); outline-offset: 2px; }
.drop b, .drop .small { display: block; }
.drop-ic, .tpl-ic { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; color: var(--go-ink); background: color-mix(in oklab, var(--go) 16%, transparent); }
.drop-ic svg, .tpl-ic svg { width: 22px; height: 22px; }
.tpl-on { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.tpl-on b { display: block; overflow-wrap: anywhere; }
.checks { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.checks legend { padding-bottom: 6px; }
.checks label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); font-weight: 600; font-size: .92rem; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--leaf-500); }

/* ───────────── Entrada y cuenta ───────────── */
body[data-rol="fuera"] .switch, body[data-rol="fuera"] .avatar-btn, body[data-rol="paciente"] .switch { display: none; }
body:not([data-rol="nutriologa"]) .top-right { margin-left: auto; }
.avatar-btn { border: 0; cursor: pointer; font: inherit; font-weight: 750; font-size: .8rem; transition: transform 300ms var(--ease-spring); }
.avatar-btn:hover { transform: translateY(-1px) scale(1.04); }
.avatar-btn:focus-visible { outline: 2px solid var(--go); outline-offset: 2px; }
.login { max-width: 26rem; margin: clamp(8px, 6vh, 64px) auto 0; padding: 28px 24px; display: grid; gap: 12px; text-align: left; }
.login .h-xl { margin: 0; }
.login > .muted { margin: 0 0 6px; }
.login-ic { width: 56px; height: 56px; border-radius: 18px; margin-bottom: 6px; }
.login-ic svg { width: 28px; height: 28px; }
.login-foot { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.input-lg { min-height: 56px; font-size: 1.15rem; font-weight: 650; letter-spacing: .02em; }
.input-code { text-align: center; font-size: 1.6rem; letter-spacing: .5em; padding-left: .5em; font-variant-numeric: tabular-nums; }
.empty-first { max-width: 32rem; margin: 24px auto; padding: 32px 24px; }
.empty-first .gbox { width: 56px; height: 56px; }

/* ───────────── Responsivo ───────────── */
@media (max-width: 1220px) {
  .pro { grid-template-columns: 16rem minmax(0, 1fr); }
  .pro > .sticky { position: static; }
  .pro > .side { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 16px; }
}
@media (max-width: 860px) {
  .pro { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .plist { display: flex; overflow-x: auto; scrollbar-width: none; }
  .pitem { width: auto; flex: 0 0 auto; }
  .pitem .ring { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-grid .meal-thumb { max-width: 14rem; }
  .logo-sub { display: none; }
  .agenda { grid-template-columns: minmax(0, 1fr); }
  .meas-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .switch { order: 3; width: 100%; margin: 0; }
  .switch .chip { flex: 1; }
  .top-right { margin-left: auto; }
  body[data-view="paciente"] .pt-nav { display: none; }
  body[data-view="paciente"] .bottom-nav {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 50; justify-content: space-around; padding: 6px;
    border-radius: 24px; background: color-mix(in oklab, var(--card) 94%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  }
  .bottom-nav button { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 6px 4px; border: 0; background: transparent; border-radius: 16px; color: var(--muted); font-size: .7rem; font-weight: 650; cursor: pointer; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav button[aria-current="page"] { color: var(--go-ink); background: color-mix(in oklab, var(--go) 13%, transparent); }
  .ing { grid-template-columns: auto minmax(0, 1fr); }
  .ing-kcal { grid-column: 2; text-align: left; }
  .pro-nav .chip { flex: 1; justify-content: center; }
  .ex-ed { grid-template-columns: 56px minmax(0, 1fr); }
  .ex-ed-img { grid-row: auto; }
  .ex-ed-img img { width: 56px; height: 46px; }
  .ex-ed-nums { grid-column: 1 / -1; }
  .ex-ed .ing-tools { grid-column: 1 / -1; margin-left: 0; }
  .appt { gap: 8px; }
  .appt .pill { padding-right: .3rem; }
  .appt .pill-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .appt-time { min-width: 2.9rem; }
  .moves form[data-act="steps-form"] { flex-wrap: wrap; justify-content: center; }
  .day-ed { padding: 10px; margin-inline: -4px; }
  .lockcard { flex-direction: column; }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cstat { padding: 10px 10px 6px; }
  .cstat b { font-size: 1.15rem; }
}

/* Cambio de pestaña: la pantalla vieja se desvanece y la nueva entra con sus propias animaciones */
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out .22s var(--ease-out-expo) both; }
::view-transition-new(root) { animation: vt-in .45s var(--ease-out-expo) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ───────────── Consulta: datos avanzados, plan de entrenamiento, suplementos (consulta.js) ───────────── */
.tabs { flex-wrap: wrap; border-radius: 22px; }
.tabs .chip { flex: 1 0 auto; white-space: nowrap; }
.btn-danger { color: #fff; background-image: var(--gloss), linear-gradient(135deg, #fca5a5, #ef4444 55%, #b91c1c); box-shadow: var(--gloss-edge); }
.badge-btn svg:last-child { width: 13px; height: 13px; opacity: .8; }

.ev-tools { flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.ev-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 12px; }
.evtable { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.evtable th, .evtable td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.evtable thead th { font-size: .7rem; color: var(--muted); background: var(--card-2); text-transform: uppercase; letter-spacing: .06em; }
.evtable tbody th { font-weight: 600; }
.evtable tbody th small { color: var(--muted); font-weight: 500; font-size: .7rem; }
.evtable td:nth-child(2) { font-weight: 700; white-space: nowrap; }
.evtable .ev-sec th { padding-top: 14px; font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--honey-ink); }
.evtable tr:last-child > * { border-bottom: 0; }
.ev-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 12px; margin-top: 14px; }
.ev-box { display: grid; gap: 10px; align-content: start; padding: 14px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.dot-m { background: var(--mac-p); } .dot-g { background: var(--mac-c); }
.segbody { --seg-on: color-mix(in oklch, var(--mac-p) 62%, var(--card)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "ra fig la" "rl fig ll"; gap: 8px; align-items: center; }
.seg-cell { display: grid; gap: 1px; padding: 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seg-cell b { font-size: .7rem; color: var(--muted); }
.seg-fig { display: grid; justify-items: center; gap: 6px; }
.seg-fig .seg-cell { justify-items: center; }
.seg-fig svg { width: 100%; max-width: 104px; height: auto; }
.ev-notes { margin: 0; padding-left: 18px; color: var(--warn); }
.phys { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.phys-y { display: flex; flex-direction: column; justify-content: space-between; padding: 6px 0; font-size: .66rem; font-weight: 650; color: var(--muted); text-align: right; }
.phys-x { display: flex; justify-content: space-between; font-size: .66rem; font-weight: 650; color: var(--muted); }
.phys-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.phys-c { display: grid; gap: 1px; align-content: center; justify-items: center; text-align: center; min-height: 58px; padding: 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.phys-c b { font-size: .9rem; }
.phys-c small { font-size: .6rem; line-height: 1.15; color: var(--muted); }
.phys-c.is-on { background-image: var(--gloss), var(--go-grad); color: var(--on-go); border-color: transparent; box-shadow: var(--gloss-edge); }
.phys-c.is-on small { color: var(--on-go); }
.phys-c.is-calc { border: 2px dashed var(--go); }

.meas-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fs { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.fs legend { padding: 0 0 8px; }
.segform { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.segform label { font-size: .85rem; font-weight: 600; }

.ex-note { grid-column: 2; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tpl-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.tpl-row small { display: block; color: var(--muted); font-size: .78rem; }
.tpl-row .ing-tools { display: flex; margin-top: 2px; }

.sup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.sup-si { box-shadow: inset 3px 0 0 var(--ok); }
.sup-no .sup-main { opacity: .7; }
.sup-main { display: grid; gap: 6px; min-width: 0; }
.sup-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; }
.sup-fields label { display: grid; gap: 2px; }
.sup-fields span { font-size: .66rem; font-weight: 650; color: var(--muted); }
.sup-seg { grid-column: 2; max-width: 24rem; }
.sup-seg span { min-height: 36px; font-size: .78rem; }
.sup-add { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto; gap: 8px; align-items: end; margin-top: 14px; }
.rec-ed { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.rec-ed li { padding-left: 2px; }
.rec-ed li > * { vertical-align: middle; }
.rec-ed .input { width: calc(100% - 40px); }
.rec-list { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; font-weight: 550; }
.sup-pt-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.sup-pt { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.sup-pt small { display: block; color: var(--muted); font-size: .8rem; }

@media (max-width: 860px) {
  .sup-seg { grid-column: 1 / -1; max-width: none; }
  .sup-add { grid-template-columns: 1fr 1fr; }
  .sup-add .field:first-child, .sup-add .btn { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .meas-3, .ev-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-note { grid-column: 1 / -1; }
  .evtable { font-size: .8rem; }
  .evtable th, .evtable td { padding: 6px 5px; }
  .evtable thead th { font-size: .6rem; letter-spacing: .02em; }
  .evtable td:nth-child(2) { white-space: normal; }
  .evtable .badge { white-space: normal; text-align: center; line-height: 1.15; }
  .seg-cell { padding: 6px; font-size: .72rem; }
}

/* Tiempos de comida: nombre y hora editables en la tarjeta */
.meal-ed-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 2px; }
.meal-name-in { flex: 1 1 10rem; min-width: 0; padding: 4px 2px; font: inherit; font-size: 1.05rem; font-weight: 750; color: var(--ink); background: transparent; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; }
.meal-name-in:hover { border-bottom-color: var(--muted); }
.meal-name-in:focus-visible { outline: none; border-bottom: 2px solid var(--go); }
.meal-time-in { width: 9rem; min-height: 36px; }
.meal-ed-head > .tool { align-self: flex-start; }


/* ═════════════ Botones con relieve: grafito metálico (como en Nexo) ═════════════
 * Lo que se toca y no está elegido va en grafito con filo y brillo; lo elegido, en verde sólido.
 * Así se nota que es botón y, al mismo tiempo, en qué pestaña estás. */
.chip:not([aria-pressed="true"]):not(.is-on), .tool, .btn-ghost, .pill:not(.pill-go):not(.pill-danger) {
  border: 1px solid transparent;
  background-color: transparent;
  background-image: var(--gloss-soft), var(--metal), var(--metal-filo);
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
  box-shadow: var(--metal-shadow);
  color: var(--metal-ink);
}
.chip:not([aria-pressed="true"]):not(.is-on):hover, .tool:hover, .btn-ghost:hover, .pill:not(.pill-go):not(.pill-danger):hover {
  background-image: var(--gloss-soft), var(--metal-hi), var(--metal-filo-hi);
  color: var(--metal-ink);
  transform: translateY(-1px);
}
.chip:not([aria-pressed="true"]):not(.is-on):active, .tool:active, .btn-ghost:active { transform: scale(.96); }
.chip[aria-pressed="true"], .chip.is-on { background-clip: border-box; }
.tabs .chip, .pt-nav .chip, .switch .chip { transition: transform 300ms var(--ease-spring), box-shadow 200ms; }
/* Las pills llevan el ícono en una bolita verde con brillo */
.pill:not(.pill-go):not(.pill-danger) .pill-icon { background-image: var(--gloss), var(--go-grad); color: var(--on-go); box-shadow: var(--gloss-edge); }
/* Texto verde donde antes era un botón "fantasma" */
.btn-ghost { color: var(--go-ink); }
.btn-ghost:hover { color: var(--go-ink); }
/* Herramientas chicas: mismo relieve, ícono un poco más claro */
.tool { border-radius: 10px; color: color-mix(in oklab, var(--metal-ink) 78%, transparent); }
.tool:disabled { transform: none; }
.tool-danger, .btn-danger-text { color: var(--bad); }
.tool-danger:hover, .btn-danger-text:hover {
  color: var(--bad);
  background-image: var(--gloss-soft), linear-gradient(color-mix(in oklab, #ef4444 16%, var(--card)), color-mix(in oklab, #ef4444 16%, var(--card))), linear-gradient(160deg, color-mix(in oklab, #ef4444 80%, transparent), color-mix(in oklab, #ef4444 25%, transparent));
}
@media (prefers-reduced-motion: reduce) {
  .chip:hover, .tool:hover, .btn-ghost:hover, .pill:hover { transform: none; }
}

/* ═════════════ Entrenamiento en vivo (entreno.js) · como en Nexo, en verde ═════════════ */
.live-open { overflow: hidden; }
.live {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); background: var(--page);
  animation: live-in 420ms var(--ease-out-expo);
}
.live[hidden] { display: none; }
@keyframes live-in { from { transform: translateY(28px); opacity: 0; } }
.live-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.live-clock { display: grid; justify-items: center; min-width: 0; line-height: 1.15; }
.live-clock strong { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-clock small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: var(--muted); }

.live-strip {
  display: flex; gap: 8px; flex-shrink: 0; overflow-x: auto; scrollbar-width: none; padding: 12px 16px 14px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in oklab, var(--go) 6%, transparent), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent);
}
.live-strip::-webkit-scrollbar { display: none; }
.lx {
  display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; max-width: 200px; min-height: 44px; padding: 0 16px 0 6px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer; font: inherit; font-size: var(--text-sm); font-weight: 650; color: var(--metal-ink);
  background-image: var(--gloss-soft), var(--metal), var(--metal-filo); background-clip: padding-box, padding-box, border-box; background-origin: border-box;
  box-shadow: var(--metal-shadow); transition: transform 300ms var(--ease-spring);
}
.lx:active { transform: scale(.96); }
.lx-n { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: oklch(1 0 0 / .1); font-size: .8rem; font-weight: 800; }
.lx-n svg { width: 16px; height: 16px; }
.lx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx.is-on { color: var(--on-go); background-image: var(--gloss), var(--go-grad); background-clip: border-box; box-shadow: var(--gloss-edge), 0 10px 24px -12px var(--go), 0 0 0 4px color-mix(in oklab, var(--go) 14%, transparent); }
.lx.is-on .lx-n { background: oklch(0 0 0 / .16); }
.lx.is-done:not(.is-on) .lx-n { background-image: var(--gloss), var(--go-grad); color: var(--on-go); }
.live-progress { flex-shrink: 0; height: 3px; background: var(--line); }
.live-progress > span { display: block; height: 100%; background: var(--go-grad); box-shadow: 0 0 10px var(--go); transform-origin: left; transition: transform 600ms var(--ease-out-expo); }

.live-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 28px; }
.live-body > * { max-width: 640px; margin-inline: auto; }
.live-ex { display: grid; gap: 12px; }
.live-demo { position: relative; margin: -16px -16px 0; aspect-ratio: 16 / 10; max-height: 34dvh; background: #050705; overflow: hidden; }
@media (min-width: 672px) { .live-demo { margin: 0; border-radius: 20px; } }
.live-demo video { width: 100%; height: 100%; object-fit: contain; }
.live-demo-hide { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: rgb(0 0 0 / .55); color: #fff; font: inherit; font-size: .75rem; font-weight: 650; cursor: pointer; backdrop-filter: blur(6px); }
.live-demo-hide svg { width: 14px; height: 14px; }
.live-ex-head { display: flex; align-items: center; gap: 12px; }
.live-thumb { flex-shrink: 0; width: 64px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #050705; cursor: pointer; }
.live-thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-last { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.live-last b { color: var(--ink); }

.set-grid { display: grid; gap: 6px; }
.set-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 56px; align-items: center; gap: 8px; min-height: 54px; padding: 5px 6px; border-radius: 16px; transition: background-color 250ms; }
.set-head { min-height: 0; padding-block: 0; font-size: .66rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.set-head > span { text-align: center; }
.set-head svg { width: 14px; height: 14px; vertical-align: -2px; }
.set-num { display: grid; place-items: center; height: 40px; border-radius: 12px; background: var(--soft); font-weight: 800; font-variant-numeric: tabular-nums; }
.set-in { width: 100%; height: 46px; padding: 0 4px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 1.1rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: center; }
.set-in::placeholder { color: color-mix(in oklab, var(--muted) 70%, transparent); font-weight: 600; }
.set-in:focus { outline: none; border-color: var(--go); box-shadow: 0 0 0 3px color-mix(in oklab, var(--go) 25%, transparent); }
.set-check {
  display: grid; place-items: center; height: 46px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; color: var(--metal-ink);
  background-image: var(--gloss-soft), var(--metal), var(--metal-filo); background-clip: padding-box, padding-box, border-box; background-origin: border-box; box-shadow: var(--metal-shadow);
  transition: transform 300ms var(--ease-spring);
}
.set-check svg { width: 22px; height: 22px; }
.set-check:active { transform: scale(.9); }
.set-row.is-done { background: color-mix(in oklab, var(--go) 12%, transparent); }
.set-row.is-done .set-in { border-color: transparent; background: transparent; }
.set-row.is-done .set-num { background-image: var(--gloss), var(--go-grad); color: var(--on-go); }
.set-row.is-done .set-check { background-image: var(--gloss), var(--go-grad); background-clip: border-box; color: var(--on-go); box-shadow: var(--gloss-edge), 0 8px 18px -10px var(--go); animation: pop-check 450ms var(--ease-spring); }
@keyframes pop-check { 40% { transform: scale(1.12); } }
.live-set-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.live-set-btns .pill:disabled { opacity: .45; cursor: default; }

.rest { position: relative; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); background: color-mix(in oklab, var(--info) 10%, var(--card)); }
.rest-fill { position: absolute; inset: 0; transform-origin: left; background: color-mix(in oklab, var(--info) 22%, transparent); transition: transform 300ms linear; }
.rest > :not(.rest-fill) { position: relative; }
.rest-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 650; color: var(--info); }
.rest-label svg { width: 16px; height: 16px; }
.rest-left { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rest-actions { display: flex; gap: 6px; margin-left: auto; }
.rest-btn { display: grid; place-items: center; min-width: 48px; height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: color-mix(in oklab, var(--ink) 10%, transparent); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.rest-btn svg { width: 18px; height: 18px; }
.live-foot { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.live-foot .btn-cta { flex: 1; }
.live-sum { max-width: 560px; }
.sum-hero { display: grid; justify-items: center; gap: 6px; padding-top: 12px; text-align: center; }
.gbox-lg { width: 72px; height: 72px; border-radius: 22px; color: var(--on-go); }
.gbox-lg svg { width: 34px; height: 34px; }

.live-bar {
  position: fixed; left: 0; right: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 24px); bottom: 18px; z-index: 55;
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 8px; border: 0; border-radius: 999px; cursor: pointer; text-align: left; font: inherit;
  background-image: var(--gloss), var(--go-grad); color: var(--on-go); box-shadow: var(--gloss-edge), 0 14px 30px -12px var(--go);
  animation: live-in 400ms var(--ease-spring) both;
}
.live-bar b { display: block; font-size: .88rem; }
.live-bar small { display: block; font-size: .72rem; opacity: .75; }
.live-bar-go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: oklch(0 0 0 / .16); }
.live-bar-go svg { width: 18px; height: 18px; }
@media (max-width: 600px) { body[data-view="paciente"] .live-bar { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* Actividad: entreno de hoy, y pasos y cardio abajo en su propia tarjeta */
.train-done { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-size: var(--text-sm); font-weight: 650; }
.train-done svg { width: 16px; height: 16px; flex-shrink: 0; }
.steps-big { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.steps-big b { font-size: 2.2rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.steps-big span { color: var(--muted); font-weight: 600; }
.steps-big-sm b { font-size: 1.45rem; }
.steps-big-sm span { font-size: .85rem; }
.steps-bar { position: relative; height: 14px; border-radius: 999px; overflow: hidden; background: var(--soft); box-shadow: inset 0 1px 2px rgb(0 0 0 / .3); }
.steps-bar > span { position: relative; display: block; height: 100%; border-radius: inherit; background-image: var(--gloss), var(--go-grad); box-shadow: 0 0 14px -2px var(--go); transition: width 800ms var(--ease-out-expo); }
.steps-bar.is-cardio > span { background-image: var(--gloss), linear-gradient(90deg, #bae6fd, #38bdf8 55%, #0284c7); box-shadow: 0 0 14px -2px #38bdf8; }
.steps-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.week-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 92px; margin-top: 16px; }
.week-steps span { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 4px; }
.week-steps i { align-self: end; width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: color-mix(in oklab, var(--metal-ink) 16%, transparent); }
.week-steps .is-met i { background-image: var(--gloss), var(--go-grad); }
.week-steps .is-today i { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--go); }
.week-steps .is-today:not(.is-met) i { background: color-mix(in oklab, var(--go) 38%, transparent); }
.week-steps em { font-style: normal; font-size: .68rem; font-weight: 700; color: var(--muted); }
.week-steps .is-today em { color: var(--go-ink); }
.tlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tlog li { display: grid; gap: 6px; padding: 12px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.tlog-ex { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); }
.tlog-ex b { color: var(--ink); font-variant-numeric: tabular-nums; }
