:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef1ed;
  --text: #17201d;
  --muted: #5f6b66;
  --line: #e1e6e0;
  --brand: #0f766e;
  --brand-strong: #0b5e58;
  --brand-ink: #ffffff;
  --brand-soft: #d8efea;
  --accent: #f59e0b;
  --danger: #c2410c;
  --danger-soft: #fdecdf;
  --shadow: 0 1px 2px rgb(16 24 20 / .06), 0 4px 16px rgb(16 24 20 / .06);
  --shadow-lg: 0 -8px 40px rgb(16 24 20 / .18);
  --radius: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1412;
    --surface: #13201d;
    --surface-2: #1a2a26;
    --text: #e7efec;
    --muted: #93a39d;
    --line: #23332f;
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --brand-ink: #062b27;
    --brand-soft: #123a35;
    --danger: #fb923c;
    --danger-soft: #3a2116;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-lg: 0 -8px 40px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#app {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px);
}

/* ---------- Cabeçalho ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  padding: calc(14px + var(--safe-t)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 8px;
}
.top .title { flex: 1; min-width: 0; }
.top h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top.compact h1 { font-size: 20px; }
.eyebrow { margin: 0 0 2px; font-size: 13px; color: var(--muted); font-weight: 600; }
.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--text);
}
.icon-btn:active { background: var(--surface-2); }

.page { padding: 4px 16px 16px; }

/* ---------- Cards das listas ---------- */
.cards { display: grid; gap: 12px; }
.card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.card:active { transform: scale(.99); }
.card h2 { margin: 0 44px 2px 0; font-size: 18px; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.card .menu-btn { position: absolute; top: 8px; right: 6px; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; font-size: 14px; color: var(--muted); }
.card .row strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s ease; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .big { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.empty h2 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 0 20px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 14px;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 650; font-size: 16px;
}
.btn:active { filter: brightness(.95); transform: scale(.98); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }

.fab {
  position: fixed; z-index: 6;
  right: max(16px, calc(50% - 340px + 16px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  height: 56px; padding: 0 22px 0 18px;
  border: 0; border-radius: 18px;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 700; font-size: 16px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgb(15 118 110 / .35);
}
.fab:active { transform: scale(.96); }

/* ---------- Barra de abas ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.tabbar a.active { color: var(--brand); }
.tabbar svg { width: 24px; height: 24px; }

/* ---------- Tela da lista ---------- */
.summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.summary .nums { display: flex; justify-content: space-between; gap: 12px; }
.summary .num span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.summary .num strong { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.summary .num.right { text-align: right; }
.summary .hint { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand-strong);
  font-size: 13px; font-weight: 600;
}

.quick {
  display: flex; gap: 8px; margin: 14px 0 6px;
}
.quick input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  font-size: 16px;
}
.quick input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.quick .btn { width: 50px; padding: 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 0; }
.toggle-link { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 14px; padding: 10px 0; }

.group { margin-top: 14px; }
.group-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 4px 8px; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.group-title .count { margin-left: auto; font-weight: 600; }
.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.check {
  flex: none; width: 56px; align-self: stretch;
  display: grid; place-items: center;
  border: 0; background: none;
}
.check i {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid color-mix(in srgb, var(--muted) 60%, transparent);
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.check svg { width: 16px; height: 16px; stroke-width: 3; opacity: 0; color: var(--brand-ink); }
.item.done .check i { background: var(--brand); border-color: var(--brand); }
.item.done .check svg { opacity: 1; }
.item-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 0; min-height: 64px;
  border: 0; background: none; text-align: left;
}
.item-main:active { background: var(--surface-2); }
.thumb {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center; font-size: 22px; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-text { flex: 1; min-width: 0; }
.item-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-price { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 15px; }
.item-price.none { color: var(--muted); font-weight: 500; font-size: 13px; }
.item.done .item-name { text-decoration: line-through; color: var(--muted); }
.item.done .thumb { opacity: .55; }
.item.done .item-price { color: var(--muted); }

/* ---------- Mercados / Ajustes ---------- */
.section-title { margin: 22px 4px 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row-btn {
  width: 100%; min-height: 56px; padding: 10px 12px 10px 16px;
  display: flex; align-items: center; gap: 12px;
  border: 0; background: none; text-align: left;
}
.row-btn:active { background: var(--surface-2); }
.row-btn .ico { font-size: 22px; width: 32px; text-align: center; flex: none; }
.row-btn .txt { flex: 1; min-width: 0; }
.row-btn .txt small { display: block; color: var(--muted); font-size: 13px; }
.row-btn .chev { color: var(--muted); width: 20px; height: 20px; }
.note { color: var(--muted); font-size: 14px; margin: 8px 4px 0; }

/* ---------- Bottom sheet ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .4); opacity: 0; transition: opacity .25s ease; }
#sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 680px; margin: 0 auto;
  max-height: calc(100dvh - var(--safe-t) - 24px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
}
#sheet-root.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; padding: 6px 8px 4px 20px; flex: none; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 19px; }
.sheet-body { overflow-y: auto; padding: 6px 20px calc(20px + var(--safe-b)); overscroll-behavior: contain; }

.menu { display: grid; gap: 4px; padding-bottom: 4px; }
.menu-item { min-height: 52px; border: 0; border-radius: 12px; background: none; text-align: left; padding: 0 12px; font-size: 16px; font-weight: 550; display: flex; align-items: center; gap: 12px; }
.menu-item:active { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 14px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 16px;
}
.textarea { min-height: 76px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stepper { display: flex; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.stepper button { width: 46px; border: 0; background: none; font-size: 22px; font-weight: 600; color: var(--brand); }
.stepper button:active { background: var(--surface-2); }
.stepper input { flex: 1; min-width: 0; border: 0; background: none; text-align: center; font-size: 17px; font-weight: 600; min-height: 48px; }
.stepper input:focus { outline: none; }

.money { position: relative; }
.money::before { content: "R$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money .input { padding-left: 44px; }
.total-line { font-size: 14px; color: var(--muted); }
.total-line strong { color: var(--text); }

.chips { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; margin: 0 -20px; padding-inline: 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips label { flex: none; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 15px; font-weight: 550; white-space: nowrap; cursor: pointer;
}
.chips input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.photo-pick {
  position: relative; display: grid; place-items: center;
  height: 150px; border: 2px dashed var(--line); border-radius: 16px; background: var(--bg);
  color: var(--muted); font-weight: 600; overflow: hidden; cursor: pointer;
}
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick .ph { display: grid; justify-items: center; gap: 6px; }
.photo-pick.has { border-style: solid; height: 200px; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; gap: 8px; }
.photo-actions .btn { flex: 1; min-height: 40px; font-size: 14px; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn { flex: 1; }
.form-actions .btn.danger { flex: 0 0 auto; padding: 0 16px; }

.emoji-input { width: 64px; text-align: center; font-size: 22px; padding: 0; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; z-index: 30; left: 16px; right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px);
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: 14px;
  background: #17201d; color: #fff; box-shadow: 0 8px 30px rgb(0 0 0 / .25);
  font-size: 15px;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: none; pointer-events: auto; }
#toast span { flex: 1; }
#toast button { border: 0; background: none; color: #5eead4; font-weight: 700; padding: 6px 8px; }

/* ---------- Início: planejadas, gasto do mês ---------- */
.spend {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px; padding: 14px 12px 14px 16px;
  border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-strong);
  font-weight: 600;
}
.spend span { flex: 1; }
.spend strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.spend .chev { color: inherit; width: 20px; height: 20px; }
.section-title { display: flex; align-items: center; gap: 8px; }
.count-pill { background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 1px 8px; font-size: 12px; }
.section-sum { margin-left: auto; color: var(--text); text-transform: none; letter-spacing: 0; }
.card .sub { align-items: center; gap: 4px 10px; margin-top: 2px; }
.when { font-weight: 600; color: var(--brand-strong); }
.when.soon { color: var(--accent); }
.when.late { color: var(--danger); }
.repeat { color: var(--brand-strong); font-weight: 600; }
.cards.archived { opacity: .7; margin-top: 8px; }

/* ---------- Lista / modo compra ---------- */
.chips-line { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip.soft { background: var(--surface-2); color: var(--muted); }
.icon-btn.on { background: var(--brand-soft); color: var(--brand-strong); }
.icon-btn.small { width: 34px; height: 34px; margin-left: auto; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; flex: none; }

.seg {
  display: flex; gap: 4px; padding: 4px; margin: 10px 0 2px;
  background: var(--surface-2); border-radius: 14px;
}
.seg button {
  flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: none;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.progress.warn > i { background: var(--accent); }
.progress.over > i { background: var(--danger); }
.over { color: var(--danger); }
.good { color: var(--brand); }

.trend { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.trend.up { background: var(--danger-soft); color: var(--danger); }
.trend.down { background: var(--brand-soft); color: var(--brand-strong); }

.bottom-actions {
  position: fixed; z-index: 6; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  max-width: 680px; margin: 0 auto; padding: 0 16px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.bottom-actions > * { pointer-events: auto; }
.fab.inline { position: static; flex: none; }
.btn.finish {
  flex: 1; min-width: 0; height: 56px; border-radius: 18px;
  background: var(--text); color: var(--bg);
  box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px;
}

.lead { color: var(--muted); margin: 0; }
.summary.mini { box-shadow: none; background: var(--bg); }
.summary .num strong small, .row-val small { font-size: 12px; color: var(--muted); font-weight: 500; }

.radios { display: grid; gap: 8px; }
.radios label { position: relative; }
.radios input { position: absolute; opacity: 0; }
.radios span {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); font-weight: 550; cursor: pointer;
}
.radios span::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--muted); }
.radios input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.radios input:checked + span::before { border: 6px solid var(--brand); }
.radios input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.price-hist { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.ph-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; font-size: 13px; }
.ph-head .toggle-link { padding: 0; font-size: 13px; }
.ph-row { display: flex; justify-content: space-between; padding: 4px 0; }
.ph-row strong { font-variant-numeric: tabular-nums; }
.ph-best { margin-top: 4px; color: var(--brand-strong); font-weight: 600; }

/* ---------- Histórico ---------- */
.row-val { flex: none; font-variant-numeric: tabular-nums; font-size: 15px; text-align: right; }
.row-btn .thumb { width: 36px; height: 36px; font-size: 18px; }

/* ---------- Comparar ---------- */
.winner {
  margin-bottom: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 750; text-align: center; letter-spacing: .02em;
}
.winner.warn { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.card.cmp { display: grid; gap: 10px; }
.card.cmp:active { transform: none; }
.card.cmp.best { border: 2px solid var(--brand); }
.cmp-head { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.cmp-head h2 { margin: 0; }
.badge-win { background: var(--brand-soft); color: var(--brand-strong); border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-result { padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cmp-result strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- Conta / casa ---------- */
.code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--text); }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3em; text-align: center; font-size: 22px; text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

/* ---------- Meta, reposição, relatórios ---------- */
button.spend { width: 100%; border: 0; text-align: left; flex-wrap: wrap; }
.spend small, .restock small { display: block; font-size: 13px; font-weight: 500; opacity: .85; }
.spend .progress { flex-basis: 100%; margin-top: 6px; background: color-mix(in srgb, var(--brand-strong) 18%, transparent); }
.restock {
  width: 100%; display: flex; align-items: center; gap: 10px;
  margin: 8px 0 4px; padding: 12px 12px 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-align: left; font-weight: 600;
}
.restock > span:not(.ico) { flex: 1; min-width: 0; }
.restock small { color: var(--muted); opacity: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.restock .ico { font-size: 22px; }
.restock .chev { color: var(--muted); width: 20px; height: 20px; flex: none; }
.restock:active { background: var(--surface-2); }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 10px; }
.month-nav strong { font-size: 17px; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }

button.summary { width: 100%; text-align: left; display: block; }
.summary .nums.three .num { flex: 1; }
.summary .nums.three strong { font-size: 18px; }

.bars { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; }
.bar-head > span { min-width: 0; }
.bar-head small { display: block; color: var(--muted); font-size: 12px; }
.bar-head strong { flex: none; font-variant-numeric: tabular-nums; }
.bar { height: 8px; margin-top: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bars li:not(.current) .bar > i { opacity: .85; }
.bars li.current .bar-head { font-weight: 700; }
.bars:has(li.current) li:not(.current) .bar > i { opacity: .4; }

.settle { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong); display: grid; gap: 4px; }
.settle small { color: var(--muted); }

/* ---------- Calendário ---------- */
.cal { margin-top: 12px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-day {
  min-height: 52px; padding: 4px 2px; border: 0; border-radius: 10px; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
}
.cal-day:active { background: var(--surface-2); }
.cal-day .n { font-size: 14px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .n { background: var(--text); color: var(--bg); }
.cal-day .v { font-size: 10px; font-weight: 700; line-height: 1.1; padding: 1px 4px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-strong); font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; }
.cal-day .v.plan { background: color-mix(in srgb, var(--accent) 22%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.cal-day.has-late .v.plan { background: var(--danger-soft); color: var(--danger); }
.cal-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot.spent { background: var(--brand); }
.dot.plan { background: var(--accent); }
.dot.late { background: var(--danger); }

/* ---------- Despensa ---------- */
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; vertical-align: 1px; background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: color-mix(in srgb, var(--accent) 20%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.item.pantry .item-main { padding-left: 12px; }
.item.pantry .item-name { white-space: normal; }
.mini-step { flex: none; display: flex; align-items: center; gap: 2px; padding-right: 8px; }
.mini-step button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--brand); font-size: 20px; font-weight: 700; }
.mini-step button:active { filter: brightness(.95); }
.mini-step span { min-width: 42px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mini-step small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }

/* Lista de sugestões com caixa de marcar */
.checks { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 4px; }
.check-row label { flex: 1; min-width: 0; position: relative; }
.check-row input { position: absolute; opacity: 0; }
.check-row label > span, .radios input[type=checkbox] + span {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); cursor: pointer;
}
.check-row label > span { display: block; padding-left: 42px; position: relative; }
.check-row label > span::before, .radios input[type=checkbox] + span::before {
  content: ""; width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--muted);
}
.check-row label > span::before { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.check-row small { display: block; color: var(--muted); font-size: 13px; }
.check-row input:checked + span, .radios input[type=checkbox]:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.check-row input:checked + span::before, .radios input[type=checkbox]:checked + span::before {
  border: 2px solid var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check-row input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.check-row .icon-btn.small { margin-left: 0; color: var(--muted); }

/* ---------- Receitas ---------- */
.textarea.tall { min-height: 140px; }
.recipe-steps { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
