/* Caudal — mobile-first UI. Dark, moderno, tipo app de finanzas. */
:root {
  --bg-0: #0b1020;
  --bg-1: #0f1629;
  --surface: #161f38;
  --surface-2: #1e2a4a;
  --line: #26324f;
  --text: #eaf0ff;
  --muted: #93a1c4;
  --faint: #64729a;

  --brand: #34e2b0;      /* menta: marca / positivo */
  --brand-2: #22d3ee;    /* cyan */
  --pos: #34e2b0;
  --neg: #fb7185;

  --fixed: #8b93ff;      /* violeta */
  --variable: #fbbf24;   /* ámbar */
  --ant: #fb7185;        /* coral */
  --none: #64729a;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 12px 30px -12px rgba(0,0,0,.55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -200px, #17233f 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 480px; margin: 0 auto; padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
a { color: var(--brand-2); text-decoration: none; }
h1, h2, h3 { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- Month bar ---------- */
.monthbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .3rem 0 1rem; }
.monthbar .nav {
  width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  font-size: 1.25rem; color: var(--text); transition: transform .08s, background .15s;
}
.monthbar .nav:active { transform: scale(.94); background: var(--surface-2); }
.monthbar .label { flex: 1; text-align: center; font-size: 1.15rem; font-weight: 700; letter-spacing: .2px; }
.monthbar .label small { display: block; color: var(--faint); font-weight: 500; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }

/* ---------- Hero: RESTO SUELDO ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 1.25rem 1.3rem;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(52,226,176,.18), transparent 55%),
    linear-gradient(160deg, #16244a, #111a33);
  border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 1rem;
}
.hero .k { color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.hero .v { font-size: 2.5rem; font-weight: 800; letter-spacing: -.5px; margin-top: .15rem; line-height: 1.05; }
.hero .v.pos { color: var(--pos); }
.hero .v.neg { color: var(--neg); }
.hero .cur { font-size: 1rem; font-weight: 600; color: var(--muted); margin-right: .15rem; }

.progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,.07); margin-top: 1rem; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.progress.over > span { background: linear-gradient(90deg, #f59e0b, var(--neg)); }
.hero .legend { display: flex; justify-content: space-between; margin-top: .55rem; font-size: .8rem; color: var(--muted); }
.hero .legend b { color: var(--text); font-weight: 700; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.05rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.section-title { display: flex; align-items: center; justify-content: space-between;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: .8rem; font-weight: 700; }

/* ---------- Quick add ---------- */
.amount-wrap { position: relative; margin-bottom: .9rem; }
.amount-wrap .sign { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 1.6rem; font-weight: 700; }
.amount-input {
  width: 100%; font-size: 2.1rem; font-weight: 800; text-align: center; letter-spacing: -.5px;
  background: var(--bg-1); color: var(--text); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: .7rem 1rem; transition: border-color .15s, box-shadow .15s;
}
.amount-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(52,226,176,.12); }
.amount-input::placeholder { color: var(--faint); }

/* Hide the up/down spinners on numeric inputs (Chrome/Safari/Firefox). */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.field { display: flex; gap: .5rem; align-items: center; margin-bottom: .3rem; }
select, .input {
  width: 100%; background: var(--bg-1); color: var(--text); border: 1.5px solid var(--line);
  border-radius: 12px; padding: .6rem .75rem; font-size: .92rem; -webkit-appearance: none; appearance: none;
}
select:focus, .input:focus { outline: none; border-color: var(--brand); }
.input.lg { font-size: 1.15rem; padding: .7rem .85rem; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1.5px solid var(--line); background: var(--bg-1); color: var(--text);
  border-radius: 999px; padding: .5rem .8rem; font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: transform .07s, border-color .15s, background .15s;
}
.chip:active { transform: scale(.95); }
.chip.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 18%, var(--bg-1)); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip .em { font-size: 1rem; }

/* ---------- Category list ---------- */
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-item { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.cat-item:last-child { border-bottom: none; }
.cat-item .ic {
  width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; font-size: 1.2rem;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.cat-item .body { flex: 1; min-width: 0; }
.cat-item .name { font-weight: 600; }
.cat-item .sub { color: var(--faint); font-size: .74rem; margin-top: 1px; }
.cat-item .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.chev { color: var(--faint); font-size: 1.1rem; margin-left: .2rem; }

.totals { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800;
  padding-top: .9rem; margin-top: .5rem; border-top: 1.5px dashed var(--line); }
.totals .amt { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* Segmented breakdown bar */
.segbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-top: 1rem; background: rgba(255,255,255,.05); }
.segbar > span { height: 100%; }
.seg-fixed { background: var(--fixed); }
.seg-variable { background: var(--variable); }
.seg-ant { background: var(--ant); }
.legend-row { display: flex; justify-content: space-between; gap: .4rem; margin-top: .7rem; }
.legend-item { flex: 1; text-align: center; }
.legend-item .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.legend-item .lk { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.legend-item .lv { font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }

/* ---------- Detail (Excel-like) rows ---------- */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-row { display: flex; align-items: center; gap: .7rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.tx-row:last-child { border-bottom: none; }
.tx-main { flex: 1; min-width: 0; }
.tx-desc { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { color: var(--faint); font-size: .74rem; margin-top: 2px; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tx-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.paid-toggle { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-1); color: var(--faint); cursor: pointer; font-size: 1rem; transition: transform .08s; }
.paid-toggle:active { transform: scale(.9); }
.paid-toggle.paid { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #04231b; border-color: transparent; }
.pill { font-size: .64rem; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.warn { background: color-mix(in srgb, var(--neg) 20%, var(--surface-2)); color: #ffd7dd; }

/* Inline edit/delete controls on movement rows */
.icon-btn.sm { width: 32px; height: 32px; flex: 0 0 auto; }
.icon-btn.sm .icon { width: 16px; height: 16px; }
a.chev { text-decoration: none; display: inline-grid; place-items: center; }
.tx-row { display: block; }
.tx-line { display: flex; align-items: center; gap: .6rem; }
.rank-detail-row { display: block; }
.rd-line { display: flex; align-items: center; gap: .5rem; }
.rd-line .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-edit-wrap { margin-top: .7rem; }
.paid-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin: .1rem 0 .55rem; }
.paid-check input { width: auto; }

/* ---------- Buttons / flashes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--bg-1); color: var(--text); border: 1.5px solid var(--line);
  border-radius: 12px; padding: .7rem 1rem; font-size: .95rem; font-weight: 700; cursor: pointer; width: 100%; }
.btn:active { transform: scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #04231b; border-color: transparent; }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, var(--line)); background: color-mix(in srgb, var(--neg) 10%, transparent); }
/* Edit a already-confirmed item: distinct from the green "Guardar" and red danger. */
.btn-edit { color: var(--fixed); border-color: color-mix(in srgb, var(--fixed) 45%, var(--line)); background: color-mix(in srgb, var(--fixed) 12%, transparent); }
.config-link { display: flex; align-items: center; gap: .5rem; justify-content: center;
  color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none;
  padding: .9rem; margin-top: .2rem; }
.config-link .icon { width: 18px; height: 18px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .4rem;
  max-height: 190px; overflow-y: auto; padding: .5rem; background: var(--bg-1);
  border: 1.5px solid var(--line); border-radius: 12px; }
.icon-pick { display: grid; place-items: center; aspect-ratio: 1; background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 10px; color: var(--muted); cursor: pointer; }
.icon-pick.sel { border-color: var(--brand); color: var(--text);
  background: color-mix(in srgb, var(--brand) 20%, var(--surface-2)); }
.icon-pick .icon { width: 20px; height: 20px; }

.flash { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-radius: 14px;
  font-size: .88rem; font-weight: 600; margin-bottom: .9rem;
  background: color-mix(in srgb, var(--brand) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); color: #c9fff0; }
.flash.err { background: color-mix(in srgb, var(--neg) 16%, var(--surface)); border-color: color-mix(in srgb, var(--neg) 35%, var(--line)); color: #ffd7dd; }

.empty { text-align: center; color: var(--faint); padding: 1.6rem 1rem; }
.empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; }

.inline-income { display: inline-flex; align-items: center; gap: .3rem; }
.inline-income.link-more { color: var(--brand); font-weight: 600; text-decoration: none; }
.more-chev { display: inline-flex; align-items: center; }
.more-chev .icon { width: 15px; height: 15px; opacity: .85; }
.inline-income input { width: 7.5rem; background: rgba(255,255,255,.06); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: .28rem .5rem; font-size: .82rem; font-variant-numeric: tabular-nums; }

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  padding: .5rem .5rem calc(.5rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-0) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  /* Force its own GPU layer: stops the iOS flicker where a fixed element with
     backdrop-filter briefly vanishes while a new page paints. */
  transform: translateZ(0); -webkit-transform: translateZ(0); will-change: transform;
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--faint);
  font-size: .66rem; font-weight: 700; padding: .3rem .55rem; border-radius: 12px;
  transition: color .2s ease, transform .12s ease; }
.tabbar a .icon { width: 24px; height: 24px; transition: transform .12s ease; }
.tabbar a.active { color: var(--brand); }
.tabbar a:active { transform: scale(.9); }
/* Central elevated button: "+" (add gasto) on the month, home icon elsewhere. */
.tabbar a.add { margin-top: -1.7rem; width: 56px; height: 56px; border-radius: 50%;
  align-items: center; justify-content: center; padding: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #04231b;
  box-shadow: 0 10px 22px -6px rgba(52,226,176,.5);
  transition: transform .14s ease, box-shadow .2s ease; }
.tabbar a.add:active { transform: scale(.93); }
.tabbar a.add .icon { width: 28px; height: 28px; }

/* ---------- Inline SVG icons ---------- */
.icon { width: 1.2em; height: 1.2em; display: inline-block; vertical-align: -0.18em; flex: 0 0 auto; }
.icon.flip { transform: scaleX(-1); }
.icon-lg { width: 40px; height: 40px; display: inline-block; }
.cat-item .ic .icon { width: 22px; height: 22px; }
.chip .icon { width: 16px; height: 16px; margin-right: 1px; }
.chev .icon { width: 18px; height: 18px; }
.monthbar .nav .icon { width: 22px; height: 22px; }
.paid-toggle .icon { width: 17px; height: 17px; }
.flash .icon { width: 17px; height: 17px; }
.btn .icon { width: 18px; height: 18px; }
.empty .icon-lg { color: var(--faint); opacity: .7; }

/* ---------- Top bar (brand + logout) ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin: .2rem 0 .8rem; }
.wordmark-sm { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; letter-spacing: .2px;
  color: inherit; text-decoration: none; }
.wordmark-sm .icon { color: var(--brand); width: 20px; height: 20px; }
.wordmark-sm img { width: 22px; height: 22px; border-radius: 6px; display: block; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.icon-btn .icon { width: 20px; height: 20px; }

/* ---------- Login ---------- */
.login { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; }
.login .brand { text-align: center; margin-bottom: 1.6rem; }
.login .logo { width: 66px; height: 66px; margin: 0 auto .7rem; display: block;
  border-radius: 18px; box-shadow: 0 14px 30px -8px rgba(52,226,176,.5); }
.login .wordmark { font-size: 1.9rem; font-weight: 800; letter-spacing: -.5px; }
.login .tagline { color: var(--muted); font-size: .88rem; margin-top: .25rem; }
.login .fld { display: flex; align-items: center; gap: .6rem; background: var(--bg-1);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0 .8rem; margin-bottom: .7rem; }
.login .fld:focus-within { border-color: var(--brand); }
.login .fld .ic { color: var(--faint); display: grid; place-items: center; }
.login .fld .ic .icon { width: 18px; height: 18px; }
.login .fld .input { border: none; background: transparent; padding: .8rem 0; }
.login .fld .input:focus { outline: none; }
.login .btn-primary { margin-top: .4rem; }
.login .lockout-note { color: var(--muted); font-size: .92rem; margin: .2rem 0 1rem; }
.oauth-sep { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0 .9rem; color: var(--muted); font-size: .78rem; }
.oauth-sep::before, .oauth-sep::after { content: ""; flex: 1 1 auto; height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  background: #fff; color: #3c4043; border: 1px solid var(--line); font-weight: 600; }
.btn-google:hover { background: #f5f6f7; }
.btn-google .g-logo { width: 18px; height: 18px; flex: none; }

/* ---------- Fixed-expenses checklist ---------- */
[x-cloak] { display: none !important; }
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); text-transform: none; letter-spacing: 0; }
.badge.ok { background: color-mix(in srgb, var(--brand) 20%, var(--surface-2)); color: #c9fff0;
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.badge .icon { width: 13px; height: 13px; }

.fx-list { list-style: none; margin: 0; padding: 0; }
.fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .7rem .6rem; margin: 0 -.6rem;
  border-bottom: 1px solid var(--line); }
.fx-row:last-child { border-bottom: none; }
.fx-row.pending { background: color-mix(in srgb, var(--variable) 8%, transparent); border-radius: 10px; }
.fx-main { flex: 1; min-width: 0; }
.fx-name { font-weight: 600; }
.fx-where { color: var(--faint); font-size: .74rem; margin-top: 1px; }
.pending-tag { color: var(--variable); font-weight: 700; }
.fx-amt { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-weight: 700; }
.amt-input { width: 6.6rem; text-align: right; background: var(--bg-1); border: 1.5px solid var(--line);
  color: var(--text); border-radius: 9px; padding: .4rem .5rem; font-size: .95rem; font-weight: 700; }
.amt-input:focus { outline: none; border-color: var(--brand); }
.fx-summary { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
  padding-top: .9rem; margin-top: .5rem; border-top: 1.5px dashed var(--line); font-weight: 700; }
.fx-summary .ok { color: var(--brand); display: inline-flex; align-items: center; gap: .3rem; }
.fx-summary .ok .icon { width: 16px; height: 16px; }
.fx-summary .neg { color: var(--neg); }

/* Collapsible manual entry */
.collapse-head { display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; color: var(--text); font-size: .95rem; font-weight: 700;
  cursor: pointer; padding: 0; }
.collapse-head > span:first-child { display: inline-flex; align-items: center; gap: .4rem; }
.collapse-head .icon { width: 18px; height: 18px; }
.collapse-head .chev { color: var(--faint); transition: transform .15s; }
.collapse-head .chev.rot { transform: rotate(90deg); }

/* ---------- Savings / patrimonio ---------- */
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.hero .save-legend { margin-top: .3rem; }
.hero .save-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.hero .save-legend .icon { width: 15px; height: 15px; color: var(--brand); }
.hero .save-legend a { color: var(--text); }

.quote-edit { display: flex; align-items: center; gap: .4rem; margin-top: .9rem;
  padding-top: .8rem; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.quote-edit label { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted);
  font-size: .82rem; font-weight: 600; white-space: nowrap; }
.quote-edit label .icon { width: 15px; height: 15px; }
.quote-edit input { flex: 1; max-width: 8rem; background: var(--bg-1); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 10px; padding: .4rem .6rem; font-size: .95rem;
  font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-edit input:focus { outline: none; border-color: var(--brand); }

.asset-list { list-style: none; margin: 0; padding: 0; }
.asset-block { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.asset-block:last-child { border-bottom: none; }
.asset-head { display: flex; align-items: center; gap: .7rem; }
.asset-head .ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--surface-2); color: var(--brand); flex: 0 0 auto; }
.asset-head .ic .icon { width: 20px; height: 20px; }
.asset-main { flex: 1; min-width: 0; }
.asset-main .name { font-weight: 700; }
.asset-main .sub { color: var(--faint); font-size: .74rem; margin-top: 1px; }
.asset-val { text-align: right; font-weight: 700; }
.asset-val .pnl { display: block; font-size: .74rem; font-weight: 700; margin-top: 1px; }
.loc-list { list-style: none; margin: .5rem 0 0; padding: 0 0 0 46px; }
.loc-row { display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .82rem; padding: .18rem 0; }
.loc-row span:first-child { display: inline-flex; align-items: center; gap: .3rem; }
.loc-row .icon { width: 14px; height: 14px; color: var(--faint); }

.save-form .field { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; }
.save-form .field label { color: var(--muted); font-size: .74rem; font-weight: 600; }
.save-form .field input { width: 100%; background: var(--bg-1); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .6rem .75rem; font-size: .92rem; }
.save-form .field input:focus { outline: none; border-color: var(--brand); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .55rem; }
/* Money input (label + boxed $ field) used in the month income sources. */
.money-field { display: flex; flex-direction: column; gap: .25rem; }
.money-field > label { color: var(--muted); font-size: .74rem; font-weight: 600; }
.money-field .money-input { display: flex; align-items: center; gap: .35rem; background: var(--bg-1);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .55rem .7rem; }
.money-field .money-input:focus-within { border-color: var(--brand); }
.money-field .money-input .cur { color: var(--faint); font-size: .9rem; }
.money-field .money-input input { width: 100%; border: none; background: transparent; color: var(--text);
  font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0; min-width: 0; }
.money-field .money-input input:focus { outline: none; }
.money-field .money-input input::placeholder { color: var(--faint); font-weight: 400; font-size: .82rem; }
.save-form .btn-primary { width: 100%; margin-top: .3rem; }
.save-form .hint { font-size: .74rem; margin: .55rem 0 0; }

.mv-list { list-style: none; margin: 0; padding: 0; }
.mv-row { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.mv-row:last-child { border-bottom: none; }
.mv-main { flex: 1; min-width: 0; }
.mv-main .name { font-weight: 600; font-variant-numeric: tabular-nums; }
.mv-main .sub { color: var(--faint); font-size: .74rem; margin-top: 1px; }
.icon-btn.danger { width: 34px; height: 34px; color: var(--neg); }
.icon-btn.danger .icon { width: 17px; height: 17px; }

/* Buy/Sell segmented control */
.seg { display: flex; gap: .3rem; background: var(--bg-1); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 3px; margin-bottom: .7rem; }
.seg button { flex: 1; background: none; border: none; color: var(--muted); font-weight: 700;
  font-size: .88rem; padding: .5rem; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.seg button.active { background: color-mix(in srgb, var(--brand) 22%, var(--surface-2)); color: #c9fff0; }
.seg button.active.sell { background: color-mix(in srgb, var(--neg) 22%, var(--surface-2)); color: #ffd7dd; }

.op { display: inline-block; font-size: .64rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; padding: .1rem .4rem; border-radius: 6px; margin-right: .35rem; vertical-align: 1px; }
.op.buy { background: color-mix(in srgb, var(--brand) 18%, var(--surface-2)); color: #c9fff0; }
.op.sell { background: color-mix(in srgb, var(--neg) 18%, var(--surface-2)); color: #ffd7dd; }

/* ---------- Hormiga panel (fase 3, retrospectivo) ---------- */
.badge.warn { background: color-mix(in srgb, var(--variable) 20%, var(--surface-2)); color: #ffe4a3;
  border-color: color-mix(in srgb, var(--variable) 40%, var(--line)); }
.badge.warn .icon { width: 13px; height: 13px; }

.ant-heads { display: flex; gap: 1.4rem; }
.ant-head .k { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.ant-num { font-size: 1.4rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ant-num.neg { color: var(--neg); }
.ant-compare { display: flex; gap: .55rem; align-items: baseline; font-size: .82rem; margin: .5rem 0 .7rem; }
.ant-compare .delta { font-weight: 700; }
.ant-compare .delta.neg { color: var(--neg); }
.ant-compare .delta.pos { color: var(--pos); }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0;
  background: none; border: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rank-row .ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--surface-2); color: var(--ant); flex: 0 0 auto; }
.rank-row .ic .icon { width: 16px; height: 16px; }
.rank-main { flex: 1; min-width: 0; }
.rank-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .84rem; font-weight: 600; margin-bottom: 3px; }
.rank-head .tnum { color: var(--muted); }
.rank-bar { height: 6px; border-radius: 4px; background: var(--bg-1); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--ant), var(--variable)); }
.rank-row .chev { flex: 0 0 auto; transition: transform .15s; }
.rank-row .chev.rot { transform: rotate(90deg); }

.rank-detail { list-style: none; margin: 0 0 .4rem 44px; padding: 0; border-left: 2px solid var(--line); }
.rank-detail-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
  padding: .3rem 0 .3rem .7rem; font-size: .8rem; }
.rank-detail-row .name { flex: 1; min-width: 0; }
.rank-detail-row .sub { color: var(--faint); font-size: .72rem; white-space: nowrap; }
.rank-detail-row .amt { color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ---------- Import review ---------- */
.review-link { display: flex; align-items: center; gap: .5rem; text-decoration: none;
  background: color-mix(in srgb, var(--variable) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--variable) 34%, var(--line)); color: #ffe4a3; }
.review-link .icon { width: 18px; height: 18px; }
.review-link .icon:last-child { margin-left: auto; }

.rev-list { list-style: none; margin: 0; padding: 0; }
.rev-item { margin-bottom: .8rem; }
/* Confirmed charge: green accent so it clearly reads as done. */
.rev-item.confirmed { border-color: color-mix(in srgb, var(--brand) 32%, var(--line)); }
.rev-top { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .7rem; }
.rev-main { flex: 1; min-width: 0; }
.rev-name { font-weight: 700; }
.rev-meta { color: var(--faint); font-size: .76rem; margin-top: 2px; display: flex; flex-wrap: wrap;
  align-items: center; gap: .35rem; }
.rev-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rev-amt.pos { color: var(--pos); }
.rev-actions { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }
.rev-actions .btn-primary { flex: 1; }

/* ---------- Spotlight tour ---------- */
.topbar-actions { display: flex; align-items: center; gap: .25rem; }
/* Transparent full-screen catcher blocks clicks on the page behind the tour. */
.tour-catch { position: fixed; inset: 0; z-index: 100; background: transparent; display: none; }
/* The "hole": a transparent box over the target; its huge box-shadow dims the
   rest of the screen, and the ring highlights the target. */
.tour-hole { position: fixed; z-index: 101; display: none; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(3, 6, 16, .70), 0 0 0 2px var(--brand);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.tour-tip { position: fixed; z-index: 102; display: none; width: min(320px, calc(100vw - 24px));
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem;
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, .7);
  transition: top .22s ease, left .22s ease; }
.tour-tip-head { display: flex; justify-content: flex-end; margin-bottom: .35rem; }
.tour-tip-prog { color: var(--faint); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.tour-tip-text { color: var(--text); font-size: .93rem; line-height: 1.45; }
.tour-tip-text b { color: var(--brand); }
.tour-tip-actions { display: flex; align-items: center; gap: .5rem; margin-top: .9rem; }
.tour-spacer { flex: 1; }
.tour-skip, .tour-back { background: none; border: none; color: var(--muted); font-weight: 700;
  font-size: .88rem; padding: .45rem .3rem; cursor: pointer; }
.tour-skip:active, .tour-back:active { transform: scale(.95); }
.tour-cta { padding: .55rem 1rem; }
