:root {
  --bg: #f4f6f7; --card: #ffffff; --ink: #14201f; --muted: #66767a; --line: #e3e8ea;
  --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #d9f0ec;
  --neg: #b42318; --pos: #067647; --warn: #fff3cd; --warn-ink: #6b4e00;
  --p0: #0f766e; --p1: #7c5cc4;
  /* gráficos (paleta validada contra la superficie #ffffff: CVD, contraste y luminosidad) */
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #e87ba4; --viz-grid: #e1e0d9; --viz-axis: #c3c2b7; --viz-deemph: #898781;
  /* escala secuencial de un tono (matriz de calor): claro = poco, oscuro = mucho */
  --heat-0: #cde2fb; --heat-1: #9ec5f4; --heat-2: #6da7ec; --heat-3: #3987e5; --heat-4: #256abf; --heat-5: #104281;
  --heat-ink-0: #0b0b0b; --heat-ink-1: #0b0b0b; --heat-ink-2: #0b0b0b; --heat-ink-3: #0b0b0b; --heat-ink-4: #ffffff; --heat-ink-5: #ffffff;
  --radius: 14px; --tab-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1415; --card: #162022; --ink: #e8f0ef; --muted: #8fa3a6; --line: #263234;
    --brand: #2dd4bf; --brand-ink: #062a27; --brand-soft: #123b37;
    --neg: #ff8a80; --pos: #5fd69a; --warn: #3a3010; --warn-ink: #f6dc8a; --p0: #2dd4bf; --p1: #b39ddb;
    /* oscuro: los mismos tonos con pasos elegidos para la superficie #162022 (validados) */
    --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #d55181; --viz-grid: #2c2c2a; --viz-axis: #383835; --viz-deemph: #898781;
    /* en oscuro el ancla se invierte: poco = cerca del fondo, mucho = más claro */
    --heat-0: #0d366b; --heat-1: #184f95; --heat-2: #256abf; --heat-3: #3987e5; --heat-4: #6da7ec; --heat-5: #9ec5f4;
    --heat-ink-0: #ffffff; --heat-ink-1: #ffffff; --heat-ink-2: #ffffff; --heat-ink-3: #0b0b0b; --heat-ink-4: #0b0b0b; --heat-ink-5: #0b0b0b;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* el atributo hidden debe ganarle a reglas como .field { display: block } */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
}
body.noscroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h2 { font-size: 20px; margin: 4px 0 8px; }
h3 { font-size: 16px; margin-bottom: 8px; }
h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; }
.offline-pill { display: none; font-size: 12px; background: var(--warn); color: var(--warn-ink); padding: 2px 10px; border-radius: 99px; }
body.offline .offline-pill { display: inline-block; }

main { max-width: 720px; margin: 0 auto; padding: 12px 16px 128px; }   /* abajo: que el botón ＋ no tape lo último */
.page > * + * { margin-top: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: block; width: 100%; text-align: left; }
.card.hero { background: linear-gradient(160deg, var(--brand-soft), var(--card)); }
.card.settle { cursor: pointer; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card-head h3, .card-head h2 { margin: 0; }
.label { font-size: 13px; color: var(--muted); }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.big.ok { color: var(--pos); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.warn { background: var(--warn); color: var(--warn-ink); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-top: 10px; }
.neg { color: var(--neg); } .pos .amt { color: var(--pos); }
.dim { opacity: .55; }

.breakdown, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.breakdown > div, .kpis > div { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.breakdown span, .kpis span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }

.monthnav { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 0; }
.monthnav strong { min-width: 150px; text-align: center; }

/* Filas / listas */
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; text-align: left;
  padding: 10px 2px; border-top: 1px solid var(--line); cursor: pointer; min-height: 52px;
}
.row:first-of-type, h3 + .row, .card-head + .row { border-top: 0; }
.row.static { cursor: default; }
.row.link { color: inherit; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.row .amt .sub { font-weight: 400; }
.row .icon { font-size: 22px; width: 32px; text-align: center; }
.row .chev { color: var(--muted); font-size: 22px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dayhead { font-size: 12px; text-transform: capitalize; color: var(--muted); padding: 14px 2px 2px; font-weight: 600; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px 4px; }
.list .dayhead:first-child { padding-top: 10px; }
.list .row { border-top: 0; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.tx.transfer .title { color: var(--muted); }

.toolbar { display: grid; gap: 8px; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 8px 14px; min-height: 40px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.chip.more { border-style: dashed; color: var(--muted); }

/* Controles */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 600; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn.big { min-height: 52px; font-size: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn.ghost { background: none; border-color: transparent; }
.btn.danger.ghost { color: var(--neg); }
.btn:disabled { opacity: .5; }
.btn.link, button.link { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; }
.icon-btn { background: none; border: 0; font-size: 22px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions.col { flex-direction: column; }
.spacer { flex: 1; }
.link-btn { background: none; border: 0; color: var(--brand); }

input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 12px; min-height: 46px; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }
/* la regla general quita la apariencia nativa; el checkbox la necesita para mostrar la marca */
input[type=checkbox] { appearance: auto; -webkit-appearance: checkbox; width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
.signed { display: flex; gap: 8px; }
.signed input { flex: 1; }
.btn.sign { min-width: 52px; font-size: 20px; padding: 0 12px; }
select:disabled { opacity: .65; }
.field { display: block; margin-bottom: 12px; }
.field > span:first-child { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.field.check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field.check span { margin: 0; color: var(--ink); font-size: 15px; }
.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field.inline > span:first-child { margin: 0; white-space: nowrap; }
.field.inline input { max-width: 150px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.seg button { flex: 1; white-space: nowrap; border: 0; background: none; padding: 10px 6px; min-height: 42px; cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.seg.small button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.backlink { display: inline-block; padding: 4px 0 8px; font-weight: 600; }

/* Captura */
.amount-row { display: flex; gap: 10px; margin: 12px 0 6px; }
.amount { font-size: 34px !important; font-weight: 700; min-height: 64px !important; text-align: right; font-variant-numeric: tabular-nums; }
.amount.expr { font-size: 24px !important; }   /* una operación larga cabe */
.cur { width: 96px !important; flex: none; }
.fxline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; min-height: 0; }
.txform > * + * { margin-top: 12px; }
.txform .field { margin-bottom: 0; }

/* Modales */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; max-height: calc(100% - 24px); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 16px; }
.sheet-body { overflow-y: auto; overflow-x: hidden; padding: 8px 16px 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }   /* solo vertical: nada la mueve de lado */
.sheet footer { display: flex; gap: 8px; align-items: center; padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
/* con el teclado abierto: botones más bajos y sin el margen inferior de la pantalla (lo tapa el teclado) */
.backdrop.kb .sheet footer { padding: 6px 12px; }
.backdrop.kb .sheet footer .btn { min-height: 38px; padding: 6px 14px; }
.backdrop.kb .sheet header { padding-top: 6px; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 20px; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70; background: #1d2b2a; color: #fff; padding: 12px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; transition: .2s; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast .link { color: #5eead4; }

/* Navegación */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); height: calc(var(--tab-h) + var(--safe-b)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); font-size: 11px; }
.tabbar a i { font-style: normal; font-size: 20px; filter: grayscale(1); opacity: .8; }
.tabbar a.on { color: var(--brand); font-weight: 700; }
.tabbar a.on i { filter: none; opacity: 1; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 31; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 30px; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); cursor: pointer; }
.fab[hidden] { display: none; }
.banner { display: flex; align-items: center; gap: 10px; background: var(--warn); color: var(--warn-ink); border-radius: 12px; padding: 8px 10px 8px 14px; margin-bottom: 12px; font-size: 14px; }
.banner span { flex: 1; } .banner a { font-weight: 700; color: inherit; text-decoration: underline; }

/* Gráficos y tablas */
.bars { display: grid; gap: 8px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 46%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--brand); height: 100%; border-radius: 6px; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl .r { text-align: right; } .tbl tr.tot td { font-weight: 700; border-bottom: 0; }
.pctbar { display: flex; gap: 3px; margin: 6px 0; }
.pct { color: #fff; text-align: center; padding: 8px 4px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.pct.p0 { background: var(--p0); color: var(--brand-ink); border-radius: 10px 0 0 10px; } .pct.p1 { background: var(--p1); color: #fff; border-radius: 0 10px 10px 0; }
.cat-detail { border-top: 1px solid var(--line); }
.cat-detail summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 2px; cursor: pointer; list-style: none; }
.cat-detail summary::-webkit-details-marker { display: none; }
.cd-vals { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.cd-vals small { color: var(--muted); font-size: 12px; font-weight: 400; }
.cat-detail .inner { padding: 0 0 6px 8px; }
.cat-group { margin-bottom: 12px; }
.cat-group h4 { margin: 8px 0; }
.pre { white-space: pre-wrap; font: 13px/1.4 ui-monospace, monospace; background: var(--bg); padding: 10px; border-radius: 10px; }

.welcome { text-align: center; padding: 56px 8px 24px; }
.welcome h1 { font-size: 40px; color: var(--brand); margin-bottom: 8px; }
.welcome p { color: var(--muted); }

/* ---- Gráficos ---------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 18px; font-weight: 700; }                 /* cifras proporcionales, no tabulares */
.tile-delta { font-size: 12px; color: var(--muted); }
.tile-delta.up-bad, .tile-delta.down-bad { color: var(--neg); }
.tile-delta.up-good, .tile-delta.down-good { color: var(--pos); }
.tile-delta.up-bad::before, .tile-delta.up-good::before { content: '▲ '; }   /* la dirección nunca solo por color */
.tile-delta.down-bad::before, .tile-delta.down-good::before { content: '▼ '; }

.viz .card-head { align-items: flex-start; }
.viz-plot { position: relative; width: 100%; margin-top: 6px; }
.viz-svg { display: block; overflow: visible; font-family: inherit; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.viz-svg:focus { outline: none; }
.viz-svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-base { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-year { font-size: 10px; }
.viz-bar { fill: var(--viz-1); transition: opacity .12s; }
.viz-bar.partial { opacity: .55; }                                  /* mes en curso */
.viz-bar.dim { opacity: .35; }
.viz-ref { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz-ref-label, .viz-value { font-size: 11px; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.viz-ref-label { fill: var(--muted); }
.viz-value { fill: var(--ink); font-weight: 600; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { opacity: .10; }
.viz-dot { stroke: var(--card); stroke-width: 2; }                   /* anillo del color de fondo */
.viz-crossline { stroke: var(--viz-axis); stroke-width: 1; }
.viz-tip { position: absolute; top: -4px; z-index: 5; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .14); font-size: 12px; min-width: 110px; max-width: 250px; }
.viz-tip-title { color: var(--muted); margin-bottom: 2px; }
.viz-tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.viz-tip-row b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--muted); }
.viz-key-line { display: inline-block; width: 12px; height: 2px; border-radius: 1px; flex: none; }
.viz-key-rect { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.viz-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.viz-foot { margin: 8px 0 0; }
.viz-spark { flex: none; }
.viz-spark-line { fill: none; stroke: var(--viz-deemph); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-spark-dot { fill: var(--viz-1); }
.viz-table-wrap { overflow-x: auto; margin-top: 6px; }
.viz-table th, .viz-table td { white-space: nowrap; }

/* matriz de calor: 2px de separación del color de fondo entre celdas */
.heat-wrap { overflow-x: auto; margin-top: 6px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }
.heat th, .heat td { padding: 7px 5px; text-align: right; white-space: nowrap; border-radius: 4px; min-width: 46px; }
.heat thead th { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.heat thead th small { display: block; font-size: 10px; font-weight: 400; }
/* columna fija: el anillo del color de fondo tapa la separación de 2px para que no asomen las celdas que pasan debajo */
.heat .heat-name { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; min-width: 100px; max-width: 128px; font-weight: 600; border-radius: 0; box-shadow: 0 0 0 2px var(--card), 6px 0 6px -4px rgba(0, 0, 0, .22); }
.heat-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.heat-label { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.heat td.h0 { background: var(--heat-0); color: var(--heat-ink-0); }
.heat td.h1 { background: var(--heat-1); color: var(--heat-ink-1); }
.heat td.h2 { background: var(--heat-2); color: var(--heat-ink-2); }
.heat td.h3 { background: var(--heat-3); color: var(--heat-ink-3); }
.heat td.h4 { background: var(--heat-4); color: var(--heat-ink-4); }
.heat td.h5 { background: var(--heat-5); color: var(--heat-ink-5); }
.heat td.h-none { color: var(--muted); }
.heat .heat-total { font-weight: 700; }
.heat-row { cursor: pointer; }
.heat-row:hover .heat-label, .heat-row:focus .heat-label { text-decoration: underline; }
.heat-row:focus { outline: 2px solid var(--brand); outline-offset: -2px; }
.heat tfoot th, .heat tfoot td { font-weight: 700; }
.bar-row.tappable { width: 100%; background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }

/* ---- Captura: descripción primero ------------------------------------------- */
.form-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.form-top .kind-pill { flex: 0 1 auto; min-width: 0; }   /* con letra de 16 px (iPhone) el tipo se achica antes de desbordar */
.form-top .chip { flex: none; }
.kind-pill { width: auto; min-height: 34px; padding: 4px 30px 4px 12px; font-size: 14px; font-weight: 600; border-radius: 99px; }
.desc-wrap { position: relative; }
.desc-input { font-size: 17px !important; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, .16); overflow: hidden; }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; min-height: 52px; }
.suggest-item:first-child { border-top: 0; }
.suggest-item.active, .suggest-item:hover { background: var(--brand-soft); }
.s-icon { width: 24px; text-align: center; flex: none; font-size: 18px; }
.s-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-amt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.amount-help { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 0; margin-top: -6px; }
.amount-help:empty { display: none; }
.amount-eval { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.amount-eval.bad { color: var(--neg); }
.chip.small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.calc-keys { display: flex; gap: 6px; margin: -2px 0 8px; }
.calc-keys[hidden] { display: none; }
.chip.calc-key { flex: 1; min-width: 0; padding: 4px 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.calc-key.eq { color: var(--brand); }
.cat-chips { padding-bottom: 6px; }
/* el ancho de un select lo fija su opción más larga: se acota para que "Otra…" sea un botón más */
.chip-select { width: 108px; flex: none; min-height: 40px; border-radius: 99px; padding: 6px 28px 6px 14px; font-size: 15px; background-color: var(--card); text-overflow: ellipsis; }
.sum-chip { padding: 7px 10px; }
.summary { display: flex; flex-wrap: wrap; gap: 8px; }
.sum-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 12px; min-height: 38px; font-size: 14px; cursor: pointer; }
.sum-chip.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.sum-editor { background: var(--bg); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.sum-editor .chips { align-items: center; }
.sum-editor input[type=date] { width: auto; min-height: 40px; }

/* ---- Inicio: pendientes ------------------------------------------------------- */
.pend { border-color: var(--brand); }
.pend-progress { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin: 2px 0 6px; }
.pend-progress > div { height: 100%; background: var(--brand); border-radius: 3px; }
.pend-row .icon { font-size: 20px; }
.pend-row .row-actions { flex-wrap: nowrap; align-items: center; }
.icon-btn.small { width: 32px; height: 32px; font-size: 15px; }
.link-row { display: block; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 2px; text-align: left; color: var(--brand); font-weight: 600; cursor: pointer; }
.link-row.small { font-size: 13px; font-weight: 500; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tile.tappable { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.merge-box { display: grid; gap: 6px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.tidy { border-color: var(--brand); }
.tidy .title, .tidy .sub { white-space: normal; }

/* ---- Cartola por cuenta y cuadre con el banco ----------------------------------- */
.acc-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.acc-top .main { flex: 1; min-width: 0; }
.acc-top h2 { margin: 2px 0 0; overflow-wrap: anywhere; }
.acc-top .icon-btn { margin-left: -8px; }
.acc-card .actions { margin-top: 10px; }
.recon { border-color: var(--neg); }
.recon.ok { border-color: var(--pos); }
.recon-ok { font-weight: 700; color: var(--pos); font-size: 17px; }
.recon-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: baseline; margin: 2px 0 6px; }
.recon-grid > span:nth-child(3n+1) { color: var(--muted); font-size: 14px; }
.recon-grid b { font-variant-numeric: tabular-nums; text-align: right; }
.recon-grid .link { padding: 0; font-size: 14px; }
.carry .link { display: block; padding: 6px 0 0; font-size: 13px; text-align: left; }
.recon-explain { margin: 4px 0 0; }
.recon-sum { display: grid; gap: 4px; }
.recon-verdict { font-weight: 600; }
.hint { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.hint:first-of-type { border-top: 0; }
.hint-text { display: grid; gap: 2px; font-size: 14px; }
.hint .row-actions { justify-content: flex-start; }
.acc-tools .chips:empty { display: none; }
.dayhead.split { display: flex; justify-content: space-between; gap: 8px; }
.daybal { text-transform: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.row.acc-move { padding: 0; gap: 0; cursor: default; min-height: 0; }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 52px; padding: 10px 2px; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.row-main .amt.pos { color: var(--pos); }
/* marca "encontrado en el banco": círculo de 30px con área táctil de 44px */
.tick { position: relative; flex: none; width: 30px; height: 30px; margin: 0 10px 0 0; border-radius: 50%; border: 2px solid var(--muted); background: none; color: transparent; font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.tick::after { content: ''; position: absolute; inset: -8px; }
.tick.on { background: var(--pos); border-color: var(--pos); color: var(--card); }
.acc-move.ticked .title, .acc-move.ticked .amt { color: var(--muted); }
.recon-mark { margin: 10px -12px 0; padding: 8px 12px; background: var(--brand-soft); color: var(--ink); font-size: 13px; font-weight: 600; }
.recon-mark.from { background: var(--bg); color: var(--muted); }
.list .recon-mark:first-child { margin-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.drift-list { margin: 6px 0; }

/* ---- Inversiones por cantidad y puntos ------------------------------------------ */
.steps { padding-left: 20px; margin: 8px 0 12px; display: grid; gap: 6px; }
.sym-search { display: flex; gap: 8px; align-items: center; }
.sym-search input { flex: 1; min-width: 0; }
.sym-results { display: grid; margin-top: 4px; }
.sym-results .row { min-height: 44px; padding: 6px 2px; }
.sym-results .title, .sym-results .sub { white-space: normal; }
.sym-results .ok-note { color: var(--pos); }
.sym-results .warn-note { color: var(--warn-ink); }
.trade-total { font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 0; min-height: 1.4em; }

/* ---- Inversiones: de dónde viene la ganancia (barra 100%) ----------------------- */
.share-plot { margin-top: 8px; }
.share-bar { display: flex; gap: 2px; height: 28px; }
.share-seg { flex: 1 1 0; min-width: 4px; height: 100%; border: 0; padding: 0; cursor: pointer; border-radius: 0; }
.share-seg:first-child { border-radius: 4px 0 0 4px; }
.share-seg:last-child { border-radius: 0 4px 4px 0; }
.share-seg:only-child { border-radius: 4px; }
.share-seg.on, .share-seg:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; position: relative; z-index: 1; }
.share-plot .viz-tip { top: 36px; }
.share-legend { display: grid; gap: 2px; margin-top: 10px; }
.share-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; font-size: 14px; padding: 4px 0; }
.share-row .s-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row .s-name small { color: var(--muted); }
.share-row .s-amt { font-variant-numeric: tabular-nums; color: var(--muted); }
.share-row .s-pct { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 48px; text-align: right; }
.share-loss { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.share-sum { margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.share-row .s-amt.neg { color: var(--neg); }
.viz-line.dash { stroke-dasharray: 5 4; }
.viz-key-line.dash { height: 0; background: none; border-top: 2px dashed; }

/* ---- Visualizaciones: ritmo, calendario, distribución, inflación ---------------- */
.pace-msg { margin: 4px 0 0; font-size: 14px; font-weight: 600; }
.pace-msg.up-bad::before { content: '▲ '; color: var(--neg); }
.pace-msg.down-good::before { content: '▼ '; color: var(--pos); }
.cal-grid { display: grid; grid-template-columns: 14px repeat(12, 1fr); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 3px; margin-top: 8px; }
.cal-dow { font-size: 10px; color: var(--muted); align-self: center; grid-column: 1; }
.cal-cell { display: inline-block; aspect-ratio: 1; min-width: 0; border-radius: 3px; border: 0; padding: 0; background: var(--bg); cursor: pointer; }
.cal-legend .cal-cell { width: 12px; height: 12px; vertical-align: -2px; margin: 0 2px; cursor: default; }
.cal-cell.none { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.cal-cell.future { background: none; cursor: default; }
.cal-cell.h0 { background: var(--heat-0); } .cal-cell.h1 { background: var(--heat-1); } .cal-cell.h2 { background: var(--heat-2); }
.cal-cell.h3 { background: var(--heat-3); } .cal-cell.h4 { background: var(--heat-4); } .cal-cell.h5 { background: var(--heat-5); }
.cal-cell.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.cal-legend { margin-top: 8px; }
.cal-card p { margin: 8px 0 0; }
.alloc-block + .alloc-block { margin-top: 14px; }
.alloc-block .label { margin-bottom: -2px; }
.div-list { display: grid; gap: 10px; margin-top: 8px; }
.div-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr 56px; gap: 10px; align-items: center; }
.div-name { display: grid; min-width: 0; }
.div-name span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.div-name small { color: var(--muted); font-size: 12px; }
.div-track { position: relative; height: 14px; }
.div-zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--viz-axis); }
.div-bar { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.div-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.paste-btn { margin-left: auto; }

/* ---- Propiedades ------------------------------------------------------------------- */
.rent { display: grid; gap: 4px; }
.rent-line { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rent-line.strong { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; font-size: 15px; }
/* fuera de lo normal: anillo rojo con un borde del color de la tarjeta (se ve sobre celdas claras y oscuras) y esquina */
.heat td.anom { position: relative; box-shadow: inset 0 0 0 2px var(--neg), inset 0 0 0 4px var(--card); }
.heat td.anom::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 12px 12px 0; border-color: transparent var(--neg) transparent transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Análisis: salud, proyección, este año vs el anterior ---------------------------------- */
.seg.tabs { display: flex; width: 100%; margin-bottom: 10px; }
.seg.tabs button { flex: 1; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.health-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 4px; align-content: start; }
.health-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 6px; align-items: baseline; }
.health-title { font-size: 13px; color: var(--muted); }
.health-badge { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.health-item.is-good .health-badge { color: var(--pos); box-shadow: inset 0 0 0 1px var(--pos); }
.health-item.is-warn .health-badge { background: var(--warn); color: var(--warn-ink); }
.health-item.is-bad .health-badge { color: var(--neg); box-shadow: inset 0 0 0 1px var(--neg); }
.health-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health-detail { font-size: 13px; }
.health-ref { font-size: 12px; color: var(--muted); }
.fc-scen { margin-top: 10px; display: grid; gap: 8px; }
.fc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fc-field { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.fc-field input { width: 100%; min-width: 0; }
.div-row.yoy, .made-row { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; width: 100%; cursor: pointer; }
.div-row.yoy { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; }
.alert-card { border-color: var(--neg); color: inherit; text-decoration: none; }
.alert-card .title { font-weight: 700; margin-bottom: 2px; }
.made-of { margin-top: 6px; }
.made-of p { margin: 0 0 6px; }
.made-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.made-row .made-track { grid-column: 1 / -1; }
.made-row.on .made-name { color: var(--brand); }
.made-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.made-name small { color: var(--muted); font-weight: 400; }
.made-track { height: 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.made-track span { display: block; height: 100%; background: var(--viz-1); border-radius: 3px; }
.made-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.health-hint { font-size: 13px; font-weight: 600; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 18px 2px 0; }
.section-head h4 { margin: 0; }
.alert-card .card-foot { margin-top: 8px; justify-content: flex-end; gap: 8px; }
.fold-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 32px; }
.fold-head h3 { margin: 0; flex: 1; }
.fold-chev { color: var(--muted); font-size: 18px; }
.acc-fold .fold-head[aria-expanded="true"] { margin-bottom: 4px; }
/* sugerencia de categoría propia: nombre y detalle a todo el ancho, botones debajo */
.sug-row { flex-wrap: wrap; row-gap: 6px; }
.sug-row .main { flex-basis: 100%; }
.sug-row .row-actions { margin-left: auto; }
/* calendario de registros mirando un mes pasado: los días de otros meses, atenuados */
.cal-cell.other { opacity: .35; }
.alloc-note { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--warn); color: var(--warn-ink); font-size: 13px; }
.alloc-note span { flex: 1; }
/* recuadro para pegar un comprobante con el gesto del teléfono */
.paste-zone { min-height: 140px; border: 2px dashed var(--line); border-radius: 14px; padding: 14px; margin: 8px 0; display: grid; place-items: center; text-align: center; color: var(--muted); -webkit-user-select: text; user-select: text; overflow: hidden; }
.paste-zone:empty::before { content: 'Mantén presionado aquí › Pegar'; font-weight: 600; }
.paste-zone:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.paste-zone img { max-width: 100%; max-height: 200px; }
.fc-typical { margin-top: 12px; }
.fc-typical h4 { margin: 0 0 6px; }
.fc-spend { margin-top: 10px; }
.fc-spend small { margin-top: 2px; }
/* selección de varios movimientos */
.row.tx.selectable { gap: 10px; }
.pick-box { flex: none; width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; font-weight: 700; color: var(--brand-ink); }
.row.tx.picked .pick-box { background: var(--brand); box-shadow: none; }
.row.tx.picked { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.sel-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 32; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .18); }
.sel-count { flex: 1 1 100%; font-size: 13px; font-weight: 600; }
.sel-spacer { height: 100px; }
/* 📋 sobre el ＋: pegar lo copiado y registrar */
.fab-mini { position: fixed; right: 27px; bottom: calc(var(--tab-h) + var(--safe-b) + 82px); z-index: 31; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; box-shadow: 0 4px 12px rgba(0, 0, 0, .22); cursor: pointer; }
.fab-mini[hidden] { display: none; }
/* metas */
.goal-row { display: grid; gap: 4px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.goal-row:first-of-type { border-top: 0; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.goal-top .title { font-weight: 600; }
.goal-track { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.goal-track > div { height: 100%; background: var(--viz-3); border-radius: 6px; }
.goals h4 { margin-top: 16px; }
.rvs-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
.month-summary .kpis small { display: inline; font-size: 12px; }
details summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
/* resumen para el contador */
.tax-preview { overflow: hidden; min-width: 0; }
.tx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
@media (max-width: 520px) {
  .tx-tbl { font-size: 12px; }
  .tx-tbl th, .tx-tbl td { padding: 4px 4px; }
  .tx-tbl td:first-child, .tx-tbl th:first-child { min-width: 110px; }
}
.tax-report h1 { font-size: 17px; margin: 0 0 4px; }
.tax-report h2 { font-size: 14px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--brand); color: var(--ink); }
.tax-report h3 { font-size: 13px; margin: 10px 0 4px; }
.tx-note { color: var(--muted); font-size: 12px; margin: 4px 0; }
.tx-tbl { border-collapse: collapse; width: 100%; margin: 6px 0 10px; font-size: 13px; }
.tx-tbl th, .tx-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tx-tbl th { font-weight: 600; color: var(--muted); }
.tx-tbl .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.tx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.tx-kpis div { border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.tx-kpis span { display: block; font-size: 12px; color: var(--muted); }
.tx-kpis b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tax-report ul { margin: 4px 0 8px 18px; padding: 0; font-size: 13px; }
}
.tax-report .tx-head p { font-size: 13px; }

/* ---- programados ---- */
.rep-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.rep-fields.three > :last-child { grid-column: 1 / -1; }   /* cuál y día lado a lado; "hasta" abajo */
.rep-fields .rep-shift { grid-column: 1 / -1; }
.sched-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card-2, var(--card)); border: 1px solid var(--line); font-size: 13px; }
.sched-note[hidden] { display: none; }
.sched-list .row .sub, .sched-list .row .title { white-space: normal; }

/* iPhone: Safari hace zoom al tocar un campo con letra de menos de 16 px (ej. los de Repetir o la simulación
   de arriendo, que heredan 12 px). Todos los campos quedan en 16 px o más. */
@supports (-webkit-touch-callout: none) {
  :where(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: max(16px, 1em) !important; }   /* sin especificidad: el monto grande (34 px) se mantiene */
}
.fc-field input, .fc-field select { font-size: 16px; }
.sched-done { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.chips a.chip { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.calc-hint { display: block; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 0; }
.calc-hint.bad { color: var(--neg); }
.rep-tx { margin-top: 10px; }
.rep-tx[hidden] { display: none; }
/* liquidación de sueldo */
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pay-row input { width: 9.5em; flex: none; text-align: right; min-height: 40px; padding: 6px 10px; }
.pay-row .r { text-align: right; white-space: nowrap; }
.pay-row.strong { font-weight: 700; font-size: 17px; border-bottom: 0; }
.pay-total { margin-top: 10px; }
.month-chips { flex-wrap: wrap; gap: 6px; }
.advice-list { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.advice-list li { margin: 4px 0; }
.card.warn-card { border-color: var(--warn); background: var(--warn); color: var(--warn-ink); }

/* Cuenta: QR de la verificación en dos pasos (fondo blanco también en modo oscuro: lo leen las cámaras) */
.totp-qr { background: #fff; padding: 8px; border-radius: 8px; width: min(220px, 70vw); margin: 8px 0; }
.totp-qr svg { display: block; width: 100%; height: auto; }
.totp-secret { word-break: break-all; user-select: all; }
p.bad, .card .bad { color: var(--neg); }
.warn-box { border-left: 4px solid var(--neg); }

/* Bloqueo con Face ID / huella: cortina sobre todo (también oculta los montos en el selector de apps) */
#lock-curtain { position: fixed; inset: 0; z-index: 9999; background: var(--bg, #0b1513); display: flex; align-items: center; justify-content: center; }
#lock-curtain .lock-box { text-align: center; padding: 24px; }
#lock-curtain .lock-msg { color: var(--muted, #8aa); margin: 8px 0 20px; }
