/* ============================================================
   Núcleo — hoja de estilos
   ------------------------------------------------------------
   Móvil primero. Navegación inferior al alcance del pulgar,
   tipografía legible de pie en el gimnasio y objetivos
   táctiles de 44 px como mínimo.
   ============================================================ */

:root {
  --bg: #0b0f14; --bg2: #121923; --card: #161f2b; --card2: #1d2836;
  --line: #26354a; --txt: #e8eef6; --mut: #8ea1b8;
  --acc: #4ade80; --acc2: #60a5fa; --warn: #fbbf24; --dang: #f87171;
  --r: 16px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--txt);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  overflow-x: hidden;
}

/* ---------- cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(11px + env(safe-area-inset-top)) 15px 11px;
  background: rgba(11, 15, 20, .93); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { font-size: 25px; line-height: 1; }
.brand-txt { min-width: 0; }
.topbar h1 { font-size: 17px; font-weight: 680; letter-spacing: -.015em; white-space: nowrap; }
.topbar p { font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* chip de estado: el dolor de hoy, siempre visible y a un toque */
.ready {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); color: var(--txt);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 13px; font-size: 12.5px; font-weight: 620;
  cursor: pointer; min-height: 40px; white-space: nowrap;
}
.ready.green { border-color: rgba(74, 222, 128, .45); }
.ready.amber { border-color: rgba(251, 191, 36, .45); }
.ready.red { border-color: rgba(248, 113, 113, .45); }
.ready-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--acc); }
.ready-dot.green { background: var(--acc); box-shadow: 0 0 7px var(--acc); }
.ready-dot.amber { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.ready-dot.red { background: var(--dang); box-shadow: 0 0 7px var(--dang); }

.install {
  background: var(--acc); color: #07140c; border: 0; border-radius: 999px;
  padding: 9px 14px; font-size: 13px; font-weight: 650; cursor: pointer; flex-shrink: 0;
}

/* ---------- navegación inferior ----------
   Abajo porque es donde llega el pulgar con el móvil en una mano. */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(18, 25, 35, .97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabs button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--mut);
  font-size: 11px; font-weight: 620; cursor: pointer;
  height: var(--nav-h); transition: color .15s;
}
.tabs button span { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(.55); transition: filter .15s; }
.tabs button.active { color: var(--acc); }
.tabs button.active span { filter: none; }

main { padding: 15px 15px 28px; max-width: 720px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin-bottom: 13px;
}
.card.accent { border-color: rgba(74, 222, 128, .4); background: linear-gradient(160deg, rgba(74, 222, 128, .09), var(--card)); }
.card.warn { border-color: rgba(251, 191, 36, .4); background: linear-gradient(160deg, rgba(251, 191, 36, .08), var(--card)); }
.card.sub-card { background: var(--bg2); padding: 14px; }
.card h2 { font-size: 19px; font-weight: 680; letter-spacing: -.015em; margin-bottom: 5px; }
.card h3 { font-size: 15.5px; font-weight: 640; margin-bottom: 10px; }
.card p { font-size: 14.5px; }
.card.warn strong { display: block; margin-bottom: 6px; font-size: 15px; }
.muted { color: var(--mut); font-size: 14px; }
.note { margin-top: 11px; padding: 10px 12px; background: rgba(96, 165, 250, .1); border-left: 3px solid var(--acc2); border-radius: 8px; font-size: 13.5px; color: #cfe0f5; }
.sec-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); margin: 22px 0 10px; }

details { margin-top: 11px; }
summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--warn); padding: 6px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
details ul { margin: 8px 0 0 18px; }
details li { font-size: 13.5px; color: #e3d6b4; margin-bottom: 5px; }

.pills { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.pill { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; color: var(--mut); font-weight: 550; }
.tag { background: var(--card2); border-radius: 5px; padding: 1px 7px; font-size: 11px; font-weight: 600; color: #9fb3cc; }

.btn {
  background: var(--acc); color: #07140c; border: 0; border-radius: 12px;
  padding: 13px 17px; font-size: 14.5px; font-weight: 680; cursor: pointer;
  width: 100%; min-height: 48px;
}
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); }
.btn.danger { color: var(--dang); border-color: rgba(248, 113, 113, .4); }
.btn:active { transform: scale(.98); }
.row-btns { display: flex; gap: 8px; margin-top: 10px; }
.row-btns .btn { font-size: 13.5px; padding: 11px; min-height: 44px; }
.lnk { background: none; border: 0; color: var(--acc2); font-size: 13.5px; font-weight: 620; padding: 4px 0; cursor: pointer; text-align: left; }

/* ---------- aviso legal ---------- */
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(160deg, rgba(251, 191, 36, .1), var(--card));
  border: 1px solid rgba(251, 191, 36, .38); border-radius: 12px;
  padding: 12px 13px; margin-bottom: 14px;
}
.banner.gone { display: none; }
.banner strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.banner p { font-size: 13px; color: #e8d9b0; margin-bottom: 4px; }
.banner-x { background: none; border: 0; color: var(--mut); font-size: 16px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }

/* ---------- Hoy: cabecera de sesión ---------- */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.today-head h2 { font-size: 21px; font-weight: 690; letter-spacing: -.02em; }
.today-head p { font-size: 13px; color: var(--mut); }
.ring-sm { position: relative; width: 54px; height: 54px; flex-shrink: 0; }
.ring-sm svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.r-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.r-fg {
  fill: none; stroke: var(--acc2); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 119.4;
  transition: stroke-dashoffset .5s ease, stroke .3s;
}
.ring-sm span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- selector de sesión ---------- */
.picker { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 13px; }
.picker::-webkit-scrollbar { display: none; }
.picker button {
  flex: 0 0 auto; background: var(--card); border: 1px solid var(--line); color: var(--mut);
  border-radius: 999px; padding: 10px 15px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .18s; min-height: 42px;
}
.picker button.active { background: var(--acc2); border-color: var(--acc2); color: #07152a; }

/* adaptación por dolor, pegada a la sesión que modifica */
.adapt { border-radius: 12px; padding: 12px 13px; margin-bottom: 13px; }
.adapt b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.adapt p { font-size: 13px; margin: 0; }
.adapt.amber { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .4); }
.adapt.amber p { color: #e8d9b0; }
.adapt.red { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .42); }
.adapt.red p { color: #f3c4c4; }

/* ---------- bloques y ejercicios ---------- */
.block-title {
  font-size: 12.5px; font-weight: 680; text-transform: uppercase; letter-spacing: .08em;
  color: var(--acc2); margin: 18px 0 9px; display: flex; align-items: center; gap: 9px;
}
.block-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.ex { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 9px; overflow: hidden; transition: border-color .2s; }
.ex.done { border-color: rgba(74, 222, 128, .5); background: linear-gradient(160deg, rgba(74, 222, 128, .07), var(--card)); }
.ex-head { display: flex; align-items: center; gap: 11px; padding: 12px 13px; }
.chk {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 9px; border: 2px solid var(--line); background: transparent;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
  color: transparent; cursor: pointer; transition: .18s;
}
.ex.done .chk { background: var(--acc); border-color: var(--acc); color: #07140c; }
.ex-main { flex: 1; min-width: 0; cursor: pointer; }
.ex-name { font-size: 15px; font-weight: 640; display: block; }
.ex.done .ex-name { color: var(--mut); }
.ex-meta { font-size: 12px; color: var(--mut); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ex-meta .dose { color: var(--txt); font-weight: 620; }
.ex-meta .rest { opacity: .85; }
.ex-btns { display: flex; gap: 6px; flex-shrink: 0; }
.ex-how, .ex-go {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--card2); border: 1px solid var(--line); color: var(--txt);
  font-size: 15px; cursor: pointer; display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.ex-how:active, .ex-go:active { background: var(--line); }
.ex-go { background: rgba(96, 165, 250, .14); border-color: rgba(96, 165, 250, .4); color: #bfdcff; }

/* registro de carga: solo en ejercicios con peso */
.load-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 13px 12px;
}
.load-row .ll { font-size: 12px; color: var(--mut); }
.load-row .ll b { color: var(--acc); }
.load-in { display: flex; gap: 6px; }
.load-in input {
  width: 64px; background: var(--bg2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px; font-size: 14px; text-align: center; min-height: 40px;
  font-variant-numeric: tabular-nums;
}
.load-in input:focus { outline: none; border-color: var(--acc2); }
.in-save {
  background: var(--card2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; font-size: 13px; font-weight: 620;
  cursor: pointer; min-height: 40px;
}
.in-save:active { background: var(--line); }

.ex-body { display: none; padding: 0 13px 13px; border-top: 1px solid var(--line); }
.ex.open .ex-body { display: block; padding-top: 12px; }
.ex-body h5 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); margin: 13px 0 6px; font-weight: 650; }
.ex-parts, .ex-mach { font-size: 13px; color: var(--mut); margin: 0 0 6px; line-height: 1.5; }
.ex-parts b, .ex-mach b { color: var(--txt); font-weight: 600; }
.cues { margin-left: 17px; }
.cues li { font-size: 13.5px; margin-bottom: 5px; color: #d5e2f0; }
.why { font-size: 13.5px; color: #bcd2e8; background: rgba(96, 165, 250, .09); padding: 10px 12px; border-radius: 9px; border-left: 3px solid var(--acc2); }
.watch { font-size: 13.5px; color: #e8d6ad; background: rgba(251, 191, 36, .09); padding: 10px 12px; border-radius: 9px; border-left: 3px solid var(--warn); }
.how-lnk { margin-top: 12px; }

.session-foot {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.done-line { font-size: 14px; color: var(--mut); white-space: nowrap; }
.session-foot .btn { flex: 1; width: auto; }

/* ---------- Plan: la semana ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.wd {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 3px; border-radius: 10px; text-align: center;
  background: var(--bg2); border: 1px solid var(--line);
}
.wd-d { font-size: 11px; font-weight: 700; color: var(--mut); text-transform: uppercase; }
.wd-s { font-size: 9.5px; line-height: 1.25; color: var(--mut); }
.wd.on { background: rgba(74, 222, 128, .1); border-color: rgba(74, 222, 128, .42); }
.wd.on .wd-d { color: var(--acc); }
.wd.on .wd-s { color: var(--txt); }
.wk-note { margin-top: 11px; font-size: 12.5px; }

/* ---------- fases ---------- */
.phase {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--pc, var(--acc));
  border-radius: 14px; padding: 15px; margin-bottom: 11px;
}
.phase.cur { background: var(--card2); }
.phase-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phase h3 { font-size: 16.5px; font-weight: 660; margin-bottom: 3px; }
.badge {
  background: var(--acc); color: #07140c; border-radius: 999px; padding: 3px 9px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.phase .wk { font-size: 12.5px; color: var(--mut); font-weight: 560; }
.phase .goal { font-size: 14px; margin: 9px 0; color: #d5e2f0; }
.phase dl { margin-top: 11px; display: grid; gap: 9px; }
.phase dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--mut); font-weight: 650; margin-bottom: 2px; }
.phase dd { font-size: 13.5px; color: #cfdcea; }
.phase ul { margin-left: 18px; margin-top: 4px; }
.phase ul li { font-size: 13.5px; margin-bottom: 4px; color: #cfdcea; }

/* ---------- Guía: acordeones ---------- */
.acc { background: var(--card); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 9px; overflow: hidden; }
.acc-h {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: var(--txt);
  padding: 15px 14px; font-size: 14.5px; font-weight: 640;
  cursor: pointer; text-align: left; min-height: 52px;
}
.acc-h span { font-size: 18px; flex-shrink: 0; }
.acc-h i { margin-left: auto; color: var(--mut); font-style: normal; font-size: 18px; transition: transform .2s; }
.acc.open .acc-h i { transform: rotate(90deg); }
.acc-b { display: none; padding: 0 14px 15px; }
.acc.open .acc-b { display: block; }
.acc-b h4 { font-size: 15px; margin-bottom: 6px; }

/* ---------- semáforo (hoja inferior) ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(4, 7, 11, .74); display: flex; align-items: flex-end; animation: fade .18s ease; }
.sheet-box {
  width: 100%; background: var(--bg2); border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(22px + var(--safe-b));
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: up .26s cubic-bezier(.2, .9, .3, 1);
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet-box h3 { font-size: 17px; margin-bottom: 4px; }

.slider-wrap { display: block; margin: 14px 0; }
.slider-wrap > span { font-size: 14px; color: var(--mut); display: block; margin-bottom: 9px; }
.slider-wrap b { color: var(--txt); font-size: 17px; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 99px;
  background: linear-gradient(90deg, var(--acc) 0%, var(--warn) 50%, var(--dang) 100%);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 3px solid var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); cursor: pointer;
}
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--bg); cursor: pointer; }

.gate { display: flex; flex-direction: column; gap: 7px; margin: 14px 0; }
.gate-row {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px;
  background: var(--card2); border-left: 4px solid var(--line);
  opacity: .5; transition: opacity .2s, background .2s;
}
.gate-row.green { border-left-color: var(--acc); }
.gate-row.amber { border-left-color: var(--warn); }
.gate-row.red { border-left-color: var(--dang); }
.gate-row b { font-size: 13px; min-width: 44px; flex-shrink: 0; }
.gate-row span { font-size: 13px; color: var(--mut); }
.gate-row.on { opacity: 1; background: #22303f; }
.gate-row.on span { color: var(--txt); }
.verdict { margin: 13px 0 16px; padding: 11px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 580; background: var(--card2); }
.verdict.green { color: #a7f3d0; }
.verdict.amber { color: #fde68a; }
.verdict.red { color: #fca5a5; }

/* ---------- reglas, objetivo, fuentes ---------- */
.rules { display: grid; gap: 10px; }
.rule { display: flex; gap: 11px; align-items: flex-start; }
.rule .ic { font-size: 19px; flex-shrink: 0; line-height: 1.3; }
.rule b { font-size: 14px; display: block; margin-bottom: 2px; }
.rule p { font-size: 13.5px; color: var(--mut); }
ul.rules { display: block; margin: 12px 0 0; padding-left: 20px; }
ul.rules li { font-size: 14px; line-height: 1.5; margin-bottom: 8px; color: var(--txt); }

.lever-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.lever-icon { font-size: 26px; line-height: 1; }
.lever-head h3 { margin: 0 0 4px; font-size: 16px; }
.lever p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; }
.lever .ev { margin: 0; font-size: 12px; color: var(--mut); border-top: 1px solid var(--line); padding-top: 9px; }
.np { margin: 10px 0; font-size: 14px; line-height: 1.5; }
.np b { color: var(--warn); }
.honest { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mut); }
.tl { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl b { font-size: 13px; color: var(--acc2); }
.tl span { font-size: 14px; line-height: 1.5; }
.flags { margin-left: 18px; }
.flags li { font-size: 13.5px; margin-bottom: 7px; color: #f3c4c4; }
.sources { margin-left: 17px; }
.sources li { font-size: 12.5px; color: var(--mut); margin-bottom: 8px; line-height: 1.5; }

/* ---------- test direccional ---------- */
.steps { margin-left: 20px; }
.steps li { font-size: 14px; margin-bottom: 8px; color: #d5e2f0; padding-left: 3px; }
.outcome {
  width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px; margin-bottom: 9px;
  cursor: pointer; color: var(--txt); transition: .18s; min-height: 48px;
}
.outcome:active { transform: scale(.99); }
.outcome b { display: block; font-size: 14px; margin-bottom: 4px; }
.outcome span { font-size: 12.5px; color: var(--mut); }
.outcome.sel { border-color: var(--acc2); background: linear-gradient(160deg, rgba(96, 165, 250, .12), var(--card)); }
.res { background: var(--bg2); border: 1px solid var(--acc2); border-radius: 12px; padding: 13px; }
.res h4 { font-size: 16px; margin-bottom: 7px; color: var(--acc2); }
.res p { font-size: 13.5px; }

/* ---------- qué evitar ---------- */
.avoid { background: var(--bg2); border: 1px solid var(--line); border-radius: 13px; padding: 13px; margin-bottom: 9px; }
.avoid h4 { font-size: 14.5px; font-weight: 640; color: #fca5a5; margin-bottom: 7px; display: flex; gap: 8px; align-items: flex-start; }
.avoid .w { font-size: 13px; color: var(--mut); margin-bottom: 9px; }
.avoid .a { font-size: 13px; color: #a7f3d0; background: rgba(74, 222, 128, .09); padding: 9px 11px; border-radius: 9px; border-left: 3px solid var(--acc); }
.avoid .a b { color: var(--acc); }

/* ---------- progreso ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 14px; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 5px; text-align: center; }
.stat b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--acc); }
.stat span { font-size: 10px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; display: block; }

.phase-switch { display: flex; gap: 6px; margin-bottom: 9px; }
.phase-switch button {
  flex: 1; background: var(--card2); border: 1px solid var(--line); color: var(--mut);
  border-radius: 10px; padding: 11px 4px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 44px;
}
.phase-switch button.active { background: var(--acc); border-color: var(--acc); color: #07140c; }

.crit { display: flex; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.crit:last-child { border-bottom: 0; }
.crit .chk { width: 24px; height: 24px; font-size: 13px; border-radius: 7px; }
.crit.on .chk { background: var(--acc); border-color: var(--acc); color: #07140c; }
.crit span { font-size: 13.5px; flex: 1; }
.crit.on span { color: var(--mut); text-decoration: line-through; }
.crit-bar { height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; margin-top: 11px; }
.crit-bar div { height: 100%; background: var(--acc2); border-radius: 3px; transition: width .4s ease; }
.crit-bar div.full { background: var(--acc); }

/* progresión de cargas */
.lp { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lp:last-of-type { border-bottom: 0; }
.lp-n { flex: 1; min-width: 0; font-size: 14px; font-weight: 620; }
.lp-n span { display: block; font-size: 11px; color: var(--mut); font-weight: 400; }
.lp-v { text-align: right; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-v span { display: block; font-size: 11px; color: var(--mut); }
.lp-d { font-size: 12.5px; font-weight: 700; min-width: 56px; text-align: right; }
.lp-d.up { color: var(--acc); }
.lp-d.down { color: var(--dang); }
.lp-d.flat { color: var(--mut); }
.lp-note { margin-top: 12px; font-size: 12px; }

.log { max-height: 320px; overflow-y: auto; }
.log-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.log-row:last-child { border-bottom: 0; }
.log-row span { color: var(--mut); font-size: 11.5px; }
.lr-r { text-align: right; white-space: nowrap; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(5, 8, 12, .94); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 16px; overflow-y: auto;
  animation: fade .18s ease;
}
.overlay.hidden, .hidden { display: none !important; }

.how-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  width: min(460px, 94vw); max-height: 92vh; overflow-y: auto;
  padding: 16px 16px calc(16px + var(--safe-b)); -webkit-overflow-scrolling: touch;
}
.how-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.how-top h3 { font-size: 18px; line-height: 1.3; margin: 0; }
.how-close {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--mut); font-size: 15px; cursor: pointer; line-height: 1;
}
.how-close:active { background: var(--line); }
.how-parts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--mut); margin: 6px 0 0; }

/* lienzo de la animación */
.how-anim {
  position: relative; margin: 13px 0;
  background: radial-gradient(circle at 50% 42%, #1b2634 0%, #121923 72%);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.how-anim svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / .85; }
.how-phase {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(11, 15, 20, .82); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; font-size: 11.5px; font-weight: 620; color: var(--acc);
}
.anim-ctl { position: absolute; right: 9px; top: 9px; display: flex; gap: 6px; }
.anim-ctl button {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(11, 15, 20, .8); border: 1px solid var(--line);
  color: var(--txt); font-size: 12.5px; font-weight: 620; cursor: pointer;
}
.anim-ctl button.on { background: var(--acc); color: #07140c; border-color: var(--acc); }

.how-grid { display: grid; gap: 9px; }
.how-sec { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 9px; }
.how-grid .how-sec { margin-bottom: 0; }
.how-sec h4 {
  display: flex; align-items: center; gap: 7px; margin: 0 0 7px;
  font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); font-weight: 700;
}
.how-sec p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--txt); }
.how-machine { border-left: 3px solid var(--acc2); font-weight: 600; }
.how-sec ol { margin: 0; padding-left: 20px; }
.how-sec ol li { font-size: 13.5px; line-height: 1.6; margin-bottom: 7px; color: var(--txt); }
.how-sec ol li::marker { color: var(--acc); font-weight: 700; }
.how-video {
  display: block; text-align: center; background: var(--card2); color: var(--acc2);
  border: 1px solid var(--line); border-radius: 11px; padding: 13px;
  font-size: 13.5px; font-weight: 620; text-decoration: none;
}
.how-video:active { background: var(--line); }

/* ---------- temporizador ---------- */
.timer-box { text-align: center; max-width: 340px; width: 100%; }
.t-ex { font-size: 18px; font-weight: 650; margin-bottom: 20px; letter-spacing: -.01em; }
.t-ring { position: relative; width: 210px; height: 210px; margin: 0 auto 20px; }
.t-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-bg { fill: none; stroke: var(--line); stroke-width: 7; }
.t-fg { fill: none; stroke: var(--acc); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 339.3; transition: stroke-dashoffset .95s linear; }
.t-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.t-sub { font-size: 14px; color: var(--mut); margin-bottom: 22px; min-height: 22px; }
.t-actions { display: flex; gap: 9px; }

/* ---------- aviso flotante ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 90;
  background: var(--card2); border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 18px; font-size: 13.5px; font-weight: 620;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
  max-width: 90vw; text-align: center;
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

footer { padding: 20px 0 8px; text-align: center; }
footer p { font-size: 11.5px; color: #5a6b80; }

/* ---------- área táctil ----------
   Estos controles se ven pequeños a propósito (casilla, cerrar, enlaces),
   pero el dedo necesita 44 px. Se amplía la zona sensible sin tocar
   el aspecto visual. */
.chk, .banner-x, .lnk, .install, .how-close, .anim-ctl button { position: relative; }
.chk::after, .banner-x::after, .lnk::after,
.install::after, .how-close::after, .anim-ctl button::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, 44px); height: max(100%, 44px);
}

@media (min-width: 560px) {
  .how-grid { grid-template-columns: 1fr 1fr; }
  .wd-s { font-size: 10.5px; }
  .rules { grid-template-columns: 1fr 1fr; }
  ul.rules { grid-template-columns: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
