/* ═══════════════════════════════════════════════════════════════
   Cardio final (js/24j-cardio.js): prescripción premium + anillo
   Ligero para Safari en iPhone: degradados planos, sin filtros ni
   desenfoques ni colores P3. El color sigue a la fase:
   trabajo = fuego, descanso = hielo, continuo = acento, hecho = verde.
═══════════════════════════════════════════════════════════════ */
.cx { --cx-hot: #ff6a3d; --cx-cool: #5b8dff; --cx-acc: var(--rn-acc, #d4a843); display: grid; gap: 12px; margin: 14px 0 16px; }

/* Prescripción */
.cx-card { position: relative; overflow: hidden; display: grid; gap: 12px; padding: 15px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cx-card::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 2px; border-radius: 0 0 2px 2px; background: linear-gradient(90deg, transparent, var(--cx-c), transparent); opacity: .85; }
.cx-card.is-hiit { --cx-c: var(--cx-hot); background: radial-gradient(120% 120% at 100% 0%, rgba(255,106,61,.16), transparent 55%), linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.cx-card.is-steady { --cx-c: var(--cx-acc); background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--cx-acc) 16%, transparent), transparent 55%), linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.cx-card header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cx-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--cx-c); background: color-mix(in srgb, var(--cx-c) 16%, rgba(255,255,255,.03)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cx-c) 30%, transparent); }
.cx-ic svg { width: 22px; height: 22px; }
.cx-card header > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.cx-card header small { font: 900 9.5px/1 'Inter', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cx-c); }
.cx-card header b { font: 900 21px/1 'Barlow Condensed', sans-serif; letter-spacing: .4px; text-transform: uppercase; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-card header em { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px 7px 9px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);  border-radius: 999px; background: rgba(0,0,0,.28); font: 800 13px/1 'Inter', sans-serif; font-style: normal; color: #fff; font-variant-numeric: tabular-nums; }
.cx-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cx-tiles div { display: grid; justify-items: center; gap: 4px; padding: 11px 6px; border-radius: 16px; background: rgba(0,0,0,.24); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.cx-tiles b { font: 900 26px/1 'Barlow Condensed', sans-serif; color: #fff; }
.cx-tiles b i { font-style: normal; font-size: 14px; margin-left: 1px; opacity: .7; }
.cx-tiles small { font: 800 10px/1 'Inter', sans-serif; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.55); }
.cx-tiles .is-work b { color: #ffb08a; } .cx-tiles .is-work { box-shadow: inset 0 0 0 1px rgba(255,106,61,.35); }
.cx-tiles .is-rest b { color: #a9c3ff; } .cx-tiles .is-rest { box-shadow: inset 0 0 0 1px rgba(91,141,255,.35); }
.cx-stations { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-stations span { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px 0 5px; border-radius: 999px; background: rgba(255,255,255,.06); font: 700 12.5px/1 'Inter', sans-serif; color: #fff; }
.cx-stations i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--cx-c); color: #1a0b05; font: 900 11px/1 'Inter', sans-serif; font-style: normal; }
.cx-card header em svg { width: 14px; height: 14px; color: var(--cx-c); }
.cx-card header em i { margin-left: 2px; font: 700 11px/1 'Inter', sans-serif; font-style: normal; color: rgba(255,255,255,.6); }
.cx-params { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
/* 3 por fila; si la última fila queda con 2 o 1, se reparten el ancho completo */
.cx-param:nth-child(3n+1):nth-last-child(2), .cx-param:nth-child(3n+1):nth-last-child(2) ~ .cx-param { grid-column: span 3; }
.cx-param:nth-child(3n+1):last-child { grid-column: 1 / -1; }
.cx-params:empty { display: none; }
.cx-param { grid-column: span 2; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 10px 10px 11px; border-radius: 16px; background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.32)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 1px 0 rgba(255,255,255,.03); }
.cx-param-hd { display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; min-width: 0; }
.cx-param-ic { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; color: var(--cx-c); background: color-mix(in srgb, var(--cx-c) 14%, transparent); }
.cx-param-ic svg { width: 13px; height: 13px; }
.cx-param small { min-width: 0; font: 800 8.5px/1 'Inter', sans-serif; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.48); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-param b { font: 900 24px/.95 'Barlow Condensed', sans-serif; letter-spacing: .2px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-param b i { margin-left: 3px; font: 700 11px/1 'Inter', sans-serif; font-style: normal; color: rgba(255,255,255,.55); }
.cx-note { margin: 0; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.2); border-left: 2px solid var(--cx-c); font: 600 13px/1.5 'Inter', sans-serif; color: rgba(255,255,255,.82); }

/* Escenario */
.cx-stage { --ph: var(--cx-acc); display: grid; justify-items: center; gap: 12px; padding: 18px 14px 16px; border-radius: 26px;
  background: radial-gradient(90% 70% at 50% 30%, color-mix(in srgb, var(--ph) 18%, transparent), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); transition: background .5s; }
.cx-stage[data-phase=work] { --ph: var(--cx-hot); }
.cx-stage[data-phase=rest] { --ph: var(--cx-cool); }
.cx-stage[data-phase=done] { --ph: #2fbf74; }
.cx-ring { position: relative; width: min(64vw, 236px); aspect-ratio: 1; container-type: inline-size; }
.cx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cx-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 14; }
.cx-arc { fill: none; stroke: url(#cx-g-steady); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .25s linear; }
.cx-stage[data-phase=work] .cx-arc { stroke: url(#cx-g-work); }
.cx-stage[data-phase=rest] .cx-arc { stroke: url(#cx-g-rest); }
.cx-stage[data-phase=done] .cx-arc { stroke: url(#cx-g-done); }
.cx-total-track { fill: none; stroke: rgba(255,255,255,.05); stroke-width: 3; }
.cx-total { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .25s linear; }
.cx-center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; }
.cx-center small { max-width: 74cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 900 clamp(7.5px, 4.7cqw, 11px)/1 'Inter', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--ph); }
.cx-center b { font: 900 27cqw/.9 'Barlow Condensed', sans-serif; letter-spacing: .5px; color: #fff; font-variant-numeric: tabular-nums; }
.cx-center em { max-width: 66cqw; font: 700 clamp(9px, 5.1cqw, 12px)/1.3 'Inter', sans-serif; font-style: normal; color: rgba(255,255,255,.62); }
.cx-stage[data-run] .cx-center b { animation: cxBeat 1s ease-in-out infinite; }
@keyframes cxBeat { 50% { transform: scale(1.025); } }
.cx-pips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 260px; }
.cx-pips i { width: 18px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); transition: background .3s, width .3s; }
.cx-pips i.is-on { width: 28px; background: var(--ph); }
.cx-pips i.is-done { background: rgba(255,255,255,.55); }
.cx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-radius: 16px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.cx-stats > div { display: grid; justify-items: center; gap: 5px; padding: 11px 6px 10px; }
.cx-stats > div + div { box-shadow: inset 1px 0 0 rgba(255,255,255,.06); }
.cx-stats small { font: 800 10px/1 'Inter', sans-serif; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255,255,255,.45); }
.cx-stats b { font: 900 22px/1 'Barlow Condensed', sans-serif; letter-spacing: .3px; color: #fff; font-variant-numeric: tabular-nums; }
.cx-stats .is-grit b { color: var(--cx-acc); }
.cx-stage[data-paused] .cx-center small, .cx-stage[data-ended] .cx-center small { color: rgba(255,255,255,.6); }
.cx-stage[data-paused] .cx-center b { animation: cxBlink 1.6s ease-in-out infinite; }
.cx-stage[data-ended] .cx-arc { opacity: .55; }
@keyframes cxBlink { 50% { opacity: .45; } }
.cx-bar { width: 100%; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.cx-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cx-hot), var(--cx-acc)); transition: width .25s linear; }
.cx-ctrl { display: grid; grid-template-columns: 64px 76px 64px; align-items: start; justify-content: center; gap: 18px; margin-top: 4px; touch-action: pan-y; }
.cx-ctrl .cx-btn-ghost { position: relative; margin: 12px auto 0; }
.cx-btn-ghost small { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); font: 700 10.5px/1 'Inter', sans-serif; color: rgba(255,255,255,.5); white-space: nowrap; }
.cx-ctrl button { display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s; }
.cx-ctrl button:active { transform: scale(.92); }
.cx-btn-ghost { width: 52px; height: 52px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.cx-btn-ghost svg { width: 21px; height: 21px; }
.cx-btn-main { width: 76px; height: 76px; background: var(--ph); color: #0d0d10; box-shadow: 0 12px 28px color-mix(in srgb, var(--ph) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.4); transition: background .4s, transform .15s; }
.cx-btn-main svg { width: 30px; height: 30px; }
.cx-stage:not([data-run]) .cx-btn-main svg { margin-left: 3px; }
.cx-stage[data-phase=done] .cx-btn-main svg { margin-left: 0; width: 34px; height: 34px; }
.cx-stage[data-phase=done] .cx-btn-main { animation: cxPop .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes cxPop { from { transform: scale(.7); } }
.cx { padding-bottom: 28px; }
/* Resumen */
.cx-sumrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; margin: 10px 0 0; padding: 12px 14px; border-radius: 16px; background: rgba(255,106,61,.08); box-shadow: inset 0 0 0 1px rgba(255,106,61,.22); }
.cx-sumrow span { display: inline-flex; align-items: center; gap: 8px; font: 800 13px/1 'Inter', sans-serif; color: #fff; }
.cx-sumrow span svg { width: 17px; height: 17px; color: #ff8a5c; }
.cx-sumrow b { font: 900 18px/1 'Barlow Condensed', sans-serif; color: #fff; } .cx-sumrow b i { font-style: normal; font-size: 13px; opacity: .6; }
.cx-sumrow em { font: 900 12px/1 'Inter', sans-serif; font-style: normal; color: var(--rn-acc, #d4a843); }
@media (prefers-reduced-motion: reduce) { .cx-stage[data-run] .cx-center b, .cx-stage[data-paused] .cx-center b, .cx-stage[data-phase=done] .cx-btn-main { animation: none; } .cx-arc, .cx-total, .cx-bar i { transition: none; } }


/* Una modalidad: reloj y controles fijos; la prescripción larga se lee en su tarjeta. */
.wp-slide:has(.cx.is-single){overflow-y:hidden}
.wp-slide:has(.cx.is-single) > .wp-slide-in{height:100%;box-sizing:border-box;padding-bottom:calc(var(--safe-b,0px) + 88px);gap:8px}
.wp-slide:has(.cx.is-single) .wp-kicker,.wp-slide:has(.cx.is-single) .wp-ex-name{flex-shrink:0}
.cx.is-single{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;margin:0;padding-bottom:0}
.cx.is-single .cx-stage{flex:0 0 auto;gap:8px;padding:12px 12px 20px}
.cx.is-single .cx-ring{width:min(48vw,calc(100dvh - 610px),210px);min-width:120px}
.cx.is-single .cx-stats > div{padding:8px 6px}
.cx.is-single .cx-ctrl{margin-top:0;grid-template-columns:52px 64px 52px;gap:18px}
.cx.is-single .cx-btn-main{width:64px;height:64px}
.cx.is-single .cx-ctrl .cx-btn-ghost{margin-top:6px}
.cx.is-single .cx-card{flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;align-content:start;padding:12px;gap:10px}
.cx.is-single .cx-card header,.cx.is-single .cx-params,.cx.is-single .cx-tiles{flex-shrink:0}
@media(max-height:740px){
 .wp-slide:has(.cx.is-single) .wp-ex-name{font-size:28px}
 .cx.is-single .cx-stage{grid-template-columns:120px minmax(0,1fr);column-gap:12px;padding:10px 12px 20px}
 .cx.is-single .cx-ring{width:120px;grid-column:1;grid-row:1 / span 2}
 .cx.is-single .cx-stats{grid-column:2;grid-row:1;grid-template-columns:1fr}
 .cx.is-single .cx-stats > div{display:flex;justify-content:space-between;align-items:center;padding:6px 8px}
 .cx.is-single .cx-stats > div + div{box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
 .cx.is-single .cx-stats small{font-size:8px}
 .cx.is-single .cx-stats b{font-size:18px}
 .cx.is-single .cx-pips{grid-column:2;grid-row:2;gap:4px}
 .cx.is-single .cx-pips i{width:10px;height:5px}
 .cx.is-single .cx-pips i.is-on{width:16px}
 .cx.is-single .cx-bar,.cx.is-single .cx-ctrl{grid-column:1 / -1}
}
/* Al girar el teléfono o ampliar mucho el texto, se conserva acceso a todo el contenido. */
@media(max-height:540px){
 .wp-slide:has(.cx.is-single){overflow-y:auto}
 .wp-slide:has(.cx.is-single) > .wp-slide-in{height:auto;min-height:100%}
 .cx.is-single .cx-card{overflow-y:visible;flex:none}
}

/* Completo: el botón de la bandera lleva al resumen */
.cx-ctrl .cx-btn-ghost.is-go { background: color-mix(in srgb, var(--ph) 18%, transparent); color: var(--ph); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ph) 45%, transparent); }
.cx-ctrl .cx-btn-ghost.is-go small { color: var(--ph); font-weight: 800; }
