/* Além da Ansiedade — área gratuita (app v1). Mobile first. */
:root {
  --bg: #fbf8f3; --surface: #fff; --soft: #f1ede4; --ink: #1f2b29; --muted: #55625f;
  --brand: #2f5d57; --brand-2: #264d48; --brand-soft: #e3eeea; --accent: #c98b5b; --accent-soft: #fbe9d8;
  --line: #e2dccf; --error: #9b3b2f; --focus: #1d6fd1;
  --radius: 18px; --shadow: 0 10px 30px rgba(31, 43, 41, .08);
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 12px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.label { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--accent); margin: 0 0 4px; }
.h-page { font-size: 1.7rem; margin-bottom: 4px; }
.h-sec { font-size: 1.15rem; margin: 28px 0 12px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 14px 22px;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease; }
.btn:hover { background: var(--brand-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--full { width: 100%; }
.btn--small { min-height: 40px; padding: 10px 16px; font-size: .9rem; }
.btn--ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); margin-top: 10px; }
.btn--ghost:hover { background: var(--brand-soft); }
.linkbtn { background: none; border: 0; padding: 4px; color: var(--brand); font: 600 .92rem var(--sans); text-decoration: underline; cursor: pointer; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); font-size: 1rem; cursor: pointer; }
.icon-btn--light { background: rgba(255,255,255,.18); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 12px; }
.chip { min-height: 42px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 500 .94rem var(--sans); cursor: pointer; }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Topo */
.top { position: sticky; top: 0; z-index: 30; background: rgba(251,248,243,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top__in { max-width: 560px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top__hi { font: 600 1.15rem var(--serif); margin: 0; }
.top__sub { margin: 0; font-size: .88rem; color: var(--muted); }
.sos-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #e7a877, var(--accent)); color: #fff; font: 700 .95rem var(--sans); letter-spacing: .06em; box-shadow: 0 6px 18px rgba(201,139,91,.35); }
.sos-btn__dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: dot 2.4s ease-in-out infinite; }
@keyframes dot { 0%,100% { opacity: .5; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* Layout */
.main { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.tab { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Navegação inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; gap: 4px;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.nav__btn { flex: 1; max-width: 180px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted); font: 600 .78rem var(--sans); border-radius: 14px; cursor: pointer; }
.nav__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav__btn.is-on { color: var(--brand); background: var(--brand-soft); }

/* ---------- HOJE ---------- */
.hero-card { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring__bg { stroke: var(--soft); }
.ring__fg { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s ease; }
.ring__txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring__txt strong { font: 600 1.7rem var(--serif); }
.ring__txt span { font-size: .78rem; color: var(--muted); }
.hero-card h2 { font-size: 1.2rem; margin-bottom: 4px; }
.hero-card .muted { margin: 0; font-size: .9rem; }

.today { margin-top: 16px; border-radius: 22px; padding: 20px; color: #fff; background: linear-gradient(140deg, #3b6f68, var(--brand) 60%, #24453f); box-shadow: 0 14px 30px rgba(47,93,87,.25); }
.today .label { color: #f0c9a5; }
.today h3 { font-size: 1.35rem; margin-bottom: 6px; }
.today .muted { color: #d4e5e0; margin-bottom: 16px; }
.today .btn { background: #fff; color: var(--brand); }
.today .btn:hover { background: #f3f7f6; }
.today.is-wait .btn { background: rgba(255,255,255,.18); color: #fff; }

.days { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.day { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.day:disabled { cursor: default; background: var(--soft); border-color: transparent; }
.day__n { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem; border: 2px solid var(--line); color: var(--muted); background: #fff; }
.day__t { flex: 1; min-width: 0; }
.day__t strong { display: block; font-size: .98rem; }
.day__t small { color: var(--muted); font-size: .82rem; }
.day__go { color: var(--brand); font-weight: 700; }
.day.is-done .day__n { background: var(--brand); border-color: var(--brand); color: #fff; }
.day.is-open { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.day.is-open .day__n { border-color: var(--brand); color: var(--brand); }
.day.is-locked .day__t strong { color: var(--muted); }
.demo-note { margin-top: 18px; text-align: center; font-size: .85rem; color: var(--muted); }

/* ---------- FOLHAS (lição / ferramenta) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; animation: up .3s ease; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__in { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
.sheet__top { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; text-align: center; margin-bottom: 14px; }
.sheet__top .label { margin: 0; }
.sheet h2 { font-size: 1.55rem; }
.sheet h2:focus { outline: none; }
.lesson-body p { font-size: 1.04rem; line-height: 1.65; }
.task { background: var(--brand-soft); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.task .label { color: var(--brand); }
.note-care { font-size: .9rem; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); }
.sheet--calm { background: linear-gradient(180deg, #eef5f2, var(--bg)); }

/* Celebração */
.celebrate { text-align: center; padding: 26px 0 10px; animation: pop .4s ease; }
.celebrate:focus { outline: none; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate__burst { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f0c9a5, var(--accent));
  box-shadow: 0 0 0 0 rgba(201,139,91,.4); animation: burst 1.6s ease-out 2; position: relative; }
.celebrate__burst::after { content: ""; position: absolute; inset: 0; margin: auto; width: 34px; height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M8.2 13.6 4.6 10l-1.2 1.2 4.8 4.8 9-9-1.2-1.2z'/%3E%3C/svg%3E") center/contain no-repeat; }
@keyframes burst { 0% { box-shadow: 0 0 0 0 rgba(201,139,91,.45); } 100% { box-shadow: 0 0 0 28px rgba(201,139,91,0); } }
.celebrate__t { font: 600 1.4rem var(--serif); margin-bottom: 4px; }

/* ---------- FERRAMENTAS ---------- */
.tool { margin-top: 14px; }
.breath { display: grid; place-items: center; gap: 14px; padding: 8px 0; }
.breath__stage { position: relative; width: min(260px, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.breath__halo { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(143,185,174,.35), rgba(143,185,174,0) 70%); }
.breath__ball { width: 62%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; color: #fff;
  background: radial-gradient(circle at 38% 32%, #b7d3cb, var(--brand)); box-shadow: 0 20px 40px rgba(47,93,87,.28);
  transform: scale(.72); transition-property: transform; transition-timing-function: ease-in-out; }
.breath__cue { font: 600 1.15rem var(--serif); }
.breath__count { display: block; font: 500 .9rem var(--sans); opacity: .85; margin-top: 2px; }
.breath__time { font-size: .9rem; color: var(--muted); margin: 0; }
.seg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.seg .chip { min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.seg-label { text-align: center; font-size: .8rem; color: var(--muted); margin: 6px 0 4px; }
.breath__desc { text-align: center; font-size: .9rem; color: var(--muted); max-width: 32ch; margin: 0 auto; }

.ground { text-align: center; padding: 6px 0; }
.ground__num { width: 110px; height: 110px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 600 3rem var(--serif); }
.ground__q { font: 600 1.3rem var(--serif); margin-bottom: 6px; }
.ground__dots { display: flex; justify-content: center; gap: 10px; margin: 16px 0 18px; }
.ground__dots button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brand); background: #fff; cursor: pointer; }
.ground__dots button[aria-pressed="true"] { background: var(--brand); }

.steps-tool { text-align: center; }
.steps-tool__text { font: 600 1.2rem/1.4 var(--serif); min-height: 3.4em; display: grid; place-items: center; margin: 10px 0; }
.bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin: 10px 0 14px; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fb9ae, var(--brand)); transition: width 1s linear; }

.counter { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 0; }
.counter__btn { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font: 600 2rem var(--sans); cursor: pointer; box-shadow: 0 10px 24px rgba(47,93,87,.25); }
.counter__btn:active { transform: scale(.95); }
.counter__n { font: 600 2.6rem var(--serif); min-width: 2ch; text-align: center; }

.fields .field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: .94rem; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: 400 1rem var(--sans); color: var(--ink); resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(47,93,87,.18); }
.saved-note { font-size: .8rem; color: var(--muted); margin: 0; }

.scale { display: grid; gap: 14px; }
.scale label { display: block; font-weight: 600; font-size: .94rem; margin-bottom: 4px; }
.scale__row { display: flex; align-items: center; gap: 12px; }
.scale input[type=range] { flex: 1; accent-color: var(--brand); height: 32px; }
.scale output { font: 600 1.3rem var(--serif); min-width: 2ch; text-align: right; }
.scale__diff { text-align: center; font-weight: 600; color: var(--brand); min-height: 1.4em; }

/* ---------- RELAXAR ---------- */
.relax-grid { display: grid; gap: 12px; margin-top: 16px; }
.relax-card { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; text-align: left;
  padding: 18px; border-radius: 20px; border: 0; cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease; }
.relax-card:active { transform: scale(.98); }
.relax-card__icon { grid-row: span 2; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.7); }
.relax-card__icon svg { width: 28px; height: 28px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.relax-card strong { font: 600 1.15rem var(--serif); }
.relax-card span:last-child { color: var(--muted); font-size: .9rem; }
.relax-card--breath { background: linear-gradient(135deg, #e3eeea, #d3e6e0); }
.relax-card--ground { background: linear-gradient(135deg, #fbe9d8, #f6dcc4); }
.relax-card--body { background: linear-gradient(135deg, #ece8f4, #e0dbef); }
.sound { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.sound p { margin: 2px 0 0; font-size: .86rem; }
.switch { flex-shrink: 0; width: 56px; height: 32px; border-radius: 999px; border: 0; background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.switch span { 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 .2s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"] span { transform: translateX(24px); }
.vol { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 0 18px; font-size: .9rem; color: var(--muted); }
.vol input { flex: 1; accent-color: var(--brand); }

/* ---------- COMUNIDADE ---------- */
.tab--chat { display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.chat-head .muted { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .9rem; }
.live { width: 8px; height: 8px; border-radius: 50%; background: #3aa76d; box-shadow: 0 0 0 3px rgba(58,167,109,.2); }
.rules, .join { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.rules h2, .join h2 { font-size: 1.3rem; }
.rules ul { padding-left: 20px; margin: 0 0 12px; }
.rules li { margin-bottom: 6px; }
.err { color: var(--error); font-size: .9rem; min-height: 1em; }
.otp { text-align: center; letter-spacing: .4em; font: 600 1.4rem var(--sans) !important; }

.room { display: flex; flex-direction: column; flex: 1; }
.msgs { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.msg__who { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--brand); margin-bottom: 2px; }
.msg__time { color: var(--muted); font-weight: 400; }
.msg__body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__more { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0 2px; }
.msg.is-me { align-self: flex-end; background: var(--brand); border-color: var(--brand); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg.is-me .msg__who, .msg.is-me .msg__time, .msg.is-me .msg__more { color: #d4e5e0; }
.msg.is-system { align-self: center; max-width: 100%; text-align: center; background: var(--accent-soft); border-color: transparent; border-radius: 14px; font-size: .92rem; }
.msg.is-system .msg__who { justify-content: center; color: #8a5228; }
.composer { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1.5px solid var(--line); border-radius: 26px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; resize: none; font: 400 1rem/1.4 var(--sans); padding: 10px 0; max-height: 120px; background: transparent; color: var(--ink); }
.composer textarea:focus { outline: none; }
.composer__send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.composer__send svg { width: 20px; height: 20px; fill: #fff; }
.composer__note { font-size: .8rem; color: var(--muted); text-align: center; margin: 8px 0 0; min-height: 1em; }
.care { background: #fff7ef; border: 1.5px solid #ecd9c6; border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.care__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- SOS ---------- */
.sos { position: fixed; inset: 0; z-index: 100; color: #fff; overflow-y: auto; background: radial-gradient(120% 90% at 50% 0%, #4b7f77, #2a524c 55%, #1d3a36); animation: fade .35s ease; }
.sos__in { max-width: 520px; margin: 0 auto; min-height: 100%; padding: calc(14px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.sos__top { display: flex; align-items: center; justify-content: space-between; }
.sos__steps { display: flex; gap: 6px; }
.sos__steps span { width: 28px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.25); transition: background .3s; }
.sos__steps span.is-on { background: #f0c9a5; }
#sos-host { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 20px 0; }
.sos h3 { font: 600 1.6rem var(--serif); margin-bottom: 8px; color: #fff; }
.sos p { color: #d9e8e3; font-size: 1.05rem; }
.sos .breath__ball { background: radial-gradient(circle at 38% 32%, #f3d7bd, #c98b5b); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.sos .breath__halo { background: radial-gradient(circle, rgba(240,201,165,.35), rgba(240,201,165,0) 70%); }
.sos .breath__time { color: #d9e8e3; }
.sos .btn { background: #fff; color: var(--brand); margin-top: 18px; }
.sos .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.sos .ground__num { background: rgba(255,255,255,.15); }
.sos .ground__dots button { border-color: #fff; background: transparent; }
.sos .ground__dots button[aria-pressed="true"] { background: #fff; }
.sos__quote { font: 500 1.35rem/1.45 var(--serif) !important; color: #fff !important; font-style: italic; margin: 10px 0 14px; }
.sos__help { margin-top: 26px; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.1); font-size: .95rem !important; }
.sos__help a { color: #fff; font-weight: 700; }
.sos .chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 720px) {
  .relax-grid { grid-template-columns: 1fr 1fr; }
  .relax-card--breath { grid-column: span 2; }
}
.center { text-align: center; }
.ground__q:focus { outline: none; }

/* v1.1: boas-vindas */
.sheet--welcome { background: radial-gradient(120% 70% at 50% 0%, #e3eeea, var(--bg) 70%); }
.welcome { text-align: center; padding-top: calc(48px + env(safe-area-inset-top)); }
.welcome h2 { font-size: 1.7rem; }
.welcome h2:focus { outline: none; }
.welcome__orb { display: block; width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #b7d3cb, var(--brand)); box-shadow: 0 16px 40px rgba(47,93,87,.3); animation: dot 4s ease-in-out infinite; }
.welcome__list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 10px; text-align: left; }
.welcome__list li { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.welcome__list strong { font: 600 1.05rem var(--serif); }
.welcome__list span { color: var(--muted); font-size: .92rem; }
