@import url("capture-guide.css");
@import url("pinni-missions.css");
/* La misma tipografía en Web y MAUI, también sin conexión a Google Fonts. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins/Poppins-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins/Poppins-Bold.ttf') format('truetype'); }

.nido-icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }

/* ── Design tokens ────────────────────────────────────── */
:root {
  --crema:       #F6F3ED;
  --arena:       #E3DED4;
  --arena-ui:    #8D867D;
  --salvia:      #A8BBA0;
  --salvia-mid:  #789274;
  --salvia-deep: #52644D;
  --salvia-light:#EDF2E8;
  --terra:       #C98F7A;
  --terra-deep:  #8D6455;
  --terra-light: #FAF0EC;
  --grafito:     #374035;
  --muted:       #6F7269;
  --white:       #FFFDF9;
  --danger:      #A4473C;
  --danger-light:#FAECE7;
  --warning:     #8A6320;
  --warning-light:#F6ECD8;
  --success:     var(--salvia-deep);
  --success-light:#EAF2E8;

  /* Roles that differ in the dark theme (P65); in the light theme they keep the old values. */
  --on-accent:   #FFFDF9; /* Text on accent fills, buttons and the green headers. */
  --accent-strong: #52644D; /* Accent fills (primary buttons); --salvia-deep stays the accent text. */
  --terra-strong:  #8D6455;
  --ink-strong:  #374035; /* Dark pills (active filter chip). */
  --on-ink:      #FFFDF9;
  --danger-tint: #FCF1ED;
  --danger-tint-strong: #F2DAD1;
  --ai-card-from:#F0F3E8;
  --ai-card-to:  #F8F9F3;
  --track:       #E9E8DF;
  --neutral-soft:#f5f4f2;
  --switch-off:  #d8d4cf;
  --neutral-chip:#EEE;
  --neutral-plan:#f2f0ed;
  --line:        #E5E1D8;
  color-scheme: light;

  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   18px;
  --radius-xl:   24px;

  --shadow-card: 0 5px 22px rgba(68,77,57,0.06), 0 1px 3px rgba(68,77,57,0.03);
  --shadow-btn:  0 4px 16px rgba(91,111,88,0.30);

  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --nido-visual-viewport-height: 100dvh;
  --nido-visual-viewport-top: 0px;
  --nido-keyboard-overlay-inset: 0px;
  --nido-keyboard-height: 0px;
  --nido-keyboard-fallback-inset: 0px;
  /* The bottom bar's real height: border, padding, item height and safe area (see .bottom-nav). */
  --nido-bottom-nav-height: calc(61px + max(14px, calc(10px + var(--safe-area-bottom))));
}
/*
 * Dark theme (P65): the same tokens, darker. "dark" chosen in Preferences, or "system" (no
 * data-theme) on a device in dark mode; "light" always wins. Illustrations keep their colours.
 */
:root[data-theme="dark"] {
  --crema:       #171C17;
  --arena:       #2E352D;
  --arena-ui:    #6F786B;
  --salvia:      #7E9576;
  --salvia-mid:  #8FAA88;
  --salvia-deep: #B5CBA9;
  --salvia-light:#232C22;
  --terra:       #C98F7A;
  --terra-deep:  #E0AE9B;
  --terra-light: #33261F;
  --grafito:     #E7E9E1;
  --muted:       #A3A79C;
  --white:       #212720;
  --danger:      #EE8D80;
  --danger-light:#3A2420;
  --warning:     #E3B866;
  --warning-light:#362C18;
  --success-light:#22301F;
  --shadow-card: 0 5px 22px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
  --shadow-btn:  0 4px 16px rgba(0,0,0,0.35);
  --accent-strong: #4F6A49;
  --terra-strong:  #9C6B5A;
  --ink-strong:  #E7E9E1;
  --on-ink:      #171C17;
  --danger-tint: #3A2420;
  --danger-tint-strong: #4A2C26;
  --ai-card-from:#222B21;
  --ai-card-to:  #1E241D;
  --track:       #2E352D;
  --neutral-soft:#2A302A;
  --switch-off:  #4A5148;
  --neutral-chip:#2E352D;
  --neutral-plan:#262C25;
  --line:        #343B32;
  --loading-veil:rgba(23,28,23,0.62);
  --loading-veil-strong:rgba(23,28,23,0.92);
  --loading-panel:rgba(33,39,32,0.96);
  --loading-border:rgba(70,80,68,0.82);
  --glass-surface:rgba(33,39,32,0.85);
  --neutral-stat:#2E352D;
  --pinni-options-bg:#2A3129DD;
  --pinni-ideas-from:#222B21;
  --pinni-ideas-to:  #1E241D;
  --pinni-question-bg:#212720;
  --pinni-question-hover:#283027;
  --pinni-icon-bg:   #2C3828;
  --pinni-icon-fg:   #A9C29E;
  --pinni-icon2-bg:  #3A2A22;
  --pinni-icon2-fg:  #E0AE9B;
  --login-link:      #B5CBA9;
  --web-backdrop:    #0F130F;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --crema:       #171C17;
    --arena:       #2E352D;
    --arena-ui:    #6F786B;
    --salvia:      #7E9576;
    --salvia-mid:  #8FAA88;
    --salvia-deep: #B5CBA9;
    --salvia-light:#232C22;
    --terra:       #C98F7A;
    --terra-deep:  #E0AE9B;
    --terra-light: #33261F;
    --grafito:     #E7E9E1;
    --muted:       #A3A79C;
    --white:       #212720;
    --danger:      #EE8D80;
    --danger-light:#3A2420;
    --warning:     #E3B866;
    --warning-light:#362C18;
    --success-light:#22301F;
    --shadow-card: 0 5px 22px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
    --shadow-btn:  0 4px 16px rgba(0,0,0,0.35);
    --accent-strong: #4F6A49;
    --terra-strong:  #9C6B5A;
    --ink-strong:  #E7E9E1;
    --on-ink:      #171C17;
    --danger-tint: #3A2420;
    --danger-tint-strong: #4A2C26;
    --ai-card-from:#222B21;
    --ai-card-to:  #1E241D;
    --track:       #2E352D;
    --neutral-soft:#2A302A;
    --switch-off:  #4A5148;
    --neutral-chip:#2E352D;
    --neutral-plan:#262C25;
    --line:        #343B32;
    --loading-veil:rgba(23,28,23,0.62);
    --loading-veil-strong:rgba(23,28,23,0.92);
    --loading-panel:rgba(33,39,32,0.96);
    --loading-border:rgba(70,80,68,0.82);
    --glass-surface:rgba(33,39,32,0.85);
    --neutral-stat:#2E352D;
    --pinni-options-bg:#2A3129DD;
    --pinni-ideas-from:#222B21;
    --pinni-ideas-to:  #1E241D;
    --pinni-question-bg:#212720;
    --pinni-question-hover:#283027;
    --pinni-icon-bg:   #2C3828;
    --pinni-icon-fg:   #A9C29E;
    --pinni-icon2-bg:  #3A2A22;
    --pinni-icon2-fg:  #E0AE9B;
    --login-link:      #B5CBA9;
    --web-backdrop:    #0F130F;
    color-scheme: dark;
  }
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  background: var(--crema);
  color: var(--grafito);
  -webkit-font-smoothing: antialiased;
}

/* El host de Blazor incluye este panel fuera de AppRoot. Nido presenta los
   errores mediante AppErrorBoundary y su pantalla genérica, por lo que el
   panel predeterminado no debe aparecer al final de ninguna página. */
#blazor-error-ui {
  display: none !important;
}

/* ── Safe area / MAUI shell ───────────────────────────── */
.page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

input, textarea, select, [contenteditable="true"] {
  scroll-margin-block: 22px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius-md); border: none;
  font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
a.btn { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--salvia-mid); outline-offset: 2px; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-secondary { background: var(--white); color: var(--grafito); border: 1px solid var(--arena-ui); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--arena-ui); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-full { width: 100%; }

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden;
}

/* ── Input ────────────────────────────────────────────── */
.input {
  width: 100%; padding: 12px 16px;
  background: var(--crema); border: 1.5px solid var(--arena-ui);
  border-radius: 16px; outline: none;
  font-family: 'Poppins', sans-serif; font-size: 14px; color: var(--grafito);
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--salvia-mid); box-shadow: 0 0 0 3px var(--salvia-light); }
/* Sin el rectángulo gris del toque de iOS sobre campos, botones y opciones. */
input, select, textarea, button, label, a, summary { -webkit-tap-highlight-color: transparent; }
.input::placeholder { color: var(--muted); }
.input[type="date"] { min-height: 48px; min-width: 0; max-width: 100%; width: 100%; color-scheme: light; appearance: none; -webkit-appearance: none; }
.input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.input[type="date"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; }
.input.input-invalid { border-color: var(--danger); }
.input.input-invalid:focus { box-shadow: 0 0 0 2px var(--danger-light); }

/* ── Bottom nav ───────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--crema);
}

.app-shell.with-bottom-nav {
  padding-bottom: calc(84px + var(--safe-area-bottom));
}

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid rgba(82,100,77,.1);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -5px 24px rgba(68,77,57,.035);
  display: flex; align-items: center; justify-content: space-around;
  min-height: 72px;
  padding: 10px 8px max(14px, calc(10px + var(--safe-area-bottom)));
  z-index: 100;
}
.nav-item {
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; min-height: 50px;
  justify-content: center;
  background: none; border: none; cursor: pointer; padding: 4px 10px;
  font-family: 'Poppins', sans-serif;
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.nav-item.active .nav-icon {
  color: var(--salvia-deep);
}
.nav-item .nav-label { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.nav-item.active .nav-label { font-weight: 600; color: var(--salvia-deep); }
.nav-item.is-unavailable { opacity: .45; }
.nav-dot { width: 18px; height: 2.5px; border-radius: 2px; background: var(--salvia); margin-top: 1px; }
.nav-icon { position: relative; }
/* Pendientes por revisar: sobre la esquina del icono, sin moverlo ni cambiar la barra. */
.nav-badge {
  position: absolute; top: -6px; left: 14px;
  min-width: 17px; height: 17px; padding: 0 5px; box-sizing: border-box;
  border-radius: 999px; border: 2px solid var(--white);
  background: var(--terra-strong); color: var(--on-accent);
  font-size: 9.5px; font-weight: 700; line-height: 13px; text-align: center;
  font-variant-numeric: tabular-nums; pointer-events: none;
  animation: nav-badge-in .2s ease-out;
}
@keyframes nav-badge-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.offline-bar {
  position: sticky; top: 0; z-index: 140;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--warning-light); color: var(--warning);
  font-size: 12px; line-height: 1.35;
}
.offline-bar strong { font-weight: 700; }
.offline-bar.is-syncing { background: var(--salvia-light); color: var(--salvia-deep); }
.offline-bar-count { font-weight: 600; }
.pending-toast {
  position: fixed; z-index: 150;
  top: max(12px, env(safe-area-inset-top, 0px)); left: 16px; right: 16px;
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 4px;
  background: var(--white); color: var(--grafito);
  border: 1px solid rgba(82,100,77,.16); border-radius: 18px;
  box-shadow: var(--shadow-card), 0 8px 28px rgba(68,77,57,.14);
  animation: pending-toast-in .28s ease-out;
}
@keyframes pending-toast-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.pending-toast-main {
  flex: 1; min-width: 0; min-height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px 8px 12px; border: none; background: none; color: inherit;
  font-family: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.pending-toast-icon {
  width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 10px; background: var(--terra-light); color: var(--terra-deep);
}
.pending-toast-text { flex: 1; min-width: 0; line-height: 1.35; }
.pending-toast-action { flex-shrink: 0; font-weight: 700; color: var(--salvia-deep); padding: 0 4px; }
.pending-toast-close {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 12px;
}
.pending-toast-main:focus-visible, .pending-toast-close:focus-visible { outline: 2px solid var(--salvia-deep); outline-offset: -2px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) {
  .nav-badge, .pending-toast { animation: none; }
}
.app-fab {
  position: fixed;
  right: 22px;
  bottom: calc(88px + var(--safe-area-bottom));
  z-index: 101;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--terra-strong);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(201,143,122,0.38);
  cursor: pointer;
}

/* ── Page headers ─────────────────────────────────────── */
.page-header {
  background: var(--white); padding: 52px 22px 14px;
  border-bottom: 1px solid var(--arena);
}
.page-header-salvia { background: var(--accent-strong); padding: 52px 22px 24px; }

/* ── Auth / Login ─────────────────────────────────────── */
.login-page {
  height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--crema);
}
.login-header {
  background: var(--salvia-mid); flex: 0 0 220px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; padding: 48px 24px 30px;
}
.login-logo { font-size: 48px; font-weight: 700; color: var(--on-accent); letter-spacing: -2px; }
.login-tagline { font-size: 13px; color: rgba(255,255,255,0.92); margin-top: 6px; }
.login-brand-logo {
  width: min(280px, 76vw);
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.login-body {
  flex: 1; padding: 32px 24px 40px;
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}

/* Focusing a field must not collapse the brand header and shift the form. */

body.nido-mobile-form-focus .login-header {
  flex-basis: 96px;
  justify-content: center;
  padding: 16px 24px 12px;
}

body.nido-mobile-form-focus .login-brand-logo {
  width: min(176px, 55vw);
}

body.nido-keyboard-open .login-body {
  padding-bottom: calc(32px + var(--nido-keyboard-overlay-inset));
  /* The visibility helper already clips to visualViewport; do not subtract the keyboard twice. */
  scroll-padding-bottom: 28px;
}

body.nido-mobile-form-focus .login-body {
  padding-bottom: calc(40px + min(42vh, 360px));
  scroll-padding-bottom: calc(32px + min(42vh, 360px));
}

body.nido-mobile-form-focus::after {
  content: '';
  display: block;
  width: 1px;
  height: min(42vh, 360px);
  pointer-events: none;
}
.social-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-md); border: 1.5px solid var(--arena-ui);
  background: var(--white); font-family: 'Poppins', sans-serif; font-size: 14px;
  font-weight: 500; color: var(--grafito); cursor: pointer; transition: background 0.15s;
  width: 100%;
}
.social-btn:active { background: var(--crema); }
.social-btn .social-icon { width: 22px; height: 22px; flex-shrink: 0; }
.divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--muted); margin: 4px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--arena);
}
.app-error {
  background: var(--danger-light); border: 1px solid var(--danger);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 13px; color: var(--danger); line-height: 1.45;
  white-space: pre-line;
}
.app-error-page {
  margin: 0 22px 12px;
}

/* ── Full-screen unexpected error ────────────────────── */
.fatal-error-screen {
  position: absolute;
  inset: 0;
  z-index: 1000;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 16%, rgba(168,187,160,0.18), transparent 34%),
    var(--crema);
  padding: max(28px, env(safe-area-inset-top, 0px)) 24px
           max(22px, env(safe-area-inset-bottom, 0px));
}
.fatal-error-main {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0 24px;
}
.fatal-error-content {
  width: min(100%, 410px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.fatal-error-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 28px;
  color: var(--terra-deep);
  background: var(--terra-light);
  box-shadow: 0 10px 30px rgba(201,143,122,0.20);
}
.fatal-error-icon svg {
  width: 52px;
  height: 52px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.fatal-error-icon-dot {
  fill: currentColor;
  stroke: none;
}
.fatal-error-content h1 {
  max-width: 360px;
  color: var(--grafito);
  font-size: clamp(21px, 5.4vw, 25px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.fatal-error-description {
  max-width: 380px;
  margin-top: 14px;
  color: var(--grafito);
  font-size: 13px;
  line-height: 1.7;
}
.fatal-error-report {
  width: 100%;
  margin-top: 30px;
  padding: 16px;
  text-align: left;
  background: var(--glass-surface, rgba(255,255,255,0.82));
  border: 1px solid var(--arena);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.fatal-error-report-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fatal-error-report-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fatal-error-report code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: var(--grafito);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  user-select: all;
}
.fatal-error-copy {
  flex: 0 0 auto;
  min-width: 88px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--salvia-light);
  color: var(--success);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.fatal-error-copy:active { opacity: 0.78; }
.fatal-error-copy svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fatal-error-copy-failed {
  display: block;
  margin-top: 8px;
  color: var(--danger);
  font-size: 10px;
}
.fatal-error-actions {
  width: min(100%, 410px);
  flex: 0 0 auto;
  margin: 0 auto;
  padding-top: 16px;
}
.fatal-error-acknowledge {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-strong);
  color: var(--on-accent);
  box-shadow: var(--shadow-btn);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.fatal-error-acknowledge:active {
  opacity: 0.85;
  transform: scale(0.99);
}
.fatal-error-version {
  flex: 0 0 auto;
  padding-top: 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

@media (max-height: 620px) {
  .fatal-error-main { align-items: flex-start; padding-top: 12px; }
  .fatal-error-icon { width: 68px; height: 68px; margin-bottom: 18px; border-radius: 22px; }
  .fatal-error-icon svg { width: 42px; height: 42px; }
  .fatal-error-report { margin-top: 20px; }
}
.login-body > .login-error {
  position: sticky;
  top: 0;
  z-index: 2;
}
.login-notice {
  margin: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.email-form {
  display: flex; flex-direction: column; gap: 10px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.05em; }
.form-field > .field-error {
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.invite-toggle {
  display: flex; align-items: center; gap: 6px; background: none; border: none;
  font-family: 'Poppins', sans-serif; font-size: 12px; color: var(--salvia-deep);
  cursor: pointer; padding: 2px 0; align-self: flex-start;
}
.email-back-btn {
  border: none;
  background: transparent;
  color: var(--salvia-deep);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  padding: 2px 0;
}
.email-step-header {
  background: var(--salvia-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.email-step-header strong {
  display: block;
  color: var(--grafito);
  font-size: 14px;
  margin-bottom: 3px;
}
.email-step-header span {
  color: var(--muted);
  font-size: 11px;
}
.form-hint {
  font-size: 10px; color: var(--muted); text-align: center; line-height: 1.5; margin-top: 2px;
}
.app-runtime-footer {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

/* ── Chat IA ──────────────────────────────────────────── */
.chat-page {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; background: var(--crema);
}
.chat-header {
  background: var(--white); padding: 52px 22px 16px;
  border-bottom: 1px solid var(--arena);
  display: flex; align-items: center; gap: 12px;
}
.chat-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--salvia); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.bubble {
  max-width: 75%; padding: 10px 14px;
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bubble-ai {
  background: var(--white); color: var(--grafito);
  border-radius: 16px 16px 16px 4px;
  align-self: flex-start;
}
.bubble-user {
  background: var(--accent-strong); color: var(--on-accent);
  border-radius: 16px 16px 4px 16px;
  align-self: flex-end;
}
.bubble-row { display: flex; align-items: flex-end; gap: 8px; }
.bubble-row.user { justify-content: flex-end; }
.bubble-row.ai { justify-content: flex-start; }
.bubble-ai-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--salvia); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.suggestions { margin-top: 4px; }
.suggestions-label { font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion-chip {
  padding: 6px 12px; border-radius: 50px; border: 1px solid var(--arena-ui);
  background: var(--white); font-family: 'Poppins', sans-serif;
  font-size: 11px; color: var(--grafito); cursor: pointer;
}
.chat-offline {
  margin: 0 22px 10px; padding: 10px 14px; border-radius: 12px;
  background: var(--warning-light); color: var(--warning);
  display: grid; gap: 2px; font-size: 12px; line-height: 1.4;
}
.chat-composer { background: var(--white); padding-bottom: var(--safe-area-bottom); flex-shrink: 0; }
/*
 * Nido IA with the bottom bar: the shell is exactly the visible viewport, reserves the bar's
 * real height and the conversation fills the rest, so the composer always ends right above
 * the bar (a fixed guess of 96px left it under a 105px bar on Face ID iPhones, and 100dvh
 * plus the shell's own reservation made the whole page scroll). With the keyboard open the
 * bar steps aside and nothing is reserved: the visual viewport alone sizes the page, and it
 * follows iOS's pan (offsetTop) so no space is added twice.
 */
.app-shell.with-bottom-nav:has(> .chat-page) {
  display: flex; flex-direction: column;
  height: var(--nido-visual-viewport-height, 100dvh);
  min-height: 0; /* .app-shell's 100dvh minimum would undo the keyboard's smaller height. */
  padding-bottom: var(--nido-bottom-nav-measured-height, var(--nido-bottom-nav-height));
  overflow: hidden;
}
.app-shell.with-bottom-nav > .chat-page { flex: 1; min-height: 0; height: auto; }
.app-shell.with-bottom-nav .chat-composer { padding-bottom: 0; }
/* The bar's rounded top and shadow sit right under the input: as much air below as above. */
.app-shell.with-bottom-nav .chat-input-bar { padding-bottom: 12px; }
body.nido-keyboard-open .app-shell.with-bottom-nav .chat-input-bar { padding-bottom: 8px; }
/*
 * Fixed to the visible area (visual viewport top and height), not moved with a transform: iOS also
 * scrolls the document to show the focused field, and a transform on an in-flow page then lands
 * higher by that scroll (the conversation vanished and the box stuck to the top of the screen).
 */
body.nido-keyboard-open .app-shell.with-bottom-nav:has(> .chat-page) {
  padding-bottom: 0;
  position: fixed;
  left: 0; right: 0;
  top: var(--nido-visual-viewport-top, 0px);
  height: var(--nido-visual-viewport-height, 100dvh);
}
body.nido-keyboard-open .app-shell:has(> .chat-page) ~ .bottom-nav { display: none; }
.chat-input-bar {
  padding: 12px 22px 8px; border-top: 1px solid var(--arena-ui);
  background: var(--white); display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
  flex: 1; min-width: 0; padding: 11px 14px;
  border-radius: 12px; border: 1px solid var(--arena-ui);
  background: var(--crema); font-family: 'Poppins', sans-serif;
  font-size: 13px; line-height: 1.5; color: var(--grafito); outline: none; resize: none;
  min-height: calc(3em + 24px);
  max-height: min(calc(9em + 24px), 32dvh);
  overflow-y: auto;
}
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--salvia); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(168,187,160,0.40); flex-shrink: 0;
}
.loading-dots { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.loading-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--salvia);
  animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
.nido-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--loading-veil, rgba(247,243,238,0.62));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.nido-loading-contained {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 20px;
}

.nido-loading-panel {
  width: min(230px, 100%);
  padding: 20px 18px 18px;
  border: 1px solid var(--loading-border, rgba(221,210,195,0.82));
  border-radius: 8px;
  background: var(--loading-panel, rgba(255,255,255,0.96));
  box-shadow: 0 12px 32px rgba(95,91,87,0.18);
  color: var(--grafito);
  text-align: center;
}

.nido-loading-contained .nido-loading-panel {
  width: min(200px, 100%);
  padding: 8px 12px 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.nido-loading-panel > strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.nido-loading-scene {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 10px;
}

.nido-loading-contained .nido-loading-scene {
  width: 92px;
  height: 92px;
  margin-bottom: 6px;
}

.nido-loading-scene img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  transform: translate(-50%, -50%);
  animation: nido-loader-breathe 1.8s ease-in-out infinite;
}

.nido-loading-contained .nido-loading-scene img {
  width: 56px;
  height: 56px;
  border-radius: 15px;
}

.nido-loader-orbit {
  position: absolute;
  border: 1px dashed rgba(168,187,160,0.42);
  border-radius: 50%;
  animation: nido-loader-orbit 3.4s linear infinite;
}

.nido-loader-orbit.orbit-one {
  inset: 2px;
}

.nido-loader-orbit.orbit-two {
  inset: 15px;
  border-color: rgba(201,143,122,0.32);
  animation-duration: 2.7s;
  animation-direction: reverse;
}

.nido-loader-bird {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 18px;
  height: 9px;
  transform: translateX(-50%);
}

.nido-loader-bird::before,
.nido-loader-bird::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 9px;
  height: 6px;
  border-top: 2px solid var(--terra);
  border-radius: 50%;
}

.nido-loader-bird::before {
  left: 0;
  transform: rotate(18deg);
}

.nido-loader-bird::after {
  right: 0;
  transform: rotate(-18deg);
}

.orbit-two .nido-loader-bird::before,
.orbit-two .nido-loader-bird::after {
  border-top-color: var(--success);
}

@keyframes nido-loader-orbit {
  to { transform: rotate(360deg); }
}

@keyframes nido-loader-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.96); }
  50% { transform: translate(-50%, -50%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .nido-loader-orbit,
  .nido-loading-scene img {
    animation: none;
  }
}
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}
.chat-thinking-text {
  color: var(--muted);
  font-size: 0.84rem;
}
/* A movement Pinni understood from the chat: read it, then register or cancel it. */
.chat-movement {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--crema);
  border: 1px solid var(--line, #e3ddcf);
}
.chat-movement-summary {
  display: block;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.chat-movement-description {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.chat-movement-description span { color: var(--muted); }
/* The same chooser the movement form uses, here to correct the category without leaving the chat. */
.chat-movement-category {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.chat-movement-category-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.chat-movement-category[data-category-guess='true'] .chat-movement-category-hint {
  color: var(--grafito);
  font-weight: 600;
}
.chat-movement-notice {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.chat-movement-link {
  display: inline-block;
  margin-top: 8px;
  min-height: 44px;
  padding-top: 12px;
  color: var(--grafito);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
}
.chat-movement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chat-movement-actions .btn {
  flex: 1 1 120px;
  min-height: 44px;
}
.chat-movement[data-movement-state='saved'] { border-color: var(--salvia-deep, #52644d); }
.chat-movement[data-movement-state='cancelled'] { opacity: 0.75; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── Utilities ────────────────────────────────────────── */
.text-muted   { color: var(--muted); }
.text-salvia  { color: var(--salvia-deep); }
.text-terra   { color: var(--terra-deep); }
.text-grafito { color: var(--grafito); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fs-10        { font-size: 10px; }
.fs-11        { font-size: 11px; }
.fs-12        { font-size: 12px; }
.fs-13        { font-size: 13px; }
.fs-14        { font-size: 14px; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-12        { margin-top: 12px; }
.mt-16        { margin-top: 16px; }

/* Transactions */
.transactions-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.transactions-header {
  background: var(--white);
  border-bottom: 1px solid var(--arena);
  padding: 52px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  font-size: 12px;
  color: rgba(255,255,255,0.92);
}

.pill-btn,
.secondary-action,
.primary-action,
.close-btn {
  border: none;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}

.pill-btn {
  background: rgba(255,255,255,0.2);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-btn.subtle {
  background: rgba(255,255,255,0.12);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.transactions-summary {
  margin: 14px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  box-shadow: var(--shadow-card);
}

.transactions-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.transactions-summary strong {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
}

.amount-income {
  color: var(--salvia-deep) !important;
}

.amount-expense {
  color: var(--terra-deep) !important;
}

.segmented {
  background: var(--white);
  border-radius: 14px;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.segmented button {
  flex: 1;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 9px 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.segmented button.active {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.segmented button.active.expense {
  background: var(--terra);
}

.transactions-list {
  padding: 0 22px;
}

.tx-list-search { margin: 0 0 16px; }

.transaction-group {
  margin-bottom: 18px;
}

.transaction-group h2 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.transaction-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
}

.transaction-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--crema);
  cursor: pointer;
}

.transaction-row:last-child {
  border-bottom: none;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
}

.transaction-icon svg {
  display: block;
}

.transaction-main {
  min-width: 0;
  flex: 1;
}

.transaction-main strong {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-main span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-amount {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.transaction-values {
  min-width: 0;
  text-align: right;
}

.transaction-balance {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 3px;
  white-space: nowrap;
}

/* ── Movimientos: toolbar + filtros ───────────────────── */
.tx-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tx-groupby {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.tx-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--arena-ui);
  position: relative;
  transition: background 0.2s;
}
.tx-groupby.on .tx-switch { background: var(--salvia-mid); }
.tx-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.tx-groupby.on .tx-knob { left: 18px; }
.tx-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  padding: 7px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.tx-filter-btn.active {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.funds-import-action { padding: 14px 20px 0; }
.funds-import-action .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; }
.tx-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 3px 2px 6px;
}
.chat-mic-btn {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; border: 1px solid var(--arena-ui);
  background: var(--salvia-light); color: var(--salvia-deep); cursor: pointer;
}
.chat-mic-btn.is-listening { background: var(--terra-light); color: var(--terra-deep); border-color: var(--terra); }
.chat-mic-btn:disabled, .chat-send-btn:disabled { opacity: 0.55; cursor: default; }
.chat-mic-btn:focus-visible { outline: 2px solid var(--salvia-deep); outline-offset: 3px; }
.chat-dictation-status { margin: 0; padding: 0 22px 10px; font-size: 11px; line-height: 1.45; color: var(--salvia-deep); }
.chat-dictation-status.is-error { color: var(--terra-deep); }
.tx-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  white-space: nowrap;
  line-height: 1.25;
  border: none;
  border-radius: 999px;
  background: var(--crema);
  color: var(--muted);
  padding: 6px 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.tx-chip.active {
  background: var(--ink-strong);
  color: var(--on-ink);
}

.tx-drafts-note {
  margin: 12px 22px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--terra-light);
  color: var(--terra-deep);
  font-size: 12px;
}
.tx-currency-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 22px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.tx-currency-hint > svg { flex: none; }
.tx-currency-hint > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-suggestions {
  margin: 12px 22px 0;
  display: grid;
  gap: 8px;
}
.tx-suggestions-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--grafito);
}
.tx-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--terra-light);
  color: var(--terra-deep);
}
.tx-suggestion-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 160px;
}
.tx-suggestion-main strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.tx-suggestion-main span,
.tx-suggestion-main small { font-size: 12px; }
.tx-discard-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warning-light); color: var(--warning); font-size: 13px; }
.tx-discard-confirm span { flex: 1 1 100%; }
.tx-learned-note { margin: 0 0 8px; font-size: 12px; color: var(--salvia-deep); }
/* A purchase in another currency: what was paid, so the fund's amount is written, never copied. */
.tx-foreign-note {
  margin: 13px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--warning-light);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.4;
}
.tx-offline-note {
  margin: 12px 22px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-size: 12px;
}
.tx-pending-sync .tx-suggestion { background: var(--salvia-light); color: var(--salvia-deep); }
.tx-pending-sync .tx-suggestion.is-refused { background: var(--danger-light); color: var(--danger); }
.tx-sync-chip {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 600;
}
.tx-suggestion-match { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.tx-suggestion-match .savings-link-btn { min-height: 32px; padding: 0; color: var(--terra-deep); text-decoration: underline; }
.tx-suggestion-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tx-suggestion-actions .btn { min-height: 44px; }

/* Pendientes: acceso discreto junto al combo de tipo; cada grupo se decide en su panel. */
/* Fila con scroll horizontal que se nota desplazable (ScrollHintRow): la última píldora que no cabe asoma a medias. */
.scroll-hint { margin: 0 -2px 10px; }
.scroll-hint-track {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 3px 2px 6px;
  overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-snap-type: x proximity; scroll-padding-inline: 2px;
}
.scroll-hint-track::-webkit-scrollbar { display: none; }
.scroll-hint-track > * { scroll-snap-align: start; }
.tx-type-chip {
  flex: 0 0 auto; min-height: 32px; padding: 4px var(--hint-pad, 12px); white-space: nowrap; cursor: pointer;
  border: 1px solid var(--arena-ui); border-radius: 999px; background: var(--white); color: var(--muted);
  font: 500 12px 'Poppins', sans-serif;
}
.tx-type-chip.active { border-color: var(--salvia); background: var(--salvia-light); color: var(--salvia-deep); font-weight: 700; }
.tx-type-chip:focus-visible { outline: 2px solid var(--salvia-deep); outline-offset: 2px; }
.tx-pending-access { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tx-pending-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; max-width: 100%;
  padding: 3px 11px 3px 4px; border: 0; border-radius: 999px;
  font: 600 11px 'Poppins', sans-serif; cursor: pointer;
}
.tx-pending-pill > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-pending-pill.is-complete { background: var(--terra-light); color: var(--terra-deep); }
.tx-pending-pill.is-approve { background: var(--salvia-light); color: var(--salvia-deep); }
.tx-pending-pill-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--white); font-style: normal; }
.tx-pending-pill:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.tx-pending-sheet {
  display: flex; flex-direction: column;
  max-height: min(86dvh, 720px);
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.tx-pending-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tx-pending-sheet-header h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--grafito); }
.tx-pending-sheet-hint { margin: 6px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.tx-pending-sheet-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 8px; align-content: start;
}
.tx-pending-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--arena); border-radius: 14px; background: var(--white);
}
.tx-pending-item-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 170px; }
.tx-pending-item-main strong { font-size: 13px; color: var(--grafito); overflow-wrap: anywhere; }
.tx-pending-item-amount { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-pending-item-main small { color: var(--muted); font-size: 11px; }
.tx-pending-category {
  justify-self: start; display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  margin: 3px 0 1px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.tx-pending-category > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--grafito); }
.tx-pending-flag {
  justify-self: start; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--warning-light); color: var(--warning); font-size: 11px; font-weight: 600;
}
.tx-pending-flag .savings-link-btn { min-height: 32px; padding: 0; color: inherit; text-decoration: underline; }
.tx-pending-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tx-pending-item-actions .btn { min-height: 44px; padding-inline: 14px; }
.tx-pending-feedback { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; font-size: 12px; }
.tx-pending-feedback.is-ok { background: var(--salvia-light); color: var(--salvia-deep); }
.tx-pending-feedback.is-error { background: var(--danger-light); color: var(--danger); }
.tx-pending-empty { margin: 16px 0; text-align: center; color: var(--muted); font-size: 13px; }
.tx-pending-sheet-footer { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--arena); }
.tx-pending-sheet-footer small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.tx-pending-confirm { z-index: 130; }
@media (min-width: 768px) {
  .tx-pending-panel .tx-confirm-sheet,
  .tx-pending-confirm .tx-confirm-sheet { width: min(560px, 100%); margin: 0 auto; }
}
.tx-filter-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 22px 0;
}
.tx-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}
.tx-tag button {
  border: none;
  background: none;
  color: var(--salvia-deep);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.tx-clear-all {
  border: none;
  background: none;
  color: var(--terra-deep);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Movimientos: modal de filtros ────────────────────── */
.tx-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--crema);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--muted);
}
.tx-search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--grafito);
}
.list-search-field {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--arena-ui);
  border-radius: 8px;
  background: var(--white);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.list-search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
}
.list-search-field input::placeholder {
  color: var(--muted);
}
.list-search-field button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--crema);
  color: var(--grafito);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.list-search-block {
  padding: 12px 18px 0;
}
.tx-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tx-filter-chip {
  border: 1px solid var(--arena-ui);
  background: transparent;
  color: var(--grafito);
  border-radius: 999px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  cursor: pointer;
}
.tx-filter-chip.selected {
  border-color: var(--chip-color, var(--salvia-mid));
  background: var(--chip-color, var(--salvia-light));
  color: var(--filter-selected-color, var(--salvia-mid));
  font-weight: 600;
}

/* ── Movimientos: detalle ─────────────────────────────── */
/* Detalle abierto desde Inicio: solo el detalle; la lista de Movimientos no se muestra. */
.transactions-page.detail-only > header,
.transactions-page.detail-only > main { display: none; }

.tx-detail {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: var(--crema);
  display: flex;
  flex-direction: column;
}
.tx-detail-header {
  background: var(--white);
  border-bottom: 1px solid var(--arena);
  padding: 52px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tx-back {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--grafito);
}
.tx-detail-header > strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 600;
}
.tx-detail-edit {
  border: none;
  background: var(--crema);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--grafito);
  cursor: pointer;
}
.tx-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 30px;
}
.tx-detail-hero {
  background: var(--white);
  border-radius: 20px;
  padding: 24px 20px;
  margin-bottom: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tx-detail-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
}
.tx-detail-icon.income { background: var(--salvia-light); color: var(--salvia-deep); }
.tx-detail-icon.expense { background: var(--terra-light); color: var(--terra-deep); }
.tx-detail-hero > strong {
  font-size: 32px;
  font-weight: 700;
  color: var(--grafito);
}
.tx-detail-badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
}
.tx-detail-badge.income { background: var(--salvia-light); color: var(--salvia-deep); }
.tx-detail-badge.expense { background: var(--terra-light); color: var(--terra-deep); }
.tx-detail-badge.adjustment { background: var(--crema); color: var(--grafito); }
.tx-detail-badge.draft { background: var(--terra-light); color: var(--terra-deep); }
.tx-transfer-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.tx-conciliation-hint {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.tx-draft-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--terra-light);
  color: var(--terra-deep);
  font-size: 12px;
}
.tx-draft-banner strong { font-size: 13px; }
.tx-draft-original {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--terra);
}
.tx-draft-original small { font-size: 11px; opacity: .8; }
.tx-detail-info {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
}
.tx-detail-info > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--crema);
}
.tx-detail-info > div:last-child { border-bottom: none; }
.tx-detail-info span { color: var(--muted); font-size: 12px; }
.tx-detail-info b { color: var(--grafito); font-size: 13px; font-weight: 500; text-align: right; }
.tx-detail-attachment {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.tx-detail-attachment > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.tx-detail-learn { display: block; background: var(--crema); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; }
.tx-detail-bar {
  display: flex;
  gap: 10px;
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--arena);
}
.tx-detail-bar > button {
  flex: 1;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.tx-detail-bar-discard { border: 1px solid #E53935; background: transparent; color: var(--danger); }
.tx-detail-bar-approve { border: none; background: var(--accent-strong); color: var(--on-accent); }
.tx-detail-bar > button:disabled, .tx-confirm-approve:disabled { opacity: 0.6; }
.tx-confirm-approve {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 13px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tx-detail-learn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; color: var(--grafito); }
.tx-detail-learn-row input { flex: none; width: 22px; height: 22px; accent-color: var(--salvia-deep); }
.tx-detail-learn small { display: block; margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--salvia-deep); }
.tx-attachment-empty {
  border: 1.5px dashed var(--arena);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.tx-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tx-detail-primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
}
.tx-detail-secondary {
  width: 100%;
  border: 1px solid var(--arena);
  border-radius: 14px;
  padding: 14px;
  background: transparent;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tx-detail-delete {
  width: 100%;
  border: 1px solid #E53935;
  border-radius: 14px;
  padding: 14px;
  background: transparent;
  color: var(--danger);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Movimientos: confirmar eliminar ──────────────────── */
.tx-confirm {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tx-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(95,91,87,0.45);
}
.tx-confirm-sheet {
  position: relative;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 24px 22px 36px;
}
.tx-confirm-sheet > strong { display: block; color: var(--grafito); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.tx-confirm-sheet > p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.tx-confirm-actions { display: flex; gap: 10px; }
.tx-confirm-cancel {
  flex: 1;
  border: 1px solid var(--arena);
  border-radius: 14px;
  padding: 13px;
  background: transparent;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tx-confirm-delete {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 13px;
  background: var(--danger);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}


/* ── Transacción → registrar como fijo ────────────────── */
.tx-fixed-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
}
.tx-fixed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.tx-fixed-chip {
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
}
.tx-fixed-chip.income { background: var(--salvia-light); color: var(--salvia-deep); }
.tx-fixed-chip.expense { background: var(--terra-light); color: var(--terra-deep); }

/* ── Acceso a seguimiento (desde Categorías / Fijos) ──── */
.track-access-btn {
  margin: 0 22px 14px;
  width: calc(100% - 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--arena-ui);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--salvia-deep);
}
.track-access-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

/* ── Dashboard: card de presupuesto ───────────────────── */
.dashboard-budget-card { cursor: pointer; }
.dashboard-category-budget-overview {
  background: var(--crema);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.dashboard-category-budget-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 10px;
}
.dashboard-category-budget-totals > div { min-width: 0; }
.dashboard-category-budget-totals > div + div {
  border-left: 1px solid var(--white);
  padding-left: 12px;
}
.dashboard-category-budget-totals dt {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  min-height: 2.6em;
}
.dashboard-category-budget-totals dd {
  margin: 4px 0 0;
  color: var(--grafito);
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.dashboard-category-budget-totals dd.amount-expense { color: var(--danger); }
.dashboard-category-budget-breakdown {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.dashboard-category-budget-breakdown > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 8px;
}
.dashboard-category-budget-breakdown dd {
  margin: 0;
  font-weight: 600;
}
.dashboard-category-budget-overview .budget-track { background: var(--white); }
.dashboard-link { color: var(--salvia-deep); font-size: 12px; font-weight: 500; }
.dashboard-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--terra-light);
  color: var(--terra-deep);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.dashboard-soon { color: var(--muted); font-size: 10px; font-weight: 600; }
.dashboard-soon-desc { color: var(--muted); font-size: 12px; line-height: 1.5; }
.budget-base-mini {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  background: var(--crema);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.budget-base-mini span {
  color: var(--muted);
  font-size: 10px;
}
.budget-base-mini strong {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 800;
}

/* ── Páginas de seguimiento ───────────────────────────── */
.track-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}
.track-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 22px;
}
.track-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.92);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.track-hero h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.track-total-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}
.track-total-card > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.track-total-card > strong {
  display: block;
  color: var(--grafito);
  font-size: 26px;
  font-weight: 800;
  margin: 5px 0 8px;
}
.track-total-card > .track-bar { margin-top: 10px; }
.track-summary {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.track-summary span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.track-summary strong {
  display: block;
  color: var(--grafito);
  font-size: 16px;
  font-weight: 800;
  margin-top: 3px;
}
.track-summary-divider {
  border-left: 1px solid var(--crema);
  padding-left: 14px;
}
.track-bar {
  background: var(--crema);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}
.track-bar > div {
  height: 100%;
  border-radius: 10px;
}
.track-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.track-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.track-card-action {
  width: 100%;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.track-card-action:hover {
  box-shadow: 0 4px 14px rgba(95,91,87,0.1);
}
.track-card-action:focus-visible {
  outline: 2px solid var(--salvia-deep);
  outline-offset: 2px;
}
.track-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.track-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}
.track-card-top strong {
  flex: 1;
  min-width: 0;
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.track-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--grafito);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.track-amount.over { color: var(--terra-deep); }
.track-status {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted);
}
.track-status.over { color: var(--terra-deep); }
.track-budget-group {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--arena);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.track-group-summary {
  padding: 18px 16px 16px;
  background: linear-gradient(120deg, var(--salvia-light), var(--white));
  border-bottom: 1px solid var(--arena);
}
.track-group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.track-group-title > div { min-width: 0; }
.track-group-title h2 { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.track-group-title small { display: block; font-size: 10px; color: var(--muted); }
.track-group-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0; }
.track-group-totals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.track-group-totals > div { min-width: 0; }
.track-group-totals > div + div { border-left: 1px solid var(--arena); padding-left: 12px; }
.track-group-totals span { display: block; color: var(--muted); font-size: 10px; }
.track-group-totals strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.track-group-totals strong.over { color: var(--terra-deep); }
.track-budget-list .track-budget-items { display: flex; flex-direction: column; gap: 12px; }
.track-budget-group .track-card { display: block; border-radius: 0; box-shadow: none; padding: 16px; }
.track-budget-group .track-card + .track-card { border-top: 1px solid var(--arena); }
.track-budget-group .track-card-action:hover { background: var(--salvia-light); }
.track-budget-group .track-card-action:focus-visible { outline-offset: -3px; }
.track-budget-group .track-card-top { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 5px 8px; }
.track-budget-group .track-card-top strong { white-space: normal; overflow-wrap: anywhere; }
.track-budget-group .track-amount { grid-column: 2; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.track-chip {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.track-chip.paid { background: var(--salvia-light); color: var(--salvia-deep); }
.track-chip.pending { background: var(--terra-light); color: var(--terra-deep); }
.track-executed {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* 50/30/20 budget */
.budget-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 90px;
  position: relative;
}
.budget-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.budget-hero h1 {
  color: var(--on-accent);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.budget-adjust-btn {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia-deep);
  padding: 10px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.budget-base-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}
.budget-base-card span,
.budget-base-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.budget-base-card strong {
  display: block;
  color: var(--grafito);
  font-size: 28px;
  font-weight: 800;
  margin: 5px 0 2px;
}
.budget-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.budget-bucket-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.budget-bucket-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.budget-bucket-top > div {
  min-width: 0;
  flex: 1 1 150px;
}
.budget-bucket-top strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.budget-bucket-top strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.budget-bucket-top span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.budget-bucket-top b {
  color: var(--grafito);
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}
.budget-bucket-top b.over { color: var(--terra-deep); }
.budget-bucket-top b small {
  color: var(--muted);
  font-weight: 600;
}
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  background: rgba(95,91,87,0.34);
}
.bottom-sheet {
  width: 100%;
  max-height: 88vh;
  max-height: min(88dvh, calc(var(--nido-visual-viewport-height) - 12px));
  overflow-y: auto;
  background: var(--white);
  border-radius: 22px 22px 0 0;
  padding: 10px 22px 24px;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.18);
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}
.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-title-row h2 {
  color: var(--grafito);
  font-size: 17px;
  font-weight: 700;
}
.sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
  display: grid;
  place-items: center;
}
.budget-percent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.budget-percent-row,
.budget-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.budget-percent-row > span:first-child,
.budget-total-row > span {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 600;
}
.budget-percent-row > span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.budget-percent-row input {
  width: 64px;
  text-align: right;
  margin: 0;
}
.budget-percent-row small {
  color: var(--muted);
  font-size: 13px;
}
.budget-total-row {
  padding: 8px 2px;
}
.budget-total-row strong {
  color: var(--salvia-deep);
  font-size: 13px;
  font-weight: 800;
}
.budget-total-row strong.over {
  color: var(--terra-deep);
}
.budget-total-row small {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.empty-state {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.empty-state strong {
  color: var(--grafito);
  font-size: 15px;
}

.transaction-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--arena);
  padding: 12px 22px 28px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  z-index: 20;
}

.secondary-action,
.primary-action {
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
}

.secondary-action {
  background: var(--salvia-light);
  color: var(--salvia-deep);
}

.primary-action {
  background: var(--terra-strong);
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(201,143,122,0.35);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(95,91,87,0.42);
  z-index: 110;
  display: flex;
  align-items: flex-end;
}

.transaction-sheet {
  width: 100%;
  max-height: 90vh;
  max-height: min(90dvh, calc(var(--nido-visual-viewport-height) - 12px));
  overflow-y: auto;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 12px 22px 30px;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}

.modal-form-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding: 12px 0 0;
}

/* Los formularios de alta y edición ocupan la pantalla disponible; la lista
   queda completamente cubierta mientras el usuario trabaja. */
.modal-backdrop.full-screen-form-backdrop {
  align-items: stretch;
  background: var(--white);
}

.transaction-sheet.modal-form-sheet.full-screen-form-sheet {
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}

.modal-form-sheet > .sheet-handle {
  flex-shrink: 0;
}

.modal-form-sheet > .sheet-header,
.modal-form-sheet > .sheet-title-row {
  flex-shrink: 0;
  padding-inline: 22px;
}

.sheet-scroll-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 22px 24px;
  scroll-padding-block: 24px;
}

.sheet-actions {
  flex: 0 0 auto;
  padding: 12px 22px max(16px, calc(12px + var(--safe-area-bottom)));
  background: var(--white);
  border-top: 1px solid var(--arena);
  box-shadow: 0 -8px 24px rgba(95,91,87,0.08);
  z-index: 5;
}

.sheet-actions .save-transaction {
  margin-top: 0;
}

.sheet-actions .save-preferences-btn {
  width: 100%;
  margin-top: 0;
}

.sheet-actions .form-save-error {
  margin-bottom: 12px;
}

body.nido-keyboard-open .bottom-sheet,
body.nido-keyboard-open .transaction-sheet {
  max-height: calc(var(--nido-visual-viewport-height) - 8px);
  scroll-padding-bottom: 28px;
}

body.nido-mobile-form-focus .bottom-sheet,
body.nido-mobile-form-focus .transaction-sheet {
  padding-bottom: calc(30px + min(42vh, 360px));
  scroll-padding-bottom: calc(28px + min(42vh, 360px));
}

body.nido-mobile-form-focus .transaction-sheet.modal-form-sheet {
  padding-bottom: 0;
  scroll-padding-bottom: 0;
}

body.nido-mobile-form-focus .bottom-sheet.modal-form-sheet {
  padding-bottom: 0;
  scroll-padding-bottom: 0;
}

body.nido-mobile-form-focus .modal-form-sheet .sheet-scroll-content {
  padding-bottom: 24px;
  scroll-padding-bottom: 24px;
}

/* El WebView puede mantener el layout viewport completo mientras el teclado
   cubre la zona inferior. En foco movil, ambos tipos de backdrop se limitan
   al viewport visual o a la reserva calculada por el manejador compartido. */
body.nido-keyboard-open .modal-backdrop,
body.nido-keyboard-open .sheet-backdrop {
  inset: auto 0 auto;
  top: var(--nido-visual-viewport-top);
  bottom: auto;
  height: max(240px, calc(
    var(--nido-visual-viewport-height) - var(--nido-keyboard-fallback-inset)
  ));
}

body.nido-keyboard-open .modal-form-sheet {
  max-height: max(232px, calc(
    var(--nido-visual-viewport-height) - var(--nido-keyboard-fallback-inset) - 8px
  ));
}

/* El foco de un campo no implica que el teclado esté visible. Su reserva
   preventiva no debe convertir un formulario completo en media pantalla. */
body.nido-mobile-form-focus .modal-backdrop.full-screen-form-backdrop {
  inset: 0;
  height: auto;
}

body.nido-mobile-form-focus .transaction-sheet.modal-form-sheet.full-screen-form-sheet {
  max-height: 100%;
}

/* Si el dispositivo comunica el teclado real, el formulario se ajusta al
   viewport visible y mantiene desplazable el contenido del formulario. */
body.nido-keyboard-open .modal-backdrop.full-screen-form-backdrop {
  top: var(--nido-visual-viewport-top);
  bottom: auto;
  height: var(--nido-visual-viewport-height);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  background: var(--arena);
  border-radius: 999px;
  margin: 0 auto 18px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.sheet-header-actions { display: flex; align-items: center; gap: 12px; }

.sheet-header h2 {
  color: var(--grafito);
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  font-size: 22px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.form-field > span,
.inline-toggle span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.amount-input {
  font-size: 22px;
  font-weight: 700;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option-chip {
  border: 1px solid var(--arena-ui);
  background: var(--crema);
  color: var(--grafito);
  border-radius: 12px;
  padding: 10px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.option-chip svg {
  flex-shrink: 0;
}

.option-chip.selected {
  border-color: var(--chip-color);
  background: var(--chip-color);
  color: var(--on-accent);
}

.category-picker-option {
  justify-content: flex-start;
  text-align: left;
  background: var(--white);
  border-color: var(--arena);
  padding: 9px 10px;
  min-height: 54px;
}

.category-picker-option.selected {
  background: color-mix(in srgb, var(--chip-color) 18%, white);
  color: var(--grafito);
  box-shadow: inset 4px 0 0 var(--chip-color);
}

.category-picker-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.category-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-toggle {
  background: var(--crema);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--salvia-deep);
}

/* "More options" in the expense/income form: what it folds is summed up beside it (UX-02.04). */
.tx-more-toggle {
  width: 100%;
  min-height: 48px;
  margin-top: 13px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--crema);
  color: var(--grafito);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}
.tx-more-toggle .tx-more-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tx-more-toggle .tx-more-summary {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-more-toggle svg { flex-shrink: 0; color: var(--muted); transition: transform .2s ease; }
.tx-more-toggle.open svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .tx-more-toggle svg { transition: none; } }

.notes-input {
  min-height: 74px;
  resize: vertical;
}

.save-transaction {
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 14px;
  padding: 15px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
}

.save-transaction:disabled {
  opacity: 0.65;
}

/* Dashboard */
.dashboard-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.dashboard-hero {
  position: relative;
  isolation: isolate;
  padding: max(20px, env(safe-area-inset-top, 0px)) 16px 0;
  color: var(--on-accent);
}
.dashboard-sky {
  position: absolute;
  z-index: -1;
  inset: 0 0 112px;
  background: radial-gradient(ellipse at 95% 35%, rgba(176,192,145,.22), transparent 62%),
              linear-gradient(135deg, #5C6F53 0%, #52644D 60%, #485A44 100%);
  border-radius: 0 0 32px 32px;
  overflow: hidden;
  pointer-events: none;
}
.dashboard-sky::before, .dashboard-sky::after { content: ""; position: absolute; inset: 0; }
.dashboard-sky::before {
  background: radial-gradient(ellipse at 95% 28%, rgba(127,158,132,.13), transparent 58%),
              linear-gradient(135deg, #344F3E, #294333 60%, #243C2E);
  opacity: var(--home-sky-night, 0);
}
.dashboard-sky::after {
  background: radial-gradient(ellipse at 100% 8%, rgba(245,187,116,.7), transparent 65%),
              radial-gradient(ellipse at 84% 34%, rgba(211,140,119,.46), transparent 72%);
  mask-image: linear-gradient(90deg, transparent 0 55%, #000 90%);
  opacity: var(--home-sky-sunset, 0);
}
.dashboard-hero[data-home-period="night"] { --home-sky-night: 1; }
.dashboard-hero[data-sky-smooth="true"] .dashboard-sky::before,
.dashboard-hero[data-sky-smooth="true"] .dashboard-sky::after { transition: opacity 60s linear; }
.dashboard-hero[data-sky-paused="true"] .dashboard-sky::before,
.dashboard-hero[data-sky-paused="true"] .dashboard-sky::after { transition: none; }
.dashboard-brand { max-width: 200px; }
.dashboard-brand img { display: block; width: 148px; height: auto; filter: brightness(0) invert(1); }
.dashboard-brand > span { display: block; margin-top: 1px; font-size: 9px; line-height: 1.4; color: #F3EEDF; }
.dashboard-hero .hero-icon-btn { width: 40px; height: 40px; background: rgba(31,52,36,.24); border: 1px solid rgba(255,255,255,.35); color: var(--on-accent); }
.dashboard-welcome { position: relative; display: flex; align-items: center; min-height: 116px; padding: 15px 0 18px; }
.home-scene {
  position: absolute; right: -12px; bottom: -7px; width: min(58%, 245px);
  aspect-ratio: 3 / 2; pointer-events: none; user-select: none;
  /* Clip the flight paths inside the artwork, away from greeting and buttons. */
  clip-path: inset(-40px 0 -7px 0);
}
.home-scene-landscape { position: absolute; inset: 0; transform-origin: 50% 90%; }
.home-scene-house { display: block; width: 100%; height: 100%; object-fit: contain; }
.home-scene-orb {
  position: absolute; width: 28%; aspect-ratio: 1; left: 67%; top: -8%; border-radius: 50%;
  background: #FBE6AC; box-shadow: 0 0 24px rgba(253,224,160,.23);
}
.home-scene-sun-path {
  position: absolute; inset: 0;
  transform: translate(var(--home-sun-x, 0%), var(--home-sun-y, 0%));
  opacity: var(--home-sun-opacity, .85);
}
.home-scene[data-sun-smooth="true"] .home-scene-sun-path { transition: transform 60s linear, opacity 60s linear; }
.home-scene[data-paused="true"] .home-scene-sun-path { transition: none; }
.home-scene[data-period="afternoon"] .home-scene-sun { background: #F7CF81; }
.home-scene[data-period="afternoon"] .home-scene-house { filter: sepia(.12) saturate(1.12); }
.home-scene-moon {
  width: 22%; left: 72%; top: -14%; background: #FFF1CB; box-shadow: none;
  opacity: 0;
  mask-image: radial-gradient(circle at 77% 27%, transparent 0 51%, #000 53%);
}
.home-scene[data-period="night"] .home-scene-moon { opacity: .85; }
.home-scene[data-period="night"] .home-scene-sun-path { opacity: 0; }
.home-scene[data-period="night"] .home-scene-house { filter: brightness(.67) saturate(.73); }
.home-scene-window-light {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at 66% 33%, rgba(255,202,99,.75), transparent 8%),
              radial-gradient(ellipse at 37% 64%, rgba(255,202,99,.65), transparent 11%),
              radial-gradient(ellipse at 73% 60%, rgba(255,202,99,.45), transparent 6%);
  mix-blend-mode: screen;
}
.home-scene[data-period="night"] .home-scene-window-light { opacity: 1; }
.home-scene-stars { position: absolute; inset: -12% 0 0; opacity: 0; }
.home-scene[data-period="night"] .home-scene-stars { opacity: .65; }
.home-scene-stars i { position: absolute; width: 2px; height: 2px; background: #FFF1D3; border-radius: 50%; }
.home-scene-stars i:nth-child(1) { left: 40%; top: 5%; }
.home-scene-stars i:nth-child(2) { left: 61%; top: 3%; }
.home-scene-stars i:nth-child(3) { left: 94%; top: 12%; }
.home-scene-stars i:nth-child(4) { left: 49%; top: 16%; width: 1px; height: 1px; }
.home-scene-branch {
  position: absolute; left: 24%; top: 34%; width: 9%; height: 3px;
  background: #847052; border-radius: 60%; transform: rotate(-19deg); transform-origin: left;
}
.home-scene-foliage { position: absolute; inset: 0; animation: home-leaves-rest 23s 5s infinite; transform-origin: 24% 50%; }
.home-scene-foliage i {
  position: absolute; width: 3%; height: 2.6%; border-radius: 80% 0 80% 0;
  background: linear-gradient(30deg, #637748, #ABAF75); transform: rotate(-20deg);
}
.home-scene-foliage i:nth-child(1) { left: 25%; top: 30%; }
.home-scene-foliage i:nth-child(2) { left: 22%; top: 32%; transform: rotate(65deg); }
.home-scene-foliage i:nth-child(3) { left: 86%; top: 42%; transform: rotate(30deg); }
.home-bird { position: absolute; width: 16%; aspect-ratio: 1; left: 55%; bottom: 88%; }
.home-bird-branch { left: 22%; bottom: 63%; width: 15%; }
.home-bird-facing, .home-bird-body { display: block; width: 100%; height: 100%; transform-origin: 50% 89%; }
.home-bird-branch .home-bird-facing { transform: scaleX(-1); }
.home-bird-body { position: relative; }
.home-scene[data-ready="false"] .home-bird { opacity: 0; }
.home-scene[data-ready="true"][data-state="rest"] .home-bird-body { animation: home-bird-idle-hop 10s linear infinite; }
.home-scene[data-ready="true"][data-state="rest"] .home-bird-branch .home-bird-body { animation-delay: .35s; }
.home-bird img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.home-bird .home-bird-wing {
  opacity: 0; clip-path: polygon(54% 51%, 68% 50%, 80% 61%, 82% 78%, 74% 82%, 58% 73%);
  transform-origin: 56% 57%;
}
.home-scene[data-period="night"] .home-bird { filter: brightness(.87); }
.home-scene[data-period="night"] .home-scene-foliage { animation: none; }
/* Four seconds total: home 0–1, arrival 1–2, landing 2–3, small hops 3–4.
   Facing stays fixed: interpolating a mirrored cutout would make it look flat. */
.home-scene[data-state="entering"] .home-scene-landscape { animation: home-arrive .95s ease-out both; }
.home-scene[data-state="entering"] .home-scene-foliage { animation: home-leaves-arrive 1s ease-in-out both; }
.home-scene[data-state="entering"] .home-bird-roof { animation: home-flight-roof 1.65s .95s both; }
.home-scene[data-state="entering"] .home-bird-branch { animation: home-flight-branch 1.55s 1.15s both; }
.home-scene[data-state="entering"] .home-bird-body { animation: home-bird-hop .65s 3.05s both; }
.home-scene[data-state="entering"] .home-bird-branch .home-bird-body { animation-delay: 3.25s; }
.home-scene[data-state="entering"] .home-bird-wing { animation: home-wing-flap .16s 1s 10, home-wing-flap .2s 3.4s 2; }
.home-scene[data-state="entering"] .home-bird-branch .home-bird-wing { animation-delay: 1.2s, 3.55s; }
.home-scene[data-paused="true"] *, .home-scene[data-paused="true"] { animation-play-state: paused !important; }
@keyframes home-arrive { from { opacity: 0; transform: translateY(7px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes home-leaves-arrive { 0%, 100% { transform: none; } 40% { transform: rotate(-3deg); } 75% { transform: rotate(1.5deg); } }
@keyframes home-flight-roof {
  0% { opacity: 0; transform: translate(330%, 100%) rotate(-14deg); }
  14% { opacity: 1; }
  34% { transform: translate(180%, 70%) rotate(-10deg); animation-timing-function: ease-in; }
  68% { transform: translate(30%, -10%) rotate(8deg); }
  88% { transform: translate(-3%, 3%) scaleY(.94); }
  100% { opacity: 1; transform: none; }
}
@keyframes home-flight-branch {
  0% { opacity: 0; transform: translate(-260%, 30%) rotate(12deg); }
  14% { opacity: 1; }
  36% { transform: translate(-150%, -35%) rotate(8deg); animation-timing-function: ease-in; }
  68% { transform: translate(-25%, -20%) rotate(-8deg); }
  88% { transform: translate(3%, 3%) scaleY(.94); }
  100% { opacity: 1; transform: none; }
}
@keyframes home-bird-hop {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(1px); animation-timing-function: ease-out; }
  50% { transform: translateY(-17%); animation-timing-function: ease-in; }
  80% { transform: translateY(0); }
}
@keyframes home-wing-flap { 0%, 100% { opacity: 0; transform: rotate(0); } 20%, 80% { opacity: 1; } 50% { opacity: 1; transform: rotate(-85deg) scaleY(.8); } }
@keyframes home-bird-idle-hop { 0%, 92%, 100% { transform: translateY(0); } 94% { transform: translateY(1px); } 96% { transform: translateY(-17%); } 98% { transform: translateY(0); } }
@keyframes home-leaves-rest { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(-1.5deg); } 96% { transform: rotate(.6deg); } }
@media (prefers-reduced-motion: reduce) {
  .home-scene, .home-scene * { animation: none !important; transition: none !important; }
  .dashboard-sky::before, .dashboard-sky::after { transition: none !important; }
}
.dashboard-welcome .dashboard-identity { position: relative; z-index: 1; max-width: 65%; }
.dashboard-welcome p { font-size: 12px; line-height: 1.5; color: #F6F2E8; }
.dashboard-welcome .dashboard-welcome-note { margin-top: 8px; max-width: 170px; font-size: 12px; }
.dashboard-wave { display: inline-flex; align-items: center; vertical-align: middle; }
.dashboard-name-row h1:focus { outline: none; }

.dashboard-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.dashboard-topline p {
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  margin-bottom: 3px;
}

.dashboard-topline h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.dashboard-identity {
  flex: 1;
  min-width: 0;
}

.dashboard-name-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}

.projection-alert {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 72px;
  min-width: 0;
  padding: 13px 14px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 21px;
  background: var(--white);
  color: var(--salvia-deep);
  text-align: left;
  cursor: pointer;
}
.dashboard-name-row h1 { min-width: 0; max-width: 100%; overflow-wrap: anywhere; font-size: clamp(24px, 7vw, 31px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.projection-alert > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.projection-alert.is-negative { color: var(--danger); background: var(--danger-tint); }
.projection-alert.is-neutral { color: var(--grafito); }
.projection-alert-symbol { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 50%; background: rgba(82,100,77,.08); }
.projection-alert.is-negative .projection-alert-symbol { background: var(--danger-tint-strong); }
.projection-alert-chevron { flex: 0 0 18px; }
.projection-alert b, .projection-alert small { display: block; line-height: 1.25; }
.projection-alert b { font-size: 13px; }
.projection-alert small { margin-top: 4px; font-size: 11px; line-height: 1.45; }
.projection-alert:focus-visible { outline: 2px solid var(--arena); outline-offset: 3px; }

.dashboard-projection-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--white);
  color: var(--grafito);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dashboard-projection-dialog::backdrop { background: rgba(35, 40, 32, .5); }
.dashboard-projection-dialog .dashboard-projection { margin: 0; padding: 20px; box-shadow: none; }
.dashboard-projection-dialog .dashboard-projection-heading { align-items: center; margin-bottom: 4px; }
.dashboard-projection-dialog .dashboard-projection-heading h2 { font-size: 17px; }
.projection-dialog-close { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--crema); color: var(--grafito); cursor: pointer; }
.projection-dialog-close:focus-visible { outline: 2px solid var(--salvia-deep); outline-offset: 2px; }
.projection-opening { color: var(--muted); font-size: 12px; margin: 4px 0 15px; }
.dashboard-projection-dialog .projection-primary { border: 0; padding: 0 0 12px; }
.dashboard-projection-dialog .projection-primary > strong { font-size: 28px; }
.dashboard-projection-dialog .projection-primary > span { min-height: 0; font-size: 13px; }
.dashboard-projection-dialog .dashboard-projection-grid { margin-top: 18px; }
.projection-breakdown { margin: 10px 0; font-size: 12px; }
.projection-breakdown > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.projection-breakdown dt { color: var(--muted); }
.projection-breakdown dd { margin: 0; white-space: nowrap; font-weight: 600; }
.projection-cash-warning { margin: 12px 0; font-size: 12px; color: var(--danger); }
.projection-categories-title { margin: 16px 0 4px; font-size: 13px; }

.dashboard-projection {
  margin-top: 16px;
  padding: 15px 16px 12px;
  border-radius: 16px;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 3px 12px rgba(95,91,87,0.10);
}

.dashboard-projection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.dashboard-projection-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-projection-heading span {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-projection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-projection-metric {
  min-width: 0;
  padding: 0 12px;
  border-left: 1px solid var(--arena);
}

.dashboard-projection-metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.dashboard-projection-metric:last-child {
  padding-right: 0;
}

.dashboard-projection-metric > span,
.dashboard-projection-metric > small {
  display: block;
  line-height: 1.35;
}

.dashboard-projection-metric > span {
  min-height: 2.7em;
  color: var(--grafito);
  font-size: 10px;
  font-weight: 600;
}

.dashboard-projection-metric > strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dashboard-projection-metric > strong.is-positive { color: var(--success); }
.dashboard-projection-metric > strong.is-negative { color: var(--danger); }
.dashboard-projection-metric > strong.is-gap { color: var(--terra-deep); }
.dashboard-projection-metric > strong.is-neutral,
.dashboard-projection-metric > strong.is-unknown { color: var(--grafito); }

.dashboard-projection-metric > small {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-projection-note {
  margin: 12px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--arena);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .dashboard-projection-grid { grid-template-columns: 1fr; }
  .dashboard-projection-metric {
    padding: 9px 0;
    border-left: 0;
    border-top: 1px solid var(--arena);
  }
  .dashboard-projection-metric:first-child { padding-top: 0; border-top: 0; }
  .dashboard-projection-metric:last-child { padding-bottom: 0; }
  .dashboard-projection-metric > span { min-height: 0; }
}

.hero-icon-btn {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--grafito);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.hero-icon-btn .hero-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #E53935;
  border: 1.5px solid var(--salvia-mid);
}

.balance-card {
  margin-top: 0;
  background: var(--white);
  border-radius: 24px;
  padding: 18px;
  color: var(--grafito);
  box-shadow: var(--shadow-card);
}
.balance-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.balance-card-heading > span { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.balance-card-heading button { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; min-height: 32px; padding: 5px 8px; border: 0; border-radius: 20px; color: var(--salvia-deep); background: var(--salvia-light); font: 600 10px 'Poppins', sans-serif; cursor: pointer; }

.balance-card > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.balance-card > .balance-currency-note {
  margin: -12px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.balance-card > strong {
  display: block;
  font-size: clamp(32px, 9.5vw, 42px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.balance-grid div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 5px;
}
.balance-grid div + div { border-left: 1px solid var(--arena); padding-left: 7px; }
.balance-stat-icon { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 24px; height: 28px; align-self: center; font-size: 18px; font-style: normal; color: var(--grafito); background: var(--neutral-stat, #F0EEE8); border-radius: 50%; }
.balance-stat-icon.is-income { background: var(--salvia-light); color: var(--salvia-deep); }
.balance-stat-icon.is-expense { background: var(--danger-light); color: var(--danger); }

.balance-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 3px;
}

.balance-grid b {
  color: var(--grafito);
  font-size: clamp(10px, 3.05vw, 14px);
  font-variant-numeric: tabular-nums;
}

.balance-budget-summary {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--arena);
}

.balance-budget-heading,
.balance-budget-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.balance-budget-heading {
  margin-bottom: 6px;
}

.balance-budget-heading > span:first-child {
  color: var(--grafito);
  font-size: 10px;
  font-weight: 600;
}

.budget-state {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.budget-state.is-within,
.budget-total-percent.is-within {
  background: var(--success-light);
  color: var(--success);
}

.budget-state.is-over,
.budget-total-percent.is-over {
  background: var(--danger-light);
  color: var(--danger);
}

.balance-budget-values {
  margin-bottom: 7px;
}

.balance-budget-values > div {
  min-width: 0;
}

.balance-budget-values strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  line-height: 1.25;
}

.balance-budget-values small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.budget-total-percent {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-error {
  margin-top: 14px;
}

.dashboard-content {
  padding: 18px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.quick-actions button {
  border: none;
  background: var(--white);
  border-radius: 16px;
  padding: 13px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(95,91,87,0.06);
}

.quick-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--terra-light);
  color: var(--terra-deep);
  font-weight: 800;
}

.quick-icon.muted {
  background: var(--crema);
  color: var(--grafito);
}

.quick-icon.ai {
  background: var(--salvia-light);
  color: var(--salvia-deep);
}

.quick-actions strong {
  color: var(--grafito);
  font-size: 12px;
}

.quick-actions small {
  color: var(--muted);
  font-size: 9.5px;
  text-align: center;
}

.dashboard-card {
  background: var(--white);
  border-radius: 23px;
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.dashboard-page .dashboard-content { padding: 14px 16px 24px; gap: 14px; }
.dashboard-ai-card { background: linear-gradient(135deg, var(--ai-card-from), var(--ai-card-to)); border: 1px solid rgba(112,135,92,.1); }
.dashboard-ai-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.nido-assistant-mascot { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.dashboard-ai-avatar { display: grid; place-items: center; flex: 0 0 43px; height: 43px; padding: 3px; background: var(--accent-strong); border-radius: 14px; }
.dashboard-ai-heading h2 { color: var(--grafito); font-size: 17px; font-weight: 700; line-height: 1.3; }
.dashboard-ai-heading p { font-size: 10px; line-height: 1.5; color: var(--muted); }
.dashboard-ai-link { display: grid; place-items: center; flex-shrink: 0; margin-left: auto; width: 36px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--salvia-deep); cursor: pointer; }
.dashboard-ai-message { display: block; font-size: 14px; font-weight: 600; line-height: 1.5; }
.dashboard-ai-description { margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.dashboard-ai-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; margin-top: 13px; }
.dashboard-ai-actions .btn { min-height: 39px; padding: 8px 10px; border-radius: 22px; font-size: 11px; line-height: 1.4; box-shadow: none; }
.dashboard-ai-actions .btn-secondary { border-color: transparent; background: var(--glass-surface, rgba(255,255,255,.75)); }
/* The last setup step of automatic capture: same scale as the assistant card above, no larger body text. */
.capture-setup-reminder { border: 1px solid rgba(112,135,92,.28); }
.capture-setup-reminder h2 { color: var(--grafito); font-size: 15px; font-weight: 700; line-height: 1.3; }
.capture-setup-reminder p { margin: 6px 0 13px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.capture-setup-reminder .btn { display: flex; align-items: center; justify-content: center; min-height: 39px; padding: 8px 10px; border-radius: 22px; font-size: 13px; line-height: 1.4; box-shadow: none; text-decoration: none; }
.dashboard-month-budget-progress { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.dashboard-month-budget-progress .budget-track { flex: 1; height: 11px; }
.dashboard-month-budget .balance-budget-values { margin: 0; }
.dashboard-month-budget .balance-budget-values strong { font-size: 16px; }
.dashboard-month-budget .balance-budget-values small { font-size: 10px; line-height: 1.5; }
.dashboard-month-budget .budget-state { white-space: normal; text-align: right; font-size: 9px; background: transparent; padding: 0; }
.dashboard-category-budget-card .dashboard-category-budget-overview { margin: 4px 0 0; border-radius: 12px; padding: 9px 11px; }
.dashboard-category-budget-overview summary { cursor: pointer; font-size: 10px; font-weight: 500; color: var(--muted); }
.dashboard-category-budget-overview[open] summary { margin-bottom: 12px; }
.dashboard-category-budget-card .budget-row-action { display: grid; grid-template-columns: 34px minmax(0, 1fr) 14px; align-items: center; gap: 9px; min-height: 46px; margin-bottom: 12px; }
.dashboard-category-icon { display: grid; place-items: center; width: 34px; height: 36px; border-radius: 50%; color: color-mix(in srgb, var(--category-color, var(--salvia-deep)) 55%, #374035); background: color-mix(in srgb, var(--category-color, var(--salvia)) 12%, #FCFAF4); }
.dashboard-category-copy { min-width: 0; }
.dashboard-category-chevron { color: var(--muted); }
.dashboard-category-budget-card .budget-row-heading { flex-wrap: wrap; row-gap: 3px; margin-bottom: 6px; }
.dashboard-category-budget-card .budget-row-heading > span:first-child { font-size: 12px; font-weight: 500; }
.dashboard-category-budget-card .budget-row-values b { font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dashboard-category-budget-card .budget-percent { display: none; }
.dashboard-category-budget-card .budget-track { height: 6px; background: var(--track); }
.dashboard-card .card-title-row h2 { font-size: 14px; font-weight: 600; letter-spacing: -.015em; }
.dashboard-card .card-title-row button { display: inline-flex; align-items: center; min-height: 32px; font-size: 10px; gap: 3px; }
.dashboard-card .card-title-row { margin-bottom: 12px; }
@media (max-width: 360px) {
  .dashboard-welcome .dashboard-welcome-note { max-width: 145px; }
  .dashboard-page .balance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .balance-grid div { display: flex; flex-direction: column; align-items: flex-start; }
  .balance-grid div + div { padding-left: 5px; }
  .balance-grid b { font-size: 11px; white-space: nowrap; }
  .balance-stat-icon { width: 24px; height: 24px; margin-bottom: 4px; }
  .balance-card-heading > span { font-size: 9px; }
}

/* Importes de Inicio: la cifra nunca se parte entre símbolo y número. La letra se ajusta al ancho real
   de la tarjeta (container query) según los caracteres de la cifra (--len, desde el ViewModel), y con
   cifras largas ingresos y gastos pasan a una fila cada uno. Sin soporte, quedan los tamaños de antes. */
@supports (width: 1cqi) {
  .balance-card { container: balance-card / inline-size; }
  .balance-card > strong.balance-total {
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: clamp(20px, calc(100cqi / (var(--len, 12) * 0.64)), 42px);
  }
  .balance-grid b {
    display: block;
    white-space: nowrap;
    font-size: clamp(10px, calc((33cqi - 40px) / (var(--len, 8) * 0.6)), 15px);
  }
  @container balance-card (max-width: 519px) {
    .dashboard-page .balance-grid.is-stacked { grid-template-columns: 1fr; gap: 0; }
    .balance-grid.is-stacked > div {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      align-items: center;
      column-gap: 10px;
      padding: 9px 0;
    }
    .balance-grid.is-stacked > div:first-child { padding-top: 2px; }
    .balance-grid.is-stacked > div:last-child { padding-bottom: 0; }
    .balance-grid.is-stacked > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--arena); }
    .balance-grid.is-stacked .balance-stat-icon { grid-column: 1; grid-row: 1; width: 28px; height: 28px; margin: 0; }
    .balance-grid.is-stacked span { grid-column: 2; grid-row: 1; margin: 0; font-size: 12px; }
    .balance-grid.is-stacked b {
      grid-column: 3; grid-row: 1; text-align: right;
      font-size: clamp(12px, calc((100cqi - 150px) / (var(--len, 10) * 0.6)), 16px);
    }
  }
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}

.card-title-row h2 {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
}

.card-title-row span,
.card-title-row button {
  border: none;
  background: transparent;
  color: var(--salvia-deep);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.budget-row {
  margin-bottom: 12px;
}

.budget-row-action {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.budget-row-action:hover {
  opacity: .82;
}

.budget-row-action:focus-visible {
  outline: 2px solid var(--salvia-deep);
  outline-offset: 4px;
  border-radius: 4px;
}

.budget-row:last-child {
  margin-bottom: 0;
}

.budget-row > div:first-child,
.budget-row-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.budget-row span {
  color: var(--muted);
  font-size: 11px;
}

.budget-row b {
  color: var(--grafito);
  font-size: 11px;
  text-align: right;
}

.budget-row-values {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.budget-row .budget-percent {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--success-light);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.budget-row .budget-percent.is-over {
  background: var(--danger-light);
  color: var(--danger);
}

.budget-track {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--crema);
  overflow: hidden;
}

.budget-track div,
.budget-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dashboard-transaction {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--crema);
}

/* Conexiones: lo que cubre y a qué fondo va, a la vista. */
/* Elegir qué tarjetas cubre la conexión: opciones con borde propio, sin el recuadro del navegador. */
.auto-capture-cards-choice { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; display: grid; gap: 8px; }
.auto-capture-cards-choice > legend { padding: 0; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--grafito); }
.auto-capture-cards-choice .auto-capture-check { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.auto-capture-cards-choice .auto-capture-check:has(input:checked) { border-color: var(--salvia-deep); background: var(--salvia-light); }
.auto-capture-cards-choice .fund-rules-card { display: grid; gap: 10px; }

/* Hoja «Editar conexión»: contenido con aire, pie con acciones apiladas y centradas. */
.auto-capture-edit-actions { display: grid; gap: 4px; justify-items: stretch; }
.auto-capture-edit-actions .savings-link-btn { justify-self: center; padding: 10px 16px; }
.auto-capture-edit-cards { display: grid; gap: 12px; margin-top: 18px; }
.auto-capture-edit-cards h3 { margin: 0; font-size: 15px; }
.auto-capture-edit-cards .fund-rules { margin: 0; padding: 0; border: 0; background: transparent; }

/* Lista de conexiones: encabezado con título y contador, y cada conexión en una tarjeta con fondo y borde propios. */
.connection-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.connection-list-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.connection-list-count { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--salvia-light); color: var(--salvia-deep); }
.auto-capture-connections-list .auto-capture-item { border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 14px; background: var(--white); box-shadow: 0 2px 10px rgba(95,91,87,0.05); }
.connection-card-title .auto-capture-state { font-size: 11px; line-height: 1.35; white-space: normal; }
/* Conexiones: cada una una tarjeta compacta (icono, nombre, estado, qué cubre y a qué fondo) con «Editar» a mano. */
.connection-card-head { display: flex; align-items: center; gap: 12px; }
.connection-card-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--salvia-light); color: var(--salvia-deep); }
.connection-card-icon.bank { background: var(--terra-light); color: var(--terra-deep); }
.connection-card-title { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.connection-card-title h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.connection-card-edit { flex: 0 0 auto; min-height: 40px; padding: 0 16px; width: auto; }
.connection-card-facts { display: grid; gap: 6px; margin: 12px 0 4px; padding: 12px; border-radius: 14px; background: var(--crema); font-size: 13px; }
.connection-card-facts > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.connection-card-facts dt { color: var(--muted); flex: 0 0 auto; }
.connection-card-facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.connection-card-more { margin-top: 6px; }
.connection-card-more > summary { cursor: pointer; padding: 10px 2px; font-size: 13px; color: var(--muted); list-style: none; }
.connection-card-more > summary::-webkit-details-marker { display: none; }

.auto-capture-connection-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; font-size: 13px; }
.auto-capture-connection-facts dt { color: var(--muted); }
.auto-capture-connection-facts dd { margin: 0; font-weight: 600; text-align: right; }

.dashboard-transaction[data-recent-transaction] { cursor: pointer; }
.dashboard-transaction[data-recent-transaction]:active { opacity: .7; }

.dashboard-transaction:last-child {
  border-bottom: none;
}

.transaction-main .dashboard-tx-details {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-tx-details time {
  flex-shrink: 0;
}

.dashboard-tx-details i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.mini-empty {
  background: var(--crema);
  color: var(--muted);
  border-radius: 12px;
  padding: 16px;
  font-size: 12px;
  text-align: center;
}

.muted-card {
  box-shadow: none;
}

.map-preview {
  height: 130px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, transparent 33%, #fff 33%, #fff 36%, transparent 36%, transparent 66%, #fff 66%, #fff 68%, transparent 68%),
    linear-gradient(0deg, transparent 44%, #fff 44%, #fff 49%, transparent 49%, transparent 72%, #fff 72%, #fff 75%, transparent 75%),
    #EEF2E8;
  position: relative;
  overflow: hidden;
}

.map-preview i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--terra);
  border: 2px solid var(--white);
}

.map-preview i:nth-child(1) { left: 20%; top: 25%; }
.map-preview i:nth-child(2) { left: 50%; top: 20%; background: var(--salvia); }
.map-preview i:nth-child(3) { left: 75%; top: 35%; }
.map-preview i:nth-child(4) { left: 35%; top: 62%; background: var(--salvia); }
.map-preview i:nth-child(5) { left: 66%; top: 58%; }

.map-stats {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.map-stats span {
  background: var(--glass-surface, rgba(255,255,255,0.92));
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--grafito);
  font-size: 10px;
  font-weight: 700;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.placeholder-grid div {
  background: var(--crema);
  border-radius: 13px;
  padding: 13px;
}

.placeholder-grid strong {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  margin-bottom: 5px;
}

.placeholder-grid span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

/* Profile */
.profile-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.profile-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--white);
  color: var(--salvia-deep);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-hero h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}

.profile-hero p {
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  margin-top: 4px;
}

.profile-content {
  padding: 18px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-stats {
  margin-top: -32px;
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.profile-stats div {
  border-left: 2px solid var(--arena);
  padding-left: 9px;
}

.profile-stats strong,
.profile-section span,
.profile-row span {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
}

.profile-stats span,
.profile-section small,
.profile-row small {
  color: var(--muted);
  font-size: 10px;
}

.profile-section,
.profile-debug {
  background: var(--white);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.profile-section button:not(.save-preferences-btn),
.profile-row {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 13px 12px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}

.profile-section button:not(.save-preferences-btn) {
  cursor: pointer;
}

.profile-section button:not(.save-preferences-btn):active {
  background: var(--crema);
}

.profile-row.muted {
  opacity: 0.72;
}

.profile-debug {
  gap: 6px;
  padding: 14px 16px;
}

.profile-debug span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-debug code {
  color: var(--grafito);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.logout-btn {
  border: 1px solid var(--terra);
  border-radius: 14px;
  background: var(--terra-light);
  color: var(--terra-deep);
  padding: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.profile-family-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--crema);
}

.member-row:last-child {
  border-bottom: none;
}

.member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.member-row strong {
  display: block;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
}

.member-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.preferences-section {
  padding: 12px 14px 14px;
}

.save-preferences-btn {
  border: none;
  border-radius: 14px;
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 13px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}

.save-preferences-btn:disabled {
  opacity: 0.65;
}

.mock-profile {
  background: var(--crema);
}

.profile-mock-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 70px 22px 36px;
}
/* Mientras se coloca el scroll guardado (scroll-memory.js) la pantalla no se ve, para que no se note el salto. */
html.scroll-restoring .profile-page,
html.scroll-restoring .dashboard-page { visibility: hidden; }
/* Configuración: el encabezado ocupaba casi la mitad de la pantalla; compacto, el menú se ve más. */
.profile-mock-hero.settings-hero { padding: 52px 22px 16px; }
.settings-hero .profile-mock-avatar { width: 56px; height: 56px; border-radius: 18px; font-size: 21px; }
.settings-hero .profile-id-row { gap: 14px; }
.settings-hero .profile-id-row h1 { font-size: 22px; }
.settings-hero .profile-family-name { margin-top: 4px; }
.settings-hero .profile-metric-grid { margin-top: 14px; gap: 8px; }
.settings-hero .profile-metric-grid div { padding: 8px 6px; border-radius: 12px; }
.settings-hero .profile-metric-grid strong { font-size: 18px; }
.settings-hero .profile-metric-grid span { margin-top: 3px; }

.profile-id-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-mock-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--white);
  color: var(--salvia-deep);
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(95,91,87,0.15);
  flex-shrink: 0;
}

.profile-id-row h1 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 25px;
  line-height: 1.08;
  font-weight: 800;
}

.profile-family-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 500;
}

.profile-family-name i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--terra);
  flex-shrink: 0;
}

.profile-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.profile-metric-grid div {
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
}

.profile-metric-grid strong {
  display: block;
  color: var(--on-accent);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.profile-metric-grid span {
  display: block;
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  margin-top: 6px;
}

.profile-menu-content {
  padding: 24px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-menu-card,
.profile-preferences-card {
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(95,91,87,0.04);
}

.profile-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}

.profile-menu-item:active {
  background: var(--crema);
}

.profile-menu-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-menu-icon.green {
  background: var(--salvia-light);
  color: var(--salvia-deep);
}

.profile-menu-icon.peach {
  background: var(--terra-light);
  color: var(--terra-deep);
}

.profile-menu-icon.gray {
  background: var(--neutral-soft);
  color: var(--muted);
}

.profile-menu-text {
  flex: 1;
  min-width: 0;
}

.profile-menu-text strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.profile-menu-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.profile-arrow {
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-menu-divider {
  height: 1px;
  background: var(--crema);
  margin-left: 86px;
}

.profile-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--terra-strong);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.profile-preferences-card {
  padding: 4px 18px 18px;
}

.currency-selector {
  position: relative;
  width: 100%;
}

.currency-selector-trigger {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--crema-dark);
  border-radius: 15px;
  background: var(--crema);
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  text-align: left;
  cursor: pointer;
}

.currency-selector-trigger:focus-visible,
.currency-search:focus-within {
  outline: 2px solid var(--salvia);
  outline-offset: 2px;
}

.currency-selector-trigger:disabled {
  opacity: .65;
  cursor: default;
}

.currency-flag {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--salvia-light);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 19px;
  font-style: normal;
}

.currency-selector-current,
.currency-option-copy {
  flex: 1;
  min-width: 0;
}

.currency-selector-current strong,
.currency-selector-current small,
.currency-option-copy strong,
.currency-option-copy small {
  display: block;
}

.currency-selector-current strong,
.currency-option-copy strong {
  font-size: 13px;
  color: var(--grafito);
}

.currency-selector-current small,
.currency-option-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-selector-chevron {
  color: var(--muted);
  font-size: 18px;
}

.currency-selector-panel {
  margin-top: 8px;
  border: 1px solid var(--crema-dark);
  border-radius: 17px;
  background: var(--white);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(95, 91, 87, .12);
}

.currency-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px;
  padding: 0 12px;
  min-height: 44px;
  border: 1.5px solid var(--crema-dark);
  border-radius: 13px;
  color: var(--muted);
  background: var(--crema);
}

.currency-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--grafito);
  font: 500 12px 'Poppins', sans-serif;
}

.currency-results {
  max-height: min(360px, 48vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 8px;
}

.currency-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  text-align: left;
  cursor: pointer;
}

.currency-option:hover,
.currency-option:active,
.currency-option.selected {
  background: var(--salvia-light);
}

.currency-option-copy strong i {
  margin-left: 5px;
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.currency-selected-mark {
  color: var(--salvia-deep);
  font-size: 17px;
  font-weight: 800;
}

.currency-empty {
  padding: 20px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.profile-email-preference {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 8px;
}

.profile-email-preference > div {
  flex: 1;
  min-width: 0;
}

.profile-email-preference strong,
.profile-email-preference small {
  display: block;
}

.profile-email-preference strong {
  color: var(--grafito);
  font-size: 14px;
}

.profile-email-preference small,
.profile-email-required-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-email-switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  cursor: pointer;
}

.profile-email-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-email-switch > span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--switch-off);
  transition: background .18s ease;
}

.profile-email-switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .18s ease;
}

.profile-email-switch input:checked + span {
  background: var(--salvia-mid);
}

.profile-email-switch input:checked + span::after {
  transform: translateX(18px);
}

.profile-email-switch input:focus-visible + span {
  outline: 3px solid rgba(91,111,88,.25);
  outline-offset: 2px;
}

.profile-email-required-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--salvia-light);
}

.profile-nidoia-card {
  background: var(--white);
  border-radius: 24px;
  padding: 17px 20px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.04);
}

.profile-nidoia-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-nidoia-heading > div {
  flex: 1;
  min-width: 0;
}

.profile-nidoia-heading strong,
.profile-nidoia-heading small {
  display: block;
}

.profile-nidoia-heading strong {
  color: var(--grafito);
  font-size: 15px;
}

.profile-nidoia-heading small,
.profile-nidoia-card p {
  color: var(--muted);
  font-size: 12px;
}

.profile-nidoia-heading > span:last-child {
  color: var(--salvia-deep);
  font-size: 13px;
  font-weight: 700;
}

.profile-nidoia-track {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--salvia-light);
}

.profile-nidoia-track i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--salvia);
}

.profile-nidoia-card p {
  margin: 8px 0 0;
}

.profile-logout {
  margin-bottom: 10px;
}

/* Funds */
.funds-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.funds-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.fund-add-btn {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia-deep);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.fund-add-btn span {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--salvia-light);
  display: grid;
  place-items: center;
  line-height: 1;
}

.funds-hero h1 {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}

.funds-total-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.funds-total-card span,
.funds-total-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.funds-total-card strong {
  display: block;
  color: var(--grafito);
  font-size: 31px;
  line-height: 1.1;
  font-weight: 800;
  margin: 5px 0 6px;
}

.funds-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Categorias ───────────────────────────────────────── */
.categories-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}
.categories-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.categories-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.92);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.categories-hero h1 {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.categories-add {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia-deep);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.categories-total-card {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.categories-total-card span,
.categories-total-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.categories-total-card strong {
  display: block;
  color: var(--grafito);
  font-size: 31px;
  line-height: 1.1;
  font-weight: 800;
  margin: 5px 0 6px;
}
.categories-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.category-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.category-group-card { background: var(--white); border: 1px solid var(--arena); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-card); }
.category-group-heading { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border-bottom: 1px solid var(--arena); background: linear-gradient(120deg, var(--salvia-light), var(--white)); }
.category-group-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; }
.category-group-title { flex: 1; min-width: 0; }
.category-group-title h2 { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.category-group-title small, .category-group-budget span { display: block; font-size: 10px; color: var(--muted); }
.category-group-budget { max-width: 44%; text-align: right; }
.category-group-budget strong { display: block; font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.category-group-card .category-card { border-radius: 0; box-shadow: none; padding: 14px; }
.category-group-card .category-card + .category-card { border-top: 1px solid var(--arena); }
.category-group-card .category-text strong { white-space: normal; overflow-wrap: anywhere; }
.category-main {
  display: flex;
  gap: 13px;
  align-items: center;
}
.category-dot-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.category-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}
.category-dot-box svg {
  display: block;
}
.category-text {
  flex: 1;
  min-width: 0;
}
.category-text strong {
  display: block;
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.category-type-chip {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--crema);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
}
.category-budget {
  color: var(--muted);
  font-size: 10.5px;
}
.category-availability {
  color: var(--salvia-deep);
  font-size: 10px;
  font-weight: 600;
}
.form-field > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.category-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ── Ingresos y gastos fijos ──────────────────────────── */
.fixed-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}
.fixed-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.fixed-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.92);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.fixed-hero h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 4px;
}
.fixed-add {
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--salvia-deep);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.fixed-summary {
  margin: -12px 22px 18px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fixed-summary span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.fixed-summary strong {
  display: block;
  color: var(--grafito);
  font-size: 19px;
  font-weight: 800;
  margin-top: 3px;
}
.fixed-summary-income {
  border-left: 1px solid var(--crema);
  padding-left: 14px;
}
.fixed-chips {
  display: flex;
  gap: 7px;
  padding: 0 22px 14px;
}
.fixed-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fixed-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  gap: 13px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}
.fixed-card.paused { opacity: 0.6; }
.fixed-bar {
  width: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.fixed-bar.income { background: var(--salvia); }
.fixed-bar.expense { background: var(--terra); }
.fixed-main { flex: 1; min-width: 0; }
.fixed-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.fixed-title { min-width: 0; }
.fixed-title strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fixed-title span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.fixed-amount {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.fixed-amount.income { color: var(--salvia-deep); }
.fixed-amount.expense { color: var(--terra-deep); }
.fixed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.fixed-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--muted);
}
.fixed-switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--arena-ui);
  position: relative;
  transition: background 0.2s;
}
.fixed-switch.on { background: var(--salvia-mid); }
.fixed-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.fixed-switch.on .fixed-knob { left: 16px; }
.fixed-edit { margin-left: auto; }

/* ── Login: overlay de preparación ────────────────────── */
.login-preparing {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: var(--loading-veil-strong, rgba(247,243,238,0.92));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}
.login-spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid var(--arena);
  border-top-color: var(--salvia-deep);
  animation: nido-spin 0.8s linear infinite;
}
@keyframes nido-spin {
  to { transform: rotate(360deg); }
}

.fund-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  gap: 13px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
}

.fund-color {
  width: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.fund-main {
  flex: 1;
  min-width: 0;
}

.fund-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 13px;
}

.fund-title-row strong {
  display: block;
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
}

.fund-title-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.default-badge {
  border-radius: 999px;
  background: var(--salvia-light);
  color: var(--salvia-deep) !important;
  padding: 5px 9px;
  font-size: 9px !important;
  font-weight: 800;
  white-space: nowrap;
}

.fund-balance-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

.fund-balance-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.fund-balance-row b {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 800;
}

.fund-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.set-default-btn {
  border: none;
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
  padding: 10px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.set-default-btn.is-danger { color: var(--terra-deep); }

.primary-action.inline {
  margin-top: 10px;
  width: 100%;
}

.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-dot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--arena);
  cursor: pointer;
}

.color-dot.selected {
  box-shadow: 0 0 0 3px var(--grafito);
}

.category-icon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-icon-option {
  min-width: 0;
  border: 1px solid var(--arena);
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.category-icon-option svg {
  flex-shrink: 0;
}

.category-icon-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-icon-option.selected {
  border-color: var(--icon-color);
  background: color-mix(in srgb, var(--icon-color) 16%, white);
  color: var(--icon-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--icon-color) 24%, transparent);
}

/* Family */
.family-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 24px;
}

.family-hero {
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 52px 22px 24px;
}

.family-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  padding: 0;
}

.family-hero h1 {
  color: var(--on-accent);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  margin-top: 4px;
}

.family-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.family-metric-grid div {
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 10px 0;
  text-align: center;
}

.family-metric-grid strong,
.family-metric-grid span {
  display: block;
  color: var(--on-accent);
}

.family-metric-grid strong {
  font-size: 18px;
  font-weight: 800;
}

.family-metric-grid span {
  font-size: 9.5px;
  color: rgba(255,255,255,0.92);
}

.family-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.family-invite-card {
  margin-top: -12px;
  background: var(--white);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.family-invite-card strong,
.family-invite-card span {
  display: block;
}

.family-invite-card strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 800;
}

.family-invite-card span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  margin-top: 4px;
}

.family-invite-btn {
  border: none;
  border-radius: 14px;
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(168,187,160,0.35);
  white-space: nowrap;
}

.family-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.family-member-card {
  background: var(--white);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(95,91,87,0.05);
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.family-avatar {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
}

.family-avatar.pending {
  background: var(--terra-light);
  color: var(--terra-deep);
}

.family-member-main {
  flex: 1;
  min-width: 0;
}

.family-member-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.family-member-title strong {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-member-main small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

.family-status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}

.family-status.active {
  background: var(--salvia-light);
  color: var(--salvia-deep);
}

.family-status.pending {
  background: var(--terra-light);
  color: var(--terra-deep);
}

.auto-post-rule-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auto-post-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 14px;
  background: var(--crema);
  padding: 10px 12px;
}

.auto-post-rule div {
  min-width: 0;
}

.auto-post-rule strong,
.auto-post-rule small {
  display: block;
  overflow-wrap: anywhere;
}

.auto-post-rule strong {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 800;
}

.auto-post-rule small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.family-notice {
  margin: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.family-hint {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.family-warning {
  margin: 12px 0 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.family-received-card {
  border: 1.5px solid var(--salvia-deep);
}

.family-join-card {
  margin-top: 0;
}

.family-secondary-btn {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--grafito);
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.family-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.family-link-btn {
  border: none;
  border-radius: 10px;
  background: var(--crema);
  color: var(--grafito);
  min-height: 34px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.family-link-btn.danger {
  color: var(--danger);
  background: var(--danger-tint);
}

.family-link-btn:disabled,
.family-secondary-btn:disabled,
.family-invite-btn:disabled,
.family-leave-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.family-leave-btn {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--danger-tint-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--danger);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 4px;
}

.sheet-actions .family-leave-btn {
  margin-top: 10px;
}

.family-code-input {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.family-join-preview {
  border-radius: 16px;
  background: var(--crema);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.family-join-preview strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 800;
}

.family-join-preview span {
  color: var(--muted);
  font-size: 12px;
}

.family-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
}

.family-confirm-check input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--accent-strong);
  flex-shrink: 0;
}

.family-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.family-chip-row span {
  border-radius: 999px;
  background: var(--crema);
  color: var(--grafito);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 360px) {
  .quick-actions,
  .balance-grid,
  .fund-balance-row,
  .family-metric-grid {
    grid-template-columns: 1fr;
  }

  .placeholder-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Chat: markdown en respuestas de la IA ─────────────────── */
.bubble-md p { margin: 0 0 8px; }
.bubble-md p:last-child { margin-bottom: 0; }
.bubble-md ul,
.bubble-md ol { margin: 4px 0 8px; padding-left: 18px; }
.bubble-md li { margin-bottom: 3px; }
.bubble-md strong { font-weight: 700; }
.bubble-md h1, .bubble-md h2, .bubble-md h3, .bubble-md h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 4px;
  color: inherit;
}
.bubble-md code {
  background: var(--crema);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11.5px;
}
.bubble-md pre {
  background: var(--crema);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-x: auto;
  margin: 6px 0;
}
.bubble-md pre code { background: none; padding: 0; }
.bubble-md table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 12px;
  width: 100%;
}
.bubble-md th,
.bubble-md td {
  border: 1px solid var(--arena);
  padding: 4px 8px;
  text-align: left;
}
.bubble-md th { background: var(--crema); font-weight: 600; }
.bubble-md blockquote {
  border-left: 3px solid var(--arena);
  margin: 6px 0;
  padding-left: 10px;
  color: var(--muted);
}
.bubble-md a { color: var(--salvia-deep); }
.bubble-md hr { border: none; border-top: 1px solid var(--arena); margin: 8px 0; }

/* ── Chat: historial de sesiones ───────────────────────────── */
.chat-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.chat-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--crema);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grafito);
}
.chat-menu-wrapper { position: relative; }
/* Cierra el menú al tocar fuera, sin capturar el toque de la propia lista. */
.chat-menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.chat-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 31;
  min-width: 210px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--arena);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--grafito);
  text-align: left;
}
.chat-menu-item:hover,
.chat-menu-item.active { background: var(--crema); }
.chat-history-sheet {
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}
.chat-newchat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-strong);
  color: var(--on-accent);
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-session-list {
  overflow-y: auto;
  flex: 1;
}
.chat-sessions-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 0;
}
.chat-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--crema);
}
.chat-session-row:last-child { border-bottom: none; }
.chat-session-main {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 9px 4px;
  font-family: 'Poppins', sans-serif;
}
.chat-session-main strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--grafito);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-session-main.active strong { font-weight: 700; }
.chat-session-main span {
  font-size: 10.5px;
  color: var(--muted);
}
.chat-session-trash {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.chat-session-confirm {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.chat-session-no {
  border: 1px solid var(--arena);
  background: var(--white);
  border-radius: 10px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--grafito);
}
.chat-session-yes {
  border: none;
  background: var(--terra-strong);
  border-radius: 10px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--on-accent);
}

/* Statement import inside Nido IA */
.chat-heading-copy {
  min-width: 0;
  flex: 1;
}
.chat-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--grafito);
}
.chat-subtitle {
  font-size: 11px;
  color: var(--salvia-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-icon-btn.active {
  color: var(--salvia-deep);
  background: var(--salvia-light);
  box-shadow: inset 0 0 0 1px var(--salvia-mid);
}
.chat-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.chat-error {
  align-self: center;
  font-size: 12px;
}
.statement-import-row {
  align-items: flex-end;
}
.statement-import-card {
  width: min(100%, 390px);
  min-width: 0;
  padding: 15px;
  border-radius: 16px 16px 16px 4px;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 2px 10px rgba(66, 62, 58, 0.08);
}
.statement-import-setup {
  width: min(100%, 390px);
  min-width: 0;
  padding: 15px;
  border-radius: 16px 16px 16px 4px;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 2px 10px rgba(66, 62, 58, 0.08);
}
.statement-import-setup-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--crema);
}
.statement-import-setup-heading h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}
.statement-import-setup-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.statement-import-fund-field {
  display: grid;
  gap: 6px;
  margin: 13px 0 11px;
}
.statement-import-fund-field > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
.statement-import-fund-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 35px 0 12px;
  border: 1px solid var(--arena-ui);
  border-radius: 9px;
  background: var(--crema);
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  outline: none;
}
.statement-import-fund-field select:focus {
  border-color: var(--salvia-mid);
  box-shadow: 0 0 0 2px var(--salvia-light);
}
.statement-import-funds-loading,
.statement-import-no-funds {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}
.statement-import-no-funds {
  flex-direction: column;
}
.statement-import-no-funds button {
  border: 0;
  background: transparent;
  color: var(--salvia-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.statement-import-upload {
  min-height: 48px;
  padding: 0 14px;
  border: 1px dashed var(--salvia-mid);
  border-radius: 9px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.statement-import-upload.uploading {
  border-style: solid;
  cursor: progress;
}
/* Ruedita puramente CSS: se muestra en cuanto el navegador recibe el archivo,
   sin esperar al circuito (que puede estar reconectando). */
.statement-import-upload.uploading::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid var(--arena);
  border-top-color: var(--salvia-deep);
  border-radius: 50%;
  animation: ptr-spin 0.7s linear infinite;
}
.statement-import-upload.disabled {
  border-color: var(--arena);
  background: var(--crema);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.statement-import-file-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  text-align: center;
}
.statement-import-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--crema);
}
.statement-import-card-header > div {
  min-width: 0;
}
.statement-import-card-header h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}
.statement-import-card-header p {
  margin: 3px 0 0;
  font-size: 10.5px;
  color: var(--muted);
}
.statement-import-status {
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.statement-import-status.completed {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.statement-import-file {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 11px 0;
  color: var(--muted);
  font-size: 10.5px;
}

.statement-import-processing {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 22px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.statement-import-failed {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--terra) 35%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--terra) 10%, white);
    color: var(--terra-deep);
    font-size: 0.78rem;
    font-weight: 600;
}
.statement-import-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-import-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--crema);
  border-bottom: 1px solid var(--crema);
}
.statement-import-totals span,
.statement-import-fund span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}
.statement-import-totals strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.statement-import-totals .expense { color: var(--terra-deep); }
.statement-import-totals .income { color: var(--salvia-deep); }
.statement-import-totals .projected {
  padding-left: 9px;
  border-left: 2px solid var(--salvia-mid);
}
.statement-import-totals .projected.positive strong { color: var(--salvia-deep); }
.statement-import-totals .projected.negative {
  border-left-color: var(--terra);
}
.statement-import-totals .projected.negative strong { color: var(--terra-deep); }
.statement-import-categories {
  display: grid;
  gap: 6px;
  padding: 12px 0 9px;
}
.statement-import-categories > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
}
.statement-import-categories > div span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-import-categories > div strong {
  flex-shrink: 0;
  font-weight: 600;
}
.statement-import-categories > div strong.income { color: var(--salvia-deep); }
.statement-import-categories > div strong.expense { color: var(--terra-deep); }
.statement-import-categories p {
  margin: 0;
  color: var(--salvia-deep);
  font-size: 10px;
}
.statement-import-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.statement-import-chips span,
.statement-import-chips button {
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 9.5px;
}
.statement-import-chips .duplicate {
  color: var(--salvia-deep);
  background: var(--salvia-light);
}
.statement-import-chips .review {
  color: var(--terra-deep);
  background: var(--terra-light);
}
.statement-import-chips button.review,
.statement-import-chips button.duplicate {
  cursor: pointer;
}
.statement-import-chips .success {
  color: var(--salvia-deep);
  background: var(--salvia-light);
  cursor: pointer;
}
.statement-import-chips .excluded {
  color: var(--grafito);
  background: var(--arena);
  cursor: pointer;
}
.statement-import-validation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  margin: 0 0 11px;
  border-radius: 8px;
  background: var(--crema);
}
.statement-import-validation-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  border-radius: 6px;
  background: var(--white);
}
.statement-import-validation > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.statement-import-validation strong {
  font-size: 10px;
  line-height: 1.3;
}
.statement-import-validation small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.statement-import-validation.matched {
  color: var(--salvia-deep);
  background: var(--salvia-light);
}
.statement-import-validation.mismatch {
  color: var(--terra-deep);
  background: var(--terra-light);
}
.statement-import-draft-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin: 0 0 9px;
}
.statement-import-draft-actions button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--arena-ui);
  border-radius: 7px;
  background: var(--white);
  color: var(--grafito);
  font-family: inherit;
  font-size: 9.5px;
  cursor: pointer;
}
.statement-import-draft-actions button.danger {
  color: var(--terra-deep);
}
.statement-import-review-notice {
  margin: 0 0 8px;
  color: var(--terra-deep);
  font-size: 10px;
  line-height: 1.4;
}
.statement-import-fund {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: var(--crema);
}
.statement-import-fund strong {
  display: block;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.statement-import-fund strong.pending { color: var(--terra-deep); }
.statement-import-confirm {
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.statement-import-confirm:disabled {
  background: var(--arena);
  cursor: not-allowed;
}
.statement-import-complete {
  min-height: 42px;
  border-radius: 10px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
}

.statement-review-sheet {
  width: min(100%, 560px);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.statement-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 12px;
  flex-shrink: 0;
}
.statement-review-header.compact {
  justify-content: flex-start;
  align-items: center;
}
.statement-review-header > div {
  min-width: 0;
}
.statement-review-header h2 {
  margin: 0;
  color: var(--grafito);
  font-size: 16px;
  line-height: 1.3;
}
.statement-review-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.statement-review-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
}
.statement-review-list {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--arena);
}
.statement-review-row {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--arena);
  background: transparent;
  color: var(--grafito);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.statement-review-item.pending {
  background: color-mix(in srgb, var(--terra-light) 36%, transparent);
}
.statement-review-item.excluded {
  background: color-mix(in srgb, var(--arena) 45%, transparent);
}
.statement-review-item.excluded .statement-review-row {
  opacity: .62;
}
.statement-review-checkbox {
  margin: 0;
  accent-color: var(--salvia-deep);
  cursor: pointer;
}
.statement-review-checkbox:disabled {
  cursor: default;
  opacity: .8;
}
.statement-review-side small.excluded {
  color: var(--grafito);
  background: var(--arena);
}
.statement-draft-confirm {
  padding: 20px;
}
.statement-draft-confirm h2 {
  margin: 4px 0 7px;
  font-size: 16px;
}
.statement-draft-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.statement-draft-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}
.statement-draft-confirm-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.statement-draft-confirm-actions .secondary {
  background: var(--crema);
  color: var(--grafito);
}
.statement-draft-confirm-actions .primary {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.statement-draft-confirm-actions .primary.danger {
  background: var(--terra);
}
.statement-review-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.statement-review-main,
.statement-review-side {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.statement-review-main strong {
  overflow: hidden;
  color: var(--grafito);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-review-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-review-side {
  justify-items: end;
}
.statement-review-side strong {
  font-size: 10.5px;
  white-space: nowrap;
}
.statement-review-side strong.income,
.statement-review-transaction strong.income {
  color: var(--salvia-deep);
}
.statement-review-side strong.expense,
.statement-review-transaction strong.expense {
  color: var(--terra-deep);
}
.statement-review-side small {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--terra-light);
  color: var(--terra-deep);
  font-size: 8px;
  font-weight: 700;
}
.statement-review-transaction {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 11px 0;
  margin-bottom: 10px;
  border-top: 1px solid var(--arena);
  border-bottom: 1px solid var(--arena);
}
.statement-review-transaction span,
.statement-review-transaction small {
  color: var(--muted);
  font-size: 10px;
}
.statement-review-transaction strong {
  font-size: 12px;
}
.statement-review-transaction small {
  grid-column: 1 / -1;
}
.statement-review-category-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 0 14px;
  overflow-y: auto;
}
.statement-review-category-grid .category-picker-option {
  min-width: 0;
}
.statement-review-category-grid + .statement-import-confirm {
  flex-shrink: 0;
}
.chat-session-type {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .chat-header {
    gap: 9px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .chat-header-actions { gap: 5px; }
  .chat-icon-btn {
    width: 32px;
    height: 32px;
  }
  .chat-messages { padding-left: 16px; padding-right: 16px; }
  .chat-input-bar { padding-left: 16px; padding-right: 16px; gap: 7px; }
  .chat-send-btn {
    width: 38px;
    height: 38px;
  }
  .chat-mic-btn { width: 38px; height: 38px; }
  .chat-dictation-status { padding-left: 16px; padding-right: 16px; }
  .chat-input {
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 11.5px;
  }
  .statement-import-card { padding: 13px; }
}

/* ── Categoría en filas de transacción ─────────────────────── */
.transaction-main .tx-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: normal;
}
.tx-row-meta > i {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}
.tx-row-meta .tx-meta-date { flex-shrink: 0; }
.transaction-row.draft { background: var(--terra-light); }
.transaction-row.draft .transaction-amount { opacity: .7; font-style: italic; }
.transaction-main .tx-draft-badge {
  display: block;
  border-radius: 10px;
  padding: 1px 7px;
  margin-top: 0;
  background: var(--terra);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.tx-row-meta .tx-meta-who {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transaction-main .tx-cat-chip {
  display: block;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 500;
  color: var(--grafito);
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-cat-chip svg {
  flex-shrink: 0;
}
.tx-detail-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tx-detail-cat svg {
  flex-shrink: 0;
}

/* ── Metas de ahorro ───────────────────────────────────────── */
.savings-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 90px;
  position: relative;
}
.savings-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.savings-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.savings-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.savings-name strong {
  color: var(--grafito);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.savings-top > b {
  color: var(--grafito);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.savings-pace {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.savings-pace.achieved { background: var(--salvia-light); color: var(--salvia-deep); }
.savings-pace.ontrack  { background: var(--salvia-light); color: var(--salvia-deep); }
.savings-pace.atrisk   { background: var(--warning-light); color: var(--warning); }
.savings-pace.offtrack { background: var(--terra-light); color: var(--terra-deep); }
.savings-pace.nodate   { background: var(--neutral-chip); color: var(--muted); }
.savings-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.savings-projection {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.savings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.savings-contribute-btn {
  border: none;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--on-accent);
  padding: 9px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.savings-link-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.savings-link-btn.danger { color: var(--terra-deep); }
.savings-color-input {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}
.savings-shared-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--grafito);
  font-size: 13px;
  margin-top: 4px;
}
.savings-hint {
  color: var(--terra-deep);
  font-size: 12px;
  background: var(--terra-light);
  border-radius: 12px;
  padding: 10px 12px;
}
.confirm-sheet h2 {
  color: var(--grafito);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
}
.confirm-text {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}
.confirm-sheet .form-field { margin-top: 0; margin-bottom: 20px; }
.confirm-error { margin-bottom: 16px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-cancel {
  flex: 1;
  border: 1px solid var(--line, #E5E1D8);
  background: var(--white);
  color: var(--grafito);
  border-radius: 14px;
  padding: 13px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.confirm-delete {
  flex: 1;
  border: none;
  background: var(--terra-strong);
  color: var(--on-accent);
  border-radius: 14px;
  padding: 13px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}


/* ── Notificaciones ────────────────────────────────────────── */
.notif-page {
  min-height: 100vh;
  background: var(--crema);
  padding-bottom: 90px;
  position: relative;
}
.notif-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--crema);
  cursor: pointer;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}
.notif-row:last-child { border-bottom: none; }
.automatic-capture-page .auto-capture-card { padding: 20px; margin-bottom: 18px; }
.auto-capture-card h2 { font-size: 18px; margin: 0 0 12px; }
.auto-capture-card h3 { font-size: 15px; margin: 0; }
.auto-capture-card p, .auto-capture-card li { font-size: 13px; line-height: 1.65; }
.auto-capture-card li + li { margin-top: 10px; }
.auto-capture-fields { border: 0; margin: 0; padding: 0; display: grid; gap: 16px; min-width: 0; }
.auto-capture-check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; }
.auto-capture-check input { width: 22px; height: 22px; flex-shrink: 0; }
.auto-capture-source { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 1px solid var(--arena-ui); border-radius: 14px; font-size: 14px; }
.auto-capture-source.selected { border-color: var(--salvia-deep); background: var(--crema); font-weight: 600; }
.auto-capture-source input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--salvia-deep); }
.auto-capture-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.auto-capture-card > a.btn { margin-top: 16px; }
.auto-capture-actions button, .auto-capture-card summary { min-height: 44px; cursor: pointer; }
.auto-capture-card summary { display: flex; align-items: center; gap: 12px; list-style: none; font-size: 13px; font-weight: 700; color: var(--grafito); }
.auto-capture-card summary::-webkit-details-marker { display: none; }
.auto-capture-card summary::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; flex-shrink: 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.2s ease;
}
.auto-capture-card details[open] > summary::after, .auto-capture-card[open] > summary::after { transform: rotate(-135deg); }
.auto-capture-item { border-top: 1px solid var(--crema); padding: 16px 0; overflow-wrap: anywhere; }
.auto-capture-item a { display: block; padding: 12px 0; }
.auto-capture-item p { margin: 4px 0; }
.auto-capture-notice { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--salvia); border-radius: 12px; font-size: 12.5px; line-height: 1.5; }
.auto-capture-notice .savings-link-btn { flex: 0 0 auto; padding: 4px 0; }
.auto-capture-header, .auto-capture-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auto-capture-header h2 { margin: 0; }
.auto-capture-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auto-capture-benefits li { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 14px; color: var(--grafito); }
.auto-capture-benefits li + li { margin-top: 0; }
.auto-capture-step-count { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.05em; }
.auto-capture-progress { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; padding: 0; }
.auto-capture-progress li { height: 6px; border-radius: 999px; background: var(--crema); margin: 0; transition: background-color 0.3s ease; }
.auto-capture-progress li + li { margin-top: 0; }
.auto-capture-progress li.done { background: var(--salvia-mid); }
.auto-capture-progress li.current { background: var(--accent-strong); }
.auto-capture-howto { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; counter-reset: howto; }
.auto-capture-howto li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--crema); color: var(--grafito); }
.auto-capture-howto li + li { margin-top: 0; }
.auto-capture-howto-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: var(--salvia-light); color: var(--salvia-deep); }
.auto-capture-state { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--crema); color: var(--muted); }
.auto-capture-state.working, .auto-capture-state.tested { background: var(--salvia-light); color: var(--salvia-deep); }
.auto-capture-state.expired, .auto-capture-state.notverified { background: var(--terra-light); color: var(--terra-deep); }
.auto-capture-more { margin-top: 4px; }
.auto-capture-more[open] > summary { margin-bottom: 8px; }
.auto-capture-later { display: block; margin: 12px auto 0; min-height: 44px; }
.auto-capture-manual ol { padding-left: 18px; }
/* Fondo de PinNido frente a tarjeta de Cartera: aclaración breve bajo el selector. */
.auto-capture-hint { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
/* Ruta resumida dentro de Atajos: chips con los nombres de Apple, no una captura de pantalla. */
.auto-capture-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.auto-capture-chip { padding: 4px 10px; border-radius: 999px; background: var(--salvia-light); color: var(--salvia-deep); font-size: 12px; font-weight: 700; line-height: 1.4; }
.auto-capture-chip + .auto-capture-chip::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 8px 1px 0; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); color: var(--muted); }
.auto-capture-card .auto-capture-howto { animation: auto-capture-step-in 0.24s ease-out; }
@keyframes auto-capture-step-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .auto-capture-progress li, .auto-capture-card summary::after { transition: none; }
  .auto-capture-card .auto-capture-howto { animation: none; }
}
.notif-row.unread { background: rgba(168, 187, 160, 0.08); }
.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon.achieved { background: var(--salvia-light); color: var(--salvia-deep); }
.notif-icon.progress { background: var(--salvia-light); color: var(--salvia-deep); }
.notif-icon.warning  { background: var(--warning-light); color: var(--warning); }
.notif-icon.danger   { background: var(--terra-light); color: var(--terra-deep); }
.notif-icon.info     { background: var(--crema); color: var(--muted); }
.notif-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-main strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--grafito);
}
.notif-row.unread .notif-main strong { font-weight: 700; }
.notif-main > span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.notif-meta i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terra);
}


/* ── Configuración de notificaciones ───────────────────────── */
.notif-header-actions { display: flex; gap: 8px; align-items: center; }
.notif-gear-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-settings-sub {
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  margin-top: 4px;
}
.notif-rule-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--crema);
}
.notif-rule-row:last-child { border-bottom: none; }
.notif-rule-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-rule-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.notif-rule-text strong { font-size: 13px; font-weight: 600; color: var(--grafito); }
.notif-rule-text span { font-size: 10.5px; color: var(--muted); }
.notif-switch {
  width: 38px;
  height: 21px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  background: var(--arena-ui);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.notif-switch.on { background: var(--salvia-mid); }
.notif-switch:disabled { opacity: 0.6; }
.notif-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.notif-switch.on .notif-knob { left: 19px; }
.notif-days-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: var(--crema);
  border-radius: 12px;
  padding: 9px 12px;
}
.notif-days-row > span { flex: 1; font-size: 11.5px; color: var(--grafito); }
.notif-days-row > b { font-size: 12.5px; font-weight: 700; color: var(--grafito); min-width: 52px; text-align: center; }
.notif-step {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: var(--white);
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--grafito);
}
.notif-step:disabled { opacity: 0.6; }
.notif-settings-note {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}
.notif-settings-section {
  margin: 22px 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.notif-settings-section:first-child { margin-top: 0; }
.notif-channel-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notif-channel-card { overflow: hidden; }
.notif-channel-head {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: var(--white);
  color: var(--grafito);
  text-align: left;
  cursor: pointer;
}
.notif-channel-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-channel-icon.push { color: var(--on-accent); background: var(--salvia); }
.notif-channel-icon.email { color: var(--terra-deep); background: var(--terra-light); }
.notif-channel-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-channel-copy strong { font-size: 13.5px; font-weight: 700; }
.notif-channel-copy span { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.notif-channel-chevron {
  display: flex;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.notif-channel-card.expanded .notif-channel-chevron { transform: rotate(90deg); }
.notif-channel-body { border-top: 1px solid var(--crema); }
.notif-channel-note {
  margin: 0;
  padding: 11px 16px 14px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--crema);
}
.notif-capture-settings {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}
.notif-capture-settings .form-field { align-self: stretch; }
.notif-capture-status {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}
.notif-capture-status.is-on { color: var(--success); font-weight: 600; }
.notif-capture-status.is-attention { color: var(--warning); font-weight: 600; }
.fund-rules { align-self: stretch; padding-top: 10px; border-top: 1px solid var(--crema); }
.fund-rules-title { font-size: 12px; }
.fund-rules-list { list-style: none; margin: 0; padding: 0; align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.fund-rules-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.fund-rules-text { display: flex; flex-direction: column; min-width: 0; font-size: 11px; overflow-wrap: anywhere; }
.fund-rules-text > span { color: var(--muted); }
.fund-rules-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-self: stretch; }
.fund-rules-card .is-attention { padding-left: 0; margin: 0; }
/* Una etiqueta de dos líneas no baja su campo respecto al de al lado. */
.fund-rules-card .form-field { justify-content: space-between; margin: 0; }
/* La lista arranca separada de la cabecera verde. */
.playbooks-content { padding-top: 16px; }
.playbook-card {
  display: flex;
  flex-direction: column;
}
.playbook-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
.playbook-head-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.playbook-head-text strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--grafito);
}
.playbook-head-text span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.playbook-chevron {
  color: var(--muted);
  display: flex;
  padding-top: 2px;
  transition: transform 0.15s ease;
}
.playbook-card.expanded .playbook-chevron { transform: rotate(90deg); }
.playbook-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--crema);
  padding-top: 12px;
}
.playbook-data small {
  font-size: 10.5px;
  color: var(--muted);
}
.playbook-data ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.playbook-data li {
  font-size: 11.5px;
  color: var(--grafito);
  line-height: 1.6;
}
.playbook-unavailable {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.playbooks-entry {
  margin-top: 8px;
}


/* ── Reuniones y compromisos ───────────────────────────────── */
.meeting-card {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.meeting-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.meeting-top strong { font-size: 13.5px; font-weight: 700; color: var(--grafito); }
.meeting-top span { font-size: 10.5px; color: var(--muted); }
.meeting-card p { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.meeting-chip {
  display: inline-flex;
  align-items: center;
  background: var(--warning-light);
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}
.meeting-chip.done { background: var(--salvia-light); color: var(--salvia-deep); }
.meeting-section {
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.meeting-section-title { display: block; font-size: 13px; font-weight: 700; color: var(--grafito); }
.meeting-section-sub { font-size: 10.5px; color: var(--muted); margin: 2px 0 12px; }
.meeting-kpis { display: flex; gap: 8px; margin-top: 10px; }
.meeting-kpis > div {
  flex: 1;
  background: var(--crema);
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 0;
}
.meeting-kpis span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meeting-kpis b { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.meeting-expense { color: var(--terra-deep); }
.meeting-finding { font-size: 11px; color: var(--muted); margin-top: 8px; }
.meeting-recon-row { border-top: 1px solid var(--crema); padding: 11px 0; }
.meeting-recon-row:first-of-type { margin-top: 4px; }
.meeting-recon-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.meeting-recon-top strong { font-size: 12.5px; font-weight: 600; color: var(--grafito); }
.meeting-recon-top span { font-size: 11px; color: var(--muted); }
.meeting-recon-input { display: flex; gap: 8px; align-items: center; }
.meeting-recon-input .input { flex: 1; min-width: 0; }
.meeting-recon-input b { font-size: 11px; font-weight: 700; white-space: nowrap; }
.meeting-recon-input b.ok { color: var(--salvia-deep); }
.meeting-recon-input b.off { color: var(--terra-deep); }
.meeting-recon-btn {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.meeting-recon-btn:disabled { background: var(--arena); cursor: default; }
.meeting-recon-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
}
.meeting-commit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.meeting-commit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--crema);
}
.meeting-commit-row i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--arena);
  flex-shrink: 0;
}
.meeting-commit-row i.done { background: var(--salvia); }
.meeting-commit-row span {
  flex: 1; min-width: 0;
  font-size: 11.5px; color: var(--grafito);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meeting-commit-row span.done { opacity: 0.55; text-decoration: line-through; }
.meeting-commit-row b { font-size: 10px; color: var(--muted); font-weight: 500; flex-shrink: 0; }
.meeting-manage-btn {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.meeting-notes { min-height: 64px; resize: none; margin: 10px 0; width: 100%; box-sizing: border-box; }

.commit-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--crema);
}
.commit-row:last-child { border-bottom: none; }
.commit-check {
  width: 20px; height: 20px;
  border-radius: 7px;
  border: 1.5px solid var(--arena);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  padding: 0;
}
.commit-check.done { background: var(--accent-strong); border-color: var(--salvia-deep); }
.commit-main {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.commit-main strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--grafito);
  line-height: 1.45;
}
.commit-main strong.done { text-decoration: line-through; opacity: 0.6; }
.commit-main b { font-size: 10.5px; font-weight: 600; color: var(--grafito); }
.commit-meta { display: flex; align-items: center; gap: 6px; }
.commit-meta i { font-style: normal; font-size: 10px; color: var(--muted); }
.commit-meta i.overdue { color: var(--terra-deep); font-weight: 700; }
.commit-meta em {
  font-style: normal;
  background: var(--crema);
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--grafito);
}
.commit-main small { font-size: 9.5px; color: var(--muted); }
.commit-trash {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--crema);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--terra-deep);
  flex-shrink: 0;
}
.commit-text-input { min-height: 56px; resize: none; }


.meeting-delete-btn {
  width: 100%;
  border: 1px solid var(--terra);
  border-radius: 14px;
  padding: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--terra-deep);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
}


/* Numpad inline: pegado al monto, antes de las categorías */
.numpad-inline {
  margin: 4px 0 14px;
}
.numpad-inline .numpad-key {
  padding: 9px 0;
  font-size: 17px;
}


/* Dashboard: resumen secundario de 90 días y ritmo mensual de metas */
.dash90-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.dash90-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash90-grid span {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash90-grid b {
  font-size: 14px;
  color: var(--grafito);
}
.dash90-count {
  font-size: 11px;
  color: var(--muted);
}
.dash-goal-month {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--terra-deep);
}
.dash-goal-month.ok {
  color: var(--salvia-deep);
}

/* Planes y suscripciones */
.plans-page {
  min-height: 100%;
  background: var(--crema);
  padding-bottom: 90px;
}
.plans-hero {
  background: var(--accent-strong);
  padding: 52px 22px 24px;
  color: var(--on-accent);
}
.plans-hero h1 {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}
.plans-hero p {
  max-width: 430px;
  margin-top: 7px;
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  line-height: 1.5;
}
.plans-content {
  padding: 16px 18px 24px;
}

/* Acerca de */
.about-page {
  min-height: 100%;
  background: var(--crema);
  padding-bottom: 90px;
}

.about-hero {
  background: var(--accent-strong);
  padding: 52px 22px 24px;
  color: var(--on-accent);
}

.about-hero h1 {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.2;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 28px 32px;
  text-align: center;
}

.about-logo {
  width: min(240px, 72vw);
  height: auto;
  object-fit: contain;
}

.about-content > p {
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 12px;
}

.about-details {
  width: min(100%, 360px);
  margin: 0 0 34px;
  border-top: 1px solid var(--arena);
  border-bottom: 1px solid var(--arena);
}

.about-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 2px;
}

.about-details dt,
.about-details dd {
  margin: 0;
  font-size: 13px;
}

.about-details dt {
  color: var(--muted);
}

.about-details dd {
  color: var(--grafito);
  font-weight: 700;
}

.about-content > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.plans-current-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px;
  font-size: 11px;
  color: var(--muted);
}
.plans-current-row strong {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-size: 10px;
}
.plans-owner-note {
  margin-bottom: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--terra-light);
  color: var(--terra-deep);
  font-size: 10.5px;
  line-height: 1.45;
}
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-card {
  --plan-accent: var(--grafito);
  --plan-tint: var(--neutral-plan);
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 15px 16px;
  background: var(--white);
}
.plan-card.plan-basic {
  --plan-accent: var(--salvia-mid);
  --plan-tint: var(--salvia-light);
}
.plan-card.plan-pro {
  --plan-accent: var(--terra);
  --plan-tint: var(--terra-light);
}
.plan-card.active {
  border-color: var(--plan-accent);
  box-shadow: 0 8px 22px rgba(95, 91, 87, 0.10);
}
.plan-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.plan-eyebrow {
  display: block;
  color: var(--plan-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.plan-card h2 {
  margin-top: 2px;
  color: var(--grafito);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}
.plan-active-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--plan-tint);
  color: var(--plan-accent);
  font-size: 9px;
  font-weight: 700;
}
.plan-description {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 9px;
  color: var(--plan-accent);
}
.plan-price strong {
  font-size: 16px;
}
.plan-price span {
  color: var(--muted);
  font-size: 9px;
}
.plan-trial {
  margin: 6px 0 0;
  color: var(--plan-accent);
  font-size: 11px;
}
.plan-trial-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 11px;
}
.plan-features > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-features > div > span {
  width: 17px;
  height: 17px;
  border-radius: 6px;
  background: var(--plan-tint);
  color: var(--plan-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plan-features small {
  color: var(--grafito);
  font-size: 10.5px;
}
.plan-action {
  width: 100%;
  margin-top: 13px;
  border: none;
  border-radius: 11px;
  padding: 10px;
  background: var(--plan-accent);
  color: var(--on-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.plan-action:disabled {
  background: var(--plan-tint);
  color: var(--plan-accent);
  cursor: default;
}
.plan-premium .plan-action:disabled {
  border: 1px solid var(--arena);
  background: var(--crema);
  color: var(--muted);
}
.plans-activation-backdrop {
  z-index: 120;
}
.plans-activation-sheet {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}
.plans-activation-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  margin-bottom: 12px;
  background: var(--terra-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.plans-activation-sheet h2 {
  color: var(--grafito);
  font-size: 17px;
  letter-spacing: 0;
}
.plans-activation-sheet p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.plans-activation-sheet .save-preferences-btn {
  margin-top: 18px;
}

/* ── Product onboarding / feature discovery ──────────── */
.onboarding-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  font-family: 'Poppins', sans-serif;
}
.onboarding-mask {
  position: fixed;
  background: rgba(39, 45, 40, 0.68);
  pointer-events: auto;
  animation: onboarding-fade 180ms ease-out;
}
.onboarding-mask-full { inset: 0; }
.onboarding-mask-top { top: 0; left: 0; right: 0; }
.onboarding-mask-left { left: 0; }
.onboarding-mask-right { right: 0; }
.onboarding-mask-bottom { left: 0; right: 0; bottom: 0; }
.onboarding-highlight {
  position: fixed;
  z-index: 1;
  border: 2px solid var(--salvia);
  border-radius: 18px;
  pointer-events: auto;
  box-shadow:
    0 0 0 4px rgba(174, 199, 168, 0.32),
    0 0 0 8px rgba(255, 255, 255, 0.14);
  animation: onboarding-pulse 1.8s ease-in-out infinite;
  transition: inset 180ms ease-out, width 180ms ease-out, height 180ms ease-out;
}
.onboarding-card {
  position: fixed;
  z-index: 2;
  width: min(360px, calc(100vw - 32px));
  max-height: min(480px, calc(100dvh - 32px));
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--arena);
  border-radius: 22px;
  outline: none;
  background: var(--white);
  color: var(--grafito);
  box-shadow: 0 18px 55px rgba(30, 37, 31, 0.24);
  pointer-events: auto;
  animation: onboarding-card-in 220ms cubic-bezier(.2,.75,.25,1);
}
.onboarding-layer.is-centered .onboarding-card {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.onboarding-progress-dots {
  display: flex;
  gap: 4px;
}
.onboarding-progress-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--arena-ui);
  transition: width 160ms ease, background 160ms ease;
}
.onboarding-progress-dots i.active {
  width: 15px;
  background: var(--accent-strong);
}
.onboarding-card h2 {
  margin: 15px 0 7px;
  color: var(--grafito);
  font-size: 20px;
  line-height: 1.25;
}
.onboarding-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.onboarding-error {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--danger);
  border-radius: 11px;
  color: var(--danger);
  background: var(--danger-light);
  font-size: 11px;
}
.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}
.onboarding-actions > div {
  display: flex;
  gap: 8px;
}
.onboarding-actions button {
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.onboarding-actions button:focus-visible {
  outline: 3px solid var(--terra-light);
  outline-offset: 2px;
}
.onboarding-actions button:disabled { opacity: .58; cursor: wait; }
.onboarding-skip,
.onboarding-back { background: transparent; color: var(--muted); }
.onboarding-back { border: 1px solid var(--arena-ui) !important; color: var(--grafito); }
.onboarding-next { background: var(--accent-strong); color: var(--on-accent); }

.educational-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.empty-state-action {
  padding: 7px 11px;
  border: 1px solid var(--salvia-mid);
  border-radius: 999px;
  background: var(--salvia-light);
  color: var(--salvia-deep);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

@keyframes onboarding-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes onboarding-card-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.onboarding-layer.is-centered .onboarding-card {
  animation-name: onboarding-centered-card-in;
}
@keyframes onboarding-centered-card-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes onboarding-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(174, 199, 168, .25), 0 0 0 8px rgba(255,255,255,.1); }
  50% { box-shadow: 0 0 0 7px rgba(174, 199, 168, .38), 0 0 0 11px rgba(255,255,255,.16); }
}

@media (max-width: 600px) {
  .onboarding-layer.has-target .onboarding-card {
    right: 14px !important;
    left: 14px !important;
    width: auto;
  }
  .onboarding-card { padding: 18px; border-radius: 20px; }
  .onboarding-card h2 { font-size: 18px; }
  .onboarding-actions { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-mask,
  .onboarding-card,
  .onboarding-highlight,
  .onboarding-progress-dots i {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .onboarding-highlight { border: 3px solid Highlight; }
  .onboarding-card { border: 2px solid CanvasText; }
  .onboarding-mask { background: rgba(0, 0, 0, .78); }
}


/* Pull-to-refresh */
.ptr-indicator {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--white);
  border-radius: 999px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}
.ptr-spinner {
  display: block;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--arena);
  border-top-color: var(--salvia-deep);
  border-radius: 50%;
  animation: ptr-spin 0.7s linear infinite;
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* Movimientos: selectores primarios de fondo y período */
.tx-selectors {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.tx-selector {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tx-selector > span {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 2px;
}
.tx-selector select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--arena-ui);
  border-radius: 999px;
  background: var(--white);
  color: var(--grafito);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.tx-summary-period {
  margin: 0 0 6px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Fondos: traslados ─────────────────────────────────────── */
.fund-tabs {
  margin: 12px 22px 0;
}
.transfer-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 10px 22px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--white);
}
.transfer-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--crema);
  color: var(--grafito);
}
.transfer-main {
  min-width: 0;
}
.transfer-main strong {
  display: block;
  overflow: hidden;
  color: var(--grafito);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transfer-arrow {
  color: var(--muted);
  font-weight: 400;
}
.transfer-main span,
.transfer-main small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transfer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.transfer-side b {
  color: var(--grafito);
  font-size: 14px;
  font-weight: 700;
}
.transfer-actions {
  display: flex;
  gap: 6px;
}
.transfer-undo {
  color: var(--danger);
}
.transfer-locked {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--crema);
  color: var(--grafito);
  font-size: 13px;
}
.transfer-locked small {
  color: var(--muted);
  font-size: 11px;
}

/* ── Fijos: avisos del formulario ──────────────────────────── */
.fixed-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.fixed-hint.warn {
  color: var(--terra-deep);
}
/* Apps que lee la captura: grupos cortos y la pregunta antes de encender un banco. */
.capture-sources-group { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.capture-consent { align-self: stretch; background: var(--crema); border-radius: 12px; padding: 10px 12px; font-size: 11px; line-height: 1.5; }
.capture-consent p { margin: 0 0 8px; }
.capture-consent-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
/* "Your connections": one line at the top of Automatic movements; the list opens in a sheet. */
.auto-capture-connections-row {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border: 0; cursor: pointer; text-align: left; font-family: inherit; color: var(--grafito);
}
.auto-capture-tabs { margin: 12px 0; }
.capture-activity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.auto-capture-tabs button { padding: 9px 4px; font-size: 11.5px; }
.auto-capture-connections-title { font-weight: 600; font-size: 14px; }
.auto-capture-connections-count { flex: 1; text-align: right; font-size: 13px; color: var(--salvia-deep); }
.auto-capture-connections-row svg { flex-shrink: 0; color: var(--muted); }
.auto-capture-item-actions { flex-wrap: wrap; }
/* Android capture: one row per group of apps; the switches open in a sheet. */
.capture-group-row {
  align-self: stretch; width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 12px 4px;
  background: transparent; border: 0; border-top: 1px solid var(--crema); cursor: pointer; text-align: left;
  font-family: inherit; color: var(--grafito); text-decoration: none;
}
.capture-group-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.capture-group-copy strong { font-size: 14px; font-weight: 600; }
.capture-group-copy span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.capture-group-count { flex-shrink: 0; font-size: 13px; color: var(--salvia-deep); font-weight: 600; }
.capture-group-row svg { flex-shrink: 0; color: var(--muted); }
a.notif-capture-moved { padding: 14px 18px; border-top: 0; margin-bottom: 14px; }
.capture-sources-list { gap: 12px; margin-top: 10px; }
.capture-sources-list .fund-rules-text { font-size: 14px; gap: 2px; }
.capture-source-state { font-size: 12px; line-height: 1.4; }
.capture-source-state.is-attention { color: var(--warning); font-weight: 600; }
/* Quick entry guide (Settings): how to open the native form; it explains, it records nothing. */
.quick-guide-lead { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.quick-guide-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 12px; }
.quick-guide-steps li { display: grid; gap: 2px; font-size: 13px; line-height: 1.5; color: var(--grafito); }
.quick-guide-steps strong { font-size: 14px; }
.auto-capture-delete { color: var(--danger); }
/* Preferences (language, currency) in their own sheet (P63). */
.preferences-sheet:focus { outline: none; }
.preferences-buttons { display: flex; gap: 10px; }
.preferences-buttons .btn { flex: 1; min-height: 48px; }
/* Google Play's prominent disclosure before Android's notification access (P14). */
.capture-disclosure-list { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--grafito); }
.capture-disclosure-next { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.capture-disclosure-actions { display: flex; gap: 10px; }
.capture-disclosure-actions .btn { flex: 1; min-height: 48px; }
/* Android 13+ «Ajuste restringido»: los pasos para desbloquear el acceso, junto a su botón. */
.capture-restricted { display: grid; gap: 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--warning); }
.capture-restricted strong { color: var(--warning); font-size: 13px; }
.capture-sources-search { align-self: stretch; }
/* Bancos del iPhone: casillas por nombre y la palabra de cada uno debajo. */
.auto-capture-banks { gap: 6px; }
.auto-capture-word { display: flex; align-items: center; gap: 8px; padding-left: 28px; font-size: 11px; }
.auto-capture-word .input { flex: 1; min-width: 0; }
.auto-capture-hint.is-attention { color: var(--warning); font-weight: 600; padding-left: 28px; }
/* Registro rápido desde el icono: una tarea a pantalla completa, con áreas seguras. */
.focused-layout { min-height: 100dvh; background: var(--crema-bg, var(--white)); padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); box-sizing: border-box; }
.quick-entry { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.quick-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quick-entry-head h1 { margin: 0; font-size: 22px; }
.quick-entry-close { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--crema); font-size: 24px; line-height: 1; color: inherit; }
.quick-entry-form { display: flex; flex-direction: column; gap: 12px; }
.quick-entry-amount { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.quick-entry-amount .input { font-size: 32px; font-weight: 700; padding: 14px 16px; }
.quick-entry-loading { color: var(--muted); font-size: 13px; }
.quick-entry-save { margin-top: 4px; }
.quick-entry-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 0; }
.quick-entry-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-strong); color: var(--on-accent); }
.quick-entry-full { align-self: center; margin-top: 8px; }
/* iOS capture setup in short steps: the step's buttons stay in view under a long bank list. */
.setup-stage { overflow: visible; } /* .notif-card clips: a sticky footer needs the page to scroll it. */
.setup-stage .auto-capture-fields { gap: 12px; }
.setup-stage-actions {
  position: sticky; bottom: 0; z-index: 1; display: flex; gap: 10px; margin: 4px -4px 0; padding: 12px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--white) 30%);
}
.setup-stage-actions .btn { flex: 1; min-height: 48px; white-space: nowrap; }
.setup-stage-actions .btn-secondary { flex: 0 0 auto; padding-inline: 22px; }
/* La barra de acciones tapa lo de abajo: fondo sólido, sin que se transparente el texto. */
.setup-stage-actions { background: var(--white); border-top: 1px solid var(--line); }
/* Con el teclado abierto, el pie de la guía (Ver desde el inicio / Pausar) no le quita espacio al campo. */
body.nido-keyboard-open .capture-guide-footer { display: none; }
/* Con el teclado abierto la barra fija no puede comerse la pantalla: se queda en su sitio, sin pegarse. */
body.nido-keyboard-open .setup-stage-actions { position: static; background: none; }
/* El campo enfocado se coloca por encima de la barra fija de acciones. */
.capture-guide-scroll { scroll-padding-bottom: 150px; }
.setup-summary { display: grid; gap: 2px; margin: 0; font-size: 14px; }
.setup-summary dt { color: var(--muted); font-size: 12px; }
.setup-summary dd { margin: 0 0 8px; font-weight: 600; overflow-wrap: break-word; }
/* Capture sources and card rules: loading shape, load error with its retry, the group's one explanation,
   and the per-app question over the sheet (it used to sit under the whole list). */
.capture-skeleton { align-self: stretch; display: grid; gap: 10px; padding: 6px 0; }
.capture-skeleton span { display: block; height: 44px; border-radius: 12px; background: linear-gradient(90deg, var(--crema) 0%, var(--white) 50%, var(--crema) 100%); background-size: 200% 100%; animation: capture-skeleton 1.4s ease-in-out infinite; }
@keyframes capture-skeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .capture-skeleton span { animation: none; } }
.capture-load-error { align-self: stretch; display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--warning); }
.capture-load-error p { margin: 0; font-size: 13px; color: var(--grafito); }
.capture-sources-about { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--crema); font-size: 13px; line-height: 1.5; color: var(--grafito); }
.capture-consent-backdrop { z-index: 120; } /* Over the group sheet (110). */
.capture-consent-sheet { padding: 8px 20px calc(16px + env(safe-area-inset-bottom, 0px)); }
.capture-consent-sheet h2 { margin: 8px 0 6px; font-size: 18px; }
.capture-consent-sheet p { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--grafito); }

/* Fund selection establishes the denomination before movement details appear. */
.tx-form-step { font-size:.75rem; color:var(--muted); margin:0 0 8px; }
.tx-fund-first-hint { color:var(--muted); line-height:1.5; margin:16px 0; }

.quick-entry-date { color:var(--muted); font-size:.85rem; }
.quick-entry-date summary { cursor:pointer; }

/* Movement editor and shared quick-entry accents. */
.tx-entry-backdrop { background:rgba(28,36,30,.36); backdrop-filter:blur(5px); align-items:flex-end; }
.tx-entry-sheet.transaction-sheet { height:auto; flex:none; max-height:min(90dvh,calc(var(--nido-visual-viewport-height) - 12px)); border-radius:26px 26px 0 0; padding:0; box-shadow:0 -8px 40px rgba(16,32,22,.12); animation:entry-sheet-arrive 260ms cubic-bezier(.16,1,.3,1) backwards; }
.tx-entry-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 22px 14px; flex-shrink:0; }
.tx-entry-eyebrow { display:block; color:var(--muted); font-size:10px; letter-spacing:.1em; font-weight:500; margin-bottom:4px; }
.tx-entry-header h2 { font-size:21px; font-weight:600; line-height:1.3; margin:0; color:var(--ink-strong); }
.tx-entry-close { display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:50%; color:var(--muted); background:var(--crema); flex-shrink:0; cursor:pointer; }
.tx-entry-content.sheet-scroll-content { flex:0 1 auto; padding:0 22px 6px; max-height:calc(var(--nido-visual-viewport-height) - 166px); }
.tx-entry-stage { animation:entry-step-arrive 180ms cubic-bezier(.16,1,.3,1) backwards; }
.tx-entry-editable { min-width:0; border:0; padding:0; margin:0; }
.tx-entry-stage h3 { margin:8px 0 4px; font-size:22px; line-height:1.3; font-weight:600; color:var(--ink-strong); }
.tx-entry-subtitle { margin:0 0 20px; color:var(--muted); font-size:12px; line-height:1.5; }
.tx-entry-fund { display:flex; align-items:center; gap:6px; flex:1; min-width:0; min-height:44px; border:0; border-radius:11px; padding:5px 8px; font:inherit; font-size:11px; color:var(--salvia-deep); background:var(--salvia-light); cursor:pointer; }
.tx-entry-fund svg { flex-shrink:0; }
.tx-entry-fund > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tx-entry-fund > b { flex-shrink:0; font-size:10px; font-weight:600; margin-left:auto; }
.tx-entry-kind { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:4px; padding:4px; background:var(--crema); border:1px solid var(--arena-ui); border-radius:14px; }
.tx-entry-kind button { min-width:0; min-height:44px; padding:6px 4px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--muted); font:inherit; font-size:14px; cursor:pointer; transition:background 160ms ease,color 160ms ease; }
.tx-entry-kind button.active { background:var(--salvia-light); border-color:var(--salvia-mid); color:var(--ink-strong); font-weight:600; }
.tx-entry-hero { display:block; padding:10px 0 8px; margin:0; }
.tx-entry-amount-label { display:flex; justify-content:space-between; align-items:center; font-size:11px; color:var(--muted); font-weight:500; }
.tx-entry-amount-label em { display:inline-block; font-size:10px; font-weight:500; font-style:normal; background:var(--salvia-light); color:var(--salvia-deep); padding:3px 6px; border-radius:6px; margin-left:5px; }
.tx-entry-editable .form-field { margin-top:12px; gap:5px; }
.tx-entry-editable .form-field > span { color:var(--ink-strong); font-size:13px; font-weight:600; letter-spacing:0; text-transform:none; }
.tx-entry-field-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tx-entry-field-heading small { color:var(--muted); font-size:12px; font-weight:500; }
.tx-entry-field-heading em { font-style:normal; margin-inline-start:4px; }
.tx-entry-editable :is(select.input,input.input) { min-height:48px; min-width:0; font-size:16px; }
.tx-entry-editable input.input[type="date"] { color-scheme:inherit; }
/* The amount is the point of the form: big, no box, green for income. Also used by the native quick-entry page. */
.tx-entry-amount.amount-input { width:100%; min-width:0; border:0; border-bottom:1px solid var(--arena); border-radius:0; background:transparent; padding:8px 0; margin:0; color:var(--ink-strong); font-family:inherit; font-size:clamp(32px,10vw,42px); font-weight:600; line-height:1.2; box-sizing:border-box; min-height:56px; display:block; outline:none; box-shadow:none; }
.tx-entry-amount.amount-input:focus, .tx-entry-amount.amount-input:focus-visible { outline:none; box-shadow:none; border-bottom-color:var(--salvia-deep); }
/* In the movement form it keeps the box of the other fields, tinted like the active type, with a lighter and smaller number. */
.tx-entry-editable .tx-entry-amount.amount-input { min-height:60px; padding:8px 16px; border:1.5px solid var(--salvia-mid); border-radius:16px; background:var(--salvia-light); font-size:26px; font-weight:500; line-height:1.3; }
.tx-entry-editable .tx-entry-amount.amount-input:focus { border-color:var(--salvia-deep); }
.is-income .tx-entry-amount { color:var(--salvia-deep); }
.tx-entry-amount::placeholder { color:var(--muted); opacity:.45; }
.tx-entry-fields { display:grid; gap:10px; margin:4px 0; }
.tx-entry-description { display:flex; flex-direction:column; gap:4px; padding:8px 12px; border:1px solid var(--arena); border-radius:12px; background:var(--crema); }
.tx-entry-description > span { color:var(--muted); font-size:10px; }
.tx-entry-description > .input { min-height:24px; border:0; border-radius:0; background:transparent; padding:0; box-shadow:none; color:var(--ink-strong); font-size:14px; line-height:1.5; }
.tx-entry-category .category-selector-trigger { min-height:48px; padding:8px 12px; border:1.5px solid var(--arena-ui); border-radius:16px; background:var(--crema); }
.tx-entry-category .category-selector-icon { width:30px; height:30px; border-radius:9px; }
.tx-entry-category .category-selector-value { font-size:14px; font-weight:500; }
.tx-entry-more.tx-more-toggle { min-height:52px; margin-top:12px; padding:9px 13px; border:1px solid var(--arena-ui); border-radius:14px; background:var(--crema); color:var(--ink-strong); }
.tx-entry-more > span { text-align:left; font-size:14px; font-weight:600; }
.tx-entry-more small { display:block; color:var(--muted); font-size:12px; font-weight:400; margin-top:2px; }
.tx-entry-sheet :is(.input,.tx-entry-amount,.tx-entry-kind button,.tx-entry-more,.category-selector-trigger):focus-visible { outline:2px solid var(--salvia-deep); outline-offset:2px; }
.tx-entry-currency-hint { color:var(--muted); font-size:11px; line-height:1.4; margin:0 0 10px; }
.tx-entry-origin { display:flex; align-items:center; gap:10px; margin:2px 0 10px; padding:8px 10px; border:1px solid var(--arena); border-radius:10px; font-size:11px; }
.tx-entry-origin > span { flex-shrink:0; color:var(--muted); }
.tx-entry-origin select { min-width:0; width:100%; min-height:32px; font:inherit; border:0; background:var(--white); color:var(--ink-strong); }
.tx-entry-actions.sheet-actions { padding:12px 22px max(16px,var(--safe-area-bottom)); box-shadow:none; border-top:0; }
.tx-entry-actions .save-transaction { display:flex; justify-content:center; align-items:center; gap:10px; min-height:50px; padding:12px 16px; border-radius:14px; font-size:14px; box-shadow:0 3px 10px rgba(58,82,57,.12); }
.entry-save-spinner { width:16px; height:16px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:entry-spin 700ms linear infinite; }
.entry-saved-notice { position:fixed; top:max(18px,var(--safe-area-top,0px)); left:50%; transform:translateX(-50%); width:calc(100% - 36px); max-width:390px; display:flex; align-items:center; gap:12px; background:var(--ink-strong); color:var(--on-ink); border-radius:18px; padding:14px 16px; z-index:140; box-shadow:0 8px 26px rgba(0,0,0,.16); animation:entry-receipt-arrive 280ms cubic-bezier(.16,1,.3,1) both; }
.entry-saved-check { display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:var(--salvia-deep); color:var(--on-ink); animation:entry-check-pop 420ms cubic-bezier(.16,1,.3,1) both; }
.entry-saved-notice > span:nth-child(2) { display:flex; flex-direction:column; gap:3px; flex:1; }
.entry-saved-notice strong { font-size:13px; font-weight:500; }
.entry-saved-notice small { font-size:12px; opacity:.85; }
.entry-saved-notice > button { display:grid; place-items:center; border:0; border-radius:50%; min-width:32px; min-height:32px; background:transparent; color:inherit; cursor:pointer; }
@keyframes entry-sheet-arrive { from { transform:translateY(28px); opacity:0; } to { transform:translateY(0); opacity:1; } }
@keyframes entry-step-arrive { from { transform:translateX(8px); opacity:.5; } to { transform:translateX(0); opacity:1; } }
@keyframes entry-check-pop { from { scale:.7; } to { scale:1; } }
@keyframes entry-receipt-arrive { from { transform:translate(-50%,-10px); opacity:0; } to { transform:translate(-50%,0); opacity:1; } }
@keyframes entry-spin { to { rotate:360deg; } }
@media(min-width:640px) { .tx-entry-backdrop { align-items:center; justify-content:center; padding:20px; } .tx-entry-sheet.transaction-sheet { max-width:460px; border-radius:26px; } }
@media(prefers-reduced-motion:reduce) { .tx-entry-sheet,.tx-entry-stage,.entry-saved-notice,.entry-saved-check,.entry-save-spinner { animation:none!important; } .tx-entry-kind button { transition:none; } }

.quick-entry { max-width:440px; gap:16px; padding:24px 20px; margin:20px auto; background:var(--white); border:1px solid var(--arena); border-radius:26px; }
.quick-entry-head h1 { font-size:19px; font-weight:600; }
.quick-entry-form { gap:8px; }
.quick-entry-fund-summary { width:100%; margin-bottom:12px; }
.quick-entry-date { margin:14px 0; font-size:11px; }
.quick-entry-save { min-height:50px; font-size:14px; border-radius:14px; margin-top:8px; }
.quick-entry-done .quick-entry-check { animation:entry-check-pop 420ms cubic-bezier(.16,1,.3,1) both; }
@media(max-width:360px) { .quick-entry { padding:20px 16px; margin:12px auto; } .tx-entry-header { padding:18px 18px 12px; } .tx-entry-content.sheet-scroll-content { padding-inline:18px; } }
@media(prefers-reduced-motion:reduce) { .quick-entry-done .quick-entry-check { animation:none; } }

.tx-detail-info .tx-detail-notes-row { display:block; }
.tx-detail-notes { display:block; white-space:pre-line; text-align:start; font-weight:400; line-height:1.6; margin-top:8px; overflow-wrap:anywhere; }

/* Source configuration: real choices before secondary help, one scroll region and fixed actions. */
.capture-config-sheet { width: min(100%, 560px); }
.capture-config-sheet .sheet-header h2 { font-size: 20px; overflow-wrap: anywhere; }
.capture-config-sheet .sheet-scroll-content { padding: 0 20px 20px; min-height: 0; }
.capture-config-sheet .sheet-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); }
.capture-config-sheet .notif-card { margin: 0 0 14px; padding: 14px; }
.capture-permission-ready { display: flex; gap: 8px; align-items: center; color: var(--salvia-oscuro, #52644d); font-size: 14px; }
.capture-fund-control { margin: 12px 0 0; }
.capture-source-heading { font-size: 14px; margin: 18px 0 8px; color: var(--grafito); }
.capture-sources-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.capture-sources-list > li { display: block; border: 1px solid var(--border, #9995); border-radius: 14px; padding: 12px; }
.capture-source-row { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.capture-source-row .fund-rules-text { flex: 1; min-width: 0; }
.capture-source-row b { white-space: normal; overflow-wrap: anywhere; }
.capture-source-row .notif-switch { flex-shrink: 0; min-width: 48px; min-height: 44px; }
.capture-sources .capture-source-state { white-space: normal; line-height: 1.5; font-size: 13px; }
.capture-row-error { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; padding-top: 8px; }
.capture-sources-search { margin: 8px 0; }
.capture-missing-app { min-height: 44px; text-align: start; }
.capture-source-row[aria-busy=true], .capture-sources-list > li[aria-busy=true] { opacity: .8; }
.quick-guide-sheet { width: min(100%, 520px); }
.quick-guide-sheet .sheet-scroll-content { padding: 0 20px 16px; min-height: 0; }
.quick-guide-sheet .sheet-actions { padding: 12px 20px max(14px, env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.quick-guide-sheet .sheet-actions small { color: var(--muted); text-align: center; }
/* Los botones de instalar van arriba; las pantallas quedan más pequeñas para no obligar a desplazarse. */
.quick-guide-sheet .capture-guide-shots { padding-top: 4px; }
.quick-guide-sheet .capture-guide-shot { width: min(150px, 42vw); }
.quick-guide-sheet .capture-guide-shot-frame { border-width: 4px; border-radius: 24px; }
/* Un botón principal compacto y enlaces: tres botones grandes pegados saturaban el modal. */
.quick-guide-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 14px; }
.quick-guide-sheet .quick-guide-install { width: auto; min-height: 42px; padding: 0 22px; font-size: 14px; }
.quick-guide-actions .savings-link-btn { min-height: 42px; padding: 0; font-size: 14px; }
.quick-guide-try { display: grid; gap: 2px; justify-items: start; margin: 10px 0 4px; }
.quick-guide-try .savings-link-btn { padding: 0; font-size: 14px; }
.quick-guide-try small { color: var(--muted); font-size: 12px; line-height: 1.4; }
/* Hablar con Pinni: una fila pequeña; sus pasos van numerados en la hoja. */
#pinni-voice { margin: 12px 0; }
.pinni-voice-steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--grafito); }
.pinni-voice-steps li { display: list-item; }
.quick-guide-choices { display: flex; gap: 10px; margin: 6px 0 16px; }
.quick-guide-choices .btn { flex: 1; min-height: 44px; }
.quick-guide-instruction { font-size: 15px; line-height: 1.6; color: var(--grafito); }
.quick-gesture { margin: 14px auto; text-align: center; }
.quick-gesture figcaption { font-size: 11px; color: var(--muted); margin-top: 5px; }
.quick-gesture-phone { width: 140px; height: 168px; border: 4px solid var(--grafito); border-radius: 24px; margin: auto; position: relative; background: var(--crema); overflow: hidden; padding: 20px 10px; color: var(--grafito); }
.quick-demo-icon { position: absolute; top: 20px; left: 44px; width: 44px; height: 44px; border-radius: 12px; }
.quick-demo-menu { position: absolute; left: 8px; right: 8px; bottom: 16px; padding: 6px; font-size: 11px; line-height: 1.9; border-radius: 8px; background: var(--white); box-shadow: 0 3px 12px #0002; animation: quick-menu 3s ease-in-out infinite; }
.quick-gesture-touch { position: absolute; width: 30px; height: 30px; border: 3px solid var(--salvia, #78946e); border-radius: 50%; left: 52px; top: 30px; animation: quick-hold 3s ease-in-out infinite; background: #78946e33; }
.quick-swipe-line { position: absolute; top: 0; left: 59px; font-size: 32px; }
.quick-demo-tile { position: absolute; top: 62px; left: 20px; right: 20px; border-radius: 12px; padding: 8px; background: var(--white); font-size: 12px; }
.quick-gesture[data-method=tiles] .quick-gesture-touch { animation: quick-swipe 3s ease-in-out infinite; }
.quick-gesture[data-method=backtap] .quick-gesture-touch { top: 80px; animation: quick-backtap 2s ease-in-out infinite; }
.quick-phone-back { display: block; margin-top: 35px; font-size: 16px; }
.quick-shortcut-symbol { font-size: 36px; }
.quick-gesture.paused *, .quick-gesture.paused *::after { animation-play-state: paused !important; }
@keyframes quick-hold { 0%,100% { transform: scale(.8); opacity: .3; } 35%,65% { transform: scale(1.2); opacity: 1; } }
@keyframes quick-menu { 0%,30% { opacity: .3; } 50%,100% { opacity: 1; } }
@keyframes quick-swipe { 0%,100% { transform: translateY(-25px); } 70% { transform: translateY(60px); } }
@keyframes quick-backtap { 0%,40%,70%,100% { transform: scale(.8); opacity: .3; } 25%,55% { transform: scale(1.2); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .quick-gesture * { animation: none !important; } }
.capture-source-row .notif-switch { width: 48px; height: 44px; background: transparent; border-radius: 0; }
.capture-source-row .notif-switch::before { content: ''; position: absolute; width: 40px; height: 24px; border-radius: 16px; left: 4px; top: 10px; background: var(--arena-ui); }
.capture-source-row .notif-switch.on::before { background: var(--salvia-mid); }
.capture-source-row .notif-knob { top: 13px; left: 7px; width: 18px; height: 18px; }
.capture-source-row .notif-switch.on .notif-knob, .capture-source-row .notif-switch.selected-unavailable .notif-knob { left: 23px; }
.capture-source-row .notif-switch.selected-unavailable::before { background: var(--muted); opacity: .65; }
.capture-sources .capture-sources-about { padding: 0; background: none; font-size: 13px; margin: 12px 0 4px; }
.capture-privacy-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.capture-fund-details { font-size: 13px; margin-bottom: 12px; }
.capture-installed-filter { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; }
.capture-installed-filter input { min-width: 20px; min-height: 20px; }
.capture-region-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.capture-region-filter select { flex: 1; width: auto; min-width: 140px; }
.capture-permission-disclosure { z-index: 130; }
.capture-rule-backdrop { z-index: 120; }
.tx-currency-proposal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; line-height: 1.5; padding: 10px 0; }
.tx-currency-proposal .btn { min-height: 44px; }
.tx-detail-info .tx-detail-notes { text-align: start; }
.tx-capture-origin summary { text-align: start; color: var(--grafito); font-size: 13px; min-height: 44px; padding: 10px 0; }
.tx-detail-capture-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0; }

/* Movimientos automáticos: tres conexiones (Wallet, SMS, Apps financieras) y el detalle de cada una con sus reglas. */
.capture-connections-overview { display: grid; gap: 14px; margin: 4px 0 18px; }
.capture-connections-intro { margin: 0; }
.capture-connection-card { border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: var(--white); box-shadow: 0 2px 10px rgba(95,91,87,0.05); display: grid; gap: 10px; }
.capture-connection-card.is-unavailable { background: var(--crema); box-shadow: none; }
.capture-connection-card .connection-card-icon.wallet { background: var(--salvia-light); color: var(--salvia-deep); }
.capture-connection-card .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.capture-connection-count { margin: 0; font-weight: 600; font-size: 14px; }
.capture-connection-detail { display: grid; gap: 14px; }
.capture-connection-detail-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.capture-connection-detail-head h2 { margin: 0; font-size: 18px; }
.capture-wallet-mode { display: grid; gap: 12px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--white); }
.capture-wallet-mode h3, .capture-rules-heading { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.capture-rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.capture-rule-row { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--white); display: grid; gap: 8px; }
.capture-rule-row.is-off { background: var(--crema); }
.capture-rule-row.is-off .capture-rule-main strong { color: var(--muted); }
.capture-rule-main { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.capture-rule-main strong { font-size: 15px; overflow-wrap: anywhere; }
.capture-rule-main span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.capture-rule-fund { display: inline-flex; align-items: center; gap: 5px; }
.capture-rule-main .capture-rule-fund { color: var(--grafito); font-weight: 600; }
.capture-rule-main .auto-capture-state { margin-top: 4px; font-size: 11px; }
.capture-rule-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.capture-rule-actions .savings-link-btn { min-height: 40px; padding: 8px 2px; }
/* Android: lo que lee cada conexión en este teléfono, en una tarjeta con su propio margen interno (sin buscadores). */
.capture-android-sources { display: grid; gap: 10px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--white); position: relative; }
.capture-android-sources .auto-capture-hint { margin: 0; }
.capture-android-sources .capture-sources-list { margin-top: 0; }
.capture-apps-configured { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 4px 0; background: transparent; border: 0; text-align: left; font-family: inherit; color: var(--grafito); cursor: pointer; }
.capture-apps-configured strong { font-size: 15px; }
.capture-apps-configured svg { flex-shrink: 0; color: var(--muted); }
.capture-apps-sheet .sheet-scroll-content { display: grid; gap: 12px; }
.capture-apps-sheet .capture-source-heading { margin: 4px 0 0; }
.capture-apps-sheet .capture-region-filter { display: grid; gap: 6px; justify-items: stretch; text-align: left; }
.capture-apps-sheet .capture-region-filter select { width: 100%; }
.capture-app-fund { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.capture-app-fund .is-attention { color: var(--warning); font-weight: 600; }
.capture-app-fund .input { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.capture-rule-main .capture-app-fund { justify-self: stretch; width: 100%; }
.capture-apps-configured.capture-sms-configured { padding: 14px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--white); }
.capture-apps-menu { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); }
.capture-apps-menu li + li { border-top: 1px solid var(--crema); }
.capture-apps-menu-row { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; background: transparent; text-align: left; font-family: inherit; color: var(--grafito); cursor: pointer; }
.capture-apps-menu-row svg { flex-shrink: 0; color: var(--muted); }
.capture-apps-sheet .sheet-header { gap: 8px; }
.capture-apps-common { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--crema); }
.capture-add-app-sheet .sheet-scroll-content { display: grid; gap: 10px; }
.capture-add-app-sheet .sheet-header { gap: 8px; }
.capture-add-app-search { width: 100%; }
.capture-add-app-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--white); }
.capture-add-app-list li + li { border-top: 1px solid var(--crema); }
.capture-add-app-row { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 0; background: transparent; text-align: left; font-family: inherit; font-size: 15px; color: var(--grafito); cursor: pointer; }
.capture-add-app-row span { overflow-wrap: anywhere; }
.capture-add-app-row svg { flex-shrink: 0; color: var(--muted); }
.capture-apps-guide { display: grid; gap: 10px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--white); }
.capture-apps-guide h3 { margin: 0; font-size: 15px; }
.capture-apps-guide-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* Forecasts and card debt stay distinct from actual money. */
.projection-toggle{display:flex;align-items:center;gap:9px;min-height:44px;padding:10px 14px;margin-bottom:12px;border:1px solid var(--line);border-radius:15px;background:var(--white);color:var(--salvia-deep);font:inherit;font-size:13px;cursor:pointer}
.projection-toggle.active{background:var(--salvia-light);border-color:var(--salvia-mid)}
.projection-hint{font-size:12px;line-height:1.65;color:var(--muted);margin:8px 0 14px}
.projection-badge{display:inline-flex;padding:3px 8px;border-radius:10px;background:var(--warning-light);color:var(--warning);font-size:10px;font-weight:500}
.credit-card-summary-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}
.credit-card-summary-row span{min-width:0;overflow-wrap:anywhere}.credit-card-summary-row strong{color:var(--terra-deep);white-space:nowrap}
.credit-card-summary>small{display:block;color:var(--muted);font-size:11px;line-height:1.65;margin-top:12px}
.credit-card-total{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 0 14px;color:inherit;text-decoration:none}
.credit-card-total strong{font-size:28px;font-weight:600;line-height:1.1;letter-spacing:-.02em;color:var(--terra-deep);overflow-wrap:anywhere}
.credit-card-total span{display:inline-flex;align-items:center;gap:2px;flex:none;color:var(--muted);font-size:12px;white-space:nowrap}
.credit-card-total:focus-visible{outline:2px solid var(--terra-deep);outline-offset:3px;border-radius:10px}
.credit-card-summary-list{border-top:1px solid var(--line)}

/* «Nuevo»: a movement PinNido recorded by itself and nobody opened yet. A small orange bubble with «!»: never the
   terracotta of a pending decision, and no text (its name is the accessible label). */
.tx-new-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #F2812C; color: #fff;
  font: 700 11px/1 'Poppins', sans-serif; font-style: normal;
  box-shadow: 0 0 0 2px color-mix(in srgb, #F2812C 22%, transparent);
}

/* Details: every source of a captured movement. */
.tx-capture-origins { display: grid; gap: 8px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--crema); }
.tx-capture-origins-title { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.tx-capture-origin-item { display: grid; gap: 3px; }
.tx-capture-origin-item + .tx-capture-origin-item { padding-top: 8px; border-top: 1px solid var(--arena); }
.tx-capture-origin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; color: var(--grafito); }
.tx-capture-origin-head em { color: var(--muted); font-size: 11px; font-style: normal; }
.tx-capture-origin-message { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

/* Inside a movement row the generic «.transaction-main span» (block, margin, ellipsis) must not reshape the bubble. */
.transaction-main .tx-new-badge { display: inline-grid; margin: 0; width: 16px; height: 16px; overflow: visible; color: #fff; font-size: 11px; }

/* Pending panel rows: icon-only actions so nothing has to be opened to act on it. */
.tx-pending-icon-actions { flex-wrap: nowrap; gap: 8px; }
.tx-pending-icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0;
  border: 1px solid var(--arena-ui); border-radius: 50%; background: var(--white); color: var(--grafito); cursor: pointer;
}
.tx-pending-icon-btn:disabled { opacity: .5; cursor: default; }
.tx-pending-icon-btn.is-approve { border-color: transparent; background: var(--salvia-light); color: var(--salvia-deep); }
.tx-pending-icon-btn.is-discard { border-color: transparent; background: var(--danger-light); color: var(--danger); }
.tx-pending-icon-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* The «!» bubble is a button (quick category correction): a 16px mark with a comfortable touch target around it. */
.tx-new-badge { position: relative; padding: 0; border: 0; cursor: pointer; outline: none; }
.tx-new-badge::before { content: ""; position: absolute; inset: -12px; }
.tx-new-badge:focus-visible { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px #F2812C; }

/* Quick category sheet and the discreet pencil of a movement's detail. */
/* Above a movement's detail (115): from Home the sheet opens over it. */
.tx-quick-backdrop { z-index: 125; }
.tx-quick-summary { display: grid; gap: 2px; margin-bottom: 14px; }
.tx-quick-summary strong { color: var(--grafito); font-size: 15px; overflow-wrap: anywhere; }
.tx-quick-summary span { color: var(--muted); font-size: 13px; }
.tx-quick-current { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.tx-quick-current .tx-cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; color: var(--grafito); font-size: 12px; }
.tx-quick-actions { display: grid; gap: 10px; }
.tx-quick-full { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tx-detail-cat-edit {
  display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 6px; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.tx-detail-cat-edit:hover, .tx-detail-cat-edit:focus-visible { background: var(--salvia-light); color: var(--salvia-deep); outline: none; }

/* Three icons (review, approve, discard) stay on the row's right edge instead of wrapping under the text. */
.tx-pending-item-main { flex: 1 1 110px; }
