/* The Life Manual — the practice: the night band and the practice screen (see DIRECTION.md).
 * Night is the register: deep navy sky, a thin gold horizon, a few slow stars. Gold is kept for the sun, the arc
 * and the active control. Fraunces for names and numerals, Lora for the module's own lines, DM Sans for controls. */


.practice, .practice-screen {
  --pr-night-a: #05091A;
  --pr-night-b: #0B1730;
  --pr-night-c: #14263F;
  --pr-gold: #C4A05A;
  --pr-gold2: #E3CF9E;
  --pr-sun-a: #F3E3B6;
  --pr-sun-b: #D8B673;
  --pr-sun-c: #B98F45;
  --pr-fg: #EEEBE2;
  --pr-fg-strong: #F6F2E8;
  --pr-fg2: #AEB6C3;
  --pr-line: rgba(227, 207, 158, 0.18);
  --pr-line2: rgba(227, 207, 158, 0.34);
  --pr-display: "Fraunces", "Lora", Georgia, serif;
  --pr-serif: "Lora", "Iowan Old Style", Georgia, serif;
  --pr-ui: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --pr-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ================================================================== the band */

.practice.practice-v2 {
  --pr-pad: clamp(1.25rem, 5vw, 3.5rem);
  position: relative; isolation: isolate; overflow: hidden;
  margin: 3.5rem 0 0; padding: 0;
  border-radius: 10px;
  color: var(--pr-fg);
  background:
    radial-gradient(ellipse 70% 40% at 50% 47%, rgba(196, 160, 90, 0.10), transparent 70%),
    linear-gradient(180deg, var(--sky-a, var(--pr-night-a)) 0%, var(--sky-b, var(--pr-night-b)) 52%, var(--sky-c, var(--pr-night-c)) 100%);
  text-align: center;
}
:root[data-theme="night"] .practice.practice-v2 { box-shadow: inset 0 0 0 1px rgba(227, 207, 158, 0.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .practice.practice-v2 { box-shadow: inset 0 0 0 1px rgba(227, 207, 158, 0.12); } }

.practice-night {
  position: absolute; inset: 0 0 auto 0; height: 58%; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
}
.pr-stars { display: block; width: 100%; height: 100%; }
.pr-stars circle { opacity: var(--o); animation: pr-twinkle var(--d) ease-in-out var(--l) infinite alternate; }
@keyframes pr-twinkle { to { opacity: calc(var(--o) * 0.3); } }

.practice-v2 .practice-body { position: relative; padding: clamp(3.25rem, 7vw, 5rem) var(--pr-pad) clamp(2.5rem, 5vw, 3.5rem); text-align: center; }

.practice-v2 .practice-label {
  display: block;
  margin: 0 0 1.1rem;
  font: 450 0.8125rem/1.4 var(--pr-ui); font-variation-settings: "opsz" 14; letter-spacing: 0.02em;
  color: var(--pr-gold2);
}
.module .practice-v2 .practice-names, .practice-v2 .practice-names {
  margin: 0 auto; max-width: 16ch;
  font-family: var(--pr-display); font-weight: 300; font-style: normal;
  font-size: clamp(2.1rem, 1.35rem + 2.9vw, 3.3rem); line-height: 1.02; letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  color: var(--pr-fg-strong); text-wrap: balance;
}
.practice-v2 .practice-names .amp {
  display: block; margin: 0.28em 0 0.2em;
  font-style: italic; font-weight: 300; font-size: 0.5em; line-height: 1;
  color: var(--pr-gold2); letter-spacing: 0;
}
.practice-v2 .practice-q {
  display: block;
  margin: 1.4rem auto 0; max-width: 30rem;
  font: italic 400 clamp(1.02rem, 0.98rem + 0.25vw, 1.125rem)/1.6 var(--pr-serif);
  color: var(--pr-fg2); text-wrap: balance;
}

/* The sun resting on the water: the module's own sunrise svg, now the band's horizon. */
.practice-horizon { position: relative; margin: clamp(1.25rem, 3vw, 2rem) calc(-1 * var(--pr-pad)) 0; }
/* The svg's own halo is cut square by the slice; a soft css glow takes its place. */
.practice-horizon::before {
  content: ""; position: absolute; left: 50%; top: 65%; width: min(30rem, 90%); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(228, 201, 138, 0.26) 0%, rgba(196, 160, 90, 0.08) 32%, transparent 62%);
  pointer-events: none;
}
.practice-v2 .practice-sky { position: relative; display: block; width: 100%; height: clamp(6.5rem, 16vw, 9rem); }
.practice-v2 .practice-sky > circle:first-of-type { display: none; }

.practice-v2 .practice-after {
  display: block;
  margin: 0.25rem auto 0; max-width: 31rem;
  font: 400 1rem/1.7 var(--pr-serif); color: var(--pr-fg); text-wrap: pretty;
}
.practice-v2 strong { font-weight: 500; color: inherit; }
.practice-v2 .practice-note {
  margin: 2.25rem auto 0; max-width: 30rem;
  font: 400 0.8125rem/1.6 var(--pr-ui); font-variation-settings: "opsz" 14; color: var(--pr-fg2);
}

/* ---- the day's meditation recording (build.py adds it when media/audio/ has the day; practice.js draws the player).
 * The sun above the water becomes the play button and the horizon the timeline: gold where the recording has played,
 * a small sun where it is now. Without the script the browser's own controls show. */
.practice-audio { display: block; width: 100%; max-width: 28rem; margin: 2rem auto 0; color-scheme: dark; }
.practice-audio:not([controls]) { display: none; }

.pr-player { width: 100%; max-width: 26rem; margin: clamp(2rem, 4vw, 2.5rem) auto 0; }
.practice-v2 .pr-player + .practice-note { margin-top: 1.25rem; }
.pr-player-row { display: flex; align-items: center; justify-content: center; gap: clamp(1.5rem, 6vw, 2.25rem); }

.pr-sun {
  position: relative; display: grid; place-items: center;
  width: 4.5rem; height: 4.5rem; margin: 0; padding: 0; border: 0; border-radius: 50%;
  color: var(--pr-night-c);
  background: radial-gradient(circle at 38% 32%, var(--pr-sun-a) 0%, var(--pr-sun-b) 55%, var(--pr-sun-c) 100%);
  box-shadow: 0 0 0 1px rgba(243, 227, 182, 0.3), 0 0 30px 2px rgba(228, 201, 138, 0.2);
  cursor: pointer; transition: transform 220ms var(--pr-ease), opacity 300ms ease;
}
.pr-sun::after {
  content: ""; position: absolute; inset: -1.1rem; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(228, 201, 138, 0.3) 0%, rgba(228, 201, 138, 0.08) 45%, transparent 70%);
  opacity: 0; transition: opacity 700ms var(--pr-ease);
}
.pr-sun:hover { transform: scale(1.04); }
.pr-sun:active { transform: scale(0.97); }
.pr-sun svg { position: relative; width: 1.65rem; height: 1.65rem; fill: currentColor; }
.pr-sun .pr-i-pause, .pr-player.is-playing .pr-sun .pr-i-play { display: none; }
.pr-player.is-playing .pr-sun .pr-i-pause { display: block; }
/* While the recording plays, the sun's halo breathes, slower than a breath so it never sets a pace. */
.pr-player.is-playing .pr-sun::after { opacity: 1; animation: pr-sun-halo 7s ease-in-out infinite alternate; }
@keyframes pr-sun-halo { from { transform: scale(0.9); opacity: 0.5; } to { transform: scale(1.12); opacity: 1; } }
.pr-player.is-loading .pr-sun { opacity: 0.75; }

.pr-skip {
  display: grid; place-items: center; width: 3rem; height: 3rem; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--pr-fg2);
  cursor: pointer; transition: color 160ms ease;
}
.pr-skip:hover { color: var(--pr-gold2); }
.pr-skip svg { width: 2.4rem; height: 2.4rem; overflow: visible; }
.pr-skip text { font: 500 9px var(--pr-ui); fill: currentColor; }

/* The horizon: a range input drawn as the band's hairline. */
.pr-horizon {
  --p: 0%;
  display: block; width: 100%; height: 2.75rem; margin: 1.1rem 0 0; padding: 0;
  background: transparent; border: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.pr-horizon::-webkit-slider-runnable-track {
  height: 1px; border: 0;
  background: linear-gradient(90deg, var(--pr-gold2) 0 var(--p), var(--pr-line2) var(--p) 100%);
}
.pr-horizon::-moz-range-track { height: 1px; border: 0; background: var(--pr-line2); }
.pr-horizon::-moz-range-progress { height: 1px; background: var(--pr-gold2); }
.pr-horizon::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; margin-top: -6px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--pr-sun-a), var(--pr-sun-b) 60%, var(--pr-sun-c));
  box-shadow: 0 0 0 5px rgba(228, 201, 138, 0.1), 0 0 16px 3px rgba(228, 201, 138, 0.35);
}
.pr-horizon::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--pr-sun-a), var(--pr-sun-b) 60%, var(--pr-sun-c));
  box-shadow: 0 0 0 5px rgba(228, 201, 138, 0.1), 0 0 16px 3px rgba(228, 201, 138, 0.35);
}
.practice-v2 .pr-horizon:focus-visible, .pr-horizon:focus-visible { outline: none; }
.pr-horizon:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--pr-night-b), 0 0 0 5px var(--pr-gold2), 0 0 16px 3px rgba(228, 201, 138, 0.35); }
.pr-horizon:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--pr-night-b), 0 0 0 5px var(--pr-gold2), 0 0 16px 3px rgba(228, 201, 138, 0.35); }

.pr-times {
  display: flex; justify-content: space-between; margin-top: -0.45rem;
  font: 300 0.95rem/1 var(--pr-display); font-variation-settings: "opsz" 36, "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums; color: var(--pr-fg2);
}
.pr-now { color: var(--pr-fg-strong); }
.pr-player-msg { margin: 0.9rem 0 0; font: 450 0.875rem/1.5 var(--pr-ui); color: var(--pr-gold2); }
.pr-player-msg:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pr-player.is-playing .pr-sun::after { animation: none; }
  .pr-sun:hover, .pr-sun:active { transform: none; }
}

/* ---- the timer inside the band */
.practice-v2 .timer {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; margin: 2.25rem auto 0; max-width: 28rem; padding: 0; border: 0; background: none; color: inherit;
}
.practice-v2 .timer:focus { outline: none; }
.practice-v2 .timer-segs { order: 1; }
.practice-v2 .timer-face { order: 2; }
.practice-v2 .timer-start { order: 3; }
.practice-v2 .timer-controls { order: 4; }
.practice-v2 .timer-msg { order: 5; }
.practice-v2 .timer-bell { order: 6; }

.practice-v2 .timer-segs { display: block; list-style: none; width: 100%; margin: 0; padding: 0; font: inherit; }
.practice-v2 .timer-segs li {
  display: flex; align-items: baseline; justify-content: flex-start; gap: 0.6rem;
  margin: 0; padding: 0.55rem 0; border: 0; color: var(--pr-fg); text-align: left; list-style: none;
  transition: opacity 500ms var(--pr-ease), color 500ms var(--pr-ease);
}
.practice-v2 .timer-segs li::marker { content: none; }
.practice-v2 .timer-segs li::before { content: none; }
.practice-v2 .timer-seg-label {
  position: relative; box-shadow: none !important;
  font: 400 1.125rem/1.35 var(--pr-display); font-variation-settings: "opsz" 36, "SOFT" 100;
}
.practice-v2 .timer-lead { flex: 1 1 1rem; min-width: 1rem; border-bottom: 1px dotted var(--pr-line2); transform: translateY(-0.3em); }
.practice-v2 .timer-min { display: inline-flex; align-items: baseline; gap: 0.35rem; white-space: nowrap; }
.practice-v2 .timer-min-u { font: 400 0.8125rem/1 var(--pr-ui); color: var(--pr-fg2); }
.practice-v2 .timer-min:has(input:placeholder-shown) .timer-min-u { visibility: hidden; }
.practice-v2 .timer-segs input[type="number"] {
  width: 3.4ch; min-width: 0; height: auto; min-height: 2.75rem; margin: 0; padding: 0.1rem 0.1rem 0.15rem;
  font: 400 1.25rem/1.2 var(--pr-display); font-variant-numeric: lining-nums tabular-nums;
  color: var(--pr-fg-strong); text-align: right;
  background: transparent; border: 0; border-bottom: 1px solid var(--pr-line2); border-radius: 0; box-shadow: none;
  -moz-appearance: textfield; appearance: textfield;
  transition: border-color 160ms ease;
}
.practice-v2 .timer-segs input::-webkit-outer-spin-button,
.practice-v2 .timer-segs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.practice-v2 .timer-segs input::placeholder { font: 400 0.8125rem/1 var(--pr-ui); color: var(--pr-fg2); opacity: 0.85; text-align: center; }
.practice-v2 .timer-segs input:hover { border-bottom-color: rgba(227, 207, 158, 0.6); }
.practice-v2 .timer-segs input:focus-visible { outline: none; border-bottom-color: var(--pr-gold); box-shadow: 0 1px 0 var(--pr-gold); }
.practice-v2 .timer-segs input[aria-invalid="true"] { border-bottom-color: var(--pr-gold); box-shadow: 0 1px 0 var(--pr-gold); }
.practice-v2 .timer-segs input:disabled { opacity: 1; color: var(--pr-fg2); border-bottom-color: transparent; background: transparent; }
.practice-v2 .timer-segs li.current { color: var(--pr-fg-strong); }
.practice-v2 .timer-segs li.current .timer-seg-label::before {
  content: ""; position: absolute; left: -1rem; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--pr-gold);
}
.practice-v2 .timer-segs li.past { opacity: 0.45; }

.practice-v2 .timer-start { margin-top: 1.9rem; }
.practice-v2 .pr-open, .practice-v2 .practice-body > [data-action="practice-open"] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem;
  margin: 0; padding: 0.8rem 1.75rem;
  font: 500 1rem/1.2 var(--pr-ui); font-variation-settings: "opsz" 14; letter-spacing: 0.005em;
  color: var(--pr-night-c); background: var(--pr-gold); border: 1px solid var(--pr-gold); border-radius: 6px;
  cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease;
}
.practice-v2 .pr-open:hover { background: #D0AF6E; border-color: #D0AF6E; }
.practice-v2 .pr-open:active { transform: translateY(1px); }
.practice-v2 .pr-open[hidden] { display: none; }

.practice-v2 .timer-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 0.9rem; }
.practice-v2 .timer-controls .pr-btn {
  min-height: 2.5rem; min-width: 0; margin: 0; padding: 0.45rem 1rem;
  font: 450 0.875rem/1.2 var(--pr-ui); font-variation-settings: "opsz" 14;
  color: var(--pr-fg); background: transparent; border: 1px solid var(--pr-line2); border-radius: 6px;
  cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.practice-v2 .timer-controls .pr-btn:hover { border-color: rgba(227, 207, 158, 0.6); background: rgba(196, 160, 90, 0.08); }
.practice-v2 .timer-controls .pr-btn[aria-pressed="true"] { border-color: var(--pr-gold); color: var(--pr-gold2); }
.practice-v2 .timer-controls .pr-btn.pr-quiet { border-color: transparent; color: var(--pr-fg2); }
.practice-v2 .timer-controls .pr-btn.pr-quiet:hover { color: var(--pr-fg); background: transparent; }
.practice-v2 .timer-controls .pr-btn[hidden] { display: none; }
/* "Or time it here on the page" reads as a quiet link under the gold button. */
.practice-v2 .timer-controls .pr-btn[data-action="timer-start"] {
  min-height: 2.75rem; padding: 0.35rem 0.5rem; border-color: transparent; background: transparent; color: var(--pr-fg2);
  text-decoration: underline; text-decoration-color: var(--pr-line2); text-decoration-thickness: 1px; text-underline-offset: 0.3em;
}
.practice-v2 .timer-controls .pr-btn[data-action="timer-start"]:hover { color: var(--pr-fg); text-decoration-color: var(--pr-gold2); }
.practice-v2 .timer-controls .pr-btn[data-action="timer-start"][hidden] { display: none; }

.practice-v2 .timer-face {
  position: relative; display: grid; grid-template-columns: 7.5rem auto; align-items: center; column-gap: 1.4rem;
  width: auto; height: auto; margin: 2rem 0 0.25rem; color: var(--pr-fg);
}
.practice-v2 .timer-face[hidden] { display: none; }
.practice-v2 .timer-ring, .practice-v2 .timer-readout { grid-area: 1 / 1; }
.practice-v2 .timer-ring { position: static; inset: auto; width: 7.5rem; height: 7.5rem; transform: none; overflow: visible; }
.practice-v2 .timer-ring circle { fill: none; stroke-width: 1.4; }
.practice-v2 .timer-ring .timer-ring-track { stroke: var(--pr-line); stroke-opacity: 1; }
.practice-v2 .timer-ring .timer-ring-bar { stroke: var(--pr-gold); stroke-linecap: round; transition: stroke-dashoffset 300ms linear; }
.practice-v2 .timer-readout { position: relative; display: grid; place-items: center; width: 7.5rem; height: 7.5rem; }
.practice-v2 .timer-face p { margin: 0; }
.practice-v2 .timer-clock {
  font: 300 1.75rem/1 var(--pr-display); font-variation-settings: "opsz" 144, "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; color: var(--pr-fg-strong);
}
.practice-v2 .timer-facetext { grid-area: 1 / 2; text-align: left; }
.practice-v2 .timer-seg-name {
  max-width: 12rem; text-align: left;
  font: 400 1.25rem/1.25 var(--pr-display); font-variation-settings: "opsz" 36, "SOFT" 100; color: var(--pr-fg-strong);
}
.practice-v2 .timer-step { margin-top: 0.35rem !important; font: 400 0.8125rem/1.4 var(--pr-ui); color: var(--pr-fg2); }
.practice-v2 .timer-step:empty { display: none; }

.practice-v2 .timer-msg { min-height: 1.4em; margin: 0.9rem 0 0; font: 450 0.875rem/1.5 var(--pr-ui); color: var(--pr-gold2); text-align: center; }
.practice-v2 .timer-msg:empty { display: block; }
.practice-v2 .timer-bell {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-top: 0.4rem;
  font: 400 0.8125rem/1.4 var(--pr-ui); color: var(--pr-fg2); cursor: pointer;
}
.practice-v2 .timer-bell input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--pr-gold); }

.practice-v2 :focus-visible { outline: 2px solid var(--pr-gold2); outline-offset: 3px; }
.practice-v2 .timer-segs input:focus-visible { outline: none; }

/* ================================================================== the practice screen */

html.pr-lock { overflow: hidden; }

dialog.practice-screen {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  color: var(--pr-fg);
  background: linear-gradient(180deg, var(--pr-night-a) 0%, var(--pr-night-b) 58%, var(--pr-night-c) 100%);
  --breath: 0.5;
}
dialog.practice-screen::backdrop { background: #05091A; }
dialog.practice-screen[open] { display: block; animation: ps-in 900ms var(--pr-ease) both; }
@keyframes ps-in { from { opacity: 0; } }

.ps-sky { position: absolute; inset: 0 0 auto 0; height: 66%; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%); mask-image: linear-gradient(180deg, #000 40%, transparent 100%); }
.ps-sky .pr-stars { width: 100%; height: 100%; }

.ps-inner {
  position: relative; box-sizing: border-box; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: max(env(safe-area-inset-top), clamp(1rem, 3vh, 1.75rem)) clamp(1rem, 4vw, 3rem) max(env(safe-area-inset-bottom), clamp(1.1rem, 3.5vh, 2.25rem));
}

.ps-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; width: 100%; }
.ps-segs { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; margin: 0; padding: 0; list-style: none;
  font: 400 0.8125rem/1.4 var(--pr-ui); font-variation-settings: "opsz" 14; color: var(--pr-fg2); }
.ps-segs li { display: inline-flex; align-items: center; gap: 0.55rem; transition: color 600ms var(--pr-ease), opacity 600ms var(--pr-ease); }
.ps-segs li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--pr-line2); flex: none; }
.ps-segs li.current { color: var(--pr-fg); }
.ps-segs li.current::before { background: var(--pr-gold); box-shadow: none; }
.ps-segs li.past { opacity: 0.55; }
.ps-segs li.past::before { background: var(--pr-fg2); box-shadow: none; }
.ps-hint { margin: 0; font: 400 0.75rem/1.4 var(--pr-ui); color: var(--pr-fg2); opacity: 0.7; white-space: nowrap; }
@media (hover: none), (max-width: 640px) { .ps-hint { display: none; } }

/* ---- the breath sun */
.ps-stage { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; display: grid; place-items: end center; padding-bottom: clamp(0.75rem, 2.5vh, 1.75rem); }
.ps-sunwrap {
  --S: min(22rem, 38vh, max(40vmin, 70vw));
  position: relative; width: var(--S); height: var(--S);
  animation: ps-rise 1600ms var(--pr-ease) both;
}
@keyframes ps-rise { from { opacity: 0; transform: translateY(2.5rem); } }
.ps-halo, .ps-sun { position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none; }
.ps-halo {
  width: 190%; aspect-ratio: 1; margin: -95% 0 0 -95%;
  background: radial-gradient(circle, rgba(228, 201, 138, 0.30) 0%, rgba(196, 160, 90, 0.11) 30%, rgba(196, 160, 90, 0.03) 50%, transparent 66%);
  transform: scale(calc(0.8 + 0.3 * var(--breath)));
  opacity: calc(0.55 + 0.45 * var(--breath));
  animation: ps-glow 10s ease-in-out infinite alternate;
}
@keyframes ps-glow { from { opacity: 0.6; transform: scale(0.94); } to { opacity: 0.95; transform: scale(1.02); } }
.ps-sun {
  width: 52%; aspect-ratio: 1; margin: -26% 0 0 -26%;
  background: radial-gradient(circle at 50% 40%, var(--pr-sun-a) 0%, #EAD39C 34%, var(--pr-sun-b) 64%, var(--pr-sun-c) 100%);
  box-shadow: 0 0 2.5rem 0.5rem rgba(228, 201, 138, 0.16), 0 0 7rem 1.5rem rgba(196, 160, 90, 0.10);
  transform: scale(calc(0.84 + 0.16 * var(--breath)));
  transition: transform 1200ms var(--pr-ease), filter 900ms var(--pr-ease);
}
.practice-screen.is-pacing .ps-halo { animation: none; }
.practice-screen.is-pacing .ps-sun { transition: filter 900ms var(--pr-ease); }
.practice-screen[data-state="paused"] .ps-sun { filter: saturate(0.75) brightness(0.86); }
.practice-screen[data-state="paused"] .ps-halo { animation-play-state: paused; }

.ps-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ps-arc circle { fill: none; }
.ps-arc-track { stroke: var(--pr-line); stroke-width: 0.6; }
.ps-arc-bar { stroke: var(--pr-gold); stroke-width: 1; stroke-linecap: round; transition: stroke-dashoffset 400ms linear; }

.ps-cue { position: absolute; left: 0; right: 0; bottom: 0.1rem; margin: 0; min-height: 1.5em; text-align: center;
  font: italic 300 1.25rem/1.2 var(--pr-display); color: var(--pr-gold2); display: none; }
.practice-screen.is-still.is-pacing .ps-cue { display: block; }

/* ---- the horizon and the sun's reflection */
.ps-water { position: relative; flex: none; width: 100vw; height: 3.1rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding-top: 0.55rem; box-sizing: border-box; }
.ps-water::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 160, 90, 0.55) 22%, rgba(214, 184, 118, 0.85) 50%, rgba(196, 160, 90, 0.55) 78%, transparent);
}
.ps-water i { display: block; height: 1.5px; border-radius: 1px; background: linear-gradient(90deg, transparent, var(--pr-gold), transparent);
  opacity: calc(var(--w-o) * (0.7 + 0.3 * var(--breath))); transition: opacity 600ms linear; }
.ps-water i:nth-child(1) { width: 9rem; --w-o: 0.85; }
.ps-water i:nth-child(2) { width: 6.8rem; --w-o: 0.6; }
.ps-water i:nth-child(3) { width: 4.6rem; --w-o: 0.4; }
.ps-water i:nth-child(4) { width: 2.6rem; --w-o: 0.25; }

/* ---- the readout */
.ps-read { flex: none; text-align: center; margin-top: clamp(0.75rem, 2.5vh, 1.75rem); }
.ps-read[hidden], .ps-end[hidden], .ps-main[hidden] { display: none; }
.ps-name {
  margin: 0; font-family: var(--pr-display); font-weight: 350; font-style: normal;
  font-size: clamp(1.35rem, 1rem + 1.3vw, 2rem); line-height: 1.15;
  font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 0; color: var(--pr-fg); text-wrap: balance;
}
.ps-clock {
  margin: 0.35rem 0 0; font-family: var(--pr-display); font-weight: 200;
  font-size: clamp(3.75rem, 2.2rem + 6vw, 6.75rem); line-height: 1; letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  font-variant-numeric: lining-nums tabular-nums; color: var(--pr-fg-strong);
}
.ps-next { min-height: 1.4em; margin: 0.6rem 0 0; font: 400 0.875rem/1.4 var(--pr-ui); font-variation-settings: "opsz" 14; color: var(--pr-fg2); }
.practice-screen.is-turning .ps-name { animation: ps-fade 1100ms var(--pr-ease) both; }
@keyframes ps-fade { from { opacity: 0; transform: translateY(0.4rem); } }

/* ---- the end */
.ps-end { flex: none; max-width: 34rem; margin-top: clamp(1rem, 3vh, 2rem); text-align: center; }
.ps-end-title {
  margin: 0; font-family: var(--pr-display); font-weight: 300; font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.2rem); line-height: 1.05;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0; letter-spacing: -0.015em; color: var(--pr-fg-strong);
  animation: ps-fade 1200ms var(--pr-ease) both;
}
.practice-screen .ps-end-title:focus, .practice-screen .ps-end-title:focus-visible { outline: none; }
.ps-end-after { margin: 0.9rem auto 0; font: italic 400 1.0625rem/1.65 var(--pr-serif); color: var(--pr-fg2); text-wrap: pretty; }
.ps-end-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.5rem; margin: 1.6rem 0 0; }
.ps-notes {
  font: 500 1rem/1.3 var(--pr-ui); color: var(--pr-gold2);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: rgba(227, 207, 158, 0.45);
}
.ps-notes:hover { text-decoration-color: var(--pr-gold2); }
.practice-screen[data-state="done"] .ps-controls, .practice-screen[data-state="done"] .ps-hint { display: none; }
.practice-screen[data-state="done"] .ps-end { margin-bottom: clamp(1.5rem, 6vh, 4rem); }
.practice-screen[data-state="done"] .ps-sun { transform: scale(0.9); }

/* ---- controls */
.ps-controls { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1rem; width: min(100%, 56rem); margin-top: clamp(1rem, 3.5vh, 2.25rem); }
.ps-main { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.ps-btn {
  min-height: 2.75rem; margin: 0; padding: 0.6rem 1.2rem;
  font: 500 0.9375rem/1.2 var(--pr-ui); font-variation-settings: "opsz" 14;
  color: var(--pr-fg); background: rgba(11, 23, 48, 0.55); border: 1px solid var(--pr-line2); border-radius: 6px;
  cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.ps-btn:hover { border-color: rgba(227, 207, 158, 0.6); background: rgba(196, 160, 90, 0.08); }
.ps-pause { min-width: 8rem; }
.ps-pause[aria-pressed="true"] { border-color: var(--pr-gold); color: var(--pr-gold2); background: rgba(196, 160, 90, 0.12); }
.ps-btn-gold { color: var(--pr-night-c); background: var(--pr-gold); border-color: var(--pr-gold); }
.ps-btn-gold:hover { background: #D0AF6E; border-color: #D0AF6E; }

.ps-aids { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem 2rem;
  font: 400 0.8125rem/1.3 var(--pr-ui); font-variation-settings: "opsz" 14; color: var(--pr-fg2); }
.ps-pacer { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.9rem; }
.ps-switch {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.25rem; margin: 0; padding: 0.2rem 0.1rem;
  font: inherit; color: var(--pr-fg2); background: none; border: 0; cursor: pointer; transition: color 160ms ease;
}
.ps-switch:hover { color: var(--pr-fg); }
.ps-switch i { position: relative; width: 1.9rem; height: 1.1rem; border-radius: 0.55rem; box-shadow: inset 0 0 0 1px var(--pr-line2); flex: none;
  transition: background-color 200ms var(--pr-ease), box-shadow 200ms var(--pr-ease); }
.ps-switch i::after { content: ""; position: absolute; left: 0.2rem; top: 0.2rem; width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: var(--pr-fg2); transition: transform 240ms var(--pr-ease), background-color 200ms var(--pr-ease); }
.ps-switch[aria-checked="true"] { color: var(--pr-fg); }
.ps-switch[aria-checked="true"] i { background: rgba(196, 160, 90, 0.2); box-shadow: inset 0 0 0 1px var(--pr-gold); }
.ps-switch[aria-checked="true"] i::after { background: var(--pr-gold); transform: translateX(0.8rem); }
.ps-aid { font-style: italic; opacity: 0.8; }
.ps-steps { display: none; align-items: center; gap: 1rem; }
.practice-screen.is-pacing .ps-steps { display: inline-flex; }
.ps-step { display: inline-flex; align-items: center; gap: 0.35rem; }
.ps-step-k { margin-right: 0.15rem; }
.ps-mini {
  width: 1.9rem; height: 1.9rem; margin: 0; padding: 0; display: inline-grid; place-items: center;
  font: 400 1rem/1 var(--pr-ui); color: var(--pr-fg); background: transparent; border: 1px solid var(--pr-line2); border-radius: 6px; cursor: pointer;
}
.ps-mini:hover { border-color: rgba(227, 207, 158, 0.6); }
.ps-mini:disabled { opacity: 0.35; cursor: default; }
.ps-step-v { min-width: 2.6ch; text-align: center; font: 400 1rem/1 var(--pr-display); font-variant-numeric: lining-nums tabular-nums; color: var(--pr-fg); }

/* ---- the confirm, in place of the controls */
.ps-confirm {
  position: absolute; left: 50%; bottom: max(env(safe-area-inset-bottom), clamp(1.1rem, 3.5vh, 2.25rem)); transform: translateX(-50%);
  width: min(calc(100% - 2rem), 26rem); box-sizing: border-box; padding: 1.25rem 1.5rem 1.35rem; text-align: center;
  background: var(--pr-night-b); border: 1px solid var(--pr-line2); border-radius: 10px;
  animation: ps-fade 500ms var(--pr-ease) both;
}
.ps-confirm[hidden] { display: none; }
.ps-confirm-t { margin: 0; font: 350 1.5rem/1.2 var(--pr-display); font-variation-settings: "opsz" 72, "SOFT" 100; color: var(--pr-fg-strong); }
.ps-confirm-b { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 1rem 0 0; }
.practice-screen.is-confirming .ps-controls { visibility: hidden; }

.ps-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.practice-screen :focus-visible { outline: 2px solid var(--pr-gold2); outline-offset: 3px; }

@media (max-width: 420px) {
  .practice-v2 .timer-face { grid-template-columns: 6.5rem auto; column-gap: 1rem; }
  .practice-v2 .timer-ring, .practice-v2 .timer-readout { width: 6.5rem; height: 6.5rem; }
}
@media (max-width: 560px) {
  .ps-long { display: none; }
  .ps-btn { padding: 0.6rem 1rem; }
  .ps-aids { gap: 0.5rem 1.25rem; }
  .ps-water i:nth-child(1) { width: 6.5rem; }
  .ps-water i:nth-child(2) { width: 4.8rem; }
  .ps-water i:nth-child(3) { width: 3.2rem; }
  .ps-water i:nth-child(4) { width: 1.8rem; }
  .ps-water { height: 2.5rem; gap: 0.4rem; }
}
@media (max-height: 560px) {
  .ps-top { display: none; }
  .ps-clock { font-size: clamp(2.75rem, 10vh, 4rem); }
}

/* ---- reduced motion: no swelling, no twinkle, no entrances; the pacer becomes a text cue */
@media (prefers-reduced-motion: reduce) {
  .pr-stars circle { animation: none; }
  dialog.practice-screen[open], .ps-sunwrap, .ps-name, .ps-end-title, .ps-confirm { animation: none !important; }
  .ps-halo { animation: none; transform: none; opacity: 0.8; }
  .ps-sun { transform: none; transition: none; }
  .ps-water i { opacity: var(--w-o); transition: none; }
  .ps-arc-bar, .practice-v2 .timer-ring .timer-ring-bar { transition: none; }
}

/* Version 4, Days 12–13: the Kapal Bhati caution inside the meditation card (print: a hairline-topped note). */
.practice-v2 .caution {
  margin: 1.75rem auto 0; max-width: 31rem; padding-top: 0.9rem;
  border-top: 1px solid var(--pr-line2);
  font: 400 0.875rem/1.6 var(--pr-ui); font-variation-settings: "opsz" 14; color: var(--pr-fg2); text-align: left;
}
.practice-v2 .caution b { font-weight: 600; color: var(--pr-gold2); }

@media print {
  .practice-v2 .practice-night, .practice-v2 .timer, .practice-v2 .pr-open { display: none !important; }
  .practice-screen { display: none !important; }
}
