/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: var(--tab-h); background: var(--moss);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar ul { max-width: var(--app-w); margin: 0 auto; height: 100%; display: flex; }
.tabbar li { flex: 1; }
.tabbar a {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--cream); text-decoration: none; font-size: 11px; opacity: 0.55;
}
.tabbar a .ico { font-size: 22px; line-height: 1; }
.tabbar a.active { opacity: 1; font-weight: 600; }
.tabbar.hidden { display: none; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-s);
  border: 0; cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none;
  background: var(--moss); color: var(--cream); transition: filter .15s;
}
.btn:active { filter: brightness(0.92); }
.btn.peach { background: var(--peach-d); color: var(--cream); }
.btn.soft { background: var(--peach-l); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--moss); border: 1.5px solid var(--moss); }
.btn.white { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn.fb { background: #1877F2; color: #fff; }
.btn.ig { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* cards */
.card {
  background: var(--white); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.card.moss { background: var(--moss); color: var(--cream); }
.card.moss a { color: var(--cream); }
.card.peach { background: var(--peach); color: var(--ink); }
.card.gold { border-left: 4px solid var(--gold); }
.card.gold-border { border: 1.5px solid var(--gold); }
.card h3 { margin-bottom: 4px; }
.card .row { display: flex; align-items: center; gap: 10px; }
.card .row .grow { flex: 1; min-width: 0; }

/* lista estilo iOS */
.list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px;
  width: 100%; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; text-decoration: none;
}
.list .item:active { background: var(--cream); }
.list .item .emoji { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.list .item .txt { flex: 1; min-width: 0; }
.list .item .txt b { display: block; font-weight: 600; font-size: 15px; }
.list .item .txt span { display: block; font-size: 12.5px; color: var(--ink-2); }
.list .item .chev { color: var(--ink-2); opacity: 0.6; }
.list .item.static { cursor: default; }
.list .item.static:active { background: none; }

/* badges e chips */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--peach); color: var(--ink); white-space: nowrap;
}
.badge.gold { background: var(--gold); color: var(--white); }
.badge.moss { background: var(--moss); color: var(--cream); }
.badge.soft { background: var(--moss-l); color: var(--moss-d); }
.badge.ok { background: #DDF0E3; color: var(--ok); }
.badge.off { background: var(--line); color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--peach); display: inline-block; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip {
  border: 1.5px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 36px;
}
.chip.on { background: var(--moss); border-color: var(--moss); color: var(--cream); }
.chip .sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; border: 1px solid rgba(0,0,0,0.1); }

/* progresso */
.progress { height: 8px; background: rgba(255,255,255,0.25); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--peach); border-radius: 999px; transition: width .3s; }
.progress.dark { background: var(--line); }
.progress.dark > i { background: var(--moss); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }

/* formulários */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1.5px solid var(--line); background: var(--white); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--moss); }
.textarea { min-height: 90px; resize: vertical; }
.input.err { border-color: var(--erro); }
.err-msg { color: var(--erro); font-size: 12px; margin-top: 4px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .input { flex: 1; }
/* falar em vez de digitar: microfone dentro do campo */
.ditado { position: relative; }
.ditado .input, .ditado .textarea { padding-right: 50px; }
.mic { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; background: var(--cream); color: var(--moss); display: grid; place-items: center; cursor: pointer; }
.mic svg { width: 18px; height: 18px; }
.mic:hover { background: var(--peach-l); }
.mic:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.ditado.multi .mic { top: auto; bottom: 8px; transform: none; }
.mic.on { background: var(--erro); color: var(--white); animation: mic-pulso 1.2s ease-in-out infinite; }
@keyframes mic-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.45); } 50% { box-shadow: 0 0 0 9px rgba(192, 57, 43, 0); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.dica-ditado { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.dica-ditado svg { width: 16px; height: 16px; color: var(--moss); flex: 0 0 auto; }
.prefix { min-height: 44px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--line); font-weight: 600; }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch i::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--white); border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--moss); }
.switch input:checked + i::before { transform: translateX(20px); }

/* toast e modal */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-end; justify-content: center; background: rgba(44,26,30,0.45); }
#modal.show { display: flex; }
#modal .sheet {
  background: var(--cream); width: 100%; max-width: var(--app-w); border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto;
}
#modal .sheet h2 { margin-bottom: 10px; }
#modal .sheet .btn-row { margin-top: 16px; }

/* banner de onboarding contextual */
.banner {
  background: var(--peach); color: var(--ink); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 12px; display: flex; gap: 12px; align-items: center;
}
.banner .txt { flex: 1; font-size: 13.5px; }
.banner .txt b { display: block; font-size: 15px; }

/* placeholder "em breve" */
.soon { text-align: center; padding: 32px 20px; }
.soon .big { font-size: 56px; margin-bottom: 8px; }
.soon p { color: var(--ink-2); }

/* accordion de passos */
.steps { counter-reset: passo; }
.steps li { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  counter-increment: passo; content: counter(passo);
  width: 28px; height: 28px; border-radius: 50%; background: var(--peach); color: var(--ink);
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px;
}
.steps li b { display: block; }
.steps li span { font-size: 13px; color: var(--ink-2); }
.tabs { display: flex; background: var(--white); border-radius: 999px; padding: 4px; margin-bottom: 12px; box-shadow: var(--shadow); }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.tabs button.on { background: var(--moss); color: var(--cream); }
