/* ========== Tokens ========== */
:root {
  color-scheme: dark;
  /* Dourado neutro (base/realces) + verde escuro (destaques) */
  --bg: #11100d;
  --surface: #1a1814;
  --surface-2: #221f1a;
  --surface-3: #2c2822;
  --line: #332e26;
  --text: #f4efe4;
  --text-2: #b3aa98;
  --text-3: #7d7466;
  --accent: #c8a96b;
  --accent-ink: #f4ead2;
  --accent-soft: rgba(200, 169, 107, .14);
  --brand: #1f4a38;
  --brand-hi: #2f6b52;
  --brand-lo: #10271d;
  --income: #5cc08f;
  --expense: #e2806e;
  --warn: #e0b04c;
  --bar-income: #199e70;
  --bar-expense: #e66767;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-theme="light"] {
  /* Fundo dourado claro com destaques em verde escuro */
  color-scheme: light;
  --bg: #efe3c8;
  --surface: #faf4e6;
  --surface-2: #f3e8d0;
  --surface-3: #e7d7b6;
  --line: #dccaa5;
  --text: #2a2418;
  --text-2: #65583f;
  --text-3: #94846a;
  --accent: #82622a;
  --accent-soft: rgba(130, 98, 42, .13);
  --income: #1f7a52;
  --expense: #b94a38;
  --warn: #a8701b;
  --bar-income: #1f8a5e;
  --bar-expense: #d24a3f;
  --shadow: 0 8px 24px rgba(90, 70, 30, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; margin: 24px 0 8px; }
.pos { color: var(--income); }
.neg { color: var(--expense); }
.warn { color: var(--warn); }

/* ========== Autenticação ========== */
.auth {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(32px + var(--safe-t)) 24px 32px; max-width: 420px; margin: 0 auto; gap: 32px;
}
.brand { text-align: center; display: grid; gap: 8px; justify-items: center; }
.brand h1 { font-size: 26px; letter-spacing: -.02em; }
.logo {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-hi), var(--brand-lo)); color: #d9bd82; box-shadow: var(--shadow); margin-bottom: 8px;
}
.logo svg { width: 30px; height: 30px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.hint { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line); padding: 12px; border-radius: 12px; }
.hint svg { color: var(--accent); margin-top: 1px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ========== Campos e botões ========== */
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s;
}
textarea { resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; padding: 12px 16px; font-weight: 600; transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; }
.btn-lg { padding: 15px 18px; font-size: 16px; }
.btn-primary { background: var(--brand); color: var(--accent-ink); box-shadow: inset 0 0 0 1px rgba(200, 169, 107, .35); }
.btn-ghost { background: var(--surface-2); }
.btn-danger { background: var(--expense); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--expense); border: 1px solid var(--line); }
.btn-link { color: var(--text-2); font-size: 14px; padding: 8px; }
.grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); }
.icon-btn:active { background: var(--surface-2); }
.link { color: var(--accent); font-size: 14px; font-weight: 600; }

/* ========== Estrutura ========== */
.shell { max-width: 560px; margin: 0 auto; }
.view { padding: calc(8px + var(--safe-t)) 16px calc(110px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 4px; min-height: 56px; }
.topbar h1 { font-size: 20px; letter-spacing: -.01em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 2px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 6px 8px calc(6px + var(--safe-b)); max-width: 560px; margin: 0 auto;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 3px; font-size: 11px; color: var(--text-3); padding: 6px 0; }
.tab.active { color: var(--accent); }
.tab svg { width: 22px; height: 22px; }
.fab {
  justify-self: center; width: 56px; height: 56px; border-radius: 18px; margin-top: -22px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand-hi), var(--brand-lo)); color: #d9bd82; box-shadow: 0 8px 22px rgba(16, 39, 29, .55), inset 0 0 0 1px rgba(200, 169, 107, .4);
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.95); }

.month-switch { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.month-name { font-weight: 600; flex: 1; text-align: center; padding: 8px; }

/* ========== Início ========== */
.hero {
  border-radius: 22px; padding: 20px; color: #f4ead2; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, var(--brand-hi) 0%, var(--brand) 45%, var(--brand-lo) 100%);
  border: 1px solid rgba(200, 169, 107, .28);
  box-shadow: var(--shadow);
}
.hero-label { font-size: 13px; color: #d9bd82; letter-spacing: .02em; }
.hero-value { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 16px; }
.hero-value.neg { color: #f2b2a5; }
.hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-split > div { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 10px; }
.hero-split small { display: block; font-size: 12px; opacity: .8; }
.hero-split b { font-size: 15px; }
.pill-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .15); }
.pill-ico.income { color: #9fe0bf; }
.pill-ico.expense { color: #f2b2a5; }
.pill-ico svg { width: 18px; height: 18px; }

.quick {
  display: flex; align-items: center; gap: 6px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 12px;
}
.quick-ico { color: var(--accent); display: grid; }
.quick input { background: transparent; border: 0; padding: 10px 4px; }
.mic-btn {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.mic-btn.big { width: 54px; height: 54px; border-radius: 16px; }
.mic-btn.big svg { width: 24px; height: 24px; }
.mic-btn.listening { background: var(--expense); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(226, 128, 110, .55); } 100% { box-shadow: 0 0 0 16px rgba(226, 128, 110, 0); } }

.section { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-head h2, .panel h2 { font-size: 16px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; font-size: 13px; margin-bottom: 8px; border: 1px solid; }
.alert-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-over { color: var(--expense); background: color-mix(in srgb, var(--expense) 10%, transparent); border-color: color-mix(in srgb, var(--expense) 30%, transparent); }
.alert span { color: var(--text); }

.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini-card {
  scroll-snap-align: start; flex: 0 0 72%; max-width: 260px; text-align: left; color: #fff;
  border-radius: 18px; padding: 14px; display: grid; gap: 2px;
  background: linear-gradient(135deg, var(--card), color-mix(in srgb, var(--card) 55%, #000));
}
.mini-name { font-weight: 700; margin-bottom: 8px; }
.mini-label, .mini-foot { font-size: 12px; opacity: .8; }
.mini-value { font-size: 20px; font-weight: 700; }
.add-tile {
  width: 100%; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 16px;
  border: 1.5px dashed var(--line); border-radius: 16px; color: var(--text-2); margin-top: 12px;
}

/* ========== Listas ========== */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tx { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; }
.tx + .tx { border-top: 1px solid var(--line); }
.tx:active { background: var(--surface-2); }
.tx-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}
.tx-main { flex: 1; min-width: 0; display: grid; }
.tx-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-amt.income { color: var(--income); }
.tx-amt.expense { color: var(--text); }
.badge { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); vertical-align: 1px; }
.chev { color: var(--text-3); }
.day-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 16px 4px 6px; text-transform: uppercase; letter-spacing: .03em; }
.list-total { margin: 4px 4px 0; }
.note { margin: 0 4px 4px; }

.empty { text-align: center; padding: 28px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 8px; justify-items: center; }
.empty-emoji { font-size: 36px; }
.empty h3 { font-size: 16px; }
.empty .btn { margin-top: 8px; }

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; color: var(--text-3); }
.search input { background: transparent; border: 0; padding: 12px 0; }
.chips { display: flex; gap: 8px; margin: 12px 0 8px; overflow-x: auto; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; }
.chip {
  white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { width: 14px; height: 14px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.card-chip i { width: 14px; height: 10px; border-radius: 3px; background: var(--card); display: inline-block; }

/* ========== Cartões ========== */
.card-list { display: grid; gap: 14px; }
.cc {
  position: relative; width: 100%; text-align: left; color: #fff; border-radius: 20px; padding: 18px; display: grid; gap: 12px;
  background: linear-gradient(135deg, var(--card) 0%, color-mix(in srgb, var(--card) 50%, #000) 100%);
  box-shadow: var(--shadow); overflow: hidden;
}
.cc::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.cc.solo { margin-bottom: 14px; }
.cc-top { display: flex; justify-content: space-between; align-items: center; }
.cc-name { font-weight: 700; font-size: 17px; }
.cc-chip { width: 34px; height: 25px; border-radius: 6px; background: linear-gradient(135deg, #f3d98b, #b8913a); }
.cc-mid small { display: block; font-size: 12px; opacity: .8; }
.cc-mid b { font-size: 24px; letter-spacing: -.01em; }
.cc-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.cc-bar i { display: block; height: 100%; background: #fff; border-radius: 6px; }
.cc-foot { display: flex; justify-content: space-between; font-size: 12px; opacity: .85; gap: 8px; }
.cc-last4 { position: absolute; right: 18px; top: 50px; font-size: 12px; opacity: .7; letter-spacing: .08em; }

.invoice { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.invoice-total { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.status-aberta { background: var(--accent-soft); color: var(--accent); }
.status-fechada { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.status-paga { background: color-mix(in srgb, var(--income) 15%, transparent); color: var(--income); }
.status-futura { background: var(--surface-3); color: var(--text-2); }

/* ========== Relatórios ========== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-box { position: relative; }
.donut-box { display: grid; place-items: center; padding: 4px 0 12px; }
.donut { width: 210px; height: 210px; }
.donut .slice { cursor: pointer; }
.donut-label { fill: var(--text-2); font-size: 12px; }
.donut-value { fill: var(--text); font-size: 17px; font-weight: 700; }
.donut-empty { fill: var(--text-3); font-size: 13px; }
.bars { width: 100%; height: auto; display: block; }
.bars .bar-income { fill: var(--bar-income); }
.bars .bar-expense { fill: var(--bar-expense); }
.bars .hit { fill: transparent; }
.bars .axis { fill: var(--text-3); font-size: 11px; }
.bars .baseline { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-sq.income { background: var(--bar-income); }
.lg-sq.expense { background: var(--bar-expense); }
.legend-table { display: grid; }
.lg-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 2px; text-align: left; font-size: 14px; }
.lg-row + .lg-row { border-top: 1px solid var(--line); }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.lg-pct { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.lg-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-table { display: grid; margin-top: 8px; }
.mini-table div { display: flex; justify-content: space-between; padding: 8px 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-table div + div { border-top: 1px solid var(--line); }
.chart-tip {
  position: fixed; z-index: 100; display: none; pointer-events: none; background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow); max-width: 260px;
}
.budget { padding: 8px 0; }
.budget + .budget { border-top: 1px solid var(--line); }
.budget-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.budget .ok { color: var(--text-2); }
.budget .over { color: var(--expense); }
.budget p { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.budget p svg { width: 14px; height: 14px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px; background: var(--income); }
.bar i.warn { background: var(--warn); }
.bar i.over { background: var(--expense); }

/* ========== Ajustes ========== */
.settings { display: grid; gap: 4px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-align: left; width: 100%; }
.set-row > span { flex: 1; display: grid; font-weight: 500; }
.set-row small { color: var(--text-2); font-weight: 400; font-size: 12px; }
.set-row > svg:first-child { color: var(--accent); }
.set-row > svg:last-child { color: var(--text-3); }
.set-row.danger, .set-row.danger > svg:first-child { color: var(--expense); }
.settings .field { margin-bottom: 8px; }

/* ========== Bottom sheet ========== */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + var(--safe-b));
  max-height: 92dvh; overflow-y: auto; transform: translateY(100%); transition: transform .22s ease-out;
  border-top: 1px solid var(--line); overscroll-behavior: contain;
}
.sheet.tall { min-height: 60dvh; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 0 auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 19px; }
.sheet-msg { color: var(--text-2); margin-bottom: 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; position: sticky; bottom: calc(-16px - var(--safe-b)); background: var(--surface); padding: 10px 0 calc(6px + var(--safe-b)); }
.btn-col { display: grid; gap: 10px; }

.form { display: grid; gap: 4px; }
.field { display: grid; gap: 6px; margin-top: 12px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.smart { display: flex; gap: 8px; align-items: stretch; }
.smart textarea { font-size: 16px; }
.smart-hint { margin: 6px 2px 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-top: 12px; }
.seg button { padding: 9px; border-radius: 9px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.seg button.on.expense { color: var(--expense); }
.seg button.on.income { color: var(--income); }
.amount-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.amount-wrap:focus-within { border-color: var(--accent); }
.amount-wrap span { font-weight: 700; color: var(--text-2); }
.amount-wrap input { border: 0; background: transparent; font-size: 26px; font-weight: 700; padding: 10px 0; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-chip { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid transparent; font-size: 11px; text-align: center; }
.cat-chip i { font-style: normal; font-size: 20px; }
.cat-chip span { line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cat-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); font-weight: 600; }
.inst-row { display: flex; gap: 10px; align-items: center; }
.inst-row select { width: 110px; flex: none; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid transparent; outline: 2px solid transparent; }
.swatch.on { border-color: var(--surface); outline-color: var(--text); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji { font-size: 20px; padding: 6px 0; border-radius: 10px; background: var(--surface-2); border: 1.5px solid transparent; }
.emoji.on { border-color: var(--accent); background: var(--accent-soft); }
.group-title { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 14px 4px 8px; }
.examples { display: grid; gap: 8px; margin: 14px 0; }
.example { display: grid; gap: 2px; background: var(--surface-2); padding: 12px; border-radius: 12px; }

/* ========== Toast ========== */
#toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 200; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--line);
  transform: translateY(-20px); opacity: 0; transition: all .25s; font-size: 14px;
}
.toast.show { transform: none; opacity: 1; }
.toast-ok svg { color: var(--income); }
.toast-error svg { color: var(--expense); }
.toast-warn svg { color: var(--warn); }

@media (min-width: 600px) {
  .cat-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Aviso de voz (motivo da falha + alternativa) */
.smart-hint.voice-warn {
  color: var(--text); background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: 10px 12px; border-radius: 12px;
}

/* Faixa atrás da barra de status do iPhone (evita texto por baixo da hora/bateria ao rolar) */
.shell::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-t);
  background: var(--bg); z-index: 30;
}

/* Compras no cartão do mês (tela Início) */
.purchases { padding: 14px 16px 6px; margin-bottom: 0; }
.purchases-total { display: grid; gap: 2px; padding-bottom: 10px; }
.purchases-total b { font-size: 24px; letter-spacing: -.01em; }
.purchase-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); text-align: left; }
.purchase-card > svg { color: var(--text-3); width: 18px; height: 18px; }
.purchase-card b { font-variant-numeric: tabular-nums; }
.block { display: block; font-size: 11px; font-weight: 500; text-align: right; }
.purchase-card .lg-dot { box-shadow: 0 0 0 1.5px var(--text-3); }

/* Composição das despesas no quadro de saldo */
.hero-break { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .18); display: grid; gap: 6px; font-size: 13px; }
.hero-break-title { opacity: .75; font-size: 12px; }
.hero-break div { display: flex; justify-content: space-between; gap: 10px; }
.hero-break span { display: inline-flex; align-items: center; gap: 8px; opacity: .9; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-break b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-break i { width: 14px; height: 10px; border-radius: 3px; background: var(--card); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); flex: none; }

/* Gastos de terceiros */
.badge.owner { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.badge.owner.paid { background: color-mix(in srgb, var(--income) 15%, transparent); color: var(--income); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px;
  background: var(--accent-soft); color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn-sm { padding: 8px; border-radius: 10px; flex: none; }
.btn-sm svg { width: 18px; height: 18px; color: var(--income); }
.person-tip { display: flex; align-items: center; gap: 4px; margin: 10px 4px 0; }
.person-tip svg { width: 14px; height: 14px; }

/* Saldo acumulado (disponível em conta) */
.hero .hero-value { margin-bottom: 2px; }
.hero-sub { font-size: 12px; opacity: .75; margin-bottom: 14px; }
.hero-split em { display: block; font-style: normal; font-size: 11px; opacity: .75; line-height: 1.3; margin-top: 2px; }
.hero-split > div { align-items: flex-start; }
.pill-ico { flex: none; height: 30px; }

/* Recebimentos de terceiros */
.person-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.person-summary div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; }
.person-summary small { color: var(--text-2); font-size: 12px; }
.person-summary b { font-size: 17px; font-variant-numeric: tabular-nums; }
.wrap-actions { flex-wrap: wrap; }
.wrap-actions .btn-primary { flex-basis: 100%; }
.wrap-actions .btn-ghost { flex: 1; }
.person-tip { display: block; }
.person-tip svg { display: inline; vertical-align: -2px; }
