:root {
  --bg: var(--tg-theme-secondary-bg-color, #f2f1ee);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #1d1f1e);
  --hint: var(--tg-theme-hint-color, #8a8f8c);
  --link: var(--tg-theme-link-color, #4f8a6f);
  --danger: var(--tg-theme-destructive-text-color, #d9534f);
  --sep: color-mix(in srgb, var(--hint) 22%, transparent);
  /* Brand: calm sage with a warm accent, readable in light and dark themes */
  --sage: #5f9a7e;
  --sage-soft: color-mix(in srgb, var(--sage) 14%, transparent);
  --warm: #e2a273;
  --warm-soft: color-mix(in srgb, var(--warm) 16%, transparent);
  --radius: 18px;
  --pad: 16px;
  --top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  /* Telegram does not always publish the safe-area vars before the first paint: fall back to env() */
  --top-safe: max(var(--top), env(safe-area-inset-top, 0px));
  --bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  min-height: var(--tg-viewport-stable-height, 100vh);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

#app {
  padding: calc(var(--top-safe) + 12px) var(--pad) calc(var(--bottom) + 28px);
  max-width: 560px;
  margin: 0 auto;
  animation: fade .22s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 6px 4px 4px; }
.sub { color: var(--hint); font-size: 15px; margin: 0 4px 16px; }
.section-label {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--hint);
  margin: 22px 8px 8px;
}
.card { background: var(--card); border-radius: var(--radius); padding: var(--pad); }
.stack > * + * { margin-top: 10px; }

/* Hero */
.hero { display: flex; gap: 14px; align-items: center; }
.hero img {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none;
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--sage-soft);
}
.hero h1 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.hero .role { color: var(--hint); font-size: 15px; }
.online { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sage); margin-top: 4px; font-weight: 600; }
.online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 var(--sage); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.cta-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.cta {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  height: 64px; border-radius: 14px; background: var(--sage-soft); color: var(--text);
  font-size: 13px; font-weight: 600; transition: transform .12s;
}
.cta .ico { font-size: 20px; line-height: 1; }
.cta.primary { background: var(--sage); color: #fff; }
.cta:active, .tile:active, .row:active { transform: scale(.97); }

/* Tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--card); border-radius: var(--radius); padding: 14px; text-align: left;
  min-height: 104px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .12s;
}
.tile .ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: var(--sage-soft);
}
.tile.warm .ico { background: var(--warm-soft); }
.tile b { font-size: 16px; display: block; margin-top: 10px; }
.tile span { font-size: 13px; color: var(--hint); }
.tile.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 12px; justify-content: flex-start; }
.tile.wide b { margin: 0; }
.tile.sos .ico { background: color-mix(in srgb, var(--danger) 14%, transparent); }

/* List rows */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px var(--pad); min-height: 56px; transition: transform .12s;
}
.row + .row { border-top: 1px solid var(--sep); }
.row .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--sage-soft); flex: none; font-size: 18px; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 600; }
.row .grow span { display: block; color: var(--hint); font-size: 14px; }
.chev { color: var(--hint); font-size: 20px; }

/* Breathing */
.breathe { display: flex; flex-direction: column; align-items: center; padding: 10px 0 0; }
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 3px; gap: 3px; width: 100%; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--hint); }
.seg button.on { background: var(--sage); color: #fff; }
.orb-wrap { position: relative; width: 280px; height: 280px; margin: 36px 0 24px; display: grid; place-items: center; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed var(--sep); }
.orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--sage) 55%, #fff), var(--sage));
  box-shadow: 0 0 0 10px var(--sage-soft), 0 0 0 20px color-mix(in srgb, var(--sage) 7%, transparent);
  transform: scale(1); transition-property: transform; transition-timing-function: ease-in-out;
}
.orb-text { position: absolute; text-align: center; color: #fff; font-weight: 700; pointer-events: none; }
.orb-text .phase { font-size: 19px; }
.orb-text .count { font-size: 34px; font-variant-numeric: tabular-nums; }
.breathe .hint { color: var(--hint); text-align: center; font-size: 15px; min-height: 42px; }
.big-btn {
  height: 52px; border-radius: 14px; background: var(--sage); color: #fff; font-weight: 700; width: 100%; margin-top: 18px;
}
.big-btn.ghost { background: var(--sage-soft); color: var(--text); }
.cycles { color: var(--hint); font-size: 14px; margin-top: 8px; }

/* Audio / video practice */
.player { display: flex; align-items: center; gap: 12px; }
.play {
  width: 46px; height: 46px; border-radius: 50%; background: var(--sage); color: #fff; flex: none;
  display: grid; place-items: center; font-size: 17px;
}
.bar { height: 4px; border-radius: 4px; background: var(--sep); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--sage); transition: width .3s linear; }
.circle-video { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; display: block; margin: 6px auto 0; background: #000; }

/* Mood */
.faces { display: flex; justify-content: space-between; gap: 6px; }
.face {
  flex: 1; height: 58px; border-radius: 14px; background: var(--bg); font-size: 28px;
  transition: transform .15s, background .15s;
}
.face.on { background: var(--sage-soft); transform: scale(1.08); box-shadow: inset 0 0 0 2px var(--sage); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--card); font-size: 14px; font-weight: 600; }
.chip.on { background: var(--sage); color: #fff; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart .col i { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--sage); opacity: .85; }
.chart .col small { font-size: 10px; color: var(--hint); }
.avg { display: flex; justify-content: space-between; align-items: baseline; }
.avg b { font-size: 28px; }

/* Test */
.progress { height: 6px; border-radius: 6px; background: var(--sep); overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--sage); transition: width .25s; }
.q { font-size: 20px; font-weight: 650; line-height: 1.3; margin-bottom: 18px; }
.answer { width: 100%; height: 54px; border-radius: 14px; background: var(--card); font-weight: 600; margin-top: 10px; text-align: left; padding: 0 16px; }
.answer:active { background: var(--sage-soft); }
.result-score { font-size: 54px; font-weight: 800; letter-spacing: -.03em; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; }

/* Booking */
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 62px; height: 70px; border-radius: 14px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.day small { color: var(--hint); font-size: 12px; }
.day b { font-size: 20px; }
.day.on { background: var(--sage); color: #fff; }
.day.on small { color: rgba(255,255,255,.8); }
.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time { height: 44px; border-radius: 12px; background: var(--card); font-weight: 600; font-variant-numeric: tabular-nums; }
.time.on { background: var(--sage); color: #fff; }
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.format { height: 64px; border-radius: 14px; background: var(--card); font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.format .ico { font-size: 20px; }
.format.on { box-shadow: inset 0 0 0 2px var(--sage); background: var(--sage-soft); }
.status { font-size: 13px; font-weight: 600; }
.status.pending { color: var(--warm); }
.status.confirmed { color: var(--sage); }
.danger-link { color: var(--danger); font-size: 14px; font-weight: 600; padding: 8px 0; }

/* SOS */
.sos-num { display: flex; justify-content: space-between; align-items: center; }
.sos-num b { font-size: 22px; font-variant-numeric: tabular-nums; }
.call-btn { height: 40px; padding: 0 16px; border-radius: 12px; background: var(--danger); color: #fff; font-weight: 700; font-size: 14px; }

.empty { text-align: center; color: var(--hint); padding: 22px 8px; font-size: 15px; }
.muted { color: var(--hint); font-size: 14px; }
.skeleton { height: 140px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), color-mix(in srgb, var(--card) 70%, var(--bg)), var(--card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 24px); transform: translate(-50%, 20px);
  background: color-mix(in srgb, var(--text) 88%, transparent); color: var(--card);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  #app, .msg { animation: none !important; }
}

/* ---------- Chat ---------- */
body.chat-open #app { padding: 0; max-width: none; }
.chat {
  position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto;
  padding-top: var(--top-safe); padding-bottom: var(--bottom); background: var(--bg);
}
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 10px var(--pad);
  background: var(--card); border-bottom: 1px solid var(--sep);
}
.chat-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-head b { display: block; font-size: 16px; }
.chat-head span { font-size: 13px; color: var(--sage); }
.chat-head span.idle { color: var(--hint); }
.msgs {
  flex: 1; overflow-y: auto; padding: 12px 10px 8px; display: flex; flex-direction: column; gap: 6px;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.msg { max-width: 82%; display: flex; flex-direction: column; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 8px 12px; border-radius: 18px; font-size: 15.5px; line-height: 1.38; white-space: pre-wrap; word-wrap: break-word;
}
.me .bubble { background: var(--sage); color: #fff; border-bottom-right-radius: 6px; }
.them .bubble { background: var(--card); border-bottom-left-radius: 6px; }
.msg.pending { opacity: .6; }
.time-stamp { font-size: 11px; color: var(--hint); margin: 2px 6px 0; }
.transcript { font-size: 13px; color: var(--hint); font-style: italic; max-width: 82%; align-self: flex-end; text-align: right; margin: -2px 6px 4px; }
.day-sep { align-self: center; font-size: 12px; color: var(--hint); background: var(--card); padding: 3px 10px; border-radius: 10px; margin: 8px 0 4px; }

.vbubble { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 8px 12px 8px 8px; }
.vbubble .vplay { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; flex: none; }
.me .vbubble .vplay { background: rgba(255,255,255,.25); color: #fff; }
.them .vbubble .vplay { background: var(--sage); color: #fff; }
.wave { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; }
.wave i { flex: 1; border-radius: 2px; background: currentColor; opacity: .35; }
.wave i.on { opacity: 1; }
.me .wave { color: #fff; }
.them .wave { color: var(--sage); }
.vdur { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; min-width: 30px; }

.note { width: 210px; height: 210px; border-radius: 50%; overflow: hidden; position: relative; background: #000; }
.note video { width: 100%; height: 100%; object-fit: cover; display: block; }
.note .note-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.note .note-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.media-img, .media-video { max-width: 260px; border-radius: 16px; display: block; }

.typing { align-self: flex-start; background: var(--card); border-radius: 18px; border-bottom-left-radius: 6px; padding: 10px 14px; min-width: 120px; max-width: 82%; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.typing .t-text { font-size: 14px; color: var(--hint); }
.typing .bar { margin-top: 8px; }
.typing .t-meta { font-size: 12px; color: var(--hint); margin-top: 4px; font-variant-numeric: tabular-nums; }

.quick { display: flex; gap: 8px; padding: 6px 10px 0; overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--card); font-size: 14px; font-weight: 600; color: var(--sage); }
.sys-card { align-self: stretch; background: color-mix(in srgb, var(--danger) 10%, var(--card)); border-radius: 14px; padding: 10px 12px; font-size: 14px; margin: 4px 0; }
.sys-card button { color: var(--danger); font-weight: 700; margin-top: 6px; }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px 10px; }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; font: inherit; font-size: 16px; color: var(--text);
  background: var(--card); border-radius: 20px; padding: 10px 14px; max-height: 120px; min-height: 42px; line-height: 1.35;
}
.composer textarea::placeholder { color: var(--hint); }
.round { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--sage); color: #fff; font-size: 18px; transition: transform .12s; }
.round:active { transform: scale(.92); }
.round.ghost { background: var(--card); color: var(--danger); }
.rec { flex: 1; height: 42px; border-radius: 21px; background: var(--card); display: flex; align-items: center; gap: 10px; padding: 0 14px; font-variant-numeric: tabular-nums; }
.rec .red { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
.rec .lvl { flex: 1; height: 4px; border-radius: 2px; background: var(--sep); overflow: hidden; }
.rec .lvl i { display: block; height: 100%; background: var(--sage); width: 0; transition: width .1s; }
.chat-empty { margin: auto; text-align: center; color: var(--hint); padding: 30px 20px; font-size: 15px; }
.chat-empty img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }

/* ---------- Motion system ---------- */
:root { --spring: cubic-bezier(.34, 1.56, .64, 1); --ease-out: cubic-bezier(.22, 1, .36, 1); }

/* Ambient background: two slow blurred blobs tinted by the psychologist's accent */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: .22;
  background: radial-gradient(circle, var(--sage), transparent 65%);
  animation: drift 22s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { top: -35vmax; left: -25vmax; }
.ambient i:nth-child(2) { bottom: -40vmax; right: -30vmax; background: radial-gradient(circle, var(--warm), transparent 65%); animation-duration: 28s; animation-delay: -8s; opacity: .16; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vmax, 6vmax) scale(1.12); } 100% { transform: translate(-6vmax, 10vmax) scale(.95); } }

/* Screen transitions */
#app.go-fwd { animation: in-fwd .38s var(--ease-out); }
#app.go-back { animation: in-back .38s var(--ease-out); }
@keyframes in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* Staggered entrance */
.rise { opacity: 0; animation: rise .55s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 55ms + 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* Press feedback with spring release */
.press { transition: transform .35s var(--spring); }
.press:active { transform: scale(.95); transition-duration: .08s; }

/* Hero avatar with spinning accent ring */
.avatar-ring { position: relative; width: 84px; height: 84px; flex: none; }
.avatar-ring::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--sage), var(--warm), transparent 60%, var(--sage));
  animation: spin 6s linear infinite;
}
.avatar-ring::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; background: var(--card); }
.avatar-ring img { position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; letter-spacing: .02em; vertical-align: middle; }
.badge.ai { background: color-mix(in srgb, #7b86c9 16%, transparent); color: #6a74b8; }
.badge.live { background: var(--sage-soft); color: var(--sage); }
.greet { font-size: 14px; color: var(--hint); margin: 4px 6px 10px; }
.switch-psy { font-size: 13px; font-weight: 600; color: var(--sage); margin-top: 6px; display: flex; gap: 4px; align-items: center; }
.tile .ico { transition: transform .4s var(--spring); }
.tile:active .ico { transform: rotate(-8deg) scale(1.12); }

/* ---------- Psychologist picker ---------- */
.picker-head { padding: 4px 4px 0; }
.carousel {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 14px calc(-1 * var(--pad)) 0; padding: 6px calc(10vw) 18px; perspective: 900px;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.pcard {
  flex: none; width: 80vw; max-width: 380px; scroll-snap-align: center; border-radius: 26px; overflow: hidden;
  background: var(--card); box-shadow: 0 18px 40px -22px rgba(0,0,0,.35); will-change: transform, opacity;
  transform-origin: center bottom;
}
.pcard .ph { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); will-change: transform; }
.pcard .ph::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.pcard .ph .cap { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; color: #fff; }
.pcard .ph .cap h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.pcard .ph .cap p { font-size: 14px; opacity: .9; }
.pcard .ph .badge { position: absolute; top: 12px; left: 12px; z-index: 1; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(255,255,255,.75); color: #222; }
.pcard .body { padding: 14px 16px 16px; }
.pcard .meta { display: flex; gap: 8px; font-size: 13px; color: var(--hint); margin-bottom: 8px; }
.pcard .about { font-size: 14.5px; line-height: 1.42; }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pcard .tags span { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 9px; background: color-mix(in srgb, var(--pc) 14%, transparent); color: var(--pc); }
.pdots { display: flex; justify-content: center; gap: 6px; }
.pdots i { width: 7px; height: 7px; border-radius: 4px; background: var(--sep); transition: width .35s var(--spring), background .3s; }
.pdots i.on { width: 22px; background: var(--sage); }
.pick-btn {
  position: relative; overflow: hidden; height: 54px; border-radius: 16px; width: 100%; margin-top: 16px;
  background: var(--sage); color: #fff; font-weight: 700; font-size: 16px; transition: background .4s, transform .35s var(--spring);
}
.pick-btn::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-100%); animation: shine 2.8s ease-in-out infinite;
}
@keyframes shine { 60%, 100% { transform: translateX(100%); } }

/* Confetti */
.confetti { position: fixed; left: 0; top: 0; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; z-index: 99; }

/* Success check */
.success { display: grid; place-items: center; text-align: center; padding: 30px 10px; }
.success svg { width: 92px; height: 92px; }
.success circle { stroke: var(--sage); stroke-width: 4; fill: none; stroke-dasharray: 280; stroke-dashoffset: 280; animation: draw .7s var(--ease-out) forwards; }
.success path { stroke: var(--sage); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s .55s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Chart bars grow, result count-up */
.chart .col i { transform-origin: bottom; animation: grow .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes grow { from { transform: scaleY(0); } }

/* Breathing ripples */
.ripple { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--sage); opacity: 0; pointer-events: none; }
.ripple.go { animation: ripple 2.4s ease-out; }
@keyframes ripple { from { opacity: .5; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }

/* Composer action morph */
.round { transition: transform .35s var(--spring), background .25s; }
.round.morph { animation: morph .35s var(--spring); }
@keyframes morph { 0% { transform: scale(.6) rotate(-90deg); } 100% { transform: none; } }

#toast { transition: opacity .25s, transform .45s var(--spring); }

@media (prefers-reduced-motion: reduce) {
  .ambient i, .avatar-ring::before, .pick-btn::after { animation: none !important; }
  .rise { opacity: 1; animation: none; }
}
