/* ==========  SOULSAA APP  ========== */
:root {
  --ink: #111114; --ink-2: #6b6b73; --line: #ececf0; --paper: #f6f5f8; --white: #fff;
  --c1: #ff9f43; --c2: #ff4f8b; --c3: #7b5cff;
  --grad: linear-gradient(100deg, var(--c1), var(--c2) 50%, var(--c3));
  --radius: 22px; --tabbar: 64px;
  --serif: "Instrument Serif", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #ecebf0; color: var(--ink); font-family: "Inter", -apple-system, system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.small { font-size: 13px; }
.pad { padding: 16px 20px; }

.app { max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--white); position: relative; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 12px); box-shadow: 0 0 60px rgba(0,0,0,.06); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar__logo img { height: 38px; width: auto; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 24px; height: 24px; fill: var(--ink); }
.pill { font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 99px; background: var(--ink); color: #fff; }
.pill--light { background: rgba(255,255,255,.22); color: #fff; }

/* Views */
.view { display: none; animation: fade .35s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view__head { padding: 20px 20px 6px; }
.view__head h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 2px; }
.view__head p { margin: 0; }
.subhead { font-size: 15px; font-weight: 700; margin: 18px 20px 10px; }

/* Stories */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 14px 16px 10px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 70px; text-align: center; font-size: 12px; }
.story__ring { width: 66px; height: 66px; border-radius: 50%; padding: 3px; background: var(--grad); margin: 0 auto 6px; }
.story__ring span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; background: var(--paper); overflow: hidden; font-size: 24px; }
.story__ring img { width: 100%; height: 100%; object-fit: cover; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 99px; background: var(--paper); color: var(--ink); }
.chip.is-active { background: var(--ink); color: #fff; }

/* Posts */
.post { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.post__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; padding: 2px; background: var(--grad); flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; background: #fff; object-fit: contain; }
.post__who b { display: block; font-size: 14px; line-height: 1.2; }
.post__who span { font-size: 12px; color: var(--ink-2); }
.post__media { position: relative; aspect-ratio: 4 / 5; background: var(--paper); overflow: hidden; cursor: pointer; }
.post__media img { width: 100%; height: 100%; object-fit: cover; }
.post__badge { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 5px 10px; border-radius: 99px; backdrop-filter: blur(6px); }
.post__play { position: absolute; inset: 0; display: grid; place-items: center; }
.post__play span { width: 68px; height: 68px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; backdrop-filter: blur(4px); }
.post__play svg { width: 28px; height: 28px; fill: #fff; margin-left: 4px; }
.heart-pop { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.heart-pop svg { width: 96px; height: 96px; fill: #fff; filter: drop-shadow(0 4px 20px rgba(0,0,0,.3)); }
.heart-pop.go { animation: pop .8s ease; }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.1); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.post__actions { display: flex; align-items: center; gap: 16px; padding: 10px 14px 4px; }
.post__actions button svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.post__actions .save { margin-left: auto; }
.post__actions .liked svg { fill: var(--c2); stroke: var(--c2); }
.post__actions .saved svg { fill: var(--ink); }
.post__body { padding: 2px 14px 0; font-size: 14px; }
.post__title { font-weight: 700; margin: 2px 0 4px; }
.post__caption { white-space: pre-line; margin: 0; }
.post__caption.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.tags { color: #3b4cc0; font-size: 13px; margin: 6px 0 0; }
.read-btn { margin: 10px 14px 0; }

.review { margin: 14px 16px; padding: 20px; border-radius: var(--radius); background: var(--paper); }
.review__stars { color: var(--c1); letter-spacing: 2px; font-size: 16px; }
.review__text { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin: 8px 0 12px; }
.review__who { font-size: 13px; color: var(--ink-2); }
.review__who b { color: var(--ink); }
.empty { text-align: center; padding: 48px 28px; }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 0 18px; color: var(--ink-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 13px 20px; border-radius: 14px; text-decoration: none; transition: transform .15s ease, opacity .15s ease; }
.btn:active { transform: scale(.98); }
.btn--block { width: 100%; }
.btn--grad { background: var(--grad); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.plan--dark .btn--ghost { border-color: #fff; color: #fff; }

/* Reels */
.reel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.reel { position: relative; aspect-ratio: 9 / 16; background: #000; overflow: hidden; }
.reel img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.reel span { position: absolute; left: 8px; right: 8px; bottom: 8px; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.25; text-shadow: 0 1px 6px rgba(0,0,0,.7); text-align: left; }
.video-list { padding: 0 16px 8px; display: grid; gap: 14px; }
.vrow { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; text-align: left; }
.vrow img { width: 140px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.vrow b { font-size: 14px; line-height: 1.3; display: block; }
.vrow span { font-size: 12px; color: var(--ink-2); }

/* Player */
.player { position: fixed; inset: 0; z-index: 80; background: #000; }
.player__close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; }
.player__track { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; }
.player__slide { height: 100%; scroll-snap-align: start; display: grid; place-items: center; position: relative; }
.player__slide iframe { width: 100%; max-width: 480px; height: 100%; border: 0; }
.player__slide.wide iframe { height: auto; aspect-ratio: 16 / 9; }
.player__slide .poster { width: 100%; max-width: 480px; height: 100%; object-fit: cover; opacity: .5; }

/* Cards (calm, journal, book) */
.card, .plan { margin: 14px 16px; padding: 20px; border-radius: var(--radius); background: var(--paper); }
.card h3, .plan h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0 0 14px; }
.card__tag { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 8px !important; }
.affirm { margin: 14px 16px; padding: 24px 22px; border-radius: var(--radius); background: var(--grad); color: #fff; }
.affirm__label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; margin: 0 0 8px; }
.affirm__text { font-family: var(--serif); font-size: 28px; line-height: 1.15; margin: 0 0 16px; }

.breathe__modes { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.breathe__modes .chip { background: #fff; }
.breathe__modes .chip.is-active { background: var(--ink); }
.orb-wrap { height: 240px; display: grid; place-items: center; position: relative; }
.orb { width: 110px; height: 110px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 60px rgba(255,79,139,.45); transform: scale(.75); transition: transform 4s ease-in-out; }
.orb__cue { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-weight: 700; margin: 0 !important; }
.ground__dots { display: flex; gap: 6px; justify-content: center; margin: 0 0 14px; }
.ground__dots i { width: 8px; height: 8px; border-radius: 50%; background: #d9d8df; }
.ground__dots i.on { background: var(--c2); }
.ground__step { font-size: 16px; min-height: 72px; }

/* Journal */
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 14px; }
.mood { display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border-radius: 14px; background: #fff; font-size: 11px; font-weight: 600; color: var(--ink-2); border: 2px solid transparent; }
.mood b { font-size: 26px; line-height: 1; }
.mood.is-on { border-color: var(--c2); color: var(--ink); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: inherit; resize: vertical; margin-bottom: 12px; background: #fff; }
textarea:focus, input:focus { outline: 2px solid var(--c3); outline-offset: 1px; }
.saved { margin: 10px 0 0 !important; }
.streak { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.streak b { font-size: 36px; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mood-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.mood-strip span { aspect-ratio: 1; border-radius: 6px; background: #e3e2e8; display: grid; place-items: center; font-size: 13px; }
.entry { margin: 10px 16px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); }
.entry__top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }
.entry__top b { color: var(--ink); font-size: 14px; }
.entry p { margin: 6px 0 0; white-space: pre-line; font-size: 14px; }
.entry button { font-size: 12px; color: var(--ink-2); text-decoration: underline; }

/* Book */
.plan__price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 10px; }
.plan__price small { font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.plan--dark { background: #111114; color: #fff; }
.plan--dark .plan__price small, .plan--dark .card__tag, .plan--dark .ticks { color: rgba(255,255,255,.7); }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--c2); font-weight: 700; }

/* Tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar svg .fill { fill: currentColor; stroke: none; }
.tabbar a.is-active { color: var(--ink); }
.tabbar a.is-active svg { stroke-width: 2.4; }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet__panel { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; background: #fff; border-radius: 24px 24px 0 0; animation: up .35s ease; }
#sheetBody { overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px calc(28px + var(--safe-b)); }
@keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet__close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.15); font-size: 15px; z-index: 2; }
.article__img { max-width: none; width: calc(100% + 44px); margin: -22px -22px 18px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 24px 24px 0 0; }
.article h2 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 6px; }
.article .meta { font-size: 13px; color: var(--ink-2); margin: 0 0 16px; }
.article h3 { font-size: 18px; margin: 22px 0 6px; }
.article p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 90; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Assistant */
.fab { position: fixed; z-index: 45; right: max(16px, calc(50% - 240px + 16px)); bottom: calc(var(--tabbar) + var(--safe-b) + 14px); display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 10px; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); }
.fab i { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); display: block; }
.chat { position: fixed; inset: 0; z-index: 75; display: flex; justify-content: center; background: rgba(0,0,0,.4); }
.chat__panel { width: 100%; max-width: 480px; height: 100%; background: #fff; display: flex; flex-direction: column; }
.chat__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); }
.chat__head b { display: block; font-size: 15px; }
.chat__head span { font-size: 12px; color: var(--ink-2); }
.chat__head button { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); }
.chat__log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-line; animation: fade .25s ease; }
.msg--bot { background: #fff; border-bottom-left-radius: 6px; align-self: flex-start; }
.msg--me { background: var(--ink); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg--typing { color: var(--ink-2); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.quick button { font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 99px; background: #fff; border: 1.5px solid var(--ink); }
.chat__form { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; }
.chat__form input { flex: 1; border: 1px solid var(--line); border-radius: 99px; padding: 11px 16px; font: inherit; }
.chat__form button { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 17px; flex: none; }
.paycard { align-self: stretch; background: #120d18; color: #fff; border-radius: 20px; padding: 18px; text-align: center; position: relative; overflow: hidden; animation: fade .3s ease; }
.paycard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--grad); }
.paycard__label { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--c2); margin: 6px 0 4px; }
.paycard__name { font-family: var(--serif); font-size: 24px; line-height: 1.1; margin: 0 0 4px; }
.paycard__amt { font-size: 40px; font-weight: 800; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.paycard__sub { font-size: 13px; color: rgba(255,255,255,.7); margin: 0 0 12px; }
.paycard__qr { background: #fff; border-radius: 16px; padding: 12px; width: 200px; margin: 0 auto 12px; }
.paycard__qr img, .paycard__qr svg { width: 100%; height: auto; display: block; }
.paycard__ref { font-size: 12px; color: rgba(255,255,255,.65); margin: 8px 0 0; }
.paycard .btn { margin-top: 8px; }
.paycard .btn--ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.assist-cta { display: flex; align-items: center; gap: 14px; margin: 14px 16px 0; padding: 16px 18px; width: calc(100% - 32px); text-align: left; border-radius: var(--radius); background: #111114; color: #fff; }
.assist-cta i { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); flex: none; }
.assist-cta b { display: block; font-size: 15px; }
.assist-cta span { font-size: 13px; color: rgba(255,255,255,.72); }

/* Login */
.gate { position: fixed; inset: 0; z-index: 85; background: #fff; overflow-y: auto; }
.gate__panel { max-width: 400px; margin: 0 auto; padding: calc(36px + env(safe-area-inset-top, 0px)) 24px 32px; text-align: center; }
.gate__logo { height: 64px; width: auto; margin: 0 auto 18px; }
.gate h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; }
.gate .muted { margin: 0 0 24px; }
.social { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px; border-radius: 14px; font-weight: 600; margin-bottom: 10px; border: 1.5px solid var(--line); background: #fff; }
.social svg { width: 20px; height: 20px; }
.social--fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.gate__or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-2); font-size: 13px; }
.gate__or::before, .gate__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { padding: 9px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.gate__form { display: grid; gap: 10px; text-align: left; }
.gate__form input { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font: inherit; width: 100%; }
.gate__err { margin: 0; color: #c62828; font-size: 13px; }
.gate__link { color: var(--ink-2); font-size: 13px; text-decoration: underline; justify-self: center; }
.gate__legal { font-size: 12px; color: var(--ink-2); margin: 18px 0 8px; }
.gate__skip { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 8px; }
.gate button:disabled { opacity: .6; }
.acct { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--grad); color: #fff; font-weight: 700; display: grid; place-items: center; }
.acct img { width: 100%; height: 100%; object-fit: cover; }
.acct--out { width: auto; background: none; color: var(--ink); border-radius: 99px; }
.acct__in { font-size: 13px; font-weight: 600; padding: 7px 12px; border: 1.5px solid var(--ink); border-radius: 99px; }
.chat__log > * { flex: none; }
body[data-view="calm"] .fab, body[data-view="journal"] .fab, body[data-view="book"] .fab { display: none; }
#sheetBody > h2:first-child { padding-right: 44px; }
