﻿@font-face {
  font-family: "Moderat";
  src: url("fonts/Moderat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Moderat";
  src: url("fonts/Moderat-Medium.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #f5f3ed;
  --muted: #a9b2ad;
  --subtle: #77817c;
  --stage: #101816;
  --stage-deep: #0a100f;
  --panel: rgba(27, 39, 36, 0.82);
  --panel-solid: #1b2724;
  --line: rgba(235, 242, 238, 0.13);
  --line-strong: rgba(235, 242, 238, 0.26);
  --inhale: #9fded3;
  --inhale-light: #d8f4ee;
  --inhale-deep: #4d9e91;
  --exhale: #b9b5e8;
  --exhale-light: #e5e1f7;
  --exhale-deep: #7771b8;
  --sand: #e9d6b4;
  --rose: #e9bfc5;
  --sky: #b8d7e5;
  --danger: #f4b8b2;
  --ring: rgba(255, 255, 255, 0.92);
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.27);
  --ease-breath: cubic-bezier(0.42, 0, 0.2, 1);
  font-family: "Moderat", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--stage-deep);
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% -8%, rgba(84, 139, 126, 0.18), transparent 34rem),
    radial-gradient(circle at 92% 24%, rgba(116, 105, 166, 0.12), transparent 30rem),
    linear-gradient(160deg, #111b18 0%, #0d1513 46%, #111714 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  color: #101816;
  background: var(--ink);
  border-radius: 12px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.09;
  pointer-events: none;
}

.ambient-one {
  top: 20%;
  left: -14rem;
  background: var(--inhale);
}

.ambient-two {
  right: -16rem;
  bottom: 2%;
  background: var(--exhale);
}

.app-shell {
  width: min(100%, 1160px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px 108px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--ink);
  background: none;
  border: 0;
  letter-spacing: 0.18em;
  font-weight: 600;
  font-size: 0.84rem;
}

.wordmark-mark {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.wordmark-mark span {
  width: 11px;
  height: 11px;
  background: radial-gradient(circle at 35% 28%, var(--inhale-light), var(--inhale-deep));
  border-radius: 50%;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offline-pill {
  padding: 6px 9px;
  color: var(--sand);
  border: 1px solid rgba(233, 214, 180, 0.35);
  border-radius: 99px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button,
.back-button,
.stage-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.icon-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.view {
  display: none;
  animation: view-in 380ms ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.home-intro {
  max-width: 690px;
  margin: 48px 0 38px;
}

.eyebrow,
.micro-label,
.card-kicker {
  margin: 0 0 10px;
  color: var(--inhale);
  font-size: 0.7rem;
  line-height: 1.2;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.65rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 400;
}

h1 em {
  color: var(--inhale);
  font-style: normal;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 400;
}

.lede,
.page-heading > p:last-child {
  max-width: 590px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.foundation-card {
  position: relative;
  display: flex;
  overflow: hidden;
  width: 100%;
  min-height: 230px;
  padding: 34px;
  align-items: flex-end;
  justify-content: space-between;
  text-align: left;
  background:
    linear-gradient(120deg, rgba(84, 151, 136, 0.24), rgba(35, 48, 44, 0.92) 62%),
    var(--panel-solid);
  border: 1px solid rgba(159, 222, 211, 0.22);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.foundation-card::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 87% 40%, rgba(159, 222, 211, 0.12), transparent 28%);
  content: "";
  pointer-events: none;
}

.foundation-copy {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 460px;
  flex-direction: column;
}

.foundation-copy strong {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 400;
}

.foundation-copy > span:last-child {
  color: #c3ccc7;
  line-height: 1.5;
}

.mini-orbit,
.explain-orbit,
.score-orbit {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
}

.mini-orbit {
  z-index: 1;
  width: 122px;
  height: 122px;
  margin: 0 16px 8px 32px;
}

.mini-orbit span,
.explain-orbit span {
  display: block;
  width: 74%;
  height: 74%;
  background: radial-gradient(circle at 33% 28%, var(--inhale-light) 0%, var(--inhale) 39%, var(--inhale-deep) 100%);
  border-radius: 50%;
  box-shadow: 0 0 48px rgba(159, 222, 211, 0.28);
}

.baseline-row {
  display: flex;
  padding: 28px 4px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.baseline-row > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 4px 12px;
}

.baseline-row .micro-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--subtle);
}

.baseline-row strong {
  font-size: 1.35rem;
  font-weight: 400;
}

.baseline-row div > span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
}

.text-button {
  padding: 8px 0;
  color: var(--inhale);
  background: none;
  border: 0;
  white-space: nowrap;
}

.text-button.compact {
  font-size: 0.85rem;
}

.purpose-section,
.snapshot {
  margin-top: 82px;
}

.section-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.purpose-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.purpose-card {
  display: flex;
  min-height: 230px;
  padding: 22px;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 180ms ease, transform 180ms ease;
}

.purpose-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.purpose-icon,
.setup-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: auto;
  place-items: center;
  color: #101816;
  background: var(--inhale);
  border-radius: 50%;
  font-size: 1.2rem;
}

.purpose-card strong {
  margin: 28px 0 7px;
  font-size: 1.05rem;
  font-weight: 400;
}

.purpose-card > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.purpose-voice .purpose-icon { background: var(--sand); }
.purpose-airway .purpose-icon { background: var(--sky); }
.purpose-rest .purpose-icon { background: var(--exhale); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  display: flex;
  min-height: 140px;
  padding: 24px;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.stat-card strong {
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  font-weight: 400;
}

.stat-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.narrow-view {
  width: min(100%, 680px);
  margin: 30px auto 0;
}

.narrow-view .back-button {
  margin-bottom: 48px;
}

.narrow-view h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
}

.explain-orbit {
  width: 160px;
  height: 160px;
  margin: 44px auto;
}

.explain-orbit span {
  width: 62%;
  height: 62%;
}

.instruction-list {
  display: grid;
  gap: 0;
  margin: 38px 0;
}

.instruction-list > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 17px 0;
  align-items: start;
  border-top: 1px solid var(--line);
}

.instruction-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.instruction-list span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--stage);
  background: var(--inhale);
  border-radius: 50%;
  font-size: 0.75rem;
}

.instruction-list p,
.plain-notice p,
.safety-notice p {
  margin: 2px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.plain-notice,
.safety-notice {
  margin: 24px 0;
  padding: 20px;
  background: rgba(159, 222, 211, 0.06);
  border: 1px solid rgba(159, 222, 211, 0.18);
  border-radius: 18px;
}

.plain-notice strong,
.safety-notice strong {
  font-weight: 400;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 22px;
  border-radius: 99px;
  font-weight: 600;
}

.primary-button {
  margin-top: 14px;
  color: #0d1513;
  background: var(--inhale);
  border: 1px solid var(--inhale);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  margin-top: 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.score-orbit {
  width: 230px;
  height: 230px;
  margin: 22px auto 48px;
  background: radial-gradient(circle, rgba(159, 222, 211, 0.12), transparent 68%);
  box-shadow: inset 0 0 60px rgba(159, 222, 211, 0.06);
}

.score-orbit span {
  font-size: 3.5rem;
  letter-spacing: -0.05em;
}

.score-orbit small {
  color: var(--muted);
}

.result-copy,
.setup-purpose,
.setup-instruction {
  color: var(--muted);
  line-height: 1.65;
}

.result-copy {
  margin: 22px 0 30px;
}

.pace-adjuster {
  margin: 26px 0;
  padding: 22px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.pace-adjuster > div,
.stepper {
  display: flex;
  margin-top: 12px;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.pace-adjuster button,
.stepper button {
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 1.25rem;
}

.pace-adjuster strong {
  font-size: 2rem;
  font-weight: 400;
}

.pace-adjuster small {
  font-size: 1rem;
}

.page-heading {
  margin: 48px 0 34px;
}

.page-heading h1 {
  max-width: 730px;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 24px 0;
}

.filter-chip,
.chip-row button {
  min-height: 40px;
  padding: 8px 16px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
}

.filter-chip.is-active,
.chip-row button.is-active {
  color: #0f1816;
  background: var(--inhale);
  border-color: var(--inhale);
}

.library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.library-card {
  display: grid;
  min-height: 150px;
  padding: 23px;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.library-card .purpose-icon {
  width: 44px;
  height: 44px;
  margin: 0;
}

.library-card strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 400;
}

.library-card span span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.library-arrow {
  color: var(--subtle);
}

.setup-icon {
  width: 62px;
  height: 62px;
  margin: 30px 0 22px;
}

.setup-purpose {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 1.08rem;
}

.setup-instruction {
  margin: 0;
}

.breathing-route-card {
  display: flex;
  margin-top: 20px;
  padding: 14px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(169, 230, 211, 0.10), rgba(199, 185, 232, 0.10));
  border: 1px solid rgba(169, 230, 211, 0.22);
  border-radius: 16px;
}

.breathing-route-card span {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
}

.breathing-route-card strong {
  font-size: 0.94rem;
  font-weight: 500;
  text-align: right;
}

.setup-panel {
  margin: 34px 0 20px;
  padding: 4px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.setting-row {
  display: flex;
  padding: 20px 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.setting-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-row .micro-label {
  margin: 0;
}

.setting-row > div:first-child > span:last-child {
  color: var(--muted);
  font-size: 0.77rem;
}

.chip-row {
  display: flex;
  gap: 6px;
}

.chip-row button {
  min-width: 42px;
  padding-inline: 11px;
}

.stepper {
  margin: 0;
  gap: 12px;
}

.stepper strong {
  min-width: 40px;
  text-align: center;
  font-weight: 400;
}

.sound-setting {
  margin: 0;
  padding: 20px 0;
  border: 0;
}

.sound-setting legend {
  padding: 20px 0 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  border-radius: 11px;
  font-size: 0.8rem;
}

.segmented input:checked + span {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}

.acknowledgement {
  display: grid;
  margin: 18px 0 8px;
  padding: 18px;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  background: rgba(233, 191, 197, 0.07);
  border: 1px solid rgba(233, 191, 197, 0.22);
  border-radius: 18px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.acknowledgement input {
  width: 19px;
  height: 19px;
  accent-color: var(--inhale);
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 34px 0 46px;
}

.summary-card {
  min-height: 150px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.summary-card strong {
  display: block;
  margin-top: 20px;
  font-size: 2rem;
  font-weight: 400;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.history-subtitle {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item,
.empty-state {
  display: grid;
  padding: 18px 20px;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.history-item strong {
  display: block;
  margin-bottom: 5px;
  font-weight: 400;
}

.history-item span,
.history-item time,
.empty-state {
  color: var(--muted);
  font-size: 0.8rem;
}

.history-item time {
  text-align: right;
}

.danger-text {
  width: auto;
  margin-top: 24px;
  color: var(--danger);
  border-color: rgba(244, 184, 178, 0.24);
}

.stage-view {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow-y: auto;
  padding: max(28px, env(safe-area-inset-top)) 24px max(38px, env(safe-area-inset-bottom));
  text-align: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(159, 222, 211, 0.08), transparent 28rem),
    #0b1110;
}

.stage-view.is-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stage-close {
  position: absolute;
  top: max(22px, env(safe-area-inset-top));
  right: 24px;
  z-index: 3;
  font-size: 1.55rem;
}

.stage-progress {
  position: absolute;
  top: max(34px, env(safe-area-inset-top));
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.breath-ring {
  position: relative;
  display: grid;
  width: min(68vw, 390px);
  aspect-ratio: 1;
  margin: 32px 0 40px;
  place-items: center;
  border: 1.5px solid var(--ring);
  border-radius: 50%;
}

.breath-orb {
  width: 8%;
  height: 8%;
  background: radial-gradient(circle at 34% 27%, var(--inhale-light) 0%, var(--inhale) 41%, var(--inhale-deep) 100%);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(159, 222, 211, 0.2);
  transition: background 500ms ease;
  will-change: width, height;
}

.stage-view[data-phase="inhale"] .breath-orb,
.stage-view[data-phase="topUp"] .breath-orb {
  background: radial-gradient(circle at 34% 27%, var(--inhale-light) 0%, var(--inhale) 41%, var(--inhale-deep) 100%);
  box-shadow: 0 0 55px rgba(159, 222, 211, 0.24);
}

.stage-view[data-phase="exhale"] .breath-orb,
.stage-view[data-phase="holdOut"] .breath-orb {
  background: radial-gradient(circle at 34% 27%, var(--exhale-light) 0%, var(--exhale) 41%, var(--exhale-deep) 100%);
  box-shadow: 0 0 55px rgba(185, 181, 232, 0.24);
}

.stage-view[data-phase="holdIn"] .breath-orb {
  background: radial-gradient(circle at 34% 27%, #f5ebd8 0%, var(--sand) 45%, #a88e64 100%);
}

.countdown-disc {
  position: absolute;
  display: none;
  width: 44%;
  height: 44%;
  place-items: center;
  color: #101816;
  background: #f8f7f2;
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.16);
}

.countdown-disc.is-active {
  display: grid;
}

.countdown-disc span {
  font-size: clamp(3.2rem, 12vw, 5.7rem);
  letter-spacing: -0.06em;
}

.phase-copy h1 {
  font-size: clamp(2.4rem, 8vw, 4.9rem);
}

.phase-copy p {
  margin: 12px 0 0;
  color: var(--muted);
}

.phase-copy .phase-route {
  width: fit-content;
  margin: 14px auto 0;
  padding: 8px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.phase-copy .phase-route[hidden] {
  display: none;
}

#phase-time {
  display: block;
  min-height: 1.5rem;
  margin-top: 12px;
  color: var(--inhale);
  font-variant-numeric: tabular-nums;
}

.stage-tap,
.stage-stop {
  min-width: 180px;
  min-height: 54px;
  margin-top: 30px;
  padding: 13px 24px;
  color: #0b1110;
  background: var(--ink);
  border: 0;
  border-radius: 99px;
  font-weight: 600;
}

.stage-stop {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: max(18px, calc((100vw - 1120px) / 2));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(18px, calc((100vw - 1120px) / 2));
  display: grid;
  min-height: 70px;
  padding: 7px;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(20, 29, 27, 0.88);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.bottom-nav[hidden] {
  display: none;
}

.bottom-nav button {
  display: flex;
  padding: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--subtle);
  background: transparent;
  border: 0;
  border-radius: 16px;
  font-size: 0.68rem;
}

.bottom-nav button > span:first-child {
  font-size: 1.1rem;
}

.bottom-nav button.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

.completion-sheet {
  position: fixed;
  z-index: 80;
  inset: 0;
  padding: 24px;
  background: rgba(4, 8, 7, 0.74);
  backdrop-filter: blur(14px);
}

.completion-sheet:not([hidden]) {
  display: grid;
  place-items: center;
}

.completion-sheet > div {
  width: min(100%, 470px);
  padding: 38px 30px 30px;
  text-align: center;
  background: #17221f;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.completion-sheet h2 {
  font-size: 2rem;
}

.completion-sheet p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.completion-orbit {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 24px;
  place-items: center;
  color: var(--stage);
  background: var(--inhale);
  border-radius: 50%;
  font-size: 1.6rem;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 104px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 17px;
  color: var(--stage);
  background: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 780px) {
  .app-shell {
    padding-inline: 18px;
  }

  .topbar {
    height: 70px;
  }

  .home-intro {
    margin-top: 28px;
  }

  .foundation-card {
    min-height: 205px;
    padding: 25px;
  }

  .mini-orbit {
    width: 92px;
    height: 92px;
    margin-right: 0;
  }

  .purpose-grid,
  .library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purpose-card {
    min-height: 195px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-bottom: 102px;
  }

  h1 {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }

  .foundation-card {
    min-height: 224px;
    padding: 25px 22px;
  }

  .foundation-copy {
    max-width: 68%;
  }

  .foundation-copy strong {
    font-size: 2.1rem;
  }

  .foundation-copy > span:last-child {
    font-size: 0.82rem;
  }

  .mini-orbit {
    width: 78px;
    height: 78px;
    margin-left: 12px;
  }

  .baseline-row {
    align-items: flex-end;
  }

  .baseline-row > div {
    grid-template-columns: 1fr;
  }

  .purpose-section,
  .snapshot {
    margin-top: 66px;
  }

  .purpose-grid {
    gap: 10px;
  }

  .purpose-card {
    min-height: 184px;
    padding: 18px;
  }

  .purpose-card strong {
    margin-top: 22px;
  }

  .stat-grid {
    gap: 8px;
  }

  .stat-card {
    min-height: 122px;
    padding: 17px 12px;
  }

  .stat-card strong {
    font-size: 1.75rem;
  }

  .library-list,
  .history-summary {
    grid-template-columns: 1fr;
  }

  .library-card {
    min-height: 126px;
  }

  .history-summary {
    gap: 8px;
  }

  .summary-card {
    min-height: 105px;
  }

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .chip-row {
    width: 100%;
  }

  .chip-row button {
    flex: 1;
  }

  .breath-ring {
    width: min(76vw, 330px);
  }

  .stage-progress {
    top: max(38px, env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


@media (min-width: 781px) and (max-width: 1199px) {
  .bottom-nav {
    right: auto;
    left: 50%;
    width: 420px;
    transform: translateX(-50%);
  }
}

@media (min-width: 1200px) {
  .bottom-nav {
    top: 50%;
    right: 22px;
    bottom: auto;
    left: auto;
    width: 76px;
    min-height: auto;
    grid-template-columns: 1fr;
    transform: translateY(-50%);
  }

  .bottom-nav button {
    min-height: 66px;
  }
}
