:root {
  --bg: #f4f7f3;
  --surface: #ffffff;
  --text: #1b2a21;
  --muted: #5d6e63;
  --border: #dbe4dd;
  --primary: #2f7d4f;
  --primary-ink: #ffffff;
  --soft: #e2efe6;
  --accent: #e9a93a;
  --accent-soft: #fbf0da;
  --danger: #c0483f;
  --bubble: #eef4f8;
  --radius: 16px;
  --gutter: 16px;   /* margem lateral do conteúdo (menor em celular pequeno) */
  --rail: 0px;      /* largura da barra de abas lateral (só no computador) */
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.05);
  /* Gráfico do fantasma: você × fantasma (par validado pra daltonismo, claro e escuro). */
  --chart-you: #2f7d4f;
  --chart-ghost: #7a5fc4;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1612;
    --surface: #17211b;
    --text: #e5eee7;
    --muted: #97a99c;
    --border: #2a3a30;
    --primary: #5cc185;
    --primary-ink: #0b1a10;
    --soft: #1e3226;
    --accent: #f0b95a;
    --accent-soft: #3a2f1a;
    --danger: #e0766c;
    --bubble: #1c2a33;
    --shadow: none;
    --chart-you: #45a96f;
    --chart-ghost: #9085e9;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barra de teste ---------- */
.devbar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.devbar-row { display: flex; gap: 8px; align-items: center; }
.clock-label { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-label.simulated { color: var(--accent); font-weight: 600; }
.devbar-tag { color: var(--muted); white-space: nowrap; }
.devbar select {
  flex: 1; min-width: 0;
  padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
.devbar-btn {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap;
}
/* ---------- Estrutura ---------- */
main {
  max-width: 480px; margin: 0 auto;
  padding: 16px var(--gutter) 48px;
  container-type: inline-size;
  min-height: calc(100dvh - 90px);
  display: flex; flex-direction: column;
  outline: none;
}
/* ---------- Barra de baixo: as 3 abas principais ---------- */
body.has-tabbar main { padding-bottom: 96px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar[hidden] { display: none; }
.tabbar button {
  position: relative; flex: 1; max-width: 140px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600; padding: 6px 2px; cursor: pointer; border-radius: 10px;
}
.tabbar button span { font-size: 22px; line-height: 1; }
.tabbar button[aria-current="page"] { color: var(--primary); background: var(--soft); }
/* 🔔 Avisos no topo (ao lado do 🆘), com o número de avisos novos. */
.bell-link {
  position: relative; border: none; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 6px; border-radius: 8px; opacity: 0.8;
}
.bell-link[aria-current="page"] { opacity: 1; background: var(--soft); }
.bell-count {
  position: absolute; top: -3px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.bell-count[hidden] { display: none; }

/* ---------- Menu lateral (☰): as outras abas ---------- */
.menu-btn {
  flex: none; width: 40px; height: 40px; margin-left: -8px;
  border: none; border-radius: 10px; background: none; color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.menu-btn:hover { background: var(--soft); }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  width: min(300px, 84vw); display: flex; flex-direction: column; gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: 0 0 40px rgb(0 0 0 / 0.25);
  transform: translateX(-105%); transition: transform 0.22s ease-out; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / 0.45); }
.drawer-backdrop[hidden] { display: none; }
body.menu-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px 8px; }
.drawer-brand { font-weight: 700; font-size: 17px; }
.drawer-items { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.drawer-items button, .drawer-user {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: none; border-radius: 12px; background: none; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 600; padding: 12px; text-align: left; cursor: pointer;
}
.drawer-items button span { font-size: 20px; width: 24px; text-align: center; }
.drawer-items button:hover, .drawer-user:hover { background: var(--bg); }
.drawer-items button[aria-current="page"] { background: var(--soft); color: var(--primary); }
.drawer-foot { border-top: 1px solid var(--border); padding-top: 8px; }
.drawer-user .avatar { font-size: 28px; line-height: 1; }
.drawer-user .grow { display: flex; flex-direction: column; min-width: 0; }
.drawer-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-user small { color: var(--muted); font-weight: 500; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* Faixa de avisos na tela inicial (o aviso mais urgente, uma linha). */
.notice-banner {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.notice-banner .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-banner .count { flex: none; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: #1b1405; font-size: 12px; }

/* Etapas do perfil (aba Avisos). */
.profile-card { gap: 10px; }
.profile-card summary { cursor: pointer; color: var(--muted); }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; }
.step-list .ico { font-size: 20px; line-height: 1; }
.step-list small { display: block; }
.step-list.locked { opacity: 0.7; }
.btn.step-btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }

.intro-kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--primary); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 99px; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);
}
.toast[hidden] { display: none; }
body.has-tabbar .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; flex: 1; gap: 16px; animation: enter 0.2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.topline { display: flex; align-items: center; gap: 12px; min-height: 36px; }

/* ---------- Cabeçalhos fixos ----------
   O topo de toda tela (← nas internas; ☰, título, ⚙️ e 🆘 nas abas; o topo do Início) fica preso
   ao rolar, sempre do mesmo tamanho. Com a página rolada, só a linha de baixo ganha cor. */
.topline, .tab-title, .home-top {
  position: sticky; top: 0; z-index: 6;
  margin: -16px calc(-1 * var(--gutter)) 0; padding: calc(6px + env(safe-area-inset-top)) var(--gutter) 6px;
  background: var(--bg); border-bottom: 1px solid transparent;
}
body.scrolled .topline, body.scrolled .tab-title, body.scrolled .home-top { border-bottom-color: var(--border); }
/* ← (voltar): mesmo tamanho de toque e mesma cor do ☰, pra ficar fácil de achar. */
.back {
  flex: none; width: 40px; height: 40px; margin-left: -8px; display: grid; place-items: center;
  border: none; border-radius: 10px; background: none; color: var(--text); font: inherit; cursor: pointer;
  font-size: 22px; line-height: 1;
}
.back:hover { background: var(--soft); }
.help-link, .settings-link {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 6px; border-radius: 8px; opacity: 0.8;
}
.spacer-h { flex: 1; }
.progress { flex: 1; height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.25s; }

h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 0; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.25; margin: 0; }
.why { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.spacer { flex: 1; }

.bubble {
  background: var(--bubble); border-radius: var(--radius) var(--radius) var(--radius) 4px;
  padding: 10px 14px; font-size: 15px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px;
  border-radius: 14px; border: 1px solid transparent;
  font-family: inherit; font-weight: 600; font-size: 17px; line-height: 1.2; cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-block { width: 100%; }

/* ---------- Opções ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }
.options.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); }
.option {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 16px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: 14px;
  font: inherit; text-align: left; cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.12s, background 0.12s;
}
.option .emoji { font-size: 24px; line-height: 1; }
.option .label { font-weight: 600; }
.option .hint { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.option[aria-pressed="true"] { border-color: var(--primary); background: var(--soft); }
.option:focus-visible, .btn:focus-visible, .chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.row-buttons { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.row-buttons .option { justify-content: center; padding: 0; font-size: 20px; font-weight: 700; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale .option { flex-direction: column; justify-content: center; gap: 4px; padding: 12px 4px; text-align: center; font-size: 12px; }
.scale .option .emoji { font-size: 30px; }

.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emoji-grid .option { justify-content: center; padding: 0; aspect-ratio: 1; font-size: 30px; min-height: 0; }

/* ---------- Entrada numérica ---------- */
.stepper { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 8px; }
.stepper button {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 26px; cursor: pointer;
}
.stepper .value { display: flex; align-items: baseline; gap: 6px; }
.stepper input, .money input {
  width: clamp(88px, 30vw, 120px); text-align: center;
  font-family: inherit; font-weight: 700; font-size: 40px; line-height: 1;
  color: var(--text); background: transparent; border: none; border-bottom: 2px solid var(--border);
  padding: 4px 0;
}
.stepper input:focus, .money input:focus { outline: none; border-color: var(--primary); }
.money { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 8px; }
.money span { font-weight: 700; font-size: 26px; line-height: 1; color: var(--muted); }
.money input { width: min(180px, 50vw); }
.unit-label { color: var(--muted); font-weight: 600; }
.suffix { margin: 0; text-align: center; color: var(--muted); font-weight: 600; }
.calc { margin: 0; min-height: 1.5em; text-align: center; font-size: 15px; color: var(--primary); font-weight: 600; }

/* Seletor "por dia / por semana" */
.segmented { justify-content: center; }
.segmented .chip { flex: 1 1 0; min-width: 0; text-align: center; padding: 10px 8px; font-size: 14px; }

/* Aviso de sinceridade */
.big-emoji { font-size: 56px; line-height: 1; margin-top: 8px; }
.pledge { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pledge li {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.pledge li > span:first-child { font-size: 20px; line-height: 1.3; }

.example {
  background: var(--soft); border-radius: 12px; padding: 10px 14px;
  font-size: 15px; color: var(--text);
}

.text-input {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit;
}
.text-input:focus { outline: none; border-color: var(--primary); }

/* ---------- Intro ---------- */
.intro { text-align: center; justify-content: center; }
.intro .big { font-size: 72px; line-height: 1; margin-top: 24px; }
.intro p { color: var(--muted); font-size: 17px; margin: 0; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: width 0.2s; }
.dots span.on { width: 24px; border-radius: 99px; background: var(--primary); }

/* ---------- Cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.band { border-left: 4px solid var(--primary); }
.band.medio { border-left-color: var(--accent); }
.band.alto { border-left-color: var(--danger); }
.band.pendente { border-left-color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 99px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--primary); background: var(--soft); }
/* Calendário junto dos botões "Hoje"/"Ontem" (qualquer dia desde o cadastro). */
.date-chip { display: inline-flex; align-items: center; gap: 6px; padding-top: 4px; padding-bottom: 4px; }
.date-chip input {
  border: none; background: transparent; color: inherit; padding: 0;
  font-family: inherit; font-weight: 600; font-size: 14px; color-scheme: light dark;
}
.date-field { display: flex; flex-direction: column; gap: 6px; }
.chip .tag { font-size: 11px; font-weight: 700; color: var(--primary); margin-left: 4px; text-transform: uppercase; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill { padding: 4px 10px; border-radius: 99px; background: var(--soft); font-size: 14px; }

/* Curva de metas */
.curve { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.curve .bar {
  flex: 1; min-width: 3px; background: var(--primary); border-radius: 4px 4px 0 0;
  position: relative; opacity: 0.85;
}
.curve .bar.base { background: var(--muted); opacity: 0.4; }
.curve .bar.zero { background: var(--accent); height: 3px !important; }
.curve-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Limite de cada semana, embaixo do gráfico. */
.limits { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.limits summary { cursor: pointer; font-weight: 700; }
.limits[open] summary { margin-bottom: 6px; }
.limits-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.limits-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.limits-table td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.limits-table td small { display: block; font-size: 11px; color: var(--muted); }
.limits-table tr.now td { background: var(--soft); font-weight: 600; }
.limits-table .here { color: var(--primary) !important; font-weight: 700; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-row > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* número ímpar: o último ocupa a linha */
.stat { background: var(--bg); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 13px; color: var(--muted); }

.plan-line { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; }
.plan-line .ico { font-size: 20px; line-height: 1.3; }
.plan-line small { display: block; color: var(--muted); font-size: 13px; }
.plan-line .grow { min-width: 0; }
.plans { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
/* Ações de um plano "se X, então Y" (uma ou mais). */
.acts { margin: 2px 0 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.acts.strong { margin-top: 6px; font-size: 16px; font-weight: 600; }
/* Dias de uso: a fileira de dias, como no despertador. */
/* Como dividir a semana, à mão: os cards (meta, distribuído, falta) e cada dia com + e −. */
.stat-row.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row.three > .stat:last-child { grid-column: auto; }
.stat-row.three .stat { padding: 10px; }
.stat-row.three b { font-size: 17px; }
.stat.stat-over b { color: var(--danger); }
.day-split { display: flex; gap: 4px; }
.day-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border-radius: 12px; background: var(--soft); }
.day-col.off { background: transparent; border: 1px dashed var(--border); }
.day-amt { font-size: 15px; }
.day-name { font-size: 12px; font-weight: 700; color: var(--muted); }
.day-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.day-btn:disabled { opacity: 0.35; cursor: default; }
/* Barras da semana: quanto dá em cada dia. */
.week-bars-wrap { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.week-bars { display: flex; height: 132px; }
.wb-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wb-val { font-size: 12px; font-weight: 700; color: var(--text); }
.wb-track { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border); }
.wb-bar { position: relative; z-index: 1; width: 70%; max-width: 30px; background: var(--primary); border-radius: 4px 4px 0 0; }
/* Eixo à esquerda (0, metade, topo) e as linhas de grade atrás das barras. */
.wb-col.wb-axis { flex: 0 0 26px; }
.wb-axis .wb-track { border-bottom: none; }
.wb-tick { position: absolute; right: 5px; transform: translateY(50%); font-size: 10px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.wb-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--border); }
.wb-day { font-size: 12px; font-weight: 600; color: var(--muted); }
/* No Início: o limite vira a barra clara e o usado vem por dentro dela; hoje em destaque. */
.week-bars.with-use .wb-bar { background: var(--soft); box-shadow: inset 0 0 0 1px var(--primary); }
.wb-used { position: absolute; z-index: 2; bottom: 0; left: 50%; transform: translateX(-50%); width: 70%; max-width: 30px; background: var(--primary); border-radius: 4px 4px 0 0; }
/* Passou do limite: verde até o limite, laranja no que passou, e "+X" em cima. */
.wb-used.under { border-radius: 0; }
.wb-used.over { background: var(--accent); }
.wb-excess { position: absolute; z-index: 3; left: 50%; transform: translate(-50%, -2px); font-size: 11px; font-weight: 800; line-height: 1; color: var(--accent); white-space: nowrap; }
.legend .sw.over { background: var(--accent); }
.day-col.locked .day-amt { font-size: 14px; }
.day-col.locked:not(.off) { opacity: 0.6; }
.wb-col.today .wb-day { color: var(--primary); font-weight: 800; }
.legend .sw.used { background: var(--primary); }
.legend .sw.limit { background: var(--soft); box-shadow: inset 0 0 0 1px var(--primary); }
/* Objetivo: a barra de 10% a 100%. */
.goal-slider { display: flex; flex-direction: column; gap: 6px; }
.goal-value { font-size: 24px; color: var(--primary); }
.goal-slider input[type="range"] { width: 100%; accent-color: var(--primary); height: 32px; }
.goal-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.rules-next { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.row-links { display: flex; gap: 16px; flex-wrap: wrap; }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
/* Regra "do meu jeito": liga o lado e escolhe o horário. */
.rule-side { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rule-toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.rule-toggle input { width: 22px; height: 22px; accent-color: var(--primary); }

/* Várias escolhas com caixinha (ações do plano). */
.option.check .box {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px;
  border: 2px solid var(--border); border-radius: 7px;
  font-size: 14px; font-weight: 800; line-height: 1; color: var(--primary-ink);
}
.option.check[aria-pressed="true"] .box { background: var(--primary); border-color: var(--primary); }
.option.check[aria-pressed="true"] .box::after { content: '✓'; }

/* "Escreva o seu" + Adicionar. */
.add-own { display: flex; align-items: center; gap: 8px; }
.add-own .text-input { flex: 1; min-width: 0; }
.add-own .btn { flex: none; min-height: 48px; padding: 10px 16px; font-size: 15px; }

.identity { display: flex; align-items: center; gap: 12px; }
.identity .avatar { font-size: 44px; line-height: 1; }
.identity .pid { font: 700 22px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.04em; }

.notice {
  background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; font-size: 15px;
}
.error {
  background: var(--danger); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 15px;
}

/* ---------- Tela inicial ---------- */
.home { gap: 14px; }
/* Topo do Início (fixo, ver "Cabeçalhos fixos"): barra de cima e, embaixo, avatar com nome e
   conquistas na mesma linha e a semana do plano. */
.home-top { display: flex; flex-direction: column; gap: 2px; }
.who-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-line .who-name { flex: 0 1 auto; min-width: 0; }
.who-line .vitrine { margin-top: 0; flex: none; }
.home-bar { display: flex; align-items: center; justify-content: space-between; }
.home-nav { display: flex; align-items: center; gap: 4px; }
.tab-title .back + .menu-btn, .home-nav .back + .menu-btn { margin-left: 0; }
.home-head { display: flex; align-items: center; gap: 12px; }
.home-head .avatar { font-size: 34px; line-height: 1; }
.home-head .who { flex: 1; min-width: 0; }
.home-head .pid { font: 700 18px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.04em; }
/* Nome no topo (apelido ou ID): tocar abre ⚙️ Configurações. */
.who-name {
  display: flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.who-name .nick { font-weight: 700; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.04em; }
.streak {
  font: inherit; font-weight: 700; font-size: 18px; padding: 6px 12px; border-radius: 99px; border: none; cursor: pointer;
  background: var(--accent-soft); color: var(--text); white-space: nowrap;
}

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions .btn { min-height: 44px; padding: 10px 16px; font-size: 15px; }

.next-step { position: relative; border-left: 4px solid var(--primary); gap: 6px; }
.next-step h2 { padding-right: 36px; }
.card-close { position: absolute; top: 8px; right: 8px; }
.next-step p { margin: 0; }
.next-step .kicker { padding-right: 36px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); }
.next-step.kind-risk { border-left-color: var(--accent); }
.next-step.kind-risk .kicker { color: var(--accent); }
.next-step .row-actions { margin-top: 6px; }

.sleep-card { background: var(--accent-soft); border-color: transparent; gap: 6px; }

.today-card { gap: 8px; }
.meter { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.3s; }
/* Cartão do topo: meta da semana em cima, a parte de hoje embaixo. */
.week-head, .today-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.today-sep { border: none; border-top: 1px solid var(--border); margin: 4px 0 0; width: 100%; }
.meter.thin { height: 6px; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-actions > :only-child { grid-column: 1 / -1; }
.btn.big { min-height: 64px; font-size: 16px; }
.btn-accent { background: var(--accent); color: #1b1405; }
.btn-soft { background: var(--soft); color: var(--primary); border: 2px solid var(--primary); }

.link {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--primary); font: inherit; font-weight: 600; text-align: left; text-decoration: underline;
}
.center-link { align-self: center; text-align: center; font-size: 15px; }

/* Corrigir lançamentos: um cartão por dia (hoje, ontem, anteontem). */
.day-card { gap: 8px; }
.day-uses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.day-uses li { display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 8px; align-items: center; }
.day-uses .time { font-variant-numeric: tabular-nums; font-weight: 700; }
.day-uses .link { font-size: 14px; }

.section-title { font-size: 16px; margin-bottom: 8px; }
.uses ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.uses li {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 12px;
}
.uses .time { font-variant-numeric: tabular-nums; font-weight: 700; display: flex; flex-direction: column; line-height: 1.15; }
.uses .time small { font-size: 11px; font-weight: 600; }
/* Horário em 24h: hora e minuto em duas listas. */
.time-field { display: inline-flex; align-items: center; gap: 4px; }
.time-field select { width: auto; padding-right: 8px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.time-field select:disabled { opacity: 0.4; }
.uses .amount { font-weight: 600; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent;
  color: var(--muted); font-size: 16px; cursor: pointer;
}
.icon-btn:hover { background: var(--soft); }

.missions ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.missions li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; font-size: 15px; }
.missions .m-done span:last-child { color: var(--muted); text-decoration: line-through; }
.missions .m-locked { color: var(--muted); }

/* ---------- Títulos das abas (com ⚙️ e 🆘) ---------- */
.tab-title { display: flex; align-items: center; gap: 4px; }
.tab-title .settings-link, .tab-title .bell-link, .tab-title .help-link { padding: 4px; }
.tab-title h1 { flex: 1; min-width: 0; margin: 0; font-size: clamp(19px, 5.4vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-title .bell-link + .help-link { margin-left: 0; }

/* ---------- Progresso ---------- */
.stat-row.compact b { font-size: 17px; line-height: 1.3; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--primary); }
.chart .bar.over { fill: var(--accent); }
.chart .partial .bar { opacity: 0.5; }
.chart .target { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.chart .baseline { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart text { fill: var(--muted); font-size: 11px; text-anchor: middle; font-family: inherit; }
.chart .val { fill: var(--text); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend .sw { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.legend .sw.bar { background: var(--primary); }
.legend .sw.target { height: 3px; background: var(--text); }
.legend .sw.baseline { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; }

.heatmap {
  display: grid; grid-template-columns: 30px repeat(var(--cols), 1fr); gap: 3px;
  font-size: 11px; color: var(--muted); align-items: center;
}
.hm-hour { text-align: left; white-space: nowrap; }
.hm-day { font-weight: 600; }
.hm-cell {
  aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--primary-ink);
  background: color-mix(in srgb, var(--primary) var(--i), var(--soft));
}

.trig-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.trig-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-bottom: 4px; }

.sleep-bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; }
.sleep-col { flex: 1; max-width: 44px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.sleep-col .sb { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.sleep-col.base .sb { background: var(--muted); opacity: 0.5; }
.sleep-col.hard .sb { background: var(--accent); }
.sleep-col span { font-size: 12px; font-weight: 700; }
.sleep-col small { font-size: 11px; color: var(--muted); }

/* ---------- Wikislow ---------- */
.wiki-list { display: flex; flex-direction: column; gap: 6px; }
.wiki-row {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  color: var(--text); font: inherit;
}
.wiki-row .wiki-title { font-weight: 700; line-height: 1.3; }
.wiki-row.read .wiki-title { color: var(--muted); }
.wiki-suggest { gap: 8px; border-color: var(--primary); }
.wiki-suggest .wiki-row { border: none; padding: 0; background: none; }
.article h1 { font-size: 24px; }
.article-body p { margin: 0 0 12px; line-height: 1.6; }
.article-body ul, .article-body ol { margin: 0 0 12px; padding-left: 22px; line-height: 1.6; }
.article-body li { margin-bottom: 4px; }
.todo { border-color: var(--primary); background: var(--soft); }
.todo ul { margin: 0; padding-left: 20px; line-height: 1.6; }
.source-link {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
  color: var(--text); padding: 10px 12px; border-radius: 10px; background: var(--bg);
}
.source-link small { color: var(--primary); font-weight: 700; }

/* ---------- Jogo ---------- */
.pills-row { display: flex; align-items: center; gap: 4px; }

.money-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; }
.money-line b { font-size: 20px; color: var(--primary); }
.money-line b.neg { color: var(--accent); }

/* ---------- Você vs. você ---------- */
.good { color: var(--primary); }
.bad { color: var(--accent); }
.self-card { gap: 12px; border-color: var(--primary); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.vs > div { display: flex; flex-direction: column; gap: 2px; }
.vs > div:last-child { text-align: right; }
.vs b { font-size: 20px; }
.vs-mid b { font-size: 16px; }
.meter.over > span { background: var(--accent); }
.record-line { margin: 0; font-weight: 600; }
.review-card { background: var(--soft); border-color: var(--primary); gap: 6px; }
.tool-note { margin: 0; color: var(--primary); font-weight: 600; }
.tool-note.muted { color: var(--muted); font-weight: 500; }

.records { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.records li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; }
.records .rec-emoji { font-size: 20px; }
.records .rec-label { display: flex; flex-direction: column; font-size: 15px; }
.records .rec-value { font-size: 17px; white-space: nowrap; }
.records li.at-record .rec-value { color: var(--primary); }

/* Você vs. o seu fantasma */
.ghost-head { display: flex; align-items: center; gap: 12px; }
.ghost-badge { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 26px; background: var(--soft); }
.ghost-badge.behind { background: var(--accent-soft); }
.ghost-big { display: block; font-size: 24px; line-height: 1.2; }
.chart-wrap { position: relative; touch-action: pan-y; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart text.tick { font-size: 10px; text-anchor: end; }
.chart text.tick.start { text-anchor: start; }
.chart text.end { fill: var(--text); font-weight: 700; text-anchor: start; }
.chart.ghost polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart.ghost .you-line { stroke: var(--chart-you); }
.chart.ghost .ghost-line { stroke: var(--chart-ghost); stroke-dasharray: 5 4; }
.chart.ghost .ghost-line.multi { stroke-dasharray: none; stroke-width: 1.6; }
/* Fantasma "Por dia": o uso de cada dia em barras (hoje mais forte). */
.chart.ghost .day-bar { fill: var(--chart-you); opacity: 0.7; }
.chart.ghost .day-bar.today { opacity: 1; }
.chart.ghost .gap.ahead { fill: var(--chart-you); opacity: 0.12; }
.chart.ghost .gap.behind { fill: var(--accent); opacity: 0.2; }
.chart.ghost circle { stroke: var(--surface); stroke-width: 2; }
.chart.ghost .you-dot { fill: var(--chart-you); }
.chart.ghost .ghost-dot { fill: var(--chart-ghost); }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute; top: -4px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px 10px; font-size: 13px; line-height: 1.35;
}
.chart-tip .tip-when { color: var(--muted); font-size: 12px; }
/* Menu suspenso do fantasma e do mapa de horários. */
.pick-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.pick-label select { width: 100%; }
.chart text.tick.day { text-anchor: middle; }
.chart text.tick.day.today { fill: var(--text); font-weight: 700; }
.legend .sw.you { height: 2px; background: var(--chart-you); }
.legend .sw.ghost { height: 0; border-top: 2px dashed var(--chart-ghost); border-radius: 0; }
.legend .sw.ghost.solid { border-top-style: solid; }
.legend .sw.daybar { background: var(--chart-you); }

/* Relatório: pensado para a tela e para imprimir ou salvar em PDF */
.report { gap: 14px; }
.report-head h1 { margin-top: 2px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.report-table th, .report-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.report-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.report-rows { gap: 0; }
.report-rows li { padding: 8px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.report-rows li:last-child { border-bottom: none; }
.report-rows li span { color: var(--muted); }
.report-rows li b { text-align: right; font-weight: 600; }
/* Dinheiro (Progresso e relatório): o número em destaque e a curva do economizado. */
.money-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.money-hero { font-size: 28px; line-height: 1.1; }
.chart.money polyline { fill: none; stroke: var(--chart-you); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart.money .area.up { fill: var(--chart-you); opacity: 0.12; }
.chart.money .area.down { fill: var(--accent); opacity: 0.25; }
.chart.money .zero { stroke: var(--muted); stroke-width: 1; }
.chart.money circle { fill: var(--chart-you); stroke: var(--surface); stroke-width: 2; }
/* Resumo da melhoria: um quadro por número */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--bg); min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 22px; line-height: 1.2; }
.kpi-delta { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-delta.good { color: var(--primary); }
.kpi-delta.bad { color: var(--danger); }
.kpi-note { font-size: 12px; color: var(--muted); }
/* Pela largura do conteúdo (não da tela): 2 colunas no celular, 3 quando cabe. */
@container (max-width: 559px) { .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@container (min-width: 560px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media print {
  /* Papel é sempre claro, mesmo com o celular no tema escuro. */
  :root {
    --bg: #f4f7f3; --surface: #fff; --text: #1b2a21; --muted: #4a5a50; --border: #d5ded8;
    --primary: #2f7d4f; --soft: #e2efe6; --accent: #e9a93a; --accent-soft: #fbf0da; --danger: #c0483f;
    --chart-you: #2f7d4f; --chart-ghost: #7a5fc4; --shadow: none; color-scheme: light;
  }
  .devbar, .tabbar, .drawer, .drawer-backdrop, .menu-btn, .topline, .toast, .no-print, .help-link, .settings-link, .bell-link, .chart-tip { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; min-height: 0; }
  .report { animation: none; }
  .report .card { border: 1px solid var(--border); break-inside: avoid; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Vitrine de badges */
.bchip {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: 15px; line-height: 1; background: var(--bg); border: 2px solid var(--border);
}
.bchip.big { width: 44px; height: 44px; font-size: 24px; border-width: 3px; }
.bchip.tier-0 { border-color: #c98b4f; }
.bchip.tier-1 { border-color: #aab4bd; }
.bchip.tier-2 { border-color: #e3b53a; }
.vitrine {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 6px 2px 2px;
  border: 1px dashed var(--border); border-radius: 99px; background: none; color: var(--text); cursor: pointer; font: inherit;
}
.vitrine-edit { color: var(--muted); font-size: 13px; margin-left: 2px; }
.vitrine-card { gap: 10px; border-color: var(--primary); }
.vitrine-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 10px 6px; border-radius: 12px; background: var(--bg); font-size: 13px; font-weight: 600; line-height: 1.2;
}
.slot.empty { border: 2px dashed var(--border); color: var(--muted); font-weight: 400; justify-content: center; min-height: 92px; }
.pin {
  margin-top: 4px; padding: 6px 12px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--primary); background: transparent; color: var(--primary); font: inherit; font-size: 13px; font-weight: 700;
}
.pin.on { background: var(--primary); color: var(--primary-ink); }
.badge.pinned { box-shadow: 0 0 0 2px var(--primary) inset; }

.breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 10px;
}
.badge .b-emoji { font-size: 36px; line-height: 1; filter: grayscale(1); opacity: 0.45; }
.badge.earned .b-emoji { filter: none; opacity: 1; }
.badge.earned { border-color: var(--primary); }
.badge .b-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.badge .b-crit { font-size: 13px; color: var(--muted); line-height: 1.3; }
.badge .b-done { font-size: 13px; font-weight: 700; color: var(--primary); }
.badge .b-prog { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge .b-date { font-size: 12px; color: var(--primary); font-weight: 600; }
.b-tiers { display: flex; gap: 4px; }
.b-tiers span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.b-tiers span.on { background: var(--accent); }
.b-tiers.medals span.on:nth-child(1) { background: #c98b4f; }
.b-tiers.medals span.on:nth-child(2) { background: #aab4bd; }
.b-tiers.medals span.on:nth-child(3) { background: #e3b53a; }
.small-meter { height: 6px; width: 100%; }

/* ---------- Lançar uso ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-weight: 700; }
.paid-chip { margin: 0; }
.ghost-chip { border-style: dashed; color: var(--muted); }

/* ✕ no canto de uma opção escrita pela pessoa (tirar da lista). */
.opt-wrap, .chip-wrap { position: relative; display: block; }
.chip-wrap { display: inline-block; }
.opt-wrap > .option { width: 100%; }
.remove-x {
  position: absolute; top: -6px; right: -6px; z-index: 1;
  width: 22px; height: 22px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 11px; line-height: 1; cursor: pointer;
}
.remove-x:hover { color: var(--danger); border-color: var(--danger); }
/* Botão com uma linha menor embaixo, ex.: "Fumei" / "(lançar)". */
.btn.btn-stack { flex-direction: column; gap: 0; }
.btn-sub { font-size: 12px; font-weight: 500; opacity: 0.75; }

/* ---------- Diálogo de ajuda ---------- */
dialog {
  width: min(440px, calc(100vw - 32px)); border: none; border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 20px;
}
dialog::backdrop { background: rgb(0 0 0 / 0.5); }
dialog h2 { margin-bottom: 8px; }
.help-item { display: flex; flex-direction: column; gap: 2px; margin: 14px 0; }
.help-item span { color: var(--muted); font-size: 15px; }
dialog a { color: var(--primary); font-weight: 600; }

/* Janela do preço de um tipo (no primeiro lançamento dele) e a lista de preços. */
.price-dialog form { display: flex; flex-direction: column; gap: 10px; }
.price-dialog h2 { font-size: 19px; line-height: 1.3; margin: 0; }
.price-dialog p { margin: 0; }
.price-dialog .row-actions { display: grid; grid-template-columns: 1fr 1fr; }
.price-dialog .row-actions .btn { width: 100%; }
.price-list li { display: flex; align-items: center; gap: 12px; }
.price-list li b { flex: 1; min-width: 0; }
.price-list .money { flex: none; margin-top: 0; }
.price-list .money span { font-size: 18px; }
.price-list .money input { width: 110px; font-size: 22px; }

/* ---------- ⚙️ Configurações ---------- */
.settings { gap: 14px; }
.settings .identity .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.settings-list small.missing { color: var(--accent); font-weight: 600; }
/* Os botões das Configurações: cada um abre a sua área. */
.settings-hub { display: flex; flex-direction: column; gap: 10px; }
.settings-nav {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.settings-nav:hover { border-color: var(--primary); }
.settings-nav .ico { font-size: 24px; line-height: 1; }
.settings-nav .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-nav small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-nav small.missing { color: var(--accent); font-weight: 600; }
.settings-nav.danger b { color: var(--danger); }
.btn-danger { background: var(--danger); color: var(--surface); border: 2px solid transparent; font-weight: 700; }
.btn-danger:disabled { opacity: 0.6; }
/* A barra de teste, quando mora nas Configurações: sem o fundo e a borda do topo. */
.test-card .devbar { position: static; padding: 0; background: none; border: none; }

/* ---------- Conta (entrar / criar conta) ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.password-row { display: flex; gap: 8px; align-items: stretch; }
.password-row .text-input { flex: 1; min-width: 0; }

/* ---------- Lançar uso: o resumo do que vem pronto (toque pra mudar) ---------- */
.chips.center { justify-content: center; }
.log-summary {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--border); background: var(--surface);
  color: var(--text); font: inherit;
}
.log-summary .small { color: var(--primary); font-weight: 600; white-space: nowrap; }

/* ---------- Telas de todos os tamanhos ----------
   Celular pequeno (até 360px): menos margem e botões um pouco menores. Tablet: coluna mais larga.
   Computador: as abas viram uma barra fixa à esquerda e Progresso/Relatório usam 2 colunas. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-tip { white-space: normal; max-width: 200px; }

@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .stepper { gap: 8px; }
  .stepper button { width: 46px; height: 46px; font-size: 22px; }
  .stepper input { font-size: 34px; }
  .btn.big { min-height: 56px; font-size: 15px; }
  .heatmap { grid-template-columns: 26px repeat(var(--cols), 1fr); gap: 2px; font-size: 9px; }
  .hm-cell { font-size: 8px; border-radius: 3px; }
  .row-buttons, .day-split { gap: 4px; }
  .emoji-grid .option { font-size: 24px; }
  .day-uses li { grid-template-columns: auto 1fr auto auto; }
  .day-uses li > .muted { grid-column: 1 / -1; grid-row: 2; }
  .uses li { grid-template-columns: auto 1fr auto; }
  .uses li > .muted { grid-column: 1 / -1; }
}

@media (min-width: 768px) {
  main { max-width: 680px; }
  .tabbar button { max-width: 160px; }
}

@media (min-width: 1024px) {
  :root { --rail: 104px; }
  body.has-tabbar { padding-left: var(--rail); }
  body.has-tabbar main { max-width: 760px; padding-bottom: 48px; }
  .tabbar {
    top: 0; right: auto; width: var(--rail); flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: calc(16px + env(safe-area-inset-top)) 10px 16px;
    border-top: none; border-right: 1px solid var(--border);
  }
  .tabbar button { flex: none; max-width: none; padding: 12px 4px; font-size: 13px; }
  body.has-tabbar .toast { bottom: 24px; left: calc(50% + var(--rail) / 2); }
  .screen.cols { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .screen.cols > :is(.tab-title, .topline, .report-head, h1, .wide) { grid-column: 1 / -1; }
}
.auth-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-head h1 { margin: 0; }
.auth .center { text-align: center; margin: 0; }

/* ---------- ⭐ Avaliar o app ---------- */
.stars-pick { display: flex; justify-content: center; gap: 6px; }
.stars-pick button {
  border: none; background: none; cursor: pointer; padding: 4px;
  font-size: 40px; line-height: 1; color: var(--border);
}
.stars-pick button.on { color: var(--accent); }
textarea.text-input { resize: vertical; min-height: 110px; line-height: 1.4; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }

/* ---------- 🔥 Sequência de registro (Início) ---------- */
.streak-card { gap: 12px; border-color: var(--accent); }
.streak-head { display: flex; align-items: center; gap: 12px; }
.streak-head .grow { display: flex; flex-direction: column; }
.flame { font-size: 40px; line-height: 1; }
.flame.off { filter: grayscale(1); opacity: 0.5; }
.streak-num { font-size: 24px; line-height: 1.1; }
.streak-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.sd { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sd small { font-size: 11px; color: var(--muted); }
.sd-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; border: 2px solid var(--border); color: var(--muted);
}
.sd.logged .sd-dot { background: var(--accent); border-color: var(--accent); color: #1b1405; }
.sd.protected .sd-dot { background: #dff1fb; border-color: #8fcbe8; font-size: 14px; }
.sd.missed .sd-dot { background: var(--bg); border-style: dotted; }
.sd.pending .sd-dot { border-style: dashed; border-color: var(--accent); }
.sd.none .sd-dot { opacity: 0.35; }
.streak-msg { margin: 0; font-weight: 600; }
.shield-line > span:nth-child(2) { flex: 1; min-width: 0; }
.shield-line { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.shield-line.on { background: #e5f4fb; color: #134a63; }
.shield-dots { display: inline-flex; gap: 3px; margin-left: auto; }
.shield-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.shield-dots i.on { background: #4aa8d8; }
.streak-help summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; }
.streak-help ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sd.protected .sd-dot { background: #12313f; border-color: #2f7aa0; }
  :root:not([data-theme="light"]) .shield-line.on { background: #12313f; color: #bfe6f7; }
}
@media (max-width: 360px) { .sd-dot { width: 28px; height: 28px; } }

/* ---------- Conquistas: a mais perto e a trilha da sequência ---------- */
.next-badge { border-color: var(--primary); }
.nb-row { display: flex; gap: 14px; align-items: flex-start; }
.nb-row .grow { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.nb-emoji { font-size: 40px; line-height: 1; }
.trail { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); position: relative; }
.trail::before { content: ''; position: absolute; left: 6%; right: 6%; top: 15px; height: 3px; background: var(--border); border-radius: 2px; }
.trail li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.t-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: var(--surface); border: 2px solid var(--border);
}
.trail li.got .t-dot { background: var(--accent-soft); border-color: var(--accent); }
.trail li.here .t-dot { border-color: var(--primary); border-style: dashed; border-width: 3px; }
.trail small { font-size: 12px; font-weight: 700; color: var(--muted); }
.trail li.got small { color: var(--text); }
@media (max-width: 360px) { .t-dot { width: 26px; height: 26px; font-size: 13px; } .trail::before { top: 12px; } }
