/* ============================================================
   MIS FINANZAS Y TAREAS — sistema de diseño (v2)
   Tipografía: Fraunces (cifras/titulares) + Work Sans (interfaz)
   Concepto: "libreta de cuentas" — tinta índigo sobre papel cálido, acento ámbar.
   ============================================================ */

:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ink: #1B2340;
  --paper: #F1EFE8;
  --paper-raised: #FFFFFF;
  --paper-sunken: #E7E4DA;
  --line: #DAD6C9;
  --accent: #9A5F1F;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(154,95,31,.11);
  --on-solid: #FFFFFF;

  --income: #2F6F52;
  --expense: #A8452F;
  --bill: #3D6BA5;
  --savings: #7A5AA8;
  --debt: #857055;
  --expense-soft: rgba(168,69,47,.10);
  --income-soft: rgba(47,111,82,.10);
  --savings-soft: rgba(122,90,168,.12);

  --text: var(--ink);
  --text-muted: #4B4F6B;
  --text-faint: #62667C;

  --shadow: 0 1px 2px rgba(27,35,64,.06), 0 6px 20px rgba(27,35,64,.06);
  --radius-m: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F2F2F5; --paper: #000000; --paper-raised: #1C1C1E; --paper-sunken: #2C2C2E;
    --line: #333336; --accent: #E0A254; --accent-ink: #1B1204; --accent-soft: rgba(224,162,84,.15);
    --on-solid: #000000;
    --income: #6FCB9F; --expense: #E38874; --bill: #82B1EA; --savings: #B6A0E8; --debt: #CDB89C;
    --expense-soft: rgba(227,136,116,.14); --income-soft: rgba(111,203,159,.13); --savings-soft: rgba(182,160,232,.14);
    --text-muted: #C2C2C8; --text-faint: #98989F;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F2F2F5; --paper: #000000; --paper-raised: #1C1C1E; --paper-sunken: #2C2C2E;
  --line: #333336; --accent: #E0A254; --accent-ink: #1B1204; --accent-soft: rgba(224,162,84,.15);
  --on-solid: #000000;
  --income: #6FCB9F; --expense: #E38874; --bill: #82B1EA; --savings: #B6A0E8; --debt: #CDB89C;
  --expense-soft: rgba(227,136,116,.14); --income-soft: rgba(111,203,159,.13); --savings-soft: rgba(182,160,232,.14);
  --text-muted: #C2C2C8; --text-faint: #98989F;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-tap-highlight-color: transparent; }
body {
  height: 100%; margin: 0;
  background: var(--paper); color: var(--text);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--font-display); }
button, input, select, textarea { font-family: inherit; color: inherit; font-size: inherit; }
button { -webkit-appearance: none; appearance: none; }
::selection { background: var(--accent-soft); }
.tnum { font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-display); }

/* iconos */
svg.i { width: 1.2em; height: 1.2em; display: inline-block; vertical-align: -0.22em; flex: none; }

/* ---------------- Shell ---------------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.page { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rail { display: none; }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  padding: 14px 20px 12px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .1px; }
.topbar .sub { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }

main#content {
  flex: 1 1 auto; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 16px 16px 150px;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--paper-raised); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; padding: 6px 2px 4px; cursor: pointer;
  color: var(--text-faint); font-size: 10.5px; font-weight: 500; border-radius: 12px; min-width: 0;
}
.tab .ic { font-size: 22px; line-height: 1; display: block; }
.tab.active { color: var(--accent); }

.fab {
  position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 25;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: 26px;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(184,117,42,.38);
}
.fab:active { transform: scale(.94); }

@media (min-width: 760px) {
  #app { flex-direction: row; }
  .rail {
    display: flex; flex-direction: column; gap: 2px; width: 232px; flex: none;
    height: 100vh; position: sticky; top: 0; padding: 28px 14px 22px;
    border-right: 1px solid var(--line); background: var(--paper-raised);
  }
  .rail .brand { font-family: var(--font-display); font-size: 21px; font-weight: 600; padding: 0 10px 22px; line-height: 1.15; }
  .rail .brand .sub { display: block; font-family: var(--font-ui); font-size: 12.5px; font-weight: 400; color: var(--text-faint); margin-top: 3px; }
  .rail .tab {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14.5px;
    padding: 11px 12px; width: 100%; text-align: left; border-radius: 10px;
  }
  .rail .tab .ic { font-size: 19px; }
  .rail .tab:hover { background: var(--paper-sunken); }
  .rail .tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .rail-fab {
    margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: var(--accent-ink); border: none; border-radius: 12px;
    padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .tabbar, .fab { display: none; }
  .topbar { padding: 22px 40px 14px; }
  main#content { padding: 24px 40px 60px; max-width: 880px; }
  .toast { bottom: 34px !important; }
}

/* ---------------- Primitivas ---------------- */
.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; }
.section-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); letter-spacing: .01em;
  margin: 26px 2px 10px; display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 2px; }
.section-title .link { font-size: 12.5px; font-weight: 500; color: var(--accent); cursor: pointer; background: none; border: none; padding: 2px 0; }

.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { border-radius: var(--radius-m); padding: 13px 11px; background: var(--paper-raised); border: 1px solid var(--line); min-width: 0; }
.kpi .v { font-family: var(--font-display); font-size: clamp(15px, 4.6vw, 22px); font-weight: 600; white-space: nowrap; }
.kpi .l { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.kpi.income .v { color: var(--income); }
.kpi.expense .v { color: var(--expense); }
.kpi.avail .v { color: var(--accent); }

.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper-raised); cursor: pointer; }
.row:active { background: var(--paper-sunken); }
.row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.row .main { flex: 1 1 auto; min-width: 0; }
.row .ttl { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12px; color: var(--text-faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-size: 14.5px; font-weight: 600; flex: none; }
.pos { color: var(--income); }
.neg { color: var(--expense); }
.row.static { cursor: default; }

.date-sep { font-size: 12px; font-weight: 600; color: var(--text-faint); margin: 18px 4px 7px; }
.date-sep:first-child { margin-top: 0; }
.summary-line { font-size: 12.5px; color: var(--text-faint); margin: 12px 2px 12px; }

.empty { text-align: center; padding: 44px 20px; color: var(--text-faint); font-size: 13.5px; }
.empty .big { font-size: 34px; margin-bottom: 10px; color: var(--text-faint); }
.empty b { color: var(--text-muted); font-size: 15px; }
.empty .cta { margin-top: 16px; }

.pill-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.pill-row::-webkit-scrollbar { display: none; }
.pill {
  flex: none; padding: 7px 14px; border-radius: 100px; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--paper-raised); border: 1px solid var(--line); color: var(--text-muted);
}
.pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.sm { padding: 5px 11px; font-size: 12px; }

.segmented { display: flex; background: var(--paper-sunken); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button { flex: 1; border: none; background: none; padding: 8px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.segmented button.active { background: var(--paper-raised); color: var(--text); box-shadow: var(--shadow); }

.month-nav { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 2px 0 14px; }
.month-nav .lbl { font-family: var(--font-display); font-weight: 600; font-size: 16px; min-width: 150px; text-align: center; }

.progress { height: 6px; border-radius: 4px; background: var(--paper-sunken); overflow: hidden; }
.progress > div { height: 100%; border-radius: 4px; background: var(--accent); }
.progress.over > div { background: var(--expense); }
.budget-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.budget-row:first-child { padding-top: 2px; }
.budget-row:last-child { border-bottom: none; padding-bottom: 2px; }
.budget-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 7px; }
.budget-row .top .cat { font-weight: 500; }
.budget-row .top .nums { color: var(--text-faint); white-space: nowrap; }
.budget-row .top .nums b { color: var(--text); font-weight: 600; }
.budget-row.over .nums b { color: var(--expense); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; border: none; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--ink); color: var(--paper);
}
.btn.block { flex: 1 1 0; width: 100%; }
.btn.ghost { background: var(--paper-sunken); color: var(--text); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--expense-soft); color: var(--expense); flex: none; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; flex: none; cursor: pointer;
  background: var(--paper-sunken); color: var(--text); display: grid; place-items: center; font-size: 18px;
}
.icon-btn:active { transform: scale(.94); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--text-faint); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper-raised); font-size: 16px; color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.type-toggle { display: flex; gap: 6px; }
.type-toggle button {
  flex: 1; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised);
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; min-width: 0;
}
.type-toggle button.active { color: var(--on-solid); border-color: transparent; }
.type-toggle button.active[data-t="Ingreso"] { background: var(--income); }
.type-toggle button.active[data-t="Factura"] { background: var(--bill); }
.type-toggle button.active[data-t="Gasto"] { background: var(--expense); }
.type-toggle button.active[data-t="Ahorro"] { background: var(--savings); }
.type-toggle button.active[data-t="Deuda"] { background: var(--debt); }
.type-toggle button.active[data-p], .type-toggle button.active[data-e] { background: var(--ink); color: var(--paper); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.chip { padding: 6px 12px; border-radius: 100px; font-size: 13px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text-muted); cursor: pointer; }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* Hoja (modal) */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10,12,24,.42);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  background: var(--paper); width: 100%; max-width: 480px; max-height: 90%; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 14px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateY(18px); transition: transform .18s ease;
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet .handle { width: 36px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 14px; }
.sheet h2 { font-size: 19px; margin: 0 0 16px; font-weight: 600; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; }
@media (min-width: 760px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; max-height: 86%; } }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  max-width: 88%; text-align: center; background: var(--ink); color: var(--paper);
  padding: 11px 18px; border-radius: 100px; font-size: 13.5px; font-weight: 500; z-index: 80; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; }

.chart-wrap { position: relative; height: 200px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-m); background: var(--expense-soft); color: var(--expense); font-size: 13px; margin-bottom: 10px; }
.alert.warn { background: var(--accent-soft); color: var(--accent); }
.alert svg.i { font-size: 18px; margin-top: 1px; }
.alert b { display: block; font-size: 13.5px; margin-bottom: 1px; }

.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--paper-sunken); border-top-color: var(--accent); animation: spin .7s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 90px 20px; color: var(--text-faint); font-size: 13.5px; }
.loading .spinner { margin-bottom: 16px; }

.check-btn {
  width: 28px; height: 28px; border-radius: 50%; flex: none; cursor: pointer; display: grid; place-items: center;
  border: 1.6px solid var(--line); background: var(--paper-raised); color: var(--on-solid); font-size: 15px; padding: 0;
}
.check-btn.done { background: var(--income); border-color: var(--income); }

.config-list { padding: 0; overflow: hidden; }
.config-list .row2 { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); }
.config-list .row2:last-child { border-bottom: none; }
.config-list input { border: none; background: none; font-size: 15px; padding: 8px 2px; width: 100%; color: var(--text); min-width: 0; }
.config-list input:focus { outline: none; }
.config-list input.amt { width: 92px; text-align: right; flex: none; color: var(--text-muted); }
.config-list .rm { flex: none; color: var(--text-faint); background: none; border: none; font-size: 16px; cursor: pointer; padding: 8px; }

.profile-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-m); background: var(--paper-raised); border: 1px solid var(--line); }
.profile-tile .av { width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 600; font-family: var(--font-display); }
.profile-tile .t { font-weight: 600; font-size: 15px; }
.profile-tile .d { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }

.menu { padding: 2px 14px; }
.menu-item {
  display: flex; align-items: center; gap: 13px; padding: 13px 0; cursor: pointer; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--text);
}
.menu-item:last-child { border-bottom: none; }
.menu-item .ic { width: 22px; font-size: 19px; color: var(--text-muted); display: grid; place-items: center; flex: none; }
.menu-item .chev { margin-left: auto; color: var(--text-faint); font-size: 14px; display: flex; }
.menu-item.static { cursor: default; }
.future-badge { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--savings-soft); color: var(--savings); padding: 3px 8px; border-radius: 100px; }

/* Inversiones: gráfico de evolución estilo bróker */
.tr-card { padding: 16px 14px 12px; margin-bottom: 12px; }
.tr-head { margin: 0 2px 8px; min-height: 58px; }
.tr-big { font-family: var(--font-display); font-size: clamp(26px, 8vw, 34px); font-weight: 600; letter-spacing: -.5px; line-height: 1.1; }
.tr-chg { font-size: 14px; font-weight: 600; margin-top: 4px; }
.tr-when { color: var(--text-faint); font-weight: 500; }
.tr-fecha { font-size: 12px; color: var(--text-faint); margin-top: 2px; min-height: 15px; }
.tr-chart { position: relative; height: 170px; margin: 4px 0 10px; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.tr-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tr-empty { display: grid; place-items: center; color: var(--text-faint); font-size: 13px; cursor: default; }
.tr-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-faint); opacity: .5; display: none; pointer-events: none; }
.tr-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 3px var(--paper-raised); display: none; pointer-events: none; }
.tr-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-faint); margin: 0 2px 10px; flex-wrap: wrap; }
.tr-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.tr-legend i.dash { background: repeating-linear-gradient(90deg, var(--text-faint) 0 2px, transparent 2px 5px); }
.tr-note { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; margin: -4px 2px 10px; }
.tr-chips button { font-size: 12.5px; padding: 7px 4px; }
.tr-mini { flex: 1; min-width: 0; background: var(--paper-sunken); border-radius: 10px; padding: 8px 9px; }
.tr-mini .l { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-mini .v { font-size: 15px; font-weight: 600; margin-top: 2px; }
/* Botones tipo enlace fuera de los títulos de sección (Elegir pestañas, Cambiar activo…) */
button.link { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; background: none; border: none; padding: 4px 0; display: inline-block; text-align: left; }

/* Bloque 4: avisos de cobros y pagos, editor de reglas */
.rec-card { padding: 4px 14px; }
.rec-aviso { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rec-aviso:last-child { border-bottom: none; }
.rec-aviso .rec-txt { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.rec-aviso .rec-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.rec-aviso.pasado .rec-sub { color: var(--expense); }
.rec-aviso.hecho { color: var(--text-muted); }
.rec-btns { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; }
.btn.sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; min-height: 0; }
.rec-prev { font-size: 13px; color: var(--text-muted); background: var(--paper-sunken); border-radius: 10px; padding: 10px 12px; margin-top: 10px; line-height: 1.45; }
.rec-learn { font-size: 13px; line-height: 1.45; background: var(--income-soft); color: var(--text); border-radius: 10px; padding: 9px 11px; margin: 4px 0 8px; }
.rec-learn.warn { background: var(--accent-soft); }
.rec-hint { font-size: 12.5px; color: var(--text-faint); line-height: 1.45; margin-top: 6px; }

/* Bloque 5: importación y reglas */
.imp-drop { display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--line); border-radius: var(--radius-m); padding: 26px 12px; cursor: pointer; background: var(--paper-raised); font-weight: 600; color: var(--accent); }
.imp-drop input { display: none; }
.imp-drop span { display: inline-flex; gap: 8px; align-items: center; }
.imp-file { font-size: 12.5px; color: var(--text-faint); margin: -8px 0 10px; word-break: break-all; }
.imp-file select { font-size: 12.5px; padding: 2px 6px; width: auto; }
.imp-map { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.imp-map label { flex: 0 0 38%; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.imp-map select { flex: 1 1 auto; min-width: 0; }
.imp-note { font-size: 12.5px; color: var(--text-muted); background: var(--paper-sunken); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; line-height: 1.4; }
.imp-note.warn { background: var(--accent-soft); color: var(--text); }
.imp-bulk { font-size: 12.5px; margin: 6px 2px; color: var(--text-faint); }
.imp-bulk .link { font-size: 12.5px; }
.imp-list { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.imp-row { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper-raised); align-items: flex-start; }
.imp-row:last-child { border-bottom: none; }
.imp-row.off { opacity: .5; }
.imp-row input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.imp-main { flex: 1 1 auto; min-width: 0; }
.imp-top { display: flex; gap: 8px; justify-content: space-between; font-size: 13.5px; }
.imp-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.imp-amt { font-weight: 600; flex: none; }
.imp-sub { font-size: 11.5px; color: var(--text-faint); margin: 2px 0 6px; }
.imp-sels { display: flex; gap: 6px; }
.imp-sels select { font-size: 12.5px; padding: 5px 6px; min-width: 0; flex: 1 1 0; }
.regla-box { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.6; cursor: pointer; }
.regla-box input[type=checkbox] { margin-top: 4px; accent-color: var(--accent); flex: none; }
.regla-box input[type=text] { display: inline-block; width: 110px; padding: 2px 6px; font-size: 12.5px; }
.list .rm { flex: none; color: var(--text-faint); background: none; border: none; font-size: 16px; cursor: pointer; padding: 8px; }
.imp-map select, .imp-sels select, .imp-file select { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); font-size: 14px; }
.imp-sels select { padding: 6px 8px; font-size: 13px; }
.field .regla-box input[type=checkbox] { width: 18px; height: 18px; padding: 0; margin: 3px 0 0; flex: none; }
.field .regla-box input[type=text] { display: inline-block; width: 120px; padding: 3px 7px; font-size: 13px; border-radius: 7px; margin: 0 2px; }
.field .regla-box span { flex: 1 1 auto; }
.field label.regla-box { font-weight: 400; font-size: 12.5px; color: var(--text-muted); text-transform: none; letter-spacing: 0; margin: 8px 0 0; }

/* Novedades y etiquetas NUEVO / MEJORADO */
.badge-new { display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: var(--income); color: var(--on-solid); line-height: 1.3; text-transform: uppercase; font-family: inherit; }
.badge-new.mejor { background: var(--savings); }
.badge-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--savings); margin-left: 4px; vertical-align: super; }
.nov-hero { background: linear-gradient(135deg, var(--accent), var(--savings)); color: #fff; border-radius: var(--radius-m); padding: 16px 18px; margin-bottom: 12px; }
.nov-hero h2 { color: #fff; margin: 2px 0 0; font-size: 20px; }
.nov-k { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.nov-list { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--paper-raised); }
.nov-it { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.nov-it[data-click] { cursor: pointer; }
.nov-it:last-child { border-bottom: none; }
.nov-em { font-size: 22px; width: 28px; text-align: center; flex: none; }
.nov-tx { flex: 1; min-width: 0; }
.nov-tx b { font-size: 14.5px; }
.nov-tx div { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; line-height: 1.35; }
.nov-go { color: var(--text-faint); flex: none; display: flex; }
.imp-cfg { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.imp-cfg input { margin-top: 3px; accent-color: var(--accent); flex: none; }

/* Bloque 6: metas de inversión y patrimonio */
.type-toggle button.active[data-t="Inversión"] { background: var(--savings); }
.meta-tipo { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--savings); background: var(--savings-soft); padding: 2px 6px; border-radius: 6px; }
.meta-inv-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.meta-inv-nums .l { font-size: 11px; color: var(--text-faint); }
.meta-inv-nums .v { font-size: 15px; font-weight: 600; margin-top: 1px; }
.meta-est { font-size: 12px; color: var(--text-muted); background: var(--paper-sunken); border-radius: 9px; padding: 8px 10px; margin-top: 8px; line-height: 1.45; }
.asig-grupo { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper-raised); margin-bottom: 10px; overflow: hidden; }
.asig-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.asig-head b { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asig-head span { font-size: 12px; color: var(--text-faint); flex: none; }
.asig-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.asig-row:last-child { border-bottom: none; }
.asig-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.asig-row span { flex: 1; min-width: 0; color: var(--text-muted); }
.pat-card { padding: 14px 16px; }
.pat-total { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.pat-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 4px 0; color: var(--text-muted); }
.pat-note { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.45; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* UX: elementos que se pueden pinchar */
.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .08s ease, border-color .15s ease, background .15s ease; }
.tappable:active { transform: scale(.975); }
.kpi.tappable { position: relative; }
.kpi.tappable::after { content: '›'; position: absolute; top: 8px; right: 10px; font-size: 17px; line-height: 1; color: var(--text-faint); opacity: .7; }
@media (hover: hover) { .kpi.tappable:hover, .budget-row.tappable:hover, .pat-row.tappable:hover { border-color: var(--accent); } .budget-row.tappable:hover .cat { color: var(--accent); } }
.budget-row.tappable { border-radius: 10px; }
.budget-row.tappable .top .cat::after { content: ' ›'; color: var(--text-faint); }
.alert.tappable::after { content: '›'; margin-left: auto; align-self: center; font-size: 18px; opacity: .6; }
.legend .tappable { text-decoration: underline dotted; text-underline-offset: 3px; }
.chev-s { display: inline-flex; color: var(--text-faint); margin-left: 4px; flex: none; }
.chev-s svg { width: 14px; height: 14px; }
.pat-row.tappable { align-items: center; border-radius: 8px; padding: 6px 4px; margin: 0 -4px; }
.pat-row.tappable > span:first-child { flex: 1; }
.filtros-activos { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.link.volver { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 8px; font-size: 13.5px; }
.link.volver svg { width: 16px; height: 16px; }
.cuenta-fecha { font-size: 11.5px; color: var(--text-faint); padding: 0 14px 8px; margin-top: -4px; }
.cuenta-ed { border-bottom: 1px solid var(--line); }
.cuenta-ed:last-child { border-bottom: none; }
.config-list .cuenta-ed .row2 { border-bottom: none; }
.cuenta-ops { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; }
.cuenta-ops select { font-size: 13.5px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--text); }
.cuenta-colores { display: inline-flex; gap: 6px; }
.cuenta-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 2px var(--paper); }
.cuenta-color.on { border-color: var(--text); }
.cuenta-tengo { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--text-muted); }
#cuentaChips .chip .dot, [id^="tras-"] .chip .dot { margin-right: 6px; }
.cuenta-saldo { flex: none; font-size: 15px; padding: 0 2px; }
.cuenta-fecha .link { font-size: 12px; margin-left: 6px; }
.cuadrar-dif { font-size: 14px; line-height: 1.5; color: var(--text-muted); margin: -4px 0 6px; }
.cuadrar-dif .pos { color: var(--income); } .cuadrar-dif .neg { color: var(--expense); }
.cuadra-ok { color: var(--income); font-weight: 600; }
.swipe-acc.uno button { width: 148px; }
.row.traspaso .ttl, .row.traspaso .amt { color: var(--text-muted); }
.mov-ic.t-tras { background: var(--paper-sunken); color: var(--text-faint); }
.hero-cuentas { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; color: inherit; font: inherit; font-size: 14px; padding: 2px 0 8px; cursor: pointer; text-align: left; opacity: .9; }
.hero-cuentas b { font-weight: 700; }
.hero-cuentas .i { width: 14px; height: 14px; opacity: .7; }
.cuentas-total { font-size: 28px; font-weight: 700; margin: 0 0 8px; }
.cuentas-card .cuentas-total { padding: 0 2px; }
.cuenta-fila, .asignar-fila { width: 100%; text-align: left; background: none; border: none; font: inherit; color: inherit; }
.cuenta-fila .dot { margin-right: 10px; width: 11px; height: 11px; }
.row .cuenta-dot { margin-right: 6px; vertical-align: 1px; width: 8px; height: 8px; }
.cuenta-filtro .pill .dot { width: 8px; height: 8px; }
.asignar-aviso { margin-top: 14px; }
.cuenta-acc { display: flex; gap: 10px; margin-bottom: 6px; }
.cuenta-acc .btn { flex: 1; }
.asignar-lista { margin-top: 8px; }
.asignar-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; margin-right: 10px; }
.asignar-fila.on .asignar-check { background: var(--accent); border-color: var(--accent); color: var(--on-solid); }
.asignar-check .i { width: 14px; height: 14px; }
.k-tras .crear-ic { background: var(--paper-sunken); color: var(--text-muted); }
/* hojas: botón de cerrar */
.sheet { position: relative; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--paper-sunken); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.sheet-x svg { width: 16px; height: 16px; }
.sheet h2 { padding-right: 40px; }

/* Bloque 8.1: grupos */
.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; letter-spacing: .02em; border: 2px solid var(--paper-raised); }
.avatars { display: flex; flex: none; }
.avatars .avatar + .avatar { margin-left: -9px; }
.enlace-box { margin-top: 10px; font-size: 12px; word-break: break-all; background: var(--paper-sunken); border-radius: 9px; padding: 8px 10px; color: var(--text-muted); user-select: all; -webkit-user-select: all; }
.unirse-card { background: linear-gradient(135deg, var(--accent), var(--savings)); color: #fff; border-radius: var(--radius-m); padding: 16px 18px; margin-bottom: 14px; }
.unirse-nombre { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.unirse-meta { font-size: 13px; opacity: .9; margin-top: 2px; }
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.wa-btn { background: #25D366 !important; color: #fff !important; }

/* Gastos compartidos (bloque 8.2) */
.comp-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius-m); background: transparent; color: var(--accent); font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: left; }
.comp-toggle .i, .comp-head .i, .comp-tag .i, .comp-ok .i { width: 18px; height: 18px; flex: none; }
.comp-box { border: 1px solid var(--accent); border-radius: var(--radius-m); padding: 12px 14px; background: var(--accent-soft); }
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comp-head b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--accent); }
.comp-lbl { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 6px; }
.comp-box .chips { margin: 0; }
.segmented.sm button { font-size: 12.5px; padding: 7px 4px; }
.comp-rows { margin-top: 8px; }
.comp-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; cursor: default; }
.comp-row:last-child { border-bottom: none; }
.comp-row .n { flex: 1; min-width: 0; }
.comp-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.comp-row input.comp-val, .field .comp-row input.comp-val { width: 100px; flex: none; text-align: right; padding: 8px 10px; font-size: 15px; }
.comp-row .u { width: 18px; color: var(--text-faint); font-size: 13px; flex: none; }
.comp-resumen { margin-top: 10px; font-size: 13.5px; line-height: 1.45; }
.amt-sub { font-size: 11px; color: var(--text-faint); font-weight: 500; text-align: right; white-space: nowrap; }
.comp-tag { display: inline-flex; vertical-align: -3px; color: var(--accent); margin-left: 6px; }
.deuda-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.deuda-row:last-of-type { border-bottom: none; }
.deuda-row .t { flex: 1; line-height: 1.35; }
.comp-ok { display: flex; align-items: center; gap: 8px; color: var(--income); font-weight: 600; font-size: 14.5px; }
.comp-total { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-bottom: 6px; }
.field label.comp-row { display: flex; margin: 0; font-size: 14.5px; font-weight: 400; color: var(--text); cursor: pointer; }
.comp-row b { font-weight: 600; }
.comp-box .chip { background: var(--paper-raised); }
.comp-box .chip.active { background: var(--accent); color: var(--accent-ink); }
.comp-box .segmented { background: var(--paper-raised); }
.comp-box .segmented button.active { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

/* Metas y deudas compartidas (bloque 8.3) */
.obj-grupo { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 100px; }
.obj-grupo .i { width: 13px; height: 13px; }
.obj-personas { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* Tickets (bloque 8B) */
.tk-btn { margin: -2px 0 14px; }
.tk-cargando { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px; text-align: center; font-size: 14px; }
.tk-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-cab, .tk-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 86px 30px; gap: 6px; align-items: center; }
.tk-cab { font-size: 11.5px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding: 0 10px 4px; }
.tk-list { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper-raised); overflow: hidden; }
.tk-item { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tk-item:last-child { border-bottom: none; }
.tk-row input { width: 100%; min-width: 0; padding: 8px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-size: 15px; color: var(--text); font-family: inherit; }
.tk-row input.tk-c, .tk-row input.tk-i { text-align: right; }
.tk-x { border: none; background: none; color: var(--text-faint); cursor: pointer; padding: 4px; display: flex; justify-content: center; }
.tk-x .i { width: 16px; height: 16px; }
.tk-quien { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.tk-quien .chip { padding: 4px 10px; font-size: 12.5px; }
.tk-quien .chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tk-ok { display: flex; align-items: center; gap: 8px; color: var(--income); font-weight: 600; font-size: 13.5px; }
.tk-ok .i { width: 18px; height: 18px; flex: none; }
.tk-warn { background: var(--expense-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.tk-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-det { margin: -4px 0 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper-raised); padding: 10px 14px; font-size: 13.5px; }
.tk-det summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.tk-det-l { margin-top: 8px; }
.tk-det-r { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); }

/* Novedades: destacados grandes (Parche 3) */
.nov-sub { font-size: 13px; opacity: .92; margin-top: 4px; }
.nov-dest { border-radius: var(--radius-m); padding: 14px 16px 14px; margin-bottom: 10px; border: 1px solid var(--line); background: var(--paper-raised); }
.nov-dest.accent { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), var(--paper-raised) 70%); }
.nov-dest.savings { border-color: var(--savings); background: linear-gradient(160deg, var(--savings-soft), var(--paper-raised) 70%); }
.nov-dest-top { display: flex; align-items: center; gap: 12px; }
.nov-dest-em { font-size: 34px; width: 52px; height: 52px; border-radius: 14px; background: var(--paper-raised); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow); }
.nov-dest h3 { margin: 3px 0 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); }
.nov-dest .badge-new { margin-left: 0; }
.nov-dest p { margin: 10px 0 6px; font-size: 14px; line-height: 1.45; color: var(--text); }
.nov-dest ul { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.nov-dest-btn { color: #fff; }
.nov-dest.accent .nov-dest-btn { background: var(--accent); color: var(--accent-ink); }
.nov-dest.savings .nov-dest-btn { background: var(--savings); color: var(--on-solid); }
/* Parche 8 en adelante: iconos de la app en vez de emojis */
.nov-dest-em svg.i { font-size: 22px; }
.nov-dest.accent .nov-dest-em { color: var(--accent); }
.nov-dest.savings .nov-dest-em { color: var(--savings); }
.nov-em svg.i { font-size: 17px; color: var(--accent); }
/* punto en la pestaña «Más» cuando hay algo nuevo sin ver */
.tab.con-novedad .ic { position: relative; }
.tab.con-novedad .ic::after { content: ''; position: absolute; top: -1px; right: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--income); border: 2px solid var(--paper); }

/* ================= Bloque 9 · nueva estructura ================= */
:root { --hero-bg: #1F2440; --hero-tile: rgba(255,255,255,.08); --hero-muted: #C9CBE0; --bill-soft: rgba(61,107,165,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hero-bg: #1C1C1E; --bill-soft: rgba(130,177,234,.14); --toast-bg: #2C2C2E; } }
:root[data-theme="dark"] { --hero-bg: #1C1C1E; --bill-soft: rgba(130,177,234,.14); --toast-bg: #2C2C2E; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tb-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-r { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-volver { display: none; }
body.en-tu .tb-volver { display: inline-grid; }
.tb-btn { width: 40px; height: 40px; border-radius: 50%; }
.tb-avatar { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; position: relative; cursor: pointer; font-family: inherit; }
.tb-avatar.con-novedad::after { content: ''; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--income); border: 2px solid var(--paper); }
body.en-tu .tb-avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.tabbar { align-items: flex-end; }
.tab-crear { flex: 0 0 56px; align-self: center; width: 56px; height: 56px; aspect-ratio: 1 / 1; margin: -28px 8px 0; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(184,117,42,.42); cursor: pointer; }
.tab-crear .i { width: 26px; height: 26px; }
.rail .rail-tu { margin-top: 8px; }
@media (min-width: 760px) { .rail .rail-fab { margin-top: auto; } }

/* Hero de Inicio */
.hero { background: var(--hero-bg); color: #F4F1EA; border-radius: 26px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-nav { display: flex; align-items: center; gap: 4px; }
.hero-arrow { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--hero-tile); color: inherit; display: grid; place-items: center; cursor: pointer; }
.hero-arrow .i { width: 16px; height: 16px; }
.hero-per { font-weight: 600; font-size: 15px; padding: 0 6px; }
.hero-seg { display: flex; background: var(--hero-tile); border-radius: 12px; padding: 3px; }
.hero-seg button { border: none; background: none; color: var(--hero-muted); font: inherit; font-weight: 600; font-size: 12.5px; border-radius: 9px; padding: 6px 12px; cursor: pointer; }
.hero-seg button.active { background: #F4F1EA; color: #1F2440; }
.hero-main { border: none; background: none; padding: 0; color: inherit; font: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.hero-k { font-size: 13px; color: var(--hero-muted); }
.hero-v { font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
.hero-v.neg { color: #F2A58B; }
.hero-bar { height: 8px; border-radius: 4px; background: var(--hero-tile); display: flex; overflow: hidden; }
.hero-bar i { display: block; height: 100%; }
.hero-bar .g { background: #E78B6B; } .hero-bar .a { background: #B9A3E6; } .hero-bar .d { background: #CDB89C; }
.hero-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-tile { border: none; background: var(--hero-tile); border-radius: 14px; padding: 9px 10px; text-align: left; color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-tile .l { font-size: 11.5px; color: var(--hero-muted); }
.hero-tile b { font-size: 15px; white-space: nowrap; }
.hero-tile b.pos { color: #8FD3AE; } .hero-tile b.neg { color: #F2A58B; } .hero-tile b.sav { color: #C9B8F0; }

/* Lo próximo */
.prox-scroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.prox-scroll::-webkit-scrollbar { display: none; }
.prox-card { flex: none; width: 158px; scroll-snap-align: start; text-align: left; background: var(--paper-raised); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 3px; font: inherit; color: var(--text); cursor: pointer; }
.prox-cuando { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.prox-cuando.pronto { color: var(--expense); }
.prox-t { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prox-d { font-size: 12.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }

/* Dinero: selector de apartado */
.chips-nav { display: flex; gap: 8px; overflow-x: auto; margin: 16px -16px 12px; padding: 0 16px; scrollbar-width: none; }
.chips-nav::-webkit-scrollbar { display: none; }
.chip-nav { flex: none; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); border-radius: 20px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; position: relative; }
.chip-nav.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.empty-mini { text-align: center; color: var(--text-faint); font-size: 13.5px; padding: 16px; }

/* Botón + : qué quieres apuntar */
.crear-ticket { width: 100%; display: flex; align-items: center; gap: 14px; border: none; background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 14px 16px; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 10px 24px rgba(184,117,42,.3); margin-bottom: 12px; }
.crear-ticket b { display: block; font-size: 17px; }
.crear-ticket > span:nth-child(2) > span { font-size: 13px; opacity: .92; }
.crear-ticket .badge-new { margin-left: auto; background: var(--paper-raised); color: var(--income); }
.crear-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.18); }
.crear-ic .i { width: 24px; height: 24px; }
.crear-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.crear-op { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper-raised); border-radius: 18px; padding: 14px 6px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; }
.crear-op .crear-ic { width: 42px; height: 42px; border-radius: 13px; }
.k-gasto .crear-ic { background: var(--expense-soft); color: var(--expense); }
.k-ingreso .crear-ic { background: var(--income-soft); color: var(--income); }
.k-comp .crear-ic { background: var(--savings-soft); color: var(--savings); }
.k-tarea .crear-ic, .k-factura .crear-ic { background: var(--bill-soft); color: var(--bill); }
.k-ahorro .crear-ic { background: var(--accent-soft); color: var(--accent); }
.k-imp .crear-ic { background: var(--paper-sunken); color: var(--text-muted); }

/* Tú y buscador */
.menu-extra { margin-left: auto; color: var(--text-faint); font-size: 13px; }
.menu-extra + .chev { margin-left: 8px; }
.tu-buscar { margin: 14px 0 0; }
.buscar-campo input { font-size: 16px; }

/* ================= Bloque 9B · lavado de cara ================= */
:root { --radius-m: 18px; }
.card { border-radius: 20px; }
.list { border-radius: 20px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: 0; margin: 24px 2px 10px; }
.section-title .link { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.section-title .link .i { width: 14px; height: 14px; }
.section-title .hint { font-weight: 500; color: var(--text-faint); font-size: 12.5px; }
.pill { border-radius: 20px; }
.date-sep { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; color: var(--text); margin: 20px 6px 8px; }
.date-sep .pos { color: var(--income); font-weight: 600; } .date-sep .neg { color: var(--expense); font-weight: 600; }
.mov-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.mov-ic .i { width: 20px; height: 20px; }
.mov-ic.t-expense { background: var(--expense-soft); color: var(--expense); }
.mov-ic.t-income { background: var(--income-soft); color: var(--income); }
.mov-ic.t-savings { background: var(--savings-soft); color: var(--savings); }
.mov-ic.t-bill { background: var(--bill-soft); color: var(--bill); }
.mov-ic.t-debt { background: var(--paper-sunken); color: var(--debt); }
.row .ttl { font-weight: 600; }
.mov-tools { display: flex; gap: 8px; overflow-x: auto; margin: -2px 0 12px; scrollbar-width: none; }
.mov-tools::-webkit-scrollbar { display: none; }
.tool-btn { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); border-radius: 14px; padding: 9px 12px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.tool-btn .i { width: 18px; height: 18px; color: var(--accent); }
.tool-btn .badge-new { margin-left: 2px; }
/* metas con anillo */
.meta-cab { display: flex; align-items: center; gap: 14px; }
.anillo { flex: none; color: var(--text); }
.anillo-v { transition: stroke-dasharray .9s cubic-bezier(.2,.9,.25,1); }
.meta-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.meta-nom { font-weight: 700; font-size: 16px; }
.meta-cant { font-size: 13.5px; color: var(--text-muted); }
.estado-pill { font-size: 12px; font-weight: 700; border-radius: 9px; padding: 3px 9px; margin-top: 3px; }
.estado-pill.e-verde { background: var(--income-soft); color: var(--income); }
.estado-pill.e-amarillo { background: var(--accent-soft); color: var(--accent); }
.estado-pill.e-rojo { background: var(--expense-soft); color: var(--expense); }
.estado-pill.e-gris { background: var(--paper-sunken); color: var(--text-muted); }
/* patrimonio */
.pat-barra { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: 10px 0 8px; }
.pat-barra i { display: block; }
/* agenda: semana */
.semana { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.semana-flecha { width: 30px; height: 44px; border: none; background: none; color: var(--text-faint); display: grid; place-items: center; cursor: pointer; flex: none; }
.semana-flecha .i { width: 16px; height: 16px; }
.semana-dias { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dia { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); font: inherit; cursor: pointer; }
.dia .l { font-size: 11px; font-weight: 600; color: var(--text-faint); }
.dia b { font-size: 16px; }
.dia i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.dia i.con { background: var(--accent); }
.dia.hoy b { color: var(--accent); }
.dia.sel { background: var(--hero-bg); border-color: var(--hero-bg); color: #F4F1EA; }
.dia.sel .l { color: var(--hero-muted); } .dia.sel b { color: #F4F1EA; } .dia.sel i.con { background: #E7B577; }
.dia-col { width: 38px; flex: none; text-align: center; display: flex; flex-direction: column; line-height: 1.1; }
.dia-col b { font-size: 17px; } .dia-col span { font-size: 11px; color: var(--text-faint); }
.tu-grupo .section-title { margin-top: 20px; }

/* ================= Bloque 9C · microinteracciones ================= */
button, .row, .tappable, .chip, .pill, .dia, .prox-card { -webkit-tap-highlight-color: transparent; }
.btn, .chip, .pill, .chip-nav, .tool-btn, .crear-op, .crear-ticket, .tab, .tab-crear, .hero-tile, .hero-arrow, .icon-btn, .tb-avatar, .dia, .prox-card, .check-btn, .nov-dest-btn, .semana-flecha, .comp-toggle, .hero-main, .mov-flecha, .mov-per-lbl {
  transition: transform .42s cubic-bezier(.3,1.35,.5,1), background-color .22s ease, color .22s ease, box-shadow .22s ease, border-color .22s ease, opacity .22s ease;
}
:is(.btn, .chip, .pill, .chip-nav, .tool-btn, .crear-op, .crear-ticket, .tab, .hero-tile, .hero-arrow, .icon-btn, .tb-avatar, .dia, .prox-card, .nov-dest-btn, .semana-flecha, .comp-toggle, .mov-flecha, .mov-per-lbl):active { transform: scale(.955); transition-duration: .1s; transition-timing-function: ease-out; }
.crear-op:active, .prox-card:active, .crear-ticket:active { transform: scale(.97); }
.hero-main:active { transform: scale(.98); transition-duration: .08s; }
.tab-crear:active { transform: scale(.88); transition-duration: .08s; }
.row, .menu-item { transition: transform .36s cubic-bezier(.3,1.25,.5,1), background-color .18s ease; }
.row:active, .menu-item:active { transform: scale(.99); transition-duration: .1s; }
.tab.active .ic { animation: tab-pop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes tab-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: none; } }
body.crear-abierto .tab-crear { transform: rotate(135deg); background: var(--ink); color: var(--paper); box-shadow: none; }

/* entrada de cada sección: la página sube un poco y las barras se llenan */
main#content.entra > * { animation: entra .26s cubic-bezier(.22,1,.36,1) both; } /* 11/11: de .5 s a .26 s (más ágil) */
main#content.entra > *:nth-child(2) { animation-delay: .02s; } main#content.entra > *:nth-child(3) { animation-delay: .04s; }
main#content.entra > *:nth-child(4) { animation-delay: .06s; } main#content.entra > *:nth-child(n+5) { animation-delay: .07s; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes aparece { from { opacity: 0; } }
@keyframes crece { from { transform: scaleX(0); } to { transform: none; } }
@keyframes anillo { from { stroke-dasharray: 0 999; } }

/* cifra que rueda */
.hero-v.rueda-arriba { animation: rueda-arriba .5s cubic-bezier(.22,1,.36,1); }
.hero-v.rueda-abajo { animation: rueda-abajo .5s cubic-bezier(.22,1,.36,1); }
@keyframes rueda-arriba { from { transform: translateY(35%); opacity: 0; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes rueda-abajo { from { transform: translateY(-35%); opacity: 0; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }

/* aviso tipo isla (arriba) */
.toast {
  top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto !important; left: 50%;
  display: flex; align-items: center; gap: 10px; max-width: min(92%, 420px); text-align: left;
  background: var(--toast-bg, #14172A); color: #FFFFFF; padding: 8px 16px 8px 8px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(10,12,30,.35); transform: translate(-50%, -14px) scale(.82); opacity: 0;
  transition: transform .55s cubic-bezier(.3,1.3,.5,1), opacity .25s ease; z-index: 120;
}
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.toast.con-accion.show { pointer-events: auto; }
.toast-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast-ic .i { width: 14px; height: 14px; }
.toast-ic.ok { background: #2F7A57; color: #fff; } .toast-ic.aviso { background: #C97A2C; color: #fff; }
.toast-txt { opacity: 0; transition: opacity .2s ease .12s; }
.toast.show .toast-txt { opacity: 1; }
.toast-btn { border: none; background: none; color: #E7B577; font: inherit; font-weight: 800; padding: 4px 2px 4px 8px; cursor: pointer; white-space: nowrap; }
@media (min-width: 760px) { .toast { top: 18px; } }

/* selector deslizante */
.segmented.con-ind, .hero-seg.con-ind { position: relative; }
.seg-ind { position: absolute; left: 0; border-radius: 8px; background: var(--paper-raised); box-shadow: 0 1px 2px rgba(26,31,54,.08), 0 2px 8px rgba(26,31,54,.06); transition: transform .5s cubic-bezier(.3,1.25,.5,1), width .5s cubic-bezier(.3,1.25,.5,1); z-index: 0; pointer-events: none; }
.con-ind > button { transition: color .25s ease; }
.hero-seg .seg-ind { background: #F4F1EA; box-shadow: none; border-radius: 9px; }
.con-ind > button { position: relative; z-index: 1; }
.segmented.con-ind > button.active, .hero-seg.con-ind > button.active { background: transparent; box-shadow: none; }

/* completar tarea: el check se dibuja y el texto se tacha */
.check-btn.marcando { background: var(--income); border-color: var(--income); color: #fff; transform: scale(1.12); }
.check-btn.marcando .i path, .check-btn.marcando .i polyline { stroke-dasharray: 24; stroke-dashoffset: 24; animation: dibuja .35s ease forwards .05s; }
@keyframes dibuja { to { stroke-dashoffset: 0; } }
.row.hecha-anim .ttl { color: var(--text-faint); background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 0 55%; background-size: 0 1.5px; animation: tacha .35s ease forwards .1s; }
@keyframes tacha { to { background-size: 100% 1.5px; } }

/* deslizar movimientos */
.swipe { position: relative; overflow: hidden; background: var(--expense); border-radius: inherit; }
.swipe-acc { position: absolute; right: 0; top: 0; bottom: 0; display: flex; }
.swipe-acc button { width: 74px; border: none; color: #fff; font: inherit; font-size: 11.5px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.swipe-acc .i { width: 18px; height: 18px; }
.sw-dup { background: var(--bill); } .sw-del { background: var(--expense); }
.swipe-acc button { color: var(--on-solid); }
.swipe > .row { position: relative; z-index: 1; transition: transform .5s cubic-bezier(.3,1.2,.5,1), background-color .15s; }
.swipe-acc button { transition: opacity .25s ease; } .swipe:not(.abierta) .swipe-acc button { opacity: .7; }
.swipe.abierta > .row { box-shadow: 6px 0 16px rgba(26,31,54,.14); }

/* confeti */
.confeti { position: fixed; width: 9px; height: 9px; border-radius: 2px; z-index: 130; pointer-events: none; }

/* esqueleto de carga */
.esqueleto { display: flex; flex-direction: column; gap: 12px; }
.sk { border-radius: 18px; background: linear-gradient(100deg, var(--paper-sunken) 30%, var(--paper-raised) 50%, var(--paper-sunken) 70%); background-size: 300% 100%; animation: brillo 1.3s ease-in-out infinite; }
.sk-hero { height: 196px; border-radius: 26px; } .sk-t { height: 16px; width: 40%; border-radius: 8px; margin-top: 8px; }
.sk-fila { display: flex; gap: 10px; } .sk-card { height: 92px; flex: 1; } .sk-lista { height: 180px; }
.loading-txt { text-align: center; font-size: 12.5px; color: var(--text-faint); }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: 0 0; } }

.row.futuro { opacity: .45; }

/* ================= Parche 3b · gráficos y Movimientos mes a mes ================= */
/* inversiones: Valor / Rentabilidad */
.tr-modo { margin: 0 0 12px; }
.tr-modo button { font-size: 12.5px; padding: 7px 4px; }
.tr-cero { position: absolute; right: 0; transform: translateY(-120%); font-size: 10.5px; color: var(--text-faint); pointer-events: none; }
.tr-big { transition: color .25s ease; }

/* presupuesto por categoría: misma escala y marca de presupuesto */
.pbar { position: relative; height: 8px; border-radius: 5px; background: var(--paper-sunken); }
.pbar i { position: absolute; top: 0; bottom: 0; display: block; border-radius: 5px; }
.pb-f { left: 0; background: var(--accent); }
.pb-over { background: var(--expense); border-radius: 0 5px 5px 0 !important; }
.budget-row.over .pb-f { border-radius: 5px 0 0 5px; }
.pb-tick { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--paper-raised); }
.pb-resto { display: block; text-align: right; font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.pb-resto.neg { color: var(--expense); font-weight: 600; }
.budget-row.cero .cat, .budget-row.cero .nums { color: var(--text-faint); }

/* Movimientos: mes a mes */
.mov-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--paper-raised); border: 1px solid var(--line); border-radius: 20px; padding: 6px 6px 6px 4px; margin: 0 0 12px; }
.mov-per { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mov-flecha { width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.mov-flecha:not(:disabled):hover { background: var(--paper-sunken); }
.mov-flecha:disabled { opacity: .25; cursor: default; }
.mov-flecha .i { width: 18px; height: 18px; }
.mov-nav.todo .mov-flecha { display: none; }
.mov-nav.todo .mov-per-lbl { padding-left: 12px; }
.mov-per-lbl { border: none; background: none; font: inherit; color: var(--text); text-align: left; padding: 2px 4px; cursor: pointer; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.mov-per-lbl b { font-family: var(--font-display); font-size: 19px; font-weight: 600; white-space: nowrap; }
.mov-modo { flex: none; width: auto; }
.mov-modo button { font-size: 12.5px; padding: 7px 11px; }
.buscar-todo { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.desde-der { animation: desde-der .42s cubic-bezier(.22,1,.36,1) both; }
.desde-izq { animation: desde-izq .42s cubic-bezier(.22,1,.36,1) both; }
@keyframes desde-der { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes desde-izq { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ================= Pruebas de uso (12/10) ================= */
/* Guardar siempre a mano: la barra de botones de los formularios se queda pegada abajo */
.sheet .actions.fija { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); z-index: 3; background: var(--paper);
  margin: 18px -20px 0; padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 16px -12px rgba(0,0,0,.18); }

/* Zonas de toque de al menos ~44 px sin cambiar cómo se ven */
.check-btn { width: 30px; height: 30px; position: relative; }
.check-btn::after, .sheet-x::after, .hero-arrow::after, .icon-btn::after, .semana-flecha::after, .mov-flecha::after { content: ''; position: absolute; inset: -8px; }
.sheet-x { width: 36px; height: 36px; top: 8px; right: 10px; }
.hero-arrow, .icon-btn, .semana-flecha, .mov-flecha { position: relative; }
button.link { position: relative; }
button.link::after { content: ''; position: absolute; inset: -10px -6px; }
.pill, .chip, .chip-nav { position: relative; }
.pill::after, .chip::after { content: ''; position: absolute; inset: -6px -2px; }
.segmented button { min-height: 36px; }
.hero-seg button { min-height: 32px; }
.dia { min-width: 40px; }

/* Móviles pequeños (iPhone SE) */
.type-toggle button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .type-toggle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.anio-fila .col { min-width: 88px; text-align: right; }
.anio-fila .mes-c { display: none; }
@media (max-width: 380px) { .anio-fila .col { min-width: 74px; } .anio-fila .mes-l { display: none; } .anio-fila .mes-c { display: inline; } }

/* Etiqueta NUEVO del selector de mes: como pegatina en la esquina */
.mov-nav { position: relative; }
.mov-per-lbl > span { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.mov-per-lbl span.badge-new { position: absolute; top: -8px; left: 14px; margin: 0; }

/* Lo próximo: títulos en dos líneas */
.prox-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }

/* Empieza aquí (usuario nuevo) */
.empieza { background: var(--paper-raised); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-top: 14px; }
.empieza h3 { font-family: var(--font-display); font-size: 19px; margin: 0 0 4px; }
.empieza p { margin: 0 0 12px; font-size: 13.5px; color: var(--text-muted); }
.empieza-paso { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: var(--paper-sunken); border-radius: 14px; padding: 12px; margin-top: 8px; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.empieza-paso .n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.empieza-paso b { display: block; font-size: 14.5px; }
.empieza-paso span.d { font-size: 12.5px; color: var(--text-muted); }
.empieza-paso .chev-s { margin-left: auto; }
.pat-row { min-height: 40px; }
.btn.sm { min-height: 36px; }
.legend .tappable { padding: 6px 2px; margin: -6px 0; }
.mov-per-lbl b { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 370px) {
  .mov-nav { gap: 6px; }
  .mov-flecha { width: 32px; }
  .mov-per-lbl b { font-size: 16.5px; }
  .mov-modo button { padding: 7px 8px; }
}
@media (max-width: 350px) { .mov-per-lbl .mes-l { font-size: 0; } .mov-per-lbl .mes-l::after { content: attr(data-c); font-size: 16.5px; } }
.mov-per { flex: 1 1 auto; }
.mov-per-lbl { flex: 1 1 auto; }
.mov-per-lbl b { font-size: 18px; }
@media (max-width: 380px) { .mov-nav { gap: 6px; } .mov-flecha { width: 32px; } .mov-modo button { padding: 7px 8px; } .mov-per-lbl b { font-size: 17px; } }

/* ================= Categorías estándar (12/10) ================= */
.fijo-seg { margin-top: 8px; }
.chip-pers { color: var(--accent); font-weight: 800; margin-right: 4px; }
.chip-mas { border-style: dashed; color: var(--text-muted); }
.cat-aviso { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text-muted); font-size: 12.5px; line-height: 1.4; }
.cat-aviso .i { color: var(--accent); flex: none; margin-top: 1px; }
.cat-aviso.fuerte { background: var(--expense-soft); }
.cat-aviso.fuerte .i { color: var(--expense); }
.sub-row { padding-top: 0; }
.pres-mas { display: block; margin: 12px auto 0; text-align: center; }
.cat-std-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); }
.cat-std-row:last-child { border-bottom: none; }
.cat-std-row .mov-ic { width: 32px; height: 32px; }
.cat-std-row .cn { flex: 1; min-width: 0; }
.cat-std-row .cn b { display: block; font-size: 14.5px; font-weight: 600; }
.cat-std-row .cn span { font-size: 12px; color: var(--text-faint); }
.cat-std-row input.amt { width: 92px; flex: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--paper-raised); color: var(--text); font-size: 14px; text-align: right; }
.cat-std-row .rm { flex: none; }
.cat-std-row input.cn-in { flex: 1; min-width: 0; border: none; background: none; font-size: 14.5px; font-weight: 600; color: var(--text); padding: 6px 2px; }
/* cabecera de novedades: colores fijos para que el texto blanco se lea también en oscuro */
.nov-hero { background: linear-gradient(135deg, #9A5F1F, #6E4FA0); }

/* ================= Metas híbridas (13/10) ================= */
.meta-card { margin-bottom: 12px; }
.meta-card.conseguida { border-color: var(--income); box-shadow: 0 0 0 2px var(--income-soft); }
.meta-nom .obj-grupo { font-size: 11.5px; vertical-align: middle; }
.meta-barra { position: relative; height: 10px; border-radius: 6px; background: var(--paper-sunken); margin: 14px 0 6px; }
.meta-barra .mb-f { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.hito-m { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--paper-raised); }
.hito-m.ok { background: var(--income); }
.hitos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.hito { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--paper-sunken); color: var(--text-muted); }
.hito.ok { background: var(--income-soft); color: var(--income); }
.meta-sig { font-size: 13px; color: var(--text-muted); margin: 6px 0 2px; }
.meta-comp { margin: 10px 0 4px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; }
.meta-comp > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meta-comp span { color: var(--text-muted); }
.meta-comp em { font-style: normal; font-weight: 700; }
.meta-txt { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.meta-txt b { color: var(--text); }
.meta-acc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meta-cab { position: relative; padding-right: 40px; }
.meta-edit { position: absolute; top: -4px; right: -6px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.meta-edit:hover, .meta-edit:focus-visible { background: var(--paper-sunken); color: var(--text); }
.meta-edit .i { width: 18px; height: 18px; }
.meta-usos { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 4px; }
.meta-usos > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.hito-row .rm { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.hito-row .rm:hover, .hito-row .rm:focus-visible { background: var(--paper-sunken); color: var(--expense); }
.hito-row .rm .i { width: 18px; height: 18px; }
.uso-gasto { display: flex; gap: 10px; align-items: center; margin: 4px 0 6px; font-size: 14px; }
.asig-row small { display: block; color: var(--accent); font-size: 11.5px; }

/* Vista por hito (13/10) */
.meta-vista { display: inline-flex; gap: 2px; background: var(--paper-sunken); border-radius: 999px; padding: 3px; margin: 12px 0 2px; }
.meta-vista button { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 650; padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.meta-vista button.on { background: var(--paper-raised); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.meta-hito-nom { font-size: 13.5px; font-weight: 650; color: var(--text); margin-top: 2px; }
.meta-hito-nom span { font-weight: 500; color: var(--text-faint); }
.hitos button.hito { font-family: inherit; line-height: 1.3; cursor: pointer; border: 1px solid transparent; }
.hitos button.hito.activo { border-color: var(--accent); color: var(--accent); }
.meta-resumen { display: flex; width: 100%; align-items: center; gap: 4px; justify-content: flex-start; margin-top: 10px; padding: 9px 12px; border-radius: 12px; border: 0; background: var(--paper-sunken); color: var(--text-muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.meta-resumen b { color: var(--text); }
.meta-resumen .i { width: 14px; height: 14px; margin-left: auto; }
.hito-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.hito-row .hn { grid-column: 1 / -1; }
.hito-row input.amt, .hito-row .hf { flex: none; width: 100%; min-width: 0; }

/* Arreglos rápidos de la fase 1 (13/10) */
.amt.sav, .date-sep .sav { color: var(--savings); }
.sav-flecha { font-weight: 600; }
.tema-seg { margin-left: auto; flex: none; }
.tema-seg button { padding: 6px 9px; font-size: 13px; }
.menu-item.static { flex-wrap: wrap; row-gap: 8px; }
.hero-tile { justify-content: space-between; }
.hero-tile .l { line-height: 1.2; }

/* Pruebas de uso simuladas (13/10) */
.importe-grande { font-size: 22px !important; font-weight: 650; font-variant-numeric: tabular-nums; }
.edit-aviso { font-size: 12.5px; color: var(--text-muted); background: var(--paper-sunken); border-radius: 10px; padding: 8px 10px; margin: -4px 0 12px; line-height: 1.4; }
.mov-add-ctx { margin: 0 0 10px; }
.pb-pie { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 3px; }
.pb-pie .pb-resto { margin: 0; }
.pb-edit { font-size: 12.5px; }
.buscar-total { font-size: 13px; color: var(--text-muted); margin: -2px 0 8px; }
.empieza-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.empieza-cab .link { font-size: 12.5px; }
.amigos-sel { display: grid; gap: 6px; }
.chip-nueva { border-style: dashed !important; }
.field.falta { animation: falta .5s ease 2; border-radius: 12px; box-shadow: 0 0 0 2px var(--expense); }
@keyframes falta { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .field.falta { animation: none; } }
.pb-edit.sin { color: var(--text-faint); font-weight: 500; }

.asig-todas{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px}.asig-todas small{color:var(--text-faint);font-size:12px}

/* ===== Fase 2 · prueba de estructura (14/10) ===== */
.estr-aviso { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-muted); background: var(--accent-soft); border-radius: 10px; padding: 7px 12px; margin: 0 0 12px; }
.estr-aviso b { color: var(--text); }
.estr-aviso .link { font-size: 12.5px; font-weight: 700; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; }
.estr-intro { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: -4px 0 12px; }
.estr-opc { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--paper-raised); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.estr-opc b { font-size: 15px; }
.estr-opc > span { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.estr-opc.on { border-color: var(--accent); background: var(--accent-soft); }
.estr-ya { font-size: 11px; font-weight: 700; color: var(--accent); margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }
.inicio-seg, .mov-vista { margin-bottom: 14px; }
.card.aten { padding: 4px; margin-bottom: 10px; }
.aten-fila { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: none; border-radius: 10px; padding: 10px; cursor: pointer; }
.aten-fila + .aten-fila { border-top: 1px solid var(--line); border-radius: 0; }
.aten-main { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; background: none; border: none; font: inherit; color: inherit; text-align: left; padding: 0; cursor: pointer; }
.aten-main > svg.i { font-size: 18px; flex: none; color: var(--accent); }
.aten-fila.mal .aten-main > svg.i { color: var(--expense); }
.aten-fila.juntos .aten-main > svg.i { color: var(--savings); }
.aten-btns { display: flex; gap: 6px; flex: none; }
.aten-fila.mas .aten-main > svg.i { display: none; }
.aten-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.aten-t b { font-size: 14px; }
.aten-t span { font-size: 12.5px; color: var(--text-muted); }
.resumen-link { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; margin-top: 18px; cursor: pointer; }
.resumen-link > svg.i { font-size: 20px; color: var(--accent); flex: none; }
.resumen-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.resumen-link b { font-size: 14.5px; }
.resumen-link > span > span { font-size: 12.5px; color: var(--text-muted); }
.pat-mini { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 14px; cursor: pointer; }
.pat-mini .l { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.pat-mini b { font-size: 17px; }
.pat-mini .pat-barra { grid-column: 1 / -1; margin: 4px 0 0; }
.juntos-cab { margin-bottom: 4px; }
.juntos-acc { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.juntos-acc .btn { flex: 1; min-width: 140px; }
.amigos-fila { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.amigos-fila::-webkit-scrollbar { display: none; }
.amigo-av { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: none; font: inherit; color: var(--text); cursor: pointer; padding: 0; flex: none; min-width: 52px; }
.amigo-av .avatar { width: 44px; height: 44px; font-size: 14px; }
.amigo-av > span:last-child { font-size: 12px; color: var(--text-muted); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.juntos-cab .comp-total.vacio { font-size: 17px; font-family: var(--font-ui); font-weight: 600; color: var(--text-muted) !important; }
.juntos-acc .btn { white-space: nowrap; }
.inicio-seg button { font-size: 12.5px; }
.juntos-acc .btn { flex: 1 1 0; min-width: 0; padding: 10px 8px; font-size: 13.5px; justify-content: center; }
.resumen-link + .resumen-link { margin-top: 8px; }

/* iPhone/Android: un campo con letra menor de 16 px hace que el navegador amplíe la pantalla al tocarlo (Paloma, 14/10) */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea,
  .config-list input, .tk-row input, .cat-std-row input.amt, .cat-std-row input.cn-in, .comp-row input.comp-val,
  .field .regla-box input[type=text], .regla-box input[type=text], .imp-file select, .imp-sels select, .imp-map select { font-size: 16px !important; }
  .tk-row input { padding: 9px 8px; }
  .cat-std-row input.amt { width: 100px; }
}

/* tareas: categorías como chips */
.tcat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.sugerida { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.chip.nueva { border-style: dashed; }
.tcat-nueva { display: flex; gap: 8px; margin-top: 8px; }
.tcat-nueva input { flex: 1; min-width: 0; }

/* ticket: unidades por persona e invitar sin salir */
.tk-unid { display: block; }
.un-cab { font-size: 12px; color: var(--text-muted); margin: 2px 0 4px; }
.un-fila { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.un-fila .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.un-b { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-raised); font-size: 18px; line-height: 1; color: var(--text); cursor: pointer; }
.un-v { min-width: 34px; text-align: center; }
.un-v.libre { color: var(--text-faint); font-weight: 500; }
.un-auto { width: 34px; font-size: 11px; color: var(--accent); }
.inv-inline { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* Inicio sin scroll: en pantallas bajitas se aprieta un poco el resumen */
@media (max-height: 760px) {
  .hero { padding: 12px 14px 12px; gap: 8px; border-radius: 22px; }
  .hero-v { font-size: 36px; }
  .inicio-seg { margin-bottom: 10px; }
  .prox-card { padding: 10px; }
}
@media (max-height: 700px) {
  .hero { padding: 10px 12px 10px; gap: 6px; }
  .hero-v { font-size: 30px; }
  .hero-tile { padding: 6px 8px; }
  .hero-tile .l { font-size: 11px; }
  .hero-bar { height: 6px; }
  .inicio-seg button { white-space: nowrap; padding-left: 4px; padding-right: 4px; font-size: 12px; }
  .inicio-seg { margin-bottom: 8px; }
  #content .section-title { margin-top: 12px; margin-bottom: 6px; }
  .aten-fila { padding: 7px 8px; }
  .prox-card { width: 150px; padding: 8px 10px; }
}

/* ===== Fase 3 · animaciones que esperan a que las veas (IntersectionObserver) =====
   El JS marca barras, aros y gráficos con .va-*; .visto arranca la animación cuando entran en pantalla y
   .ya significa «esto ya lo viste en esta visita»: se pinta tal cual, sin repetir. Sin JS o con «reducir movimiento», todo se ve ya. */
.va-bar { transform-origin: left center; }
.va-bar:not(.visto):not(.ya) { transform: scaleX(0); }
.va-bar.visto:not(.ya) { animation: crece 1s cubic-bezier(.22,1,.36,1) both; }
.va-fade:not(.visto):not(.ya) { opacity: 0; }
.va-fade.visto:not(.ya) { animation: aparece .5s ease both; }
.va-ring:not(.visto):not(.ya) { stroke-dasharray: 0 999; opacity: 0; }
.va-ring.visto:not(.ya) { animation: anillo 1.1s cubic-bezier(.2,.9,.25,1) both; }
.va-pop:not(.visto):not(.ya) { opacity: 0; transform: scale(.86) rotate(-14deg); }
.va-pop.visto:not(.ya) { animation: pop-entra .8s cubic-bezier(.3,1.25,.5,1) both; }
@keyframes pop-entra { from { opacity: 0; transform: scale(.86) rotate(-14deg); } to { opacity: 1; transform: none; } }
.va-up:not(.visto):not(.ya) { opacity: 0; transform: translateY(14px); }
.va-up.visto:not(.ya) { animation: entra .6s cubic-bezier(.22,1,.36,1) both; }
.pb-over.va-fade.visto { animation-delay: .35s; }

/* Ajustes → Aspecto y sensaciones */
.asp-sec { margin-bottom: 20px; }
.asp-pal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.asp-sw { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper-raised); font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: transform .4s cubic-bezier(.3,1.35,.5,1), border-color .2s ease; }
.asp-sw:active, .asp-tp:active { transform: scale(.95); }
.asp-sw i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.asp-sw i svg { width: 16px; height: 16px; opacity: 0; transform: scale(.4); transition: opacity .2s ease, transform .4s cubic-bezier(.3,1.35,.5,1); }
.asp-sw.on { border-color: var(--accent); color: var(--text); }
.asp-sw.on i svg { opacity: 1; transform: none; }
.asp-tipos { display: grid; gap: 8px; }
.asp-tp { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper-raised); font: inherit; color: var(--text); cursor: pointer; text-align: left; transition: transform .4s cubic-bezier(.3,1.35,.5,1), border-color .2s ease, background-color .2s ease; }
.asp-tp.on { border-color: var(--accent); background: var(--accent-soft); }
.asp-tp .n { font-family: var(--asp-f, var(--font-display)); font-size: 22px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.asp-tp .l { font-size: 12.5px; color: var(--text-muted); text-align: right; }
.asp-fila { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.asp-fila:last-child { border-bottom: none; }
.asp-fila .t { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.asp-fila .t span { display: block; font-weight: 500; font-size: 12.5px; color: var(--text-muted); margin-top: 1px; line-height: 1.35; }
.asp-nota { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; background: var(--paper-sunken); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
html:not([data-look="nuevo"]) .asp-solo-nuevo { display: none; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; border: none; background: var(--paper-sunken); flex: none; cursor: pointer; padding: 0; transition: background-color .25s ease; box-shadow: inset 0 0 0 1px var(--line); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.switch.on { background: var(--accent); box-shadow: none; }
.switch.on::after { transform: translateX(20px); }
/* conmutador oculto para el «toque» de iPhone */
#haptico { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.cuenta-espera { opacity: 0; }
/* al cambiar de paleta o de estilo, los colores se funden en vez de saltar */
html.cambiando *, html.cambiando *::before, html.cambiando *::after { transition: background-color .45s ease, color .45s ease, border-color .45s ease, box-shadow .45s ease, fill .45s ease, stroke .45s ease !important; }

/* Cuentas y saldos: lista y hoja de cada cuenta */
.cuentas-lista .cuenta-fila { padding: 13px 14px; }
.cuentas-lista .cuenta-fila + .cuenta-fila { border-top: 1px solid var(--line); }
.cuentas-lista .cuenta-fila .chev-s { margin-left: 6px; color: var(--text-faint); }
.cuenta-ed .field select { width: 100%; font-size: 15px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--text); }
.cuenta-ed .cuenta-colores { display: flex; flex-wrap: wrap; gap: 10px; }
.cuenta-ed .cuenta-color { width: 30px; height: 30px; }
.cuenta-ajustes { padding: 0; margin-top: 6px; }
.cuenta-ajuste { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 14px; }
.cuenta-ajuste + .cuenta-ajuste { border-top: 1px solid var(--line); }
.cuenta-ajuste .chip { flex: none; margin: 0; }

/* Ventana emergente (confirmaciones), centrada encima de la hoja */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(10,12,24,.5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .15s ease;
}
.popup-backdrop.open { opacity: 1; }
.popup {
  background: var(--paper); color: var(--text); width: 100%; max-width: 360px; border-radius: 18px;
  padding: 20px 18px 16px; box-shadow: var(--shadow); border: 1px solid var(--line); transform: scale(.96); transition: transform .15s ease;
}
.popup-backdrop.open .popup { transform: scale(1); }
.popup h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.popup p { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: var(--text-muted); }
.popup-btns { display: flex; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .popup-backdrop, .popup { transition: none; } }

/* Personas sin cuenta y administradores en un grupo */
.miembro-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.miembro-acc .btn.sm { padding: 6px 10px; font-size: 12.5px; }
.sc-enlace { margin-top: 10px; }
.tag-sincuenta { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--paper-sunken); color: var(--text-muted); }
.row.sin-cuenta .avatar { opacity: .85; box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 1.5px var(--text-faint); }
.sc-anadir { margin-top: 10px; }
.sc-anadir input { flex: 1; min-width: 0; }
.seg-mini { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-mini .chip { margin: 0; }
.miembro-fila .avatar { align-self: flex-start; margin-top: 2px; }

/* ---- Inicio (fase 4): tarjeta «Te queda este mes» y «Estos días» ---- */
.hero2 { gap: 8px; padding: 14px 18px 12px; }
.mes-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; border: none; font: inherit; font-size: 13px; color: inherit; background: var(--hero-tile); border-radius: 999px; padding: 6px 10px 6px 12px; cursor: pointer; }
.mes-pill span { opacity: .85; }
.mes-pill-ic { display: inline-flex; } .mes-pill-ic .i { width: 13px; height: 13px; transform: rotate(90deg); }
.hero2 .hero-main { margin-top: 4px; }
.hero-v small { font-size: .5em; font-weight: inherit; letter-spacing: 0; }
.hero-v.vacio { opacity: .5; }
.hero-nuevo { margin: 0; font-size: 14px; line-height: 1.45; color: var(--hero-muted); }
.hero-prev { display: flex; align-items: center; gap: 8px; width: 100%; border: 1.5px dashed rgba(255,255,255,.45); background: none; color: inherit; font: inherit; font-size: 14px; border-radius: 14px; padding: 9px 12px; cursor: pointer; text-align: left; }
.hero-prev .prev-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.7); border-radius: 6px; padding: 1px 6px; }
.hero-prev .prev-l { opacity: .85; }
.hero-prev b { margin-left: auto; font-weight: 700; }
.hero-prev .i { width: 14px; height: 14px; opacity: .7; }
.hero2 .hero-cuentas { border-top: 1px solid rgba(255,255,255,.18); padding-top: 12px; padding-bottom: 2px; justify-content: space-between; }
.hero2 .hero-cuentas b { margin-left: auto; }
.dias-tit { display: flex; align-items: center; justify-content: space-between; }
.dias-tit .link { display: inline-flex; align-items: center; gap: 2px; }
.dias-tit .link .i { width: 14px; height: 14px; }
.dias-lista { padding: 0; overflow: hidden; }
.dia-fila { display: flex; align-items: center; }
.dia-fila + .dia-fila { border-top: 1px solid var(--line); }
.dia-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: none; font: inherit; color: inherit; text-align: left; padding: 11px 14px; cursor: pointer; }
.dia-ic, .dia-fecha { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-sunken); color: var(--text-muted); }
.dia-ic .i { width: 18px; height: 18px; }
.dia-fila.rec .dia-ic { background: var(--accent-soft); color: var(--accent); }
.dia-fila.mal .dia-ic { background: color-mix(in srgb, var(--expense) 16%, transparent); color: var(--expense); }
.dia-fila.warn .dia-ic { background: color-mix(in srgb, #F29A2E 18%, transparent); color: #C97A12; }
.dia-fila.juntos .dia-ic { background: var(--accent-soft); color: var(--accent); }
.dia-fecha { display: flex; flex-direction: column; justify-content: center; gap: 0; line-height: 1; }
.dia-fecha i { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--text-faint); }
.dia-fecha b { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 2px; }
.dia-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dia-t b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dia-t > span { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dia-btns { display: flex; gap: 6px; padding-right: 12px; flex: none; }
.dia-btns .btn.sm { min-height: 38px; padding: 0 13px; }
.dias-mas { width: 100%; border: none; border-top: 1px solid var(--line); background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); padding: 12px; cursor: pointer; }
.dias-vacio { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); }
.dias-vacio .i { width: 18px; height: 18px; color: var(--income); }
.info-card { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.45; }
.info-card b { display: block; margin-bottom: 2px; }
.info-card .link { flex: none; align-self: center; }
.info-ic { flex: none; color: var(--accent); } .info-ic .i { width: 18px; height: 18px; }
.prev-lista { padding: 0; overflow: hidden; margin-bottom: 12px; }
.prev-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 14px; }
.prev-fila + .prev-fila { border-top: 1px solid var(--line); }
.prev-fila div { display: flex; flex-direction: column; gap: 2px; }
.prev-fila div span { font-size: 12.5px; color: var(--text-muted); }
.prev-fila .pos { color: var(--income); } .prev-fila .neg { color: var(--expense); }
.prev-fila.total { background: var(--paper-sunken); font-size: 15px; }
.tumes-op { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: var(--paper-raised); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; font: inherit; color: inherit; cursor: pointer; }
.tumes-op.on { border-color: var(--accent); background: var(--accent-soft); }
.tumes-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-faint); margin-top: 1px; }
.tumes-op.on .tumes-radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--paper-raised); background: var(--accent); }
.tumes-txt { display: flex; flex-direction: column; gap: 3px; }
.tumes-txt b { font-size: 15px; }
.tumes-txt span { font-size: 13px; color: var(--text-muted); }
.tumes-dia { margin: -2px 0 10px; }
.kpi-row.kpi-mes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi.sav .v { color: var(--savings); } .kpi.debt .v { color: var(--debt, var(--expense)); }
/* Trayecto (docs/31) */
.k-tray .crear-ic { background: var(--paper-sunken); color: var(--text-muted); }
.tr-intro { margin-top: -4px; }
.tr-seg { margin: 6px 0 10px; }
.tr-sitios .field { margin-bottom: 8px; }
.tr-km { display: flex; align-items: center; gap: 8px; }
.tr-km input { flex: 1; min-width: 0; }
.tr-km span { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.tr-prods { margin-top: 6px; }
.tr-precio-f { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-pers { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.tr-pers b { min-width: 24px; text-align: center; font-size: 17px; }
.tr-res { margin: 12px 0 6px; padding: 14px 16px; border-radius: 16px; background: var(--paper-sunken); text-align: center; }
.tr-res.vacio { color: var(--text-muted); font-size: 13.5px; }
.tr-res-l { font-size: 12.5px; color: var(--text-muted); }
.tr-res-n { font-size: 28px; font-weight: 700; margin: 2px 0; }
.tr-res-d { font-size: 13px; color: var(--text-muted); }
.tr-guardar { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.tr-guardar .field { flex: 1; margin: 0; }
.tr-guardar-l { display: inline-flex; gap: 6px; align-items: center; margin: 4px 0; }
.tr-acc { flex-wrap: wrap; }
.tr-acc #trRes { flex-basis: 100%; }
.tr-acc .tr-res { margin: 0 0 8px; padding: 8px 12px; }
.tr-acc .tr-res-n { font-size: 22px; }
/* Trayecto v2: tres pasos */
.tr-paso { margin: 4px 0 16px; }
.tr-paso-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.tr-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; background: var(--paper-sunken); color: var(--text-muted); }
.tr-kmfila { display: flex; gap: 8px; align-items: center; }
.tr-kmfila .tr-km { flex: 1; margin: 0; }
.tr-vuelta { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tr-vuelta svg, .tr-link svg, .tr-rep svg { width: 15px; height: 15px; }
.tr-link { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }
.tr-rep { margin-bottom: 8px; }
.tr-sitios { margin-top: 10px; }
.tr-coche { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line, rgba(127,127,127,.25)); background: transparent; color: inherit; text-align: left; font: inherit; }
.tr-coche-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-coche-t small { color: var(--text-muted); font-size: 12.5px; }
.tr-cambiar { color: var(--accent, currentColor); font-size: 13.5px; font-weight: 600; }
.tr-sub { font-size: 13px; color: var(--text-muted); margin: 10px 0 4px; }
.tr-listo { margin-top: 8px; }
.tr-pers-f { display: flex; justify-content: space-between; align-items: center; }
.tr-pers-f .tr-paso-t { margin: 0; }
.tr-pers-f .tr-pers { margin: 0; }

/* Logo de PalomApp (11/11, opción 7DA): alas y moneda sin el cuadrado; las alas toman el color del texto. */
.marca-ico { display: block; color: var(--text, #16205A); overflow: visible; }
.marca-login { margin: 4px auto 16px; }
.marca-ob { margin: 2px 0 18px; }
.rail .brand .marca-rail { margin: 0 0 10px; }

/* 11/11 · Avisos (docs/39): tarjeta de Inicio y hoja de Tú */
.av-card { padding: 14px 16px; margin-bottom: 14px; }
.av-cab { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.av-cab .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, #6D3FE0) 14%, transparent); color: var(--accent, #6D3FE0); flex: none; }
.av-cab b { display: block; font-size: 15px; }
.av-cab span { display: block; font-size: 12.5px; color: var(--text-faint); line-height: 1.35; }
.av-fila { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, rgba(127,127,127,.18)); }
.av-txt { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.av-txt b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-txt span { display: block; font-size: 12px; color: var(--text-faint); }
.av-imp { font-size: 14px; white-space: nowrap; }
.av-imp.neg { color: var(--expense, #D93B3B); } .av-imp.pos { color: var(--income, #1E9E62); }
.av-borrar { flex: none; min-width: 40px; min-height: 40px; }
.av-mas { font-size: 12.5px; color: var(--text-faint); padding: 6px 0 2px; }
.av-card .btn.block { margin-top: 10px; }
.av-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.av-opt + .av-opt { border-top: 1px solid var(--line, rgba(127,127,127,.18)); }
.av-opt b { display: block; font-size: 14.5px; } .av-opt span { display: block; font-size: 12.5px; color: var(--text-faint); }
.av-explica b:first-child { display: block; font-size: 15px; line-height: 1.35; margin-bottom: 8px; }
.av-explica ul { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.av-explica li { margin-bottom: 4px; }
.av-nota { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0 10px; color: var(--text-faint); }
