/* Baldes — tema claro, cartões brancos, cantos generosos. */
:root {
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #15171C;
  --muted: #6B7280;
  --faint: #9AA1AC;
  --line: #ECEEF2;
  --fill: #F1F2F5;
  --fill-2: #E6E8EC;
  --pos: #16A34A;
  --danger: #E5484D;
  --danger-soft: #FDECEC;
  --r: 22px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --tabs-h: 58px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; overscroll-behavior: none; }
body {
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  font-size: 16px;
}
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
input, select { -webkit-user-select: text; user-select: text; font-size: 16px; }
h1, h2, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); line-height: 1.45; }
.center { text-align: center; }
.tiny { font-size: 12px; color: var(--faint); word-break: break-word; }
.ic { display: inline-flex; flex: none; }
.neg { color: var(--danger) !important; }
.pos { color: var(--pos); }
.minus { color: var(--text); }
[hidden] { display: none !important; }

/* ---------- estrutura ---------- */
.view {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--st) + 14px) 16px calc(var(--sb) + var(--tabs-h) + 28px);
}
body[data-route="home"] .view { padding-bottom: calc(var(--sb) + var(--tabs-h) + 100px); }

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabs-h) + var(--sb));
  padding-bottom: var(--sb);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  z-index: 6;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 650; color: var(--faint); text-decoration: none;
  transition: color .2s;
}
.tab.on { color: var(--text); }
.tab:active .ic { transform: scale(.9); }

/* ---------- Início ---------- */
.home-head { padding: 6px 4px 18px; }
.eyebrow { font-size: 14px; font-weight: 650; color: var(--muted); }
.total-label { font-size: 15px; color: var(--muted); margin-top: 14px; }
.total { font-size: 42px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.grid .span2 { grid-column: span 2; min-height: 150px; }

.bk {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  width: 100%;
  min-height: 168px;
  padding: 14px 14px 15px;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: transform .15s var(--ease);
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* recorta o líquido nos cantos no Safari */
}
.bk:active { transform: scale(.975); }
.bk.wide { min-height: 150px; }
.bk.hero { min-height: 220px; padding: 18px; }
.bk-top { display: flex; align-items: center; justify-content: space-between; }
.bk-icon {
  width: 38px; height: 38px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--soft); color: var(--ink);
}
.bk-pct {
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: rgba(255, 255, 255, .75); padding: 4px 9px; border-radius: 999px;
}
.bk-name { font-size: 15px; font-weight: 650; color: #3D424B; }
.bk-bal { font-size: 23px; font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.bk-bal.big { font-size: 36px; }
.bk-goal { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; color: var(--ink); margin-top: 4px; }
.bk-extra {
  position: absolute; right: 14px; bottom: 16px;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: rgba(255, 255, 255, .8); padding: 5px 10px; border-radius: 999px;
}
.bk-extra.late { color: var(--danger); }

.liquid { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.liquid-fill {
  position: absolute; inset: 0;
  transform: translateY(96%);
  transition: transform 1.1s var(--ease);
  will-change: transform;
}
.liquid-tilt {
  position: absolute; left: -30%; right: -30%; top: 0; bottom: -80%;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 0;
}
.liquid-slosh { position: absolute; inset: 0; transform-origin: 50% 0; }
.wave { position: absolute; left: 0; top: 0; width: 200%; height: 12px; fill: var(--soft); animation: wave 7s linear infinite; }
.wave.w2 { animation-duration: 11s; animation-direction: reverse; opacity: .7; }
.liquid-body {
  position: absolute; left: 0; right: 0; top: 11px; bottom: 0; overflow: hidden;
  background: linear-gradient(to bottom, var(--soft), var(--soft) 40%, color-mix(in srgb, var(--c) 26%, transparent));
  background-color: var(--soft);
}
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ib {
  position: absolute; top: 30px; width: 6px; height: 6px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85);
  animation: idle-bubble 7s linear infinite;
  opacity: 0;
}
@keyframes idle-bubble {
  0% { transform: translateY(90px) scale(.6); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: translateY(-34px) scale(1); opacity: 0; }
}

/* peixinhos-dólar (o nado é feito por js/fx/fish.js) */
.fish-tank { position: absolute; left: 4px; right: 4px; bottom: 0; z-index: -1; pointer-events: none; transition: top 1.1s var(--ease); }
.fish-swim { position: absolute; left: 0; bottom: 0; will-change: transform; }
.fish-flip { transition: transform .35s var(--ease); }
.fish { display: block; height: auto; animation: fish-bob 2.6s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .12)); }
@keyframes fish-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-3px) rotate(3deg); } }
.fish-tank.dry .fish { animation: fish-flop 1.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes fish-flop { 0%, 100% { transform: rotate(-12deg); } 25% { transform: translateY(-6px) rotate(10deg); } 50% { transform: rotate(-6deg); } }

/* efeitos de água */
.stream {
  position: absolute; top: 0; width: 9px; margin-left: -4.5px; z-index: -1;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--c) 30%, transparent), var(--c));
  transform-origin: 50% 0;
}
.drop { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); z-index: -1; }
.bub { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .95); background: color-mix(in srgb, var(--c) 25%, transparent); z-index: -1; }
.leak { position: absolute; left: -4px; top: -5px; width: 8px; height: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.shine { position: absolute; top: -10%; bottom: -10%; left: 0; width: 34%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); z-index: 1; pointer-events: none; }

.actions {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--sb) + var(--tabs-h) + 12px);
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px;
  z-index: 5;
}
.act {
  height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 17px; font-weight: 750;
  transition: transform .12s var(--ease);
}
.act:active { transform: scale(.96); }
.act-in { background: var(--text); color: #fff; box-shadow: 0 10px 24px rgba(21, 23, 28, .28); }
.act-out { background: #fff; color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--line) inset; }

.give {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px 10px 10px 12px; margin-bottom: 12px;
}
.give-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--ink); flex: none; }
.give-main { flex: 1; display: flex; flex-direction: column; }
.give-main span { font-size: 13px; color: var(--muted); font-weight: 600; }
.give-main strong { font-size: 18px; font-weight: 800; }
.give-btn { background: var(--soft); color: var(--ink); font-weight: 750; font-size: 15px; padding: 9px 16px; border-radius: 12px; }
.give-btn:disabled { background: var(--fill); color: var(--faint); }

.month-nav.compact { padding: 0 0 4px; margin-left: -10px; justify-content: flex-start; gap: 2px; }
.month-nav.compact strong { font-size: 15px; color: var(--muted); min-width: 118px; text-align: center; }
.home-head .total-label { margin-top: 4px; }
.past-banner { display: flex; align-items: center; gap: 10px; background: #EEF2FF; color: #3730A3; border-radius: 16px; padding: 10px 10px 10px 14px; margin-bottom: 12px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.past-banner span { flex: 1; text-align: left; }
.past-banner button { background: #3730A3; color: #fff; font-weight: 700; font-size: 13px; padding: 8px 10px; border-radius: 11px; white-space: nowrap; }
.compare-card { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.cmp-head { display: flex; justify-content: space-between; align-items: baseline; }
.cmp-head span { font-size: 13px; color: var(--muted); font-weight: 600; }
.cmp-row { display: grid; grid-template-columns: 1fr auto 74px; align-items: center; gap: 10px; font-size: 14.5px; }
.cmp-row.total { font-weight: 750; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cmp-name { display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink, var(--text)); min-width: 0; }
.cmp-v { font-weight: 700; }
.delta { justify-self: end; font-size: 12px; font-weight: 750; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.delta.up { background: var(--danger-soft); color: #C42D33; }
.delta.down { background: #E6F6EC; color: #15803D; }
.delta.same, .delta.none { background: var(--fill); color: var(--muted); }

.banner {
  display: flex; align-items: center; gap: 12px;
  background: #FFF7E8; color: #9A5B00;
  border-radius: 18px; padding: 12px 12px 12px 14px; margin-bottom: 12px;
}
.banner-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.banner-text strong { font-size: 15px; }
.banner-btn { background: #9A5B00; color: #fff; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 12px; }

/* ---------- páginas ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 40px; margin: -4px 0 10px -6px; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; font-weight: 650; color: var(--text); padding: 6px 8px 6px 0; }
.page-title { font-size: 32px; font-weight: 800; letter-spacing: -.4px; padding: 8px 4px 2px; }
.page-sub { color: var(--muted); font-weight: 600; padding: 0 4px 16px; }
.sec { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 24px 6px 8px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.empty { text-align: center; color: var(--faint); padding: 28px 0; font-weight: 600; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; padding: 10px 6px 0; }
.version { text-align: center; color: var(--faint); font-size: 13px; padding: 26px 0 6px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.stat strong { font-size: 18px; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.qbtn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px 6px; font-size: 14px; font-weight: 700;
  transition: transform .12s var(--ease);
}
.qbtn:active { transform: scale(.95); }
.qbtn .ic { color: var(--ink, var(--text)); }
.page-bucket .qbtn .ic { color: inherit; }

.sec-row { display: flex; align-items: center; justify-content: space-between; }
.sec-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 750; color: var(--text); text-transform: none; letter-spacing: 0; background: #fff; padding: 6px 10px; border-radius: 10px; box-shadow: var(--shadow); }
.pots-empty { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--muted); font-size: 14px; line-height: 1.4; }
.livre-row .t { color: var(--muted); }
.pots-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 6px 0; font-size: 13px; color: var(--muted); }
.pot-chips { margin-top: -4px; }
.pot-chip small { font-size: 12px; font-weight: 600; opacity: .7; }
.pot-chip.on { background: var(--pc, var(--c)); color: #fff; }
.pot-chip .ic { color: var(--pc); }
.pot-chip.on .ic { color: #fff; }
.pot-chip:disabled { opacity: .35; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: 14px; padding: 4px; gap: 4px; }
.seg-btn { text-align: center; height: 40px; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--muted); transition: background .2s, color .2s; }
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.pct-box { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 18px 0 4px; }
.pct-box .amount { min-width: 120px; }
.round.big { width: 54px; height: 54px; background: var(--fill); box-shadow: none; }
.fix-box { display: flex; flex-direction: column; gap: 10px; }
.small { font-size: 13px; }

/* potinhos: camadas dentro do balde, ícones e cores */
.strata {
  position: absolute; left: 0; right: 0; bottom: 0; height: 100%; z-index: -1;
  display: flex; flex-direction: column-reverse;
  transform-origin: 50% 100%; transition: transform 1.1s var(--ease);
  pointer-events: none;
}
.strata i { display: block; flex-basis: 0; background: color-mix(in srgb, var(--pc) 55%, transparent); border-top: 1.5px solid rgba(255, 255, 255, .7); }
.strata i.livre { background: transparent; border-top: 0; }
.pot-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.leg { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, #fff); padding: 5px 10px; border-radius: 999px; }
.leg.livre { color: var(--muted); background: var(--fill); }
.ic.initial { width: 1.2em; height: 1.2em; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.pot-badge { width: 38px; height: 38px; flex: none; border-radius: 13px; display: grid; place-items: center; color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, #fff); }
.pot-badge.livre { color: var(--faint); background: var(--fill); }
.pot-row { align-items: flex-start; }
.pot-row .pot-badge { margin-top: 2px; }
.pot-v { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pot-v small { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.spent-line { margin-top: 3px; }
.spent-line .delta { justify-self: auto; }
.pot-look { display: flex; align-items: center; gap: 14px; }
.pot-icon-btn { width: 64px; height: 64px; flex: none; border-radius: 20px; display: grid; place-items: center; color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 35%, transparent); }
.pot-icon-btn .ic.initial { font-size: 26px; }
.look-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.look-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--pc); transition: transform .12s; }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pc); }
.icon-picker { display: flex; flex-direction: column; gap: 8px; }
.icon-group { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: 16px; background: var(--fill); color: #3D424B; }
.icon-cell small { font-size: 11px; font-weight: 650; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-cell.on, .icon-cell:active { background: color-mix(in srgb, var(--pc) 16%, #fff); color: var(--pc); }
.topbar .month-nav.compact { margin: 0; padding: 0; }
.topbar .month-nav.compact strong { min-width: 112px; }

.tip { display: flex; gap: 10px; align-items: flex-start; background: #EAF8EF; color: #136C36; border-radius: 16px; padding: 12px 14px; margin-top: 12px; font-size: 14px; line-height: 1.4; }
.tip .ic { margin-top: 2px; }

.goal-card { margin-top: 12px; }
.goal-top, .cover-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; }
.goal-top span { display: flex; align-items: center; gap: 4px; }
.goal-sub { font-size: 13px; color: var(--muted); margin-top: 8px; }

.bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar.lg { height: 12px; border-radius: 6px; }
.bar.thin { height: 6px; }
.bar > i { display: block; height: 100%; background: var(--c, var(--text)); transform-origin: left center; transition: transform .8s var(--ease); border-radius: inherit; }
.bar.out > i { background: var(--soft); box-shadow: inset 0 0 0 1px var(--c); }

.link-card { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; text-align: left; }
.link-card .main { flex: 1; min-width: 0; }

/* listas */
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list.flat { box-shadow: none; background: var(--fill); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 11px 14px; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
button.row:active, .row .main:active { background: #FAFAFB; }
.dot { width: 38px; height: 38px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--soft); color: var(--ink); }
.dot.neutral { background: var(--fill); color: #3D424B; }
.main { flex: 1; min-width: 0; text-align: left; }
.t { font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s { font-size: 13px; color: var(--muted); margin-top: 1px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v { font-weight: 750; white-space: nowrap; }
.v.neutral { color: var(--muted); }
.danger-row .t, .danger-row .dot { color: var(--danger); }

.switch { width: 52px; height: 32px; border-radius: 16px; background: var(--fill-2); position: relative; flex: none; transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .25s var(--ease); }
.switch.on { background: #34C759; }
.switch.on i { transform: translateX(20px); }

/* histórico */
.month-nav { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; }
.month-nav strong { font-size: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: var(--text); }
.icon-btn:active { background: var(--fill); }
.icon-btn:disabled { opacity: .25; }
.month-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.month-sum div { display: flex; flex-direction: column; gap: 2px; }
.month-sum span { color: var(--muted); font-size: 13px; font-weight: 600; }
.month-sum strong { font-size: 22px; font-weight: 800; }
.hbars { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.hb-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 6px; }
.hb-name { display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink); }
.hb-vals { font-size: 13px; font-weight: 650; white-space: pre; }
.hb-bars { display: flex; flex-direction: column; gap: 4px; }

/* contas fixas */
.cover.ok .cover-top strong { color: var(--pos); }
.cover.short .cover-top strong { color: #E06A12; }
.cover { margin-bottom: 12px; }
.bill-row { padding-left: 8px; }
.bill-row .main { padding: 4px 0; }
.check { width: 44px; height: 44px; flex: none; display: grid; place-items: center; color: #C3C8D0; border-radius: 50%; }
.check.on { color: var(--c); }
.bill-row.paid .t { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.badge { font-size: 11.5px; font-weight: 750; padding: 2px 8px; border-radius: 999px; }
.badge.late { background: var(--danger-soft); color: #D3373C; }
.badge.soon { background: #FFF1DF; color: #B95E00; }
.badge.paid { background: #E6F6EC; color: #15803D; }
.badge.part { background: #E8F0FE; color: #1D4ED8; }
.add-btn { margin-top: 12px; }

/* ---------- folhas ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 20; }
.backdrop { position: absolute; inset: 0; background: rgba(14, 17, 24, .38); opacity: 0; transition: opacity .32s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - var(--st) - 10px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding-bottom: var(--sb);
  transform: translateY(105%);
  transition: transform .4s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .12);
}
.sheet.tall { height: calc(100% - var(--st) - 10px); }
.sheet.dragging { transition: none; }
.sheet-root.open .backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: translateY(0); }
.sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 16px 12px 6px 20px; touch-action: none; flex: none; }
.grab { position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #D9DDE3; }
.sheet-title { flex: 1; font-size: 20px; font-weight: 800; }
.sheet-head .icon-btn { background: var(--fill); width: 34px; height: 34px; border-radius: 50%; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px 14px; display: flex; flex-direction: column; }

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

.amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-size: 46px; font-weight: 800; letter-spacing: -.8px; padding: 2px 0; transition: color .15s; }
.amount .cur { font-size: 22px; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.amount.zero { color: #C5CAD2; }
.amount.long { font-size: 36px; }

.tithe-hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: -8px; font-size: 13px; color: var(--faint); font-weight: 600; }

.split-preview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sp { background: var(--soft); border-radius: 14px; padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.sp-name { font-size: 11px; font-weight: 700; color: var(--ink); }
.sp-v { font-size: 13px; font-weight: 750; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.meta-row { display: flex; gap: 8px; }
.field {
  flex: 1; min-width: 0; height: 46px;
  border: 0; outline: none;
  background: var(--fill); border-radius: 14px;
  padding: 0 14px;
  font-size: 16px; font-weight: 600;
  -webkit-appearance: none; appearance: none;
}
.form > .field { flex: none; }
.field:focus { box-shadow: 0 0 0 2px var(--text) inset; background: #fff; }
.field::placeholder { color: var(--faint); font-weight: 500; }
.day-select { flex: 0 0 140px; }
.date-pill { position: relative; flex: 0 0 auto; height: 46px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; background: var(--fill); border-radius: 14px; color: #3D424B; }
.date-input { border: 0; background: transparent; outline: none; font-size: 15px; font-weight: 650; width: 128px; min-height: 30px; -webkit-appearance: none; appearance: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 13px; border-radius: 17px; background: var(--fill); font-size: 14px; font-weight: 650; color: #3D424B; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip:active { background: var(--fill-2); }

.bucket-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bp { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; border-radius: 15px; background: var(--fill); color: var(--ink); font-size: 11.5px; font-weight: 700; transition: background .2s, color .2s, transform .12s; }
.bp:active { transform: scale(.94); }
.bp.on { background: var(--c); color: #fff; }
.bp:disabled { opacity: .3; }
.pick-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: -6px; padding-left: 4px; }

.after { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; background: var(--fill); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--muted); font-weight: 600; margin-top: -4px; }
.after strong { color: var(--text); font-size: 16px; }
.after.warn { background: var(--danger-soft); color: #B4282D; }
.warn-line { flex-basis: 100%; display: flex; align-items: center; gap: 5px; font-size: 13px; color: #C42D33; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { height: 54px; border-radius: 16px; background: var(--fill); font-size: 25px; font-weight: 650; display: grid; place-items: center; transition: transform .08s, background .12s; }
.key:active { transform: scale(.93); background: var(--fill-2); }
.key-back { color: #3D424B; }

.btn { height: 54px; width: 100%; border-radius: 17px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 750; transition: transform .12s var(--ease), opacity .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--text); color: #fff; }
.btn.primary:disabled, .btn.primary.blocked { opacity: .3; }
.btn.ghost { background: var(--fill); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger-solid { background: var(--danger); color: #fff; }
.btn.danger-solid:disabled { opacity: .3; }

.summary { display: flex; flex-direction: column; gap: 14px; }
.sum-total { font-size: 38px; font-weight: 800; text-align: center; }
.sum-desc { text-align: center; color: var(--muted); margin-top: -10px; font-weight: 600; }
.sum-rows { display: flex; flex-direction: column; gap: 12px; }
.sum-row { display: flex; align-items: center; gap: 12px; }
.sum-ic { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--ink); flex: none; }
.sum-main { flex: 1; }
.sum-top { display: flex; justify-content: space-between; font-size: 15px; font-weight: 650; margin-bottom: 5px; }

.pct-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pct-row + .pct-row { border-top: 1px solid #E4E6EA; }
.pct-name { flex: 1; font-weight: 650; }
.pct-v { width: 52px; text-align: center; font-size: 18px; }
.round { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.round:active { transform: scale(.9); }
.pct-sum { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 700; font-size: 17px; padding: 6px; border-radius: 14px; background: #E6F6EC; color: #15803D; }
.pct-sum.bad { background: var(--danger-soft); color: #C42D33; }
.pct-sum small { font-size: 13px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare div { background: var(--fill); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.compare span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.compare small { color: var(--muted); }
.errors { margin: 0; padding-left: 20px; color: #B4282D; font-size: 14px; line-height: 1.5; }

/* ---------- avisos ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; top: calc(var(--st) + 8px);
  z-index: 60;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 10px 10px 16px;
  background: rgba(21, 23, 28, .94); color: #fff;
  border-radius: 18px; box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
  font-weight: 600; font-size: 15px;
  opacity: 0; transform: translateY(-16px) scale(.96);
  transition: opacity .25s, transform .35s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast-text { flex: 1; }
.toast-btn { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 750; padding: 8px 12px; border-radius: 12px; }

.update-pill {
  position: fixed; left: 50%; bottom: calc(var(--sb) + var(--tabs-h) + 80px); z-index: 30;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: #2563EB; color: #fff; font-weight: 700; font-size: 15px;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 10px 28px rgba(37, 99, 235, .35);
}

.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.coin {
  position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--c) 19% 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 4px 10px rgba(0, 0, 0, .18);
}
.confetti { position: absolute; left: 0; top: 0; width: 8px; height: 12px; border-radius: 2px; }
.skip-layer { position: fixed; inset: 0; z-index: 45; }

/* ---------- telas de proteção ---------- */
.gate { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; transition: opacity .3s; }
.gate.leaving { opacity: 0; }
.gate-inner { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: calc(var(--st) + 28px) 24px calc(var(--sb) + 28px); max-width: 480px; margin: 0 auto; }
.gate h1 { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
.gate-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }
.steps li { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); line-height: 1.4; }
.steps li .ic { vertical-align: -3px; color: #2563EB; display: inline-flex; }
.step-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 14px; }
.gate-alert { width: 72px; height: 72px; border-radius: 24px; background: #FFF1DF; color: #B95E00; display: grid; place-items: center; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 8px; }

.onboarding .gate-inner { justify-content: flex-end; gap: 18px; }
.ob-track { width: calc(100% + 48px); margin: 0 -24px; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; flex: 1; }
.ob-track::-webkit-scrollbar { display: none; }
.ob-card { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 28px; }
.ob-card h1 { font-size: 30px; }
.ob-card p { font-size: 17px; }
.ob-art { min-height: 190px; display: flex; align-items: center; justify-content: center; }
.ob-badge { width: 120px; height: 120px; border-radius: 40px; background: var(--soft); color: var(--ink); display: grid; place-items: center; }
.ob-buckets { flex-direction: column; gap: 8px; }
.ob-chip { display: flex; align-items: center; gap: 8px; background: var(--soft); color: var(--ink); font-weight: 750; padding: 8px 14px; border-radius: 999px; }
.ob-bucket { width: 190px; height: 190px; overflow: visible; }
.ob-water { animation: ob-fill 4.5s cubic-bezier(.3,.6,.3,1) infinite; }
.ob-wave { animation: ob-wave 2.2s linear infinite; }
.ob-drop { animation: ob-drop 2.1s cubic-bezier(.5,0,.9,.5) infinite; opacity: 0; }
.ob-handle { transform-origin: 256px 184px; animation: ob-swing 4.5s ease-in-out infinite; }
@keyframes ob-fill { 0% { transform: translateY(200px); } 70%, 88% { transform: translateY(0); } 100% { transform: translateY(200px); } }
@keyframes ob-wave { to { transform: translateX(-200px); } }
@keyframes ob-drop { 0% { translate: 0 -20px; opacity: 0; } 10% { opacity: 1; } 55% { translate: 0 290px; opacity: 1; } 60%, 100% { translate: 0 300px; opacity: 0; } }
@keyframes ob-swing { 0%, 60% { transform: rotate(0); } 66% { transform: rotate(-9deg); } 74% { transform: rotate(6deg); } 82% { transform: rotate(-3deg); } 90%, 100% { transform: rotate(0); } }
.ob-dots { display: flex; gap: 8px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 4px; background: #D0D4DA; transition: width .3s var(--ease), background .3s; }
.ob-dots i.on { width: 22px; background: var(--text); }

/* Transição entre telas */
::view-transition-old(root) { animation: vt-out .18s ease-in both; }
::view-transition-new(root) { animation: vt-in .26s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .wave, .ib, .ob-water, .ob-wave, .ob-drop, .ob-handle, .fish { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Telas largas (preview no PC): centraliza numa coluna de celular. */
@media (min-width: 560px) {
  .view { padding-left: calc(50% - 214px); padding-right: calc(50% - 214px); }
  .actions { left: calc(50% - 214px); right: calc(50% - 214px); }
  .sheet { left: calc(50% - 240px); right: calc(50% - 240px); }
}
