/* =====================================================================
   OverDose on Zen · style.css
   Warm, serene, mobile-first. Light = "day", Dark = "Bedtime Mode".
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #FAF8F5;
  --bg-2: #F2ECE4;
  --bg-3: #EAF0EC;
  --ink: #2C3E35;
  --ink-2: rgba(44, 62, 53, .78);
  --muted: rgba(44, 62, 53, .58);
  --line: rgba(44, 62, 53, .10);
  --sage: #7A9A8B;
  --sage-deep: #5D7D6E;
  --sage-soft: rgba(122, 154, 139, .16);
  --terra: #D4A373;
  --terra-deep: #B9824F;
  --terra-soft: rgba(212, 163, 115, .18);
  --lav: #B5B2C9;
  --lav-soft: rgba(181, 178, 201, .25);
  --rose: #C9A9A6;
  --danger: #B5605A;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .75);
  --shadow: 0 10px 34px -12px rgba(44, 62, 53, .16), 0 2px 8px -2px rgba(44, 62, 53, .05);
  --shadow-lg: 0 24px 60px -18px rgba(44, 62, 53, .28);
  --orb-a: #9DBBAC;
  --orb-b: #C9C6DC;
  --overlay-bg: radial-gradient(120% 90% at 50% 20%, #F4EFE8 0%, #E8EFEA 55%, #E4E2EE 100%);
  --radius: 22px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --tabbar-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131A17; --bg-2: #18211D; --bg-3: #1A2421;
    --ink: #E8E3D9; --ink-2: rgba(232, 227, 217, .8); --muted: rgba(232, 227, 217, .55); --line: rgba(232, 227, 217, .09);
    --sage: #8FB3A2; --sage-deep: #A9C9B9; --sage-soft: rgba(143, 179, 162, .14);
    --terra: #D9AE84; --terra-deep: #E4BE98; --terra-soft: rgba(217, 174, 132, .14);
    --lav: #A3A0C2; --lav-soft: rgba(163, 160, 194, .16); --rose: #C29C99; --danger: #D98A82;
    --glass: rgba(255, 255, 255, .05); --glass-strong: rgba(30, 40, 36, .92); --glass-border: rgba(255, 255, 255, .08);
    --shadow: 0 10px 34px -12px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7);
    --orb-a: #5F8574; --orb-b: #6E6B92;
    --overlay-bg: radial-gradient(120% 90% at 50% 20%, #1C2622 0%, #141B18 60%, #17161F 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131A17; --bg-2: #18211D; --bg-3: #1A2421;
  --ink: #E8E3D9; --ink-2: rgba(232, 227, 217, .8); --muted: rgba(232, 227, 217, .55); --line: rgba(232, 227, 217, .09);
  --sage: #8FB3A2; --sage-deep: #A9C9B9; --sage-soft: rgba(143, 179, 162, .14);
  --terra: #D9AE84; --terra-deep: #E4BE98; --terra-soft: rgba(217, 174, 132, .14);
  --lav: #A3A0C2; --lav-soft: rgba(163, 160, 194, .16); --rose: #C29C99; --danger: #D98A82;
  --glass: rgba(255, 255, 255, .05); --glass-strong: rgba(30, 40, 36, .92); --glass-border: rgba(255, 255, 255, .08);
  --shadow: 0 10px 34px -12px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7);
  --orb-a: #5F8574; --orb-b: #6E6B92;
  --overlay-bg: radial-gradient(120% 90% at 50% 20%, #1C2622 0%, #141B18 60%, #17161F 100%);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .005em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  transition: background-color .8s var(--ease), color .6s var(--ease);
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 5.5vw, 2.4rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .9em; }
a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); }
:focus-visible { outline: 2.5px solid var(--sage); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 22px; height: 22px; flex: none; }
.btn .ic { width: 18px; height: 18px; }

#zen-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; }
main { max-width: 1040px; margin: 0 auto; padding: 8px 18px calc(var(--tabbar-h) + 36px + env(safe-area-inset-bottom)); outline: none; }
.view { animation: viewIn .55s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-head { padding: 18px 2px 6px; max-width: 680px; }
.lead { color: var(--ink-2); font-size: 1.02rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 600; color: var(--sage-deep); margin: 0 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .78rem; line-height: 1.5; }
.tiny .ic, .small .ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.center { text-align: center; justify-content: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.gap-s { gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 2px 14px; gap: 12px; }
.section-head h2 { margin: 0; }
.card-pad { padding: 22px; margin-bottom: 16px; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.12rem; letter-spacing: -.01em; }
.brand-text strong { font-weight: 700; color: var(--sage-deep); margin-right: 1px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--terra) 0 18%, transparent 19%),
              radial-gradient(circle, transparent 0 40%, var(--sage) 41% 52%, transparent 53%),
              radial-gradient(circle, transparent 0 66%, var(--lav) 67% 78%, transparent 79%);
}
.desk-nav { display: none; margin: 0 auto; gap: 2px; }
.desk-nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 500; transition: background .3s, color .3s; }
.desk-nav a:hover { background: var(--sage-soft); }
.desk-nav a[aria-current="page"] { background: var(--sage-soft); color: var(--sage-deep); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass);
  display: grid; place-items: center; cursor: pointer; transition: transform .25s var(--ease), background .3s;
}
.icon-btn:hover { background: var(--sage-soft); }
.icon-btn:active { transform: scale(.93); }
.icon-btn .ic { width: 20px; height: 20px; }
.ic-sun { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; }
:root[data-theme="dark"] .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: block; }
  :root:not([data-theme="light"]) .ic-moon { display: none; }
}
.streak-chip {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--terra-soft); color: var(--terra-deep); font-weight: 700; cursor: pointer;
}
.streak-chip .ic { width: 18px; height: 18px; }
.avatar-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--sage-soft); color: var(--sage-deep); border: 1px solid var(--line); font-weight: 700; font-size: 1rem;
}
.avatar-btn.has-user { color: #fff; border: 2px solid var(--glass-border); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  max-width: 520px; margin: 0 auto;
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; border-radius: 20px; transition: color .3s; position: relative; }
.tabbar a .ic { width: 23px; height: 23px; transition: transform .35s var(--ease); }
.tabbar a[aria-current="page"] { color: var(--sage-deep); }
.tabbar a[aria-current="page"] .ic { transform: translateY(-2px) scale(1.08); }
.tabbar a[aria-current="page"]::after { content: ''; position: absolute; bottom: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--terra); }

@media (min-width: 960px) {
  .desk-nav { display: flex; }
  .tabbar { display: none; }
  main { padding-bottom: 60px; padding-top: 18px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: transform .25s var(--ease), box-shadow .3s, background .3s, opacity .3s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--sage); color: #fff; box-shadow: 0 8px 22px -10px var(--sage); }
.btn-primary:hover { background: var(--sage-deep); }
:root[data-theme="dark"] .btn-primary { color: #10170F; }
.btn-terra { background: var(--terra); color: #fff; box-shadow: 0 8px 22px -10px var(--terra); }
.btn-terra:hover { background: var(--terra-deep); }
.btn-soft { background: var(--sage-soft); color: var(--sage-deep); }
.btn-soft:hover { background: color-mix(in srgb, var(--sage) 26%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--glass); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .86rem; }
.btn-lg { min-height: 56px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.link-soft { background: none; border: 0; padding: 0; color: var(--sage-deep); font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; }
.link-soft:hover { text-decoration: underline; }

/* ---------- Home ---------- */
.announce { margin: 16px 0 0; padding: 12px 18px; border-radius: var(--radius-sm); background: var(--terra-soft); color: var(--ink); font-size: .92rem; text-align: center; }
.hero { text-align: center; padding: 26px 8px 6px; }
.hero-title { max-width: 560px; margin: 0 auto .3em; font-weight: 500; }
.hero-sub { color: var(--muted); font-size: .95rem; margin: 0; }

.pause-wrap { display: grid; place-items: center; padding: 30px 0 34px; }
.pause-ring {
  position: relative; width: min(68vw, 270px); aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 50%; -webkit-tap-highlight-color: transparent;
}
.pause-ring .ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.pause-ring .r1 { background: radial-gradient(circle, color-mix(in srgb, var(--sage) 35%, transparent) 0%, transparent 70%); animation: breathe 10s ease-in-out infinite; }
.pause-ring .r2 { inset: 9%; border: 1.5px solid color-mix(in srgb, var(--sage) 45%, transparent); animation: breathe 10s ease-in-out infinite .4s; }
.pause-ring .r3 { inset: -6%; border: 1px solid color-mix(in srgb, var(--lav) 55%, transparent); animation: breathe 10s ease-in-out infinite .8s; opacity: .7; }
.pause-core {
  position: absolute; inset: 17%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.55), transparent 55%), linear-gradient(150deg, var(--orb-a), var(--sage) 45%, var(--orb-b));
  color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset, 0 18px 50px -12px color-mix(in srgb, var(--sage) 75%, transparent), 0 0 70px -10px color-mix(in srgb, var(--lav) 70%, transparent);
  transition: transform .5s var(--ease), box-shadow .5s;
  animation: corePulse 10s ease-in-out infinite;
}
.pause-ring:hover .pause-core { box-shadow: 0 0 0 1px rgba(255,255,255,.45) inset, 0 22px 60px -10px color-mix(in srgb, var(--sage) 85%, transparent), 0 0 90px -6px color-mix(in srgb, var(--lav) 80%, transparent); }
.pause-ring:active .pause-core { transform: scale(.95); }
.pause-label { font-size: 1.45rem; font-weight: 600; line-height: 1.15; text-align: center; letter-spacing: -.01em; text-shadow: 0 1px 12px rgba(44,62,53,.25); }
.pause-meta { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; opacity: .9; font-weight: 600; }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .65; } 40% { transform: scale(1.06); opacity: 1; } }
@keyframes corePulse { 0%, 100% { transform: scale(.97); } 40% { transform: scale(1.02); } }

.streak-card { padding: 20px 22px; max-width: 560px; margin: 0 auto; }
.streak-top { display: flex; justify-content: space-between; align-items: center; }
.streak-big { font-size: 2.2rem; font-weight: 700; margin: 0; line-height: 1.1; color: var(--ink); }
.streak-unit { font-size: 1rem; font-weight: 500; color: var(--muted); }
.streak-icon { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--terra-soft); color: var(--terra-deep); }
.streak-icon .ic { width: 28px; height: 28px; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 16px 0 10px; }
.week-dots .d { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: .7rem; color: var(--muted); font-weight: 600; }
.week-dots .d i { width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 50%; background: var(--line); display: grid; place-items: center; transition: background .4s; }
.week-dots .d i .ic { width: 14px; height: 14px; color: #fff; }
.week-dots .d.on i { background: linear-gradient(140deg, var(--sage), var(--terra)); box-shadow: 0 4px 12px -4px var(--sage); }
.week-dots .d.today span { color: var(--sage-deep); }
.week-dots .d.today i { outline: 2px solid color-mix(in srgb, var(--sage) 50%, transparent); outline-offset: 2px; }
.streak-note { margin: 0; color: var(--muted); font-size: .88rem; }

.chip-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-border); background: var(--glass); box-shadow: var(--shadow); font-weight: 500; font-size: .92rem;
  transition: transform .25s var(--ease), background .3s, color .3s; scroll-snap-align: start;
  text-decoration: none; color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--sage); color: #fff; border-color: transparent; }
.chip .em { font-size: 1.1rem; }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .tile-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.tile {
  display: flex; flex-direction: column; gap: 3px; padding: 18px; text-decoration: none; color: var(--ink); min-height: 132px;
  transition: transform .35s var(--ease), box-shadow .35s; position: relative; overflow: hidden;
}
.tile::before { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -40px; top: -40px; opacity: .55; background: var(--tc, var(--sage-soft)); filter: blur(4px); transition: transform .6s var(--ease); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile:hover::before { transform: scale(1.25); }
.tile .ic { width: 30px; height: 30px; color: var(--ti, var(--sage-deep)); margin-bottom: auto; position: relative; }
.tile strong { font-weight: 600; font-size: 1rem; position: relative; margin-top: 18px; }
.tile span { font-size: .82rem; color: var(--muted); position: relative; line-height: 1.4; }
.t-sage { --tc: var(--sage-soft); --ti: var(--sage-deep); }
.t-terra { --tc: var(--terra-soft); --ti: var(--terra-deep); }
.t-night { --tc: rgba(110, 120, 160, .2); --ti: #6F7AA0; }
.t-lav { --tc: var(--lav-soft); --ti: #8481A8; }
.t-rose { --tc: rgba(201, 169, 166, .25); --ti: #A8807C; }
.t-sky { --tc: rgba(143, 166, 184, .22); --ti: #6C8BA3; }

.daily-word { margin-top: 28px; padding: 26px; position: relative; overflow: hidden; }
.daily-word blockquote { margin: 4px 0 18px; font-size: 1.3rem; line-height: 1.5; font-weight: 500; letter-spacing: -.01em; }
.daily-word::after { content: '“'; position: absolute; right: 18px; top: -18px; font-size: 9rem; color: var(--sage); opacity: .12; font-family: Georgia, serif; }

.support-card { display: flex; gap: 16px; padding: 22px; margin-top: 16px; align-items: flex-start; }
.support-card p { color: var(--ink-2); font-size: .92rem; }
.support-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--terra-soft); color: var(--terra-deep); display: grid; place-items: center; flex: none; }
.help-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px 0 0; font-size: .88rem; color: var(--muted); flex-wrap: wrap; text-align: center; }
.help-line .ic { width: 16px; height: 16px; color: var(--terra); }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 6px 0 18px; box-shadow: var(--shadow); }
.seg button { border: 0; background: none; height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--ink-2); transition: background .3s, color .3s; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--sage); color: #fff; box-shadow: 0 6px 16px -8px var(--sage); }
.seg-small button { height: 34px; padding: 0 12px; font-size: .8rem; }

/* ---------- Breathing list ---------- */
.card-list { display: grid; gap: 14px; }
@media (min-width: 720px) { .card-list { grid-template-columns: 1fr 1fr; } }
.breath-item { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.breath-item h3 { margin: 0; }
.breath-item p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.pattern { display: flex; gap: 6px; flex-wrap: wrap; }
.pattern span { font-size: .74rem; padding: 4px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-deep); font-weight: 600; }
.pattern span.hold { background: var(--lav-soft); color: #7A77A0; }
.pattern span.out { background: var(--terra-soft); color: var(--terra-deep); }
.breath-item .row { margin-top: 4px; }
.mood-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-tags span { font-size: .72rem; color: var(--muted); }

/* ---------- Breath overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: var(--overlay-bg); display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(26px + env(safe-area-inset-bottom));
  animation: fadeIn .6s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 720px; width: 100%; margin: 0 auto; }
.overlay-title { margin: 0; font-weight: 600; text-align: center; flex: 1; }
.overlay-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; }
.breath-stage, .ody-stage { flex: 1; display: grid; place-items: center; }
.breath-orb { position: relative; width: min(78vw, 340px); aspect-ratio: 1; display: grid; place-items: center; }
.orb-glow { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--sage) 45%, transparent), transparent 68%); transform: scale(.6); transition: transform 4s ease-in-out, opacity 4s; }
.orb-core {
  position: absolute; inset: 14%; border-radius: 50%; transform: scale(.55);
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.6), transparent 55%), linear-gradient(150deg, var(--orb-a), var(--sage) 50%, var(--orb-b));
  box-shadow: 0 30px 80px -20px color-mix(in srgb, var(--sage) 80%, transparent), 0 0 0 1px rgba(255,255,255,.3) inset;
  transition: transform 4s ease-in-out;
}
.orb-text { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; color: #fff; text-shadow: 0 1px 16px rgba(44,62,53,.35); text-align: center; padding: 0 16%; }
#bo-phase { font-size: 1.35rem; font-weight: 600; transition: opacity .5s; }
.orb-count { font-size: 2.6rem; font-weight: 300; line-height: 1.2; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.progress-line { width: 100%; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-line span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--terra)); border-radius: 99px; transition: width .9s linear; }

/* ---------- Mood dial ---------- */
.dial-wrap { display: grid; place-items: center; padding: 14px 0 6px; }
.dial {
  position: relative; width: min(86vw, 360px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--lav-soft), var(--sage-soft), var(--terra-soft), var(--lav-soft));
  box-shadow: var(--shadow), 0 0 0 1px var(--glass-border) inset;
}
.dial::before { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: var(--bg); box-shadow: var(--shadow) ; }
.dial-center { position: absolute; inset: 26%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; z-index: 2; }
.dial-emoji { font-size: 2.6rem; line-height: 1; transition: transform .5s var(--ease); }
.dial-label { font-weight: 600; font-size: .95rem; }
.dial-btn {
  position: absolute; width: 25%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--glass-border); cursor: pointer; z-index: 3;
  background: var(--glass-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: translate(-50%, -50%); transition: transform .35s var(--ease), background .3s, box-shadow .3s; font-size: 1.35rem; line-height: 1;
}
.dial-btn small { font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0; margin-top: 4px; color: var(--ink-2); max-width: 94%; line-height: 1.15; text-align: center; }
.dial-btn:hover { transform: translate(-50%, -50%) scale(1.08); }
.dial-btn[aria-pressed="true"] { background: var(--mc, var(--sage)); transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 10px 28px -8px var(--mc, var(--sage)); }
.dial-btn[aria-pressed="true"] small { color: #fff; }
.dial-needle { position: absolute; left: 50%; top: 50%; width: 3px; height: 30%; background: linear-gradient(var(--terra), transparent); transform-origin: 50% 0; border-radius: 3px; z-index: 1; transition: transform .7s var(--ease); opacity: 0; }
.dial-needle.on { opacity: .9; }
.dial-desc { text-align: center; color: var(--ink-2); min-height: 1.6em; margin: 14px auto 0; max-width: 460px; }
.mood-recs { display: grid; gap: 14px; margin-top: 10px; }
.rec-group h3 { margin: 22px 2px 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--sage-deep); font-weight: 700; }
.rec { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; text-align: left; width: 100%; border: 1px solid var(--glass-border); transition: transform .3s var(--ease); margin-bottom: 10px; }
.rec:hover { transform: translateX(3px); }
.rec-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--sage-soft); color: var(--sage-deep); }
.rec-icon.terra { background: var(--terra-soft); color: var(--terra-deep); }
.rec-icon.lav { background: var(--lav-soft); color: #7A77A0; }
.rec strong { display: block; font-weight: 600; }
.rec span { font-size: .85rem; color: var(--muted); display: block; line-height: 1.45; }
.rec .go { margin-left: auto; color: var(--muted); }

/* ---------- Odysseys ---------- */
.ody-grid { display: grid; gap: 14px; margin-top: 4px; }
@media (min-width: 640px) { .ody-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .ody-grid { grid-template-columns: repeat(3, 1fr); } }
.ody-card { padding: 0; overflow: hidden; cursor: pointer; text-align: left; border: 1px solid var(--glass-border); display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s; }
.ody-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ody-art { height: 112px; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--oc), color-mix(in srgb, var(--oc) 40%, var(--lav))); }
.ody-art::before, .ody-art::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.22); }
.ody-art::before { width: 140px; height: 140px; right: -30px; top: -50px; }
.ody-art::after { width: 80px; height: 80px; left: 20px; bottom: -40px; background: rgba(255,255,255,.15); }
.ody-art .dur { position: absolute; left: 14px; top: 12px; font-size: .74rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.14); padding: 3px 10px; border-radius: 99px; display: flex; gap: 5px; align-items: center; }
.ody-art .dur .ic { width: 14px; height: 14px; }
.ody-art .play { position: absolute; right: 14px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(0,0,0,.3); }
.ody-art .play .ic { width: 18px; height: 18px; margin-left: 2px; }
.ody-body { padding: 16px 18px 18px; }
.ody-body h3 { margin: 0 0 4px; }
.ody-body p { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.ody-done { color: var(--sage-deep); font-size: .74rem; font-weight: 700; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.ody-done .ic { width: 14px; height: 14px; }

.timer-ring { position: relative; width: min(64vw, 250px); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.tr-fg { fill: none; stroke: var(--sage); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset 1s linear; }
.timer-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-text span { font-size: 2.6rem; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer-text small { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.ody-stage { gap: 26px; align-content: center; }
.ody-line { text-align: center; font-size: 1.25rem; line-height: 1.55; max-width: 520px; margin: 0 auto; min-height: 4.6em; padding: 0 10px; transition: opacity .8s var(--ease), transform .8s var(--ease); font-weight: 500; }
.ody-line.fade { opacity: 0; transform: translateY(6px); }
.play-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; background: var(--sage); color: #fff; display: grid; place-items: center; box-shadow: 0 14px 34px -12px var(--sage); transition: transform .25s var(--ease); }
.play-btn:active { transform: scale(.94); }
.play-btn .ic { width: 28px; height: 28px; }
.icon-btn.off { opacity: .45; }

/* ---------- Jar ---------- */
.jar-layout { display: grid; gap: 16px; }
@media (min-width: 760px) { .jar-layout { grid-template-columns: 280px 1fr; align-items: stretch; } }
.jar-visual { padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); }
.jar-svg { width: 170px; height: auto; }
.jar-svg .star { animation: twinkle 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.jar-svg .star.drop { animation: drop 1.1s cubic-bezier(.3,.7,.3,1) both, twinkle 3.5s ease-in-out 1.1s infinite; }
@keyframes twinkle { 0%, 100% { opacity: .95; } 50% { opacity: .55; } }
@keyframes drop { from { transform: translateY(-140px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.jar-count { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.jar-count strong { color: var(--ink); font-size: 1.1rem; }
.jar-form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.jar-prompt { font-size: 1.2rem; font-weight: 500; margin: 0; line-height: 1.45; }
.jar-form .seg { margin: 4px 0 0; align-self: flex-start; }
.jar-form .link-soft { align-self: flex-start; }
textarea, input[type="text"], input[type="email"], input[type="password"], input:not([type]), select {
  width: 100%; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); border-radius: var(--radius-xs);
  padding: 12px 14px; font-size: 1rem; transition: border-color .3s, box-shadow .3s; resize: vertical;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
select { width: auto; padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; font-size: .9rem; }
.notes { columns: 1; column-gap: 14px; }
@media (min-width: 640px) { .notes { columns: 2; } }
@media (min-width: 960px) { .notes { columns: 3; } }
.note { break-inside: avoid; margin-bottom: 14px; padding: 18px 18px 14px; position: relative; animation: viewIn .5s var(--ease) both; }
.note p { margin: 0 0 10px; white-space: pre-wrap; word-wrap: break-word; }
.note footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .76rem; color: var(--muted); }
.note .kind { font-weight: 700; }
.note .del { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; opacity: .6; }
.note .del:hover { opacity: 1; color: var(--danger); }
.note .del .ic { width: 16px; height: 16px; }
.note.k-win { border-left: 3px solid var(--sage); }
.note.k-kind { border-left: 3px solid var(--terra); }
.note.k-grateful { border-left: 3px solid var(--lav); }
.note.highlight { box-shadow: 0 0 0 2px var(--terra), var(--shadow-lg); }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ic { width: 38px; height: 38px; margin: 0 auto 10px; color: var(--sage); opacity: .7; }

/* ---------- Sleep ---------- */
.sound-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .sound-grid { grid-template-columns: repeat(3, 1fr); } }
.sound {
  padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .3s var(--ease), background .4s, border-color .4s;
  border: 1px solid var(--glass-border); text-align: left; position: relative;
}
.sound-head { display: flex; align-items: center; justify-content: space-between; }
.sound .ic { width: 30px; height: 30px; color: var(--sage-deep); }
.sound strong { font-weight: 600; }
.sound .state { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: all .3s; }
.sound .state .ic { width: 14px; height: 14px; opacity: 0; color: #fff; }
.sound.on { background: color-mix(in srgb, var(--sage) 18%, var(--glass)); border-color: color-mix(in srgb, var(--sage) 45%, transparent); }
.sound.on .state { background: var(--sage); border-color: var(--sage); }
.sound.on .state .ic { opacity: 1; }
.sound input[type="range"] { opacity: .35; transition: opacity .3s; }
.sound.on input[type="range"] { opacity: 1; }
.sound .bars { position: absolute; right: 18px; bottom: 54px; display: flex; gap: 3px; height: 16px; align-items: flex-end; opacity: 0; transition: opacity .3s; }
.sound.on .bars { opacity: .7; }
.sound .bars i { width: 3px; background: var(--sage); border-radius: 2px; animation: eq 1.4s ease-in-out infinite; }
.sound .bars i:nth-child(2) { animation-delay: .3s; } .sound .bars i:nth-child(3) { animation-delay: .6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.sleep-controls { padding: 22px; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.timer-read { font-size: 1.6rem; font-weight: 300; margin: 0; font-variant-numeric: tabular-nums; }
.sleep-controls .seg { margin: 4px 0; align-self: stretch; display: grid; grid-template-columns: repeat(5, 1fr); }
.sleep-controls .seg button { padding: 0 4px; }
.vol-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--line); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--sage); box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--sage); cursor: pointer; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background .3s; flex: none; }
.switch-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .35s var(--ease); }
.switch input:checked + .switch-track { background: var(--sage); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2.5px solid var(--sage); outline-offset: 3px; }
.switch-label { font-weight: 600; font-size: .92rem; }

/* Bedtime dimming when sounds play in dark mode */
body.bedtime-dim main { filter: brightness(.82); transition: filter 1.5s; }

/* ---------- PMR ---------- */
.pmr { max-width: 560px; margin: 8px auto 0; }
.pmr-track { position: relative; height: 360px; perspective: 1000px; }
.pmr-card {
  position: absolute; inset: 0; padding: 26px 24px; display: flex; flex-direction: column; text-align: center; align-items: center; justify-content: center;
  transition: transform .7s var(--ease), opacity .7s var(--ease); opacity: 0; pointer-events: none; transform: translateX(40px) scale(.96);
}
.pmr-card.active { opacity: 1; pointer-events: auto; transform: none; }
.pmr-card.prev { transform: translateX(-40px) scale(.96); }
.pmr-step { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pmr-card h2 { font-size: 1.7rem; margin: 6px 0 12px; }
.pmr-phase { display: inline-flex; padding: 5px 14px; border-radius: 99px; font-weight: 700; font-size: .8rem; margin-bottom: 12px; background: var(--terra-soft); color: var(--terra-deep); }
.pmr-phase.release { background: var(--sage-soft); color: var(--sage-deep); }
.pmr-card p { color: var(--ink-2); max-width: 420px; margin: 0 auto 6px; font-size: 1.02rem; }
.pmr-card .pmr-release { color: var(--muted); font-size: .92rem; }
.pmr-meter { width: 120px; height: 120px; margin: 14px auto 0; position: relative; }
.pmr-meter .fill { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--terra-soft), transparent 70%); transform: scale(.5); transition: transform 1s var(--ease), background .6s; }
.pmr-meter.tense .fill { transform: scale(1); background: radial-gradient(circle, color-mix(in srgb, var(--terra) 45%, transparent), transparent 70%); }
.pmr-meter.release .fill { transform: scale(.6); background: radial-gradient(circle, color-mix(in srgb, var(--sage) 45%, transparent), transparent 70%); transition-duration: 4s; }
.pmr-meter span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; font-weight: 300; font-variant-numeric: tabular-nums; }
.pmr-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; }
.pmr-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pmr-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: all .35s var(--ease); }
.pmr-dots button[aria-current="true"] { background: var(--sage); width: 26px; border-radius: 6px; }

/* ---------- Bites ---------- */
.bites { display: grid; gap: 12px; }
@media (min-width: 720px) { .bites { grid-template-columns: 1fr 1fr; } }
.bite { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.bite h3 { margin: 0; font-size: 1rem; }
.bite p { margin: 0; color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; }
.bite .row { margin-top: auto; }
.bite .icon-btn { width: 40px; height: 40px; }
.bite .fav[aria-pressed="true"] { color: var(--terra); }
.bite.playing { box-shadow: 0 0 0 2px var(--sage), var(--shadow-lg); }

/* ---------- Account ---------- */
.auth-card { padding: 22px; max-width: 460px; }
.auth-card .seg { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.field > span { padding-left: 2px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--sage); }
.form-msg { margin: 0; min-height: 0; font-size: .88rem; color: var(--danger); }
.form-msg.ok { color: var(--sage-deep); }
.form-msg:empty { display: none; }
.guest-progress { padding: 20px; margin-top: 16px; max-width: 460px; }
.profile-head { display: flex; align-items: center; gap: 18px; padding: 22px; margin-top: 18px; }
.profile-head h1 { font-size: 1.5rem; margin: 0; }
.profile-head p { margin: 0; }
.avatar-lg { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; color: #fff; flex: none; box-shadow: 0 10px 24px -10px currentColor; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 640px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; text-align: center; display: flex; flex-direction: column; }
.stat strong { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--sage-deep); }
.stat span { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 640px) { .badge-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .badge-grid { grid-template-columns: repeat(4, 1fr); } }
.badge { padding: 16px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid var(--glass-border); cursor: default; position: relative; }
.badge .b-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: linear-gradient(140deg, var(--sage-soft), var(--terra-soft)); }
.badge.earned .b-icon { background: linear-gradient(140deg, var(--sage), var(--terra)); box-shadow: 0 10px 24px -10px var(--sage); }
.badge.locked { opacity: .62; }
.badge.locked .b-icon { filter: grayscale(1); opacity: .6; }
.badge strong { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.badge small { font-size: .74rem; color: var(--muted); line-height: 1.4; }
.badge .b-bar { width: 80%; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 2px; }
.badge .b-bar i { display: block; height: 100%; background: var(--sage); border-radius: 99px; }
.badge.earned { cursor: pointer; transition: transform .3s var(--ease); }
.badge.earned:hover { transform: translateY(-3px); }
.badge .b-share { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.badge .b-share .ic { width: 16px; height: 16px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--bg); cursor: pointer; box-shadow: 0 0 0 1px var(--line); transition: transform .25s var(--ease); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.1); }

/* ---------- Support ---------- */
.donate-card { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.amounts button { height: 58px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--glass); font-weight: 700; font-size: 1.1rem; cursor: pointer; transition: all .3s var(--ease); }
.amounts button[aria-pressed="true"] { background: var(--terra); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -12px var(--terra); transform: translateY(-2px); }
.goal-bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.goal-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--sage), var(--terra)); transition: width 1.4s var(--ease); }
.soft-list { padding-left: 1.1em; color: var(--ink-2); }
.soft-list li { margin-bottom: 6px; }
.thanks { max-width: 560px; font-weight: 500; text-align: center; }

/* ---------- About / prose ---------- */
.prose { max-width: 720px; }
.prose p { white-space: pre-line; color: var(--ink-2); }
.help-card { border-left: 4px solid var(--terra); }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 46px 10px 10px; color: var(--muted); font-size: .86rem; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.site-footer p { margin: 0; }
.site-footer .links a { color: var(--ink-2); text-decoration: none; }
.site-footer .links a:hover { text-decoration: underline; }
.site-footer .btn { margin-top: 10px; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(20, 27, 24, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .4s var(--ease) both; }
.modal-card { width: 100%; max-width: 440px; padding: 30px 24px 24px; position: relative; background: var(--glass-strong); text-align: center; max-height: calc(100vh - 36px); overflow-y: auto; animation: pop .55s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; }
.modal-card h2 { font-size: 1.45rem; margin-bottom: .3em; padding: 0 34px; }
.modal-card .big-emoji { font-size: 3.4rem; line-height: 1; margin: 6px 0 12px; animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.modal-card .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.share-preview { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow); margin: 6px 0 14px; }
.share-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-links a, .share-links button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--radius-xs); border: 1px solid var(--line); background: var(--glass); text-decoration: none; color: var(--ink-2); font-size: .72rem; font-weight: 600; cursor: pointer; }
.share-links .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .85rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .45s var(--ease) both; max-width: calc(100vw - 36px); text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 960px) { .toast { bottom: 30px; } }

/* ---------- Simple pages (install, reset, share) ---------- */
.plain-page { display: grid; place-items: center; min-height: 100vh; padding: 20px;
  background: radial-gradient(90% 60% at 20% 0%, var(--sage-soft), transparent 60%), radial-gradient(80% 60% at 100% 100%, var(--lav-soft), transparent 60%), var(--bg); }
.plain-wrap { width: 100%; max-width: 480px; }
.plain-wrap .brand-mark { width: 46px; height: 46px; margin-bottom: 16px; }
.notice { padding: 10px 14px; border-radius: var(--radius-xs); font-size: .9rem; }
.notice-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.share-card { text-align: center; padding: 34px 26px; }
.share-card .big-emoji { font-size: 4rem; margin-bottom: 10px; }
.share-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.share-badges div { padding: 12px 6px; border-radius: var(--radius-sm); background: var(--sage-soft); font-size: .72rem; font-weight: 600; }
.share-badges div span { display: block; font-size: 1.6rem; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
  .orb-core, .orb-glow { transition-duration: 1.5s !important; }
}

/* ---------- v1.1 additions ---------- */
.len-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: .74rem; font-weight: 700; color: var(--terra-deep); background: var(--terra-soft); padding: 4px 10px; border-radius: 99px; }
.len-badge .ic { width: 14px; height: 14px; }
.breath-item .row.between { align-items: flex-start; gap: 10px; }
#breath-count { margin: 0 2px 10px; }
.bo-cue { text-align: center; max-width: 460px; margin: 0 auto 8px; min-height: 3.2em; padding: 0 16px; color: var(--ink-2); font-size: 1.02rem; line-height: 1.55; transition: opacity .7s var(--ease), transform .7s var(--ease); }
.bo-cue.fade { opacity: 0; transform: translateY(6px); }
.sound-desc { display: block; font-size: .76rem; color: var(--muted); line-height: 1.35; margin-top: -6px; }
.sound .bars { bottom: auto; top: 24px; right: 56px; }

/* ---------- Mobile fit fix (v1.2.1) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; }

#zen-canvas {
  position: fixed; inset: 0;
  width: 100% !important; height: 100% !important;
  max-width: 100vw; pointer-events: none; z-index: 0;
}

img, video, iframe { max-width: 100%; height: auto; }
.app, main, .view, .topbar, .tabbar, footer { max-width: 100%; min-width: 0; }
.topbar { flex-wrap: nowrap; min-width: 0; }
.brand { min-width: 0; }
pre, code, .seo-article, .glass { overflow-wrap: anywhere; }

@media (max-width: 420px) {
  .topbar { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .topbar-actions { gap: 6px; }
  .icon-btn, .avatar-btn { width: 38px; height: 38px; }
  main { padding-left: 14px; padding-right: 14px; }
  .hero { padding-top: 16px; }
  .pause-wrap { padding: 20px 0 24px; }
}
