@font-face { font-family: "Bebas Neue"; src: url(assets/fonts/BebasNeue-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(assets/fonts/Poppins-300.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(assets/fonts/Poppins-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(assets/fonts/Poppins-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(assets/fonts/Poppins-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

/* ---------- Themes (from the channel logo + banner) ----------
   Surfaces are opaque, one tone step above the ground, with hairline borders: the sky and the breathing shapes carry the mood.
   The phase colours are the reels' own: inhale, hold (full), exhale, hold (empty). */
:root, [data-theme="cosmos"] {
  --bg-top: #0b1620; --bg-bot: #1b3549;
  --card: #122230; --card-2: #1a2e3e; --line: rgba(238, 241, 243, .09);
  --text: #eef1f3; --muted: #9db1c0;
  --accent: #e8650f; --accent-2: #ffb15c; --accent-ink: #1a0d03;
  --ring: #d2c9c3; --orb-a: #ffd7a3; --orb-b: #e8650f;
  --star: 255, 236, 214; --glow: 232, 101, 15;
  --ph-in: #78bce1; --ph-full: #e8e2d8; --ph-out: #ee7a2e; --ph-empty: #e9c48f;
  color-scheme: dark;
}
[data-theme="forest"] {
  --bg-top: #0a1f27; --bg-bot: #1e4457;
  --card: #102a34; --card-2: #173643; --line: rgba(238, 246, 250, .09);
  --text: #eef6fa; --muted: #a2c4d4;
  --accent: #78bce1; --accent-2: #c9e8f7; --accent-ink: #06202c;
  --ring: #c9e8f7; --orb-a: #e3f4fc; --orb-b: #78bce1;
  --star: 214, 238, 250; --glow: 120, 188, 225;
  --ph-in: #78bce1; --ph-full: #e8e2d8; --ph-out: #ee7a2e; --ph-empty: #e9c48f;
  color-scheme: dark;
}
[data-theme="night"] {
  --bg-top: #07071a; --bg-bot: #231d55;
  --card: #110f2a; --card-2: #19173b; --line: rgba(241, 237, 255, .09);
  --text: #f1edff; --muted: #aaa3d6;
  --accent: #9c7fe0; --accent-2: #dccfff; --accent-ink: #120a2e;
  --ring: #cdbfff; --orb-a: #f3edff; --orb-b: #9c7fe0;
  --star: 225, 215, 255; --glow: 156, 127, 224;
  --ph-in: #78bce1; --ph-full: #e8e2d8; --ph-out: #ee7a2e; --ph-empty: #e9c48f;
  color-scheme: dark;
}
[data-theme="bubble"] {
  --bg-top: #e4f0f2; --bg-bot: #b9d3da;
  --card: #f4f9fa; --card-2: #e2edf0; --line: rgba(24, 57, 74, .12);
  --text: #18394a; --muted: #33545f;
  --accent: #2c6c82; --accent-2: #2b5b6c; --accent-ink: #ffffff;
  --ring: #6f97a5; --orb-a: #d4e4e8; --orb-b: #5f8d9d;
  --star: 255, 255, 255; --glow: 83, 125, 141;
  --ph-in: #3f83a8; --ph-full: #6c7781; --ph-out: #c2560f; --ph-empty: #a87a2c;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bot)) fixed;
  background-color: var(--bg-top);
  overscroll-behavior: none;
  transition: background .6s, color .4s;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 12px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

#app {
  position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 92px);
}
.view { display: none; animation: view-in .45s cubic-bezier(.16, 1, .3, 1) both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 22px 4px; }
.center { text-align: center; justify-content: center; }
.hidden { display: none !important; }
.page-title { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 34px; letter-spacing: .05em; line-height: 1; margin: 0; }
.page-head { margin: 6px 4px 18px; }
.page-head .muted { margin-top: 6px; font-size: 14px; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 99px; font-weight: 600; font-size: 15px;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .15s ease, filter .2s ease;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; }
.btn-primary.big { width: 100%; margin-top: 18px; padding: 17px; font-size: 16px; }
.btn-primary.full { width: 100%; margin: 4px 0; padding: 15px; }
.btn-ghost { padding: 13px 20px; border-radius: 99px; border: 1px solid var(--line); background: var(--card-2); font-weight: 500; transition: background .2s; }
.btn-ghost:hover { background: color-mix(in srgb, var(--card-2) 80%, var(--text) 8%); }
.btn-ghost.full { width: 100%; margin: 6px 0; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-text { display: inline-flex; align-items: center; gap: 4px; padding: 10px 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.btn-text:hover { color: var(--text); }
.btn-text:disabled { opacity: .35; }
.danger { color: #ff8f7a; }
[data-theme="bubble"] .danger { color: #b03a22; }
.btn-link { display: block; margin: 14px auto 0; padding: 6px 4px; color: var(--accent-2); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Home ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 8px 6px; }
.hero-preview { position: relative; width: min(52vw, 210px); aspect-ratio: 1; margin-bottom: 6px; }
.hero-preview canvas { position: absolute; inset: 0; display: block; }
.hero-title { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: clamp(36px, 10vw, 46px); letter-spacing: .05em; line-height: 1; margin: 0 0 8px; text-wrap: balance; }
.hero-summary { margin: 0; font-size: 15px; font-weight: 300; color: var(--muted); text-wrap: balance; }
.hero .btn-primary.big { max-width: 360px; }
.hero-stats { margin: 14px 0 0; min-height: 1.4em; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.section-title { font-size: 14px; font-weight: 500; color: var(--muted); margin: 30px 6px 10px; }
.card { padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 500; }

/* techniques: one list, each row carrying its reel motif */
.tech-list { border-radius: 20px; background: var(--card); border: 1px solid var(--line); padding: 6px; }
.tech { width: 100%; display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; text-align: left; padding: 12px 12px; border-radius: 15px; border: 1.5px solid transparent; transition: background .2s, border-color .25s; }
.tech + .tech { margin-top: 2px; }
.tech:hover { background: var(--card-2); }
.tech[aria-pressed="true"] { background: var(--card-2); border-color: var(--accent); }
.tech svg { width: 48px; height: 48px; overflow: visible; }
.tech-name { display: block; font-family: "Bebas Neue", sans-serif; font-size: 22px; letter-spacing: .04em; line-height: 1.05; }
.tech-rhythm { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tech-benefit { display: block; margin-top: 3px; font-size: 13px; color: var(--text); opacity: .82; line-height: 1.4; }
.g-track { fill: none; stroke: var(--text); stroke-opacity: .16; stroke-width: 2.4; stroke-linejoin: round; }
.g-in, .g-out, .g-full, .g-empty { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.g-in { stroke: var(--ph-in); } .g-out { stroke: var(--ph-out); } .g-full { stroke: var(--ph-full); } .g-empty { stroke: var(--ph-empty); }
.g-dot { fill: var(--ph-in); }
.g-core { fill: var(--ph-in); }
.g-ring { fill: none; stroke: var(--ring); stroke-width: 1.2; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; min-height: 52px; }
.row + .row, .more { border-top: 1px solid var(--line); }
.row.col { flex-direction: column; align-items: stretch; }
.row label { font-size: 15px; }
.more summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; font-size: 15px; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more summary .ic { color: var(--muted); transition: transform .25s ease; }
.more[open] summary .ic { transform: rotate(90deg); }
.more[open] summary { padding-bottom: 6px; }
.more .row:first-of-type { border-top: 0; }

.stepper { display: flex; align-items: center; gap: 2px; background: var(--card-2); border-radius: 99px; padding: 2px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; font-size: 20px; line-height: 1; transition: background .15s; }
.stepper button:active { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.stepper output { min-width: 50px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--card-2); margin-top: 8px; }
.segmented button { flex: 1; padding: 11px 8px; border-radius: 99px; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.pattern { display: flex; gap: 6px; margin-top: 8px; }
.pattern div { flex: 1; padding: 10px 4px; border-radius: 14px; background: var(--card-2); text-align: center; }
.pattern b { display: block; font-family: "Bebas Neue", sans-serif; font-size: 26px; font-weight: 400; line-height: 1; }
.pattern span { font-size: 13px; color: var(--muted); }
.tip { margin: 12px 2px 2px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.link-how { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px 2px 4px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--accent-2); }
.link-how .ic { color: var(--muted); }

/* ---------- Tab bar: plain, flush to the edge ---------- */
.tabbar {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 12px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--card); border-top: 1px solid var(--line);
  transition: opacity .9s ease .15s;
}
.tabbar button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; border-radius: 14px; color: var(--muted); font-size: 12px; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { color: var(--text); }
.tabbar button.active svg { stroke: var(--accent); }

/* ---------- Session ---------- */
.session {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 18px);
  background: transparent; /* the starry sky shows through */
  animation: fade .5s ease both;
}
.session.tappable { cursor: pointer; }
body.in-session #app, body.in-session .tabbar { visibility: hidden; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.session-top { width: 100%; max-width: 520px; display: flex; justify-content: center; min-height: 24px; }
.round-label { font-size: 14px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* the phase word: Bebas, wide tracking, in the phase colour; it rises out of a mask when it changes (as in the reels) */
.phase-cue {
  margin-top: 5vh; min-height: 1.15em; overflow: hidden; text-align: center;
  font-family: "Bebas Neue", sans-serif; font-size: clamp(40px, 11vw, 60px); letter-spacing: .1em; text-indent: .1em; line-height: 1.1;
  transition: color .6s ease;
}
.phase-sub { min-height: 2.9em; max-width: 30ch; color: var(--muted); text-align: center; font-size: 15px; font-weight: 300; line-height: 1.45; margin-top: 6px; text-wrap: balance; }
.rise { animation: word-rise .55s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes word-rise { from { opacity: 0; transform: translateY(70%); } to { opacity: 1; transform: none; } }
.phase-cue .io { display: inline-flex; align-items: center; gap: .45em; }
.phase-cue .io b { font-weight: 400; color: var(--muted); opacity: .45; transition: color .35s ease, opacity .35s ease; }
.phase-cue .io i { font-style: normal; color: var(--muted); opacity: .4; }
.phase-cue[data-side="in"] .io b[data-s="in"], .phase-cue[data-side="out"] .io b[data-s="out"] { color: var(--c); opacity: 1; }

.stage { position: relative; width: min(86vw, 46vh, 420px); aspect-ratio: 1; margin: auto 0; --ty: 0px; }
.stage canvas { position: absolute; inset: 0; display: block; }
.vz-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: translateY(var(--ty)); pointer-events: none; }
.vz-count { font-family: "Bebas Neue", sans-serif; font-size: clamp(64px, 19vw, 104px); line-height: .9; color: var(--text); font-variant-numeric: tabular-nums; }
.vz-count.hit { animation: hit .22s ease-out; }
@keyframes hit { from { transform: scale(1.07); } to { transform: none; } }
.vz-count.small-text { font-size: clamp(26px, 7vw, 36px); letter-spacing: .14em; text-indent: .14em; }
/* power: the core stays clean, the count sits under the ripples; the meter puts the count below the bars */
.stage[data-mode="ripple"] .vz-text, .stage[data-mode="meter"] .vz-text { justify-content: flex-end; }
.stage[data-mode="ripple"] .vz-count, .stage[data-mode="meter"] .vz-count { font-size: clamp(44px, 12vw, 64px); }

.session-bottom { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.btn-tap { width: 100%; padding: 16px 18px; border-radius: 99px; font-size: 15px; font-weight: 500; color: var(--text); background: var(--card); border: 1px solid var(--line); animation: breathe-soft 3.2s ease-in-out infinite; }
@keyframes breathe-soft { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.round-dots { display: flex; gap: 8px; min-height: 8px; }
.round-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.round-dots i.done { background: var(--accent); }
.round-dots i.now { background: var(--accent-2); transform: scale(1.4); }
/* controls sit at the bottom, in the thumb's reach */
.sess-controls { display: flex; align-items: center; justify-content: center; gap: 22px; }
.ctl { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--text); transition: background .2s, transform .15s; }
.ctl:active { transform: scale(.94); }
.ctl-main { width: 64px; height: 64px; }
.ctl-main .ic { width: 24px; height: 24px; }
.ctl[aria-pressed="true"] { color: var(--muted); }
.session.paused .stage { filter: saturate(.4) brightness(.85); }
.session.paused .phase-sub { color: var(--text); font-weight: 400; }

/* ---------- Results ---------- */
.results { justify-content: center; overflow-y: auto; }
.results-inner { width: 100%; max-width: 440px; text-align: center; }
.results .page-title { font-size: 40px; margin-bottom: 8px; }
.res-bars { display: flex; align-items: flex-end; justify-content: center; gap: 12px; height: 170px; margin: 26px 0 18px; }
.res-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); width: 44px; }
.res-bar b { color: var(--text); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.res-bar .fill { width: 100%; border-radius: 4px; background: var(--accent); animation: grow .8s cubic-bezier(.16, 1, .3, 1) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.res-stats { display: flex; justify-content: center; gap: 28px; margin: 22px 0 0; }
.res-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.res-stats dt { font-size: 13px; color: var(--muted); }
.res-stats dd { margin: 0; font-family: "Bebas Neue", sans-serif; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.pb { margin: 18px 0 0; color: var(--accent-2); font-weight: 600; font-size: 14px; }

/* ---------- Quiet ending: the light goes down, nothing to read but one line ---------- */
.quiet-end { justify-content: center; gap: 10px; text-align: center; background: #02050a; animation: dim 2.4s ease both; }
@keyframes dim { from { background: transparent; } to { background: #02050a; } }
.quiet-word { margin: 0; font-family: "Bebas Neue", sans-serif; font-size: 44px; letter-spacing: .12em; text-indent: .12em; color: #c9d3da; animation: quiet-in 2.4s ease .8s both; }
.quiet-sub { margin: 0 0 18px; max-width: 28ch; font-size: 15px; font-weight: 300; line-height: 1.5; color: #8394a1; animation: quiet-in 2.4s ease 1.4s both; }
.quiet-end .btn-text { color: #8394a1; animation: quiet-in 2s ease 2.2s both; }
@keyframes quiet-in { from { opacity: 0; } }

/* ---------- Opening ---------- */
.intro { position: fixed; inset: 0; z-index: 60; background: #050b12; display: none; cursor: pointer; }
.intro.play { display: block; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-words { position: absolute; left: 0; right: 0; top: 64%; text-align: center; padding: 0 16px; }
.intro-title { margin: 0; font-family: "Bebas Neue", sans-serif; font-size: clamp(56px, 16vw, 150px); line-height: .9; letter-spacing: .04em; color: #eef2ef; white-space: nowrap; animation: arrive 1.8s cubic-bezier(.2, .7, .2, 1) .5s both; }
.intro-title em { font-style: normal; color: #f0802e; }
.intro-cue { margin: 0 0 18px; font-size: 13px; font-weight: 500; letter-spacing: .32em; text-indent: .32em; text-transform: uppercase; color: #9fd3e6; animation: appear 1.2s ease 1.3s both; }
@keyframes arrive { from { opacity: 0; letter-spacing: .32em; filter: blur(14px); transform: translateY(18px) scale(.96); } to { opacity: 1; letter-spacing: .04em; filter: none; transform: none; } }
@keyframes appear { from { opacity: 0; } }
.intro.out { opacity: 0; transform: scale(1.06); filter: blur(6px); transition: opacity .8s ease, transform .8s cubic-bezier(.4, 0, .2, 1), filter .8s ease; pointer-events: none; }
/* the menu rises in behind it */
#app { transition: opacity .9s ease .15s, transform 1s cubic-bezier(.16, 1, .3, 1) .15s; }
body:not(.ready) #app { opacity: 0; transform: translateY(14px); }
body:not(.ready) .tabbar { opacity: 0; }

/* ---------- Power breathing walkthrough ---------- */
.tut { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 10, .7); animation: fade .35s ease both; }
.tut-card { position: relative; width: 100%; max-width: 400px; padding: 22px 20px 16px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.tut .modal-x { position: absolute; top: 12px; right: 12px; }
.tut-art { width: 180px; height: 180px; margin: 4px auto 6px; }
.tut-art svg { width: 100%; height: 100%; overflow: visible; }
.tut-steps { display: grid; }
.tut-step { grid-area: 1 / 1; opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.tut-step.on { opacity: 1; transform: none; pointer-events: auto; transition: opacity .4s ease .18s, transform .55s cubic-bezier(.16, 1, .3, 1) .18s; }
.tut-k { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tut-h { margin: 0 0 8px; font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 40px; letter-spacing: .06em; line-height: 1; }
.tut-h em { font-style: normal; color: var(--accent); }
.tut-p { margin: 0 auto; max-width: 30ch; font-size: 15px; font-weight: 300; line-height: 1.5; color: var(--text); }
.tut-safe { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tut-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 14px; }
.tut-nav .btn-text { justify-self: start; }
.tut-nav .btn-primary { justify-self: end; min-width: 112px; }
.tut-dots { display: flex; gap: 7px; }
.tut-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: width .35s cubic-bezier(.16, 1, .3, 1), background .35s; }
.tut-dots i.on { width: 22px; background: var(--accent); }
/* the motion graphics: one small scene per step */
.ta-core { fill: var(--ph-in); transform-origin: 100px 100px; transform-box: view-box; }
.ta-ripples circle { fill: none; stroke: var(--ring); stroke-width: 1.4; opacity: 0; transform-origin: 100px 100px; transform-box: view-box; }
.ta-arrows path, .ta-hand path { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ta-arrows, .ta-hand { opacity: 0; }
.ta-hand path { fill: var(--card-2); }
.ta-tap { fill: none; stroke: var(--accent-2); stroke-width: 2; opacity: 0; transform-origin: 132px 140px; transform-box: view-box; }
.ta-count { font-family: "Bebas Neue", sans-serif; font-size: 30px; fill: var(--bg-top); }
[data-step="0"] .ta-core { animation: ta-breathe 2.6s cubic-bezier(.45, 0, .55, 1) infinite; }
[data-step="0"] .ta-ripples circle { animation: ta-ripple 2.6s cubic-bezier(.2, .6, .3, 1) infinite; }
[data-step="0"] .ta-ripples circle:nth-child(2) { animation-delay: .87s; }
[data-step="0"] .ta-ripples circle:nth-child(3) { animation-delay: 1.73s; }
[data-step="0"] .ta-arrows { animation: ta-arrow 2.6s ease-in-out infinite; }
@keyframes ta-breathe { 0%, 100% { transform: scale(.62); } 50% { transform: scale(1.12); } }
@keyframes ta-ripple { 0% { opacity: .6; transform: scale(.9); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes ta-arrow { 0%, 45% { opacity: .9; transform: translateY(0); } 50%, 100% { opacity: 0; transform: translateY(-8px); } }
[data-step="1"] .ta-core { fill: var(--ph-empty); animation: ta-still 4s ease-in-out infinite; }
[data-step="1"] .ta-count { font-size: 22px; }
@keyframes ta-still { 0%, 100% { transform: scale(.62); } 50% { transform: scale(.65); } }
[data-step="2"] .ta-core { fill: var(--ph-empty); transform: scale(.55); }
[data-step="2"] .ta-hand { animation: ta-hand 2.4s cubic-bezier(.16, 1, .3, 1) infinite; }
[data-step="2"] .ta-tap { animation: ta-tap 2.4s ease-out infinite; }
@keyframes ta-hand { 0% { opacity: 0; transform: translate(14px, 14px); } 25% { opacity: 1; transform: none; } 40% { transform: translate(-1px, 2px) scale(.97); } 55%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(10px, 10px); } }
@keyframes ta-tap { 0%, 38% { opacity: 0; transform: scale(.4); } 42% { opacity: .9; } 75%, 100% { opacity: 0; transform: scale(2.6); } }
[data-step="3"] .ta-core { fill: var(--ph-full); animation: ta-recover 4s cubic-bezier(.16, 1, .3, 1) infinite; }
[data-step="3"] .ta-ripples circle:first-child { animation: ta-ripple 4s ease-out .6s infinite; }
@keyframes ta-recover { 0% { transform: scale(.55); } 30%, 92% { transform: scale(1.15); } 100% { transform: scale(.55); } }

/* ---------- Progress ---------- */
.chart { position: relative; height: 180px; display: flex; align-items: flex-end; gap: 4px; padding: 16px 0 0 34px; }
.chart .axis { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart .axis span { position: absolute; left: 0; top: -8px; background: var(--card); padding-right: 4px; }
.chart .col { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: calc(100% - 18px); min-width: 0; }
.chart .col i { width: 100%; max-width: 22px; border-radius: 3px 3px 0 0; background: var(--accent); }
.chart .col b { font-size: 11px; font-weight: 600; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.chart .col span { position: absolute; bottom: -18px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart .empty { margin: auto; color: var(--muted); font-size: 14px; text-align: center; padding-right: 34px; }
.cal-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cal-key i { width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.k-done { background: var(--accent); }
.k-today { box-shadow: inset 0 0 0 1.5px var(--text); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar .d { aspect-ratio: 1; border-radius: 8px; background: var(--card-2); display: grid; place-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.calendar .d.b { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.calendar .d.today { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.history { list-style: none; padding: 4px 16px; margin: 0; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; }
.history li + li { border-top: 1px solid var(--line); }
.history .h-title { font-weight: 500; font-size: 15px; }
.history .h-sub { font-size: 13px; color: var(--muted); }
.history .h-val { text-align: right; font-family: "Bebas Neue", sans-serif; font-size: 24px; letter-spacing: .03em; line-height: 1; font-variant-numeric: tabular-nums; }
.history .h-val small { display: block; font-family: "Poppins", sans-serif; font-size: 11px; letter-spacing: 0; color: var(--muted); }

/* ---------- Settings ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-grid button { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line); font-size: 14px; font-weight: 500; text-align: left; }
.theme-grid button[aria-pressed="true"] { border-color: var(--accent); }
.swatch { height: 60px; border-radius: 12px; position: relative; overflow: hidden; }
.swatch::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.sw-cosmos { background: linear-gradient(180deg, #0b1620, #25445a); } .sw-cosmos::after { background: #e8650f; }
.sw-forest { background: linear-gradient(180deg, #0a1f27, #1e4457); } .sw-forest::after { background: #78bce1; }
.sw-bubble { background: linear-gradient(180deg, #e4f0f2, #b9d3da); } .sw-bubble::after { background: #5f8d9d; }
.sw-night { background: linear-gradient(180deg, #07071a, #231d55); } .sw-night::after { background: #9c7fe0; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; font-size: 15px; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { width: 48px; height: 28px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(20px); background: #fff; }
.toggle input:focus-visible + i { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.safety p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.danger-zone { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 10, .7); animation: fade .3s; overflow-y: auto; }
.modal-card { position: relative; width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px 22px 22px; border-radius: 26px; text-align: center; background: var(--card); border: 1px solid var(--line); }
.modal-card .page-title { font-size: 32px; }
.modal-card ul { text-align: left; padding-left: 20px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.modal-card li { margin-bottom: 8px; }
.modal-card a { color: var(--accent-2); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); }
.modal-x { position: absolute; top: 12px; right: 12px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); font-size: 14px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- In-app dialog: the calm choice comes first, the destructive one is a quiet link ---------- */
.dialog-text { margin: 10px 0 0; font-size: 15px; line-height: 1.5; }
.dialog-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.dialog-actions .btn-primary, .dialog-actions .btn-ghost { width: 100%; padding: 15px; }
.dialog-actions .btn-text { align-self: center; margin-top: 6px; }

/* ---------- Account, forms ---------- */
.acct-title { margin: 0 0 4px; font-weight: 600; font-size: 16px; word-break: break-all; }
.acct-text { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.links { padding: 4px 16px; }
.link-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; color: var(--text); text-decoration: none; font-size: 15px; }
.link-row + .link-row { border-top: 1px solid var(--line); }
.link-row .ic { color: var(--muted); }
.safety .link-row { margin-top: 8px; border-top: 1px solid var(--line); padding-bottom: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.check input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 4px; text-align: left; font-size: 14px; color: var(--muted); }
.field input { width: 100%; padding: 14px 16px; border-radius: 14px; font: inherit; font-size: 16px; color: var(--text); caret-color: var(--accent); background: var(--card-2); border: 1px solid var(--line); outline: none; }
.field input:focus-visible { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.form-error { min-height: 1.2em; margin: 10px 0 0; color: #ff8f7a; font-size: 14px; text-align: left; }
[data-theme="bubble"] .form-error { color: #b03a22; }
.auth-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.auth-links .btn-link { margin: 14px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .view, .rise, .vz-count.hit, .btn-tap, .tut-art *, .quiet-end, .quiet-end * { animation: none !important; }
  .tut-step, .tut-step.on { transition: none; }
}
