/* Inter variable, servida desde el propio sitio (licencia OFL en vendor/fonts). */
@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-wght-normal.8e433c0592f7.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-ext-wght-normal.ad4eb06671be.woff2") format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --accent: #5835dd;
  --on-accent: #fff;
  --r: 1;
  --font: InterVariable,Inter,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --blue: var(--accent);
  --blue-hover: color-mix(in oklab, var(--accent) 86%, black);
  --link: color-mix(in oklab, var(--accent) var(--link-mix, 92%), black);
  --focus: color-mix(in srgb, var(--accent) 55%, white);
  --ink: #0b0d11;
  --brand-ink: #0b0d11;
  --text-strong: #2a3342;
  --muted: #515c6c;
  --placeholder: #737b8a;
  --accent-text: color-mix(in oklab, var(--link) 82%, #77808f);
  --line: #e5e7ec;
  --line-soft: #eef0f3;
  --line-strong: #d8dbe1;
  --field-line: #c4c9d1;
  --line-hover: color-mix(in srgb, var(--accent) 34%, white);
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-2: #fafbfc;
  --tint: color-mix(in srgb, var(--accent) 8%, white);
  --tint-gray: #f0f1f4;
  --green: #146847;
  --green-bg: #ecf7f0;
  --amber: #845308;
  --amber-bg: #fdf5e6;
  --amber-line: #f0e2c6;
  --red: #a33143;
  --red-bg: #fdf0ee;
  --violet: #81497e;
  --chart-grid: #e8eaee;
  --chart-label: #5c6577;
  --chart-line: var(--accent);
  --chart-zero: #c9665e;
  --shadow-xs: 0 1px 2px rgb(16 24 40 / .05);
  --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 2px 6px -1px rgb(16 24 40 / .05);
  --shadow-lg: 0 16px 40px -12px rgb(16 24 40 / .18), 0 2px 6px rgb(16 24 40 / .05);
  --glass: color-mix(in oklab, var(--bg) 80%, transparent);
}

/* Tema oscuro: se activa con data-theme="dark" o, sin preferencia guardada, con el del sistema. */
:root[data-theme=light] {
  color-scheme: light;
}

:root[data-theme=dark] {
  color-scheme: dark;
  --blue-hover: color-mix(in oklab, var(--accent) 86%, white);
  --link: color-mix(in oklab, var(--accent) 50%, white);
  --focus: color-mix(in srgb, var(--accent) 70%, white);
  --ink: #f6f7f9;
  --brand-ink: #f6f7f9;
  --text-strong: #cfd4dc;
  --muted: #a8b1c0;
  --placeholder: #7d8493;
  --accent-text: color-mix(in oklab, var(--accent) 48%, white);
  --line: #23272f;
  --line-soft: #1c2027;
  --line-strong: #2d323c;
  --field-line: #3a404c;
  --line-hover: color-mix(in srgb, var(--accent) 45%, #14171d);
  --bg: #0b0d11;
  --surface: #14171d;
  --surface-2: #181b22;
  --tint: color-mix(in srgb, var(--accent) 15%, #14171d);
  --tint-gray: #1d2028;
  --green: #72d9a7;
  --green-bg: #132a20;
  --amber: #f4c477;
  --amber-bg: #2b2317;
  --amber-line: #4a3b21;
  --red: #ff9bab;
  --red-bg: #33191b;
  --violet: #deafd7;
  --chart-grid: #23272f;
  --chart-label: #9aa1ae;
  --chart-line: color-mix(in oklab, var(--accent) 60%, white);
  --chart-zero: #ff9bab;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / .35);
  --shadow: 0 1px 2px rgb(0 0 0 / .35), inset 0 1px 0 rgb(255 255 255 / .03);
  --shadow-lg: 0 18px 44px -12px rgb(0 0 0 / .6), inset 0 1px 0 rgb(255 255 255 / .04);
}

/* Sin JavaScript manda el tema del dispositivo. Mismos valores que el bloque de arriba (una prueba lo vigila). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --blue-hover: color-mix(in oklab, var(--accent) 86%, white);
    --link: color-mix(in oklab, var(--accent) 50%, white);
    --focus: color-mix(in srgb, var(--accent) 70%, white);
    --ink: #f6f7f9;
    --brand-ink: #f6f7f9;
    --text-strong: #cfd4dc;
    --muted: #a8b1c0;
    --placeholder: #7d8493;
    --accent-text: color-mix(in oklab, var(--accent) 48%, white);
    --line: #23272f;
    --line-soft: #1c2027;
    --line-strong: #2d323c;
    --field-line: #3a404c;
    --line-hover: color-mix(in srgb, var(--accent) 45%, #14171d);
    --bg: #0b0d11;
    --surface: #14171d;
    --surface-2: #181b22;
    --tint: color-mix(in srgb, var(--accent) 15%, #14171d);
    --tint-gray: #1d2028;
    --green: #72d9a7;
    --green-bg: #132a20;
    --amber: #f4c477;
    --amber-bg: #2b2317;
    --amber-line: #4a3b21;
    --red: #ff9bab;
    --red-bg: #33191b;
    --violet: #deafd7;
    --chart-grid: #23272f;
    --chart-label: #9aa1ae;
    --chart-line: color-mix(in oklab, var(--accent) 60%, white);
    --chart-zero: #ff9bab;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / .35);
    --shadow: 0 1px 2px rgb(0 0 0 / .35), inset 0 1px 0 rgb(255 255 255 / .03);
    --shadow-lg: 0 18px 44px -12px rgb(0 0 0 / .6), inset 0 1px 0 rgb(255 255 255 / .04);
  }
}

/* Barra lateral. «Clara» (por defecto) comparte el fondo de la página; las demás son un bloque oscuro. */
:root {
  --nav: var(--bg);
  --nav-ink: var(--ink);
  --nav-muted: var(--muted);
  --nav-icon: var(--muted);
  --nav-hover: color-mix(in oklab, var(--ink) 6%, transparent);
  --nav-active: var(--surface);
  --nav-active-ink: var(--ink);
  --nav-active-icon: var(--link);
  --nav-line: var(--line);
  --nav-shadow: var(--shadow-xs);
}

:root[data-nav=navy],
:root[data-nav=accent],
:root[data-nav=black] {
  --nav: #192940;
  --nav-ink: #e6ecf5;
  --nav-muted: #a6b6cd;
  --nav-icon: #9fb2cf;
  --nav-hover: #ffffff14;
  --nav-active: #ffffff1f;
  --nav-active-ink: #fff;
  --nav-active-icon: #fff;
  --nav-line: #ffffff1c;
  --nav-shadow: none;
}

:root[data-theme=dark][data-nav=navy] {
  --nav: #111b2b;
}

:root[data-nav=accent] {
  --nav: color-mix(in oklab, var(--accent) 60%, #0a0f1a);
}

:root[data-nav=black] {
  --nav: #0c0d10;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: .875rem/1.6 var(--font);
  font-optical-sizing: auto;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* El contorno transparente reaparece en modo de alto contraste, donde las sombras se quitan. */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ── Iconos SVG: una máscara pintada con el color del texto. Uso: <span class="ico ico-home" aria-hidden="true"></span> ── */
.ico {
  display: inline-block;
  flex: none;
  inline-size: 1.15em;
  block-size: 1.15em;
  vertical-align: calc(0.5cap - 0.575em - 0.02em);
  background-color: currentColor;
  mask: var(--icon) no-repeat center / contain;
  pointer-events: none;
  forced-color-adjust: none;
}

.ico-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v9a1.5 1.5 0 0 1-1.5 1.5H15V14H9v6.5H4.5A1.5 1.5 0 0 1 3 19Z'/%3E%3C/svg%3E"); }
.ico-moves { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5h15m-4-4 4 4-4 4M20 16.5H5m4-4-4 4 4 4'/%3E%3C/svg%3E"); }
.ico-calendar { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2.5'/%3E%3Cpath d='M7.5 3v5m9-5v5m-13 2.5h17M8 15h3'/%3E%3C/svg%3E"); }
.ico-users { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M2.5 20v-1.5a6.5 6.5 0 0 1 13 0V20M16 5.3a3 3 0 0 1 0 5.4m1 3a5.7 5.7 0 0 1 4.5 5.6V20'/%3E%3C/svg%3E"); }
.ico-user { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.ico-target { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='13' r='8'/%3E%3Ccircle cx='11' cy='13' r='4'/%3E%3Cpath d='m11 13 8-8m-2-2v4h4'/%3E%3C/svg%3E"); }
.ico-settings { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h3m6 0h9M3 12h9m6 0h3M3 18h3m6 0h9'/%3E%3Ccircle cx='9' cy='6' r='2.5'/%3E%3Ccircle cx='15' cy='12' r='2.5'/%3E%3Ccircle cx='9' cy='18' r='2.5'/%3E%3C/svg%3E"); }
.ico-logout { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H5a1.5 1.5 0 0 0-1.5 1.5v13A1.5 1.5 0 0 0 5 20h5m-1-8h12m-5-5 5 5-5 5'/%3E%3C/svg%3E"); }
.ico-menu { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
.ico-eye { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.7-7 10-7 10 7 10 7-3.7 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='2.8'/%3E%3C/svg%3E"); }
.ico-eye-off { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 3 18 18M6.4 7.2A19.2 19.2 0 0 0 2 12s3.7 7 10 7a10.5 10.5 0 0 0 5-1.4M10 5.2a10 10 0 0 1 2-.2c6.3 0 10 7 10 7a20 20 0 0 1-2.5 3.5M9.3 11.3a2.8 2.8 0 0 0 3.4 3.4'/%3E%3C/svg%3E"); }
.ico-shield { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4.5 6v6c0 4.6 3.2 7.8 7.5 9 4.3-1.2 7.5-4.4 7.5-9V6L12 3Z'/%3E%3C/svg%3E"); }
.ico-plus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v16M4 12h16'/%3E%3C/svg%3E"); }
.ico-trend { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8M15 7h6v6'/%3E%3C/svg%3E"); }
.ico-wallet { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 7V5.5A1.5 1.5 0 0 0 16.5 4H5a2 2 0 0 0 0 4h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V6'/%3E%3Ccircle cx='16' cy='14' r='1.2'/%3E%3C/svg%3E"); }
.ico-upload { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3m-4.5 4.5L12 3l4.5 4.5M4 15v3.5A1.5 1.5 0 0 0 5.5 20h13a1.5 1.5 0 0 0 1.5-1.5V15'/%3E%3C/svg%3E"); }
.ico-list { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h12M9 12h12M9 18h12M4 6h.01M4 12h.01M4 18h.01'/%3E%3C/svg%3E"); }
.ico-bank { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8 9-5 9 5v1H3ZM6 12v5m6-5v5m6-5v5M3 20h18'/%3E%3C/svg%3E"); }
.ico-card { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5.5' width='19' height='13' rx='2.5'/%3E%3Cpath d='M3 10h18M6.5 15h3.5'/%3E%3C/svg%3E"); }
.ico-receipt { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3.5 7.4 5l2.3-1.5L12 5l2.3-1.5L16.6 5 19 3.5v17l-3.5-2-3.5 2-3.5-2-3.5 2ZM8.5 9.5h7m-7 4h5'/%3E%3C/svg%3E"); }
.ico-cash { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M6 12h.5m11 0h.5'/%3E%3C/svg%3E"); }

/* El botón de privacidad cambia de ojo según el estado que app.js anuncia en aria-label. */
#privacy-toggle .ico-eye-off,
#privacy-toggle[aria-label^=Mostrar] .ico-eye {
  display: none;
}

#privacy-toggle[aria-label^=Mostrar] .ico-eye-off {
  display: inline-block;
}

.sidebar {
  scrollbar-width: thin;
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--nav);
  color: var(--nav-muted);
  border-right: 1px solid var(--nav-line);
  padding: 22px 14px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  letter-spacing: -.02em;
  font-weight: 650;
  color: var(--nav-ink);
  padding: 4px 8px;
  line-height: 1.2;
}

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
}

/* El símbolo va en el color de acento (ajustado para contraste); en menús oscuros, en blanco. */
.brand-symbol {
  color: var(--brand-symbol, var(--link));
}

:root[data-nav=navy],
:root[data-nav=accent],
:root[data-nav=black] {
  --brand-symbol: #fff;
}

.nav-label {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--nav-muted);
  margin: 15px 0 9px;
  padding-left: 12px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar nav>a,
.settings-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: calc(8px * var(--r));
  font-size: 13.5px;
  font-weight: 500;
  color: var(--nav-muted);
  transition: background-color .15s, color .15s;
}

.sidebar nav>a>.ico,
.settings-link>.ico {
  font-size: 17px;
  color: var(--nav-icon);
}

.sidebar nav>a:hover,
.settings-link:hover {
  background: var(--nav-hover);
  color: var(--nav-ink);
}

.sidebar nav>a.selected,
.settings-link.selected {
  background: var(--nav-active);
  color: var(--nav-active-ink);
  box-shadow: var(--nav-shadow);
  font-weight: 600;
}

.sidebar nav>a.selected>.ico,
.settings-link.selected>.ico {
  color: var(--nav-active-icon);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 30px;
}

.settings-link {
  margin-bottom: 10px;
}

.user-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 6px 18px;
  border-top: 1px solid var(--nav-line);
  color: var(--nav-ink);
  font-size: 13px;
  font-weight: 550;
}

.user-line small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--nav-muted);
}

.user-line form {
  margin-left: auto;
}

.user-line button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: calc(8px * var(--r));
  font-size: 17px;
  color: var(--nav-muted);
}

.user-line button:hover {
  background: var(--nav-hover);
  color: var(--nav-ink);
}

.avatar {
  height: 32px;
  width: 32px;
  flex: none;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--accent) 18%, var(--nav));
  color: var(--nav-ink);
  border-radius: 50%;
  font-weight: 600;
}

.shell {
  margin-left: 240px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  padding: 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.topbar>span {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar b {
  font-weight: 600;
  color: var(--ink);
}

.topbar i {
  font-style: normal;
  color: var(--placeholder);
}

.topbar>div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  font-size: 18px;
  border-radius: calc(8px * var(--r));
  transition: background-color .15s, color .15s;
}

.icon-button:hover {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  color: var(--ink);
}

.content {
  max-width: 1550px;
  padding: 35px 36px 0;
  margin: auto;
  /* Al navegar, htmx lleva #main al borde de la ventana: el margen deja libre la barra fija
     para que el aviso «Movimiento registrado.» no quede tapado. */
  scroll-margin-top: 60px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 650;
  margin-bottom: 8px;
}

.page-heading h1 {
  font-size: clamp(1.6rem, 1.25rem + 1vw, 2rem);
  letter-spacing: -.025em;
  line-height: 1.3;
  font-weight: 650;
}

.page-heading p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 9px;
  max-width: 760px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: calc(8px * var(--r));
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s, translate .1s;
}

.button:active {
  translate: 0 1px;
}

.button>.ico {
  font-size: 15px;
}

.button.primary {
  background: var(--blue);
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 1px 2px rgb(16 24 40 / .14), 0 4px 12px -4px color-mix(in srgb, var(--accent) 45%, transparent);
}

.button.primary:hover {
  background: var(--blue-hover);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover,
.button.white:hover {
  background: var(--surface-2);
  border-color: var(--field-line);
  color: var(--ink);
}

.button.white {
  background: var(--surface);
  color: var(--accent-text);
  border-color: var(--line-strong);
}

.button.danger {
  background: #bc6661;
  color: white;
}

.button.full {
  width: 100%;
}

.text-link {
  color: var(--link);
  font-size: 12.5px;
  font-weight: 550;
}

.text-link:hover {
  text-decoration: underline;
}

/* Un botón con aspecto de enlace sigue siendo un objetivo de toque: mínimo 24 px de alto. */
button.text-link {
  min-block-size: 24px;
}

.muted {
  color: var(--muted);
}

.onboarding {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 23px;
  padding: 19px 22px;
  background: var(--tint);
  border: 1px solid var(--line-strong);
  border-radius: calc(10px * var(--r));
  margin-bottom: 24px;
}

.onboarding b {
  font-size: 13px;
  color: var(--text-strong);
  font-weight: 600;
}

.onboarding p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr;
  gap: 17px;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(14px * var(--r));
  box-shadow: var(--shadow);
  padding: 20px;
  min-height: 165px;
}

.stat>span {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.stat i {
  font-style: normal;
  color: var(--accent-text);
}

.stat>strong {
  font-size: 27px;
  letter-spacing: -.03em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  margin: 16px 0 7px;
  white-space: nowrap;
}

.stat>small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.stat>a {
  font-size: 12px;
  color: var(--accent-text);
  margin-top: auto;
  padding-top: 14px;
}

.stat.featured {
  background: linear-gradient(140deg, color-mix(in oklab, var(--accent) 88%, white), var(--accent) 45%, color-mix(in oklab, var(--accent) 72%, black));
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 10px 30px -12px color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--on-accent);
  position: relative;
  overflow: hidden;
}

.featured>span,
.featured>small,
.featured>a,
.featured i {
  color: color-mix(in srgb, var(--on-accent) 86%, transparent);
}

.featured:after {
  content: '';
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--on-accent) 12%, transparent);
  width: 150px;
  height: 150px;
  border-radius: calc(30px * var(--r));
  right: -40px;
  bottom: -90px;
  transform: rotate(35deg);
  pointer-events: none;
}

.two-columns {
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(300px,1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(14px * var(--r));
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}

.content > .panel + .panel {
  margin-block-start: 22px;
}

.panel-note {
  margin: 0;
  padding: 14px 22px 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 23px 18px;
}

.panel h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.panel-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
}

.badge {
  display: inline-block;
  border-radius: calc(5px * var(--r));
  padding: 3px 9px;
  background: var(--tint-gray);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  line-height: 1.5;
}

.badge.blue {
  background: var(--tint);
  color: var(--accent-text);
}

.badge.green {
  background: var(--green-bg);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.gray {
  background: var(--tint-gray);
  color: var(--muted);
}

.dashboard-forecast {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px 23px 25px;
}

.dashboard-forecast h3 {
  font-size: 15px;
  font-weight: 550;
  margin-top: 7px;
}

.dashboard-forecast p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
  max-width: 310px;
  margin: 8px 0 17px;
}

.forecast-visual {
  position: relative;
  width: 95%;
  height: 80px;
  margin-bottom: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.forecast-visual>span {
  display: block;
  background: var(--tint-gray);
  height: 1px;
  width: 100%;
}

.forecast-visual>i {
  position: absolute;
  left: calc(50% - 22px);
  top: 15px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 27px;
  border-radius: calc(12px * var(--r));
  background: var(--tint);
  color: var(--accent-text);
}

.panel-foot {
  padding: 14px 23px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.event-row:last-child {
  border: 0;
}

.date-chip {
  width: 38px;
  min-width: 38px;
  border: 1px solid var(--line-strong);
  border-radius: calc(8px * var(--r));
  text-align: center;
  padding: 5px;
  background: var(--surface-2);
}

.date-chip b {
  display: block;
  font-size: 16px;
  font-weight: 550;
  color: var(--muted);
}

.date-chip span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

.event-row>div:nth-child(2) {
  flex: 1;
}

.event-row>div>b {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
}

.event-row small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.event-row>strong {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  padding: 37px 24px;
  min-height: 200px;
}

.empty>span {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  border-radius: calc(11px * var(--r));
  background: var(--tint);
  color: var(--accent-text);
  font-size: 25px;
  margin-bottom: 13px;
}

.empty h3 {
  font-size: 14px;
  font-weight: 550;
}

.empty p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
  max-width: 370px;
  margin-top: 7px;
}

.empty a {
  margin-top: 14px;
}

.goal-row {
  padding: 0 23px 23px;
}

.goal-row>b {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 8px;
}

.goal-row strong {
  font-size: 22px;
  letter-spacing: -.6px;
  font-weight: 550;
}

.goal-row small {
  font-size: 12.5px;
  color: var(--muted);
}

progress {
  appearance: none;
  display: block;
  border: 0;
  width: 100%;
  height: 6px;
  border-radius: calc(8px * var(--r));
  background: var(--tint-gray);
  overflow: hidden;
  margin-top: 13px;
}

progress::-webkit-progress-bar {
  background: var(--tint-gray);
  border-radius: calc(8px * var(--r));
}

progress::-webkit-progress-value {
  background: color-mix(in srgb, var(--accent) 72%, white);
  border-radius: calc(8px * var(--r));
}

progress::-moz-progress-bar {
  background: color-mix(in srgb, var(--accent) 72%, white);
}

.notice {
  display: block;
  font-size: 13px;
  line-height: 1.9;
  padding: 16px 19px;
  border-radius: calc(10px * var(--r));
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  color: var(--muted);
  background: var(--tint);
  margin-bottom: 20px;
}

.notice.success {
  background: var(--green-bg);
  color: var(--muted);
}

.notice.error {
  background: var(--red-bg);
  color: var(--red);
}

.notice.warning {
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  color: var(--amber);
}

.notice.info {
  background: var(--tint);
  color: var(--accent-text);
}

.notice.subtle {
  background: var(--tint);
  color: var(--muted);
}

.table-scroll {
  overflow: auto;
}

table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  font-size: 13px;
}

th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  background: var(--surface-2);
  border-block: 1px solid var(--line);
  padding: 10px 20px;
  white-space: nowrap;
}

td {
  padding: 14px 20px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  transition: background-color .12s;
}

tbody tr:hover>td {
  background: var(--surface-2);
}

tr:last-child td {
  border: 0;
}

td b {
  font-weight: 550;
  color: var(--text-strong);
  font-size: 13px;
}

td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin-top: 5px;
}

.amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 18px 22px;
}

.toolbar input:not([type=checkbox]) {
  min-width: 180px;
  flex: 1;
}

.toolbar label {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}

.toolbar .muted {
  margin-left: auto;
  font-size: 12.5px;
}

input:not([type=checkbox]):not([type=hidden]),
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: calc(8px * var(--r));
  box-shadow: var(--shadow-xs);
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13.5px;
  width: 100%;
  min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}

input:not([type=checkbox]):not([type=hidden]):hover,
select:hover,
textarea:hover {
  border-color: color-mix(in oklab, var(--field-line) 60%, var(--ink));
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.toolbar select {
  width: auto;
  min-width: 130px;
}

.form-panel {
  padding: 26px 28px;
  max-width: 900px;
}

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

.field {
  min-width: 0;
}

.field[hidden] {
  display: none;
}

.field label,
form>label {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  margin-bottom: 8px;
}

.field small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 7px;
}

.field.wide {
  grid-column: 1/-1;
}

.checkbox-label {
  display: flex!important;
  align-items: center;
  gap: 8px;
  line-height: 1.8;
  padding-top: 8px;
}

input[type=checkbox] {
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
}

.required {
  font-size: 12px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 21px;
  margin-top: 28px;
}

.errorlist {
  list-style: none;
  margin: 10px 0;
  padding: 10px 13px;
  background: var(--red-bg);
  border-radius: calc(6px * var(--r));
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.8;
}

.form-panel form>.errorlist {
  margin: 0 0 23px;
}

.subnav {
  display: flex;
  gap: 24px;
  font-size: 12.5px;
  color: var(--accent-text);
  margin-bottom: 23px;
  flex-wrap: wrap;
}

.space-top {
  margin-top: 24px;
}

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

.account-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.account-symbol {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  background: var(--tint);
  color: var(--accent-text);
  border-radius: calc(9px * var(--r));
  font-size: 22px;
}

.account-card h2 {
  font-size: 17px;
}

.account-balance {
  font-size: 29px;
  font-weight: 550;
  letter-spacing: -.9px;
  line-height: 1.3;
  margin: 18px 0 7px;
}

.account-card>small {
  color: var(--muted);
  font-size: 12.5px;
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-block: 1px solid var(--line);
  margin: 22px 0 16px;
  padding: 13px 0;
  color: var(--muted);
  font-size: 12px;
}

.account-card>p {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 17px;
  overflow-wrap: anywhere;
}

.account-card>.text-link {
  margin-top: auto;
}

.cash-chart {
  padding: 10px 15px;
  height: 300px;
}

.cash-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cash-chart.compact {
  height: 220px;
}

.negative {
  color: var(--red);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  border-top: 1px solid var(--line);
}

.mini-stats>div {
  padding: 21px 24px;
}

.mini-stats>div+div {
  border-left: 1px solid var(--line);
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.mini-stats b {
  display: block;
  font-size: 24px;
  font-weight: 550;
  letter-spacing: -.7px;
  margin-top: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 23px;
}

summary {
  padding: 20px 23px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 0 27px;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

footer b {
  color: var(--muted);
  font-weight: 600;
  margin-right: 7px;
}

.htmx-indicator {
  display: none;
}

#loading.htmx-request,
.htmx-request #loading {
  display: block;
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 25;
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 4px 12px #203a6017;
  border-radius: calc(6px * var(--r));
  padding: 8px 14px;
  font-size: 12.5px;
}

.auth-content {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 30px;
  background: radial-gradient(ellipse at top,var(--tint),transparent 70%);
}

.login-card {
  max-width: 460px;
  width: 100%;
  padding: 40px;
  border: 1px solid var(--line-strong);
  border-radius: calc(19px * var(--r));
  background: var(--surface);
  box-shadow: 0 12px 60px #27437508;
}

.login-card .brand {
  padding: 0;
  margin-bottom: 35px;
  color: var(--brand-ink);
}

.login-card .brand-logo {
  height: 30px;
  --brand-symbol: var(--link);
}

.login-card h1 {
  font-size: 33px;
  line-height: 1.3;
  letter-spacing: -1.2px;
  font-weight: 600;
  margin-bottom: 13px;
}

.login-card>p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 25px;
}

.login-card label {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  margin-bottom: 18px;
}

.login-card input {
  display: block;
  margin-top: 8px;
}

.login-card small {
  display: block;
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin-top: 25px;
}

.mobile {
  display: none;
}

@media(max-width:1250px) {
  .sidebar {
    width: 222px;
    padding-inline: 14px;
  }

  .shell {
    margin-left: 222px;
  }

  .content {
    padding: 29px 27px 0;
  }

  .topbar {
    padding: 0 27px;
  }

  .stat {
    padding: 19px 16px;
  }

  .stat>strong {
    font-size: 24px;
  }

  .stats-grid {
    gap: 13px;
  }

  .two-columns {
    gap: 19px;
    grid-template-columns: minmax(0,1.4fr) minmax(290px,1fr);
  }

  .account-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(max-width:1000px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    min-height: 165px;
    padding: 20px;
  }

  .stat>strong {
    font-size: 28px;
  }

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

  .onboarding {
    align-items: flex-start;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .account-card {
    padding: 21px;
  }

  .account-balance {
    font-size: 25px;
  }

  .form-grid {
    gap: 20px 18px;
  }

  .page-heading p {
    font-size: 12.5px;
  }

  .toolbar input:not([type=checkbox]) {
    min-width: 150px;
  }
}

@media(max-width:760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
    width: 240px;
    box-shadow: 20px 0 50px #18283f15;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .shell {
    margin-left: 0;
  }

  .mobile {
    display: grid;
  }

  .topbar {
    height: 60px;
    padding: 0 18px;
    gap: 10px;
  }

  .topbar>span {
    flex: 1;
    font-size: 12px;
    gap: 8px;
    min-width: 0;
  }

  .topbar b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
  }

  .privacy-note {
    display: none;
  }

  .content {
    padding: 25px 18px 0;
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 24px;
  }

  .page-heading h1 {
    font-size: 26px;
  }

  .page-heading p {
    font-size: 12.5px;
    line-height: 1.9;
    max-width: 350px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .page-heading>.button {
    font-size: 12px;
    padding: 8px 11px;
    min-height: 34px;
  }

  .onboarding {
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .onboarding b {
    font-size: 13px;
  }

  .onboarding p {
    font-size: 12.5px;
  }

  .onboarding .button {
    font-size: 12px;
    min-height: 33px;
  }

  .stats-grid {
    gap: 12px;
    margin-bottom: 18px;
  }

  .stat {
    padding: 17px 14px;
    min-height: 170px;
  }

  .stat>span {
    font-size: 12px;
  }

  .stat>strong {
    font-size: 24px;
    letter-spacing: -.75px;
    margin-top: 18px;
  }

  .stat>small,
  .stat>a {
    font-size: 11px;
  }

  .two-columns {
    gap: 18px;
    margin-bottom: 18px;
  }

  .panel-head {
    padding: 20px 18px 16px;
  }

  .panel-head h2 {
    font-size: 13px;
  }

  .panel-head p {
    font-size: 12px;
  }

  .panel-head .text-link {
    font-size: 12px;
    white-space: nowrap;
  }

  .dashboard-forecast {
    min-height: 245px;
  }

  .panel-foot {
    font-size: 12px;
    padding: 13px 18px;
    line-height: 1.8;
  }

  .event-row {
    padding: 15px 18px;
    gap: 10px;
  }

  .event-row small {
    font-size: 11px;
  }

  /* «Revisar →» baja a su propio renglón para no salirse de la tarjeta. */
  .event-row:has(> .button) {
    flex-wrap: wrap;
  }

  .event-row > .button {
    margin-left: 48px;
  }

  .table-scroll table {
    font-size: 12.5px;
    min-width: 550px;
  }

  .table-scroll th,
  .table-scroll td {
    padding: 13px 15px;
  }

  .table-scroll td b {
    font-size: 12.5px;
  }

  .toolbar {
    padding: 17px 16px;
    gap: 10px;
  }

  .toolbar>input:not([type=checkbox]) {
    min-width: 100%;
    flex-basis: 100%;
  }

  .toolbar>select {
    flex: 1;
    max-width: 100%;
  }

  .toolbar .button {
    font-size: 12px;
    padding: 8px 11px;
  }

  .toolbar label {
    flex: 1;
  }

  .toolbar label>input:not([type=checkbox]) {
    min-width: 120px;
  }

  .toolbar .muted {
    font-size: 12px;
  }

  .toolbar select {
    min-width: 95px;
    font-size: 12.5px;
  }

  .form-panel {
    padding: 22px 19px;
  }

  .form-grid {
    gap: 20px 16px;
  }

  .field label {
    font-size: 12px;
  }

  .field small {
    font-size: 11px;
  }

  .field[data-field=source],
  .field[data-field=target],
  .field[data-field=business_adjust],
  .field[data-field=missing_day],
  .field[data-field=merge_statement],
  .field[data-field=title],
  .field[data-field=description],
  .field[data-field=timezone_name] {
    grid-column: 1/-1;
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .account-card {
    padding: 23px;
  }

  .account-balance {
    font-size: 30px;
  }

  .subnav {
    font-size: 12.5px;
    gap: 15px;
    line-height: 1.9;
  }

  .cash-chart {
    height: 240px;
    padding: 6px;
  }

  .mini-stats>div {
    padding: 15px 11px;
  }

  .mini-stats span {
    font-size: 11px;
  }

  .mini-stats b {
    font-size: 19px;
  }

  .notice {
    font-size: 12.5px;
    padding: 15px 17px;
    line-height: 1.9;
  }

  footer {
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    margin-top: 27px;
    padding: 19px 0;
    gap: 9px;
  }

  .login-card {
    padding: 30px 25px;
  }

  .login-card h1 {
    font-size: 29px;
  }

  .pagination {
    font-size: 12px;
    gap: 10px;
  }
}

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

.preset-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.preset-row button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: calc(20px * var(--r));
  padding: 6px 11px;
  color: var(--accent-text);
  font-size: 12px;
}

.preset-row button:hover {
  background: var(--tint);
  border-color: var(--line-hover);
}

.preset-row small {
  font-size: 12px;
  color: var(--muted);
}

@media(max-width:760px) {
  .preset-row {
    gap: 7px;
  }

  .preset-row>span,
  .preset-row>small {
    flex-basis: 100%;
  }
}

.card-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.reconcile-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: calc(9px * var(--r));
  margin: 26px 0 18px;
}

.reconcile-summary > div {
  padding: 16px 18px;
}

.reconcile-summary > div + div {
  border-left: 1px solid var(--line);
}

.reconcile-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.reconcile-summary b {
  display: block;
  font-size: 20px;
  font-weight: 550;
  margin-top: 6px;
}

.reconcile-summary .is-ok b {
  color: var(--green);
}

.reconcile-summary .is-off b {
  color: var(--red);
}

.mini-stats.single {
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}

.event-row form {
  margin-left: auto;
}

@media(max-width:760px) {
  .reconcile-summary {
    grid-template-columns: 1fr;
  }

  .reconcile-summary > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* Colores por tipo de movimiento: entra, sale, deuda, entre cuentas. */
.tone-in {
  --tone: var(--green);
}

.tone-out {
  --tone: var(--red);
}

.tone-debt {
  --tone: var(--violet);
}

.tone-move {
  --tone: var(--accent-text);
}

.tone-neutral {
  --tone: var(--muted);
}

td[class*=tone-],
strong[class*=tone-] {
  color: var(--tone);
  font-weight: 600;
}

.amount.voided {
  text-decoration: line-through;
}

.sign {
  color: inherit;
  display: inline-block;
  min-width: .8em;
}

.flow-dot::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--tone);
}

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.tone-in-text {
  color: var(--green);
}

.tone-out-text {
  color: var(--red);
}

.tone-debt-text {
  color: var(--violet);
}

.tone-move-text {
  color: var(--accent-text);
}

.tone-neutral-text {
  color: var(--muted);
}

.heading-actions,
.row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row-actions {
  gap: 14px;
  justify-content: flex-end;
}

.loan-layout {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: start;
}

.form-section {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--accent-text);
  margin: 6px 0 12px;
}

.form-section ~ .form-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.loan-summary {
  padding: 0 22px 6px;
  color: var(--muted);
}

.loan-summary b {
  color: var(--ink);
}

.loan-summary p {
  margin: 0 0 8px;
}

#loan-preview .notice,
#rule-preview .notice {
  margin: 0 22px 14px;
}

.compact-table td,
.compact-table th {
  padding: 9px 14px;
}

.show-all {
  margin: 12px 22px 18px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.rule-preview-list {
  list-style: none;
  margin: 0;
  padding: 0 22px 18px;
  display: grid;
  gap: 6px;
}

.rule-preview-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.rule-preview-list b {
  color: var(--ink);
}

details.advanced {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

details.advanced > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .loan-layout {
    grid-template-columns: 1fr;
  }
}

.guide-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 16px 22px;
  margin-bottom: 20px;
}

.guide-index a {
  color: var(--link);
  font-size: 13px;
  text-decoration: none;
}

.guide {
  padding: 22px 26px;
  margin-bottom: 20px;
  scroll-margin-top: 20px;
}

.guide h2 {
  margin: 0 0 12px;
}

.guide p,
.guide li,
.guide dd {
  color: var(--muted);
  max-width: 85ch;
}

.guide b {
  color: var(--ink);
}

.guide dt {
  font-weight: 650;
  margin-top: 14px;
}

.guide dd {
  margin: 4px 0 0;
}

.guide ol {
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.guide table {
  margin-top: 8px;
}

.settings-link:has(+ .settings-link) {
  margin-bottom: 0;
}

/* Nuevo movimiento: primer paso con botones. */
.kind-cards {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.kind-cards legend {
  font-weight: 650;
  margin-bottom: 12px;
  color: var(--ink);
}

.kind-card {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: calc(10px * var(--r));
  background: var(--surface-2);
  cursor: pointer;
}

.kind-card:hover {
  border-color: var(--line-hover);
}

.kind-card:has(input:checked) {
  border-color: var(--tone);
  box-shadow: 0 0 0 1px var(--tone) inset;
  background: var(--tint);
}

.kind-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kind-card:has(input:focus-visible) {
  outline: 3px solid var(--focus);
}

.kind-card b {
  color: var(--ink);
}

.kind-card small {
  color: var(--muted);
  padding-left: 13px;
}

.field-missing {
  color: var(--amber) !important;
}

/* Cuentas agrupadas. */
.group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.group-head h2 {
  margin: 0;
}

.group-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.group-total {
  text-align: right;
  margin-left: auto;
  font-size: 13px;
}

.group-total span {
  display: block;
  color: var(--muted);
}

.group-total b {
  font-size: 22px;
}

.account-grid + .group-head,
.heading-actions.space-top + .group-head {
  margin-top: 34px;
}

.credit-line {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.credit-line progress {
  width: 100%;
}

.heading-actions.centered {
  justify-content: center;
  margin-top: 12px;
}

/* Primeros pasos. */
.first-steps {
  margin-bottom: 24px;
}

.first-steps ol {
  list-style: none;
  margin: 0;
  padding: 0 22px 18px;
  display: grid;
  gap: 4px;
}

.first-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.first-steps li:last-child {
  border-bottom: 0;
}

.first-steps li > div {
  flex: 1;
  display: grid;
}

.first-steps li small {
  color: var(--muted);
}

.first-steps li > .step-actions {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.step-actions a,
.step-skip {
  display: inline-flex;
  align-items: center;
  min-block-size: 24px;
}

.step-skip {
  padding: 0;
  color: var(--muted);
}

@media (pointer: coarse) {
  .step-actions a,
  .step-skip {
    min-block-size: 32px;
  }
}

.first-steps li.done b {
  color: var(--muted);
  text-decoration: line-through;
}

.step-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  background: var(--tint);
  color: var(--accent-text);
  flex: none;
}

.done .step-mark {
  background: var(--green-bg);
  color: var(--green);
}

[hidden] {
  display: none !important;
}

/* Sin registros, el encabezado de la tabla solo estorba. */
table:has(.empty) thead {
  display: none;
}

/* Asistente de tarjeta: compras a meses que ya traes. */
.form-hint {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  margin: -4px 0 14px;
  max-width: 70ch;
}

.msi-rows {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.msi-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: calc(10px * var(--r));
  background: var(--surface-2);
}

.msi-summary {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: calc(9px * var(--r));
  background: var(--tint);
  color: var(--text-strong);
  font-size: 12.5px;
}

.msi-summary.negative {
  background: var(--red-bg);
}

@media(max-width:760px) {
  .msi-row {
    grid-template-columns: 1fr 1fr;
  }

  .msi-row .field[data-field$=title] {
    grid-column: 1/-1;
  }
}

/* Proyección por periodo: selector semanal / mensual / anual. */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: calc(9px * var(--r));
  background: var(--surface-2);
}

.segmented a {
  padding: 6px 13px;
  border-radius: calc(6px * var(--r));
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}

.segmented a:hover {
  color: var(--ink);
}

.segmented a.selected {
  background: var(--blue);
  color: var(--on-accent);
}

.stack-periods td.amount small {
  font-weight: 500;
}

@media(max-width:760px) {
  .panel-head:has(.segmented) {
    flex-wrap: wrap;
  }

  .table-scroll.stack-periods tr {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .table-scroll.stack-periods td[data-label] {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0 4px;
  }

  .stack-periods td[data-label]::before {
    content: attr(data-label);
    margin-right: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
  }

  .stack-periods td[data-label] small {
    flex-basis: 100%;
    text-align: right;
    margin-top: 0;
  }
}

/* Importar desde Excel. */
.import-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.import-step {
  display: flex;
  gap: 16px;
  padding: 22px;
}

.import-step h2 {
  font-size: 15px;
  margin-bottom: 6px;
}

.import-step p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.import-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.import-upload input[type=file] {
  flex: 1;
  min-width: 200px;
}

.import-confirm {
  padding: 16px 22px;
}

@media(max-width:900px) {
  .import-steps {
    grid-template-columns: 1fr;
  }
}

@media(max-width:760px) {
  .stack-import td:nth-child(1) { grid-area: 1 / 1; font-size: 12px; }
  .stack-import td:nth-child(2) { grid-area: 1 / 2; font-size: 12px; }
  .stack-import td:nth-child(3) { grid-column: 1/-1; }
  .stack-import td:nth-child(4) { grid-column: 1/-1; }
}

/* «¿Qué es esto?»: para qué sirve, ejemplo y si cambia tus saldos. */
.concept-box {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: calc(11px * var(--r));
  background: var(--surface);
}

.concept-box > summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}

.concept-box > summary::-webkit-details-marker {
  display: none;
}

.concept-box > summary span {
  color: var(--accent-text);
}

.concept-box > summary small {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concept-box > summary::after {
  content: 'Ver más ▾';
  color: var(--link);
  font-size: 12px;
  white-space: nowrap;
}

.concept-box[open] > summary small {
  visibility: hidden;
}

.concept-box[open] > summary::after {
  content: 'Ocultar ▴';
}

.concept-box .concept {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 11px 11px;
}

.concept {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: calc(11px * var(--r));
  overflow: hidden;
  margin-bottom: 22px;
}

.concept > div {
  background: var(--surface);
  padding: 14px 18px;
}

.concept span {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.concept p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-strong);
}

.concept .badge {
  margin-right: 4px;
}

/* Estado y compras a meses dentro de cada tarjeta. */
.card-extras {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: calc(9px * var(--r));
  background: var(--tint-gray);
  font-size: 12.5px;
  color: var(--muted);
}

.card-extras > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-extras b {
  color: var(--ink);
}

.card-extras .text-link {
  font-size: 12.5px;
  white-space: nowrap;
}

@media(max-width:900px) {
  .concept {
    grid-template-columns: 1fr;
  }
}

/* ===== Móvil: barra fija, navegación inferior, tablas como tarjetas. ===== */
.bottom-nav {
  display: none;
}

@media(max-width:760px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }

  .topbar>div {
    gap: 6px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .sidebar {
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar.open ~ .shell::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 25;
    background: #0b121f80;
    backdrop-filter: blur(2px);
  }

  body.menu-open {
    overflow: hidden;
  }

  /* 16px evita que iOS haga zoom al enfocar un campo. */
  input:not([type=checkbox]):not([type=hidden]),
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .button {
    min-height: 42px;
  }

  .stack .amount small {
    display: inline;
    margin-left: 4px;
  }

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

  .stat,
  .stat.featured {
    min-height: 0;
  }

  .stat>strong {
    margin: 8px 0 4px;
  }

  .stat>a {
    padding-top: 8px;
  }

  /* En el teléfono solo se ven los pasos pendientes. */
  .first-steps li.done {
    display: none;
  }

  /* Las acciones van en una fila bajo el texto para no apretarlo. */
  .first-steps li {
    flex-wrap: wrap;
  }

  .first-steps li > .step-actions {
    flex: 1 0 100%;
    grid-auto-flow: column;
    justify-content: start;
    gap: 18px;
    padding-left: 42px;
    text-align: left;
  }

  .topbar-root {
    display: none;
  }

  .topbar b {
    max-width: 100%;
    font-weight: 600;
    color: var(--ink);
  }

  .mini-stats {
    grid-template-columns: 1fr 1fr;
  }

  .mini-stats>div:nth-child(3) {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .group-total {
    text-align: left;
    margin-left: 0;
  }

  .row-actions {
    justify-content: flex-start;
  }

  /* Tablas apiladas: cada fila es una tarjeta y nada queda fuera de la pantalla. */
  .table-scroll.stack table {
    min-width: 0;
  }

  .stack thead {
    display: none;
  }

  .stack table,
  .stack tbody,
  .stack tr,
  .stack td {
    display: block;
  }

  .stack tr {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 6px 14px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  .stack tr:last-child {
    border-bottom: 0;
  }

  .stack.table-scroll td {
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .stack td small {
    margin-top: 2px;
  }

  .stack td[colspan] {
    grid-column: 1/-1;
  }

  .stack td:empty {
    display: none;
  }

  .stack .row-actions,
  .stack td > .text-link {
    display: flex;
    min-height: 32px;
    align-items: center;
  }

  /* Movimientos: concepto | importe · fecha | estado · acciones. */
  .stack-movements td:nth-child(1) { grid-area: 1 / 1; }
  .stack-movements td:nth-child(2) { grid-area: 2 / 1; font-size: 12px; }
  .stack-movements td:nth-child(3) { grid-area: 1 / 2; text-align: right; }
  .stack-movements td:nth-child(4) { grid-area: 2 / 2; justify-self: end; }
  .stack-movements td:nth-child(5) { grid-column: 1/-1; }

  /* Agenda: concepto | importe · fecha | estado · acción. */
  .stack-agenda td:nth-child(1) { grid-area: 2 / 1; }
  .stack-agenda td:nth-child(1) b { font-size: 12px; font-weight: 500; color: var(--muted); }
  .stack-agenda td:nth-child(2) { grid-area: 1 / 1; }
  .stack-agenda td:nth-child(3) { grid-area: 1 / 2; text-align: right; white-space: nowrap; }
  .stack-agenda td:nth-child(4) { grid-area: 2 / 2; justify-self: end; }
  .stack-agenda td:nth-child(5) { grid-column: 1/-1; }

  /* Listas de configuración: una columna, acciones al final. */
  .stack-list tr {
    grid-template-columns: minmax(0,1fr);
  }

  .bottom-nav.mobile {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5,1fr);
    align-items: center;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: color-mix(in oklab, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }

  .bottom-nav a,
  .bottom-nav-more {
    display: grid;
    justify-items: center;
    gap: 2px;
    font-size: 10.5px;
    font-weight: 550;
    color: var(--muted);
    padding: 8px 0;
  }

  .bottom-nav-more {
    position: relative;
    border: 0;
    background: none;
    font: inherit;
    font-size: 10.5px;
    padding: 0;
    cursor: pointer;
  }

  .bottom-nav-more .nav-count {
    position: absolute;
    top: -4px;
    right: calc(50% - 20px);
  }

  .bottom-nav a .ico,
  .bottom-nav-more .ico {
    font-size: 20px;
    line-height: 1;
  }

  .bottom-nav a.selected {
    color: var(--link);
  }

  .bottom-nav .bottom-nav-add {
    justify-self: center;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: var(--blue);
    color: var(--on-accent);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 34%, transparent);
  }

  .bottom-nav .bottom-nav-add .ico {
    font-size: 22px;
  }

  footer {
    margin-bottom: 8px;
  }
}

/* Amigos e inicio con Google */
.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: calc(10px * var(--r));
  background: var(--red);
  color: white;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  text-align: center;
}

.google-button {
  gap: 10px;
}

.google-mark {
  font-weight: 700;
  color: #4285f4;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}

.copy-line {
  display: flex;
  gap: 8px;
}

.copy-line input {
  flex: 1;
  min-width: 0;
}

/* Tarjeta «Comparte este enlace»: sin .panel-head, el margen va en la tarjeta. */
.invite-panel {
  display: grid;
  gap: 10px;
  padding: 22px 23px;
  margin-bottom: 22px;
}

.invite-panel p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* En el celular el enlace va a todo el ancho y los botones debajo. */
@media (max-width: 760px) {
  .invite-panel {
    padding: 20px 18px;
    margin-bottom: 18px;
  }

  .invite-panel .copy-line {
    flex-wrap: wrap;
  }

  .invite-panel .copy-line input {
    flex-basis: 100%;
  }

  .invite-panel .copy-line .button {
    flex: 1;
    justify-content: center;
  }
}

.event-row .avatar {
  flex: none;
}

.loan-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.loan-totals div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.repayment-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.repayment-answer select {
  max-width: 180px;
}

/* Datos para recibir transferencias */
.settings-link:has(.nav-count) {
  display: flex;
  align-items: center;
}

.profile-reminder .text-link {
  margin-left: 6px;
  white-space: nowrap;
}

.transfer-info {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
}

.transfer-info .copy-line input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.transfer-info small {
  color: var(--muted);
}

/* Preferencias: cuenta y contraseña */
.settings-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 23px;
}

@media (max-width: 760px) {
  .settings-account {
    padding: 20px 18px;
  }
}

.settings-account small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.narrow-form {
  max-width: 560px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

/* En teléfonos, dos columnas de ~135 px cortan fechas y nombres de cuentas: una sola columna. */
@media (max-width: 420px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Amigos */
.stats-grid.friends-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat.attention {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 1px var(--accent-text) inset;
}

.button.small {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12px;
  flex: none;
}

.attention-panel {
  border-left: 3px solid var(--accent-text);
}

.loan-row > div {
  display: grid;
  gap: 5px;
}

.loan-row progress {
  max-width: 320px;
}

.loan-row > strong small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-align: right;
}

.avatar.owe {
  background: #8a5a2b;
}

.avatar.big {
  width: 44px;
  height: 44px;
  font-size: 18px;
  flex: none;
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.friend-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  transition: border-color .15s, box-shadow .15s;
}

.friend-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 18px rgb(15 30 60 / 7%);
}

.friend-card.waiting {
  border-color: var(--amber);
  box-shadow: inset 0 3px 0 var(--amber);
}

.friend-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  color: inherit;
  min-width: 0;
}

.friend-card-top > div {
  flex: 1;
  min-width: 0;
}

.friend-card-top h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card-top small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.friend-card-top:hover h3 {
  color: var(--accent-text);
}

.friend-card-go {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.friend-card-balance {
  display: grid;
  gap: 3px;
  margin: 0 18px;
  padding: 13px 15px;
  border-radius: calc(10px * var(--r));
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.friend-card-balance small {
  color: var(--muted);
  font-size: 12px;
}

.friend-card-balance strong {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.friend-card-balance strong em {
  font-style: normal;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}

.friend-card-balance.owes-me {
  background: var(--green-bg);
  border-color: transparent;
}

.friend-card-balance.owes-me strong {
  color: var(--green);
}

.friend-card-balance.i-owe {
  background: color-mix(in srgb, var(--violet) 10%, transparent);
  border-color: transparent;
}

.friend-card-balance.i-owe strong {
  color: var(--violet);
}

.friend-card-balance.even strong {
  font-size: 16px;
  color: var(--ink);
}

.friend-card-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 16px;
  font-size: 12.5px;
}

.friend-card-bank > div {
  flex: 1;
  min-width: 0;
}

.friend-card-bank b {
  display: block;
  font-weight: 600;
}

.friend-card-bank small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: calc(8px * var(--r));
  background: var(--tint);
  color: var(--accent-text);
  font-weight: 600;
}

.bank-mark.muted {
  background: var(--tint-gray);
  color: var(--muted);
}

.friend-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.friend-card-actions .button {
  justify-content: center;
}

.transfer-details summary {
  cursor: pointer;
  font-size: 12.5px;
}

.friends-start-action {
  padding: 0 22px 22px;
}

/* Detalle de una operación */
.entry-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.entry-amount {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.entry-amount small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.stepper {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.stepper li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.stepper li + li::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}

.stepper li span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 11px;
}

.stepper li.done span {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.stepper li.current {
  color: var(--ink);
  font-weight: 600;
}

.stepper li.current span {
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.stepper li.stopped span {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.loan-progress {
  display: grid;
  gap: 6px;
  margin: 16px 0;
}

.loan-progress small {
  color: var(--muted);
}

.plan-row.state-paid b,
.plan-row.state-paid strong {
  color: var(--muted);
}

.plan-row.state-late {
  background: var(--amber-bg);
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Medallas e historial entre dos amigos */
.medals {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.medal {
  display: grid;
  gap: 8px;
  grid-row: span 3;
  grid-template-rows: subgrid;
  margin: 0;
  padding: 20px;
}

.medal h2 {
  align-items: center;
  display: flex;
  gap: 12px;
}

.medal-icon {
  font-size: 1.8rem;
}

.medal:not(.earned) .medal-icon {
  filter: grayscale(1);
}

.medal.earned small {
  color: var(--green);
}

.medal progress {
  accent-color: var(--accent);
  inline-size: 100%;
}

.together {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0 24px 24px;
}

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

.together dd {
  font-weight: 600;
  margin: 0;
}

/* Desacuerdos entre amigos */
.dispute {
  margin-block-start: 14px;
}

.dispute > summary {
  color: var(--red);
  cursor: pointer;
  padding-block: 12px;
}

.dispute-reasons {
  border: 0;
  margin: 0;
  padding: 0;
}

.dispute-reasons label {
  align-items: center;
  display: flex;
  gap: 10px;
  min-block-size: 44px;
}

.dispute-reasons label > input[type='radio'] {
  accent-color: var(--accent);
  block-size: 20px;
  flex: none;
  inline-size: 20px;
  margin: 0;
  min-block-size: 0;
  padding: 0;
}

.dispute-note {
  display: grid;
  gap: 6px;
  margin-block: 10px;
}

.dispute .button {
  margin-block-start: 10px;
}

/* Elegir amigo con tarjetas */
.friend-picker {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}

.friend-picker legend {
  font-weight: 650;
  margin-bottom: 10px;
  color: var(--ink);
}

.friend-picker .options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.friend-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
}

.friend-option:hover {
  border-color: var(--line-hover);
}

.friend-option:has(input:checked) {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 1px var(--accent-text) inset;
  background: var(--tint);
}

.friend-option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
}

.friend-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.friend-option .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

@media (max-width: 1000px) {
  .stats-grid.friends-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid.friends-stats {
    grid-template-columns: 1fr;
  }

  .stepper li + li::before {
    width: 10px;
  }

  .stepper li {
    font-size: 11px;
  }

  .entry-amount {
    font-size: 24px;
  }
}

/* Historial entre amigos: línea de tiempo por mes. */
.kind-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
}

.kind-icon.in {
  background: var(--green-bg);
  color: var(--green);
}

.kind-icon.out {
  background: var(--red-bg);
  color: var(--red);
}

.timeline-row.voided {
  opacity: .6;
}

.timeline-row.voided > strong {
  text-decoration: line-through;
}

.timeline-row:hover,
.loan-row:hover {
  background: var(--surface-2);
}

.timeline-month {
  margin-bottom: 16px;
}

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.month-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.month-head > span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12.5px;
}

.month-head small {
  color: var(--muted);
  font-size: 12px;
}

.history-toolbar,
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 16px;
}

.history-head {
  margin-top: 30px;
}

.history-flows {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-size: 13px;
}

.history-flows small {
  color: var(--muted);
}

.friend-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.friend-chips a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
}

.friend-chips a:hover {
  border-color: var(--blue);
}

.friend-chips .avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

/* Página de un amigo. */
.friend-hero {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) minmax(240px, 1.3fr);
  gap: 22px;
  align-items: center;
  padding: 22px 23px;
}

.friend-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar.huge {
  width: 58px;
  height: 58px;
  font-size: 24px;
  flex: none;
}

.friend-balance {
  display: grid;
  gap: 3px;
}

.friend-balance small {
  color: var(--muted);
  font-size: 12px;
}

.friend-balance strong {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.friend-balance.big strong {
  font-size: 24px;
}

.friend-hero-stats {
  display: grid;
  gap: 10px;
}

.friend-hero-stats div {
  display: grid;
  gap: 2px;
}

.friend-hero-stats small {
  color: var(--muted);
  font-size: 12px;
}

.friend-hero-stats b {
  font-size: 15px;
}

.friend-hero-transfer {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

@media(max-width:900px) {
  .friend-hero {
    grid-template-columns: 1fr;
  }
}

@media(max-width:760px) {
  .history-toolbar .segmented,
  .history-head .segmented {
    width: 100%;
    overflow-x: auto;
  }
}

/* Próximos pagos */
.overdue-panel {
  border-color: var(--amber);
  box-shadow: inset 3px 0 0 var(--amber);
}

.agenda-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 13px;
}

.agenda-range input {
  width: auto;
  margin-left: 6px;
}

.agenda-month {
  margin-bottom: 16px;
}

.agenda-row.done {
  opacity: .55;
}

.agenda-row > strong .muted {
  color: var(--muted);
  font-weight: 550;
}

.agenda-row .row-actions {
  flex: none;
}

@media(max-width:760px) {
  .agenda-row {
    flex-wrap: wrap;
  }

  .agenda-row > div:nth-child(2) {
    flex: 1 1 60%;
  }

  .agenda-row .row-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 50px;
  }
}

/* Acciones secundarias en un menú «⋯». */
.more-menu {
  position: relative;
}

.more-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 2px 9px;
  border-radius: calc(7px * var(--r));
  color: var(--muted);
  font-size: 16px;
  line-height: 1.2;
}

.more-menu > summary::-webkit-details-marker {
  display: none;
}

.more-menu > summary:hover,
.more-menu[open] > summary {
  background: var(--tint-gray);
  color: var(--ink);
}

.more-menu > div {
  display: grid;
  margin-top: 6px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: calc(10px * var(--r));
  background: var(--surface);
}

.more-menu[open] {
  flex-basis: 100%;
}

.more-menu > div a {
  padding: 8px 10px;
  border-radius: calc(7px * var(--r));
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
}

.more-menu > div a:hover {
  background: var(--tint);
}

.finished-panel > summary {
  cursor: pointer;
  padding: 16px 22px;
  font-size: 13px;
}

.finished-panel > summary small {
  color: var(--muted);
  margin-left: 6px;
}

.finished-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}

.empty .button {
  margin-top: 14px;
}

.includes {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

.agenda-range label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.month-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
}

/* Metas y límites de gasto como tarjetas con avance. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.plan-grid.inside {
  padding: 16px 22px 22px;
  margin: 0;
}

.plan-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  margin: 0;
}

.plan-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.plan-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.plan-card-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.plan-percent {
  font-size: 13px;
  font-weight: 650;
  color: var(--accent-text);
}

.plan-card progress {
  width: 100%;
}

.plan-amounts {
  font-size: 14px;
  margin: 0;
}

.plan-amounts b {
  font-size: 18px;
}

.plan-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.plan-card.near {
  border-color: var(--amber);
}

.plan-card.over {
  border-color: var(--red);
}

.plan-card.over .plan-percent {
  color: var(--red);
}

.plan-card-actions {
  margin-top: 4px;
}

.copy-budgets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-question p {
  margin: 4px 0 12px;
}

.match-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Apariencia elegida por cada persona (Preferencias → Apariencia). theme.js fija estos atributos en <html>. ── */
:root[data-corners=sharp] {
  --r: .25;
}

:root[data-corners=round] {
  --r: 1.8;
}

:root[data-font=serif] {
  --font: Georgia,'Times New Roman',serif;
}

:root[data-font=mono] {
  --font: ui-monospace,'Cascadia Code','SF Mono',Consolas,monospace;
}

.avatar.emoji {
  background: var(--nav-hover);
  font-size: 18px;
}

.look-panel {
  max-width: 760px;
}

.look-group {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
  min-width: 0;
}

.look-group legend,
.pill-choice legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 650;
  color: var(--ink);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.swatch[aria-pressed=true] {
  box-shadow: 0 0 0 3px var(--ink);
}

.swatch-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 6px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.swatch-custom input[type=color] {
  width: 46px;
  min-height: 38px;
  height: 38px;
  padding: 3px;
  cursor: pointer;
}

.pill-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.pill-choice label {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.pill-choice input {
  position: absolute;
  inset: 0;
  width: auto;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.pill-choice span,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: calc(19px * var(--r));
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.chip:hover,
.pill-choice label:hover span {
  border-color: var(--line-hover);
}

.pill-choice input:checked + span,
.chip[aria-current=true],
.chip[aria-pressed=true] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}

.pill-choice input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.pill-choice.avatars span {
  padding: 5px 11px;
  font-size: 19px;
}

.pill-choice.avatars label:first-child span {
  font-size: 13px;
}

.pill-choice .font-serif span {
  font-family: Georgia,'Times New Roman',serif;
}

.pill-choice .font-mono span {
  font-family: ui-monospace,'Cascadia Code',Consolas,monospace;
}

.look-preview {
  display: grid;
  grid-template-columns: minmax(200px,280px) minmax(0,1fr);
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: calc(12px * var(--r));
  background: var(--bg);
}

.look-preview .stat {
  margin: 0;
}

.look-preview-side {
  display: grid;
  gap: 12px;
}

/* ── Anotar rápido: compositor, botones de categoría y fecha, importe grande. ── */
.composer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 16px 22px;
  margin-bottom: 24px;
}

.composer > h2,
.composer > b {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.composer-actions {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px;
}

.composer-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid var(--line-strong);
  border-radius: calc(21px * var(--r));
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.composer-button span {
  font-size: 17px;
  line-height: 1;
}

.composer-button:hover {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 8%, var(--surface));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips + input:not([hidden]),
.chips + select:not([hidden]) {
  margin-top: 10px;
}

.field input[hidden],
.field select[hidden] {
  display: none;
}

.quick-repeat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 900px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.quick-form {
  max-width: 720px;
}

.quick-form .form-grid {
  grid-template-columns: minmax(0,1fr);
}

.quick-form [data-field=amount] input,
.quick-start .big-amount input {
  min-height: 60px;
  padding: 10px 14px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -.5px;
  color: var(--ink);
}

.quick-start {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(280px,420px);
  gap: 28px;
  align-items: start;
  padding: 26px 28px;
  margin-bottom: 24px;
  border-color: var(--line-hover);
}

.quick-start h2 {
  font-size: 22px;
  letter-spacing: -.5px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.quick-start p,
.quick-start form > small {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.quick-start form {
  display: grid;
  gap: 18px;
}

/* ── Movimientos como historia por día. ── */
.feed-day > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 23px 7px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}

.feed-day > header .feed-date,
.feed-day > header b {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-strong);
}

.feed-day ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px 23px;
  border-top: 1px solid var(--line-soft);
}

.feed-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  background: color-mix(in srgb, var(--tone) 13%, var(--surface));
}

.feed-body {
  min-width: 0;
}

.feed-body > b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.feed-body > small {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.feed-side {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.feed-side strong {
  font-size: 14.5px;
  white-space: nowrap;
}

.feed-actions {
  display: flex;
  gap: 12px;
}

.feed-actions .text-link {
  font-size: 12px;
  font-weight: 500;
}

.feed-item.voided .feed-body > b {
  text-decoration: line-through;
  color: var(--muted);
}

.feed-item.voided .feed-icon {
  filter: grayscale(1);
  opacity: .6;
}

/* ── Entrar y crear cuenta. ── */
.password-line {
  position: relative;
}

.password-line input {
  padding-right: 76px;
}

.reveal {
  position: absolute;
  right: 8px;
  bottom: 5px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
}

.login-card small.field-hint {
  margin: -8px 0 18px;
}

@media(max-width:760px) {
  .composer {
    padding: 14px 16px;
  }

  .composer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1 1 100%;
  }

  .composer-button {
    justify-content: center;
    padding: 9px 10px;
  }

  .quick-start {
    grid-template-columns: minmax(0,1fr);
    padding: 20px 18px;
  }

  .look-preview {
    grid-template-columns: minmax(0,1fr);
  }

  .feed-day > header,
  .feed-item {
    padding-left: 16px;
    padding-right: 16px;
  }

  .feed-item {
    grid-template-columns: 38px minmax(0,1fr) auto;
    gap: 11px;
  }

  .feed-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
}

/* Con el tipo ya elegido, las opciones se compactan para llegar de inmediato al importe. */
.quick-form .kind-cards:has(input:checked) {
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 8px;
}

.quick-form .kind-cards:has(input:checked) .kind-card {
  padding: 8px 12px;
  align-content: center;
}

.quick-form .kind-cards:has(input:checked) .kind-card small {
  display: none;
}

.quick-form .kind-cards:has(input:checked) .kind-card:not(:has(input:checked)) {
  opacity: .75;
}

/* Importes sin flechitas: se escriben, no se ajustan de centavo en centavo. */
input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.user-line .avatar {
  background: #ffffff26;
}

.forgot-link {
  display: block;
  margin: -8px 0 18px;
  text-align: right;
}

.login-card>p.auth-switch {
  margin: 20px 0 0;
  text-align: center;
}

/* ── Menos a la vista: pestañas por sección y «Más…» para lo poco usado. ── */
.section-tabs {
  display: flex;
  gap: 4px;
  margin: -8px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.section-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}

.section-tabs a:hover {
  color: var(--ink);
}

.section-tabs a.selected {
  color: var(--link);
  border-bottom-color: var(--link);
}

.section-tabs .nav-count {
  margin-left: 0;
}

.sidebar nav {
  margin-top: 26px;
}

.kind-cards:not(.show-all):not(:has(.kind-extra input:checked)) .kind-extra,
.kind-cards.show-all .kind-more,
.kind-cards:has(.kind-extra input:checked) .kind-more {
  display: none;
}

.kind-more {
  text-align: left;
  font: inherit;
  border-style: dashed;
}

.look-more .look-group:first-of-type {
  margin-top: 16px;
}

.look-more {
  margin-bottom: 8px;
}

/* ── Accesibilidad: texto solo para lectores de pantalla, saltar al contenido, estados sin depender del color. ── */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: calc(8px * var(--r));
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.composer > h2,
.feed-day > header .feed-date {
  margin: 0;
  line-height: inherit;
}

.look-title {
  margin-bottom: 10px;
  font-weight: 650;
  color: var(--ink);
}

/* Elegido = relleno y además una palomita, para no depender solo del color. */
.pill-choice input:checked + span::before,
.chip[aria-pressed=true]::before,
.reveal[aria-pressed=true]::before {
  content: '✓';
  content: '✓' / '';
  margin-right: 2px;
  font-weight: 700;
}

.pill-choice.avatars input:checked + span::before {
  content: none;
}

.pill-choice.avatars input:checked + span {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
}

.login-field {
  margin-bottom: 18px;
}

.login-card .login-field label {
  margin-bottom: 0;
}

.login-card .login-field .field-hint {
  margin: 4px 0 0;
  line-height: 1.5;
}

/* Alto contraste de Windows: el relleno y las sombras desaparecen, así que lo elegido se marca con contorno. */
@media (forced-colors: active) {
  .swatch {
    forced-color-adjust: none;
  }

  .swatch[aria-pressed=true],
  .chip[aria-pressed=true],
  .pill-choice input:checked + span,
  .kind-card:has(input:checked),
  .section-tabs a.selected,
  .sidebar a.selected {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

/* ── Metas: apartar y sacar, historia y qué pasó con el dinero. ── */
.plan-card.reached {
  border-color: var(--green);
}

.goal-move label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}

.goal-move > div,
.goal-choices,
.goal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.goal-move input {
  flex: 1 1 90px;
  min-width: 0;
}

.goal-links {
  gap: 4px 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}

.plan-card button.text-link {
  padding: 0;
  font-size: inherit;
  text-align: left;
}

.goal-history summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}

.goal-history ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
}

.goal-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid var(--line-soft);
}

.goal-history li span {
  color: var(--muted);
}

.goal-reached {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── Avisos de lo que la app hizo o propone hacer sola. ── */
.auto-done,
.auto-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Aviso de proyecto personal en la entrada. */
.auth-disclaimer {
  display: block;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer > span {
  text-wrap: pretty;
}

/* ── Comprobantes (opcionales) ── */
input[type=file] {
  cursor: pointer;
  padding: 6px;
  color: var(--muted);
}

input[type=file]::file-selector-button {
  margin-inline-end: 12px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: calc(8px * var(--r));
  background: var(--surface-2);
  color: var(--text-strong);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}

input[type=file]:hover::file-selector-button {
  border-color: var(--field-line);
  background: var(--tint);
}

.receipt-field {
  margin-top: 20px;
}

.receipt-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-remove {
  margin-bottom: 10px;
}

.event-row:has(> .repayment-answer) {
  flex-wrap: wrap;
}

.event-row > .repayment-answer {
  flex: 1 0 100%;
}

.repayment-receipt {
  flex-basis: 100%;
  font-size: 13px;
}

.repayment-receipt summary {
  cursor: pointer;
  color: var(--link);
}

.receipt-ready {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 13px;
  color: var(--green);
}

.receipt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.receipt-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: calc(12px * var(--r));
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.receipt-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--tint-gray);
  border-bottom: 1px solid var(--line);
}

.receipt-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.receipt-pdf {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.receipt-pdf .ico {
  font-size: 34px;
  color: var(--accent-text);
}

.receipt-meta {
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
  min-width: 0;
}

.receipt-meta b {
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-meta small {
  font-size: 12px;
  color: var(--muted);
}

.receipt-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.receipt-actions form {
  display: contents;
}

.receipt-upload {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.receipt-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 550;
  color: var(--link);
}

.receipt-link:hover {
  text-decoration: underline;
}

.entry-receipts-head {
  padding: 0 0 16px;
}

/* ----- Aviso de privacidad, términos, aceptación y errores ----- */
.legal {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(22px, 5vw, 40px);
  overflow: visible;
}

.legal .brand {
  display: inline-flex;
  margin-block-end: 18px;
}

.legal h1 {
  margin: 6px 0 4px;
}

.legal h2 {
  margin: 28px 0 8px;
  font-size: 17px;
}

.legal p,
.legal li {
  color: var(--muted);
  line-height: 1.6;
  max-width: 75ch;
}

.legal b,
.legal td:first-child {
  color: var(--ink);
}

.legal ul,
.legal ol {
  padding-inline-start: 20px;
  display: grid;
  gap: 6px;
}

.legal-date {
  font-size: 13px;
}

.legal-links {
  margin-block-start: 32px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
}

.legal mark,
.consent mark {
  background: color-mix(in srgb, var(--amber, #d97706) 22%, transparent);
  color: var(--ink);
  padding-inline: 3px;
  border-radius: 4px;
}

.auth-content:has(> .legal) {
  place-items: start center;
}

.consent ul {
  padding-inline-start: 20px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.consent-check {
  align-items: flex-start !important;
  line-height: 1.5 !important;
  margin-block: 18px 4px;
  cursor: pointer;
}

.consent-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-block-start: 1px;
}

/* Aviso simplificado: en el registro (antes de crear la cuenta) y en /aviso/. */
.legal-summary {
  margin-block: 4px 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: calc(12px * var(--r, 1));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  font-size: 13px;
  line-height: 1.55;
}

.legal-summary h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.legal-summary p {
  margin: 10px 0 0;
  color: var(--muted);
}

.login-card .legal-summary ul {
  margin: 0;
  font-size: 13px;
}

.login-card .consent-check {
  margin-block: 14px 4px;
  font-size: 13px;
  font-weight: 450;
  color: var(--ink);
}

.login-card .consent-check input {
  display: inline-block;
  margin-top: 1px;
}

.login-card .consent-check + .errorlist,
.form-panel .consent-check + .errorlist {
  margin-block: 4px 0;
}

.login-card form > .button.full {
  margin-top: 18px;
}

.consent-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.error-card .brand {
  display: inline-flex;
  margin-block-end: 18px;
}

/* En teléfonos, cada movimiento usa todo el ancho para su texto; las acciones bajan a su renglón. */
@media (max-width: 420px) {
  .feed-side {
    display: contents;
  }

  .feed-side > strong {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .feed-side > .receipt-link,
  .feed-actions {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .feed-actions .text-link {
    display: inline-flex;
    align-items: center;
    min-block-size: 24px;
  }

  /* La tabla del aviso tiene dos columnas cortas: cabe sin desplazarse de lado. */
  .legal .table-scroll table {
    min-width: 0;
  }
}


/* Cuenta del grupo: una fila por persona; se apila en pantallas angostas. */
.group-people {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.group-person {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr) auto;
  gap: 12px;
  align-items: end;
}

.group-person [data-field="contact_name"][hidden] {
  display: block;
  visibility: hidden;
}

.group-person .icon-button {
  width: 44px;
  height: 44px;
}

.group-left {
  margin: 14px 0 22px;
  font-weight: 600;
  color: var(--ink);
}

.group-left.over {
  color: var(--red);
}

.tip-picker {
  margin-top: 8px;
}

.group-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.group-table th,
.group-table td {
  padding: 6px 8px;
  text-align: end;
  border-bottom: 1px solid var(--line);
}

.group-table th:first-child {
  text-align: start;
  font-weight: 500;
}

/* El encabezado de cada fila es parte de la fila: sin el fondo de los encabezados de columna. */
.group-table tbody th,
.group-table tfoot th {
  background: none;
  border-block: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  font-size: inherit;
  white-space: normal;
}

.group-table tbody tr:last-child > th {
  border-bottom: 0;
}

.group-table tbody tr:hover > th {
  background: var(--surface-2);
}

.panel > .group-table :is(th, td):first-child {
  padding-inline-start: 18px;
}

.panel > .group-table :is(th, td):last-child {
  padding-inline-end: 18px;
}

.panel > .group-table ~ :is(.group-note, .entry-actions) {
  padding-inline: 18px;
}

.group-closed td:not(:last-child) {
  text-decoration: line-through;
  opacity: .6;
}

.group-write-off {
  padding-block: 4px 16px;
}

.group-write-off summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.group-table tfoot th,
.group-table tfoot td {
  font-weight: 700;
  border-bottom: 0;
}

@media (max-width: 640px) {
  .group-person {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .group-person [data-field="friend"] {
    grid-column: 1 / -1;
  }

  .group-person [data-field="contact_name"][hidden] {
    display: none;
  }

  .group-table th,
  .group-table td {
    padding: 6px 4px;
    font-size: 14px;
  }
}

/* ── Seguridad de la cuenta: códigos, dos pasos, llaves de acceso y sesiones. ── */
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: .35em;
  min-height: 50px;
  max-width: 300px;
}

.auth-secondary {
  margin-top: 16px;
  text-align: center;
}

.auth-secondary button,
.auth-details summary {
  font-size: 13px;
  cursor: pointer;
}

.auth-details {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.auth-details summary {
  color: var(--link);
  font-weight: 550;
}

.auth-details[open] summary {
  margin-bottom: 14px;
}

.passkey-button {
  margin-top: 12px;
}

.passkey-error {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--red);
}

.form-panel.narrow {
  max-width: 620px;
}

.form-panel>p {
  font-size: 13.5px;
  line-height: 1.8;
}

.security-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.security-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.security-list li:first-child {
  border-top: 0;
}

.security-list li>div {
  flex: 1 1 260px;
  min-width: 0;
}

.security-list small {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.security-list .row-actions {
  display: flex;
  gap: 8px;
}

.steps-list {
  margin: 0 0 22px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.8;
}

.steps-list li+li {
  margin-top: 14px;
}

.qr {
  display: block;
  margin: 12px 0 4px;
  padding: 10px;
  border-radius: calc(10px * var(--r));
  /* Siempre claro: las cámaras leen mal un código QR con los colores invertidos. */
  background: #fff;
}

.secret,
.recovery-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}

.recovery-codes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: calc(10px * var(--r));
  background: var(--tint);
}

/* Dentro de un panel de formulario el relleno ya lo pone el panel. */
.form-panel.flush>.panel-head,
.form-panel.flush>.panel-note {
  padding-left: 0;
  padding-right: 0;
}

.form-panel.flush>.panel-head {
  padding-top: 0;
}

/* ── Avisos: campanita de la barra superior. ── */
.ico-bell { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9a6 6 0 0 1 12 0c0 6 2.5 7.5 2.5 7.5h-17S6 15 6 9Zm4 10.5a2.2 2.2 0 0 0 4 0'/%3E%3C/svg%3E"); }

.topbar>div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bell {
  position: relative;
}

.bell .nav-count {
  position: absolute;
  top: -2px;
  right: -4px;
  margin: 0;
  min-width: 17px;
  padding: 0 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
  line-height: 17px;
  text-align: center;
}

/* Ventana de la campanita: se abre bajo la barra superior, pegada a la derecha. */
@supports not selector(:popover-open) {
  .bell-panel {
    display: none;
  }
}

.bell-panel {
  position: fixed;
  inset: 64px 20px auto auto;
  margin: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 90px));
  overflow-y: auto;
  padding: 6px 0 0;
  border: 1px solid var(--line);
  border-radius: calc(14px * var(--r));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 50px rgb(0 0 0 / .28);
}

.bell-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 10px;
}

.bell-panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.bell-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}

.bell-row:hover,
.bell-all:hover {
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}

.bell-row b {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.bell-row small {
  color: var(--muted);
  font-size: 12px;
}

.bell-row strong {
  font-size: 13px;
  white-space: nowrap;
}

.bell-when {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.bell-when.when-overdue {
  color: var(--amber, #b7791f);
}

.bell-when.when-today,
.bell-when.when-tomorrow,
.bell-when.tone-friend {
  color: var(--link);
}

.bell-empty {
  margin: 0;
  padding: 22px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.bell-all {
  display: block;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  color: var(--link);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 640px) {
  .bell-panel {
    inset: 60px 12px auto 12px;
    width: auto;
  }
}

/* En qué se fue tu dinero: una fila por categoría con su parte del total. */
.spending-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 23px 20px;
  list-style: none;
}

.spending-list li {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) minmax(60px, 2fr) auto;
  align-items: center;
  gap: 12px;
}

.spending-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spending-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spending-amount small {
  display: inline-block;
  min-width: 3.2em;
  color: var(--muted);
}

/* accent-color aún no pinta <progress> en todos los navegadores: se dibuja con sus pseudo-elementos. */
.spending-bar {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.spending-bar::-webkit-progress-bar {
  background: var(--surface-2);
}

.spending-bar::-webkit-progress-value {
  background: var(--blue);
  border-radius: 4px;
}

.spending-bar::-moz-progress-bar {
  background: var(--blue);
  border-radius: 4px;
}

.outlook b {
  display: block;
}

@media (max-width: 560px) {
  .spending-list li {
    grid-template-columns: 1fr auto;
  }

  .spending-bar {
    grid-column: 1 / -1;
    order: 3;
  }
}

.top-spending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 23px 14px;
  color: var(--muted);
  font-size: 13px;
}
