/* Respirar más lento: la curva manda; el resto acompaña. En modo sesión, fondo noche y nada más que la guía. */
.rs {
  --rs-fondo: var(--papel);
  --rs-tinta: var(--tinta);
  --rs-texto: var(--cuerpo);
  --rs-nota: var(--nota);
  --rs-azul: var(--azul);
  --rs-azul-suave: #9DBEDD;
  --rs-linea: var(--linea);
  --rs-pista-in: #E4EDF6;
  --rs-pista-out: #F1ECE2;
  --rs-boton: #fff;
  display: grid; gap: 28px;
}
body.session:has(.rs), body.session .r-page:has(.rs) { background: #16212A; }
body.session .rs {
  --rs-fondo: #16212A; --rs-tinta: #FDFAF5; --rs-texto: #C9D3DA; --rs-nota: #93A3AE; --rs-azul: #9DBEDD; --rs-azul-suave: #4F6E8B;
  --rs-linea: #2E3D49; --rs-pista-in: #22374B; --rs-pista-out: #222E38; --rs-boton: #1F2C36;
  color: var(--rs-tinta);
}
body.session .r-page:has(.rs) .r-session-ui { background: color-mix(in srgb, #16212A 94%, transparent); border-bottom-color: #2E3D49; }
body.session .r-page:has(.rs) .r-session-ui .r-btn { background: #1F2C36; color: #FDFAF5; }
body.session .rs-por, body.session .rs-cuerpo, html:has(body.session .rs) { background: #16212A; }
body.session .rs-por, body.session .rs-cuerpo, body.session .rs-avisos li:not(:nth-child(2)) { display: none; }

/* ---------- por qué ---------- */
.rs-por { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 40px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--rs-linea); }
.rs-por h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.15; text-wrap: balance; }
.rs-por h2 em { color: var(--rs-azul); }
.rs-por p { margin: 8px 0 0; color: var(--rs-texto); font-size: 15px; max-width: 52ch; }
.rs-por-svg { width: 100%; height: auto; aspect-ratio: 640 / 180; display: block; overflow: visible; min-width: 0; }
.rs-por > * { min-width: 0; }
.rs-por-llave { fill: none; stroke: var(--rs-azul); stroke-width: 1.2; }
.rs-por-t { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; fill: var(--rs-nota); }
.rs-por-t.azul { fill: var(--rs-azul); }
.rs-por-corta { fill: none; stroke: #8A969E; stroke-width: 2.4; stroke-dasharray: 1; stroke-linecap: round; }
.rs-por-larga { fill: none; stroke: var(--rs-azul); stroke-width: 3.5; stroke-dasharray: 1; stroke-linecap: round; }

/* ---------- guía ---------- */
.rs-guia { display: grid; gap: 6px; }
.rs-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: clamp(70px, 10vw, 112px); }
.rs-palabra { display: flex; align-items: baseline; gap: clamp(14px, 3vw, 32px); }
.rs-palabra b { font-family: var(--display); font-style: italic; font-weight: 300; font-size: clamp(56px, 10vw, 112px); line-height: .9; letter-spacing: -.02em; color: var(--rs-azul); transition: color .4s; }
.rs[data-fase="fuera"] .rs-palabra b { color: var(--rs-tinta); }
.rs[data-fase="arriba"] .rs-palabra b { color: var(--rs-nota); }
.rs[data-fase="quieto"] .rs-palabra b { color: var(--rs-tinta); }
.rs-palabra span { font-family: var(--mono); font-weight: 500; font-size: clamp(40px, 7vw, 80px); line-height: .9; color: var(--rs-tinta); font-variant-numeric: tabular-nums; min-width: 1ch; }
.rs-sub { margin: 4px 0 0; font-family: var(--display); font-style: italic; font-size: clamp(18px, 2.2vw, 22px); color: var(--rs-texto); min-height: 1.4em; }
.rs-vivo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rs-lienzo { position: relative; margin-top: 4px; }
.rs-svg { width: 100%; display: block; overflow: hidden; }
body.session .rs-svg { max-height: 52vh; }
.rs-curva { fill: none; stroke: var(--rs-tinta); stroke-width: 3; stroke-linecap: round; opacity: .55; }
.rs[data-fase="quieto"] .rs-curva-hecha { opacity: 0; }
.rs-curva-hecha { fill: none; stroke: var(--rs-azul); stroke-width: 7; stroke-linecap: round; }
.rs-seg-p { fill: var(--rs-tinta); }
.rs-seg-p.dentro { fill: var(--rs-azul); }
.rs-seg-p.arriba { fill: var(--rs-nota); }
.rs-pista { rx: 3; }
.rs-pista.dentro { fill: var(--rs-pista-in); }
.rs-pista.fuera { fill: var(--rs-pista-out); }
.rs-pista.arriba { fill: transparent; stroke: var(--rs-linea); }
.rs-pista-t { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; fill: var(--rs-texto); }
.rs-pista-t.dentro { fill: var(--rs-azul); }
.rs-cab { stroke: var(--rs-tinta); stroke-width: 2; opacity: .35; }
.rs-punto { fill: var(--rs-azul); stroke: var(--rs-fondo); stroke-width: 4; }
.rs-estado { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--rs-nota); min-height: 1.4em; font-variant-numeric: tabular-nums; }

/* ilustración infantil */
.rs-ilus svg { display: block; width: clamp(110px, 16vw, 170px); height: auto; }
.rs-ilus svg > * { transition: opacity .4s; }
.rs-ilus[data-f="dentro"] .vela, .rs-ilus[data-f="dentro"] .mecha, .rs-ilus[data-f="dentro"] #rs-llama { opacity: .35; }
.rs-ilus[data-f="fuera"] .rs-flor { opacity: .35; }
.rs-flor ellipse { fill: #F3D7DE; stroke: var(--rs-tinta); stroke-width: 1.6; transition: fill .5s; }
.rs-flor .c { fill: #EBA83F; stroke: var(--rs-tinta); stroke-width: 1.6; }
.rs-flor.on ellipse { fill: #E9A9B8; }
.rs-flor .tallo { fill: none; stroke: #3E7A4D; stroke-width: 3; stroke-linecap: round; }
.rs-ilus .vela { fill: #fff; stroke: var(--rs-tinta); stroke-width: 1.6; }
.rs-ilus .mecha { stroke: var(--rs-tinta); stroke-width: 2; }
.rs-ilus .llama { fill: #EBA83F; stroke: #B07316; stroke-width: 1.2; }

/* controles */
.rs-ctrl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 28px; margin-top: 12px; }
.rs-play { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 26px 0 20px; border: 0; border-radius: 999px; background: var(--rs-tinta); color: var(--rs-fondo); font-size: 17px; cursor: pointer; }
.rs-play .ico { width: 0; height: 0; border-left: 14px solid currentColor; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.rs-play.on .ico { width: 14px; height: 18px; border: 0; border-left: 5px solid currentColor; border-right: 5px solid currentColor; }
.rs-grupo { display: grid; gap: 4px; }
.rs-grupo .lab { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rs-nota); }
.rs-seg { display: flex; border: 1.5px solid var(--rs-linea); border-radius: 999px; overflow: hidden; background: var(--rs-boton); }
.rs-seg button { min-height: 42px; padding: 0 12px; border: 0; background: none; color: var(--rs-texto); font-size: 14px; cursor: pointer; }
.rs-seg button[aria-checked="true"] { background: var(--rs-tinta); color: var(--rs-fondo); }
.rs-vel { display: flex; align-items: center; border: 1.5px solid var(--rs-linea); border-radius: 999px; background: var(--rs-boton); }
.rs-vel button { width: 44px; min-height: 42px; border: 0; background: none; color: var(--rs-tinta); font-size: 20px; cursor: pointer; border-radius: 999px; }
.rs-vel button:disabled { opacity: .3; cursor: default; }
.rs-vel output { min-width: 52px; text-align: center; font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.rs-opc { display: flex; gap: 8px; }
.rs-tog { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--rs-linea); background: var(--rs-boton); color: var(--rs-texto); font-size: 14px; cursor: pointer; }
.rs-tog[aria-pressed="true"] { border-color: var(--rs-azul); color: var(--rs-azul); background: color-mix(in srgb, var(--rs-azul) 10%, var(--rs-boton)); }
.rs-tog[aria-pressed="true"]::before { content: '✓ '; }
.rs.respirando .rs-grupo:not(.rs-opc) .rs-seg { opacity: .5; }
.rs-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rs-linea); }
.rs-aire-btn, .rs-link { border: 0; background: none; padding: 6px 0; color: var(--rs-azul); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; text-align: left; }
.rs-avisos { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13.5px; color: var(--rs-texto); max-width: 60ch; }
.rs-avisos li::before { content: '· '; color: var(--rs-nota); }

/* a mi aire */
.rs-aire { display: grid; gap: 10px; }
.rs-aire-cab h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 300; font-size: clamp(40px, 6vw, 64px); color: var(--rs-azul); }
.rs-aire-cab p { margin: 4px 0 0; color: var(--rs-texto); max-width: 56ch; }
.rs-pad { background: #fff; border-radius: 14px; }
body.session .rs-pad { background: #1B2731; }
.rs-ref { fill: none; stroke: #C3CBD0; stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.rs-ref-t { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; fill: var(--rs-nota); }
.rs-mia { fill: none; stroke: var(--rs-azul); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.rs-pulsa { display: block; width: 100%; margin-top: 10px; min-height: 120px; border: 2px solid var(--rs-azul); border-radius: 16px; background: color-mix(in srgb, var(--rs-azul) 6%, var(--rs-boton)); color: var(--rs-azul); font-family: var(--display); font-style: italic; font-size: clamp(18px, 2.4vw, 22px); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; transition: background .3s; }
.rs-pulsa.on { background: var(--rs-azul); color: var(--rs-fondo); border-style: solid; }
.rs-aire-dato { margin: 0; min-height: 1.5em; font-family: var(--display); font-style: italic; font-size: 19px; color: var(--rs-azul); }

/* antes / después */
.rs-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 32px; align-items: center; padding: 18px 20px; background: var(--papel-2); border-radius: 14px; }
.rs-cuerpo h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 19px; }
.rs-cuerpo h2 small { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--nota); margin-left: 6px; }
.rs-cuerpo p { margin: 2px 0 0; color: var(--cuerpo); font-size: 14.5px; }
.rs-escala { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-escala button { width: 38px; height: 38px; border: 1.5px solid var(--linea); background: #fff; border-radius: 8px; font-family: var(--mono); font-size: 14px; color: var(--cuerpo); cursor: pointer; }
.rs-escala button[aria-checked="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.rs-final { display: grid; gap: 14px; justify-items: start; padding-top: 24px; border-top: 1px solid var(--rs-linea); }
.rs-final h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; }
.rs-final h2 em { color: var(--rs-azul); }
#rs-escala-despues button[aria-checked="true"] { background: var(--azul); border-color: var(--azul); }
.rs-neutro { margin: 0; font-family: var(--display); font-style: italic; font-size: 19px; color: var(--rs-azul); max-width: 46ch; }
.rs-semana { width: 100%; }
.rs-semana .lab { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rs-nota); }
.rs-semana ol { list-style: none; margin: 6px 0 0; padding: 0; max-width: 520px; }
.rs-semana li { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rs-linea); font-size: 14.5px; color: var(--rs-texto); }
.rs-semana li b { font-weight: 500; color: var(--rs-tinta); }
.rs-acc { margin-top: 4px; }

@media (max-width: 760px) {
  .rs-por { grid-template-columns: 1fr; }
  .rs-cuerpo { grid-template-columns: 1fr; }
  .rs-ctrl { gap: 12px 16px; }
  .rs-play { width: 100%; justify-content: center; }
  .rs-escala button { width: calc((100% - 40px) / 11); min-width: 26px; height: 40px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-palabra b { transition: none; }
}
