/* ══════════════════════════════════════════════════
   O₂ RHYTHM — REGULATE TOOLS (immersive mode)
   When a tool is running, the screen dims into a calm night room.
══════════════════════════════════════════════════ */

:root {
  --rgx-night: #050d1c;
  --rgx-ink: #e8f1fb;
  --rgx-ink-soft: rgba(232, 241, 251, .68);
  --rgx-ink-faint: rgba(232, 241, 251, .38);
  --rgx-glass: rgba(255, 255, 255, .06);
  --rgx-glass-line: rgba(255, 255, 255, .12);
  --rgx-teal: #2dd4c4;
  --rgx-blue: #4c8dff;
}

/* ── Immersive shell ── */
body.rg-immersive { overflow: hidden; }
/* The panel's slide-in transform would trap the fixed overlay inside it */
body.rg-immersive .panel { transform: none !important; animation: none !important; }
body.rg-immersive #rgViewActive {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; gap: 0;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  color: var(--rgx-ink);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(45, 212, 196, .16), transparent 55%),
    radial-gradient(120% 60% at 100% 100%, rgba(76, 141, 255, .18), transparent 55%),
    var(--rgx-night);
  animation: rgxFadeIn .5s ease both;
}
@keyframes rgxFadeIn { from { opacity: 0; } to { opacity: 1; } }

.rgx-ambient { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
body.rg-immersive #rgViewActive > *:not(.rgx-ambient) {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px; margin-left: auto; margin-right: auto;
}

body.rg-immersive .rg-topbar { color: var(--rgx-ink); }
body.rg-immersive .rg-exit-btn,
body.rg-immersive .rg-sound-btn { color: var(--rgx-ink-soft); background: transparent; }
body.rg-immersive .rg-exit-btn:hover,
body.rg-immersive .rg-sound-btn:hover { color: #fff; background: var(--rgx-glass); }
body.rg-immersive .rg-tool-label { color: var(--rgx-ink-soft); letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; font-weight: 600; }
body.rg-immersive .rg-progress-wrap { margin-top: 10px; }
body.rg-immersive .rg-progress-bar { background: rgba(255, 255, 255, .08); height: 3px; }
body.rg-immersive .rg-progress-fill { background: linear-gradient(90deg, var(--rgx-blue), var(--rgx-teal)); box-shadow: 0 0 10px rgba(45, 212, 196, .6); transition: none; }
body.rg-immersive .rg-progress-label { color: var(--rgx-ink-faint); font-variant-numeric: tabular-nums; }

body.rg-immersive .rg-stage {
  flex: 1; justify-content: center; gap: 18px;
  padding: 18px 0 8px; text-align: center;
}
body.rg-immersive .rg-round-label { color: var(--rgx-ink-faint); letter-spacing: .06em; }
body.rg-immersive .rg-breath-cue { color: var(--rgx-ink-soft); font-size: 1.05rem; min-height: 1.6em; max-width: 30ch; margin: 0 auto; }
body.rg-immersive .rg-controls { justify-content: center; }
body.rg-immersive .rg-controls .btn--ghost {
  color: var(--rgx-ink-soft); border: 1px solid var(--rgx-glass-line); background: var(--rgx-glass);
  border-radius: 999px; padding: 8px 18px;
}
body.rg-immersive .rg-controls .btn--ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
/* Pause means nothing for self-paced tools */
#rgViewActive[data-tool="senses"] #rgPauseBtn,
#rgViewActive[data-tool="release"] #rgPauseBtn { display: none; }

.rgx-hint { color: var(--rgx-ink-faint); font-size: .85rem; margin: 0; }

/* ═══ Breathing orb ═══ */
.rgx-orb-wrap {
  position: relative; width: min(78vw, 320px); aspect-ratio: 1;
  display: grid; place-items: center; margin: 0 auto;
  touch-action: none; user-select: none; -webkit-user-select: none;
  --rgx-accent: var(--rgx-teal);
}
.rgx-orb-wrap[data-kind="out"]  { --rgx-accent: var(--rgx-blue); }
.rgx-orb-wrap[data-kind="hold"] { --rgx-accent: rgba(255, 255, 255, .7); }
.rgx-orb-wrap.is-lead { cursor: pointer; }

.rgx-track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rgx-track__box, .rgx-track__ring { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 2; }
.rgx-track__arc {
  fill: none; stroke: var(--rgx-accent); stroke-width: 3; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 150px 150px;
  transition: stroke .6s ease;
}
.rgx-track__dot {
  fill: #fff; transition: fill .6s ease;
  filter: drop-shadow(0 0 6px var(--rgx-teal)) drop-shadow(0 0 14px var(--rgx-accent));
}

.rgx-orb {
  position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%;
  transform: scale(var(--s, .55)); will-change: transform;
}
.rgx-orb__core {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .85), rgba(45, 212, 196, .9) 26%, rgba(26, 111, 216, .92) 68%, rgba(13, 27, 62, .95));
  box-shadow: 0 0 60px rgba(45, 212, 196, .45), 0 0 120px rgba(76, 141, 255, .25), inset 0 -18px 40px rgba(5, 13, 28, .45);
  transition: filter .9s ease;
}
.rgx-orb[data-kind="out"] .rgx-orb__core  { filter: hue-rotate(22deg) saturate(1.1); }
.rgx-orb[data-kind="hold"] .rgx-orb__core { filter: saturate(.7) brightness(1.08); }
.rgx-orb__halo {
  position: absolute; inset: -22%; border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 196, .3), transparent 65%);
  animation: rgxHalo 6s ease-in-out infinite;
}
.rgx-orb__halo--2 { inset: -45%; opacity: .45; animation-delay: -3s; background: radial-gradient(circle, rgba(76, 141, 255, .28), transparent 62%); }
@keyframes rgxHalo { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }

.rgx-orb-wrap .rg-breath-text { position: relative; z-index: 2; pointer-events: none; }
.rgx-orb-wrap .rg-breath-phase {
  display: block; color: #fff; font-size: .78rem; font-weight: 600; letter-spacing: .24em;
  text-shadow: 0 1px 12px rgba(5, 13, 28, .8);
}
.rgx-orb-wrap .rg-breath-count {
  display: block; color: #fff; font-size: 3rem; font-weight: 300; line-height: 1.1;
  font-variant-numeric: tabular-nums; text-shadow: 0 2px 18px rgba(5, 13, 28, .7);
}
[data-theme="dark"] .rgx-orb-wrap .rg-breath-phase { color: #fff; }

/* Sigh steps */
.rgx-steps { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rgx-steps[hidden] { display: none; }
.rgx-step {
  font-size: .78rem; padding: 6px 12px; border-radius: 999px;
  color: var(--rgx-ink-faint); border: 1px solid var(--rgx-glass-line);
  transition: all .35s ease;
}
.rgx-step.active { color: #05101f; background: var(--rgx-teal); border-color: var(--rgx-teal); box-shadow: 0 0 18px rgba(45, 212, 196, .5); }
.rgx-step.done { color: var(--rgx-ink-soft); border-color: rgba(45, 212, 196, .4); }

/* Guide me / I'll lead */
.rgx-mode {
  display: inline-flex; padding: 4px; margin: 4px auto 0; border-radius: 999px;
  background: var(--rgx-glass); border: 1px solid var(--rgx-glass-line);
}
.rgx-mode[hidden] { display: none; }
.rgx-mode__btn {
  border: 0; background: transparent; color: var(--rgx-ink-soft); cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  transition: background .25s, color .25s;
}
.rgx-mode__btn.active { background: rgba(255, 255, 255, .92); color: #0d1b3e; }
.rgx-lead-stats { color: var(--rgx-teal); font-size: .9rem; margin: 0; min-height: 1.4em; }
.rgx-lead-stats[hidden] { display: none; }

/* ═══ 5 Senses ═══ */
.rgx-sky { width: 100%; max-width: 420px; height: auto; margin: 0 auto; overflow: visible; }
.rgx-sky__line { stroke: rgba(255, 255, 255, .22); stroke-width: 1; animation: rgxFadeIn .8s ease both; }
.rgx-sky__star {
  transform-box: fill-box; transform-origin: center;
  filter: drop-shadow(0 0 5px currentColor);
  animation: rgxStarIn .6s cubic-bezier(.16, 1, .3, 1) both, rgxTwinkle 3.5s ease-in-out .6s infinite;
}
@keyframes rgxStarIn { from { transform: scale(0); opacity: 0; } 60% { transform: scale(1.6); } to { transform: scale(1); opacity: 1; } }
@keyframes rgxTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.rgx-senses, .rgx-senses-summary { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rgx-senses[hidden], .rgx-senses-summary[hidden] { display: none; }
body.rg-immersive .rg-senses-header { display: flex; justify-content: space-between; width: 100%; max-width: 360px; }
body.rg-immersive .rg-senses-sense { font-weight: 700; letter-spacing: .18em; font-size: .85rem; }
body.rg-immersive .rg-senses-counter { color: var(--rgx-ink-faint); font-size: .85rem; }
body.rg-immersive .rg-senses-intro { color: var(--rgx-ink-soft); margin: 0; min-height: 1.4em; }
body.rg-immersive .rg-senses-item { color: #fff; font-size: 1.45rem; font-weight: 600; line-height: 1.3; margin: 0; max-width: 22ch; }
.rgx-senses-input {
  width: 100%; max-width: 320px; text-align: center; font: inherit; font-size: 1rem;
  color: #fff; background: transparent; border: 0; border-bottom: 1px solid var(--rgx-glass-line);
  padding: 8px 4px; outline: none; transition: border-color .2s;
}
.rgx-senses-input::placeholder { color: var(--rgx-ink-faint); }
.rgx-senses-input:focus { border-bottom-color: var(--rgx-teal); }
.rgx-found-btn {
  font: inherit; font-weight: 700; font-size: 1rem; letter-spacing: .02em; cursor: pointer;
  color: #05101f; background: linear-gradient(135deg, #7ff0e4, var(--rgx-teal));
  border: 0; border-radius: 999px; padding: 14px 36px; margin-top: 4px;
  box-shadow: 0 8px 28px rgba(45, 212, 196, .35);
  transition: transform .15s ease, box-shadow .2s ease;
}
.rgx-found-btn:hover { box-shadow: 0 10px 34px rgba(45, 212, 196, .5); }
.rgx-found-btn:active { transform: scale(.96); }
.rgx-senses-summary__title { color: #fff; font-size: 1.4rem; font-weight: 600; margin: 0; }
.rgx-senses-summary__list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: 420px;
}
.rgx-senses-summary__list li {
  color: var(--rgx-ink); background: var(--rgx-glass); border: 1px solid var(--rgx-glass-line);
  padding: 6px 12px; border-radius: 999px; font-size: .9rem;
  animation: rgxStarIn .5s ease both;
}
.rgx-senses-summary__list li.rgx-senses-summary__empty { border: 0; background: none; color: var(--rgx-ink-soft); font-size: 1rem; }

/* ═══ Tapping ═══ */
.rgx-tap-stage { position: relative; width: min(72vw, 280px); margin: 0 auto; touch-action: manipulation; cursor: pointer; }
.rgx-body { width: 100%; height: auto; display: block; overflow: visible; }
.rgx-body__line { fill: none; stroke: rgba(232, 241, 251, .35); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rgx-body__soft { fill: none; stroke: rgba(232, 241, 251, .18); stroke-width: 1.6; stroke-linecap: round; }
.rgx-tp { fill: rgba(255, 255, 255, .2); transition: fill .3s ease; }
.rgx-tp.done { fill: rgba(45, 212, 196, .45); }
.rgx-tp.active { fill: var(--rgx-teal); filter: drop-shadow(0 0 8px var(--rgx-teal)); }
.rgx-tp-ripple {
  fill: none; stroke: var(--rgx-teal); stroke-width: 2;
  transform-box: fill-box; transform-origin: center;
  animation: rgxRipple .85s ease-out forwards;
}
@keyframes rgxRipple { from { transform: scale(1); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }
.rgx-tap-ripples { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.rgx-user-ripple {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .7); animation: rgxRippleUser .65s ease-out forwards;
}
@keyframes rgxRippleUser { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
body.rg-immersive .rg-tap-cue { color: var(--rgx-ink-faint); margin: 0; letter-spacing: .06em; }
body.rg-immersive .rg-tap-point { color: #fff; font-size: 1.6rem; font-weight: 600; margin: 0; background: none; border: 0; box-shadow: none; padding: 0; }
body.rg-immersive .rg-tap-count { color: var(--rgx-ink-soft); font-variant-numeric: tabular-nums; margin: 0; }
body.rg-immersive .rg-tap-dot { background: rgba(255, 255, 255, .18); }
body.rg-immersive .rg-tap-dot.active { background: var(--rgx-teal); box-shadow: 0 0 8px var(--rgx-teal); }
body.rg-immersive .rg-tap-dot.done { background: rgba(45, 212, 196, .5); }

/* ═══ Sound ═══ */
body.rg-immersive .rg-sound-grid { width: 100%; }
body.rg-immersive .rg-sound-card {
  color: var(--rgx-ink); background: var(--rgx-glass); border: 1px solid var(--rgx-glass-line);
  border-radius: 18px; backdrop-filter: blur(6px);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
body.rg-immersive .rg-sound-card:hover { border-color: rgba(45, 212, 196, .6); background: rgba(45, 212, 196, .1); transform: translateY(-2px); box-shadow: none; }
.rgx-sound-ico { font-size: 1.8rem; line-height: 1; display: block; margin-bottom: 4px; }
body.rg-immersive .rg-sound-player { background: none; border: 0; box-shadow: none; width: 100%; align-items: center; }
.rgx-waves { width: 100%; height: 140px; display: block; }
body.rg-immersive .rg-sound-playing { color: #fff; font-size: 1.3rem; font-weight: 600; }
body.rg-immersive .rg-sound-timer { color: var(--rgx-ink-soft); font-size: 2.2rem; font-weight: 300; font-variant-numeric: tabular-nums; }
body.rg-immersive .rg-volume-row { color: var(--rgx-ink-soft); }
body.rg-immersive .rg-sound-stop-btn { color: var(--rgx-ink); background: var(--rgx-glass); border: 1px solid var(--rgx-glass-line); }
.rgx-sound-actions { display: flex; gap: 10px; justify-content: center; }
.rg-volume-slider { accent-color: var(--rgx-teal); }

/* ═══ Let It Go ═══ */
.rgx-release { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.rgx-release[hidden] { display: none; }
.rgx-release__q { color: #fff; font-size: 1.35rem; font-weight: 600; margin: 0; }
.rgx-release__input {
  width: 100%; font: inherit; font-size: 1.05rem; line-height: 1.5; color: #fff; resize: none;
  background: var(--rgx-glass); border: 1px solid var(--rgx-glass-line); border-radius: 18px;
  padding: 16px; outline: none; transition: border-color .2s;
}
.rgx-release__input::placeholder { color: var(--rgx-ink-faint); }
.rgx-release__input:focus { border-color: rgba(45, 212, 196, .6); }
.rgx-release__canvas { display: block; margin: 0 auto; max-width: 100%; }
.rgx-release__canvas[hidden] { display: none; }

.rgx-hold-btn {
  position: relative; width: 128px; height: 128px; margin: 6px auto 0; border-radius: 50%;
  border: 0; cursor: pointer; font: inherit; color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .18), rgba(45, 212, 196, .12) 60%, transparent);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .25s ease, opacity .25s ease;
}
.rgx-hold-btn[hidden] { display: none; }
.rgx-hold-btn:disabled { opacity: .35; cursor: default; }
.rgx-hold-btn.is-holding { transform: scale(1.08); }
.rgx-hold-btn__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rgx-hold-btn__bg { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 3; }
.rgx-hold-btn__fg { fill: none; stroke: var(--rgx-teal); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--rgx-teal)); }
.rgx-hold-btn__label { position: relative; font-size: .85rem; font-weight: 600; letter-spacing: .04em; line-height: 1.3; }

/* ═══ "Just start" (Regulate home, normal theme) ═══ */
.rgx-juststart {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: #fff; border: 0; border-radius: var(--radius-lg, 20px);
  padding: 18px 20px; margin-bottom: var(--sp-6, 1.5rem);
  background: linear-gradient(135deg, #0d1b3e 0%, #1a4f9c 55%, #00a596 100%);
  box-shadow: 0 10px 30px rgba(26, 111, 216, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rgx-juststart:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(26, 111, 216, .35); }
.rgx-juststart__orb {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff, #7ff0e4 30%, #1a6fd8 80%);
  box-shadow: 0 0 22px rgba(127, 240, 228, .7);
  animation: rgxBreatheIcon 5s ease-in-out infinite;
}
@keyframes rgxBreatheIcon { 0%, 100% { transform: scale(.8); } 45% { transform: scale(1.05); } }
.rgx-juststart__text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rgx-juststart__title { font-size: 1.15rem; font-weight: 700; }
.rgx-juststart__sub { font-size: .9rem; opacity: .8; }
.rgx-juststart__arrow { font-size: 1.8rem; opacity: .7; }

/* ═══ Before / after check (normal theme) ═══ */
.rgx-check {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 20px);
  padding: 16px 18px;
}
.rgx-check[hidden] { display: none; }
.rgx-check--after { text-align: left; width: 100%; margin: 4px 0 8px; }
.rgx-check__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rgx-check__q { font-weight: 600; color: var(--text); }
.rgx-check__val { font-size: .85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rgx-check__ends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-faint); }
.rgx-check__slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; outline: none;
  background: linear-gradient(90deg, #00bfae, #f5b642 60%, #ef6f6c);
  opacity: .45; transition: opacity .2s;
}
.rgx-check__slider.is-set, .rgx-check--after .rgx-check__slider { opacity: 1; }
.rgx-check__slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 3px solid #0d1b3e; box-shadow: 0 2px 10px rgba(13, 27, 62, .25);
}
.rgx-check__slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 3px solid #0d1b3e; box-shadow: 0 2px 10px rgba(13, 27, 62, .25);
}
.rgx-check__result { margin: 4px 0 0; font-weight: 600; min-height: 1.4em; color: var(--text); }
.rgx-check__result[data-tone="down"] { color: #00a596; }

@media (prefers-reduced-motion: reduce) {
  .rgx-orb__halo, .rgx-sky__star, .rgx-juststart__orb { animation: none; }
}
.rgx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }

/* ═══ Body tools ═══ */
.rgx-orb[data-kind="squeeze"] .rgx-orb__core { filter: hue-rotate(-150deg) saturate(1.3) brightness(1.05); }
.rgx-orb[data-kind="cold"] .rgx-orb__core { filter: hue-rotate(28deg) saturate(.8) brightness(1.2); }
#rgxBodyOrb { transform: scale(.7); }
.rgx-body-step { margin: 0; min-height: 1.3em; font-size: .85rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rgx-teal); }
.rgx-step--dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; }

/* ═══ What helped last time (Regulate home, normal theme) ═══ */
.rgx-lasttime {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; cursor: pointer; font: inherit;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--teal); border-radius: var(--radius-lg, 20px);
  padding: 14px 18px; margin-bottom: var(--sp-3, .75rem);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rgx-lasttime[hidden] { display: none; }
.rgx-lasttime:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.rgx-lasttime__eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.rgx-lasttime__text { font-weight: 600; font-size: 1rem; }
.rgx-lasttime__cta { font-size: .85rem; color: var(--text-muted); }

/* ═══ How are you now? (end of every tool) ═══ */
.rgx-hownow { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 8px 0 4px; width: 100%; }
.rgx-hownow[hidden] { display: none; }
.rgx-hownow__q { margin: 0; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.rgx-hownow__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 420px; }
.rgx-hownow__btn {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; padding: 14px 8px;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: var(--radius-md, 14px);
  transition: border-color .2s ease, transform .15s ease;
}
.rgx-hownow__btn:hover { border-color: var(--teal); }
.rgx-hownow__btn:active { transform: scale(.97); }
.rgx-hownow__btn[data-how="better"]:hover { border-color: #00a596; color: #00a596; }
.rgx-hownow__btn[data-how="worse"]:hover { border-color: #d64545; color: #d64545; }
.rgx-link-quiet { font: inherit; font-size: .85rem; color: var(--text-muted); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.rgx-next { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.rgx-next[hidden] { display: none; }
.rgx-next__msg { margin: 0; color: var(--text-muted); text-align: center; max-width: 32ch; }
.rgx-next .rg-complete-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }
.rgx-next .rg-complete-actions > [hidden] { display: none; }
.rgx-next__crisis {
  margin: 4px 0 0; padding: 10px 14px; border-radius: var(--radius-md, 14px); max-width: 360px;
  border: 1px solid var(--divider); border-left: 3px solid #d64545; font-size: .88rem; color: var(--text);
}
.rgx-next__crisis[hidden] { display: none; }
.rgx-next__crisis a { color: #d64545; font-weight: 700; }

/* ═══ "All tools" on the Regulate screen ═══ */
.rgx-alltools {
  display: block; margin: 4px auto 0; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  background: none; border: 0; color: var(--text-muted); padding: 8px 12px;
}
.rgx-alltools:hover { color: var(--teal); }
#rgToolGrid { margin-top: var(--sp-4, 1rem); }

/* ═══ Sit with me ═══ */
.rgx-sit { position: relative; display: flex; flex-direction: column; align-items: center; gap: 36px; width: 100%; }
.rgx-sit__orb {
  position: relative; width: min(52vw, 210px); aspect-ratio: 1;
  animation: rgxSitBreath 9s ease-in-out infinite;
}
@keyframes rgxSitBreath { 0%, 100% { transform: scale(.78); } 50% { transform: scale(.94); } }
.rgx-sit__orb .rgx-orb__core { filter: saturate(.85) brightness(1.05); }
.rgx-sit__line {
  min-height: 2.4em; margin: 0; max-width: 24ch; text-align: center;
  font-size: 1.35rem; font-weight: 500; line-height: 1.4; color: #fff;
  opacity: 0; transform: translateY(6px); transition: opacity 1.6s ease, transform 1.6s ease;
}
.rgx-sit__line.show { opacity: .92; transform: translateY(0); }

.rgx-sit__end { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: rgxFadeIn .8s ease both; }
.rgx-sit__end[hidden] { display: none; }
.rgx-sit__end-q { margin: 0; color: var(--rgx-ink); font-size: 1.15rem; font-weight: 600; }
.rgx-sit__ok {
  font: inherit; font-weight: 600; cursor: pointer; color: var(--rgx-ink-soft);
  background: transparent; border: 1px solid var(--rgx-glass-line); border-radius: 999px; padding: 12px 28px;
}
.rgx-sit__ok:hover { color: #fff; border-color: rgba(255, 255, 255, .35); }

.rgx-sit__rain {
  font: inherit; font-size: .85rem; cursor: pointer; color: var(--rgx-ink-faint);
  background: none; border: 1px solid var(--rgx-glass-line); border-radius: 999px; padding: 7px 16px; margin-top: 8px;
}
.rgx-sit__rain[aria-pressed="true"] { color: var(--rgx-teal); border-color: rgba(45, 212, 196, .5); }
.rgx-hint[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .rgx-sit__orb { animation: none; transform: scale(.86); }
}

/* Nothing to pause or restart when there is nothing to do */
#rgViewActive[data-tool="sit"] .rg-controls { display: none; }

/* ═══ Sit with me, together ═══ */
.rgx-sit__orbs { position: relative; display: grid; place-items: center; }
button.rgx-sit__orb { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; }
button.rgx-sit__orb:focus-visible { outline: 2px solid rgba(255, 255, 255, .4); outline-offset: 8px; border-radius: 50%; }

/* The other person's glow: smaller, beside yours, breathing on the same cycle */
.rgx-sit__companion {
  position: absolute; width: 38%; aspect-ratio: 1; right: -24%; bottom: -6%;
  opacity: 0; transform: scale(.6); transition: opacity 1.4s ease, transform 1.4s ease;
  animation: rgxSitBreath 9s ease-in-out infinite; pointer-events: none;
}
.rgx-sit__companion .rgx-orb__core { filter: hue-rotate(40deg) saturate(.9) brightness(1.1); }
.rgx-sit.has-companion .rgx-sit__companion { opacity: 1; }

/* A soft pulse, sent or received */
.is-pulsing .rgx-orb__core { animation: rgxSitPulse 1.2s ease-out; }
@keyframes rgxSitPulse {
  0% { box-shadow: 0 0 60px rgba(45, 212, 196, .45), 0 0 0 0 rgba(255, 255, 255, .55); }
  100% { box-shadow: 0 0 60px rgba(45, 212, 196, .45), 0 0 0 40px rgba(255, 255, 255, 0); }
}

.rgx-sit__status { margin: -12px 0 0; min-height: 1.4em; color: var(--rgx-teal); font-weight: 600; text-align: center; }
.rgx-sit__status[hidden] { display: none; }

.rgx-sit__extras { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rgx-sit__extras [hidden] { display: none; }

.rgx-sit__ask {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 340px;
  padding: 18px; border-radius: 18px; background: var(--rgx-glass); border: 1px solid var(--rgx-glass-line);
  animation: rgxFadeIn .4s ease both;
}
.rgx-sit__ask[hidden] { display: none; }
.rgx-sit__ask-label { color: var(--rgx-ink); font-weight: 600; }
.rgx-sit__ask-input {
  width: 100%; text-align: center; font: inherit; font-size: 1.05rem; color: #fff;
  background: transparent; border: 0; border-bottom: 1px solid var(--rgx-glass-line); padding: 8px 4px; outline: none;
}
.rgx-sit__ask-input:focus { border-bottom-color: var(--rgx-teal); }
.rgx-sit__ask-input::placeholder { color: var(--rgx-ink-faint); }
.rgx-sit__ask .rgx-found-btn { text-decoration: none; text-align: center; }
.rgx-sit__ask-row { display: flex; gap: 8px; }
.rgx-sit__ask-row .rgx-sit__ok { padding: 9px 18px; font-size: .9rem; }

/* Friend's welcome screen (reuses the closing-screen look) */
.o2-sitguest .rgx-found-btn { margin-top: 6px; }
.o2-sitguest__msg { text-decoration: none; }
.o2-sitguest__msg[hidden] { display: none; }
.o2-sitguest__care { margin: 14px 0 0; font-size: .85rem; color: rgba(232, 241, 251, .6); }
.o2-sitguest__care a { color: #ff8a8a; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .rgx-sit__companion { animation: none; }
}

/* End screens on phones: buttons wrap instead of stretching off screen */
.rg-complete-card { width: 100%; box-sizing: border-box; }
.rg-complete-actions .btn,
.rf-thanks-actions .btn,
.cn-after-reading__actions .btn,
.o2-moment__alt .btn,
#leaveForm .form-actions .btn {
  white-space: normal; height: auto; min-height: 48px; line-height: 1.3;
  text-align: center; max-width: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.btn .btn-sub { display: block; white-space: normal; font-size: .82em; font-weight: 500; font-style: italic; opacity: .85; margin-top: 3px; }
.rgx-next .rg-complete-actions { align-items: stretch; }
#leaveForm .form-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
#leaveForm .form-actions .btn { width: 100%; margin-top: 0 !important; }
