:root {
  --ink: #17133f;
  --ink-2: #2a2270;
  --ink-3: #1c1650;
  --paper: #fff6e3;
  --sun: #ffd23f;
  --orange: #ff7a1a;
  --pink: #ff3d7f;
  --violet: #6b4bff;
  --mint: #2ee6b8;
  --sky: #3da5ff;
  --lav: #c7b6ff;
  --white: #ffffff;
  --radius: 22px;
  --head: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --text: 'DM Sans', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  background: var(--ink);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--head); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.wrap { max-width: 540px; margin: 0 auto; padding: 0 16px; }
.screen { min-height: 100vh; min-height: 100dvh; padding-top: calc(var(--safe-t) + 14px); padding-bottom: calc(var(--safe-b) + 40px); }
.screen[hidden] { display: none; }

/* ---------- figure colours ---------- */
.t-morning {
  --f-bg: #ffd23f; --f-deco: #ffe991; --f-mat: #ff7a1a; --f-prop: #fff6e3;
  --f-skin: #f5b48f; --f-skin2: #d9946e; --f-shirt: #ff3d7f; --f-shirt2: #cf2b63;
  --f-pants: #3b2fc9; --f-pants2: #2a2196; --f-shoe: #17133f; --f-shoe2: #17133f;
  --f-hair: #2b1a12; --f-eye: #17133f; --f-strap: #3da5ff; --f-focus: #17133f;
}
.t-evening {
  --f-bg: #2d2580; --f-deco: #4a40b8; --f-mat: #6b4bff; --f-prop: #c7b6ff;
  --f-skin: #f5b48f; --f-skin2: #d9946e; --f-shirt: #2ee6b8; --f-shirt2: #1fae8b;
  --f-pants: #ff6fb1; --f-pants2: #d24e8d; --f-shoe: #0f0c2e; --f-shoe2: #0f0c2e;
  --f-hair: #2b1a12; --f-eye: #17133f; --f-strap: #ffd23f; --f-focus: #ffd23f;
}
.fig { display: block; width: 100%; height: 100%; }
.fig line, .fig path[class^='s-'] { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fig .s-skin { stroke: var(--f-skin); }
.fig .s-skin.far { stroke: var(--f-skin2); }
.fig .s-shirt { stroke: var(--f-shirt); }
.fig .s-shirt.far { stroke: var(--f-shirt2); }
.fig .s-pants { stroke: var(--f-pants); }
.fig .s-pants.far { stroke: var(--f-pants2); }
.fig .s-shoe { stroke: var(--f-shoe); }
.fig .s-strap { stroke: var(--f-strap); }
.fig .f-skin { fill: var(--f-skin); }
.fig .f-skin.far { fill: var(--f-skin2); }
.fig .f-hair { fill: var(--f-hair); }
.fig .f-eye { fill: var(--f-eye); }
.fig .f-bg { fill: var(--f-bg); }
.fig .f-deco { fill: var(--f-deco); }
.fig .f-mat { fill: var(--f-mat); }
.fig .f-prop { fill: var(--f-prop); }
.fig .focus circle {
  fill: var(--f-focus); fill-opacity: 0.16; stroke: var(--f-focus); stroke-width: 1.4; stroke-dasharray: 2.6 2.2;
  transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(0.82); opacity: 0.55; } 50% { transform: scale(1.12); opacity: 1; } }

/* ---------- home ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
.brand svg { width: 34px; height: 34px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  font-weight: 700; font-size: 14px; background: var(--pink); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 #0b0826;
}
.pill-btn svg { width: 18px; height: 18px; }
.hello h1 { font-size: clamp(36px, 10vw, 48px); font-weight: 800; }
.hello h1 em { font-style: normal; color: var(--sun); }
.hello p { margin-top: 10px; color: var(--lav); font-size: 17px; max-width: 30ch; }

.streak {
  margin: 24px 0 18px; background: var(--mint); color: var(--ink); border-radius: var(--radius);
  padding: 18px 18px 16px; border: 2.5px solid var(--ink); box-shadow: 5px 5px 0 #0b0826;
}
.streak-row { display: flex; align-items: center; gap: 14px; }
.streak-num { font-family: var(--head); font-weight: 800; font-size: 54px; line-height: 0.9; }
.streak-txt b { display: block; font-family: var(--head); font-size: 20px; line-height: 1.1; }
.streak-txt span { font-size: 14px; }
.flame { width: 40px; height: 48px; flex: none; margin-left: auto; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.day { text-align: center; font-size: 12px; font-weight: 700; border-radius: 12px; padding: 6px 0 7px; }
.day.today { background: var(--ink); color: var(--white); }
.dots { display: flex; justify-content: center; gap: 4px; margin-top: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; opacity: 0.45; }
.dot.m.on { background: var(--sun); border-color: var(--ink); opacity: 1; }
.dot.e.on { background: var(--violet); border-color: var(--ink); opacity: 1; }
.day.today .dot.on { border-color: var(--white); }
.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 2px solid var(--ink); }

.tiles { display: grid; gap: 16px; }
.tile {
  position: relative; display: grid; grid-template-columns: 1fr 38%; align-items: stretch; text-align: left;
  border-radius: var(--radius); overflow: hidden; border: 2.5px solid var(--ink); box-shadow: 5px 5px 0 #0b0826;
  min-height: 168px; transition: transform 0.15s ease, box-shadow 0.15s ease; text-decoration: none;
}
.tile:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #0b0826; }
.tile.morning { background: linear-gradient(135deg, var(--sun) 0%, #ffb23f 55%, var(--orange) 100%); color: var(--ink); }
.tile.evening { background: linear-gradient(135deg, var(--violet) 0%, #4a36d6 60%, var(--ink-2) 100%); color: var(--white); }
.tile-txt { padding: 18px 8px 18px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.tile-when { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.tile h2 { font-size: clamp(21px, 6.8vw, 32px); font-weight: 800; white-space: nowrap; }
.tile-meta { font-size: 14px; font-weight: 600; opacity: 0.9; }
.tile-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; }
.tile-go svg { width: 18px; height: 18px; }
.tile-art { position: relative; }
.tile-art .fig { position: absolute; inset: 0; height: 100%; }
.tile-art .fig .f-bg, .tile-art .fig .f-deco { fill: transparent; }
.tile-art .fig .focus { display: none; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--sun); }
.tile.evening .badge { background: var(--mint); color: var(--ink); }
.done-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; background: var(--white); color: var(--ink); }
.done-tag svg { width: 12px; height: 12px; }

.section-title { font-size: 22px; font-weight: 800; margin: 34px 0 12px; }
.tips { display: grid; gap: 10px; }
.tip { display: flex; gap: 12px; align-items: flex-start; background: var(--ink-2); border-radius: 18px; padding: 14px 16px; }
.tip svg { width: 26px; height: 26px; flex: none; margin-top: 1px; }
.tip b { display: block; font-size: 15px; }
.tip span { font-size: 14px; color: var(--lav); }
.foot { margin-top: 26px; font-size: 13px; color: var(--lav); }
.foot button { text-decoration: underline; font-weight: 700; color: var(--white); padding: 0; }

/* ---------- session page ---------- */
.sess.t-morning { background: var(--paper); color: var(--ink); }
.sess.t-evening { background: var(--ink-3); color: var(--white); }
.back {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 2.5px solid currentColor; margin-bottom: 18px;
}
.back svg { width: 22px; height: 22px; }
.sess-when { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.t-morning .sess-when { color: #c4410c; }
.t-evening .sess-when { color: var(--mint); }
.sess h1 { font-size: clamp(38px, 11vw, 52px); font-weight: 800; margin-top: 6px; }
.sess-blurb { margin-top: 10px; font-size: 17px; max-width: 34ch; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.meta span { font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 2px solid currentColor; }
.note { margin-top: 18px; border-radius: 18px; padding: 14px 16px; font-size: 15px; display: flex; gap: 12px; }
.note svg { width: 24px; height: 24px; flex: none; }
.t-morning .note { background: #ffe9a8; }
.t-evening .note { background: var(--ink-2); color: var(--white); }
.rules { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rules span { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 10px; }
.t-morning .rules span { background: var(--ink); color: var(--sun); }
.t-evening .rules span { background: var(--mint); color: var(--ink); }

.cards { display: grid; gap: 22px; margin-top: 26px; }
.card { border-radius: var(--radius); overflow: hidden; border: 2.5px solid var(--ink); }
.t-morning .card { background: var(--white); box-shadow: 5px 5px 0 var(--ink); }
.t-evening .card { background: var(--ink-2); border-color: #0b0826; box-shadow: 5px 5px 0 #0b0826; }
.art { position: relative; aspect-ratio: 3 / 2; border-bottom: 2.5px solid var(--ink); }
.t-evening .art { border-color: #0b0826; }
.art .fig { position: absolute; inset: 0; }
.art-num, .art-time {
  position: absolute; top: 12px; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px;
}
.art-num { left: 12px; font-family: var(--head); font-size: 15px; }
.art-time { right: 12px; }
.t-morning .art-num, .t-morning .art-time { background: var(--ink); color: var(--sun); }
.t-evening .art-num, .t-evening .art-time { background: var(--mint); color: var(--ink); }
.card-body { padding: 16px 18px 20px; }
.card h3 { font-size: 24px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: var(--ink); background: var(--lav); }
.chip.c-neck, .chip.c-blood { background: var(--pink); }
.chip.c-low { background: var(--mint); }
.chip.c-up, .chip.c-legs { background: var(--sky); }
.chip.c-shoulder { background: var(--sun); }
.chip.c-hip { background: var(--orange); }
.chip.c-strength { background: var(--ink); color: var(--white); }
.t-evening .chip.c-strength { background: var(--white); color: var(--ink); }
.cue { margin-top: 12px; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cue svg { width: 20px; height: 20px; flex: none; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; font-size: 16px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.t-morning .steps li::before { background: var(--sun); color: var(--ink); border: 2px solid var(--ink); }
.t-evening .steps li::before { background: var(--violet); color: var(--white); }
.hints { display: grid; gap: 8px; margin-top: 14px; }
.hint { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 10px 12px; font-size: 15px; }
.hint svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.hint b { font-weight: 800; }
.t-morning .hint.feel { background: #e3fbf4; }
.t-morning .hint.easy { background: #ffe7ef; }
.t-evening .hint.feel { background: rgba(46, 230, 184, 0.14); }
.t-evening .hint.easy { background: rgba(255, 111, 177, 0.16); }

.mark-done {
  width: 100%; margin-top: 26px; padding: 14px; border-radius: 16px; font-weight: 800; border: 2.5px dashed currentColor;
}
.sticky-start {
  position: sticky; bottom: calc(var(--safe-b) + 12px); z-index: 5; margin-top: 22px;
}
.start-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 17px 20px;
  border-radius: 999px; font-family: var(--head); font-weight: 800; font-size: 20px; border: 2.5px solid var(--ink);
}
.start-btn svg { width: 22px; height: 22px; }
.t-morning .start-btn { background: var(--ink); color: var(--sun); box-shadow: 4px 4px 0 var(--orange); }
.t-evening .start-btn { background: var(--mint); color: var(--ink); box-shadow: 4px 4px 0 #0b0826; }

/* ---------- safety ---------- */
.safety { background: var(--paper); color: var(--ink); }
.safety h1 { font-size: clamp(36px, 10vw, 48px); font-weight: 800; margin-top: 4px; }
.safety .intro { margin-top: 10px; font-size: 17px; }
.flag { border-radius: var(--radius); border: 2.5px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 18px; margin-top: 20px; }
.flag h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.flag h2 svg { width: 26px; height: 26px; flex: none; }
.flag ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.flag .call { display: inline-block; margin-top: 12px; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--white); text-decoration: none; }
.flag.red { background: var(--pink); }
.flag.orange { background: var(--orange); }
.flag.blue { background: var(--sky); }
.flag.green { background: var(--mint); }
.small { font-size: 13px; margin-top: 22px; opacity: 0.85; }

/* ---------- player ---------- */
.player {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 16px);
  overflow-y: auto;
}
.player[hidden] { display: none; }
.player.t-morning { background: var(--paper); color: var(--ink); }
.player.t-evening { background: var(--ink-3); color: var(--white); }
.p-inner { max-width: 540px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; flex: 1; gap: 12px; }
.p-top { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 2.5px solid currentColor; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.p-progress { flex: 1; display: flex; gap: 4px; }
.p-progress i { flex: 1; height: 7px; border-radius: 4px; background: currentColor; opacity: 0.18; position: relative; overflow: hidden; }
.p-progress i.done { opacity: 1; }
.t-morning .p-progress i.done { background: var(--orange); }
.t-evening .p-progress i.done { background: var(--mint); }
.p-progress i.now { opacity: 1; background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.p-stage { position: relative; border-radius: var(--radius); overflow: hidden; border: 2.5px solid var(--ink); aspect-ratio: 3 / 2; max-height: 40vh; max-height: 40dvh; width: 100%; margin: 0 auto; }
.t-evening .p-stage { border-color: #0b0826; }
.p-stage .fig { position: absolute; inset: 0; }
.p-flag {
  position: absolute; left: 10px; top: 10px; white-space: nowrap;
  font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px; background: var(--ink); color: var(--white);
}
.t-evening .p-flag { background: var(--white); color: var(--ink); }
.p-flag.switch { background: var(--pink); color: var(--ink); animation: pop 0.5s ease; transform-origin: left center; }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.p-label { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.t-morning .p-label { color: #c4410c; }
.t-evening .p-label { color: var(--mint); }
.p-name { font-size: clamp(28px, 8vw, 36px); font-weight: 800; }
.p-cue { font-weight: 700; font-size: 16px; }
.p-steps { font-size: 15px; margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.p-mid { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: currentColor; opacity: 0.15; }
.t-morning .ring .bar { stroke: var(--orange); }
.t-evening .ring .bar { stroke: var(--mint); }
.ring .bar { stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 38px; font-variant-numeric: tabular-nums; }
.p-ctrls { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; }
.play-btn { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; border: 2.5px solid var(--ink); }
.play-btn svg { width: 30px; height: 30px; }
.t-morning .play-btn { background: var(--ink); color: var(--sun); box-shadow: 3px 3px 0 var(--orange); }
.t-evening .play-btn { background: var(--mint); color: var(--ink); box-shadow: 3px 3px 0 #0b0826; }
.p-next { margin-top: auto; font-size: 14px; font-weight: 600; opacity: 0.8; padding-top: 8px; }
.p-next b { font-weight: 800; }

.p-done { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 14px; }
.p-done .big-check { width: 110px; height: 110px; }
.p-done h2 { font-size: clamp(34px, 10vw, 46px); font-weight: 800; }
.p-done p { font-size: 17px; max-width: 30ch; }
.p-done .start-btn { max-width: 340px; margin-top: 10px; }

@media (min-width: 700px) {
  .screen { padding-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .fig .focus circle, .p-flag.switch { animation: none; }
  .tile { transition: none; }
}
