:root {
  --bg: #F2F2F7; --card: #FFFFFF; --text: #000; --muted: rgba(60, 60, 67, .6); --sep: rgba(60, 60, 67, .16);
  --fill: rgba(118, 118, 128, .12); --brand: #0E9F6E; --brand-deep: #047857; --brand-soft: rgba(14, 159, 110, .12);
  --red: #EF4444; --green: #16A34A; --orange: #F97316; --bar: rgba(249, 249, 249, .86);
  --grad: linear-gradient(135deg, #10B981, #047857); --over: linear-gradient(135deg, #F97316, #DC2626);
  --r: 20px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
.dark {
  --bg: #000; --card: #1C1C1E; --text: #fff; --muted: rgba(235, 235, 245, .6); --sep: rgba(84, 84, 88, .55);
  --fill: rgba(118, 118, 128, .24); --brand: #34D399; --brand-soft: rgba(52, 211, 153, .16); --bar: rgba(22, 22, 24, .86);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .4; cursor: default; }
a { color: var(--brand); text-decoration: none; }
small { font-size: 13px; }
h1, h2, h3, h4 { margin: 0; }
h3 { font-size: 17px; }
.ic { width: 22px; height: 22px; flex: none; }
.ic.big { width: 28px; height: 28px; }
.ic.inline { width: 17px; height: 17px; vertical-align: -3px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 12px; margin: 6px 0 0; }
.b { font-weight: 600; } .bold { font-weight: 600; } .block { display: block; }
.brand { color: var(--brand); } .red { color: var(--red); } .green { color: var(--green); } .orange { color: var(--orange); }
.grow { flex: 1; min-width: 0; } .right { text-align: right; } .center { display: flex; justify-content: center; margin: 8px 0; }
.center-text { text-align: center; } .mt { margin-top: 12px; } .spacer { flex: 1; min-height: 24px; }
.pad-x { display: block; padding: 18px 18px 6px; }

#app { max-width: 560px; margin: 0 auto; }
#main { padding: calc(var(--safe-t) + 8px) 16px calc(110px + var(--safe-b)); }

/* ---------- Encabezados */
.top { padding: 6px 4px 14px; }
.top h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.top-actions { display: flex; justify-content: flex-end; gap: 4px; min-height: 40px; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--brand); }
.icon-btn:active { background: var(--fill); }
.icon-btn.sm { width: 32px; height: 32px; color: var(--muted); }
.link { color: var(--brand); font-size: 16px; }
.link.small { font-size: 13px; display: block; margin: 2px auto 0; }

/* ---------- Tarjetas */
.card { display: block; width: 100%; background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card h3 { margin-bottom: 10px; }
.card.pad-s { padding: 6px 8px; }
.card.block { text-align: left; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-title h3 { margin: 0; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.split h3 { margin: 0; }
.row-card { display: flex; align-items: center; gap: 12px; text-align: left; }
.row-card small { display: block; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 0; text-align: left; }
.row b, .row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { color: var(--muted); margin-top: 1px; }
.row small em { color: var(--brand); font-style: normal; }
.row.link { color: var(--brand); } .row.red { color: var(--red); } .row.dim { opacity: .55; }
.list .row + .row { border-top: .5px solid var(--sep); }
.card.list { padding-top: 6px; padding-bottom: 6px; }
.amt { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amt small { display: block; font-weight: 400; color: var(--muted); }
.big-num { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.big-num small { font-size: 17px; font-weight: 600; }
.badge { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 99px; background: var(--fill); }
.badge.red { background: rgba(239, 68, 68, .12); } .badge.green { background: rgba(22, 163, 74, .12); }
.empty { display: grid; justify-items: center; gap: 4px; padding: 36px 16px; color: var(--muted); text-align: center; }
.empty b { color: var(--text); }
.add-btn { text-align: center; color: var(--brand); font-weight: 600; }
.danger-btn { text-align: center; color: var(--red); display: flex; gap: 8px; justify-content: center; align-items: center; }
.emoji-big { font-size: 44px; }
.pct-big { font-size: 20px; }

/* ---------- Íconos de categoría y logo */
.cat-ic { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--c) 18%, transparent); line-height: 1; }
.logo { display: inline-block; border-radius: 26%; box-shadow: 0 10px 30px rgba(14, 159, 110, .35); }

/* ---------- Tarjeta disponible */
.safe { background: var(--grad); color: #fff; border-radius: 24px; padding: 20px; margin-bottom: 14px; box-shadow: 0 12px 30px rgba(14, 159, 110, .25); }
.safe.over { background: var(--over); box-shadow: 0 12px 30px rgba(220, 38, 38, .25); }
.safe-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; gap: 8px; }
.pill { font-size: 12px; background: rgba(255, 255, 255, .2); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.safe-amount { font-size: 42px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.modes { display: flex; gap: 6px; }
.modes button { font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 99px; background: rgba(255, 255, 255, .16); color: #fff; }
.modes button.on { background: #fff; color: var(--brand-deep); }
.safe-sub { font-size: 14px; font-weight: 500; opacity: .92; margin: 12px 0; }
.safe-foot { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; opacity: .9; margin-top: 6px; }
.safe-cta { background: rgba(255, 255, 255, .2); color: #fff; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 99px; }
.bar { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .5s; }
.bar.light { background: rgba(255, 255, 255, .25); } .bar.light i { background: #fff; }
.bar.thin { height: 5px; flex: 1; margin: 6px 0; }

.quick { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); border-radius: 99px; padding: 8px 8px 8px 16px; margin-bottom: 14px; color: var(--muted); }
.quick span:nth-child(2) { flex: 1; }
.quick-mic { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border-radius: 16px; padding: 12px; min-width: 0; }
.tile-l { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.tile-l .ic { width: 15px; height: 15px; }
.tile b.long { font-size: 13px; letter-spacing: -.02em; }
.tile b { display: block; margin-top: 6px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.install { position: relative; border: 1.5px dashed var(--brand); }
.install .close { position: absolute; right: 10px; top: 10px; color: var(--muted); }
.install p { margin: 6px 0 0; }

/* ---------- Dona y gráficas */
.donut { position: relative; flex: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center small { color: var(--muted); }
.donut-center b { font-size: 20px; }
.donut-row { display: flex; align-items: center; gap: 16px; }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.legend li span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.legend i, .legend-inline i { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.legend-inline { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.legend-inline span { display: flex; align-items: center; gap: 5px; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; }
.chart .grid { stroke: var(--sep); stroke-dasharray: 2 3; }
.chart .ylabel, .chart .xlabel { fill: var(--muted); font-size: 10px; }
.slice { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 0; text-align: left; }
.slice .grow > .split { display: flex; }
.pct { width: 38px; text-align: right; }
.row-s { padding: 6px 0; }

/* ---------- Presupuestos, metas */
.budget { display: block; width: 100%; padding: 8px 0; text-align: left; }
.budget-top { display: flex; align-items: center; gap: 10px; }
.budget-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-top small { white-space: nowrap; color: var(--muted); }
.budget-top small b { color: var(--text); display: inline; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- Controles */
.primary { display: block; width: 100%; background: var(--grad); color: #fff; font-weight: 600; text-align: center; padding: 16px; border-radius: 16px; font-size: 17px; }
.primary.sm, .secondary.sm { padding: 10px; font-size: 15px; border-radius: 12px; }
.secondary { display: block; width: 100%; background: var(--brand-soft); color: var(--brand); font-weight: 600; text-align: center; padding: 16px; border-radius: 16px; }
.mini { background: var(--grad); color: #fff; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 99px; }
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; margin-bottom: 14px; }
.seg button { flex: 1; text-align: center; padding: 7px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-weight: 600; }
.seg.big button { padding: 9px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--card); border-radius: 99px; padding: 8px 14px; font-size: 15px; font-weight: 500; border: 0; }
select.chip { appearance: none; -webkit-appearance: none; padding-right: 14px; }
.chip.on { background: var(--brand); color: #fff; }
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); }
.dark .chip.brand { color: var(--brand); }
.chip.sm { padding: 5px 10px; font-size: 13px; background: var(--fill); }
.chip.freq { display: flex; align-items: center; gap: 8px; text-align: left; }
.chip.freq span { display: grid; } .chip.freq small { color: var(--muted); font-weight: 400; }
.search { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 12px; padding: 9px 12px; margin-bottom: 14px; color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--text); font-size: 17px; min-width: 0; }
.field { display: block; width: 100%; background: var(--card); border: 0; border-radius: 14px; padding: 14px; font-size: 17px; outline: none; margin-bottom: 18px; }
.field-label { display: block; font-weight: 600; margin: 6px 0 8px; }
.amount-field { display: flex; align-items: center; gap: 8px; }
.amount-field span { color: var(--muted); }
.amount-field input { flex: 1; border: 0; outline: none; background: none; font-size: 17px; text-align: right; min-width: 0; }
.inline-amount { display: flex; align-items: center; gap: 6px; }
.inline-amount span { color: var(--muted); }
.inline-amount input { width: 140px; border: 0; outline: none; background: none; text-align: right; font-size: 17px; }
.form { padding: 2px 16px; }
.frow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 6px 0; text-align: left; }
.form .frow + .frow { border-top: .5px solid var(--sep); }
.frow input:not([type=checkbox]), .frow select { flex: 1; border: 0; outline: none; background: none; font-size: 17px; min-width: 0; }
.frow select { appearance: none; -webkit-appearance: none; flex: none; max-width: 55%; text-align: right; color: var(--muted); direction: rtl; }
.frow input.right { text-align: right; }
.frow input[type=date] { text-align: left; min-height: 30px; }
.frow.red { color: var(--red); }
.foot-note { font-size: 13px; color: var(--muted); margin: -6px 16px 18px; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--fill); position: relative; transition: background .2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { font-size: 24px; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; }
.emoji-grid button.on { background: var(--brand-soft); outline: 2px solid var(--brand); }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.color-grid button { aspect-ratio: 1; border-radius: 50%; }
.color-grid button.on { outline: 3px solid var(--text); outline-offset: 2px; }

/* ---------- Periodos y listas */
.pnav { display: flex; align-items: center; justify-content: space-between; text-align: center; }
.day { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 16px 6px; }

/* ---------- Registrar */
.smart-top { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.smart-top .ic { width: 18px; height: 18px; }
#smart { display: block; width: 100%; border: 0; outline: none; background: none; resize: none; font-size: 20px; margin: 10px 0 12px; overflow: hidden; line-height: 1.3; }
.smart-actions { display: flex; align-items: center; gap: 8px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: 99px; cursor: pointer; }
.pill-btn .ic { width: 18px; height: 18px; }
.pill-btn.rec { background: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.clear { color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; }
.understood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.amount-big { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.amount-big span { font-size: 30px; font-weight: 600; color: var(--muted); }
.amount-big input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.amount-big.green input { color: var(--green); }
.rate { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-top: 8px; flex-wrap: wrap; }
.rate input { width: 90px; border: 0; background: var(--fill); border-radius: 8px; padding: 5px 8px; outline: none; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; margin-top: 10px; }
.cat { display: grid; justify-items: center; gap: 6px; text-align: center; }
.cat-dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--c) 16%, transparent); transition: transform .15s; }
.cat-dot.more { background: var(--fill); font-size: 13px; color: var(--muted); }
.cat.on .cat-dot { background: var(--c); transform: scale(1.06); box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 45%, transparent); }
.cat small { font-size: 11px; line-height: 1.2; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 26px; }
.cat.on small { color: var(--text); font-weight: 600; }

/* ---------- Barra de pestañas */
#tabbar[hidden] { display: none; }
#tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(calc(100% - 24px), 520px);
  display: flex; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 30px; padding: 6px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); z-index: 10; }
.tab { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 22px; font-size: 11px; font-weight: 500; color: var(--text); }
.tab .ic { width: 24px; height: 24px; }
.tab.on { color: var(--brand); background: var(--fill); }
.tab.add .add-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.tab.add .ic { width: 18px; height: 18px; stroke-width: 2.6; }

/* ---------- Hojas */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .3); opacity: 0; transition: opacity .28s; }
.sheet { position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 560px; height: calc(100% - var(--safe-t) - 12px);
  background: var(--bg); border-radius: 14px 14px 0 0; display: flex; flex-direction: column;
  transform: translate(-50%, 100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1); }
.sheet-wrap.open .backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translate(-50%, 0); }
.sh-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px 10px; gap: 8px; }
.sh-head > :first-child { justify-self: start; } .sh-head > :last-child { justify-self: end; }
.sh-head h3 { font-size: 17px; text-align: center; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(24px + var(--safe-b)); }
.sh-foot { padding: 10px 16px calc(10px + var(--safe-b)); background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.steps-list p { margin: 8px 0; }

/* ---------- Bienvenida */
.onb { min-height: calc(100dvh - var(--safe-t) - 40px); display: flex; flex-direction: column; padding-bottom: calc(20px + var(--safe-b)); }
.onb h2 { font-size: 26px; margin: 24px 0 16px; letter-spacing: -.01em; }
.steps { display: flex; gap: 6px; padding-top: 8px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--fill); }
.steps i.on { background: var(--brand); }
.onb-hero { text-align: center; margin: 48px 0 24px; }
.onb-hero h1 { font-size: 34px; margin: 22px 0 10px; letter-spacing: -.02em; }
.features { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 18px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features small { display: block; color: var(--muted); font-size: 14px; }
.feat-ic { font-size: 24px; width: 32px; text-align: center; }
.onb .primary { margin-top: 24px; }
.group { background: var(--card); border-radius: var(--r); }
.scroll-list { max-height: 52dvh; overflow-y: auto; padding: 0 14px; }
.scroll-list .row + .row { border-top: .5px solid var(--sep); }
.flag { font-size: 26px; }
.check { color: var(--brand); }

/* ---------- Toast */
#toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 10px); transform: translate(-50%, -150%); z-index: 40; max-width: calc(100% - 32px);
  background: var(--card); color: var(--text); padding: 12px 16px; border-radius: 99px; font-size: 15px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18); display: flex; align-items: center; gap: 10px; transition: transform .35s cubic-bezier(.2, .9, .25, 1.1); }
#toast.show { transform: translate(-50%, 0); }
.toast-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; }
.toast-dot.warn { background: var(--orange); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Ajustes de lectura */
.card .split > div > small, .card .split > div > b { display: block; }
.slice .split b { white-space: nowrap; }
.slice .split b:first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Cuentas (de dónde sale / a dónde entra la plata) */
.acct-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acct { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; background: var(--fill); font-size: 15px; font-weight: 500; border: 1.5px solid transparent; transition: background .15s, border-color .15s; }
.acct span { font-size: 17px; line-height: 1; }
.acct.on { background: color-mix(in srgb, var(--c) 16%, transparent); border-color: var(--c); font-weight: 600; }
.acct.add { color: var(--brand); background: none; border: 1.5px dashed var(--sep); }

/* ---------- Tu dinero (lo que tienes) y, aparte, lo que puedes gastar */
button.safe { display: block; width: 100%; text-align: left; }
.safe-q { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 10px 0 2px; }
.safe .safe-cta { display: inline-block; }
.acct-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.acct-mini span { font-size: 13px; background: rgba(255, 255, 255, .18); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.acct-mini b { font-weight: 700; }
.spend-amount { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.spend .seg { margin-bottom: 10px; }
.spend .bar { margin-top: 12px; }
.money-form .frow { min-height: 56px; }
.money-form .inline-amount input { width: 120px; }
.money-total b:last-child { font-variant-numeric: tabular-nums; }
.onb-note { margin: -2px 0 12px; }
.money-q { font-size: 22px; margin: 4px 4px 8px; letter-spacing: -.01em; }

/* ---------- Pagos de Apple Pay */
.paste-card { color: inherit; }
.paste-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.code-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 12px; margin: 4px 0 8px; border-radius: 12px; background: var(--fill); font: 600 15px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
.code-line i { font-style: normal; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; background: var(--brand); color: #fff; padding: 3px 8px; border-radius: 7px; }
.paste-box { display: block; width: 100%; border: 0; outline: none; background: none; resize: none; font-size: 16px; color: var(--text); }

/* ---------- Resumen y recomendaciones del mes */
.report-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(234, 179, 8, .16); flex: none; }
.rule-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--fill); margin: 16px 0 8px; }
.rule-bar i { display: block; height: 100%; }
.tip { display: flex; gap: 12px; align-items: flex-start; border-left: 4px solid var(--fill); }
.tip.bad { border-left-color: var(--red); } .tip.warn { border-left-color: var(--orange); }
.tip.info { border-left-color: #3B82F6; } .tip.good { border-left-color: var(--green); }
.tip-ic { font-size: 24px; line-height: 1.1; flex: none; }
.tip b { display: block; margin-bottom: 4px; }
.tip p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.tip-act { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; }
.rep-nums b { font-size: clamp(13px, 4.1vw, 17px); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rule-legend { flex-wrap: wrap; gap: 6px 14px; }
.rule-legend span { white-space: nowrap; }

/* ---------- Botón flotante "Pegar pago de Apple Pay" al abrir la app */
#pastePill { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 15; display: flex; align-items: center; gap: 2px;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .3s, opacity .3s;
  background: var(--grad); color: #fff; border-radius: 99px; padding: 4px 4px 4px 6px; box-shadow: 0 10px 30px rgba(14, 159, 110, .45); max-width: calc(100% - 32px); }
#pastePill.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#pastePill .pill-main { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; }
#pastePill .pill-x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); color: #fff; }
#pastePill .pill-x .ic { width: 16px; height: 16px; }
details.manual summary { font-weight: 600; cursor: pointer; }
details.manual .steps-list { margin-top: 10px; }
a.primary { text-decoration: none; }
