/* =====================================================================
   Aku Salud · "La ficha técnica"
   Lenguaje visual: papel, tinta, líneas finas de cota, arcos de ángulo,
   números en monoespaciada. Una sola tinta de acento (naranja de señal)
   reservada para lo que se mide y para la acción principal.
   ===================================================================== */

:root {
  --paper: #f3f0e8;
  --paper-2: #e9e5da;
  --paper-3: #dfdacd;
  --ink: #171a18;
  --ink-2: #4b504c;
  --ink-3: #8b8f89;
  --rule: rgba(23, 26, 24, .18);
  --rule-soft: rgba(23, 26, 24, .09);
  --accent: #e4572e;
  --accent-ink: #fff8f3;
  --accent-soft: rgba(228, 87, 46, .12);
  --good: #2f7d4f;
  --warn: #b5721b;
  --bad: #c0392b;
  --good-soft: rgba(47, 125, 79, .13);
  --warn-soft: rgba(181, 114, 27, .14);
  --bad-soft: rgba(192, 57, 43, .12);

  /* Alias que usan los componentes generados por JS y la animación */
  --bg: var(--paper);
  --surface: var(--paper);
  --surface-2: var(--paper-2);
  --border: var(--rule);
  --text: var(--ink);
  --muted: var(--ink-2);
  --faint: var(--ink-3);
  --primary: var(--accent);
  --primary-ink: var(--accent-ink);
  --primary-soft: var(--accent-soft);
  --fig-near: #1d211f;
  --fig-far: #a9ada4;

  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 3px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 1120px;
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  /* Grano de papel muy sutil */
  background-image: radial-gradient(rgba(23, 26, 24, .035) .6px, transparent .6px);
  background-size: 7px 7px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; font-variation-settings: "opsz" 96; }
h1 { font-size: clamp(2.1rem, 6.2vw, 4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.05rem; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Etiquetas técnicas: monoespaciada, mayúsculas, con espaciado */
.kicker, .mono {
  font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.kicker { display: block; margin-bottom: 10px; }
.kicker::before { content: "— "; color: var(--accent); }

/* Iconos (solo donde ayudan) */
[data-icon] { display: inline-flex; width: 1.1em; height: 1.1em; flex: none; }
[data-icon] svg { width: 100%; height: 100%; }

/* Reglas (líneas) */
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- Barra superior ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0);
}
.appbar-inner { max-width: var(--max); margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; }
.brand span b { font-weight: 600; color: var(--accent); }
.brand-sub { color: var(--ink-3); font-weight: 400; letter-spacing: .08em; text-transform: none; padding-left: 12px; border-left: 1px solid var(--rule); }
.appbar-actions { display: flex; gap: 6px; align-items: center; }
.appbar-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; cursor: pointer;
  background: transparent; border: 1px solid var(--rule); border-radius: 2px; font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .2s, background .2s;
}
.appbar-btn:hover { border-color: var(--ink); }
.badge { min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; font-family: var(--mono); font-size: .7rem; font-weight: 600; background: var(--ink); color: var(--paper); border-radius: 2px; }
.badge.zero { background: var(--paper-2); color: var(--ink-3); }
.account-btn { padding: 0 10px 0 4px; position: relative; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--paper-3); color: var(--ink); font-family: var(--mono); font-size: .7rem; font-weight: 600; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar [data-icon] { width: 14px; height: 14px; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.3rem; margin: 0 auto; }
.sync-dot { position: absolute; top: 4px; left: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); border: 2px solid var(--paper); }
.sync-dot[hidden] { display: none; }
.sync-dot.syncing { background: var(--warn); } .sync-dot.error { background: var(--bad); }
body.in-camera .appbar { display: none; }

/* ---------- Pantallas ---------- */
main { min-height: calc(100dvh - 56px); }
.screen { display: none; max-width: var(--max); margin: 0 auto; padding: 0 20px 64px; }
.screen.active { display: block; animation: fade .4s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--body); font-weight: 600; font-size: .95rem; border: 1px solid var(--ink); border-radius: var(--r); padding: 11px 18px;
  background: transparent; color: var(--ink); transition: background .18s, color .18s, border-color .18s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.lg { padding: 15px 22px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.secondary { border-color: var(--rule); }
.btn.secondary:hover { border-color: var(--ink); }
.btn.ghost { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { text-decoration-color: var(--ink); }
.btn.light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.danger-ghost { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.btn.danger-ghost:hover { background: var(--bad-soft); }
.btn.google { border-color: var(--rule); }
.btn .arrow { font-family: var(--mono); font-weight: 400; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(20, 22, 20, .55); color: #fff; backdrop-filter: blur(8px); }
.icon-btn [data-icon] { width: 20px; height: 20px; }
.icon-btn.subtle { background: var(--paper-2); color: var(--ink-2); width: 34px; height: 34px; backdrop-filter: none; }
.icon-btn.subtle [data-icon] { width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 18px 0 10px; cursor: pointer; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.back:hover { color: var(--ink); }
.link-btn { background: none; border: 0; padding: 4px; cursor: pointer; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; color: var(--ink-2); }

/* ---------- Portada ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 56px 0 40px; border-bottom: 1px solid var(--rule); }
.hero h1 { margin: 14px 0 18px; max-width: 12ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(1rem, 1.9vw, 1.15rem); color: var(--ink-2); max-width: 50ch; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 28px 0 30px; }
.spec { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 0 28px; width: max-content; max-width: 100%; }
.spec li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: .88rem; }
.spec li b { font-family: var(--mono); font-weight: 600; font-size: .78rem; letter-spacing: .06em; color: var(--ink); min-width: 3.6ch; }
.spec li span { color: var(--ink-2); }

/* Fotograma anotado: imagen fija con cotas y arco de ángulo dibujados encima */
.frame { position: relative; width: min(100%, 420px); margin-left: auto; aspect-ratio: 3 / 4; background: var(--paper-2); overflow: visible; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; filter: saturate(.85) contrast(1.02); }
.frame .marks { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.frame .marks * { vector-effect: non-scaling-stroke; }
.frame .corner { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.frame .dim { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.frame .dim-ext { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; opacity: .8; }
.frame .arc { stroke: var(--accent); stroke-width: 2; fill: color-mix(in srgb, var(--accent) 20%, transparent); stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 1.4s var(--ease) .4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.frame .ruler line { stroke: var(--ink); stroke-width: 1; opacity: .5; }
.frame .label { position: absolute; font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: var(--paper); border: 1px solid var(--ink); padding: 4px 8px; border-radius: 2px; white-space: nowrap; }
.frame .label.accent { border-color: var(--accent); color: var(--accent); }
.frame .label b { font-size: 1.1rem; letter-spacing: 0; display: block; line-height: 1; }
.frame .label.l-angle { left: 64%; top: 66%; animation: pop-in .5s var(--ease) 1.5s both; }
.frame .label.l-rep { left: -10px; top: -12px; }
.frame .label.l-cue { right: -10px; bottom: 3%; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.frame .label.l-cue i { display: inline-block; width: 7px; height: 7px; background: var(--good); border-radius: 50%; margin-right: 6px; }
.frame .caption { position: absolute; left: 0; right: 0; bottom: -28px; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; display: flex; justify-content: space-between; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Aviso de cuenta y progreso */
.cloud-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.cloud-banner[hidden] { display: none; }
.cloud-banner > div { display: flex; flex-direction: column; gap: 2px; }
.cloud-banner b { font-family: var(--display); font-size: 1.05rem; }
.cloud-banner .muted { font-size: .88rem; }
.cloud-ic { width: 40px; height: 40px; border: 1px solid var(--ink); border-radius: 2px; display: grid; place-items: center; color: var(--ink); }
.cloud-ic svg { width: 20px; height: 20px; }

.progress-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.progress-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.progress-copy strong { font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.progress-copy .muted { font-size: .88rem; }
.bar { position: relative; height: 6px; margin-top: 10px; background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px calc(100% / 6)); }
.bar::after { content: ""; position: absolute; inset: 0; border-right: 1px solid var(--rule); pointer-events: none; }
.bar i { display: block; height: 100%; background: var(--ink); transition: width .8s var(--ease); }
.ring { --v: 0; --c: var(--ink); width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--paper-3) 0); font-family: var(--mono); font-weight: 600; font-size: 1.1rem; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--paper); }
.ring > * { position: relative; }

/* Bloques de la portada */
.block { padding: 48px 0 0; }
.block-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: 0; }
.block-head .kicker { margin-bottom: 8px; }
.block-head .idx { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--ink-3); }
.block-head h2 { max-width: 22ch; }

.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.how li { padding: 22px 22px 26px 0; border-bottom: 1px solid var(--rule); position: relative; }
.how li + li { padding-left: 22px; border-left: 1px solid var(--rule); }
.how .n { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--accent); display: block; margin-bottom: 30px; }
.how b { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; margin-bottom: 6px; }
.how p { color: var(--ink-2); font-size: .92rem; max-width: 30ch; }

.goals { display: grid; grid-template-columns: repeat(4, 1fr); }
.goal { padding: 22px 20px 26px 0; border-bottom: 1px solid var(--rule); }
.goal + .goal { padding-left: 20px; border-left: 1px solid var(--rule); }
.goal .m { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 26px; }
.goal b { display: block; font-family: var(--display); font-size: 1.15rem; letter-spacing: -.01em; margin-bottom: 6px; }
.goal p { color: var(--ink-2); font-size: .9rem; }

/* Perfil: campos subrayados */
.profile { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; padding: 8px 0 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.field input {
  font-family: var(--body); font-size: 1.05rem; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 12px 0 10px; width: 100%;
  transition: border-color .2s;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { outline: none; border-bottom-color: var(--accent); border-bottom-width: 2px; margin-bottom: -1px; }
.field input[type="number"] { -moz-appearance: textfield; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Lista de ejercicios: cada fila es una ficha */
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.ex-card {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: center; text-align: left; cursor: pointer;
  padding: 18px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink);
  transition: background .2s;
}
.ex-card:hover { background: linear-gradient(90deg, var(--rule-soft), transparent 60%); }
.ex-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-media { position: relative; width: 96px; aspect-ratio: 4 / 5; background: var(--paper-2); overflow: hidden; border: 1px solid var(--rule); }
.ex-media img, .ex-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-media video { opacity: 0; transition: opacity .3s; }
.ex-card.playing .ex-media video { opacity: 1; }
.ex-media .tick { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease); }
.ex-card:hover .ex-media .tick, .ex-card.playing .ex-media .tick { transform: none; }
.ex-fig { display: none; }
.ex-body { min-width: 0; }
.ex-n { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: var(--accent); display: block; margin-bottom: 6px; }
.ex-name { font-family: var(--display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-meta { font-size: .86rem; color: var(--ink-2); margin-top: 6px; }
.ex-view { display: inline-block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }
.ex-target { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ex-target b { font-family: var(--display); font-variation-settings: "wdth" 78, "opsz" 96; font-weight: 700; font-size: 2.1rem; line-height: 1; letter-spacing: -.02em; }
.ex-target small { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ex-done { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .06em; padding: 3px 7px; border-radius: 2px; border: 1px solid currentColor; }
.ex-done.good { color: var(--good); } .ex-done.warn { color: var(--warn); } .ex-done.bad { color: var(--bad); }
.ex-done [data-icon] { display: none; }

.foot { margin-top: 64px; padding: 20px 0 0; border-top: 1px solid var(--ink); display: grid; gap: 6px; font-size: .82rem; color: var(--ink-2); }
.foot a { color: var(--ink); }

/* Pestañas y etiquetas */
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-2); background: transparent; }
.tag.primary { border-color: var(--accent); color: var(--accent); }
.tag.glass { background: rgba(20, 22, 20, .6); color: #fff; border-color: transparent; }
.seg { display: flex; gap: 0; border-bottom: 1px solid var(--rule); }
.seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 12px 10px; margin-bottom: -1px; font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; min-width: 0; }
.seg-btn.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.on { display: block; animation: fade .3s var(--ease) both; }

/* ---------- Ficha del ejercicio ---------- */
.ex-head { padding: 6px 0 22px; border-bottom: 1px solid var(--ink); margin-bottom: 20px; }
.ex-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ex-head h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); margin-bottom: 10px; }
.ex-head p { max-width: 64ch; }

.media-card { border: 1px solid var(--rule); padding: 0 16px 16px; }
.video-wrap { position: relative; background: #0c0d0c; display: flex; justify-content: center; margin-top: 16px; }
.video-wrap video { max-height: 64vh; width: auto; max-width: 100%; }
.video-wrap.landscape video { width: 100%; max-height: none; }
.video-badge { position: absolute; left: 12px; top: 12px; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(12, 13, 12, .7); padding: 6px 9px; display: inline-flex; align-items: center; gap: 7px; }
.video-badge .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.video-ctrl { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(12, 13, 12, .6); color: #fff; display: grid; place-items: center; cursor: pointer; border-radius: 2px; }
.video-ctrl [data-icon] { width: 18px; height: 18px; }
.speed { position: absolute; left: 12px; bottom: 12px; display: flex; border: 1px solid rgba(255, 255, 255, .5); }
.speed button { border: 0; background: rgba(12, 13, 12, .6); color: rgba(255, 255, 255, .8); font-family: var(--mono); font-size: .7rem; font-weight: 600; padding: 7px 10px; cursor: pointer; }
.speed button + button { border-left: 1px solid rgba(255, 255, 255, .5); }
.speed button.on { background: #fff; color: #0c0d0c; }

.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding-top: 16px; }
.demo { aspect-ratio: 1 / 1; width: 100%; max-height: 380px; background-image: linear-gradient(var(--rule-soft) 1px, transparent 1px), linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px); background-size: 24px 24px; border: 1px solid var(--rule); }
.guide-side { display: flex; flex-direction: column; gap: 12px; }
.phase-bar { height: 3px; background: var(--paper-3); }
.phase-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); font-size: .92rem; color: var(--ink-3); transition: color .25s; }
.steps li::before { content: "0" counter(st); font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--ink-3); }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on::before { color: var(--accent); }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 28px; border-top: 1px solid var(--ink); }
.info-grid > .card { padding: 20px 20px 24px 0; border-bottom: 1px solid var(--rule); }
.info-grid > .card + .card { padding-left: 20px; border-left: 1px solid var(--rule); }
.info-grid h3, .config h3, .placement h3 { font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.info-grid h3 [data-icon], .config h3 [data-icon], .placement h3 [data-icon] { display: none; }
.checks, .keys, .detects, .tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: .92rem; }
.checks li { padding-left: 22px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.keys { counter-reset: k; }
.keys li { counter-increment: k; padding-left: 30px; position: relative; }
.keys li::before { content: "0" counter(k); position: absolute; left: 0; top: 2px; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--accent); }
.detects li { padding-left: 18px; position: relative; }
.detects li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border: 1.5px solid var(--warn); transform: rotate(45deg); }
.detects li small { display: block; color: var(--ink-3); font-size: .8rem; }
.tips li { padding-left: 18px; position: relative; }
.tips li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 1px; background: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chip { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--rule); color: var(--ink-2); }

.config { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--ink); }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); }
.stepper { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label ctrl" "unit ctrl"; align-items: center; padding: 14px 16px; gap: 2px 16px; }
.stepper + .stepper { border-left: 1px solid var(--rule); }
.st-label { grid-area: label; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.st-unit { grid-area: unit; font-size: .78rem; color: var(--ink-3); }
.st-ctrl { grid-area: ctrl; display: flex; align-items: center; gap: 2px; }
.st-ctrl button { width: 38px; height: 38px; border: 1px solid var(--rule); background: transparent; font-size: 1.2rem; cursor: pointer; border-radius: 2px; }
.st-ctrl button:hover { border-color: var(--ink); }
.st-ctrl input { width: 78px; text-align: center; font-family: var(--display); font-variation-settings: "wdth" 80, "opsz" 96; font-size: 2rem; font-weight: 700; border: 0; background: transparent; color: var(--ink); -moz-appearance: textfield; }
.st-ctrl input::-webkit-outer-spin-button, .st-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-ctrl input:focus { outline: none; color: var(--accent); }
.switch { display: flex; align-items: center; gap: 14px; margin-top: 18px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 22px; border: 1px solid var(--ink); border-radius: 2px; position: relative; flex: none; transition: background .2s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--ink); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track .thumb { transform: translateX(20px); background: var(--paper); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch b { font-family: var(--display); font-weight: 700; }
.switch small { display: block; font-size: .8rem; }

.placement { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.placement-art { color: var(--ink); }
.placement-art svg { width: 100%; height: auto; }

.sticky-cta { position: sticky; bottom: 0; z-index: 20; margin: 28px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0)); background: linear-gradient(180deg, transparent, var(--paper) 30%); }

/* ---------- Cámara ---------- */
body.in-camera { overflow: hidden; }
.screen.camera { max-width: none; padding: 0; position: fixed; inset: 0; z-index: 60; background: #000; }
.screen.camera.active { animation: none; }
.stage { position: relative; width: 100%; height: 100%; overflow: hidden; }
#video, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mirror { transform: scaleX(-1); }
.vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 22%, transparent 72%, rgba(0, 0, 0, .6)); }
.cam-top { position: absolute; top: calc(env(safe-area-inset-top, 0) + 12px); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cam-title { color: #fff; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.cam-stats { position: absolute; top: calc(env(safe-area-inset-top, 0) + 70px); left: 12px; right: 12px; display: flex; gap: 6px; }
.rep-ring { --p: 0; position: relative; width: 84px; height: 84px; flex: none; }
.rep-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.rep-ring circle { fill: none; stroke-width: 6; }
.rep-ring .trk { stroke: rgba(255, 255, 255, .25); fill: rgba(12, 13, 12, .55); }
.rep-ring .val { stroke: var(--accent); stroke-dasharray: calc(var(--p) * 1) 100; transition: stroke-dasharray .5s var(--ease); }
.rep-ring.zero .val, .big-ring .val.zero { opacity: 0; }
.rep-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; line-height: 1; }
.rep-ring b { font-family: var(--display); font-variation-settings: "wdth" 80; font-size: 2rem; font-weight: 700; }
.rep-ring small { font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-top: 4px; }
.cam-metric { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(12, 13, 12, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); }
.cam-metric small { font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.cam-metric b { font-family: var(--display); font-variation-settings: "wdth" 80; font-size: 1.7rem; font-weight: 700; }
.depth-bar { position: absolute; right: 14px; top: 190px; bottom: 170px; width: 10px; background: rgba(255, 255, 255, .2); }
#depth-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--accent); transition: height .08s linear; }
#depth-target { position: absolute; left: -6px; right: -6px; height: 2px; background: #fff; bottom: 85%; }
#depth-target span { position: absolute; right: 18px; top: -7px; font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.cam-guide { position: absolute; left: 12px; top: 172px; width: 96px; height: 104px; pointer-events: none; background: rgba(12, 13, 12, .55); border: 1px solid rgba(255, 255, 255, .18); padding: 6px; --fig-near: #fff; --fig-far: rgba(255, 255, 255, .35); }
.cam-guide .fig-arc, .cam-guide .fig-joint, .cam-guide .fig-pulse { display: none; }
.cam-guide .fig-floor { stroke: rgba(255, 255, 255, .3); }
.cam-guide .fig-shadow { fill: rgba(255, 255, 255, .12); }
.countdown { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(0, 0, 0, .35); }
.countdown.on { display: flex; }
.cd-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .3); position: relative; }
.cd-ring::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--accent); border-color: var(--accent) transparent transparent transparent; animation: spin 1s linear infinite; }
.cd-ring span { font-family: var(--display); font-variation-settings: "wdth" 80; font-size: 5rem; font-weight: 700; color: #fff; animation: pop .9s var(--ease) both; }
.countdown p { color: #fff; font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } to { transform: none; opacity: 1; } }
.rep-flash { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.rep-flash b { font-family: var(--display); font-variation-settings: "wdth" 78; font-size: 7rem; font-weight: 800; color: #fff; animation: flash 1s var(--ease) both; }
.rep-flash b.good { color: #6fd79b; } .rep-flash b.warn { color: #f0b556; } .rep-flash b.bad { color: #ff7b6b; }
@keyframes flash { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.cue { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0) + 100px); transform: translateX(-50%); width: min(92%, 520px); display: flex; align-items: center; gap: 10px; background: rgba(12, 13, 12, .78); color: #fff; padding: 12px 16px; font-weight: 600; font-size: 1.02rem; border-left: 3px solid #fff; }
.cue.bump { animation: bump .3s var(--ease); }
@keyframes bump { 0% { transform: translateX(-50%) scale(.97); } 100% { transform: translateX(-50%) scale(1); } }
.cue-ic { width: 22px; height: 22px; flex: none; }
.cue.good { border-left-color: #6fd79b; } .cue.warn { border-left-color: #f0b556; background: rgba(120, 70, 10, .9); } .cue.bad { border-left-color: #ff7b6b; background: rgba(140, 30, 20, .92); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0) + 22px); display: flex; justify-content: center; }

/* ---------- Resultados ---------- */
.card { padding: 0; }
.res-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--ink); }
.big-ring { position: relative; width: 160px; height: 160px; }
.big-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.big-ring circle { fill: none; stroke-width: 4; }
.big-ring .trk { stroke: var(--paper-3); }
.big-ring .val { stroke-dasharray: 0 100; transition: stroke-dasharray 1.2s var(--ease); }
.big-ring .val.good { stroke: var(--good); } .big-ring .val.warn { stroke: var(--warn); } .big-ring .val.bad { stroke: var(--bad); }
.big-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-ring b { font-family: var(--display); font-variation-settings: "wdth" 78, "opsz" 96; font-size: 3.4rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.big-ring small { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.res-title h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.res-title p { margin-top: 8px; }
.level-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border: 1px solid currentColor; margin-top: 12px; }
.level-pill.good { color: var(--good); } .level-pill.warn { color: var(--warn); } .level-pill.bad { color: var(--bad); }
.level-pill [data-icon] { display: none; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); }
.metric { padding: 16px 16px 18px 0; border-top: 1px solid var(--rule); }
.metric:nth-child(3n+2), .metric:nth-child(3n+3) { padding-left: 16px; border-left: 1px solid var(--rule); }
.metric .k { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.metric .v { font-family: var(--display); font-variation-settings: "wdth" 80, "opsz" 96; font-size: 2rem; font-weight: 700; line-height: 1; margin: 8px 0 10px; letter-spacing: -.02em; }
.metric .mbar { height: 3px; background: var(--paper-3); overflow: hidden; }
.metric .mbar i { display: block; height: 100%; width: 0; transition: width 1s var(--ease); }
.c-good { color: var(--good); } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); }
.bg-good { background: var(--good); } .bg-warn { background: var(--warn); } .bg-bad { background: var(--bad); }

.reco { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 20px; padding: 20px 20px 20px 0; border-left: 3px solid var(--ink); padding-left: 20px; background: var(--paper-2); }
.reco.down { border-left-color: var(--bad); } .reco.up { border-left-color: var(--good); } .reco.keep { border-left-color: var(--warn); }
.reco-ic { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid currentColor; }
.reco.down .reco-ic { color: var(--bad); } .reco.up .reco-ic { color: var(--good); } .reco.keep .reco-ic { color: var(--warn); }
.reco-ic svg { width: 22px; height: 22px; }
.reco b { font-family: var(--display); font-size: 1.25rem; display: block; letter-spacing: -.01em; }
.reco p { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.weight-change { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-family: var(--mono); font-weight: 600; }
.weight-change .from { color: var(--ink-3); text-decoration: line-through; }
.weight-change .to { font-size: 1.25rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin-top: 24px; }
.grid-2 > .card { padding: 18px 0 22px; border-top: 1px solid var(--ink); }
#screen-report .block > h3 { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 20px 0 10px; display: flex; gap: 8px; }
#screen-report .block > h3 [data-icon] { display: none; }
.grid-2 h3 { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; display: flex; gap: 8px; }
.grid-2 h3 [data-icon] { display: none; }
.reps-chart { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 6px; border-bottom: 1px solid var(--ink); position: relative; }
.reps-chart::before { content: "100"; position: absolute; right: 0; top: 0; font-family: var(--mono); font-size: .6rem; color: var(--ink-3); }
.reps-chart .rb { flex: 1; min-width: 8px; max-width: 34px; position: relative; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.reps-chart .rb span { position: absolute; left: 50%; bottom: -20px; translate: -50% 0; font-family: var(--mono); font-size: .66rem; color: var(--ink-3); }
.chart-card { padding-bottom: 34px !important; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); font-size: .92rem; font-weight: 500; }
.issues li .dot { width: 8px; height: 8px; background: var(--warn); transform: rotate(45deg); flex: none; }
.issues li .cnt { margin-left: auto; font-family: var(--mono); font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
.ok-note { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 600; }
.actions { display: flex; gap: 10px; margin-top: 28px; }
.actions .btn { flex: 1; }

/* ---------- Informe ---------- */
.report-head { padding: 6px 0 20px; border-bottom: 1px solid var(--ink); margin-bottom: 0; }
.report-head h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.report-who { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.rep-table { display: grid; }
.rep-row { display: grid; grid-template-columns: 44px 1.4fr 1fr 1fr 80px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.rep-row .thumb { width: 44px; height: 54px; object-fit: cover; background: var(--paper-2); border: 1px solid var(--rule); }
.rep-row .nm b { display: block; font-family: var(--display); font-size: 1.05rem; }
.rep-row .nm small { color: var(--ink-2); font-size: .82rem; }
.rep-row .mini { font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.rep-row .mini .mbar { height: 3px; background: var(--paper-3); margin-top: 6px; overflow: hidden; }
.rep-row .mini .mbar i { display: block; height: 100%; }
.rep-row .sc { font-family: var(--display); font-variation-settings: "wdth" 80; font-size: 1.7rem; font-weight: 700; text-align: right; }
.rep-row.pending { opacity: .55; }
.delta { font-family: var(--mono); font-size: .66rem; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.next-steps { counter-reset: ns; list-style: none; padding: 0; margin: 0; }
.next-steps li { counter-increment: ns; display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); font-size: .94rem; }
.next-steps li::before { content: "0" counter(ns); font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--accent); padding-top: 3px; }
.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--rule); margin-top: 20px; }
.empty .empty-ic { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border: 1px solid var(--ink); }
.empty .empty-ic svg { width: 24px; height: 24px; }
.empty p { color: var(--ink-2); margin: 8px auto 20px; max-width: 40ch; }

/* ---------- Animación (maniquí) ---------- */
.fig { width: 100%; height: 100%; overflow: visible; }
.fig-floor { stroke: var(--ink); stroke-width: 1; opacity: .5; }
.fig-shadow { fill: rgba(23, 26, 24, .12); }
.fig-bone { stroke-linecap: round; }
.fig-near .fig-bone { stroke: var(--fig-near); }
.fig-far .fig-bone { stroke: var(--fig-far); }
.fig-torso-front { fill: var(--fig-near); stroke: var(--fig-near); stroke-width: 6; stroke-linejoin: round; }
.fig-torso-side { fill: var(--fig-near); stroke: var(--fig-near); stroke-width: 5; stroke-linejoin: round; }
.fig-hl { stroke: #fff; stroke-linecap: round; opacity: .18; }
.fig-far .fig-hl { opacity: .1; }
.fig-head { fill: var(--fig-near); }
.fig-head-hl { fill: #fff; opacity: .16; }
.fig-ghost { opacity: .16; }
.fig-ghost .fig-hl, .fig-ghost .fig-head-hl { display: none; }
.fig-ghost .fig-bone, .fig-ghost .fig-torso-front, .fig-ghost .fig-torso-side { stroke: var(--accent); }
.fig-ghost .fig-head, .fig-ghost .fig-torso-front, .fig-ghost .fig-torso-side { fill: var(--accent); }
.fig-eq { fill: var(--accent); stroke: var(--fig-near); stroke-width: 1.5; }
.fig-arc { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 1.5; }
.fig-joint { fill: var(--accent); stroke: var(--paper); stroke-width: 2; transition: fill .2s; }
.fig-pulse { fill: none; stroke: var(--good); stroke-width: 1.5; opacity: 0; }
.fig-label-bg { fill: var(--paper); stroke: var(--ink); stroke-width: .8; rx: 1; }
.fig-label { font: 600 9.5px var(--mono); letter-spacing: .04em; fill: var(--ink); }
.fig.reached .fig-joint { fill: var(--good); }
.fig.reached .fig-arc { stroke: var(--good); fill: color-mix(in srgb, var(--good) 22%, transparent); }
.fig.reached .fig-label { fill: var(--good); }
.fig.reached .fig-pulse { animation: joint-pulse 1s ease-out infinite; }
@keyframes joint-pulse { 0% { opacity: .9; r: 5; } 100% { opacity: 0; r: 18; } }
.cam-guide .fig-hl, .cam-guide .fig-head-hl { stroke: #000; fill: #000; opacity: .12; }

/* ---------- Ventanas (cuenta) ---------- */
.sheet { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid var(--ink); border-radius: 2px; padding: 26px 22px 22px; background: var(--paper); color: var(--ink); }
.sheet[open] { animation: fade .3s var(--ease) both; }
.sheet::backdrop { background: rgba(10, 11, 10, .5); }
.sheet-close-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.sheet-head { text-align: center; margin-bottom: 18px; }
.sheet-head img { margin: 0 auto 10px; }
.sheet-head h2 { font-size: 1.5rem; margin: 6px 0 4px; }
.sheet-head p { font-size: .9rem; }
.divider { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 10px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.auth-seg { margin-bottom: 14px; }
.auth-form { display: grid; gap: 14px; }
.auth-form .field[hidden] { display: none; }
.form-error { color: var(--bad); border-left: 3px solid var(--bad); padding: 6px 10px; font-size: .88rem; font-weight: 500; }
.form-error.ok { color: var(--good); border-left-color: var(--good); }
.form-error[hidden] { display: none; }
.acc-stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); margin-bottom: 12px; }
.acc-stats div { padding: 12px; text-align: center; }
.acc-stats div + div { border-left: 1px solid var(--rule); }
.acc-stats b { display: block; font-family: var(--display); font-variation-settings: "wdth" 80; font-size: 1.6rem; font-weight: 700; }
.acc-stats small { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.sync-line { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--good); margin-bottom: 14px; }
.sync-line.syncing { color: var(--warn); } .sync-line.error { color: var(--bad); }
.sheet .btn.block + .btn.block { margin-top: 8px; }

/* ---------- Toast y WhatsApp ---------- */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0) + 24px); translate: -50% 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 12px 18px; font-size: .9rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, translate .3s var(--ease); border-left: 3px solid var(--accent); }
.toast.on { opacity: 1; translate: -50% 0; }
.wa-fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom, 0) + 18px); z-index: 50; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
body.in-camera .wa-fab { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ex-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid > .card + .card { padding-left: 0; border-left: 0; }
  .goals { grid-template-columns: 1fr 1fr; }
  .goal:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 28px; }
  .frame { margin: 0 auto; width: min(100%, 340px); }
  .frame .label.l-rep { left: -6px; }
  .frame .label.l-cue { right: -6px; }
  .how { grid-template-columns: 1fr; }
  .how li + li { padding-left: 0; border-left: 0; }
  .how .n { margin-bottom: 14px; }
  .goals { grid-template-columns: 1fr; }
  .goal + .goal { padding-left: 0; border-left: 0; }
  .goal .m { margin-bottom: 10px; }
  .profile { grid-template-columns: 1fr 1fr; gap: 20px; }
  .profile .grow { grid-column: 1 / -1; }
  .guide { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3n+2), .metric:nth-child(3n+3) { padding-left: 0; border-left: 0; }
  .metric:nth-child(2n) { padding-left: 16px; border-left: 1px solid var(--rule); }
  .grid-2 { grid-template-columns: 1fr; }
  .res-hero { grid-template-columns: 1fr; justify-items: start; }
  .rep-row { grid-template-columns: 44px 1fr 70px; }
  .rep-row .mini { display: none; }
  .hide-sm { display: none; }
  .progress-card { grid-template-columns: auto 1fr; }
  .progress-card .btn { grid-column: 1 / -1; }
  .cloud-banner { grid-template-columns: auto 1fr; }
  .cloud-banner .btn { grid-column: 1 / -1; }
  .spec { grid-template-columns: 1fr; width: 100%; }
  .block-head { grid-template-columns: 1fr; }
  .block-head .idx { order: -1; }
  .steppers { grid-template-columns: 1fr; }
  .stepper + .stepper { border-left: 0; border-top: 1px solid var(--rule); }
  .placement { grid-template-columns: 1fr; }
  .placement-art { width: 130px; }
  .actions { flex-direction: column-reverse; }
}
@media (max-width: 480px) {
  .ex-card { grid-template-columns: 76px 1fr auto; gap: 14px; }
  .ex-media { width: 76px; }
  .ex-name { font-size: 1.15rem; }
  .ex-target b { font-size: 1.7rem; }
  .hero-cta .btn.primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .appbar, .no-print, .actions, .toast, .wa-fab { display: none !important; }
  body { background: #fff; color: #000; }
  .screen { padding: 0; }
  .rep-row, .metric, .reco { break-inside: avoid; }
}
