/* ───────── Tokens ───────── */
:root {
  --bg: #F3F0E8;
  --card: #FBFAF6;
  --card-2: #ECE9DF;
  --ink: #25302A;
  --ink-2: #4A584C;
  --muted: #636D60;
  --line: rgba(37, 48, 42, .08);
  --sage: #7E9C78;
  --sage-deep: #4D6A4B;
  --sage-soft: #D9E4D2;
  --sage-tint: #E8EEE3;
  --sand: #D9BE92;
  --clay: #C4876A;
  --fig-ink: #3F5539;
  --fig-soft: #A3B89B;
  --mat: #DDD5C4;
  --mat-top: #E9E2D3;
  --on-accent: #FBFAF6;
  --shadow: 0 1px 2px rgba(37, 48, 42, .04), 0 10px 30px -14px rgba(37, 48, 42, .22);
  --r-xl: 32px; --r-lg: 26px; --r-md: 20px; --r-sm: 14px;
  --font-display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121812;
    --card: #1B231B;
    --card-2: #232D22;
    --ink: #E8EEE3;
    --ink-2: #C3CEBD;
    --muted: #8C9887;
    --line: rgba(232, 238, 227, .08);
    --sage: #9CB894;
    --sage-deep: #A9C6A0;
    --sage-soft: #2E3D2D;
    --sage-tint: #243024;
    --sand: #D9BE92;
    --fig-ink: #DCE7D5;
    --fig-soft: #7E9877;
    --mat: #37433A;
    --mat-top: #29332A;
    --on-accent: #142014;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ───────── Base ───────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p, ol, ul { margin: 0; }
svg { display: block; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Layout ───────── */
.view {
  min-height: 100dvh;
  padding: calc(var(--safe-t) + 20px) 20px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  max-width: 560px;
  margin: 0 auto;
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 22px; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.display { font-family: var(--font-display); font-weight: 500; font-size: 40px; line-height: 1.05; letter-spacing: -.01em; }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.15; }
.section-title { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 28px 4px 12px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title small { font-weight: 500; color: var(--muted); font-size: 13px; }

.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }

/* ───────── Controls ───────── */
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink-2);
  flex: none; transition: transform .15s ease;
}
.icon-btn:active { transform: scale(.94); }

.btn-primary {
  width: 100%; height: 60px; border-radius: 999px;
  background: var(--sage-deep); color: var(--on-accent);
  font-size: 18px; font-weight: 650; letter-spacing: .01em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 12px 24px -12px rgba(77, 106, 75, .7);
  transition: transform .15s ease, filter .15s ease;
}
.btn-primary:active { transform: scale(.98); filter: brightness(.95); }
.btn-primary .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.btn-ghost {
  height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--sage-tint); color: var(--sage-deep); font-weight: 650; font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost .ic { width: 18px; height: 18px; }
.btn-danger { color: #B4513E; font-weight: 650; padding: 10px 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--sage-tint); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.chip.lvl-i { background: color-mix(in srgb, var(--sand) 30%, transparent); }
.chip .ic { width: 15px; height: 15px; stroke-width: 2; }
.ic.fill { fill: currentColor; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); display: inline-block; }
.dot.i { background: var(--sand); }
.dot.a { background: var(--clay); }
.chip.lvl-a { background: color-mix(in srgb, var(--clay) 22%, transparent); }

.seg { display: flex; background: var(--card-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button {
  flex: 1; height: 42px; border-radius: 999px; font-weight: 650; font-size: 15px; color: var(--muted);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; }
.seg button[disabled] { opacity: .5; cursor: not-allowed; }
.seg button .ic { width: 15px; height: 15px; stroke-width: 2; }
.fine-s { color: var(--s-muted, var(--muted)); font-size: 13.5px; }
.seg.small button { height: 40px; font-size: 14px; }
@media (max-width: 360px) { .seg.small button { font-size: 13px; } }

.label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 4px 10px; display: block; }

/* ───────── Tab bar ───────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 6px;
  padding: 8px 16px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; max-width: 140px; height: 48px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; font-weight: 650; color: var(--muted);
  transition: color .2s ease, background .2s ease;
}
.tab .ic { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--sage-deep); }
.tab[aria-current="page"] .tab-ic { background: var(--sage-tint); }
.tab-ic { width: 52px; height: 28px; border-radius: 999px; display: grid; place-items: center; transition: background .2s ease; }

/* ───────── Today ───────── */
.hero { padding: 22px; position: relative; overflow: hidden; }
.hero-art {
  width: 100%; aspect-ratio: 1.45; border-radius: var(--r-md);
  background: radial-gradient(120% 90% at 50% 100%, var(--sage-soft), var(--sage-tint) 60%, transparent);
  display: grid; place-items: center; margin-bottom: 18px; position: relative;
}
.hero-art .fig { width: 78%; }
.hero-art::after {
  content: ""; position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: color-mix(in srgb, var(--sand) 35%, transparent); top: 10%; right: 10%; z-index: 0; filter: blur(2px);
}
.hero-art .fig { position: relative; z-index: 1; }
.hero h2 { margin-bottom: 4px; }
.hero p.sub { color: var(--muted); margin-bottom: 14px; font-size: 15px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 44px; margin-bottom: 16px; text-align: left; }
.chip-edit { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sage-soft); color: var(--sage-deep); }

.full25 { width: 100%; display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px 16px 16px 18px; text-align: left; transition: transform .15s ease; }
.full25:active, .adv-card:active { transform: scale(.98); }
.full25-ic { width: 50px; height: 50px; border-radius: 18px; background: var(--sage-tint); color: var(--sage-deep); display: grid; place-items: center; flex: none; }
.full25-ic .ic { width: 26px; height: 26px; }
.full25-txt { flex: 1; min-width: 0; }
.full25-txt b { display: block; font-size: 17px; }
.full25-txt span { color: var(--muted); font-size: 14px; }
.full25-go { width: 48px; height: 48px; border-radius: 50%; background: var(--sage-deep); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.full25-go .ic { width: 20px; height: 20px; }

.adv-card { width: 100%; display: block; text-align: left; margin-top: 16px; transition: transform .15s ease; }
.adv-head { display: flex; align-items: center; gap: 14px; }
.adv-ic { width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--sand) 35%, transparent); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.adv-head b { display: block; font-size: 16px; }
.adv-head span { color: var(--muted); font-size: 14px; }
.adv-bar { height: 8px; border-radius: 4px; background: var(--card-2); margin: 16px 0 12px; overflow: hidden; }
.adv-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--sage), var(--sand)); }
.adv-note { font-size: 14px; color: var(--muted); }
.adv-note b { color: var(--ink-2); }

.streak { margin-top: 16px; }
.streak-row { display: flex; align-items: center; gap: 16px; }
.streak-num {
  width: 64px; height: 64px; border-radius: 22px; flex: none;
  background: var(--sage-tint); color: var(--sage-deep);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 30px; font-weight: 500;
}
.streak-text b { display: block; font-size: 17px; }
.streak-text span { color: var(--muted); font-size: 14px; }
.week { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.week span {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card-2); color: var(--muted); font-size: 13px; font-weight: 700;
}
.week span.on { background: var(--sage); color: var(--on-accent); }
.week span.today { box-shadow: inset 0 0 0 2px var(--sage); }
.week span.on.today { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--sage); }
@media (max-width: 360px) { .week span { width: 32px; height: 32px; } }

.focus-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.focus-tile {
  background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left;
  transition: transform .15s ease;
}
.focus-tile:active { transform: scale(.97); }
.focus-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-deep); display: grid; place-items: center; }
.focus-tile b { font-size: 15.5px; display: block; }
.focus-tile span { font-size: 13px; color: var(--muted); }

/* ───────── Sheets ───────── */
.sheet-root { position: fixed; inset: 0; z-index: 40; }
.backdrop { position: absolute; inset: 0; background: rgba(18, 26, 18, .38); opacity: 0; transition: opacity .3s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 600px;
  max-height: calc(100dvh - var(--safe-t) - 18px);
  background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .25);
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column;
}
.sheet-root.open .backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: translateY(0); }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--card-2); margin: 10px auto 0; flex: none; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 20px calc(24px + var(--safe-b)); overscroll-behavior: contain; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 4px; }
.sheet-close { width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; color: var(--ink-2); }
.sheet-close .ic { width: 18px; height: 18px; }

/* Setup */
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.focus-opt {
  background: var(--card); border-radius: var(--r-md); padding: 14px 6px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--ink-2); text-align: center; line-height: 1.2;
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s ease, background .2s ease;
}
.focus-opt .focus-ic { width: 42px; height: 42px; }
.focus-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--sage); background: var(--sage-tint); color: var(--ink); }
.focus-opt[aria-pressed="true"] .focus-ic { background: var(--sage); color: var(--on-accent); }

.preview { margin-top: 24px; background: var(--card); border-radius: var(--r-lg); padding: 16px 16px 6px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.preview-head b { font-size: 17px; }
.preview-head span { display: block; color: var(--muted); font-size: 13.5px; }
.plist { list-style: none; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.plist li:first-child { border-top: 0; }
.plist .mini { width: 54px; height: 45px; border-radius: 12px; background: var(--sage-tint); flex: none; padding: 2px; }
.plist .pname { font-weight: 600; font-size: 15px; line-height: 1.25; }
.plist .pmeta { color: var(--muted); font-size: 12.5px; }
.plist .phase-tag { margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sheet-cta { position: sticky; bottom: 0; padding-top: 16px; background: linear-gradient(transparent, var(--bg) 30%); margin-top: 8px; }

/* Pose detail */
.pd-art { background: radial-gradient(120% 90% at 50% 100%, var(--sage-soft), var(--sage-tint) 65%); border-radius: var(--r-lg); padding: 14px 18px 8px; margin-top: 8px; }
.pd-art .fig { width: 100%; max-height: 240px; }
.pd-title { margin: 18px 2px 4px; }
.pd-sk { color: var(--muted); font-style: italic; font-family: var(--font-display); font-size: 16px; }
.pd-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.breath-card { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--r-md); padding: 14px 16px; margin-top: 14px; }
.breath-card .bc-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: radial-gradient(circle, color-mix(in srgb, var(--sage) 55%, transparent), var(--sage-tint) 70%); color: var(--sage-deep); }
.breath-card b { display: block; font-size: 15px; }
.breath-card span { color: var(--muted); font-size: 13.5px; }
.pd h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 24px 2px 10px; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 40px; font-size: 15.5px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-deep);
  display: grid; place-items: center; font-weight: 700; font-size: 13.5px;
}
.pd p.note { background: var(--card); border-radius: var(--r-md); padding: 14px 16px; font-size: 15px; color: var(--ink-2); }
.targets { display: flex; gap: 8px; flex-wrap: wrap; }

/* Multi-frame figures animate gently outside of a session */
.fig.multi.anim .f0 { animation: figA 7s ease-in-out infinite; }
.fig.multi.anim .f1 { animation: figB 7s ease-in-out infinite; }
@keyframes figA { 0%, 38% { opacity: 1; } 50%, 88% { opacity: 0; } 100% { opacity: 1; } }
@keyframes figB { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.fig.multi:not(.anim) .f1 { display: none; }

/* Figure strokes */
.fig-near, .fig-far { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3.6; }
.fig-near { stroke: var(--fig-ink); }
.fig-far { stroke: var(--fig-soft); }
.fig-head { fill: var(--fig-ink); }
.fig-mat, .fig-wall { fill: var(--mat); }
.fig-mat-top { fill: var(--mat-top); }
.fig-prop { stroke: var(--clay); stroke-width: 1.8; stroke-dasharray: 2.5 2.5; stroke-linecap: round; }

/* ───────── Library ───────── */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px; padding: 0 18px; height: 50px; box-shadow: var(--shadow); color: var(--muted); }
.search input { flex: 1; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--muted); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin: 16px -20px 0; padding: 2px 20px 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); height: 40px; padding: 0 16px; font-size: 14px; }
.chip-row .chip[aria-pressed="true"] { background: var(--sage-deep); color: var(--on-accent); box-shadow: none; }
.lib-level { margin-top: 12px; }
.pose-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
@media (min-width: 520px) { .pose-grid { grid-template-columns: repeat(3, 1fr); } }
.pose-card { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 8px 8px 12px; text-align: left; transition: transform .15s ease; }
.pose-card:active { transform: scale(.97); }
.pc-art { background: var(--sage-tint); border-radius: 14px; aspect-ratio: 1.2; display: grid; place-items: center; padding: 4px; }
.pc-art .fig { width: 100%; }
.pc-art { position: relative; }
.pose-card.locked .pc-art .fig { opacity: .35; filter: grayscale(1); }
.pc-lock { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--card); color: var(--ink-2); display: grid; place-items: center; box-shadow: var(--shadow); }
.pc-lock .ic { width: 16px; height: 16px; }
.lock-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--sand) 30%, transparent); font-weight: 650; font-size: 14px; color: var(--ink-2); }
.lock-note .ic { width: 16px; height: 16px; }
.pc-name { font-weight: 650; font-size: 14.5px; margin: 10px 4px 2px; line-height: 1.25; }
.pc-meta { color: var(--muted); font-size: 12.5px; margin: 0 4px; display: flex; align-items: center; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ───────── Progress ───────── */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 16px 18px; }
.stat b { font-family: var(--font-display); font-weight: 500; font-size: 34px; line-height: 1.1; display: block; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head b { font-size: 17px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; color: var(--ink-2); }
.cal-nav .ic { width: 18px; height: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 0; text-align: center; }
.cal-grid .wd { font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-grid .d { height: 38px; display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.cal-grid .d span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.cal-grid .d.on span { background: var(--sage); color: var(--on-accent); }
.cal-grid .d.today span { box-shadow: inset 0 0 0 2px var(--sage); }
.cal-grid .d.future { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.hist { list-style: none; padding: 0; }
.hist li { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.hist .h-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-deep); display: grid; place-items: center; flex: none; }
.hist b { display: block; font-size: 15px; }
.hist span { color: var(--muted); font-size: 13px; }
.hist .h-min { margin-left: auto; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

/* ───────── Settings ───────── */
.set-group { background: var(--card); border-radius: var(--r-md); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.set-row:first-child { border-top: 0; }
.set-row .txt { flex: 1; }
.set-row b { display: block; font-size: 15.5px; font-weight: 600; }
.set-row span { color: var(--muted); font-size: 13px; }
.switch { width: 52px; height: 32px; border-radius: 999px; background: var(--card-2); position: relative; flex: none; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .22s cubic-bezier(.3, .7, .3, 1); }
.switch[aria-checked="true"] { background: var(--sage); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.fine { color: var(--muted); font-size: 13.5px; margin: 12px 4px 0; }

/* ───────── Session ───────── */
.session {
  position: fixed; inset: 0; z-index: 60;
  --fig-ink: #E6EEE0; --fig-soft: #86A07F; --mat: #344134; --mat-top: #283228;
  --s-ink: #EEF3EA; --s-muted: #9EAE98;
  background: radial-gradient(120% 80% at 50% 30%, #2B392B 0%, #182018 60%, #111711 100%);
  color: var(--s-ink);
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 10px) 20px calc(var(--safe-b) + 14px);
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; will-change: opacity; z-index: 0; }
.glow-in {
  box-shadow: inset 0 0 16vmin 4vmin rgba(146, 200, 132, .85);
  background: radial-gradient(ellipse at center, transparent 55%, rgba(146, 200, 132, .22) 100%);
}
.glow-hold {
  box-shadow: inset 0 0 16vmin 4vmin rgba(232, 196, 132, .85);
  background: radial-gradient(ellipse at center, transparent 55%, rgba(232, 196, 132, .22) 100%);
}
.session > *:not(.glow) { position: relative; z-index: 1; }
.s-top { display: flex; align-items: center; gap: 12px; height: 48px; flex: none; }
.s-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: var(--s-ink); flex: none; }
.s-btn .ic { width: 20px; height: 20px; }
.s-bar { flex: 1; display: flex; gap: 4px; }
.s-bar i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; display: block; }
.s-bar i b { display: block; height: 100%; width: 0; background: #CFE0C7; border-radius: 2px; }
.s-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 0; padding: 4px 0; }
.s-phase { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s-muted); }
.s-name { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 7.5vw, 34px); line-height: 1.1; margin: 6px 0 2px; }
.s-side { font-size: 15px; font-weight: 650; color: #D8C59E; min-height: 22px; }
.s-ring { position: relative; width: min(66vw, 36dvh, 300px); aspect-ratio: 1; margin: 14px 0 10px; flex: none; }
.s-ring svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: rgba(255, 255, 255, .1); }
.ring .prog { stroke: #CFE0C7; stroke-linecap: round; transition: stroke .4s ease; }
.ring .prog.ready { stroke: #D8C59E; }
.s-fig { position: absolute; inset: 13%; border-radius: 50%; background: radial-gradient(circle at 50% 70%, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02) 70%); display: grid; place-items: center; transition: transform .2s linear; }
.s-fig .fig { width: 92%; }
.s-time { font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1; }
.s-breath { margin-top: 12px; height: 40px; flex: none; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .08); display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; cursor: default; transition: background .3s ease, color .3s ease; }
.s-breath .bd { width: 10px; height: 10px; border-radius: 50%; background: #A8D19A; transition: background .3s ease, transform .2s linear; }
.s-breath.hold .bd { background: #E8C484; }
.s-breath .cnt { color: var(--s-muted); font-variant-numeric: tabular-nums; min-width: 1ch; }
.s-breath.go { background: #E6EEE0; color: #1C251C; cursor: pointer; }
.s-breath.go .bd { background: #5E8A55; }
.s-breath.go:active { transform: scale(.96); }
.s-steps { flex: none; max-height: 24dvh; overflow-y: auto; background: rgba(255, 255, 255, .06); border-radius: var(--r-md); padding: 14px 16px 4px; margin-bottom: 12px; text-align: left; -webkit-overflow-scrolling: touch; }
.s-steps .steps li { font-size: 14.5px; padding-bottom: 10px; color: #DCE5D6; }
.s-steps .steps li::before { background: rgba(255, 255, 255, .1); color: #CFE0C7; width: 24px; height: 24px; font-size: 12px; }
.s-steps .steps li { padding-left: 34px; }
.s-tip { font-size: 13.5px; color: var(--s-muted); padding-bottom: 10px; }
.s-controls { display: flex; align-items: center; justify-content: center; gap: 28px; flex: none; }
.s-controls .s-btn { width: 54px; height: 54px; }
.s-play { width: 74px; height: 74px; border-radius: 50%; background: #E6EEE0; color: #1C251C; display: grid; place-items: center; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); transition: transform .15s ease; }
.s-play:active, .s-btn:active { transform: scale(.94); }
.s-play .ic { width: 28px; height: 28px; stroke-width: 2.2; }
.paused .s-time { opacity: .5; }

@media (max-height: 700px) {
  .s-steps { max-height: 18dvh; }
  .s-time { font-size: 36px; }
  .s-ring { margin: 8px 0 6px; }
}

.s-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(10, 14, 10, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 24px; }
.s-dialog { background: #1F291F; border-radius: var(--r-lg); padding: 24px; width: 100%; max-width: 340px; text-align: center; }
.s-dialog h3 { font-family: var(--font-display); font-weight: 500; font-size: 24px; margin-bottom: 8px; }
.s-dialog p { color: var(--s-muted); margin-bottom: 20px; font-size: 15px; }
.s-dialog .row { display: flex; gap: 10px; }
.s-dialog button { flex: 1; height: 50px; border-radius: 999px; font-weight: 650; }
.s-dialog .keep { background: #E6EEE0; color: #1C251C; }
.s-dialog .end { background: rgba(255, 255, 255, .1); color: var(--s-ink); }

.s-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; animation: fadeUp .5s ease both; }
.s-done .badge { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(168, 209, 154, .35), rgba(168, 209, 154, .05) 70%); color: #CFE0C7; margin-bottom: 14px; }
.s-done .badge .ic { width: 46px; height: 46px; stroke-width: 1.6; }
.s-done h2 { font-family: var(--font-display); font-weight: 500; font-size: 36px; }
.s-done p { color: var(--s-muted); font-size: 16px; max-width: 280px; }
.s-done .sum { display: flex; gap: 10px; margin: 24px 0 30px; }
.s-done .sum div { background: rgba(255, 255, 255, .07); border-radius: var(--r-md); padding: 14px 16px; min-width: 92px; }
.s-done .sum b { display: block; font-size: 26px; font-family: var(--font-display); font-weight: 500; }
.s-done .sum span { font-size: 12.5px; color: var(--s-muted); font-weight: 600; }
.s-done .btn-primary { max-width: 320px; background: #E6EEE0; color: #1C251C; box-shadow: none; }
.s-done .sum-gap { height: 24px; }
.unlock { background: rgba(232, 196, 132, .12); border: 1px solid rgba(232, 196, 132, .35); border-radius: var(--r-md); padding: 16px; margin: -10px 0 24px; width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.unlock > b { color: #E8C484; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.unlock-poses { display: flex; gap: 12px; justify-content: center; }
.unlock-poses div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; width: 120px; }
.unlock-poses .mini { width: 84px; height: 70px; border-radius: 14px; background: rgba(255, 255, 255, .06); display: block; padding: 4px; }
.unlock .btn-ghost { background: rgba(255, 255, 255, .1); color: var(--s-ink); }
