/* Layout: uma coluna, papel branco sobre fundo bege-rosado, rosa como cor de ação; barra de abas fixa com a Emily no centro */
:root {
  --fundo: #fbf3ef;          /* bege rosado */
  --papel: #ffffff;
  --bege: #f3e6dc;
  --bege-forte: #e3cdbb;
  --rosa-claro: #fbe4ea;
  --rosa: #f2b8c8;
  --rosa-escuro: #a8436a;    /* botões e destaques (contraste AA com branco) */
  --tinta: #3a2a30;
  --suave: #7c6870;
  --linha: #efdfe2;
  --ok: #2e7a58;
  --erro: #b23a48;
  --sobre-rosa: #ffffff;
  --sombra: 0 8px 26px rgba(168, 67, 106, .08);
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --texto: "Nunito Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #1d1618; --papel: #2a2023; --bege: #352a2b; --bege-forte: #6b5547; --rosa-claro: #3c2630; --rosa: #b56a86; --rosa-escuro: #f2a7c0;
    --tinta: #f7ecef; --suave: #c8b2ba; --linha: #44343a; --ok: #74d3a5; --erro: #ff8f9c; --sobre-rosa: #2a1a21; --sombra: 0 8px 26px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--tinta); }
body { font-family: var(--texto); font-size: 17px; line-height: 1.5; -webkit-tap-highlight-color: transparent; padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: 2.15rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
h1 em, .marca em { color: var(--rosa-escuro); font-style: italic; font-weight: 600; }
p { margin: 0; }
a { color: var(--rosa-escuro); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rosa); outline-offset: 2px; }
.centro { text-align: center; justify-content: center; }

.topo { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--fundo) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--linha); }
.topo-in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.marca { font-family: var(--display); font-size: 1.4rem; font-weight: 700; text-decoration: none; color: var(--tinta); }
.selo { font-size: .76rem; font-weight: 700; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; background: var(--rosa-claro); color: var(--rosa-escuro); white-space: nowrap; }
.selo:empty { display: none; }
.selo.off { background: var(--bege); color: var(--suave); }

.tela { max-width: 640px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; outline: none; }
.cabeca { display: flex; flex-direction: column; gap: 4px; }
.cartao { background: var(--papel); border: 1px solid var(--linha); border-radius: 20px; padding: 18px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cartao.link { text-decoration: none; color: inherit; gap: 4px; }
.rotulo { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--suave); }
.suave { color: var(--suave); }
.sec { margin-top: 6px; }
.linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linha.entre { justify-content: space-between; }
.sem-quebra { flex-wrap: nowrap; }
.grade2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.coluna-centro { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.marcar { gap: 12px; align-items: flex-start; flex-wrap: nowrap; }
.marcar input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--rosa-escuro); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 0; background: var(--rosa-escuro); color: var(--sobre-rosa); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.claro { background: var(--rosa-claro); color: var(--rosa-escuro); }
.btn.contorno { background: transparent; color: var(--rosa-escuro); border: 1.5px solid var(--rosa-escuro); }
.btn.peq { min-height: 38px; padding: 6px 12px; font-size: .92rem; border-radius: 11px; }
.icone-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linha); background: var(--papel); color: var(--rosa-escuro); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icone-btn.grande { width: 48px; height: 48px; }
.icone-btn svg, .abas svg, .btn svg, .redondo svg, .chamar svg, .mic svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icone-btn svg, .btn svg { width: 20px; height: 20px; }

/* Início */
.emily-cartao { display: flex; gap: 16px; align-items: center; }
.avatar { width: 84px; height: 84px; flex: none; border-radius: 50%; box-shadow: 0 6px 20px rgba(168,67,106,.18); }
.chamar { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, var(--rosa-escuro), #c86b8e); color: #fff; text-decoration: none; box-shadow: 0 12px 30px rgba(168,67,106,.28); }
.chamar .bola { width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.chamar .bola svg { width: 32px; height: 32px; }
.chamar strong { font-family: var(--display); font-size: 1.65rem; display: block; line-height: 1.1; }
.numeros { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.numero { text-align: center; padding: 10px 4px; border-radius: 16px; background: var(--bege); }
.numero b { display: block; font-family: var(--display); font-size: 1.75rem; line-height: 1; color: var(--rosa-escuro); font-variant-numeric: tabular-nums; }
.numero span { font-size: .72rem; color: var(--suave); }
.barra { display: block; height: 8px; border-radius: 99px; background: var(--rosa-claro); overflow: hidden; margin-top: 6px; }
.barra > i { display: block; height: 100%; background: linear-gradient(90deg, var(--rosa), var(--rosa-escuro)); border-radius: 99px; }
.meta { display: flex; flex-direction: column; }
.meta .linha { font-size: .95rem; }
.passos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.passo { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--linha); background: var(--papel); text-decoration: none; color: inherit; }
.passo .marcador { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--rosa); display: grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem; color: var(--rosa-escuro); }
.passo.feito .marcador { background: var(--rosa-escuro); border-color: var(--rosa-escuro); color: var(--sobre-rosa); }
.passo .txt { flex: 1; min-width: 0; }
.passo small { color: var(--suave); display: block; }
.cal { max-width: 380px; width: 100%; margin: 0 auto; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-cab { font-size: .72rem; font-weight: 700; color: var(--suave); }
.cal-dia { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; font-size: .85rem; background: var(--bege); color: var(--suave); }
.cal-dia.pouco { background: var(--rosa-claro); color: var(--tinta); }
.cal-dia.meio { background: var(--rosa); color: var(--tinta); }
.cal-dia.cheio { background: var(--rosa-escuro); color: var(--sobre-rosa); font-weight: 700; }
.cal-dia.hoje { outline: 2px solid var(--rosa-escuro); outline-offset: 1px; }
.legenda { font-size: .78rem; color: var(--suave); gap: 14px; }
.legenda i { display: inline-block; width: 12px; height: 12px; aspect-ratio: auto; border-radius: 4px; vertical-align: -1px; margin-right: 4px; }

/* Ligação */
.ligacao { display: flex; flex-direction: column; gap: 12px; }
.lig-topo { display: flex; align-items: center; gap: 12px; }
.lig-topo .avatar { width: 56px; height: 56px; }
.lig-topo > div { flex: 1; min-width: 0; }
.lig-tempo { font-variant-numeric: tabular-nums; color: var(--suave); font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.rolar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--linha); background: var(--papel); cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--tinta); text-decoration: none; white-space: nowrap; }
.chip.ativo { background: var(--rosa-escuro); color: var(--sobre-rosa); border-color: var(--rosa-escuro); }
.conversa { display: flex; flex-direction: column; gap: 10px; min-height: 30vh; }
.balao { max-width: 88%; padding: 12px 14px; border-radius: 20px; overflow-wrap: anywhere; }
.balao.emily { align-self: flex-start; background: var(--papel); border: 1px solid var(--linha); border-bottom-left-radius: 6px; box-shadow: var(--sombra); }
.balao.emily .en { font-size: 1.08rem; }
.balao.eu { align-self: flex-end; background: var(--rosa-claro); border-bottom-right-radius: 6px; }
.balao .acoes { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.trad, .ajuda-pt { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--linha); font-size: .95rem; color: var(--suave); }
.ajuda-pt { color: var(--tinta); }
.correcao { border-radius: 16px; border: 1px solid var(--linha); background: var(--bege); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: .97rem; }
.errado { color: var(--erro); text-decoration: line-through; text-decoration-thickness: 1px; }
.certo { color: var(--ok); font-weight: 700; }
.pensando { align-self: flex-start; color: var(--suave); font-style: italic; }
.lig-controles { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 0 4px; background: linear-gradient(to top, var(--fundo) 78%, transparent); }
.lig-botoes { display: flex; justify-content: center; align-items: center; gap: 22px; }
.redondo { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--rosa-escuro); color: var(--sobre-rosa); }
.redondo svg { width: 26px; height: 26px; }
.redondo.grande { width: 84px; height: 84px; box-shadow: 0 10px 28px rgba(168,67,106,.32); }
.redondo.grande svg { width: 36px; height: 36px; }
.redondo.claro { background: var(--rosa-claro); color: var(--rosa-escuro); }
.redondo.claro.ativo { background: var(--rosa-escuro); color: var(--sobre-rosa); }
.redondo.vermelho { width: 72px; height: 72px; background: #c4384d; color: #fff; }
.onda { display: flex; justify-content: center; align-items: center; gap: 5px; height: 30px; --n: .1; }
.onda i { width: 6px; height: 8px; border-radius: 3px; background: var(--rosa); transition: height .12s; }
.onda.ouvindo i { background: var(--rosa-escuro); height: calc(8px + 22px * var(--n)); }
.onda.ouvindo i:nth-child(2n) { height: calc(8px + 14px * var(--n)); }
.onda.falando i, .onda.pensando i { animation: onda 1s ease-in-out infinite; }
.onda.pensando i { background: var(--bege-forte); }
.onda i:nth-child(2) { animation-delay: .1s; } .onda i:nth-child(3) { animation-delay: .2s; } .onda i:nth-child(4) { animation-delay: .3s; } .onda i:nth-child(5) { animation-delay: .4s; }
@keyframes onda { 0%,100% { height: 8px; } 50% { height: 26px; } }
.opcoes-lig { background: var(--papel); border: 1px solid var(--linha); border-radius: 16px; padding: 10px 14px; }
.opcoes-lig summary { cursor: pointer; font-weight: 700; color: var(--rosa-escuro); }
.opcoes-lig[open] { display: flex; flex-direction: column; gap: 12px; }
.opcoes-lig input[type=range] { flex: 1; min-width: 140px; accent-color: var(--rosa-escuro); }
body.em-ligacao .topo { display: none; }
.mic { width: 92px; height: 92px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #c86b8e, var(--rosa-escuro)); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(168,67,106,.3); cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mic.peq { width: 64px; height: 64px; }
.mic svg { width: 38px; height: 38px; }
.mic.gravando { animation: pulsar 1.2s ease-in-out infinite; }
@keyframes pulsar { 0%,100% { box-shadow: 0 0 0 0 rgba(200,107,142,.45); } 50% { box-shadow: 0 0 0 18px rgba(200,107,142,0); } }
@media (prefers-reduced-motion: reduce) { .mic.gravando, .onda i { animation: none !important; } }
.dica-mic { font-size: .9rem; color: var(--suave); text-align: center; }
.escrever { display: flex; gap: 8px; width: 100%; align-items: flex-end; }
.campo { flex: 1; min-width: 0; width: 100%; border: 1.5px solid var(--linha); border-radius: 14px; padding: 12px; background: var(--papel); resize: vertical; min-height: 48px; }
.campo.alto { min-height: 150px; }
.escrever textarea { resize: none; }

/* Exercícios */
.frase-grande { font-family: var(--display); font-size: 1.75rem; line-height: 1.25; }
.errado-sutil { color: var(--erro); }
.corrigido { background: var(--bege); padding: 12px; border-radius: 14px; white-space: pre-wrap; }
.palavras-res { display: flex; flex-wrap: wrap; gap: 6px; font-size: 1.1rem; }
.palavras-res span { padding: 2px 8px; border-radius: 8px; }
.palavras-res .acertou { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.palavras-res .faltou { background: color-mix(in srgb, var(--erro) 14%, transparent); color: var(--erro); }
.resultado { font-weight: 700; } .resultado.bom { color: var(--ok); } .resultado.ruim { color: var(--erro); }
.vocab { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 10px 12px; align-items: center; }
.vocab b { color: var(--rosa-escuro); overflow-wrap: anywhere; }
.aviso { padding: 12px 14px; border-radius: 16px; background: var(--bege); font-size: .95rem; color: var(--tinta); text-decoration: none; display: block; }
.aviso.erro { background: color-mix(in srgb, var(--erro) 12%, var(--papel)); color: var(--erro); }
.flutuante { position: fixed; left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 9; max-width: 600px; margin: 0 auto; box-shadow: var(--sombra); }
.opcoes { display: flex; flex-direction: column; gap: 8px; }
.opcao { text-align: left; padding: 14px; border-radius: 14px; border: 1.5px solid var(--linha); background: var(--papel); cursor: pointer; font-weight: 600; }
.opcao.nao-sei { color: var(--suave); }
.opcao.certa { border-color: var(--ok); color: var(--ok); }
.opcao.errada { border-color: var(--erro); color: var(--erro); }

/* Progresso */
.semanas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.semana { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; align-items: start; padding: 8px; border-radius: 12px; }
.semana .num { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--suave); text-align: center; font-variant-numeric: tabular-nums; }
.semana.atual { background: var(--rosa-claro); }
.semana.atual .num, .semana.feita .num { color: var(--rosa-escuro); }
.semana small { color: var(--suave); display: block; }
.historico { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.grafico { width: 100%; height: auto; display: block; }
.grafico text { fill: var(--suave); font-size: 10px; font-family: var(--texto); }

/* Abas */
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--papel); border-top: 1px solid var(--linha); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.abas a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--suave); font-size: .72rem; font-weight: 700; padding: 6px 0; }
.abas a.ativa { color: var(--rosa-escuro); }
.abas svg { width: 22px; height: 22px; }
.abas .aba-central svg { width: 26px; height: 26px; padding: 10px; box-sizing: content-box; border-radius: 50%; background: var(--rosa-escuro); color: var(--sobre-rosa); margin-top: -24px; box-shadow: 0 6px 18px rgba(168,67,106,.32); }

@media (max-width: 380px) { .numeros { grid-template-columns: repeat(2, minmax(0,1fr)); } h1 { font-size: 1.85rem; } }
