/* Ever — estilos. Cor principal: burgundy (#6e1f33) sobre papel creme.
 * A base (estrutura, cartões, folhas, campos) vem da Housi; os tokens são
 * próprios. Nenhuma cor fixa fora de :root e dos dois temas escuros.
 * As cores dos dados (--d1…--d3) são os passos profundos validados da paleta
 * de dados (ver memória "paleta de dados"); a escala do humor (--m1…--m5) é
 * uma rampa de um só matiz, e o número vai sempre escrito por cima. */

:root {
  --bg: #f7f2ec;
  --surface: #fffdfa;
  --surface-2: #f0e8e1;
  --line: #e7ddd4;
  --ink: #2b2326;
  --ink-2: #66575c;
  --ink-3: #8c7d81;
  --accent: #6e1f33;
  --accent-ink: #ffffff;
  --accent-soft: #f5e3e6;
  --danger: #a8352b;
  --danger-soft: #f7e3df;
  --warn: #8a5a00;
  --warn-soft: #f8ecd2;
  --ok: #2f6b45;
  --ok-soft: #e3efe6;
  --shadow: 0 1px 2px rgb(43 35 38 / 0.05), 0 6px 20px rgb(43 35 38 / 0.06);
  --shadow-lg: 0 20px 60px rgb(43 35 38 / 0.2);
  --veil: rgb(43 35 38 / 0.4);
  --d1: #6c5cc4; --d2: #c4577e; --d3: #b8873a;
  --m1: #f3dce0; --m2: #e0aeb8; --m3: #c77d8c; --m4: #9c4256; --m5: #6e1f33;
  --m-ink-claro: #2b2326; --m-ink-escuro: #ffffff; /* tinta dos degraus 1–3 e 4–5 */
  --grid: #ede4dc;

  --font-display: 'Fraunces', Georgia, serif;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --pill: 999px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='claro']) {
    --bg: #171315; --surface: #201b1e; --surface-2: #2a2427; --line: #382f33;
    --ink: #f3ecef; --ink-2: #bcadb3; --ink-3: #91838a;
    --accent: #e8a0ae; --accent-ink: #2b0f16; --accent-soft: #3b1f26;
    --danger: #e98a7f; --danger-soft: #3a221f; --warn: #e3b55a; --warn-soft: #33291a; --ok: #8cc49e; --ok-soft: #1d2e22;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 20px 60px rgb(0 0 0 / 0.5); --veil: rgb(0 0 0 / 0.55);
    --d1: #9d90e6; --d2: #e283a6; --d3: #d6a95e;
    --m1: #3a2226; --m2: #5e2c37; --m3: #8a3d4e; --m4: #bd6a7c; --m5: #e8a0ae;
    --m-ink-claro: #f3ecef; --m-ink-escuro: #2b0f16;
    --grid: #2f282b;
    color-scheme: dark;
  }
}
:root[data-theme='escuro'] {
  --bg: #171315; --surface: #201b1e; --surface-2: #2a2427; --line: #382f33;
  --ink: #f3ecef; --ink-2: #bcadb3; --ink-3: #91838a;
  --accent: #e8a0ae; --accent-ink: #2b0f16; --accent-soft: #3b1f26;
  --danger: #e98a7f; --danger-soft: #3a221f; --warn: #e3b55a; --warn-soft: #33291a; --ok: #8cc49e; --ok-soft: #1d2e22;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 20px 60px rgb(0 0 0 / 0.5); --veil: rgb(0 0 0 / 0.55);
  --d1: #9d90e6; --d2: #e283a6; --d3: #d6a95e;
  --m1: #3a2226; --m2: #5e2c37; --m3: #8a3d4e; --m4: #bd6a7c; --m5: #e8a0ae;
  --m-ink-claro: #f3ecef; --m-ink-escuro: #2b0f16;
  --grid: #2f282b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.sub { color: var(--ink-2); font-size: 14px; }
.mini { color: var(--ink-3); font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---- estrutura ------------------------------------------------------------ */

#app { padding: calc(var(--safe-t) + 20px) 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 760px; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: 14px; animation: entrar 0.25s var(--ease); }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } }

.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.topo .sub { margin-top: 4px; }
.voltar { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-size: 14px; margin-bottom: -8px; }
.voltar svg { width: 18px; height: 18px; }

.nav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.nav ul { list-style: none; margin: 0 auto; padding: 0; display: flex; max-width: 520px; height: var(--nav-h); }
.nav li { flex: 1; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.nav a[aria-current='page'] { color: var(--accent); }

/* No computador: navegação à esquerda, conteúdo mais largo. */
@media (min-width: 960px) {
  .nav { inset: 0 auto 0 0; width: 220px; border-top: 0; border-right: 1px solid var(--line); padding: 28px 12px; }
  .nav::before { content: 'Ever'; display: block; font: 600 20px var(--font-display); padding: 0 12px 22px; color: var(--ink); }
  .nav ul { flex-direction: column; height: auto; gap: 2px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 15px; }
  .nav a[aria-current='page'] { background: var(--accent-soft); }
  #app { margin-left: 220px; max-width: 980px; padding: 40px 40px 60px; }
  body:has(.nav[hidden]) #app { margin-left: auto; }
}

/* ---- cartões ---------------------------------------------------------------- */

/* Um bloco de cartões dentro de um ecrã (ex.: o conteúdo de cada separador das
   Finanças): o mesmo intervalo que a .view, senão os cartões ficam colados. */
.pilha { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 960px) {
  .view, .pilha { gap: 16px; }
  .cartao { padding: 20px; }
}

.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.cartao > h2, .cartao > h3, .cartao .cab-cartao { margin-bottom: 12px; }
.cab-cartao { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cab-cartao h2, .cab-cartao h3 { margin: 0; }
.grelha { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grelha-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .grelha-2.empilha { grid-template-columns: 1fr; gap: 14px; } }

.numero { display: flex; flex-direction: column; gap: 2px; }
.numero .rotulo { font-size: 13px; color: var(--ink-2); }
.numero .valor { font: 600 24px var(--font-display); font-variant-numeric: tabular-nums; }
.numero .valor.grande { font-size: 32px; }
.numero .nota { font-size: 12.5px; color: var(--ink-3); }
.positivo { color: var(--ok); }
.negativo { color: var(--danger); }

.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.lista > li:first-child { border-top: 0; }
.lista .corpo { flex: 1; min-width: 0; }
.lista .titulo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .direita { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lista button.linha { all: unset; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.grupo-titulo { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 2px; display: flex; justify-content: space-between; }

.etiqueta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); }
.etiqueta.ok { background: var(--accent-soft); color: var(--accent); }
.etiqueta.aviso { background: var(--warn-soft); color: var(--warn); }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent); flex: none; }

.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.alerta.perigo { background: var(--danger-soft); color: var(--danger); }
.alerta.info { background: var(--accent-soft); color: var(--accent); }
.alerta svg { width: 20px; height: 20px; margin-top: 1px; }


/* ---- botões e campos -------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--pill); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: transform 0.1s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.perigo { background: var(--danger); color: #fff; }
.btn.bloco { width: 100%; }
.btn.peq { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
.ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); }
.ico.limpo { border-color: transparent; background: transparent; }
.ico svg { width: 20px; height: 20px; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.girar { animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.campo input, .campo select, .campo textarea {
  font-weight: 400; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 12px; min-height: 46px; width: 100%;
}
.campo textarea { min-height: 80px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .btn:focus-visible, .ico:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.campo .dica { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.campo.euro { position: relative; }
.campo.euro input { padding-right: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.campo.euro::after { content: '€'; position: absolute; right: 12px; bottom: 12px; color: var(--ink-3); font-weight: 400; }
.campo.pct input { padding-right: 32px; text-align: right; }
.campo.pct { position: relative; }
.campo.pct::after { content: '%'; position: absolute; right: 12px; bottom: 12px; color: var(--ink-3); font-weight: 400; }
.form { display: flex; flex-direction: column; gap: 14px; }
.erro-box { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }

.segmentos { display: flex; background: var(--surface-2); border-radius: var(--pill); padding: 4px; gap: 4px; }
.segmentos button { flex: 1; border: 0; background: transparent; border-radius: var(--pill); padding: 8px 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 38px; }
.segmentos button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.interruptor input { width: 44px; height: 26px; appearance: none; background: var(--line); border-radius: var(--pill); position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.interruptor input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); }
.interruptor input:checked { background: var(--accent); }
.interruptor input:checked::after { transform: translateX(18px); }

/* Barra de arrastar (divisão personalizada): pega grande para o dedo. */
.slider { width: 100%; appearance: none; height: 8px; border-radius: var(--pill); background: var(--surface-2); outline-offset: 6px; }
.slider::-webkit-slider-thumb { appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow); cursor: grab; }
.slider::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow); cursor: grab; }

/* ---- folha (bottom sheet), avisos, vazio ------------------------------------- */

.veu { position: fixed; inset: 0; z-index: 50; background: var(--veil); display: flex; align-items: flex-end; justify-content: center; animation: aparecer 0.2s; }
.veu.saindo { opacity: 0; transition: opacity 0.2s; }
@keyframes aparecer { from { opacity: 0; } }
.folha {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px 16px calc(var(--safe-b) + 20px);
  box-shadow: var(--shadow-lg); animation: subir 0.3s var(--ease);
}
@keyframes subir { from { transform: translateY(40px); opacity: 0.6; } }
@media (min-width: 700px) { .veu { align-items: center; } .folha { border-radius: var(--r-lg); padding-bottom: 20px; } }
.folha .pega { width: 40px; height: 5px; border-radius: var(--pill); background: var(--line); margin: 4px auto 10px; }
.folha .cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.folha .conteudo { display: flex; flex-direction: column; gap: 14px; }
.rodape { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.rodape .btn { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 76px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--pill); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: aparecer 0.2s; max-width: calc(100% - 32px); }
.toast.com-acao { display: flex; align-items: center; gap: 12px; padding-right: 8px; }
.toast.com-acao button { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; padding: 6px 8px; cursor: pointer; white-space: nowrap; }
.toast.erro { background: var(--danger); color: #fff; }

.vazio { text-align: center; padding: 32px 16px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vazio h3 { color: var(--ink); }
.vazio .simbolo { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* ---- entrada ------------------------------------------------------------------ */

.entrada-tela { max-width: 400px; margin: 6vh auto 0; }
.entrada-tela .marca-casa { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 8px; }
.entrada-tela h1 { font-size: 34px; }

/* ---- gráfico ------------------------------------------------------------------ */

details.dobra > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
details.dobra > summary::-webkit-details-marker { display: none; }
details.dobra > summary::after { content: '+'; font-size: 20px; color: var(--ink-3); }
details.dobra[open] > summary::after { content: '−'; }
details.dobra[open] > summary { margin-bottom: 12px; }

.barra-guardar { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 10; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-radius: var(--pill); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); }
.barra-guardar .btn { min-height: 38px; }
@media (min-width: 960px) { .barra-guardar { bottom: 20px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.tarefa { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tarefa:first-child { border-top: 0; }
.tarefa .corpo { flex: 1; min-width: 0; cursor: pointer; }
.tarefa .titulo { font-weight: 600; }
.visto { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; cursor: pointer; color: transparent; padding: 0; }
.visto svg { width: 16px; height: 16px; }
.visto[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tarefa.feita .titulo { text-decoration: line-through; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--pill); padding: 6px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 34px; }
.chip[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.navegar-mes { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.navegar-mes h2 { text-transform: capitalize; }
.item-agenda { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-sm); padding: 8px 10px; background: var(--surface-2); cursor: default; text-align: left; border: 0; width: 100%; font: inherit; color: inherit; }
.item-agenda .barra-cor { width: 3px; align-self: stretch; border-radius: 2px; background: var(--c, var(--accent)); flex: none; }
.item-agenda .t { font-weight: 600; font-size: 14.5px; }
.item-agenda.google { --c: var(--s1); }
.item-agenda.conta { --c: var(--s2); }
.item-agenda.ajuda { --c: var(--s3); }
.item-agenda.limpeza { --c: var(--s4); }
.grande-acao { min-height: 56px; font-size: 16px; }
.passos { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: 2px; }
.passo { width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; font-size: 18px; font-weight: 600; color: var(--accent); cursor: pointer; line-height: 1; }
.passo:active { background: var(--accent-soft); }
.redondo { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; padding: 0; }
.redondo svg { width: 18px; height: 18px; }
.redondo.sim[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.redondo.nao[aria-pressed='true'] { background: var(--ink-3); border-color: var(--ink-3); color: var(--surface); }
.segmentos-4 button { padding: 8px 4px; font-size: 13.5px; }
.adicionar { display: flex; gap: 8px; }
.adicionar input { flex: 1; min-height: 48px; border: 1px solid var(--line); border-radius: var(--pill); padding: 0 18px; background: var(--surface); font-size: 16px; }
.adicionar input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.adicionar .btn { width: 48px; padding: 0; }
.itens { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.itens .item:first-child { border-top: 0; }
.item-corpo { all: unset; flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; }
.item-corpo .t { font-weight: 500; }
.item .qtd { color: var(--ink-3); font-weight: 400; font-size: 14px; }
.item.feito .t { text-decoration: line-through; color: var(--ink-3); }
.sino { position: relative; }
.sino .bolinha { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.barras { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.barra-linha { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.rotulo-barra { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trilho { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.enchimento { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.valor-barra { text-align: right; white-space: nowrap; font-weight: 600; }
.btn.opcao { min-height: 56px; }
.rotulo-secao { font: 600 12px var(--font); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin: 12px 0 2px; }
.cartao .rotulo-secao:first-of-type { margin-top: 4px; }
.lista.compacta > li { padding: 7px 0; gap: 10px; }
.lista.compacta .titulo { font-weight: 500; }
.lista.compacta .ico.limpo { width: 34px; height: 34px; }
.info-btn { width: 32px; height: 32px; color: var(--ink-3); }
.info-btn svg { width: 19px; height: 19px; }
.cab-cartao .acoes-cab { display: flex; align-items: center; gap: 4px; flex: none; }
.info-lista { margin: 0 0 12px; display: flex; flex-direction: column; }
.info-lista > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-lista > div:last-child { border-bottom: 0; }
.info-lista dt { color: var(--ink-2); }
.info-lista dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.info-nota { font-size: 14px; margin: 4px 0 0; }
.alerta.compacto { padding: 9px 12px; font-size: 13.5px; }

/* ===========================================================================
   Ever
   =========================================================================== */

.ola { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ola h1 { font-size: 28px; }
.ola .data { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.cab-cartao a.mini, .ver-tudo { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.cartao.plano { background: transparent; border-style: dashed; }

/* ---- hábitos ------------------------------------------------------------------ */
.habito { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.habito:first-child { border-top: 0; }
.habito .corpo { flex: 1; min-width: 0; }
.habito .titulo { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.habito .emoji { font-size: 18px; line-height: 1; width: 24px; text-align: center; flex: none; }
.habito.feito .titulo { color: var(--ink-3); }
.habito.na .titulo, .habito.ignorado .titulo { color: var(--ink-3); text-decoration: line-through; }
.habito .meta-linha { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.fogo { color: var(--d3); font-weight: 700; }
.visto.grande { width: 40px; height: 40px; }
.visto.grande svg { width: 20px; height: 20px; }
.visto.parcial { border-color: var(--accent); color: var(--accent); font-size: 11px; font-weight: 700; }
.visto.na, .visto.ignorado { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); }
.contador { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: var(--pill); padding: 2px; }
.contador button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); color: var(--accent); font-size: 18px; font-weight: 700; cursor: pointer; }
.contador .n { min-width: 46px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.semana-pontos { display: flex; gap: 4px; }
.semana-pontos span { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.semana-pontos span.f { background: var(--accent); border-color: var(--accent); }
.semana-pontos span.x { background: transparent; }
.semana-pontos span.n { background: transparent; border-style: dashed; }
.momento-titulo { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 2px; }
.momento-titulo:first-child { margin-top: 0; }

/* Calendário de um hábito: 7 linhas (seg–dom) × semanas, da mais antiga à atual. */
.grelha-dias { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.grelha-dias button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); padding: 0; cursor: pointer; font-size: 9.5px; color: var(--ink-3); }
.grelha-dias button.f { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.grelha-dias button.p { background: var(--accent-soft); border-color: var(--accent); }
.grelha-dias button.i { background: var(--surface-2); }
.grelha-dias button.na { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, transparent 3px, transparent 6px); }
.grelha-dias button.fora { visibility: hidden; }
.grelha-dias button.livre { opacity: 0.35; }
.grelha-dias button.hoje { outline: 2px solid var(--ink); outline-offset: 1px; }
.legenda-dias { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legenda-dias span { display: inline-flex; align-items: center; gap: 6px; }
.legenda-dias i { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.legenda-dias i.f { background: var(--accent); border-color: var(--accent); }
.legenda-dias i.i { background: var(--surface-2); }
.legenda-dias i.na { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 2px, transparent 2px, transparent 4px); }

.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }

/* ---- humor -------------------------------------------------------------------- */
.escala { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.escala button { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 4px 2px; }
.escala button .rosto { font-size: 24px; line-height: 1; }
.escala button .n { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.escala button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.escala button[aria-pressed='true'] .n { color: var(--accent); }
.escala-nome { font-size: 13px; color: var(--ink-2); min-height: 20px; margin-top: 4px; }
.m1 { --m: var(--m1); --mi: var(--m-ink-claro); } .m2 { --m: var(--m2); --mi: var(--m-ink-claro); }
.m3 { --m: var(--m3); --mi: var(--m-ink-claro); } .m4 { --m: var(--m4); --mi: var(--m-ink-escuro); } .m5 { --m: var(--m5); --mi: var(--m-ink-escuro); }
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendario .cab { font-size: 11px; font-weight: 700; text-transform: uppercase; text-align: center; color: var(--ink-3); padding-bottom: 2px; }
.calendario .dia { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); border: 0; padding: 0; }
.calendario .dia .v { font-weight: 700; font-size: 13px; }
.calendario .dia:is(.m1, .m2, .m3, .m4, .m5) { background: var(--m); color: var(--mi); }
.calendario .dia.hoje { outline: 2px solid var(--ink); outline-offset: 1px; }
.calendario .dia.vazio { background: transparent; }
.rampa { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.rampa i { width: 18px; height: 10px; border-radius: 3px; background: var(--m); display: inline-block; }
.entrada-humor { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.entrada-humor:first-child { border-top: 0; }
.entrada-humor .rosto { font-size: 26px; line-height: 1.1; width: 32px; text-align: center; flex: none; }
.entrada-humor .corpo { flex: 1; min-width: 0; }
.entrada-humor .t { font-weight: 600; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.etiquetas span { font-size: 12px; background: var(--surface-2); color: var(--ink-2); border-radius: var(--pill); padding: 2px 8px; }

/* Barras verticais de médias semanais (1–5). */
.colunas { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 140px; padding-top: 18px; border-bottom: 1px solid var(--grid); }
.colunas .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; position: relative; }
.colunas .par { display: flex; gap: 2px; align-items: flex-end; width: 100%; justify-content: center; height: 100%; }
.colunas .b { width: 42%; max-width: 16px; border-radius: 4px 4px 0 0; background: var(--d1); min-height: 2px; position: relative; }
.colunas .b.e { background: var(--d3); }
.colunas .b .v { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--ink-2); }
.colunas .sem { opacity: 0.25; }
.rotulos-colunas { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 4px; }
.legenda .q { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.legenda .q.d1 { --c: var(--d1); } .legenda .q.d3 { --c: var(--d3); }

/* ---- metas ---------------------------------------------------------------------- */
.meta-cartao { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.meta-cartao .linha { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meta-cartao .titulo { font-weight: 600; font-size: 16px; }
.meta-cartao .pct { font: 600 18px var(--font-display); font-variant-numeric: tabular-nums; }
.barra { height: 8px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: var(--pill); background: var(--accent); }
.barra.ok > span { background: var(--ok); }
.ritmo { font-size: 12px; font-weight: 700; border-radius: var(--pill); padding: 2px 8px; }
.ritmo.no-ritmo, .ritmo.concluida { background: var(--ok-soft); color: var(--ok); }
.ritmo.atras, .ritmo.passou { background: var(--warn-soft); color: var(--warn); }
.ritmo.sem-prazo { background: var(--surface-2); color: var(--ink-3); }
.marco { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.marco:first-child { border-top: 0; }
.marco .corpo { flex: 1; min-width: 0; }
.marco.feito .t { text-decoration: line-through; color: var(--ink-3); }
.grafico-meta svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico-meta .eixo { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.grafico-meta .grade { stroke: var(--grid); }
.grafico-meta .linha { fill: none; stroke: var(--accent); stroke-width: 2; }
.grafico-meta .alvo { stroke: var(--ok); stroke-dasharray: 4 4; }
.grafico-meta .ponto { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.grafico-meta .rot-alvo { fill: var(--ok); font-size: 11px; font-weight: 600; font-family: var(--font); }

/* ---- listas ---------------------------------------------------------------------- */
.lista-cartao { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.lista-cartao .emoji { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.lista-cartao .corpo { flex: 1; min-width: 0; }
.lista-cartao .titulo { font-weight: 600; }
.desejo { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.desejo:first-child { border-top: 0; }
.desejo .corpo { all: unset; flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.desejo .t { font-weight: 600; }
.desejo.feito .t { color: var(--ink-3); text-decoration: line-through; }
.desejo .direita { text-align: right; font-size: 13px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prioridade { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.05em; }
.estrelas { display: inline-flex; gap: 2px; }
.estrelas button { border: 0; background: none; font-size: 24px; color: var(--line); cursor: pointer; padding: 0 2px; line-height: 1; }
.estrelas button[aria-pressed='true'] { color: var(--d3); }
.estrelas-lidas { color: var(--d3); letter-spacing: 1px; }

/* ---- lembretes ------------------------------------------------------------------- */
.lembrete { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.lembrete:first-child { border-top: 0; }
.lembrete .corpo { all: unset; flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; }
.lembrete .t { font-weight: 600; }
.lembrete .q { font-size: 12.5px; color: var(--ink-3); }
.lembrete.atrasado .q { color: var(--danger); font-weight: 600; }
.lembrete.feito .t { text-decoration: line-through; color: var(--ink-3); }

/* ---- inbox e notas ------------------------------------------------------------- */
.captura { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.captura:first-child { border-top: 0; }
.captura .corpo { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.captura .acoes { flex: none; }
.captura.tratada { opacity: 0.6; }
.nota-cartao { all: unset; display: flex; flex-direction: column; gap: 4px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.nota-cartao .t { font-weight: 600; }
.nota-cartao .c { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.notas-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.busca { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); padding: 0 14px; }
.busca input { border: 0; background: transparent; flex: 1; min-height: 44px; outline: none; font-size: 16px; }
.busca svg { color: var(--ink-3); width: 18px; height: 18px; }
textarea.editor { min-height: 40vh; }

/* Botão de captura rápida, em todos os ecrãs. */
.capturar { position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer; }
.capturar svg { width: 26px; height: 26px; }
@media (min-width: 960px) { .capturar { bottom: 28px; right: 28px; } }

/* ---- mais / definições ------------------------------------------------------------- */
.mosaico { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mosaico a { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); position: relative; }
.mosaico a svg { color: var(--accent); }
.mosaico a .t { font-weight: 600; }
.mosaico a .mini { line-height: 1.35; }
.mosaico .bolinha { position: absolute; top: 12px; right: 12px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.widget-linha { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.widget-linha:first-child { border-top: 0; }
.widget-linha .t { flex: 1; font-weight: 500; }
.widget-linha.oculto .t { color: var(--ink-3); text-decoration: line-through; }
.widget-linha .ico { width: 36px; height: 36px; }
.faixa-offline { position: sticky; top: 0; z-index: 30; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; text-align: center; padding: 6px 12px; border-radius: var(--r-sm); }
.dias-semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dias-semana .chip { padding: 6px 0; text-align: center; justify-content: center; }
.grelha-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .grelha-campos { grid-template-columns: 1fr; } }
.nav li.so-telemovel { display: block; }
@media (min-width: 960px) { .nav li.so-telemovel { display: none; } }
.nav li.so-computador { display: none; }
@media (min-width: 960px) { .nav li.so-computador { display: block; } }
