/* Aurelia Calm
   Theme: dusk to night. Every surface comes from one family of deep evening colours (wine, berry, violet,
   indigo, midnight, plus sapphire for breathing and garnet for muscle relaxation). Gold is the only accent:
   the ring, every primary button, every selected option. Home sits on the store's white. */
:root {
  --case: #ffffff;          /* home ground, identical to the logo file's white */
  --ink: #171718;           /* Aurelia onyx */
  --ink-soft: #6b6b6e;
  --gold: #b08d57;
  --gold-light: #d9bd8c;
  --gold-deep: #8a6d3f;
  --line: #e7e3dc;

  --sapphire: #1d438c;
  --wine: #7d1e3a;
  --berry: #6b2057;
  --violet: #4c276e;
  --indigo: #2f2b73;
  --midnight: #141b40;
  --garnet: #650c22;

  --f-display: "Arsenal", "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  --f-body: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

/* Every gem surface shares the same text and accent rules; only the ground changes. */
.gem-sapphire { --gem: var(--sapphire); }
.gem-wine { --gem: var(--wine); }
.gem-berry { --gem: var(--berry); }
.gem-violet { --gem: var(--violet); }
.gem-indigo { --gem: var(--indigo); }
.gem-midnight { --gem: var(--midnight); }
.gem-garnet { --gem: var(--garnet); }
[class*="gem-"] {
  --gem-fg: #ffffff;
  --gem-soft: rgba(255, 255, 255, .78);
  --gem-line: rgba(255, 255, 255, .2);
  --gem-tint: rgba(255, 255, 255, .09);
  --acc: var(--gold-light);
  --acc-fg: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--case);
  color: var(--ink);
  font: 400 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.staged { overflow: hidden; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Buttons: one primary style everywhere ---------- */
.btn {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 28px; border-radius: 999px;
  font: 700 13.5px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase;
  background: var(--gold-light); color: var(--ink);
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-wide { width: 100%; }

/* ---------- Home ---------- */
.home {
  max-width: 560px; margin: 0 auto;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  padding-block: 10px 36px;
  display: flex; flex-direction: column; gap: 26px;
}
.home-head { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.logo { display: block; width: 116px; height: auto; margin-left: -4px; }
.greet { margin: 0; font: 400 36px/1.08 var(--f-display); letter-spacing: -0.02em; text-wrap: balance; }

.hero {
  background: var(--gem); color: var(--gem-fg);
  border-radius: 26px; padding: 8px 20px 22px;
  display: flex; flex-direction: column;
}
.hero-ring { display: block; width: 100%; height: 212px; }
.hero h2 { margin: 2px 0 6px; font: 400 34px/1.05 var(--f-display); letter-spacing: -0.015em; }
.hero p { margin: 0 0 18px; color: var(--gem-soft); max-width: 32ch; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; }

.block { display: flex; flex-direction: column; gap: 14px; }
.block-title { margin: 0; font: 400 27px/1.15 var(--f-display); letter-spacing: -0.01em; }

.gems { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gems li { display: flex; }
.gem-row {
  width: 100%; border: 0; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 17px 16px 17px 18px; border-radius: 18px;
  background: var(--gem); color: var(--gem-fg);
  transition: transform .15s ease, filter .15s ease;
}
.gem-row:active { transform: scale(.985); }
.gem-t { display: block; margin: 0 0 3px; font: 700 21px/1.15 var(--f-display); }
.gem-d { display: block; font-size: 14.5px; line-height: 1.4; color: var(--gem-soft); }
.dur {
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--acc);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 700 19px/1 var(--f-display); font-variant-numeric: tabular-nums;
}
.dur small { font: 400 11px/1.2 var(--f-body); letter-spacing: .04em; opacity: .85; }

.pmr {
  background: var(--gem); color: var(--gem-fg);
  border-radius: 26px; padding: 22px 16px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.pmr h2 { margin: 0 4px; font: 400 31px/1.1 var(--f-display); letter-spacing: -0.015em; }
.pmr > p { margin: 0 4px 12px; color: var(--gem-soft); max-width: 36ch; }
.pmr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pmr-list li { display: flex; }
.pmr-opt {
  width: 100%; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "num txt min";
  align-items: center; gap: 12px;
  padding: 12px 14px 12px 8px; border-radius: 15px;
  background: var(--gem-tint); border: 1px solid var(--gem-line); color: var(--gem-fg);
  transition: transform .15s ease, background-color .15s ease;
}
.pmr-opt:active { transform: scale(.985); }
.pmr-num { grid-area: num; font: 400 38px/1 var(--f-display); color: var(--acc); text-align: center; font-variant-numeric: tabular-nums; }
.pmr-txt { grid-area: txt; }
.pmr-name { display: block; font: 700 19px/1.2 var(--f-display); }
.pmr-sub { display: block; font-size: 13.5px; color: var(--gem-soft); }
.pmr-min { grid-area: min; font: 700 15px/1 var(--f-body); white-space: nowrap; font-variant-numeric: tabular-nums; }

.home-foot { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding: 22px 2px 0; }
.home-foot p { margin: 0; font: 400 22px/1.2 var(--f-display); }
.home-foot a { color: var(--gold-deep); font-weight: 700; font-size: 15px; text-decoration: none; }
.home-foot a:hover { text-decoration: underline; }
.home-foot .acct { margin: 12px 0 0; font: 400 14px/1.5 var(--f-body); color: var(--ink-soft); }
.acct span { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.acct-out { border: 0; background: none; padding: 4px 0; cursor: pointer; color: var(--gold-deep); font: 700 14px/1.3 var(--f-body); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sign in (members only) ---------- */
body.gated { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 35; overflow-y: auto; overscroll-behavior: contain;
  background: var(--case); color: var(--ink);
  padding: env(safe-area-inset-top, 0px) var(--gutter-r) env(safe-area-inset-bottom, 0px) var(--gutter-l);
}
.gate-inner { max-width: 460px; margin: 0 auto; padding-block: 16px 28px; display: flex; flex-direction: column; gap: 22px; }
.gate-card { background: var(--gem); color: var(--gem-fg); border-radius: 26px; padding: 26px 20px 22px; }
.gate-title { margin: 0 0 8px; font: 400 34px/1.05 var(--f-display); letter-spacing: -0.015em; }
.gate-text { margin: 0 0 20px; color: var(--gem-soft); }
.gate-text b { color: var(--gem-fg); overflow-wrap: anywhere; }
.gate-label { display: block; margin: 0 0 8px; font: 700 14px/1.3 var(--f-body); }
.gate-input {
  display: block; width: 100%; height: 54px; margin: 0 0 14px; padding: 0 16px;
  border-radius: 14px; border: 1.5px solid var(--gem-line); background: var(--gem-tint); color: var(--gem-fg);
  font: 400 18px/1 var(--f-body); -webkit-appearance: none; appearance: none;
}
.gate-input::placeholder { color: rgba(255, 255, 255, .45); }
.gate-input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(217, 189, 140, .3); }
.gate-code { font: 700 28px/1 var(--f-body); letter-spacing: .42em; text-align: center; padding-left: calc(16px + .42em); font-variant-numeric: tabular-nums; }
.gate-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 14px; }
.gate-link { border: 0; background: none; padding: 6px 0; cursor: pointer; color: var(--acc); font: 700 14.5px/1.3 var(--f-body); text-decoration: underline; text-underline-offset: 3px; }
.gate-link:disabled { color: var(--gem-soft); text-decoration: none; cursor: default; }
.gate-msg { margin: 16px 0 0; padding: 11px 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); font-size: 14.5px; line-height: 1.45; }
.gate-msg:empty { display: none; }
.gate-msg a { color: var(--acc); font-weight: 700; }
.gate-foot { margin: 0; text-align: center; font-size: 15px; color: var(--ink-soft); }
.gate-foot a { color: var(--gold-deep); font-weight: 700; }
a.btn { text-decoration: none; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
@media (min-width: 640px) {
  .gate-inner { padding-top: 56px; }
  .gate-card { padding: 34px 32px 28px; }
  .gate-title { font-size: 40px; }
}

/* ---------- Stages (full-screen sessions) ---------- */
.stage {
  position: fixed; inset: 0; z-index: 20;
  background: var(--gem); color: var(--gem-fg);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.stage-inner { width: 100%; max-width: 560px; margin: 0 auto; flex: 1 0 auto; display: flex; flex-direction: column; }
.stage-top { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; min-height: 58px; }
.stage-title { margin: 0; text-align: center; font: 700 15px/1.25 var(--f-body); color: var(--gem-soft); }
.icon-btn {
  width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { background: rgba(255, 255, 255, .1); }
.stage-mid { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding-block: 8px; }

.viz { --viz: min(78vw, 42vh, 330px); position: relative; width: var(--viz); height: var(--viz); flex: 0 0 auto; }
@supports (height: 1dvh) { .viz { --viz: min(78vw, 42dvh, 330px); } }
#breathe.is-config .viz { --viz: min(62vw, 31vh, 270px); }
#breathe.is-custom .viz { --viz: min(46vw, 22vh, 200px); }
@supports (height: 1dvh) {
  #breathe.is-config .viz { --viz: min(62vw, 31dvh, 270px); }
  #breathe.is-custom .viz { --viz: min(46vw, 22dvh, 200px); }
}
.viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viz-center {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.phase { font: 400 22px/1.15 var(--f-display); }
.count { font: 400 52px/1 var(--f-display); font-variant-numeric: tabular-nums; margin-top: 4px; }
.count:empty { display: none; }
#breathe.is-custom .phase { font-size: clamp(13px, calc(var(--viz) * .15), 22px); }

.group { text-align: center; min-height: 54px; display: flex; flex-direction: column; justify-content: flex-end; }
.group-name { margin: 0; font: 400 27px/1.15 var(--f-display); text-wrap: balance; }
.group-n { margin: 2px 0 0; font-size: 14px; color: var(--gem-soft); font-variant-numeric: tabular-nums; }

.caption {
  margin: 0; max-width: 30ch; min-height: 4.2em;
  font: 400 23px/1.36 var(--f-display); text-align: center; text-wrap: balance;
  transition: opacity .5s ease;
}
.caption.is-out { opacity: 0; }
.caption.is-intro { font-size: 20px; color: var(--gem-soft); }

.stage-bottom { display: flex; flex-direction: column; gap: 14px; padding-block: 6px 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.meta { margin: 0; text-align: center; font-size: 14.5px; color: var(--gem-soft); font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: center; gap: 30px; }
.play {
  width: 74px; height: 74px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--acc); color: var(--acc-fg);
  display: grid; place-items: center;
}
.play svg { width: 30px; height: 30px; }
.skip svg { width: 26px; height: 26px; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.dimmer { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 30s linear; z-index: 25; }
.dimmer.is-on { opacity: .9; pointer-events: auto; }
.dimmer.is-quick { transition-duration: .6s; }

/* ---------- Breathing setup ---------- */
.b-time { margin: 0; font: 400 17px/1 var(--f-body); color: var(--gem-soft); font-variant-numeric: tabular-nums; min-height: 17px; }
.config { display: flex; flex-direction: column; gap: 12px; }
.pats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pat {
  border: 1.5px solid var(--gem-line); background: transparent; color: inherit; cursor: pointer;
  border-radius: 14px; padding: 7px 6px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.pat b { font: 700 15px/1.1 var(--f-body); }
.pat span { font-size: 12.5px; line-height: 1.1; color: var(--gem-soft); font-variant-numeric: tabular-nums; }
.pat[aria-checked="true"] { background: var(--acc); border-color: var(--acc); color: var(--acc-fg); }
.pat[aria-checked="true"] span { color: rgba(23, 23, 24, .75); }
.pat-desc { margin: 0; font-size: 14.5px; color: var(--gem-soft); text-align: center; min-height: 1.5em; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-radius: 999px; padding: 4px; background: var(--gem-tint); gap: 2px; }
.seg button {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  min-height: 40px; border-radius: 999px; font: 700 14px/1 var(--f-body); font-variant-numeric: tabular-nums;
}
.seg button[aria-checked="true"] { background: var(--acc); color: var(--acc-fg); }

.custom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: var(--gem-tint); }
.step-box label { font-size: 12.5px; color: var(--gem-soft); }
.step-val { font: 400 26px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.step-btns { display: flex; gap: 6px; }
.step-btns button {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--gem-line); background: transparent; color: inherit;
  font: 700 18px/1 var(--f-body); cursor: pointer; display: grid; place-items: center;
}

/* ---------- Sound sheet (takes the colour of the session it opens from) ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(6, 6, 10, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel {
  width: 100%; max-width: 520px; background: var(--gem); color: var(--gem-fg);
  border-radius: 24px 24px 0 0; box-shadow: 0 -1px 0 var(--gem-line);
  padding: 20px var(--gutter-r) calc(18px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  display: flex; flex-direction: column; gap: 18px; max-height: 88vh; overflow-y: auto;
}
.sheet-panel h2 { margin: 0; font: 400 26px/1.1 var(--f-display); }
.set { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-label { font: 700 15px/1.3 var(--f-body); }
.set-note { margin: 0; font-size: 13.5px; color: var(--gem-soft); }
.switch {
  position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; cursor: pointer; flex: 0 0 auto;
  background: rgba(255, 255, 255, .25); transition: background-color .2s ease;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch[aria-checked="true"] { background: var(--acc); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.sheet select {
  width: 100%; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--gem-line); background: var(--gem-tint); color: var(--gem-fg);
  font: 400 15px var(--f-body); padding: 0 12px;
}
.sheet select option { color: var(--ink); }
.sheet input[type="range"] { width: 100%; accent-color: var(--gold-light); height: 32px; }

/* ---------- Pointer devices ---------- */
@media (hover: hover) {
  .gem-row:hover, .btn:hover, .play:hover { filter: brightness(1.08); }
  .pmr-opt:hover { background: rgba(255, 255, 255, .15); }
  .icon-btn:hover, .pat:hover, .step-btns button:hover { background: rgba(255, 255, 255, .1); }
  .pat[aria-checked="true"]:hover { background: var(--acc); }
}

/* ---------- Tablets ---------- */
@media (min-width: 640px) {
  .home { max-width: 780px; padding-block: 24px 48px; gap: 30px; }
  .logo { width: 132px; }
  .greet { font-size: 44px; }
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 20px; padding: 24px 28px; }
  .hero-ring { height: 280px; }
  .hero h2 { font-size: 40px; }
  .gems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gems li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .gem-row { padding: 20px 18px 20px 20px; }
  .pmr { padding: 26px 22px 22px; }
  .pmr-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .pmr-opt { grid-template-columns: 1fr; grid-template-areas: "num" "txt" "min"; justify-items: center; text-align: center; gap: 6px; padding: 18px 10px; }
  .pmr-num { font-size: 46px; }
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel { border-radius: 24px; max-width: 460px; padding: 26px 26px 24px; box-shadow: none; }
}

/* ---------- Desktops and landscape tablets: two columns, breathing card stays in view ---------- */
@media (min-width: 1000px) {
  .home {
    max-width: 1140px;
    display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas: "head head" "hero med" "hero pmr" "foot foot";
    column-gap: 36px; row-gap: 30px; align-items: start;
  }
  .home-head { grid-area: head; }
  .hero { grid-area: hero; position: sticky; top: 24px; display: flex; align-items: stretch; padding: 16px 30px 30px; }
  .hero-ring { height: 330px; }
  .block { grid-area: med; }
  .gems { grid-template-columns: 1fr; }
  .pmr { grid-area: pmr; }
  .home-foot { grid-area: foot; }
}

/* ---------- Sessions on big screens ---------- */
@media (min-width: 700px) and (min-height: 700px) {
  .stage-inner { max-width: 620px; }
  .viz { --viz: min(62vw, 46vh, 440px); }
  #breathe.is-config .viz { --viz: min(50vw, 34vh, 340px); }
  #breathe.is-custom .viz { --viz: min(40vw, 27vh, 270px); }
  @supports (height: 1dvh) {
    .viz { --viz: min(62vw, 46dvh, 440px); }
    #breathe.is-config .viz { --viz: min(50vw, 34dvh, 340px); }
    #breathe.is-custom .viz { --viz: min(40vw, 27dvh, 270px); }
  }
  .caption { font-size: 27px; }
  .caption.is-intro { font-size: 22px; }
  .phase { font-size: 26px; }
  #breathe.is-custom .phase { font-size: clamp(13px, calc(var(--viz) * .15), 26px); }
  .count { font-size: 64px; }
}

/* ---------- Phones on their side (and other short screens): ring left, text and controls right ---------- */
@media (orientation: landscape) and (max-height: 760px) {
  .stage-inner {
    max-width: 1000px; display: grid; align-items: center; column-gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    grid-template-areas: "top top" "viz ." "viz group" "viz text" "viz bottom" "viz .";
  }
  .stage-mid { display: contents; }
  .stage-top { grid-area: top; min-height: 50px; }
  .viz, #breathe.is-config .viz, #breathe.is-custom .viz { grid-area: viz; justify-self: center; --viz: min(42vw, 66vh, 320px); }
  @supports (height: 1dvh) { .viz, #breathe.is-config .viz, #breathe.is-custom .viz { --viz: min(42vw, 66dvh, 320px); } }
  .group { grid-area: group; min-height: 0; }
  .group-name { font-size: 22px; }
  .caption, .b-time { grid-area: text; justify-self: center; }
  .caption { min-height: 0; font-size: 19px; }
  .stage-bottom { grid-area: bottom; padding-block: 4px 10px; gap: 10px; }
  .play { width: 62px; height: 62px; }
  #pTime { margin-top: 6px !important; }
  .custom .step-box { padding: 6px 4px; }
}

/* ---------- Short phones held upright (small iPhones, Safari with toolbars) ---------- */
@media (orientation: portrait) and (max-height: 720px) {
  .stage-top { min-height: 52px; }
  .stage-mid { gap: 12px; padding-block: 4px; }
  .viz { --viz: min(78vw, 38vh, 330px); }
  @supports (height: 1dvh) { .viz { --viz: min(78vw, 38dvh, 330px); } }
}
@media (orientation: portrait) and (max-height: 600px) {
  .viz { --viz: min(70vw, 34vh, 330px); }
  #breathe.is-config .viz { --viz: min(54vw, 26vh, 270px); }
  #breathe.is-custom .viz { --viz: min(40vw, 17vh, 200px); }
  @supports (height: 1dvh) {
    .viz { --viz: min(70vw, 34dvh, 330px); }
    #breathe.is-config .viz { --viz: min(54vw, 26dvh, 270px); }
    #breathe.is-custom .viz { --viz: min(40vw, 17dvh, 200px); }
  }
  .group { min-height: 0; }
  .group-name { font-size: 23px; }
  .caption { font-size: 20px; }
  .stage-bottom { padding-block: 4px 12px; gap: 10px; }
  .play { width: 62px; height: 62px; }
  #pTime { margin-top: 6px !important; }
  .config { gap: 9px; }
  .pat { min-height: 42px; padding: 5px 4px; }
  .custom .step-box { padding: 6px 4px; }
  .seg button { min-height: 36px; }
}

/* ---------- Phones on their side: compact breathing setup ---------- */
@media (orientation: landscape) and (max-height: 430px) {
  .stage-top { min-height: 44px; }
  .config { gap: 8px; }
  .pat { min-height: 40px; padding: 4px; gap: 1px; }
  .pat b { font-size: 14px; }
  .pat-desc { font-size: 13.5px; }
  .custom .step-box {
    display: grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline;
    column-gap: 6px; row-gap: 4px; padding: 5px 3px;
  }
  .custom .step-btns { grid-column: 1 / -1; gap: 4px; }
  .step-val { font-size: 22px; }
  .step-btns button { width: 30px; height: 30px; }
  .seg button { min-height: 36px; }
  .stage-bottom { padding-block: 2px 8px; }
  .stage-bottom .btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .gem-row, .pmr-opt, .caption { transition: none; }
  .dimmer { transition-duration: 2s; }
}
