/* ============================================================
   SDV | Saia do Vício - Design System 2.0
   Claro, calmo e refinado. Uma cor de destaque: o cobre da marca.
   ============================================================ */
:root {
  --bg: #FAF9F7;
  --bg-2: #F4F2EE;
  --surface: #FFFFFF;
  --surface-2: #F6F4F1;
  --surface-3: #ECE9E3;
  --border: #E7E3DC;
  --border-soft: #EFECE6;
  --text: #1D1B18;
  --text-dim: #55524C;
  --muted: #8B867D;
  --accent: #B96F35;
  --accent-2: #9A5A28;
  --accent-soft: rgba(185, 111, 53, 0.10);
  --accent-glow: rgba(185, 111, 53, 0.18);
  --green: #4E8A5F;
  --green-soft: rgba(78, 138, 95, 0.10);
  --red: #C25B4E;
  --red-soft: rgba(194, 91, 78, 0.09);
  --blue: #4A6E96;
  --blue-soft: rgba(74, 110, 150, 0.09);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28, 25, 20, 0.04), 0 10px 30px rgba(28, 25, 20, 0.06);
  --nav-h: 74px;
  color-scheme: light;
}

/* ---------------- Tema escuro (padrão do sistema) ---------------- */
:root[data-theme="dark"] {
  --bg: #100F0D;
  --bg-2: #161411;
  --surface: #1B1814;
  --surface-2: #221E19;
  --surface-3: #2B2620;
  --border: #2E2922;
  --border-soft: #252019;
  --text: #F2EFE9;
  --text-dim: #B9B1A4;
  --muted: #8B8478;
  --accent: #D08C4F;
  --accent-2: #E3A96B;
  --accent-soft: rgba(208, 140, 79, 0.13);
  --accent-glow: rgba(208, 140, 79, 0.22);
  --green: #7FB08A;
  --green-soft: rgba(127, 176, 138, 0.12);
  --red: #D0776B;
  --red-soft: rgba(208, 119, 107, 0.12);
  --blue: #8AA6C8;
  --blue-soft: rgba(138, 166, 200, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 34px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #353028; border-color: var(--bg); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #423C32; }
:root[data-theme="dark"] .cursor-ring { border-color: rgba(242, 239, 233, 0.28); }
:root[data-theme="dark"] .field-box input::placeholder { color: #6E675C; }
:root[data-theme="dark"] .topbar { background: rgba(16, 15, 13, 0.85); }
:root[data-theme="dark"] .bottomnav { background: rgba(22, 20, 17, 0.92); }
:root[data-theme="dark"] .nav-item:hover { background: rgba(242, 239, 233, 0.06); }
:root[data-theme="dark"] .card-hover:hover { border-color: #3A342B; }
:root[data-theme="dark"] .btn-ghost:hover { border-color: #423B31; }
:root[data-theme="dark"] .msg.ai .msg-bubble { background: rgba(208, 140, 79, 0.09); border-color: rgba(208, 140, 79, 0.2); }
:root[data-theme="dark"] .daily-msg { background: linear-gradient(135deg, rgba(208, 140, 79, 0.08), var(--surface) 70%); }
:root[data-theme="dark"] .quote-card { background: linear-gradient(135deg, rgba(208, 140, 79, 0.08), var(--surface) 70%); }
:root[data-theme="dark"] .side-emergency { color: #E39A8D; border-color: rgba(208, 119, 107, 0.3); }
:root[data-theme="dark"] .login-error { color: #E8A79C; border-color: rgba(208, 119, 107, 0.35); }
:root[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.55); }
:root[data-theme="dark"] .btn-primary { color: #1B1206; }
:root[data-theme="dark"] .btn-primary .spinner { border-color: rgba(27, 18, 6, 0.3); border-top-color: #1B1206; }
:root[data-theme="dark"] .task-row.done .task-check { color: #10190F; }
:root[data-theme="dark"] .btn-green { color: #10190F; }
:root[data-theme="dark"] .btn-danger { color: #1D0F0C; }
:root[data-theme="dark"] .bnav-sos { color: #1D0F0C; }
:root[data-theme="dark"] .tl-item.reached .tl-dot svg { color: #1B1206; }
:root[data-theme="dark"] .chat-send { color: #1B1206; }
:root[data-theme="dark"] .sound-card.playing .sound-play { color: #1B1206; }
:root[data-theme="dark"] .ob-option.selected .ob-letter { color: #1B1206; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }

::selection { background: var(--accent); color: #FFFFFF; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D9D4CC; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C8C2B8; }

/* ---------------- Cursor personalizado (discreto) ---------------- */
@media (pointer: fine) {
  body.custom-cursor, body.custom-cursor * { cursor: none !important; }
  .cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0; pointer-events: none; z-index: 99999;
    border-radius: 50%; transform: translate(-50%, -50%);
  }
  .cursor-dot {
    width: 6px; height: 6px; background: var(--accent);
    transition: width .18s ease, height .18s ease, background .18s ease, opacity .3s ease;
  }
  .cursor-ring {
    width: 30px; height: 30px; border: 1.5px solid rgba(28, 25, 20, 0.22);
    transition: width .22s cubic-bezier(.3,1.2,.5,1), height .22s cubic-bezier(.3,1.2,.5,1),
                border-color .22s ease, opacity .3s ease, border-radius .25s ease;
  }
  body.cursor-hover .cursor-dot { width: 4px; height: 4px; }
  body.cursor-hover .cursor-ring { width: 42px; height: 42px; border-color: var(--accent); background: rgba(185, 111, 53, 0.05); }
  body.cursor-scrolling .cursor-dot { width: 3px; height: 14px; border-radius: 4px; }
  body.cursor-scrolling .cursor-ring { width: 24px; height: 38px; border-radius: 14px; border-color: var(--accent); }
  body.cursor-down .cursor-ring { width: 22px; height: 22px; }
}
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------------- Logomarca ---------------- */
.logo { display: flex; align-items: center; gap: 14px; user-select: none; }
.logo-mark {
  font-family: var(--font-display); font-weight: 800; font-style: italic;
  letter-spacing: -0.04em; color: var(--text);
  transform: skewX(-6deg); display: inline-block; line-height: 1;
}
.logo-mark .v { color: var(--accent); }
.logo-bar { width: 3px; align-self: stretch; background: var(--accent); border-radius: 2px; }
.logo-text {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.34em;
  color: var(--text); text-transform: uppercase; line-height: 1.4;
}
.logo-text b { color: var(--accent); font-weight: 600; }
.logo-xl .logo-mark { font-size: 64px; }
.logo-xl .logo-text { font-size: 15px; }
.logo-sm .logo-mark { font-size: 30px; }
.logo-sm .logo-text { font-size: 9.5px; letter-spacing: 0.3em; }

/* ---------------- Fundo / orbes (sutis) ---------------- */
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; pointer-events: none; }
.orb-1 { width: 480px; height: 480px; background: rgba(208, 140, 79, 0.14); top: -140px; left: -120px; }
.orb-2 { width: 420px; height: 420px; background: rgba(122, 156, 196, 0.07); bottom: -160px; right: -100px; }
.orb-3 { width: 300px; height: 300px; background: rgba(227, 169, 107, 0.08); top: 40%; left: 55%; }
.grain { display: none; }

/* ---------------- Foguinho vivo (chama tremulando) ---------------- */
.flame-anim { position: relative; display: inline-flex; }
.flame-anim svg {
  animation: flicker 1.7s ease-in-out infinite;
  transform-origin: 50% 88%;
}
.flame-anim::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(224, 140, 60, 0.35), transparent 70%);
  animation: flameGlow 1.7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  22% { transform: scale(1.06, 0.96) rotate(-2deg); }
  48% { transform: scale(0.96, 1.08) rotate(1.6deg); }
  74% { transform: scale(1.04, 0.97) rotate(-1deg); }
}
@keyframes flameGlow {
  0%, 100% { opacity: .45; transform: scale(.88); }
  50% { opacity: .95; transform: scale(1.12); }
}

/* ---------------- Animações utilitárias ---------------- */
.reveal-up { animation: revealUp .7s cubic-bezier(.2,.8,.25,1) both; }
@keyframes revealUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.anim-in { animation: viewIn .45s cubic-bezier(.2,.8,.25,1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: viewIn .5s cubic-bezier(.2,.8,.25,1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }
.stagger > *:nth-child(7) { animation-delay: .32s; }
.stagger > *:nth-child(8) { animation-delay: .37s; }

/* ============================================================
   LOGIN (painel da marca escuro + formulário claro)
   ============================================================ */
.screen-login {
  min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr;
  position: relative; overflow: hidden;
}
.login-bg { display: none; }
.login-brand {
  /* Painel escuro da marca: as cores locais são redefinidas aqui */
  --text: #F2EFE9; --text-dim: #B8AFA2; --muted: #857B6D;
  --accent: #D08C4F; --accent-2: #E3A96B;
  position: relative; display: flex; align-items: center; padding: 60px 70px;
  background: #0B0A09; color: var(--text); overflow: hidden;
}
.login-brand::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(640px 420px at 20% 10%, rgba(208, 140, 79, 0.12), transparent 65%);
}
.brand-inner { max-width: 560px; position: relative; z-index: 1; }
.brand-headline {
  font-family: var(--font-display); font-size: clamp(38px, 4.2vw, 56px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 44px 0 20px;
}
.brand-headline span { color: var(--accent-2); }
.brand-sub { color: var(--text-dim); font-size: 16px; max-width: 480px; }
.brand-stats { display: flex; align-items: center; gap: 26px; margin-top: 48px; }
.bstat strong { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--accent-2); display: block; }
.bstat span { font-size: 12.5px; color: var(--muted); display: block; max-width: 120px; margin-top: 2px; }
.bstat-div { width: 1px; height: 44px; background: rgba(242, 239, 233, 0.14); }

.login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 42px 38px;
  box-shadow: var(--shadow);
}
.login-logo-mobile { display: none; margin-bottom: 30px; }
.login-title { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -0.01em; }
.login-sub { color: var(--muted); margin: 8px 0 30px; font-size: 14px; }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px;
  padding: 0 14px; transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.field-box:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-box input {
  flex: 1; background: none; border: 0; outline: 0; padding: 15px 0; font-size: 15px; color: var(--text); min-width: 0;
}
.field-box input::placeholder { color: #AFA99F; }
.field-icon { display: flex; color: var(--muted); }
.field-icon svg, .field-eye svg { width: 18px; height: 18px; }
.field-eye { display: flex; color: var(--muted); padding: 6px; border-radius: 8px; transition: color .2s; }
.field-eye:hover { color: var(--accent-2); }

.login-error {
  background: var(--red-soft); border: 1px solid rgba(194, 91, 78, 0.3); color: #A8473B;
  border-radius: 12px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px;
  animation: shake .4s ease;
}
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted); font-size: 12px; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--border); }
.gbtn-wrap { display: flex; justify-content: center; min-height: 44px; }
/* O iframe do Google fica com fundo branco em páginas dark; isto o torna transparente de novo */
.gbtn-wrap iframe { color-scheme: light; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.auth-link { color: var(--accent-2); font-weight: 600; font-size: 13.5px; }
.auth-link:hover { text-decoration: underline; }

/* ---------- Boas-vindas (novo usuário) ---------- */
.welcome-hero { text-align: center; max-width: 520px; margin: 0 auto; }
.welcome-badge {
  width: 84px; height: 84px; margin: 0 auto 24px; border-radius: 50%;
  background: linear-gradient(135deg, #E3A96B, #C57E42); color: #FFFFFF;
  display: grid; place-items: center; box-shadow: 0 12px 34px rgba(197, 126, 66, 0.35);
}
.welcome-badge svg { width: 38px; height: 38px; }
.welcome-features { text-align: left; margin: 30px 0 8px; }
.welcome-feature { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.welcome-feature:last-child { border-bottom: 0; }
.welcome-feature .wf-icon {
  width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2);
  display: grid; place-items: center; flex-shrink: 0;
}
.welcome-feature .wf-icon svg { width: 19px; height: 19px; }
.welcome-feature strong { font-size: 14.5px; display: block; }
.welcome-feature span { font-size: 13px; color: var(--muted); }

/* ---------------- Botões ---------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px;
  padding: 13px 24px; border-radius: 13px; overflow: hidden;
  transition: transform .18s ease, box-shadow .2s ease, filter .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #FFFFFF; box-shadow: 0 6px 18px rgba(185, 111, 53, 0.22); }
.btn-primary:hover { filter: brightness(0.96); box-shadow: 0 8px 22px rgba(185, 111, 53, 0.28); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: #D4CEC5; background: var(--surface-2); }
.btn-danger { background: var(--red); color: #FFFFFF; box-shadow: 0 6px 18px rgba(194, 91, 78, 0.2); }
.btn-danger:hover { filter: brightness(0.96); }
.btn-green { background: var(--green); color: #FFFFFF; }
.btn-green:hover { filter: brightness(0.96); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; border-radius: 11px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-shine { display: none; }

.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #FFFFFF;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner.light { border-color: rgba(29,27,24,.15); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ONBOARDING
   ============================================================ */
.screen-onboarding { min-height: 100dvh; position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.ob-bg { position: absolute; inset: 0; opacity: .5; }
.ob-shell { position: relative; width: 100%; max-width: 720px; margin: 0 auto; padding: 34px 24px 60px; display: flex; flex-direction: column; flex: 1; }
.ob-head { display: flex; align-items: center; gap: 22px; margin-bottom: 40px; }
.ob-progress { flex: 1; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.ob-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.25,1); }
.ob-step-count { font-family: var(--font-display); font-size: 13px; color: var(--muted); min-width: 52px; text-align: right; }
.ob-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ob-question { animation: viewIn .4s cubic-bezier(.2,.8,.25,1) both; }
.ob-kicker { font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 14px; }
.ob-title { font-family: var(--font-display); font-size: clamp(23px, 3.2vw, 32px); font-weight: 700; line-height: 1.22; letter-spacing: -0.015em; margin-bottom: 10px; }
.ob-desc { color: var(--text-dim); margin-bottom: 30px; max-width: 560px; }
.ob-options { display: grid; gap: 11px; }
.ob-option {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 19px; font-size: 15px; color: var(--text);
  display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 2px rgba(28,25,20,.03);
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.ob-option:hover { border-color: var(--accent); transform: translateX(3px); }
.ob-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.ob-option .ob-letter {
  width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--accent-2); flex-shrink: 0;
}
.ob-option.selected .ob-letter { background: var(--accent); color: #FFFFFF; }
.ob-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 19px; font-size: 16px; outline: 0; transition: border-color .2s, box-shadow .2s;
}
.ob-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ob-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 34px; gap: 14px; }
.ob-info-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px;
  margin-bottom: 8px; box-shadow: var(--shadow);
}
.ob-score-ring { display: flex; justify-content: center; margin: 10px 0 24px; }

/* ============================================================
   LAYOUT DO APP
   ============================================================ */
.app { display: flex; min-height: 100dvh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 280px; flex-shrink: 0; position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft); padding: 26px 18px 20px;
  overflow-y: auto;
}
.sidebar-logo { padding: 0 8px 4px; }
.sidebar-streak {
  display: flex; align-items: center; gap: 13px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px;
}
.sidebar-streak .flame { color: var(--accent); display: flex; }
.sidebar-streak .flame svg { width: 26px; height: 26px; }
.sidebar-streak strong { font-family: var(--font-display); font-size: 18px; display: block; line-height: 1.1; }
.sidebar-streak span { font-size: 11.5px; color: var(--muted); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--text-dim); font-size: 14.5px; font-weight: 500; text-align: left; width: 100%;
  transition: background .16s ease, color .16s ease;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: rgba(28, 25, 20, 0.05); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }

.sidebar-foot { display: flex; flex-direction: column; gap: 12px; }
.side-emergency {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--red-soft); border: 1px solid rgba(194, 91, 78, 0.3); color: #A8473B;
  border-radius: 13px; padding: 13px; font-weight: 600; font-family: var(--font-display); font-size: 13.5px;
  transition: background .2s, transform .2s;
}
.side-emergency:hover { background: rgba(194, 91, 78, 0.16); transform: translateY(-1px); }
.side-emergency svg { width: 18px; height: 18px; }
.sidebar-user { display: flex; align-items: center; gap: 11px; padding: 10px 8px; border-top: 1px solid var(--border-soft); }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #FFFFFF; flex-shrink: 0;
}
.sidebar-user .u-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.sidebar-user .u-mail { font-size: 11.5px; color: var(--muted); }
.sidebar-user .u-info { flex: 1; min-width: 0; overflow: hidden; }
.btn-logout { color: var(--muted); padding: 8px; border-radius: 10px; display: flex; transition: color .2s, background .2s; }
.btn-logout:hover { color: var(--red); background: var(--red-soft); }
.btn-logout svg { width: 18px; height: 18px; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.offline-bar {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent-soft); color: var(--accent-2);
  border-bottom: 1px solid rgba(185, 111, 53, 0.25);
  padding: 9px 16px; font-size: 12.5px; font-weight: 600; text-align: center;
}
.offline-bar svg { width: 15px; height: 15px; flex-shrink: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 16px 30px; background: rgba(250, 249, 247, 0.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-burger { display: none; color: var(--text-dim); padding: 8px; border-radius: 10px; }
.topbar-burger svg { width: 22px; height: 22px; }
.topbar-info { flex: 1; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-date { font-size: 12.5px; color: var(--muted); text-transform: capitalize; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-flame {
  display: flex; align-items: center; gap: 7px; background: var(--accent-soft);
  border: 1px solid rgba(185, 111, 53, 0.22); color: var(--accent-2);
  padding: 8px 14px; border-radius: 999px; font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.topbar-flame svg { width: 16px; height: 16px; }
.btn-sos { padding: 10px 18px; font-size: 13.5px; }

.view { flex: 1; padding: 30px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(18px);
  border-top: 1px solid var(--border); height: var(--nav-h);
  padding: 0 6px calc(env(safe-area-inset-bottom, 0px));
  grid-template-columns: 1fr 1fr 86px 1fr 1fr; align-items: center;
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 8px 2px;
  transition: color .2s ease, transform .2s ease;
}
.bnav-item svg { width: 22px; height: 22px; }
.bnav-item.active { color: var(--accent-2); }
.bnav-item:active { transform: scale(.94); }
.bnav-sos {
  width: 58px; height: 58px; margin: 0 auto; transform: translateY(-14px);
  border-radius: 50%; background: var(--red);
  display: grid; place-items: center; color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(194, 91, 78, 0.35), 0 0 0 5px var(--bg);
  transition: transform .2s ease;
  animation: sosSoft 3.2s ease-in-out infinite;
}
@keyframes sosSoft {
  0%, 100% { box-shadow: 0 8px 22px rgba(194, 91, 78, 0.3), 0 0 0 5px var(--bg); }
  50% { box-shadow: 0 8px 30px rgba(194, 91, 78, 0.5), 0 0 0 5px var(--bg); }
}
.bnav-sos:active { transform: translateY(-14px) scale(.94); }
.bnav-sos svg { width: 25px; height: 25px; }

/* ---------- Sheet "mais" ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(28, 25, 20, 0.35); z-index: 70; backdrop-filter: blur(3px); animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  background: var(--surface); border-radius: 24px 24px 0 0; border: 1px solid var(--border); border-bottom: 0;
  padding: 14px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(28, 25, 20, 0.12);
  animation: sheetUp .35s cubic-bezier(.2,.8,.25,1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 18px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sheet-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 14px;
  color: var(--text-dim); font-size: 11px; font-weight: 600; transition: border-color .2s, color .2s;
}
.sheet-item svg { width: 22px; height: 22px; color: var(--accent-2); }
.sheet-item:active { border-color: var(--accent); color: var(--text); }
.sheet-item.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2);
  font-weight: 700;
}

/* ============================================================
   COMPONENTES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(28, 25, 20, 0.03);
  transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.card-hover:hover { border-color: #D8D2C9; transform: translateY(-2px); box-shadow: var(--shadow); }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-title svg { width: 18px; height: 18px; color: var(--accent); }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-dim);
}
.chip svg { width: 13px; height: 13px; }
.chip.accent { background: var(--accent-soft); color: var(--accent-2); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- Hero da Home / anel de sequência ---------- */
.hero-streak {
  display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 34px;
  box-shadow: var(--shadow);
}
.ring-wrap { position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.ring-wrap svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.25,1); }
.ring-center { text-align: center; position: relative; }
.ring-days { font-family: var(--font-display); font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.ring-label { font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.hero-info h2 { font-family: var(--font-display); font-size: clamp(20px, 2.3vw, 26px); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.hero-info > p { color: var(--text-dim); max-width: 520px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 22px; }

/* ---------- Missões ---------- */
.task-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 6px;
  border-bottom: 1px solid var(--border-soft); transition: opacity .3s;
}
.task-row:last-child { border-bottom: 0; }
.task-check {
  width: 26px; height: 26px; border-radius: 9px; border: 1.5px solid var(--border);
  display: grid; place-items: center; color: transparent; flex-shrink: 0;
  transition: background .25s, border-color .25s, color .25s;
}
.task-check svg { width: 14px; height: 14px; }
.task-row.done .task-check { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.task-row.done .task-name { text-decoration: line-through; color: var(--muted); }
.task-name { flex: 1; font-weight: 500; font-size: 14.5px; }
.task-xp { font-size: 11.5px; font-weight: 700; color: var(--accent-2); font-family: var(--font-display); }
.task-go { color: var(--muted); display: flex; padding: 6px; border-radius: 8px; transition: color .2s; }
.task-go:hover { color: var(--accent-2); }
.task-go svg { width: 16px; height: 16px; }

.progress-line { height: 7px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.progress-line > div { height: 100%; border-radius: 5px; background: var(--accent); transition: width .8s cubic-bezier(.2,.8,.25,1); }

/* ---------- Estat mini ---------- */
.stat-tile { text-align: left; }
.stat-tile .st-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat-tile .st-icon svg { width: 20px; height: 20px; }
.stat-tile strong { font-family: var(--font-display); font-size: 25px; font-weight: 700; display: block; line-height: 1.1; }
.stat-tile span { font-size: 12.5px; color: var(--muted); }

/* ---------- Benefícios / linha do tempo ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--surface-3); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--surface); display: grid; place-items: center;
}
.tl-item.reached .tl-dot { background: var(--accent); }
.tl-item.reached .tl-dot svg { width: 10px; height: 10px; color: #FFFFFF; }
.tl-day { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--accent-2); letter-spacing: .06em; }
.tl-title { font-weight: 600; font-size: 14.5px; margin: 2px 0; }
.tl-desc { font-size: 13px; color: var(--muted); }
.tl-item:not(.reached) { opacity: .55; }

/* ---------- Conquistas ---------- */
.badge-card { text-align: center; padding: 26px 16px; }
.badge-medal {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.badge-medal svg { width: 30px; height: 30px; }
.badge-card.unlocked .badge-medal {
  background: linear-gradient(135deg, #E3A96B, #C57E42);
  color: #FFFFFF; border-color: transparent;
  box-shadow: 0 6px 18px rgba(197, 126, 66, 0.28);
}
.badge-card.unlocked .badge-medal::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px dashed rgba(197, 126, 66, 0.4);
}
.badge-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.badge-req { font-size: 12px; color: var(--muted); margin-top: 3px; }
.badge-card:not(.unlocked) { opacity: .6; }

/* ---------- Chat (Mentor + Comunidade) ---------- */
.chat-shell { display: flex; flex-direction: column; height: calc(100dvh - 200px); min-height: 420px; }
.chat-head { padding: 16px 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-name { font-family: var(--font-display); font-weight: 700; }
.chat-head-desc { font-size: 12.5px; color: var(--muted); }
.chat-rooms { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.room-tab {
  padding: 9px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-dim); transition: all .2s ease;
}
.room-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.chat-box {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  scroll-behavior: smooth;
}
.msg { display: flex; gap: 12px; max-width: 78%; animation: msgIn .3s cubic-bezier(.2,.8,.25,1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }
.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-name { font-size: 12.5px; font-weight: 700; }
.msg-streak { font-size: 10.5px; color: var(--accent-2); font-weight: 600; background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }
.msg-time { font-size: 10.5px; color: var(--muted); }
.msg-bubble {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 11px 15px; border-radius: 5px 15px 15px 15px; font-size: 14px; line-height: 1.55;
  word-wrap: break-word; white-space: pre-wrap;
}
.msg.mine .msg-bubble { background: var(--accent-soft); border-color: rgba(185, 111, 53, 0.18); border-radius: 15px 5px 15px 15px; }
.msg.ai .msg-bubble { background: #FBF6F0; border-color: rgba(185, 111, 53, 0.16); }
.msg.ai .avatar { background: linear-gradient(135deg, #E3A96B, #C57E42); }
.chat-input-row { display: flex; gap: 11px; margin-top: 16px; }
.chat-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; font-size: 14.5px; outline: 0; resize: none; max-height: 130px;
  transition: border-color .2s, box-shadow .2s;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chat-send {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  background: var(--accent); color: #FFFFFF;
  display: grid; place-items: center; transition: transform .18s, filter .18s, box-shadow .18s;
}
.chat-send:hover { transform: translateY(-1px); filter: brightness(0.96); }
.chat-send svg { width: 20px; height: 20px; }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-4px); } }
.chat-online { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.chat-online i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.suggestion {
  font-size: 12.5px; padding: 8px 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-dim); transition: all .2s;
}
.suggestion:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---------- Diário ---------- */
.journal-entry { margin-bottom: 14px; }
.journal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.journal-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.journal-date { font-size: 11.5px; color: var(--muted); }
.journal-content { font-size: 14px; color: var(--text-dim); white-space: pre-wrap; }
.mood-picker { display: flex; gap: 9px; }
.mood-dot {
  width: 46px; height: 46px; border-radius: 13px; background: var(--surface); border: 1.5px solid var(--border);
  display: grid; place-items: center; color: var(--muted); transition: all .2s;
}
.mood-dot svg { width: 22px; height: 22px; }
.mood-dot.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); transform: scale(1.06); }
textarea.ta {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 15px 17px; font-size: 14.5px; outline: 0; resize: vertical; min-height: 110px; color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.ta:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input.ti, select.ti {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; font-size: 14.5px; outline: 0; color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input.ti:focus, select.ti:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Chips de escolha (Minha História) ---------- */
.pick-row { display: flex; gap: 9px; flex-wrap: wrap; }
.pick-chip {
  padding: 10px 17px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-dim); transition: all .2s ease;
}
.pick-chip:hover { border-color: var(--accent); color: var(--accent-2); }
.pick-chip.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

/* ---------- Mensagem diária exclusiva ---------- */
.daily-msg {
  position: relative; margin-bottom: 20px;
  border-left: 3px solid var(--accent); padding: 18px 48px 18px 22px;
  background: linear-gradient(135deg, #FBF6F0, var(--surface) 70%);
}
.daily-msg-kicker {
  display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px;
}
.daily-msg-kicker svg { width: 13px; height: 13px; }
.daily-msg-text {
  font-family: var(--font-display); font-size: 16px; font-weight: 500; font-style: italic;
  line-height: 1.5; transition: opacity .4s ease;
}
.daily-msg-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  transition: color .2s ease, background .2s ease;
}
.daily-msg-close:hover { color: var(--text); background: var(--surface-3); }
.daily-msg-close svg { width: 15px; height: 15px; }

/* ---------- Sons ---------- */
.sound-card { display: flex; align-items: center; gap: 16px; }
.sound-art {
  width: 56px; height: 56px; border-radius: 15px; flex-shrink: 0; display: grid; place-items: center;
  color: #FFFFFF;
}
.sound-art svg { width: 26px; height: 26px; }
.sound-info { flex: 1; min-width: 0; }
.sound-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.sound-desc { font-size: 12.5px; color: var(--muted); }
.sound-play {
  width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text); transition: all .2s;
}
.sound-play:hover { border-color: var(--accent); color: var(--accent-2); }
.sound-card.playing .sound-play { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.sound-play svg { width: 18px; height: 18px; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 3.5px; border-radius: 2px; background: var(--accent); animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 90%; animation-delay: .2s; }
.eq i:nth-child(3) { height: 60%; animation-delay: .4s; }
.eq i:nth-child(4) { height: 100%; animation-delay: .1s; }
@keyframes eq { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.vol-row { display: flex; align-items: center; gap: 14px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 5px; border-radius: 4px;
  background: var(--surface-3); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 2px 6px rgba(28,25,20,.2); cursor: pointer;
}

/* ---------- Respiração ---------- */
.breath-stage { display: flex; flex-direction: column; align-items: center; padding: 30px 0 10px; }
.breath-circle-wrap { position: relative; width: 260px; height: 260px; display: grid; place-items: center; margin-bottom: 26px; }
.breath-halo { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(185, 111, 53, 0.15); }
.breath-halo.h2 { inset: 22px; border-color: rgba(185, 111, 53, 0.22); }
.breath-halo.h3 { inset: 44px; border-color: rgba(185, 111, 53, 0.3); }
.breath-ball {
  width: 130px; height: 130px; border-radius: 50%;
  background: linear-gradient(135deg, #E3A96B, #C57E42);
  box-shadow: 0 10px 34px rgba(197, 126, 66, 0.3);
  display: grid; place-items: center; transition: transform 4s cubic-bezier(.4, 0, .3, 1);
}
.breath-ball span { font-family: var(--font-display); font-weight: 700; color: #FFFFFF; font-size: 15px; }
.breath-phase { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.breath-count { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- Estatísticas ---------- */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Aprender ---------- */
.article-card { display: flex; flex-direction: column; gap: 10px; }
.article-tag { align-self: flex-start; }
.article-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.35; }
.article-min { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.article-min svg { width: 13px; height: 13px; }
.article-body { color: var(--text-dim); font-size: 14.5px; line-height: 1.75; }
.article-body h3 { font-family: var(--font-display); color: var(--text); margin: 22px 0 8px; font-size: 17px; }
.article-body p { margin-bottom: 12px; }
.article-body ul { margin: 0 0 12px 20px; }
.article-body li { margin-bottom: 6px; }

/* ---------- Motivos ---------- */
.reason-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
  animation: viewIn .35s ease both;
}
.reason-num {
  width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.reason-text { flex: 1; font-size: 14.5px; }
.reason-del { color: var(--muted); display: flex; padding: 7px; border-radius: 9px; transition: color .2s, background .2s; }
.reason-del:hover { color: var(--red); background: var(--red-soft); }
.reason-del svg { width: 16px; height: 16px; }

/* ---------- Frase do dia ---------- */
.quote-card { background: linear-gradient(135deg, #FBF6F0, var(--surface) 70%); }
.quote-mark { color: var(--accent); margin-bottom: 10px; }
.quote-mark svg { width: 26px; height: 26px; }
.quote-text { font-family: var(--font-display); font-size: 17px; font-weight: 500; line-height: 1.5; font-style: italic; }
.quote-author { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ============================================================
   EMERGÊNCIA (mantida escura de propósito: foco e calma)
   ============================================================ */
.emergency {
  /* Paleta local escura: os componentes internos herdam estas variáveis */
  --bg: #0B0A09; --bg-2: #100E0C; --surface: #16130F; --surface-2: #1D1914; --surface-3: #262019;
  --border: #2B241C; --border-soft: #221C15;
  --text: #F2EFE9; --text-dim: #B8AFA2; --muted: #8B8272;
  --accent: #D08C4F; --accent-2: #E3A96B;
  --accent-soft: rgba(208, 140, 79, 0.13);
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  overflow-y: auto; color: var(--text);
}
.em-bg {
  position: absolute; inset: 0;
  background: radial-gradient(900px 600px at 50% 15%, #191310, #0B0A09 70%);
}
.em-pulse {
  position: absolute; top: 40%; left: 50%; width: 640px; height: 640px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(208, 140, 79, 0.07), transparent 65%);
}
.em-close {
  position: fixed; top: 22px; right: 24px; z-index: 210; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(242, 239, 233, 0.07); border: 1px solid rgba(242, 239, 233, 0.12);
  display: grid; place-items: center; color: #B8AFA2; transition: all .2s;
}
.em-close:hover { color: #F2EFE9; border-color: rgba(242, 239, 233, 0.3); }
.em-close svg { width: 18px; height: 18px; }
.em-content { position: relative; width: 100%; max-width: 660px; padding: 70px 26px; }
.em-stage { text-align: center; }
.em-kicker { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); animation: viewIn .5s ease both; }
.em-title { font-family: var(--font-display); font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 14px 0 10px; animation: viewIn .5s .1s ease both; }
.em-sub { color: var(--text-dim); font-size: 16px; max-width: 480px; margin: 0 auto; animation: viewIn .5s .2s ease both; }
.em-phrase {
  min-height: 60px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 600; font-style: italic;
  color: var(--accent-2); margin: 26px auto; max-width: 500px; transition: opacity .6s ease;
}
.em-actions { display: flex; flex-direction: column; align-items: center; gap: 11px; margin-top: 26px; animation: viewIn .5s .3s ease both; }
.em-win-btn { min-width: 280px; }
.em-actions-row { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }
.emergency .btn-ghost { background: rgba(242, 239, 233, 0.06); border-color: rgba(242, 239, 233, 0.14); color: #F2EFE9; }
.emergency .btn-ghost:hover { background: rgba(242, 239, 233, 0.1); border-color: rgba(242, 239, 233, 0.24); }
.em-chat { text-align: left; margin-top: 34px; animation: viewIn .5s .35s ease both; }
.em-chat .chat-box { height: 300px; }
.emergency .msg.ai .msg-bubble { background: rgba(208, 140, 79, 0.09); border-color: rgba(208, 140, 79, 0.2); }
.em-wave-timer { margin: 20px auto 0; max-width: 420px; animation: viewIn .5s .25s ease both; }
.em-wave-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.emergency .progress-line > div { background: var(--accent); }

/* ---------- Confirmação de emergência ---------- */
.em-confirm { text-align: center; }
.em-confirm-icon {
  width: 66px; height: 66px; margin: 4px auto 18px; border-radius: 50%;
  background: var(--red-soft); border: 1px solid rgba(194, 91, 78, 0.3);
  display: grid; place-items: center; color: var(--red);
}
.em-confirm-icon svg { width: 30px; height: 30px; }
.em-confirm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

/* ============================================================
   MODAIS / TOASTS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(28, 25, 20, 0.4);
  backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .22s ease both; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 30px; box-shadow: 0 24px 70px rgba(28, 25, 20, 0.22);
  animation: modalIn .35s cubic-bezier(.2,.8,.25,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 11px; justify-content: flex-end; margin-top: 24px; }

.toast-root { position: fixed; bottom: calc(var(--nav-h) + 18px); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  display: flex; align-items: center; gap: 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 13px; padding: 13px 18px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); width: 100%;
  animation: toastIn .35s cubic-bezier(.2,.8,.25,1) both;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success svg { color: var(--green); }
.toast.error svg { color: var(--red); }
.toast.info svg { color: var(--accent-2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

.fx-canvas { position: fixed; inset: 0; z-index: 400; pointer-events: none; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; margin-bottom: 14px; opacity: .5; }
.empty-state p { font-size: 14px; max-width: 320px; margin: 0 auto; }

.section-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 34px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title svg { width: 19px; height: 19px; color: var(--accent); }
.section-title:first-child { margin-top: 0; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 940px) {
  /* Login dedicado, estilo app nativo: sem card, tela inteira */
  .screen-login {
    display: block; min-height: 100dvh;
    background:
      radial-gradient(460px 340px at 50% -90px, rgba(208, 140, 79, 0.16), transparent 70%),
      var(--bg);
  }
  .login-brand { display: none; }
  .login-panel {
    min-height: 100dvh; background: none;
    padding: calc(30px + env(safe-area-inset-top, 0px)) 26px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .login-card {
    background: none; border: 0; box-shadow: none; padding: 0;
    max-width: 420px; width: 100%; margin: 0 auto;
    display: flex; flex-direction: column; justify-content: center; min-height: calc(100dvh - 120px);
  }
  .login-logo-mobile { display: flex; justify-content: center; position: relative; margin-bottom: 40px; }
  .login-logo-mobile::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 240px; height: 240px;
    transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(208, 140, 79, 0.14), transparent 65%);
  }
  .login-logo-mobile .logo-mark { font-size: 46px; }
  .login-logo-mobile .logo-text { font-size: 12px; }
  .login-title { font-size: 29px; text-align: center; }
  .login-sub { text-align: center; margin-bottom: 34px; font-size: 14.5px; }
  .field { margin-bottom: 20px; }
  .field-box { border-radius: 16px; background: var(--surface); }
  .field-box input { padding: 17px 0; }
  #loginBtn, #registerBtn { padding: 17px; border-radius: 16px; font-size: 15.5px; margin-top: 8px; }
  .auth-divider { margin: 24px 0 18px; }
  .auth-switch { margin-top: 22px; font-size: 14px; }
  .login-foot { margin-top: 26px; }

  .sidebar { display: none; }
  .bottomnav { display: grid; }
  .main { padding-bottom: calc(var(--nav-h) + 30px); }
  .topbar { padding: 14px 18px; }
  .topbar-burger { display: flex; }
  .btn-sos { display: none; }
  .view { padding: 20px 16px 40px; }

  .hero-streak { grid-template-columns: 1fr; text-align: center; padding: 28px 22px; gap: 22px; }
  .ring-wrap { margin: 0 auto; width: 190px; height: 190px; }
  .ring-days { font-size: 46px; }
  .hero-chips, .hero-actions { justify-content: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .toast-root { bottom: calc(var(--nav-h) + 26px); }

  /* Chat em tela cheia no celular */
  .chat-shell { height: calc(100dvh - 232px); min-height: 340px; }
  .msg { max-width: 95%; }
  .msg-bubble { font-size: 15px; padding: 11px 14px; }
  .chat-box { padding: 14px; gap: 12px; border-radius: 16px; }
  .chat-head { padding: 10px 14px; margin-bottom: 10px; gap: 11px; }
  .chat-head .avatar { width: 32px; height: 32px; border-radius: 10px; }
  .chat-head-name { font-size: 14px; }
  .chat-head-desc { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head-status { display: none; }
  .suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .suggestions::-webkit-scrollbar { display: none; }
  .suggestion { white-space: nowrap; flex-shrink: 0; }
  .chat-rooms { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .chat-rooms::-webkit-scrollbar { display: none; }
  .room-tab { white-space: nowrap; flex-shrink: 0; padding: 8px 15px; }
  .chat-input-row { margin-top: 10px; }
  .chat-input { padding: 13px 15px; }
  .chat-send { width: 48px; height: 48px; }

  /* 16px evita o zoom automático do celular ao focar campos */
  .chat-input, textarea.ta, input.ti, .ob-input, .field-box input, select.ti { font-size: 16px; }

  /* Emergência limpa no celular */
  .em-content { padding: 60px 16px 30px; }
  .em-kicker { font-size: 10.5px; }
  .em-title { font-size: 25px; margin: 10px 0 6px; }
  .em-sub { display: none; }
  .em-phrase { font-size: 15.5px; min-height: 46px; margin: 16px auto; max-width: 320px; }
  .em-wave-timer { max-width: 100%; }
  .em-wave-label { font-size: 11.5px; }
  .em-actions { margin-top: 18px; gap: 9px; }
  .em-win-btn { min-width: 0; width: 100%; }
  .em-actions-row { width: 100%; }
  .em-actions-row .btn { flex: 1; padding: 12px 10px; font-size: 13.5px; }
  .em-chat { margin-top: 20px; }
  .em-chat .chat-box { height: 40dvh; min-height: 230px; }
  .em-close { top: 12px; right: 12px; width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .brand-stats { flex-direction: column; align-items: flex-start; }
  .logo-xl .logo-mark { font-size: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
