:root {
  --ink: #26232B;
  --muted: #6F6A72;
  --line: #E6E0D8;
  --bg: #F6F3EE;
  --card: #FFFFFF;
  --soft: #F0EBE3;
  --cor: #E2621B;          /* laranja do mascote */
  --cor-escura: #B93A0E;
  --estavel: #5FA88A;
  --hipomania: #F0A12B;
  --mania: #E2551B;
  --depressao: #6E8FB5;
  --misto: #9A7BC8;
  --oscilando: #B48AD6;
  --alerta: #D9485F;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(38,35,43,.05), 0 8px 24px rgba(38,35,43,.07);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; font-size: 16px; }
body.com-abas { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
small { font-weight: 400; color: var(--muted); }

#app { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px 24px; }

/* ---------- botões e campos ---------- */
.btn { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; min-height: 44px; }
.btn.cor { background: var(--cor); border-color: var(--cor); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { padding: 6px 12px; font-size: 14px; min-height: 36px; }
.btn.grande { width: 100%; padding: 14px 18px; font-size: 17px; border-radius: 14px; }
.btn:active { transform: scale(.98); }
.botoes { display: flex; gap: 8px; flex-wrap: wrap; }

label.campo { display: grid; gap: 6px; font-weight: 700; font-size: 15px; margin-top: 12px; }
.texto-legal h2 { font-size: 19px; margin: 22px 0 6px; }
.texto-legal p, .texto-legal li { line-height: 1.6; }
.aceite { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; line-height: 1.45; }
.aceite input { width: 22px; height: 22px; flex: none; accent-color: var(--cor); margin-top: 1px; }
.erro-form { color: var(--alerta); font-weight: 700; margin-top: 12px; }
.conta form .btn { margin-top: 16px; }
.link-convite { word-break: break-all; background: var(--bg); border-radius: 10px; padding: 10px; margin: 14px 0 10px; font-size: 14px; }
.espaco-topo { margin-top: 12px; }
input[type=email], input[type=password], input[type=date],
input[type=text], input[type=tel], input[type=time], input[type=number], textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); font-weight: 600; min-height: 46px;
}
textarea { resize: vertical; font-weight: 400; line-height: 1.5; }
input:focus, textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--cor) 40%, transparent); outline-offset: 2px; }

.cartao { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-top: 14px; }
.cartao h3 { font-size: 17px; margin-bottom: 8px; }
.cartao ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.5; }
.cartao li + li { margin-top: 4px; }
.dica { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.45; }
.sub { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.centro { display: flex; justify-content: center; margin: 8px 0; }
.centro-texto { text-align: center; }
.h2-espaco { font-size: 18px; margin-top: 24px; margin-bottom: 4px; }
.aviso-pequeno { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 8px 0; line-height: 1.45; }
.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duas-colunas label.campo { margin-top: 0; }
.pagina h1 { font-size: 26px; margin-top: 8px; }

/* ---------- registro e boas-vindas ---------- */
.registro-topo { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; margin-bottom: 8px; }
.btn-voltar { font-size: 32px; line-height: 1; text-decoration: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.btn-fechar { text-decoration: none; color: var(--muted); font-weight: 700; padding: 10px 4px; }
.progresso { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progresso span { display: block; height: 100%; background: var(--cor); border-radius: 99px; transition: width .3s; }
.registro-data { color: var(--muted); font-size: 14px; font-weight: 700; margin-top: 4px; }
.registro h1, .boas h1 { font-size: 26px; margin-top: 6px; }
.registro-corpo { margin-top: 10px; }
.registro-rodape { position: sticky; bottom: 0; padding: 14px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22%); display: grid; gap: 4px; margin-top: 18px; }

.bloco { background: var(--card); border-radius: var(--radius); padding: 14px; margin-top: 12px; box-shadow: var(--shadow); }
.bloco h3 { font-size: 16px; margin-bottom: 10px; }
.bloco > .dica { margin: -4px 0 12px; }
.rotulo-menor { font-size: 14px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
.cartao .texto { line-height: 1.55; }

/* escala de botões (Nenhuma / Leve / Moderada / Forte) */
.escala { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.escala.cinco { grid-template-columns: repeat(5, 1fr); }
.escala.tres { grid-template-columns: repeat(3, 1fr); }
.escala.mini { grid-template-columns: repeat(2, minmax(64px, auto)); }
.escala button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 4px; min-height: 48px; font-weight: 700; font-size: 14px; cursor: pointer; line-height: 1.2; }
.escala button.on { color: #fff; border-color: transparent; background: var(--tom, var(--ink)); }
.tom-depressao { --tom: var(--depressao); }
.tom-elevacao { --tom: var(--hipomania); }
.tom-elevacao button.on[style*="--n:3"] { --tom: var(--mania); }
.tom-irritabilidade { --tom: var(--alerta); }
.tom-ansiedade { --tom: var(--misto); }
.tom-energia { --tom: var(--estavel); }
.tom-cansaco { --tom: #8C7B6B; }
.grupo-titulo { font-size: 20px; margin: 22px 0 -2px; }
.quatro-neutro { --tom: var(--ink); }
.escala button.on[style*="--n:0"] { --tom: #8E8A92; }
.escala.mini button.on { background: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--bg); border-radius: 99px; padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 40px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips.leitura .chip { cursor: default; font-size: 13px; padding: 6px 12px; min-height: 0; }
.boas .chips { margin-top: 12px; }
.inicio-topo { display: flex; align-items: center; gap: 10px; }
.inicio-topo h2 { font-size: 18px; }
.inicio-fase label.campo { margin-top: 8px; }

.linha-sim-nao { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.linha-sim-nao + .linha-sim-nao { border-top: 1px solid var(--soft); }
.linha-chave { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-weight: 700; }
.linha-chave + .linha-chave { border-top: 1px solid var(--soft); }
.linha-chave input { width: 48px; height: 28px; accent-color: var(--cor); }

.carinhas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.carinhas button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 2px; font-size: 12px; font-weight: 700; cursor: pointer; display: grid; gap: 2px; }
.carinhas button span { font-size: 26px; }
.carinhas button.on { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 12%, var(--card)); }
.total-sono { margin-top: 12px; font-size: 15px; }

.notas { list-style: none; padding: 0; margin: 0 0 10px; }
.notas li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.notas .hora { font-weight: 800; color: var(--cor-escura); }
.nova-nota { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.nova-nota .btn { grid-column: 1 / -1; }
.btn-x { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; width: 36px; height: 36px; }

.aviso-saude { background: #FFF6EC; border: 1.5px solid #F6D3AE; box-shadow: none; }
.aviso-saude p { margin-top: 4px; line-height: 1.5; }

.lista-remedios { list-style: none; padding: 0; margin: 0; }
.lista-remedios li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.novo-remedio { box-shadow: none; border: 1.5px dashed var(--line); }
.novo-remedio .btn { margin-top: 12px; width: 100%; }

/* ---------- Hoje ---------- */
.hoje-topo { display: flex; align-items: center; gap: 10px; }
.ola { font-size: 22px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perfil { width: 46px; height: 46px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden; flex: none; }
.perfil svg { margin-top: 6px; }
.btn-ajuda { text-decoration: none; background: #FCE8EB; color: #A3283C; font-weight: 800; font-size: 14px; padding: 9px 14px; border-radius: 99px; white-space: nowrap; }
.data-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; margin-top: 14px; }
.data-nav a, .data-nav .desligado { font-size: 30px; text-decoration: none; color: var(--muted); height: 44px; display: grid; place-items: center; }
.data-nav .desligado { opacity: .25; }
.data-nav strong { font-size: 17px; }
.info-dia { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 2px; }

.fase { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; border-top: 5px solid var(--cor-fase); }
.fase-mascote { background: color-mix(in srgb, var(--cor-fase) 14%, var(--card)); border-radius: 14px; padding: 6px; }
.fase-rotulo { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fase h2 { font-size: 21px; margin: 2px 0 6px; }
.fase p { line-height: 1.45; }
.fase .motivos { font-size: 14px; color: var(--muted); padding-left: 18px; margin: 8px 0 10px; }
.fase-vida { background: #FCEEF2; box-shadow: none; border: 1.5px solid #F5D3DD; }
.fase-vida p { line-height: 1.5; }
.alerta-sinais { background: #FFF7E3; box-shadow: none; border: 1.5px solid #F3DFA6; }
.registrar { margin-top: 16px; }
.resumo { margin-top: 20px; }
.resumo h3 { font-size: 18px; }
.botoes-registro { display: grid; gap: 10px; margin-top: 16px; }
.linha-dia { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.linha-dia a { display: grid; grid-template-columns: 48px 44px 1fr; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 6px 10px; box-shadow: var(--shadow); text-decoration: none; }
.linha-dia .hora { font-weight: 800; color: var(--cor-escura); }
.momento-texto { display: grid; min-width: 0; }
.momento-texto small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opcao { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; text-decoration: none; }
.opcao strong { display: block; font-size: 18px; }
.opcao small { display: block; margin-top: 2px; line-height: 1.4; }
.opcao-ic { font-size: 30px; text-align: center; }
.periodos { display: grid; gap: 10px; }
.periodo-nome { font-weight: 800; display: block; margin-bottom: 6px; }
.periodo-opcoes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.periodo-opcoes button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 6px 2px; font-size: 12px; font-weight: 700; display: grid; gap: 2px; cursor: pointer; }
.periodo-opcoes button span { font-size: 20px; }
.periodo-opcoes button.on { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 12%, var(--card)); }
.periodos-leitura { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.hora-momento { max-width: 160px; }
.resumo-titulo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chip.ciclo { background: #FCEEF2; border-color: #F5D3DD; color: #9C3657; }
.info-ciclo { font-weight: 700; color: #9C3657; margin-bottom: 6px; }
.info-dia + .centro { margin-top: 10px; }
.resumo-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-cartao { background: var(--card); border-radius: 12px; padding: 10px 8px; box-shadow: var(--shadow); display: grid; gap: 2px; text-align: center; }
.mini-cartao span { font-size: 12px; color: var(--muted); font-weight: 700; }
.mini-cartao strong { font-size: 14px; }
.resumo .chips { margin-top: 12px; }
.diario-trecho { margin: 12px 0 0; background: var(--card); border-left: 4px solid var(--cor); border-radius: 0 12px 12px 0; padding: 12px 14px; line-height: 1.5; white-space: pre-wrap; }
.sequencia { text-align: center; color: var(--muted); font-weight: 700; margin-top: 18px; }

@media (max-width: 400px) {
  .resumo-grade { grid-template-columns: repeat(2, 1fr); }
  .fase { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .fase .motivos { text-align: left; }
}

/* ---------- ajuda ---------- */
.contatos { display: grid; gap: 10px; margin-top: 16px; }
.contatos .btn { justify-content: flex-start; }
.contatos small { margin-left: auto; }
.contato { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.btn.whats { background: #E7F6EC; border-color: #BFE6CC; color: #1F7A3E; border-radius: 14px; }
.btn.ghost-borda { border-style: dashed; color: var(--muted); }
.btn.cvv { background: #EAF4FB; border-color: #C9E2F4; }
.btn.samu { background: #FCE8EB; border-color: #F4C6CE; }
.respiracao { text-align: center; }
.circulo-respirar { height: 170px; display: grid; place-items: center; }
.circulo-respirar span { width: 70px; height: 70px; border-radius: 50%; background: color-mix(in srgb, var(--estavel) 55%, var(--card)); animation: respirar 10s ease-in-out infinite; }
@keyframes respirar { 0%, 100% { transform: scale(1); } 40%, 50% { transform: scale(2.1); } }

.galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.galeria figure { margin: 0; background: var(--card); border-radius: 14px; padding: 8px; text-align: center; box-shadow: var(--shadow); }
.galeria figcaption { font-size: 12px; font-weight: 700; color: var(--muted); }
.galeria svg { width: 100%; height: auto; }

/* ---------- abas de baixo ---------- */
.abas { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(540px, calc(100% - 20px)); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-radius: 22px; box-shadow: 0 6px 28px rgba(38,35,43,.14); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; z-index: 10; }
.abas a { display: grid; justify-items: center; gap: 2px; text-decoration: none; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; border-radius: 16px; }
.abas svg { width: 24px; height: 24px; fill: currentColor; }
.abas a.on { color: var(--cor-escura); background: color-mix(in srgb, var(--cor) 12%, var(--card)); }
.abas a.mais { color: var(--cor-escura); padding-top: 0; }
.mais-bola { width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; background: var(--cor); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; box-shadow: 0 6px 16px color-mix(in srgb, var(--cor) 45%, transparent); border: 4px solid var(--bg); }
.abas a.mais:active .mais-bola { transform: scale(.94); }

.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: 100px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 20; max-width: calc(100% - 32px); }

/* ---------- mascote: movimentos ---------- */
.mascote { display: block; overflow: visible; }
.m-pulo { animation: respirar-mascote 2.4s steps(2, jump-none) infinite; }
@keyframes respirar-mascote { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.6px); } }
.m-sombra { animation: sombra 2.4s steps(2, jump-none) infinite; transform-origin: 12px 33px; }
@keyframes sombra { 50% { transform: scaleX(.85); } }

.m-olhos-fechados { opacity: 0; animation: piscar 4.2s infinite; }
.m-olhos-abertos { animation: piscar-abertos 4.2s infinite; }
@keyframes piscar { 0%, 92%, 100% { opacity: 0; } 94%, 97% { opacity: 1; } }
@keyframes piscar-abertos { 0%, 92%, 100% { opacity: 1; } 94%, 97% { opacity: 0; } }

.m-fogo.m-quadro2 { opacity: 0; }
.m-fogo.m-quadro1 { animation: quadro-a .5s steps(1) infinite; }
.m-fogo.m-quadro2 { animation: quadro-b .5s steps(1) infinite; }
.m-mania .m-fogo.m-quadro1 { animation-duration: .3s; }
.m-mania .m-fogo.m-quadro2 { animation-duration: .3s; }
@keyframes quadro-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes quadro-b { 0% { opacity: 0; } 50% { opacity: 1; } }
.m-mania .m-pulo { animation: pulinho .6s steps(2, jump-none) infinite; }
@keyframes pulinho { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }

.m-nuvem { animation: flutuar 3.2s steps(2, jump-none) infinite; }
@keyframes flutuar { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(1px); } }
.m-gota { animation: cair 1s linear infinite; }
@keyframes cair { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(6px); opacity: 0; } }
.m-depressao .m-pulo, .m-depressao-leve .m-pulo { animation-duration: 3.6s; }

.m-onda { animation: onda 1.6s steps(4) infinite; }
@keyframes onda { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-1px); } 75% { transform: translateY(1px); } }

.m-coracao { animation: batida 1.2s steps(2, jump-none) infinite; transform-origin: 11.5px 28px; }
@keyframes batida { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.m-alegre .m-pulo { animation: comemorar 1s steps(2, jump-none) infinite; }
@keyframes comemorar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

@media (prefers-reduced-motion: reduce) {
  .mascote *, .circulo-respirar span { animation: none !important; }
  .m-fogo.m-quadro2, .m-olhos-fechados { opacity: 0; }
}

/* ---------- mascote liso: movimentos ---------- */
.mascote-liso { overflow: visible; }
/* movimentos do mascote liso */
.ml-corpo-todo { animation: ml-respira 2.6s ease-in-out infinite; }
@keyframes ml-respira { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.ml-olhos { transform-origin: 60px 78px; animation: ml-piscar 4.2s infinite; }
@keyframes ml-piscar { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.ml-chama { animation: ml-tremula .45s ease-in-out infinite alternate; }
.ml-chama-grande { animation-duration: .28s; }
@keyframes ml-tremula { 0% { transform: scale(1, 1) skewX(0); } 100% { transform: scale(1.04, 1.1) skewX(-3deg); } }
.ml-mania .ml-corpo-todo { animation: ml-pulinho .6s ease-in-out infinite; }
@keyframes ml-pulinho { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ml-nuvem { animation: ml-flutua 3.2s ease-in-out infinite; }
@keyframes ml-flutua { 0%, 100% { translate: 0 0; } 50% { translate: 2px 0; } }
.ml-gota { animation: ml-cair 1s linear infinite; }
@keyframes ml-cair { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
.ml-depressao .ml-corpo-todo, .ml-depressao-leve .ml-corpo-todo { animation-duration: 3.8s; }
.ml-onda { animation: ml-onda 1.6s ease-in-out infinite; }
@keyframes ml-onda { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ml-coracao { transform-origin: 60px 118px; animation: ml-batida 1.1s ease-in-out infinite; }
@keyframes ml-batida { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
.ml-alegre .ml-corpo-todo { animation: ml-pulinho 1s ease-in-out infinite; }
.ml-alegre .ml-braco-e { transform-origin: 42px 116px; animation: ml-acena .5s ease-in-out infinite alternate; }
@keyframes ml-acena { from { transform: rotate(10deg); } to { transform: rotate(55deg); } }
@media (prefers-reduced-motion: reduce) { .mascote-liso * { animation: none !important; } }

/* ---------- remédios e trajetória ---------- */
.remedio-cartao, .tentativa { display: block; text-decoration: none; box-shadow: none; border: 1.5px solid var(--line); margin-top: 10px; }
.remedio-topo { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.remedio-topo span { color: var(--muted); font-weight: 700; font-size: 14px; }
.progresso.fino { height: 6px; margin-top: 10px; }
.aviso-remedio { background: #FFF7E3; border-radius: 10px; padding: 10px 12px; margin-top: 10px; line-height: 1.45; font-size: 14px; }
.estagio { border-top: 5px solid var(--estavel); }
.estagio-adaptacao { border-top-color: var(--hipomania); }
.estagio-esperando { border-top-color: var(--depressao); }
.estagio-encerrado { border-top-color: #A9A3AB; }
.exame { background: #EEF5FB; box-shadow: none; border: 1.5px solid #CFE2F1; }
.acao-remedio { border-top: 1px solid var(--soft); padding: 10px 0; }
.acao-remedio summary { font-weight: 800; cursor: pointer; padding: 4px 0; }
.tentativa.encerrada { background: var(--bg); }
.linha-tempo-remedios { display: grid; gap: 8px; }
.faixa-remedio { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.faixa-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faixa-trilho { position: relative; height: 14px; background: var(--soft); border-radius: 99px; }
.faixa { position: absolute; top: 0; bottom: 0; background: var(--cor); border-radius: 99px; }
.faixa.encerrada { background: #B9B2BB; }
.aviso-hoje { box-shadow: none; line-height: 1.5; }
.aviso-info { background: #F3EEFB; border: 1.5px solid #E2D8F3; }
.aviso-exame { background: #EEF5FB; border: 1.5px solid #CFE2F1; }
.aviso-alerta { background: #FFF7E3; border: 1.5px solid #F3DFA6; }
.aviso-urgente { background: #FCE8EB; border: 1.5px solid #F4C6CE; font-weight: 700; }

/* ---------- gráficos ---------- */
.periodos-graficos { margin-top: 12px; }
.exemplo-chave { margin-top: 6px; }
.aviso-exemplo { background: #F3EEFB; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 700; color: #6B4FA0; }
.grafico-humor { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; }
.g-eixo { stroke: #CFC8BE; stroke-width: 1; }
.g-ref { stroke: #CFC8BE; stroke-width: .8; stroke-dasharray: 3 3; }
.g-remedio { stroke: #26232B; stroke-width: 1; stroke-dasharray: 2 3; opacity: .45; }
.g-vazio { fill: #DDD6CC; }
.g-rotulo, .g-data { font: 700 8px var(--font); fill: var(--muted); }
.g-lua { font-size: 9px; fill: #B8AE9F; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legenda i.bola { border-radius: 50%; }
.legenda i.traco { width: 12px; height: 0; border-top: 2px dashed #8E8A92; border-radius: 0; vertical-align: 3px; }
.mapa { display: grid; grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); gap: 4px; margin-top: 10px; }
.mapa span { aspect-ratio: 1; border-radius: 4px; }
.mapa.mapa-ano { grid-template-columns: repeat(auto-fill, minmax(9px, 1fr)); gap: 2px; }
.mapa.mapa-ano span { border-radius: 2px; }

/* ---------- diário de humor ---------- */
.escrever-diario textarea { margin-top: 4px; }
.btn.gravando { background: #FCE8EB; border-color: #F4C6CE; color: #A3283C; }
.dois-modos { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.busca-diario { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); margin-top: 14px; min-height: 46px; }
.filtros-diario { margin-top: 10px; }
.dia-diario { display: block; text-decoration: none; border-left: 5px solid var(--cor-fase); }
.dia-topo { display: flex; gap: 10px; align-items: center; }
.dia-topo strong { display: block; }
.dia-mascote { width: 44px; flex: none; }
.dia-fase { font-size: 13px; font-weight: 700; color: var(--muted); }
.dia-extras { font-size: 13px; color: var(--muted); margin-top: 6px; }
.dia-texto { margin-top: 8px; line-height: 1.5; }
.dia-texto .hora { font-weight: 800; color: var(--cor-escura); font-size: 13px; }
.dia-texto mark { background: #FFE9A8; border-radius: 3px; padding: 0 2px; }
.cal-semana, .cal-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-semana { margin-top: 10px; font-size: 12px; font-weight: 800; color: var(--muted); }
.cal-grade { margin-top: 6px; }
.dia-cal { aspect-ratio: 1; border-radius: 10px; background: var(--bg); display: grid; grid-template-rows: 1fr auto; padding: 4px 2px 3px; text-decoration: none; font-weight: 800; font-size: 14px; }
.dia-cal.hoje { outline: 2.5px solid var(--ink); outline-offset: -2px; }
.dia-cal.futuro { opacity: .35; }
.dia-cal .marcas { display: flex; justify-content: center; gap: 2px; min-height: 10px; align-items: center; }
.dia-cal i { font-style: normal; font-size: 9px; line-height: 1; }
.dia-cal .m-ciclo { width: 6px; height: 6px; border-radius: 50%; background: #D95A82; box-shadow: 0 0 0 1.5px #fff; }

.em-adaptacao { color: #B9700E; font-weight: 700; }
.dia-detalhes { margin-top: 8px; }
.chip.alerta { background: #FCE8EB; border-color: #F4C6CE; color: #A3283C; }
.exemplo-rodape { margin-top: 18px; opacity: .8; font-size: 14px; }

/* ---------- instalar ---------- */
.instalar-cartao { background: #FFF4E8; box-shadow: none; border: 1.5px solid #F6D3AE; }
.cartao.destaque { border: 2px solid var(--cor); }
.passos { margin: 8px 0 0; padding-left: 22px; line-height: 1.6; }
.passos li + li { margin-top: 6px; }
.ic-passo { width: 18px; height: 18px; vertical-align: -3px; color: #2F7BF6; }

/* ---------- acompanhante ---------- */
.permissoes { margin-top: 4px; }
.permissao span { display: grid; gap: 2px; font-weight: 400; }
.permissao small { line-height: 1.4; }
.observacoes { background: #FFF8E6; box-shadow: none; border: 1.5px solid #F3E3B5; }

.profissional span { display: block; }
.contato-links { display: flex !important; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 14px; font-weight: 700; }
.contato-links a { color: var(--cor-escura); text-decoration: none; }

/* ---------- padrões ---------- */
.lista-padroes { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.lista-padroes li + li { margin-top: 6px; }
.tabela-padrao { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.tabela-padrao th { text-align: right; font-size: 11px; color: var(--muted); padding: 4px; }
.tabela-padrao td { padding: 6px 4px; border-top: 1px solid var(--soft); text-align: right; }
.tabela-padrao td:first-child { text-align: left; }
.tabela-padrao td.destaque { background: #FCEEF2; font-weight: 800; color: #9C3657; border-radius: 6px; }
.linha-chave span small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.nuvem { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 6px; font-weight: 800; color: var(--cor-escura); }
.nuvem small { font-size: 11px; color: var(--muted); }
.sobre-app { background: #FFF8F1; box-shadow: none; border: 1.5px solid #F6D9BE; }
.sobre-topo { display: flex; gap: 12px; align-items: center; }
.sobre-subtitulo { font-weight: 700; color: var(--cor-escura); font-size: 14px; margin-top: 2px; }

/* ---------- perfil ---------- */
.notif-estado { font-weight: 800; margin: 0; }
.notif-estado.ligado { color: color-mix(in srgb, var(--estavel) 70%, var(--ink)); }
.linha-chave.notif-remedio { padding-left: 14px; font-weight: 600; }
label.campo-hora { margin-top: 4px; }
label.campo-hora input { max-width: 160px; }
.perfil-link { display: grid; justify-items: center; gap: 1px; text-decoration: none; flex: none; }
.perfil-link small { font-size: 11px; font-weight: 800; color: var(--muted); }
.opcao-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; }
.opcao-linha strong { display: block; font-size: 17px; }
.opcao-linha small { display: block; margin-top: 2px; line-height: 1.4; }
.opcao-linha > span:last-child { font-size: 26px; color: var(--muted); }

/* ---------- cartão "Para hoje" ---------- */
.para-hoje-lista { list-style: none; padding: 0 !important; margin: 0 !important; }
.para-hoje-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); line-height: 1.5; }
.para-hoje-item:first-child { border-top: 0; padding-top: 2px; }
.para-hoje-item + .para-hoje-item { margin-top: 0 !important; }
.para-hoje-item strong { display: block; }
.para-hoje-item ul { padding-left: 18px; }
.para-hoje-item a { font-weight: 700; color: var(--cor-escura); }
.para-hoje-ic { font-size: 20px; flex: none; width: 26px; text-align: center; }
.para-hoje details summary { cursor: pointer; font-weight: 700; color: var(--cor-escura); padding: 8px 0 2px; }

/* ---------- folha do botão ＋ ---------- */
.folha-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(20,18,24,0); transition: background .2s; display: flex; align-items: flex-end; justify-content: center; }
.folha-fundo.aberta { background: rgba(20,18,24,.4); }
.folha { width: 100%; max-width: 560px; background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s ease-out; }
.folha-fundo.aberta .folha { transform: none; }
.folha h2 { font-size: 20px; text-align: center; margin: 8px 0 2px; }
.folha .btn.ghost { margin-top: 8px; }
.folha-alca { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { .folha, .folha-fundo { transition: none; } }

/* ---------- modo escuro ----------
   Liga com a classe "escuro" no <html> (aparencia.js decide: celular no escuro, horário da noite ou escolha da pessoa).
   Cores quentes e pouco brilho, para não acordar ninguém na hora de fechar o dia. */
html.escuro {
  color-scheme: dark;
  --ink: #EDE7E0;
  --muted: #A69E97;
  --line: #3A3430;
  --bg: #171412;
  --card: #221E1B;
  --soft: #2C2723;
  --cor: #E8752F;
  --cor-escura: #F29A5E;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --t-rosa: #3A2329; --t-rosa-borda: #5A3540; --t-rosa-texto: #F2A7B8;
  --t-amarela: #352C17; --t-amarela-borda: #54451F;
  --t-azul: #1D2A36; --t-azul-borda: #2E4356;
  --t-lilas: #2A2337; --t-lilas-borda: #3F3456; --t-lilas-texto: #C9B5EE;
  --t-laranja: #362618; --t-laranja-borda: #563A22;
  --t-verde: #1B3024; --t-verde-borda: #2A4D38; --t-verde-texto: #8FD6A8;
}
html.escuro img, html.escuro .fase-mascote, html.escuro .centro > svg { filter: brightness(.92); }
html.escuro .btn.cor, html.escuro .mais-bola { color: #1A1310; }
html.escuro .chip.on { color: #171412; }
html.escuro .escala button.on { color: #fff; }
html.escuro .aviso { color: #171412; }
html.escuro .abas { background: rgba(34,30,27,.94); box-shadow: 0 4px 20px rgba(0,0,0,.45); }
html.escuro .btn-ajuda, html.escuro .btn.samu, html.escuro .aviso-urgente, html.escuro .btn.gravando, html.escuro .chip.alerta { background: var(--t-rosa); border-color: var(--t-rosa-borda); color: var(--t-rosa-texto); }
html.escuro .fase-vida, html.escuro .chip.ciclo, html.escuro .tabela-padrao td.destaque { background: var(--t-rosa); border-color: var(--t-rosa-borda); color: var(--t-rosa-texto); }
html.escuro .info-ciclo { color: var(--t-rosa-texto); }
html.escuro .alerta-sinais, html.escuro .aviso-remedio, html.escuro .aviso-alerta, html.escuro .observacoes { background: var(--t-amarela); border-color: var(--t-amarela-borda); }
html.escuro .exame, html.escuro .aviso-exame, html.escuro .btn.cvv { background: var(--t-azul); border-color: var(--t-azul-borda); }
html.escuro .aviso-info, html.escuro .aviso-exemplo { background: var(--t-lilas); border-color: var(--t-lilas-borda); color: var(--t-lilas-texto); }
html.escuro .aviso-saude, html.escuro .instalar-cartao, html.escuro .sobre-app { background: var(--t-laranja); border-color: var(--t-laranja-borda); }
html.escuro .btn.whats { background: var(--t-verde); border-color: var(--t-verde-borda); color: var(--t-verde-texto); }
html.escuro .dia-texto mark { background: #5A4A1C; color: var(--ink); }
html.escuro .em-adaptacao { color: #E8B060; }
html.escuro .g-eixo, html.escuro .g-ref { stroke: #4A433D; }
html.escuro .g-remedio { stroke: #EDE7E0; }
html.escuro .g-vazio { fill: #3A3430; }
html.escuro .g-lua { fill: #7D746C; }
html.escuro .dia-cal .m-ciclo { box-shadow: 0 0 0 1.5px var(--card); }
html.escuro .folha-fundo.aberta { background: rgba(0,0,0,.6); }
html.escuro .escala button.on:not([style]), html.escuro .escala.mini button.on { color: #171412; }

/* ---------- tour da primeira vez ---------- */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-buraco { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(20,18,24,.62); transition: all .25s; pointer-events: none; }
.tour-balao { position: fixed; left: 16px; right: 16px; max-width: 420px; margin: 0 auto; background: var(--card); color: var(--ink); border-radius: 16px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); line-height: 1.5; }
.tour-rodape { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-pontos { flex: 1; display: flex; gap: 5px; }
.tour-pontos i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-pontos i.on { background: var(--cor); }

/* ---------- plano de segurança ---------- */
.plano-itens { list-style: none; padding: 0 !important; margin: 8px 0 0 !important; }
.plano-itens li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); margin: 0 !important; }
.plano-itens li:first-child { border-top: 0; }
.plano-novo { display: flex; gap: 8px; margin-top: 10px; }
.plano-novo input { flex: 1; min-width: 0; }
.plano-leitura h4 { font-size: 15px; margin: 12px 0 2px; }
.plano-leitura h4:first-of-type { margin-top: 4px; }

/* ---------- linha da vida ---------- */
.polo-barra { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--soft); gap: 2px; }
.ano-linha { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.ano-linha:first-of-type { border-top: 0; }
.ano-rotulo { font-weight: 800; color: var(--muted); padding-top: 2px; }
.episodios { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 8px; }
.episodio { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: start; margin: 0 !important; }
.episodio-bola { width: 14px; height: 14px; border-radius: 50%; background: var(--cor-ep); margin-top: 4px; }
.episodio-texto { line-height: 1.4; }
select { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); font-weight: 600; min-height: 46px; }

/* ---------- menstruação: começo e fim ---------- */
.ciclo-cartao { background: #FCEEF2; box-shadow: none; border: 1.5px solid #F5D3DD; }
.ciclo-cartao h3 { color: #9C3657; }
.ciclo-cartao .duas-colunas label.campo { margin-top: 0; }
.link-pequeno { background: none; border: 0; padding: 10px 0 0; color: #9C3657; font-weight: 700; font-size: 14px; text-decoration: underline; cursor: pointer; }
html.escuro .ciclo-cartao { background: var(--t-rosa); border-color: var(--t-rosa-borda); }
html.escuro .ciclo-cartao h3, html.escuro .link-pequeno { color: var(--t-rosa-texto); }
.plano-itens .botoes { flex-wrap: nowrap; flex: none; align-items: center; }
.plano-itens .btn.small { white-space: nowrap; }

/* ---------- minha ficha ---------- */
.ficha-topo { display: flex; align-items: center; gap: 14px; }
.ficha-topo h1 { margin-top: 0; font-size: 24px; }
.foto-perfil { border-radius: 50%; object-fit: cover; flex: none; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.foto-vazia svg { margin-top: 12%; }
.foto-editar { display: flex; align-items: center; gap: 14px; }
.ficha-lista { margin: 0; display: grid; gap: 2px; }
.ficha-lista dt { font-size: 13px; font-weight: 800; color: var(--muted); margin-top: 10px; }
.ficha-lista dt:first-child { margin-top: 0; }
.ficha-lista dd { margin: 0; line-height: 1.45; }
.ficha-texto { font-size: 14px; background: var(--soft); }
.passos { padding-left: 20px; line-height: 1.55; }
.passos li + li { margin-top: 6px; }
