/* Practice keeps the original photographic layers, beam and breathing glow. */
#app[data-view="practice"] .mood {
  display: block;
  isolation: isolate;
  overflow: hidden;
  background: #1a1015;
  font-family: var(--font-body, "Hanken Grotesk", sans-serif);
}
.mood::after {
  background: linear-gradient(180deg, rgba(26,16,21,.25), rgba(26,16,21,.12) 35%, rgba(26,16,21,.86) 100%);
}
.mood .mood-inner {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  gap: 12px;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.mood-inner > * { flex-shrink: 0; }
.mood-header {
  width: 100%;
  max-width: 580px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 44px;
  align-items: start;
  margin-bottom: clamp(14px, 4vh, 40px);
}
.mood-heading { min-width: 0; }
.mood .mood-pick {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: none;
  backdrop-filter: none;
  color: #fff0e7;
  font-family: var(--font-display, "Fraunces", serif);
  font-size: clamp(1.55rem, 5.8vw, 2.6rem);
  font-weight: 300;
  font-style: normal;
  line-height: 1.12;
}
.mood-subtitle { margin: 7px 0 0; font-size: .85rem; color: #e1c9c6; }
.mood-icon, .mood-inner .mc:not(.play) {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  box-shadow: none;
  color: #f2c4c4;
  backdrop-filter: none;
}
.mood-inner button svg, .mood-volume svg, .mood-cover svg, .mood-voice > svg {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.mood button:focus-visible, .mood input:focus-visible { outline: 2px solid #f2c4c4; outline-offset: 4px; }
.mood .ring { width: min(300px, calc(100vw - 48px)); margin: 0; }
.mood .ring > svg { width: 100%; height: 100%; overflow: visible; }
.ring-knob-orbit { position: absolute; inset: 0; pointer-events: none; transition: transform 1s linear; }
.ring-knob {
  position: absolute;
  top: 5.882353%; /* (170 - 150) / 340: the SVG beam's centreline. */
  left: 50%;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff0e5;
  box-shadow: 0 0 12px #ffb3a7, 0 0 30px 8px rgba(255,179,167,.7);
}
.mood .ring-in { padding: 0 34px; gap: 8px; }
.mood .ring-in h2 { font-size: 1.6rem; font-weight: 300; font-style: normal; line-height: 1.12; text-wrap: balance; }
.mood .mood-time { font-family: var(--font-display, "Fraunces", serif); font-size: 4.6rem; letter-spacing: -.04em; }
.mood .breath { max-width: 190px; font-size: .65rem; line-height: 1.5; letter-spacing: .045em; }
.mood #session-left { color: #dec5c4; font-size: .68rem; letter-spacing: .06em; }
.mood .mood-guide { max-width: 380px; margin: 0; font-size: .94rem; font-weight: 300; line-height: 1.4; color: #dfc8c6; }
.mood-stages { display: grid; gap: 9px; margin: 4px 0; }
.mood .mood-steps { margin: 0; gap: 15px; }
.mood .mood-steps i { width: 8px; height: 8px; border-color: #af8c95; }
.mood .mood-steps .done i { background: #d98f97; border-color: #d98f97; }
.mood .mood-steps .now i { background: #f2c4c4; border-color: #f2c4c4; box-shadow: 0 0 12px #e8a4a4; }
.mood #mk { font-family: var(--font-display, "Fraunces", serif); font-size: .9rem; letter-spacing: 0; text-transform: none; color: #f2dcd4; }
.mood .mood-ctl { gap: 34px; margin: 5px 0; }
.mood-inner .mc.play {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 1px solid #e8a4a4;
  background: linear-gradient(140deg, #efb5a8, #a85d79 55%, #562a48);
  box-shadow: 0 0 32px rgba(217,143,151,.25), inset 0 1px rgba(255,240,230,.5);
}
.mood-inner .mc.play svg { width: 29px; height: 29px; }
.mood-voice { position: relative; color: #f2c4c4; margin: 3px 0 8px; }
.mood-voice > svg { position: absolute; top: 12px; left: 18px; pointer-events: none; }
/* pSetting and the existing click handler replace vtog.textContent. Keep that
   accessible state text; render its label from the authoritative checkbox. */
.mood .mood-vtog { min-height: 48px; margin: 0; padding: 10px 20px 10px 52px; font-size: 0; color: inherit; background: rgba(79,39,59,.38); border: 1px solid rgba(217,143,151,.4); }
.mood-vtog::after { content: "Voice guide off"; font: 400 .95rem var(--font-display, "Fraunces", serif); }
.mood:has(#sound-voice input:checked) .mood-vtog::after { content: "Voice guide on"; }
.mood-audio { display: grid; width: 100%; max-width: 450px; gap: 10px; }
.mood .spbar, .mood-sound-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 11px;
  gap: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  backdrop-filter: blur(16px);
}
.mood .spbar img, .mood-cover { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; }
.mood-cover { display: grid; place-items: center; color: #f2c4c4; background: linear-gradient(145deg, #bd949f, #653a59 55%, #2a1a22); }
.mood .spnow b { font-family: var(--font-display, "Fraunces", serif); font-size: 1rem; font-weight: 300; }
.mood .spnow small { font-size: .65rem; }
.mood-source { display: block; color: #d8c1c4; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.mood .spbar button { display: grid; place-items: center; padding: 8px; min-width: 44px; min-height: 44px; }
.mood #spbar { gap: 3px; }
.mood #spbar img { width: 32px; height: 38px; }
.mood-sound-card { display: flex; align-items: center; min-height: 66px; }
.mood-ambience { display: flex; align-items: center; gap: 8px; min-height: 44px; max-width: 55%; padding: 0 8px 0 0; color: #f2dcd4; background: none; border: 0; box-shadow: none; font-family: var(--font-display, "Fraunces", serif); font-size: .9rem; }
.mood-ambience span { min-width: 0; overflow-wrap: anywhere; }
.mood-ambience svg:last-child { width: 16px; }
.mood-volume { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.08); color: #d7b4bd; }
.mood-volume input { width: 100%; min-width: 0; min-height: 44px; margin: 0; accent-color: #e8a4a4; cursor: pointer; }
.mood-volume input:disabled { opacity: .4; }
.mood .mood-foot { font-size: .62rem; margin: 2px 0 0; }
.mood .mood-panel { position: absolute; z-index: 10; visibility: hidden; background: rgba(42,26,34,.96); }
.mood .mood-panel.open { visibility: visible; }
@media (max-width: 899px) {
  .mood .mood-inner {
    min-height: 0;
    padding: calc(8px + env(safe-area-inset-top)) 16px calc(8px + env(safe-area-inset-bottom));
    gap: 4px;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .mood .mood-header { margin-bottom: 0; }
  .mood .mood-subtitle { margin-top: 2px; }
  .mood .ring {
    width: min(300px, 30vh, calc(100vw - 48px));
    width: min(300px, 30dvh, calc(100vw - 48px));
  }
  .mood .ring-in { padding: 0 28px; gap: 5px; }
  .mood .ring-in h2 { font-size: clamp(1.1rem, 3.4dvh, 1.6rem); }
  .mood .mood-time { font-size: clamp(2.8rem, 8dvh, 4.6rem); }
  .mood .mood-stages { gap: 4px; margin: 0; }
  .mood .mood-ctl { margin: 0; }
  .mood-inner .mc.play { width: 60px; height: 60px; }
  .mood .mood-voice { margin: 0; }
  .mood .mood-audio { display: contents; }
  .mood .spbar, .mood .mood-sound-card { flex-shrink: 0; max-width: 450px; padding: 7px; }
  .mood .mood-sound-card {
    min-height: 60px;
    background: rgba(42,26,34,.96);
  }
  .mood .mood-panel { inset: auto 8px 0; width: auto; max-height: calc(100dvh - env(safe-area-inset-top) - 20px); height: min(650px, 86dvh); padding-bottom: calc(16px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; transform: translateY(24px); }
  .mood .mood-panel.open { transform: none; }
}
@media (min-width: 900px) {
  .mood .mood-inner { padding-top: 28px; padding-bottom: 28px; }
  .mood .ring { width: 360px; }
  .mood .mood-time { font-size: 5.6rem; }
  .mood .ring-in h2 { font-size: 1.9rem; }
  .mood .mood-header { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-knob-orbit { transition: none; }
}

.mood #pinfo { min-width: 0; overflow-wrap: anywhere; }
.mood #pinfo[hidden], .mood #psetup[hidden], .mood #psound[hidden], .mood #pdemo[hidden] { display: none; }
.mood .practice-sound-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid rgba(232,164,164,.3);
  border-radius: 99px;
  background: rgba(42,26,34,.65);
  color: #e8a4a4;
  font: 400 .85rem var(--font-body, "Hanken Grotesk", sans-serif);
  box-shadow: none;
}
.mood .practice-setup, .mood .practice-demo-inline { width: 100%; min-width: 0; }

.mood .practice-setup { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.mood .practice-will { width: 100%; max-width: 580px; min-width: 0; padding: 10px; border-radius: 18px; }
.mood #pwill[hidden] { display: none; }
.practice-will-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mood .practice-will button { min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid #e8a4a4; border-radius: 99px; background: transparent; color: #f2dcd4; font: inherit; font-size: .85rem; }
.mood .practice-will [aria-pressed="true"] { background: #e8a4a4; color: #2a1a22; }
.practice-will p { margin: 10px 0 4px; font-size: .75rem; line-height: 1.5; color: #dfc8c6; }
.mood .practice-will .practice-will-later { border-color: transparent; text-decoration: underline; }
.practice-will:focus { outline: 2px solid #e8a4a4; outline-offset: 2px; }
.practice-will.nudge { animation: willingness-pulse 1s ease; }
@keyframes willingness-pulse { 50% { box-shadow: 0 0 0 4px rgba(232,164,164,.45); } }
@media (prefers-reduced-motion: reduce) { .practice-will.nudge { animation: none; outline: 2px solid #e8a4a4; } }

.practice-will h2 { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.4; }
.practice-will .practice-will-instruction { margin: 0 0 12px; font-size: .9rem; color: #f2dcd4; }
.practice-will .practice-will-ready { font-size: .9rem; color: #e8a4a4; }

/* The shell owns the viewport; only the details below the controls scroll. */
html:has(#app[data-view="practice"]), body:has(#app[data-view="practice"]) { height: 100%; overflow: hidden; }
#app[data-view="practice"] { min-height: 0; height: calc(100dvh - var(--header-height)); overflow: hidden; padding: 0; }
#app[data-view="practice"] .mood {
  top: var(--header-height);
  bottom: var(--nav-bottom);
  height: calc(100dvh - var(--header-height) - var(--nav-bottom));
  overflow: hidden;
}
.mood .mood-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
  gap: 8px;
  overflow: hidden;
}
.mood .practice-fixed {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 4px;
  color: #f6e6e9;
  background: rgba(26,16,21,.88);
  border-radius: 20px;
}
.mood .mood-header { height: auto; padding: 0; margin: 0; }
.mood .practice-media {
  --ring-size: clamp(180px, min(78vw, 42dvh), 340px);
  --media-height: min(var(--ring-size), max(180px, calc(100dvh - var(--header-height) - var(--nav-bottom) - 460px)));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: var(--media-height);
  flex: none;
}
.mood .practice-media .ring { flex: none; width: min(var(--ring-size), var(--media-height)); }
.mood .practice-media:has(#pdemo:not([hidden])) .ring { width: min(var(--ring-size), var(--media-height), calc(50% - 4px)); }
.mood .practice-media #pdemo { flex: none; width: min(300px, calc(50% - 4px), var(--media-height)); }
.mood #pdemo .demo-inline { margin: 0; padding: 0; background: none; }
.mood #pdemo h3 { margin: 0 0 2px; font-size: .85rem; line-height: 1.2; }
.mood #pdemo .demo-art { width: min(100%, calc(var(--media-height) - 44px)); max-width: 300px; }
.mood #pdemo .demo-caption, .mood #pdemo .demo-caption-list {
  margin: 2px 0 0;
  padding: 0;
  min-height: 0;
  height: 1.4em;
  font-size: 1rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  list-style: none;
}
/* Reduced motion keeps the static illustration and its caption text. */
.mood #pdemo .demo-caption-list li { display: inline; margin: 0; }
.mood #pdemo .demo-caption-list li + li::before { content: " · "; }
.mood #mg { max-width: 580px; font-size: 1.25rem; line-height: 1.3; color: #f6e6e9; }
.mood #session-left, .mood #mk { font-size: 1.1rem; line-height: 1.25; color: #f2dcd4; }
.mood .mood-stages { gap: 4px; margin: 0; }
.mood .mood-steps { min-height: 8px; }
.mood .mood-ctl { margin: 0; flex: none; }
.mood .mood-inner .mc.play { width: 60px; height: 60px; }
.mood .practice-scroll {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 6px 4px 12px;
  background: rgba(26,16,21,.88);
  border-radius: 18px;
}
.practice-scroll > * { flex-shrink: 0; max-width: 100%; }
.mood .practice-scroll #pinfo { width: 100%; max-width: 580px; }
.mood .practice-will h2 { font-size: 1.25rem; }
.mood .practice-will button { min-height: 48px; font-size: 1.05rem; }
.mood .practice-will p, .mood .practice-will .practice-will-instruction,
.mood .practice-will .practice-will-ready, .mood #pinfo, .mood #pinfo p,
.mood #pinfo summary, .mood #pinfo li { font-size: 1rem; color: #f6e6e9; }
.mood .mood-foot, .mood .practice-safety { font-size: .95rem; color: #f2dcd4; }
.mood .practice-safety { min-height: 44px; display: flex; align-items: center; }
.mood .mood-done { flex: 1 1 auto; min-height: 0; max-height: 100%; overflow-y: auto; }
@media (max-width: 600px) {
  .mood .mood-pick { font-size: 1.55rem; }
  .mood .practice-media:has(#pdemo:not([hidden])) .ring {
    width: clamp(150px, min(46vw, 34dvh), calc(50% - 4px));
  }
  .mood .practice-media #pdemo { width: min(46vw, 34dvh, calc(50% - 4px)); }
  .mood .practice-media:has(#pdemo:not([hidden])) .ring-in { padding: 0 18px; gap: 2px; }
  .mood .practice-media:has(#pdemo:not([hidden])) #mn { font-size: 1.1rem; }
  .mood .practice-media:has(#pdemo:not([hidden])) #mt { font-size: 2.5rem; }
  .mood .practice-media:has(#pdemo:not([hidden])) .breath { font-size: .65rem; line-height: 1.2; letter-spacing: 0; }
}
@media (min-width: 900px) {
  .mood .mood-inner { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .mood .mood-header { padding-top: 12px; }
  .mood .practice-media {
    --ring-size: clamp(180px, calc(100dvh - 500px), 340px);
    --media-height: var(--ring-size);
    /* Reserve both sides of the 1.085 breathing scale plus the warm glow.
       Padding keeps the demo centred on the ring, including on short desktops. */
    height: calc(var(--media-height) * 1.12 + 32px);
    padding-block: calc(var(--media-height) * .06 + 16px);
  }
  .mood .mood-time { font-size: 4.6rem; }
}
/* Short landscape uses the available width to preserve the complete ring,
   guide and controls, leaving the details their own remaining scrollport. */
@media (orientation: landscape) and (max-height: 600px) {
  .mood .mood-inner { padding-top: 2px; padding-bottom: 2px; gap: 4px; }
  .mood .practice-fixed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .4fr) minmax(160px, .6fr); gap: 2px 8px; padding: 0 4px; }
  .mood .mood-header { grid-column: 2 / 4; grid-row: 1; max-width: none; }
  .mood .mood-subtitle { display: none; }
  .mood #session-left { grid-column: 1; grid-row: 1; align-self: start; }
  .mood .practice-media { grid-column: 1; grid-row: 1 / 4; --ring-size: 160px; --media-height: 160px; height: 184px; padding-top: 24px; }
  .mood .practice-media:has(#pdemo:not([hidden])) .ring { width: 160px; }
  .mood .practice-media #pdemo { width: min(140px, calc(100% - 168px)); }
  .mood .practice-media .ring-in { padding: 0 18px; gap: 2px; }
  .mood .practice-media #mn { font-size: 1.1rem; }
  .mood .practice-media #mt { font-size: 2.25rem; }
  .mood .practice-media .breath { font-size: .6rem; line-height: 1.1; letter-spacing: 0; }
  .mood #mg { grid-column: 2 / 4; grid-row: 2; }
  .mood .mood-stages { grid-column: 2; grid-row: 3; }
  .mood .mood-ctl { grid-column: 3; grid-row: 3; gap: 12px; justify-content: center; }
  .mood .mood-inner .mc.play { width: 48px; height: 48px; }
}
