@font-face {
  font-family: 'Sora';
  src: url('/fonts/sora-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  src: url('/fonts/sora-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  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;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #4D6BFF;
  --violet: #8B5CF6;
  --pink: #FF3D95;
  --mint: #18E3A0;
  --amber: #FFB020;
  --red: #FF4D6A;
  --cyan: #22D3EE;
  --grad-main: linear-gradient(135deg, #3B5BFF 0%, #8B3DFF 55%, #FF3D95 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar: 268px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0A0720;
  --glow-1: rgba(139, 92, 246, 0.38);
  --glow-2: rgba(34, 211, 238, 0.14);
  --glow-3: rgba(255, 61, 149, 0.16);
  --surface: #161140;
  --surface-2: #1F1858;
  --surface-3: #2A2170;
  --line: rgba(255, 255, 255, 0.09);
  --text: #F7F5FF;
  --muted: #A9A3DA;
  --pos: #18E3A0;
  --neg: #FF6B8A;
  --input-bg: rgba(255, 255, 255, 0.06);
  --shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
  --glass: rgba(22, 17, 64, 0.72);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #F1EFFF;
  --glow-1: rgba(139, 92, 246, 0.24);
  --glow-2: rgba(34, 211, 238, 0.2);
  --glow-3: rgba(255, 61, 149, 0.14);
  --surface: #FFFFFF;
  --surface-2: #F6F4FF;
  --surface-3: #ECE8FF;
  --line: rgba(33, 24, 88, 0.1);
  --text: #150F3D;
  --muted: #625C99;
  --pos: #067A52;
  --neg: #D7254F;
  --input-bg: #F6F4FF;
  --shadow: 0 20px 44px -26px rgba(60, 40, 160, 0.45);
  --glass: rgba(255, 255, 255, 0.78);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 88% -8%, var(--glow-1), transparent 62%),
    radial-gradient(700px 520px at -8% 6%, var(--glow-2), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, var(--glow-3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.15; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.hide-amounts .amt { filter: blur(9px); user-select: none; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border: 0; border-radius: var(--radius-sm);
  font-weight: 650; font-size: 15px; white-space: nowrap;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--grad-main); color: #fff; box-shadow: 0 12px 30px -12px rgba(139, 61, 255, 0.85); }
.btn-primary:hover:not([disabled]) { filter: brightness(1.1); }
.btn-soft { background: var(--surface-3); color: var(--text); }
.btn-soft:hover:not([disabled]) { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover:not([disabled]) { background: var(--input-bg); }
.btn-danger { background: rgba(255, 77, 106, 0.14); color: var(--neg); }
.btn-danger:hover:not([disabled]) { background: rgba(255, 77, 106, 0.24); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--input-bg); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }

/* Formularios */
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--neg); min-height: 0; }
.field-error:empty { display: none; }
input:not([type='checkbox']):not([type='radio']), select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { padding: 12px 14px; min-height: 84px; resize: vertical; }
select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
select option, select optgroup { background: var(--surface); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.22); }
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--neg); }
input[type='date'] { min-width: 0; }
input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--violet); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.input-wrap > input:not([type='checkbox']):not([type='radio']) { padding-left: 44px; padding-right: 48px; }
.input-wrap > .icon-btn { position: absolute; right: 4px; top: 4px; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-error { padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255, 77, 106, 0.14); color: var(--neg); font-size: 14px; }
.form-error:empty { display: none; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.strength i { height: 4px; border-radius: 4px; background: var(--line); transition: background 0.2s; }
.strength[data-level='1'] i:nth-child(-n + 1) { background: var(--red); }
.strength[data-level='2'] i:nth-child(-n + 2) { background: var(--amber); }
.strength[data-level='3'] i:nth-child(-n + 3) { background: var(--cyan); }
.strength[data-level='4'] i:nth-child(-n + 4) { background: var(--mint); }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.seg button.active { background: var(--grad-main); color: #fff; box-shadow: 0 8px 20px -10px rgba(139, 61, 255, 0.9); }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--input-bg); font-size: 13.5px; font-weight: 550; color: var(--text); transition: background 0.15s, border-color 0.15s; }
.chip .icon { width: 16px; height: 16px; }
.chip:hover { border-color: var(--violet); }
.chip.active { background: rgba(139, 92, 246, 0.24); border-color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.pill .icon { width: 14px; height: 14px; }
.pill-bizum { background: rgba(0, 209, 193, 0.18); color: #00D1C1; }
.pill-credit { background: rgba(255, 61, 149, 0.18); color: var(--pink); }
.pill-debit { background: rgba(77, 107, 255, 0.2); color: #8EA2FF; }
:root[data-theme='light'] .pill-bizum { color: #007F75; }
:root[data-theme='light'] .pill-debit { color: #3550D6; }
:root[data-theme='light'] .pill-credit { color: #C8206F; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel-title { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title a, .link { color: var(--cyan); font-size: 14px; font-weight: 600; background: none; border: 0; padding: 0; }
:root[data-theme='light'] .panel-title a, :root[data-theme='light'] .link { color: #5B3FD9; }

/* Estructura */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.content { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad-main); display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgba(139, 61, 255, 0.9); }
.brand-mark svg { width: 22px; height: 22px; }
.topbar-actions { display: flex; gap: 2px; }

.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: 66px; padding: 0 6px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 8px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 16px; }
.tab .icon { width: 22px; height: 22px; }
.tab.active { color: var(--text); }
.tab.active .icon { color: var(--pink); }
.tab-add { justify-self: center; width: 54px; height: 54px; border: 0; border-radius: 20px; background: var(--grad-main); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 14px 28px -10px rgba(139, 61, 255, 0.95); }
.tab-add .icon { width: 26px; height: 26px; }

.page { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: clamp(26px, 5vw, 34px); }
.page-sub { color: var(--muted); margin-top: 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-head h2 { font-size: 19px; }

@media (min-width: 960px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 22px; position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    padding: 26px 18px 20px; border-right: 1px solid var(--line);
    background: var(--glass); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  }
  .content { margin: 0 0 0 var(--sidebar); max-width: none; padding: 34px 44px 60px; }
  .content-inner { max-width: 1120px; margin: 0 auto; }
  .topbar, .tabbar { display: none; }
  .nav { display: grid; gap: 4px; }
  .nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 14px; font-weight: 600; color: var(--muted); transition: background 0.15s, color 0.15s; }
  .nav a:hover { background: var(--input-bg); color: var(--text); }
  .nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(139, 92, 246, 0.28), rgba(255, 61, 149, 0.16)); }
  .nav a.active .icon { color: var(--pink); }
  .sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
  .user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--input-bg); border: 1px solid var(--line); }
  .user-chip .avatar { width: 38px; height: 38px; }
  .user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
  .user-chip .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-chip .who span { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tools { display: flex; gap: 6px; }
}
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 14px; background: var(--grad-main); color: #fff; font-family: var(--font-display); font-weight: 700; }

/* Tarjetas virtuales */
.vcard-wrap { container-type: inline-size; width: 100%; }
.vcard {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.586 / 1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 6cqw 6.4cqw; border-radius: 6cqw; color: #fff; background: var(--g);
  box-shadow: 0 26px 50px -24px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  text-align: left; font-family: var(--font-display);
}
.vcard::before { content: ''; position: absolute; z-index: -1; width: 78cqw; height: 78cqw; right: -24cqw; top: -38cqw; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 66%); }
.vcard::after { content: ''; position: absolute; z-index: -1; width: 70cqw; height: 70cqw; left: -26cqw; bottom: -42cqw; border-radius: 50%; background: radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 68%); }
button.vcard { width: 100%; border: 0; cursor: pointer; transition: transform 0.2s ease; }
button.vcard:hover { transform: translateY(-3px) rotate(-0.4deg); }
.vcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 3cqw; }
.vcard-alias { font-weight: 650; font-size: 4.6cqw; letter-spacing: -0.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25); }
.vcard-badges { display: flex; gap: 1.6cqw; flex-wrap: wrap; justify-content: flex-end; }
.vcard-badges span { height: 6.6cqw; padding: 0 2.8cqw; border-radius: 99px; background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(6px); font-size: 3.4cqw; font-weight: 650; display: inline-flex; align-items: center; gap: 1.2cqw; font-family: var(--font-body); }
.vcard-badges .icon { width: 3.8cqw; height: 3.8cqw; }
.vcard-mid { display: flex; align-items: center; gap: 4cqw; }
.emv { width: 11.5cqw; height: 8.6cqw; border-radius: 1.8cqw; background: linear-gradient(135deg, #FFE9A8 0%, #D9A441 100%); position: relative; box-shadow: inset 0 0 0 0.3cqw rgba(120, 80, 0, 0.35); }
.emv::before { content: ''; position: absolute; inset: 1.6cqw 0; background: repeating-linear-gradient(0deg, transparent 0 1.4cqw, rgba(120, 80, 0, 0.28) 1.4cqw 1.7cqw); }
.emv::after { content: ''; position: absolute; inset: 0 3.6cqw; border-left: 0.3cqw solid rgba(120, 80, 0, 0.28); border-right: 0.3cqw solid rgba(120, 80, 0, 0.28); }
.contactless { width: 6.4cqw; height: 6.4cqw; opacity: 0.9; }
.vcard-number { font-size: 6.2cqw; font-weight: 600; letter-spacing: 0.06em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vcard-bottom { display: flex; align-items: flex-end; gap: 6cqw; }
.vcard-bottom .grow { flex: 1; min-width: 0; }
.vcard-bottom small { display: block; font-family: var(--font-body); font-size: 3cqw; opacity: 0.8; margin-bottom: 0.6cqw; }
.num-group { display: inline-block; }
.vcard-number { word-spacing: 1.6cqw; }
.mask-dot { display: inline-block; width: 1.7cqw; height: 1.7cqw; border-radius: 50%; background: currentColor; margin-right: 1.1cqw; vertical-align: middle; }
.num-group .mask-dot:last-child { margin-right: 0; }
.scroller .vcard { box-shadow: 0 18px 30px -18px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.vcard-bottom b { font-size: 3.9cqw; font-weight: 600; letter-spacing: 0.04em; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vcard-net { height: 9cqw; display: flex; align-items: center; }
.vcard-net svg { height: 100%; width: auto; }

.theme-aurora { --g: linear-gradient(135deg, #3B5BFF 0%, #8B3DFF 52%, #FF3D95 100%); --glow: rgba(139, 61, 255, 0.8); }
.theme-sunset { --g: linear-gradient(135deg, #FF9500 0%, #FF3D6E 52%, #C026D3 100%); --glow: rgba(255, 61, 110, 0.75); }
.theme-ocean { --g: linear-gradient(135deg, #00D0FF 0%, #2563FF 56%, #5B1FE0 100%); --glow: rgba(37, 99, 255, 0.8); }
.theme-mint { --g: linear-gradient(135deg, #00F0A0 0%, #00B8D9 52%, #2563FF 100%); --glow: rgba(0, 184, 217, 0.7); }
.theme-grape { --g: linear-gradient(135deg, #7A2BFF 0%, #C026FF 55%, #FF4FD8 100%); --glow: rgba(192, 38, 255, 0.75); }
.theme-rose { --g: linear-gradient(135deg, #FF0F5B 0%, #FF4D7D 48%, #FFB36B 100%); --glow: rgba(255, 15, 91, 0.7); }
.theme-noir { --g: linear-gradient(135deg, #2B2B4A 0%, #14142B 55%, #05050F 100%); --glow: rgba(0, 0, 0, 0.8); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--g); position: relative; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.swatch.active { outline: 3px solid var(--text); outline-offset: 2px; }

/* Resumen */
.hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 30px; padding: 26px 24px 24px; color: #fff;
  background: var(--grad-main); box-shadow: 0 34px 70px -34px rgba(139, 61, 255, 0.95);
}
.hero::before { content: ''; position: absolute; z-index: -1; width: 460px; height: 460px; right: -140px; top: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 66%); }
.hero::after { content: ''; position: absolute; z-index: -1; width: 420px; height: 420px; left: -160px; bottom: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, 0.5), transparent 66%); }
.hero { display: grid; gap: 22px; }
.hero-eye { position: absolute; top: 16px; right: 16px; }
.hero-main { min-width: 0; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr auto; align-items: end; column-gap: 40px; padding: 32px 36px; }
}
.hero-label { font-weight: 600; opacity: 0.88; font-size: 14.5px; }
.hero-amount { font-family: var(--font-display); font-weight: 700; font-size: clamp(42px, 9vw, 72px); letter-spacing: -0.045em; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.hero-amount .dec { font-size: 0.5em; opacity: 0.72; letter-spacing: -0.02em; }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 99px; background: rgba(10, 7, 32, 0.28); backdrop-filter: blur(10px); font-weight: 650; font-size: 14px; }
.hero-pill .dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.hero-pill .dot .icon { width: 14px; height: 14px; }
.hero-pill small { font-weight: 500; opacity: 0.85; font-size: 12.5px; }
.quick { display: flex; gap: 22px; flex-wrap: wrap; }
.quick-btn { display: grid; justify-items: center; gap: 8px; background: none; border: 0; color: #fff; font-size: 13px; font-weight: 600; }
.quick-btn span.circle { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.28); backdrop-filter: blur(8px); transition: transform 0.15s, background 0.15s; }
.quick-btn:hover span.circle { transform: translateY(-2px); background: rgba(255, 255, 255, 0.3); }
.quick-btn .icon { width: 24px; height: 24px; }
.hero .icon-btn { color: #fff; background: rgba(255, 255, 255, 0.16); }
.hero .icon-btn:hover { background: rgba(255, 255, 255, 0.28); color: #fff; }

.scroller { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 4px; padding: 12px 4px 44px; margin: -12px -4px -22px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { flex: 0 0 min(320px, 82%); scroll-snap-align: start; }

.acc-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.acc-tile-head .pill { flex: none; }
.acc-tile { display: grid; gap: 14px; text-align: left; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform 0.15s, border-color 0.15s; }
.acc-tile:hover { transform: translateY(-2px); border-color: var(--violet); }
.acc-tile-head { display: flex; align-items: center; gap: 12px; }
.acc-dot { width: 42px; height: 42px; border-radius: 14px; background: var(--g); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 10px 22px -10px var(--glow); }
.acc-tile-head b { display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-tile-head > div:nth-child(2) { min-width: 0; flex: 1; }
.acc-tile-head span.sub { font-size: 13px; color: var(--muted); }
.balance { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; gap: 22px; }
.grid-2 > .panel { display: flex; flex-direction: column; }
.panel-body { flex: 1; display: grid; align-content: center; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.donut-box { display: grid; gap: 20px; align-items: center; justify-items: center; }
@media (min-width: 520px) { .donut-box { grid-template-columns: 190px 1fr; justify-items: stretch; } }
.donut { width: 190px; height: 190px; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-family: var(--font-display); font-size: 21px; letter-spacing: -0.03em; }
.donut-center span { font-size: 12.5px; color: var(--muted); }
.legend { display: grid; gap: 9px; width: 100%; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend-row i { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.legend-row span.name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row b { font-variant-numeric: tabular-nums; font-weight: 650; }
.bars { width: 100%; height: auto; display: block; }
.bars text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.bars .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-key { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; }

/* Movimientos */
.tx-list { display: grid; gap: 10px; }
.tx-flow { display: grid; gap: 10px; }
.tx-day {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 18px 6px 6px; font-size: 13px; font-weight: 650; color: var(--muted);
  background: linear-gradient(var(--surface) 75%, transparent);
}
.tx-flow .tx-day { position: static; background: none; }
.tx-flow .tx-list > .tx-day:first-child { padding-top: 6px; }
.tx-day-sum { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted); }
.tx-day-sum.pos { color: var(--pos); }
.tx {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px;
  padding: 4px 6px 4px 4px; border-radius: 18px; background: var(--input-bg); border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tx-flow .tx { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.tx:hover, .tx:focus-within { border-color: color-mix(in srgb, var(--violet, #7C5CFF) 45%, transparent); }
.tx-body {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; min-width: 0;
  padding: 10px 8px; border: 0; background: transparent; text-align: left; border-radius: 16px;
}
.tx-when { display: flex; align-items: center; gap: 6px; }
.tx-date-wrap { position: relative; display: grid; }
.tx-date {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.tx-date:hover { color: var(--text); background: var(--surface-3); }
.tx-date .icon { width: 16px; height: 16px; color: var(--violet); }
.tx-date-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.tx-actions { display: flex; align-items: center; opacity: 0.55; transition: opacity 0.12s; }
.tx:hover .tx-actions, .tx:focus-within .tx-actions { opacity: 1; }
.tx-actions .icon-btn { width: 36px; height: 36px; }
.tx-actions .icon-btn:hover { background: var(--surface-3); }
.tx-actions > span { display: contents; }
@media (hover: none) { .tx-actions { opacity: 1; } }
.tx-ico { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.tx-ico .icon { width: 22px; height: 22px; }
.tx-main { min-width: 0; }
.tx-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt { font-family: var(--font-display); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; text-align: right; white-space: nowrap; }
.tx-amt.pos { color: var(--pos); }
.tx-amt.neu { color: var(--cyan); }
:root[data-theme='light'] .tx-amt.neu { color: #2F55E0; }

.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-row .input-wrap { flex: 1 1 240px; }
.toolbar select.sort { width: auto; min-width: 190px; }
.toolbar-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.month-nav {
  display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 4px; border-radius: 14px;
  background: var(--input-bg); border: 1px solid var(--line);
}
.month-nav .icon-btn { width: 36px; height: 36px; color: var(--text); }
.month-nav .icon-btn .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.month-nav .icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.month-label { min-width: 150px; text-align: center; font-weight: 650; font-size: 14.5px; padding: 0 6px; white-space: nowrap; }
.filter-panel { display: none; gap: 18px; padding: 20px; margin-top: 4px; }
.filter-panel.open { display: grid; }
.filter-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.badge-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 700; }
.summary { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stat small { color: var(--muted); font-size: 12.5px; display: block; }
.stat b { font-family: var(--font-display); font-size: clamp(15px, 3.4vw, 21px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b.pos { color: var(--pos); }
.stat b.neg { color: var(--neg); }

/* Cuentas y tarjetas */
.bizum-panel { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--radius); color: #fff; background: linear-gradient(120deg, #00B8A9 0%, #00D1C1 40%, #3BE8A0 100%); box-shadow: 0 26px 50px -28px rgba(0, 209, 193, 0.9); }
.bizum-panel .b-ico { width: 48px; height: 48px; border-radius: 16px; background: rgba(255, 255, 255, 0.24); display: grid; place-items: center; }
.bizum-panel .b-ico .icon { width: 24px; height: 24px; }
.bizum-panel .b-text { flex: 1 1 220px; min-width: 0; color: #04332E; }
.bizum-panel .b-text b { display: block; font-family: var(--font-display); font-size: 17px; letter-spacing: -0.02em; }
.bizum-panel .b-text span { font-size: 14px; opacity: 0.85; }
.bizum-panel .btn-soft { background: rgba(4, 51, 46, 0.2); color: #04332E; }
.bizum-panel .b-ico { color: #04332E; }

.acc-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.acc-card { border-radius: 26px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; }
.acc-card.archived { opacity: 0.6; }
.acc-head { position: relative; isolation: isolate; padding: 20px 22px 22px; color: #fff; background: var(--g); display: grid; gap: 18px; }
.acc-head::before { content: ''; position: absolute; z-index: -1; width: 260px; height: 260px; right: -90px; top: -130px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.36), transparent 66%); }
.acc-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acc-head-top b { font-family: var(--font-display); font-size: 17px; letter-spacing: -0.02em; display: block; }
.acc-head-top span { font-size: 13px; opacity: 0.85; }
.acc-head .balance { font-size: 34px; }
.acc-head .pill { background: rgba(255, 255, 255, 0.22); color: #fff; }
.acc-body { padding: 18px 22px 20px; display: grid; gap: 14px; }
.kv { display: grid; gap: 2px; min-width: 0; }
.kv small { color: var(--muted); font-size: 12.5px; }
.kv .val { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.kv .val span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.card-grid { display: grid; gap: 34px 26px; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); align-items: start; }
.card-item { display: grid; gap: 16px; align-content: start; min-width: 0; }
.card-item-info { display: grid; gap: 10px; padding: 0 4px; }
.card-item-info .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.usage { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.usage-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad-main); }
.usage-bar i.high { background: linear-gradient(90deg, var(--amber), var(--red)); }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--line); }
.copy-row small { color: var(--muted); display: block; font-size: 12px; }
.copy-row b { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.card-hint { margin-top: -6px; }

/* Ajustes */
.set-grid { display: grid; gap: 22px; }
@media (min-width: 900px) { .set-grid { grid-template-columns: 1fr 1fr; } }
.list-plain { display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; }
.list-item .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.list-item .ico .icon { width: 18px; height: 18px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-weight: 600; font-size: 14.5px; }
.list-item .grow span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .ico.bad { background: rgba(255, 77, 106, 0.18); color: var(--neg); }
.list-item .ico.good { background: rgba(24, 227, 160, 0.16); color: var(--pos); }
.danger-zone { border-color: rgba(255, 77, 106, 0.35); }

/* Modales y avisos */
.backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(6, 4, 22, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.18s ease; }
.backdrop.closing { animation: fade-out 0.16s ease forwards; }
.modal { width: 100%; max-width: 560px; max-height: 94vh; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 28px 28px 0 0; box-shadow: var(--shadow); animation: sheet 0.26s cubic-bezier(0.2, 0.9, 0.3, 1); }
.modal-wide { max-width: 720px; }
.modal-xl { max-width: 1040px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px 24px; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 12px 24px 24px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 18px; align-content: start; }
.modal-foot {
  position: sticky; bottom: -24px; z-index: 3; display: flex; gap: 10px; flex-wrap: wrap;
  margin: 4px -24px -24px; padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent 0, var(--surface) 20px);
}
.modal-foot > .btn { flex: 1 1 auto; }
.modal-foot > .btn-danger { flex: 0 0 auto; }
.card-preview { width: 100%; max-width: 360px; margin: 0 auto; }
.modal-foot .grow { flex: 1; }
@media (min-width: 640px) {
  .backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: 28px; }
}
.amount-input { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 44px; letter-spacing: -0.04em; min-height: 76px; border-radius: 20px; }
.amount-wrap { position: relative; }
.amount-wrap .cur { position: absolute; right: 22px; top: 50%; translate: 0 -50%; font-family: var(--font-display); font-size: 24px; color: var(--muted); pointer-events: none; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr)); gap: 8px; }
.cat-opt { display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 0; padding: 12px 6px 10px; line-height: 1.25; border-radius: 16px; border: 1px solid var(--line); background: var(--input-bg); font-size: 12.5px; font-weight: 600; text-align: center; transition: border-color 0.15s, background 0.15s; }
.cat-opt .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 24%, transparent); color: var(--c); }
.cat-opt .ico .icon { width: 19px; height: 19px; }
.cat-opt:hover { border-color: var(--c); }
.cat-opt.active { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: 0 0 0 1px var(--c); }

.toasts { position: fixed; z-index: 90; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 960px) { .toasts { bottom: 28px; } }
.toast { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; font-weight: 600; font-size: 14.5px; background: var(--surface-3); border: 1px solid var(--line); box-shadow: var(--shadow); animation: toast-in 0.25s ease; }
.toast .icon { color: var(--pos); }
.toast-error .icon { color: var(--neg); }
.toast.out { animation: fade-out 0.22s ease forwards; }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 38px 20px; color: var(--muted); }
.empty .ico { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.empty .ico .icon { width: 28px; height: 28px; }
.empty h3 { color: var(--text); font-size: 18px; }
.empty p { max-width: 380px; }
.empty .btn { margin-top: 8px; }
.loading { display: grid; place-items: center; padding: 70px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--violet); animation: spin 0.8s linear infinite; }
.load-more { display: grid; justify-items: center; padding: 14px 0 4px; }

/* Acceso */
.auth { min-height: 100vh; display: grid; }
.auth-hero { position: relative; overflow: hidden; isolation: isolate; display: none; color: #fff; padding: 56px; background: var(--grad-main); }
.auth-hero .blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); opacity: 0.7; animation: drift 14s ease-in-out infinite alternate; }
.auth-hero .b1 { width: 420px; height: 420px; background: #22D3EE; left: -120px; bottom: -140px; }
.auth-hero .b2 { width: 380px; height: 380px; background: #FFB020; right: -120px; top: -120px; animation-delay: -5s; opacity: 0.55; }
.auth-hero .b3 { width: 300px; height: 300px; background: #FF3D95; right: 20%; bottom: 8%; animation-delay: -9s; }
.auth-hero h1 { font-size: clamp(34px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -0.04em; max-width: 14ch; margin-top: 44px; }
.auth-hero p { max-width: 38ch; margin-top: 16px; font-size: 17px; opacity: 0.92; }
.auth-cards { position: relative; height: 300px; margin-top: 56px; max-width: 440px; }
.auth-cards .vcard-wrap { position: absolute; width: 310px; }
.auth-cards .c1 { left: 0; top: 40px; rotate: -8deg; animation: float-a 7s ease-in-out infinite; }
.auth-cards .c2 { left: 110px; top: 0; rotate: 6deg; animation: float-b 8s ease-in-out infinite; }
.auth-panel { display: grid; place-items: center; padding: 28px 20px; }
.auth-form { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.auth-form .brand { margin-bottom: 8px; }
.auth-form h2 { font-size: 30px; letter-spacing: -0.035em; }
.auth-form .lead { color: var(--muted); margin-top: 6px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14.5px; }
.secure-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); padding: 12px 14px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--line); }
.secure-note .icon { color: var(--mint); margin-top: 1px; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-hero { display: flex; flex-direction: column; }
  .auth-hero .brand-mark { background: rgba(255, 255, 255, 0.22); box-shadow: none; }
  .auth-form > .brand { display: none; }
}

@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(40px, -30px) scale(1.12); } }
@keyframes float-a { 50% { transform: translateY(-12px); } }
@keyframes float-b { 50% { transform: translateY(10px); } }

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

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .panel { padding: 18px; }
  .hero { padding: 22px 20px 20px; border-radius: 26px; }
  .toolbar-row .input-wrap { flex-basis: 100%; }
  .toolbar select.sort { flex: 1 1 0; min-width: 0; width: auto; }
  .toolbar .seg { width: 100%; }
  .toolbar-end { width: 100%; margin-left: 0; }
  .month-nav { flex: 1 1 100%; justify-content: space-between; }
  .month-label { flex: 1; }
  .tx { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
  .tx-body { grid-column: 1 / -1; }
  .tx-when { padding: 0 0 8px 8px; }
  .tx-actions { padding-bottom: 4px; }
  .toolbar .seg button { flex: 1 1 auto; justify-content: center; padding: 0 9px; font-size: 13.5px; }
  .page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .page-head .btn { padding: 0 16px; }
}

/* Ajustes finales */
[hidden] { display: none !important; }
.donut-ring { stroke: var(--surface-3); }
.tx-right { text-align: right; min-width: 0; }
.tx-where { font-size: 12.5px; color: var(--muted); max-width: 240px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .tx-body { gap: 12px; }
  .tx-where { display: none; }
  .tx-actions .act-dup, .tx-actions .act-edit { display: none; }
}
.acc-head small { font-size: 13px; opacity: 0.85; }
.auth-panel .empty { max-width: 420px; }
.auth-form .link { font-size: inherit; }
.hero-pill .amt { font-variant-numeric: tabular-nums; }
.list-item .avatar { width: 44px; height: 44px; }
.set-grid > .panel { min-width: 0; }

.pill-soft { background: var(--surface-3); color: var(--muted); height: 22px; font-size: 11.5px; margin-left: 8px; vertical-align: middle; }
.toast-action { margin-left: 6px; padding: 6px 12px; border: 0; border-radius: 10px; background: var(--grad-main); color: #fff; font-weight: 650; font-size: 13.5px; }
.date-row { display: grid; gap: 10px; }
.dt-pair { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; }

.alerts { display: grid; gap: 10px; }
.alert { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid transparent; }
.alert-soon { background: rgba(255, 176, 32, 0.14); border-color: rgba(255, 176, 32, 0.4); }
.alert-expired { background: rgba(255, 77, 106, 0.14); border-color: rgba(255, 77, 106, 0.45); }
.alert-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.alert-soon .alert-ico { background: rgba(255, 176, 32, 0.25); color: var(--amber); }
.alert-expired .alert-ico { background: rgba(255, 77, 106, 0.25); color: var(--neg); }
:root[data-theme='light'] .alert-soon .alert-ico { color: #9A6200; }
.alert-text { flex: 1; min-width: 0; }
.alert-text b { display: block; }
.alert-text span { font-size: 13.5px; color: var(--muted); }

.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: #2B1B00; font-size: 12px; font-weight: 700; }
.nav-badge[hidden] { display: none; }
.nav a .nav-badge { margin-left: auto; }
.tab { position: relative; }
.tab .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }

.vcard-alert { margin-left: auto; display: inline-flex; align-items: center; gap: 1.2cqw; height: 6.6cqw; padding: 0 2.8cqw; border-radius: 99px; font: 650 3.4cqw var(--font-body); background: var(--amber); color: #2B1B00; }
.vcard-alert .icon { width: 3.8cqw; height: 3.8cqw; }
.vcard-alert-expired { background: var(--red); color: #fff; }

.acc-head-top .lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acc-kind-ico { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.22); }

/* Modo administración: otro aspecto a propósito, para no confundirlo con la app personal */
:root[data-mode='admin'] {
  color-scheme: dark;
  --bg: #06080C;
  --glow-1: rgba(255, 176, 32, 0.12);
  --glow-2: rgba(34, 211, 238, 0.08);
  --glow-3: rgba(255, 77, 106, 0.07);
  --surface: #0E1319;
  --surface-2: #141B24;
  --surface-3: #1C2631;
  --line: rgba(255, 255, 255, 0.1);
  --text: #E9EEF5;
  --muted: #8E9BAE;
  --pos: #35E0A1;
  --neg: #FF6B6B;
  --input-bg: rgba(255, 255, 255, 0.04);
  --shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.9);
  --glass: rgba(8, 11, 15, 0.86);
  --radius: 12px;
  --radius-sm: 8px;
  --grad-main: linear-gradient(135deg, #FFC24A 0%, #FF8A00 100%);
}
:root[data-mode='admin'] body {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(900px 520px at 92% -10%, var(--glow-1), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, var(--glow-3), transparent 60%);
  background-size: 40px 40px, 40px 40px, auto, auto;
}
:root[data-mode='admin'] .btn-primary { color: #1A1000; box-shadow: 0 10px 26px -12px rgba(255, 160, 0, 0.75); }
:root[data-mode='admin'] .seg button.active { color: #1A1000; box-shadow: 0 8px 20px -10px rgba(255, 160, 0, 0.8); }
:root[data-mode='admin'] .brand-mark { background: var(--grad-main); box-shadow: 0 10px 24px -10px rgba(255, 160, 0, 0.8); }
:root[data-mode='admin'] .brand-mark svg { stroke: #1A1000; }
:root[data-mode='admin'] .avatar { color: #1A1000; }
:root[data-mode='admin'] .panel, :root[data-mode='admin'] .stat { border-radius: 12px; }
:root[data-mode='admin'] .nav a.active { background: linear-gradient(90deg, rgba(255, 176, 32, 0.22), rgba(255, 176, 32, 0.04)); box-shadow: inset 3px 0 0 var(--amber); }
:root[data-mode='admin'] .nav a.active .icon { color: var(--amber); }
:root[data-mode='admin'] .tab.active .icon { color: var(--amber); }
:root[data-mode='admin'] .tabbar { border-radius: 14px; }
.admin-tabbar { grid-template-columns: repeat(2, 1fr); }
.admin-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed rgba(255, 176, 32, 0.55); border-radius: 10px; color: var(--amber); font-weight: 650; font-size: 13.5px; }
.admin-chip .icon { width: 18px; height: 18px; }

.admin-head { display: grid; gap: 14px; }
.admin-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ribbon { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px; border-radius: 6px; background: repeating-linear-gradient(135deg, rgba(255, 176, 32, 0.22) 0 8px, rgba(255, 176, 32, 0.1) 8px 16px); border: 1px solid rgba(255, 176, 32, 0.5); color: var(--amber); font-weight: 650; font-size: 13px; }
.ribbon .icon { width: 15px; height: 15px; }
.admin-body { display: grid; gap: 4px; margin-top: 6px; }
.tabs-wide { max-width: 100%; }
.a-h2 { font-size: 17px; margin: 22px 0 10px; }

.gate { max-width: 460px; margin: 20px auto 0; display: grid; gap: 14px; text-align: center; justify-items: center; }
.gate form { width: 100%; text-align: left; }
.gate-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 176, 32, 0.14); color: var(--amber); }
.gate-ico .icon { width: 26px; height: 26px; }

.a-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.a-stat { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); }
.a-stat small { color: var(--muted); font-size: 12.5px; }
.a-stat b { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.a-stat span { color: var(--muted); font-size: 12.5px; }
.a-stat.good { border-left-color: var(--mint); }
.a-stat.warn { border-left-color: var(--amber); }
.a-stat.bad { border-left-color: var(--red); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.badge-good { background: rgba(24, 227, 160, 0.16); color: var(--mint); }
.badge-bad { background: rgba(255, 77, 106, 0.18); color: var(--neg); }
.badge-warn { background: rgba(255, 176, 32, 0.18); color: var(--amber); }
.badge-info { background: rgba(34, 211, 238, 0.16); color: var(--cyan); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--input-bg); }
.table td .sub { display: block; font-size: 12.5px; color: var(--muted); }
.table code, .secret-key, .recovery-grid code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.who-cell .avatar { width: 38px; height: 38px; }
.who-cell b { display: block; }
.who-cell span { font-size: 12.5px; color: var(--muted); }
.row-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.row-btn { width: 34px; height: 34px; }
.row-btn.danger:hover { background: rgba(255, 77, 106, 0.16); color: var(--neg); }
.privacy-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.28); color: var(--text); font-size: 13.5px; }
.privacy-note .icon { color: var(--cyan); flex: none; }

.qr-box { justify-self: center; width: 220px; padding: 12px; border-radius: 14px; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.secret-key { letter-spacing: 0.06em; word-break: break-all; font-size: 15px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recovery-grid code { padding: 10px 12px; border-radius: 10px; background: var(--input-bg); border: 1px solid var(--line); text-align: center; font-size: 15px; letter-spacing: 0.08em; }

@media (max-width: 800px) {
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { margin-bottom: 12px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 12px; border: 0; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; }
  .who-cell { min-width: 0; text-align: left; }
}

/* Calendario */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-label { font-size: 22px; min-width: 190px; text-align: center; }
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flip-x .icon { transform: scaleX(-1); }
.cal-layout { display: grid; gap: 22px; align-items: start; }
@media (min-width: 1100px) { .cal-layout { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); } .cal-side { position: sticky; top: 24px; } }
.cal-stage { display: grid; gap: 16px; min-width: 0; }
.cal-summary { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.cal-panel { padding: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-grid .wd { text-align: center; font-size: 12.5px; font-weight: 650; color: var(--muted); padding: 4px 0 8px; }
.cal-day {
  position: relative; display: grid; align-content: space-between; justify-items: start; aspect-ratio: 1 / 0.92; min-height: 54px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cal-day:hover { transform: translateY(-2px); border-color: var(--violet); }
.cal-day .n { font-weight: 650; font-size: 14px; }
.cal-day .v { font-size: 12px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-day.out { opacity: 0.35; }
.cal-day.today .n { color: var(--pink); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--pink); }
.cal-day.selected { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.45); }
.cal-day[data-heat='1'], .swatch-heat[data-heat='1'] { background: color-mix(in srgb, var(--pink) 16%, var(--surface-2)); }
.cal-day[data-heat='2'], .swatch-heat[data-heat='2'] { background: color-mix(in srgb, var(--pink) 32%, var(--surface-2)); }
.cal-day[data-heat='3'], .swatch-heat[data-heat='3'] { background: color-mix(in srgb, var(--pink) 52%, var(--surface-2)); }
.cal-day[data-heat='4'], .swatch-heat[data-heat='4'] { background: color-mix(in srgb, var(--pink) 74%, var(--surface-2)); }
.dot-in { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.cal-grid.compact { gap: 3px; }
.cal-day.compact { aspect-ratio: 1; min-height: 0; padding: 0; border: 0; border-radius: 5px; place-items: center; align-content: center; justify-items: center; }
.cal-day.compact .n { font-size: 10.5px; font-weight: 600; }
.cal-day.compact.out { visibility: hidden; }
.cal-legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.swatch-heat { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line); }
.legend-in { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.legend-in .dot-in { position: static; }
.cal-year { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.mini { padding: 14px; display: grid; gap: 10px; }
.mini-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border: 0; background: none; padding: 0; text-align: left; color: var(--text); }
.mini-title b { font-family: var(--font-display); font-size: 16px; }
.mini-title span { font-size: 12px; color: var(--muted); }
.mini-title:hover b { color: var(--cyan); }
.day-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.day-title h2 { font-size: 19px; }
.day-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.cal-fade > * { animation: cal-in 0.4s ease both; }
@keyframes cal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
@media (max-width: 560px) {
  .cal-day { min-height: 46px; padding: 5px 6px; border-radius: 10px; }
  .cal-day .v { font-size: 10.5px; }
  .cal-label { min-width: 150px; font-size: 19px; }
  .cal-grid { gap: 4px; }
}

.fab { position: fixed; z-index: 31; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border: 0; border-radius: 20px; background: var(--grad-main); color: #fff; display: grid; place-items: center; box-shadow: 0 16px 30px -10px rgba(139, 61, 255, 0.95); transition: transform 0.15s ease; }
.fab:active { transform: scale(0.94); }
.fab .icon { width: 26px; height: 26px; }
@media (min-width: 960px) { .fab { display: none; } }

/* Tarjetas 3D: anverso y reverso */
.vcard-flip { position: relative; perspective: 1100px; outline-offset: 6px; border-radius: 6cqw; }
.vcard-flip.interactive { cursor: pointer; }
.vcard-inner {
  position: relative; aspect-ratio: 1.586 / 1; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
  transition: transform 0.9s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.vcard-flip.tilting .vcard-inner { transition: transform 0.12s linear; }
.vcard-flip.flipped { --flip: 180deg; }
.vcard-face { position: absolute; inset: 0; aspect-ratio: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.vcard-face.back { transform: rotateY(180deg); padding: 0; justify-content: flex-start; gap: 0; }
.vcard-badges span { backdrop-filter: none; background: rgba(255, 255, 255, 0.26); }
.glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.25s; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.34), transparent 55%); }
.vcard-flip.tilting .glare { opacity: 1; }
.vcard-face.back::before { opacity: 0.55; }

.vcard-face.back .stripe { height: 10cqw; margin-top: 4cqw; background: linear-gradient(#14141C, #05050A); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15); }
.vcard-face.back .sign { display: flex; align-items: center; margin: 3.5cqw 6.4cqw 0; }
.vcard-face.back .sig-line { flex: 1; height: 8cqw; border-radius: 1.4cqw; background: repeating-linear-gradient(135deg, #F6F3EC 0 2cqw, #E2DDD0 2cqw 4cqw); }
.vcard-face.back .back-text { margin: 3cqw 6.4cqw 0; display: grid; gap: 0.6cqw; }
.vcard-face.back .back-text b { font-size: 4.2cqw; }
.vcard-face.back .back-text small { font-family: var(--font-body); font-size: 2.9cqw; line-height: 1.3; opacity: 0.85; }
.vcard-face.back .back-net { position: absolute; right: 6.4cqw; bottom: 5cqw; height: 8cqw; display: flex; align-items: center; }
.vcard-face.back .back-net svg { height: 100%; width: auto; }

.vcard-wrap.float { animation: card-float 7s ease-in-out infinite; }
.vcard-flip.spin .vcard-inner { animation: card-spin 18s linear infinite; transition: none; }
@keyframes card-float { 50% { translate: 0 -10px; } }
@keyframes card-spin { from { transform: rotateY(-20deg) rotateX(4deg); } 50% { transform: rotateY(160deg) rotateX(-4deg); } to { transform: rotateY(340deg) rotateX(4deg); } }
.auth-cards .vcard-wrap.c2.float { animation-delay: -3s; }
.vcard-flip.spin.interactive { cursor: default; }

/* Animaciones */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: translateY(22px) scale(0.96); } }
@keyframes ch-in { from { opacity: 0; transform: translateY(0.55em) rotate(5deg); filter: blur(5px); } }
@keyframes word-in { from { opacity: 0; transform: translateY(0.7em) scale(0.96); filter: blur(10px); } }
@keyframes draw { from { stroke-dasharray: 0 1000; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes aurora { to { background-position: 100% 50%; } }
@keyframes glow { 50% { box-shadow: 0 10px 34px -4px rgba(139, 61, 255, 0.95); } }
@keyframes blob-a { to { transform: translate(14vw, 10vh) scale(1.2); } }
@keyframes blob-b { to { transform: translate(-12vw, -14vh) scale(1.15); } }
@keyframes card-in { from { opacity: 0; transform: perspective(900px) rotateX(24deg) translateY(36px) scale(0.94); } }

.page > * { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ch { display: inline-block; animation: ch-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 34ms + 0.1s); }
.word { display: inline-block; animation: word-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 120ms + 0.25s); }

body::before, body::after { content: ''; position: fixed; z-index: -1; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: 0.35; pointer-events: none; }
body::before { left: -14vmax; top: -10vmax; background: var(--glow-1); animation: blob-a 34s ease-in-out infinite alternate; }
body::after { right: -16vmax; bottom: -14vmax; background: var(--glow-3); animation: blob-b 40s ease-in-out infinite alternate; }

.hero { background-size: 200% 200%; background-position: 0% 50%; animation: aurora 18s ease-in-out infinite alternate; }
.brand-mark { animation: glow 5s ease-in-out infinite; }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%); transform: translateX(-130%); pointer-events: none; }
.btn-primary:hover::after { transform: translateX(130%); transition: transform 0.8s ease; }
.nav a { transition: background 0.15s, color 0.15s, transform 0.2s ease; }
.nav a:hover { transform: translateX(4px); }
.link, .panel-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size 0.3s ease; padding-bottom: 2px; }
.link:hover, .panel-title a:hover { background-size: 100% 1.5px; }
.acc-tile, .acc-card, .panel, .stat { transition: transform 0.25s ease, border-color 0.2s ease, box-shadow 0.25s ease; }
.acc-card:hover { transform: translateY(-4px); }

.donut circle:not(.donut-ring) { animation: draw 1.1s cubic-bezier(0.3, 0.8, 0.3, 1) both; }
.bars rect { transform-box: fill-box; transform-origin: 50% 100%; animation: grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.scroller > .vcard-wrap, .card-grid > .card-item { animation: card-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.acc-tiles > *, .acc-grid > * { animation: pop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.tx-list > .tx, .tx-day { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.cal-year > .mini { animation: pop 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.page > *:nth-child(2) { animation-delay: 0.07s; }
.page > *:nth-child(3) { animation-delay: 0.14s; }
.page > *:nth-child(4) { animation-delay: 0.21s; }
.page > *:nth-child(5) { animation-delay: 0.28s; }
.page > *:nth-child(6) { animation-delay: 0.35s; }
.page > *:nth-child(7) { animation-delay: 0.42s; }
.page > *:nth-child(8) { animation-delay: 0.49s; }
.page > *:nth-child(9) { animation-delay: 0.56s; }
.scroller > :nth-child(1), .card-grid > :nth-child(1), .acc-tiles > :nth-child(1), .acc-grid > :nth-child(1) { animation-delay: 0.15s; }
.scroller > :nth-child(2), .card-grid > :nth-child(2), .acc-tiles > :nth-child(2), .acc-grid > :nth-child(2) { animation-delay: 0.24s; }
.scroller > :nth-child(3), .card-grid > :nth-child(3), .acc-tiles > :nth-child(3), .acc-grid > :nth-child(3) { animation-delay: 0.33s; }
.scroller > :nth-child(4), .card-grid > :nth-child(4), .acc-tiles > :nth-child(4), .acc-grid > :nth-child(4) { animation-delay: 0.42s; }
.scroller > :nth-child(5), .card-grid > :nth-child(5), .acc-tiles > :nth-child(5), .acc-grid > :nth-child(5) { animation-delay: 0.51s; }
.scroller > :nth-child(6), .card-grid > :nth-child(6), .acc-tiles > :nth-child(6), .acc-grid > :nth-child(6) { animation-delay: 0.60s; }
.scroller > :nth-child(7), .card-grid > :nth-child(7), .acc-tiles > :nth-child(7), .acc-grid > :nth-child(7) { animation-delay: 0.69s; }
.scroller > :nth-child(8), .card-grid > :nth-child(8), .acc-tiles > :nth-child(8), .acc-grid > :nth-child(8) { animation-delay: 0.78s; }
.tx-list > :nth-child(1) { animation-delay: 0.100s; }
.tx-list > :nth-child(2) { animation-delay: 0.135s; }
.tx-list > :nth-child(3) { animation-delay: 0.170s; }
.tx-list > :nth-child(4) { animation-delay: 0.205s; }
.tx-list > :nth-child(5) { animation-delay: 0.240s; }
.tx-list > :nth-child(6) { animation-delay: 0.275s; }
.tx-list > :nth-child(7) { animation-delay: 0.310s; }
.tx-list > :nth-child(8) { animation-delay: 0.345s; }
.tx-list > :nth-child(9) { animation-delay: 0.380s; }
.tx-list > :nth-child(10) { animation-delay: 0.415s; }
.tx-list > :nth-child(11) { animation-delay: 0.450s; }
.tx-list > :nth-child(12) { animation-delay: 0.485s; }
.cal-year > :nth-child(1) { animation-delay: 0.00s; }
.cal-year > :nth-child(2) { animation-delay: 0.05s; }
.cal-year > :nth-child(3) { animation-delay: 0.10s; }
.cal-year > :nth-child(4) { animation-delay: 0.15s; }
.cal-year > :nth-child(5) { animation-delay: 0.20s; }
.cal-year > :nth-child(6) { animation-delay: 0.25s; }
.cal-year > :nth-child(7) { animation-delay: 0.30s; }
.cal-year > :nth-child(8) { animation-delay: 0.35s; }
.cal-year > :nth-child(9) { animation-delay: 0.40s; }
.cal-year > :nth-child(10) { animation-delay: 0.45s; }
.cal-year > :nth-child(11) { animation-delay: 0.50s; }
.cal-year > :nth-child(12) { animation-delay: 0.55s; }
.bars g:nth-of-type(1) rect { animation-delay: 0.20s; }
.bars g:nth-of-type(2) rect { animation-delay: 0.28s; }
.bars g:nth-of-type(3) rect { animation-delay: 0.36s; }
.bars g:nth-of-type(4) rect { animation-delay: 0.44s; }
.bars g:nth-of-type(5) rect { animation-delay: 0.52s; }
.bars g:nth-of-type(6) rect { animation-delay: 0.60s; }
.cal-grid .cal-day { animation: pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 12ms); }
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { display: none; }
  .vcard-flip.spin .vcard-inner { animation: none; transform: rotateY(-14deg); }
  .vcard-wrap.float { animation: none; }
}

.cal-summary { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.cal-summary .stat b { font-size: 19px; }
.cal-side .tx-where, .cal-side .act-dup, .cal-side .act-edit { display: none; }
@media (max-width: 560px) { .cal-summary { grid-template-columns: 1fr 1fr; } .cal-summary .stat b { font-size: 16px; } }

/* Perfil: foto, menú y selector de tema junto al perfil */
.avatar { position: relative; overflow: hidden; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; border-radius: 12px; font-size: 15px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; border-radius: 30px; font-size: 38px; }
.slot { display: inline-flex; flex: none; }

.profile { position: relative; flex: 1; min-width: 0; }
.profile-topbar { flex: none; }
.profile-row { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.profile-row > .icon-btn { width: 46px; height: 46px; flex: none; border: 1px solid var(--line); background: var(--input-bg); border-radius: 14px; }
.user-chip { width: 100%; text-align: left; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--input-bg); border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s; }
.user-chip:hover, .user-chip[aria-expanded='true'] { border-color: var(--violet); }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; display: block; }
.user-chip .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { display: block; font-size: 12px; color: var(--muted); }
.user-chip .chev { width: 16px; height: 16px; color: var(--muted); transition: transform 0.2s ease; flex: none; }
.user-chip[aria-expanded='true'] .chev { transform: rotate(180deg); }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 14px; display: inline-flex; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 2px var(--violet); }
.topbar-actions { align-items: center; }

.menu { position: absolute; z-index: 60; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 28px 60px -18px rgba(0, 0, 0, 0.75); animation: menu-in 0.16s ease; }
.menu-up { left: 0; right: -56px; bottom: calc(100% + 10px); min-width: 250px; }
.menu-down { right: 0; top: calc(100% + 10px); width: 272px; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; min-width: 0; }
.menu-head > div { min-width: 0; }
.menu-head b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font-weight: 600; font-size: 14.5px; text-align: left; }
.menu-item .icon { width: 18px; height: 18px; color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--input-bg); outline: none; }
.menu-item.danger, .menu-item.danger .icon { color: var(--neg); }
.menu-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.photo-card { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.photo-btn { position: relative; border: 0; background: none; padding: 0; border-radius: 30px; flex: none; }
.photo-btn:hover .avatar { filter: brightness(1.08); }
.photo-edit { position: absolute; right: -4px; bottom: -4px; width: 32px; height: 32px; border-radius: 50%; background: var(--grad-main); color: #fff; display: grid; place-items: center; border: 3px solid var(--surface); }
.photo-edit .icon { width: 14px; height: 14px; }
.photo-text { display: grid; gap: 2px; min-width: 0; }
.photo-text b { font-size: 18px; font-family: var(--font-display); letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; }
.photo-text > span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.photo-text .card-actions { padding-top: 10px; }

.crop-wrap { position: relative; width: 280px; height: 280px; margin: 4px auto 0; }
.crop-stage { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; background: var(--surface-3); cursor: grab; touch-action: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-img { position: absolute; left: 50%; top: 50%; max-width: none; user-select: none; pointer-events: none; }
.crop-ring { position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--violet); pointer-events: none; opacity: 0.75; }
.crop-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); cursor: pointer; text-align: center; }
.crop-empty .icon { width: 40px; height: 40px; }
.crop-empty b { color: var(--text); }
.crop-slider { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 280px; margin: 0 auto; color: var(--muted); }
.crop-slider input:not([type='checkbox']):not([type='radio']) { flex: 1; min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--violet); }

.shell.no-tabbar .content { padding-bottom: 40px; }
@media (min-width: 960px) {
  .sidebar { gap: 18px; }
}

/* Ajustes: columnas equilibradas, sin paneles estirados */
.set-grid { display: block; columns: 2 380px; column-gap: 22px; }
.set-grid > .panel { break-inside: avoid; margin-bottom: 22px; }
.list-item .grow span.wrap { white-space: normal; overflow: visible; }
.user-chip .chev { display: none; }
.profile-row > .icon-btn { width: 44px; height: 44px; }
@media (max-width: 560px) {
  .tabs-wide { display: flex; width: 100%; }
  .tabs-wide button { flex: 1 1 auto; justify-content: center; padding: 0 8px; font-size: 13px; }
  .tabs-wide button .icon { display: none; }
}

/* Administración: estado, fichas y filtros */
.a-h2.first { margin-top: 6px; }
.a-h3 { font-size: 15px; margin: 0 0 10px; }
.health-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.health { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.health small { color: var(--muted); font-size: 12.5px; display: block; }
.health b { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; display: block; line-height: 1.25; }
.health span { font-size: 12.5px; color: var(--muted); }
.health-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--mint); box-shadow: 0 0 0 4px rgba(24, 227, 160, 0.16); }
.health-warn .health-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.16); }
.health-bad .health-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 77, 106, 0.18); animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 8px rgba(255, 77, 106, 0.05); } }
.a-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.a-stat b.small { font-size: 16px; }
.chip-count { margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); font-size: 11.5px; color: var(--muted); }
.chip.active .chip-count { background: rgba(255, 255, 255, 0.18); color: var(--text); }
.who-btn { border: 0; background: none; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.who-btn:hover b { color: var(--amber); }
.detail-head { display: flex; align-items: center; gap: 16px; }
.detail-head b { font-family: var(--font-display); font-size: 19px; display: block; }
.detail-head > div > span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.detail-stats { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
@media (max-width: 560px) { .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .a-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Interruptor */
.switch-row { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.switch-row b { display: block; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1); }
.switch input:checked + i { background: var(--grad-main); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
.switch input:disabled + i { opacity: 0.5; }

/* Acceso: pestañas, tarjeta, transiciones y lateral */
.auth { min-height: 100vh; }
.auth-hero { display: none; flex-direction: column; justify-content: space-between; gap: 26px; background-size: 220% 220%; background-position: 0% 50%; transition: background-position 1.4s cubic-bezier(0.3, 0.8, 0.3, 1); animation: none; }
.auth[data-mode='register'] .auth-hero { background-position: 100% 50%; }
.auth-hero .hero-copy { margin-top: 10px; }
.auth-hero h1 { margin-top: 0; font-size: clamp(34px, 3.4vw, 50px); max-width: 15ch; }
.auth-hero p { margin-top: 14px; max-width: 40ch; }
.auth-hero p.fade-in { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: 0.35s; }
.hero-features { list-style: none; display: grid; gap: 12px; margin: 0; padding: 0; }
.hero-features li { display: flex; align-items: center; gap: 12px; font-weight: 550; font-size: 15.5px; }
.hero-features .f-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.2); flex: none; }
.hero-features .icon { width: 18px; height: 18px; }
.auth-cards { height: 270px; margin-top: 0; }
@media (max-height: 800px) { .hero-features { display: none; } }

.auth-panel { position: relative; display: grid; place-items: center; align-content: center; padding: 0 0 28px; min-height: 100vh; }
.auth-top { position: relative; isolation: isolate; overflow: hidden; width: 100%; min-height: 190px; padding: 26px 22px 24px; margin-bottom: 26px; color: #fff; background: var(--grad-main); border-radius: 0 0 34px 34px; display: grid; align-content: start; gap: 14px; box-shadow: 0 28px 50px -30px rgba(139, 61, 255, 0.9); }
.auth-top .blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(34px); opacity: 0.7; }
.auth-top .b1 { width: 200px; height: 200px; background: #22D3EE; left: -60px; bottom: -80px; }
.auth-top .b3 { width: 170px; height: 170px; background: #FF3D95; right: 10%; top: -70px; }
.auth-top .brand-mark { background: rgba(255, 255, 255, 0.22); box-shadow: none; animation: none; }
.auth-top > b { font-family: var(--font-display); font-size: 25px; letter-spacing: -0.03em; line-height: 1.15; max-width: 12ch; }
.auth-top-card { position: absolute; right: -34px; bottom: -34px; width: 190px; rotate: -10deg; }
.auth-form { width: 100%; max-width: 460px; padding: 0 20px; display: block; }

.auth-card { position: relative; display: grid; gap: 22px; padding: 26px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card.shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: var(--input-bg); border: 1px solid var(--line); }
.auth-tabs button { position: relative; z-index: 1; height: 42px; border: 0; background: none; font-weight: 650; font-size: 14.5px; color: var(--muted); border-radius: 12px; transition: color 0.25s; }
.auth-tabs button.active { color: #fff; }
.auth-tabs .tab-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: var(--grad-main); box-shadow: 0 10px 22px -10px rgba(139, 61, 255, 0.9); transition: transform 0.45s cubic-bezier(0.3, 1.25, 0.5, 1); }
.auth-tabs[data-mode='register'] .tab-ind { transform: translateX(100%); }

.auth-stage { --from: 36px; position: relative; }
.auth-stage[data-dir='-1'] { --from: -36px; }
.auth-view { display: grid; gap: 20px; animation: view-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.auth-stage.out .auth-view { animation: view-out 0.19s ease-in both; }
@keyframes view-in { from { opacity: 0; transform: translateX(var(--from)) scale(0.985); filter: blur(5px); } }
@keyframes view-out { to { opacity: 0; transform: translateX(calc(var(--from) * -0.7)) scale(0.985); filter: blur(5px); } }
.auth-view .view-head { display: grid; gap: 6px; }
.auth-view .field, .auth-view .btn, .auth-view .auth-switch { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.auth-view .field:nth-child(1) { animation-delay: 0.14s; }
.auth-view .field:nth-child(2) { animation-delay: 0.2s; }
.auth-view .field:nth-child(3) { animation-delay: 0.26s; }
.auth-view .btn { animation-delay: 0.32s; }
.auth-view .auth-switch { animation-delay: 0.4s; }
.view-head h2 { font-size: 28px; letter-spacing: -0.035em; }
.view-head .lead { color: var(--muted); font-size: 15px; margin: 0; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14.5px; margin: 0; }
.btn-lg { height: 52px; font-size: 16px; }
.btn-spinner { display: none; width: 18px; height: 18px; margin-left: 10px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading { pointer-events: none; }
.hint-line { display: block; margin-top: 4px; }

@media (min-width: 960px) {
  .auth { display: grid; grid-template-columns: 1.05fr 1fr; }
  .auth-hero { display: flex; }
  .auth-top { display: none; }
  .auth-panel { padding: 28px 0; }
}
@media (min-width: 960px) and (max-width: 1180px) { .auth-cards .vcard-wrap { width: 270px; } }

.auth-panel { align-content: start; }
@media (min-width: 960px) { .auth-panel { align-content: center; } }

/* Resumen por periodo */
.sum-panel { display: grid; gap: 18px; }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sum-head .panel-title { margin: 0; }
.sum-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sum-body { display: grid; gap: 20px; }
.sum-body .stat { background: var(--input-bg); }
@media (max-width: 560px) {
  .sum-controls { width: 100%; }
  .sum-controls .seg { width: 100%; }
  .sum-controls .seg button { flex: 1 1 0; justify-content: center; }
  .sum-controls .month-nav { flex: 1 1 0; justify-content: space-between; }
  .sum-controls .month-label { min-width: 0; flex: 1; }
}

/* Tarjetas del resumen: se arrastran y tienen flechas */
.section-tools { display: flex; align-items: center; gap: 14px; }
.scroll-arrows { display: inline-flex; gap: 6px; }
.scroll-arrows .icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--input-bg); }
.scroll-arrows .icon-btn:disabled { opacity: 0.3; pointer-events: none; }
@media (hover: none) { .scroll-arrows { display: none; } }
@media (hover: hover) { .scroller { cursor: grab; } }
.scroller.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.scroller.dragging > * { pointer-events: none; }

/* Gráfico de líneas */
.lines { width: 100%; height: auto; display: block; overflow: visible; }
.lines text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.lines .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.line-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: line-draw 1.4s cubic-bezier(0.3, 0.7, 0.2, 1) 0.2s forwards; }
.line-area { opacity: 0; animation: fade-in 0.9s ease 0.9s forwards; }
.line-dots circle { opacity: 0; animation: fade-in 0.4s ease 1.2s forwards; transition: r 0.15s; }
.line-dots:hover circle { r: 6.5; }
@keyframes line-draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

@media (max-width: 860px) { .set-grid { columns: 1; } }
.list-item .grow b { overflow-wrap: anywhere; }
.lines-box { width: 100%; }
.page-head > :first-child { flex: 1 1 260px; min-width: 0; }
.page-head > .btn { flex: none; }

/* En pantallas grandes las tarjetas son más anchas, así la fila siempre se desplaza y se ve que hay más */
@media (min-width: 900px) { .scroller > * { flex-basis: clamp(320px, 40%, 460px); } }
.scroller { overscroll-behavior-x: contain; }
.scroller, .scroller * { -webkit-user-drag: none; }
.scroller.dragging, .scroller.dragging * { user-select: none; }

/* Barra de progreso (presupuestos y metas) */
.meter { position: relative; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 1%); border-radius: inherit; background: var(--c, var(--grad-main)); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.meter.is-warn > i { background: var(--amber); }
.meter.is-over > i { background: var(--red); }
@media (prefers-reduced-motion: reduce) { .meter > i { transition: none; } }
@media (min-width: 960px) { .sidebar { overflow-y: auto; } }

/* El boton flotante solo estorba donde la pagina ya tiene su propio boton de alta */
html:not([data-route='/calendario']) .fab { display: none; }

/* Contraste en tema claro */
:root[data-theme='light'] .vcard-alert-expired { background: #C81E3A; }
:root[data-theme='light'] .btn-danger { color: #B3152F; }
:root[data-theme='light'] .pill-bizum { color: #006A61; }
:root[data-theme='light'] .meter { background: rgba(33, 24, 88, 0.14); }

/* Marca numerica dentro del menu del perfil y barra lateral con muchas entradas */
.menu-item .nav-badge { margin-left: auto; }
@media (min-width: 960px) { .nav { min-height: 0; overflow-y: auto; } }
@media (min-width: 960px) and (max-height: 860px) { .sidebar { gap: 14px; padding-top: 18px; } .nav a { height: 40px; } }

/* Saldo antes y después de cada movimiento */
.tx-bal { margin-top: 3px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-bal b { color: var(--text); font-weight: 650; }
.tx-bal-two { white-space: normal; display: flex; flex-wrap: wrap; gap: 0 14px; }
.tx-bal-two .bal-part { white-space: normal; overflow-wrap: break-word; min-width: 0; }
.tx-bal { white-space: normal; overflow: visible; }
.tx-bal .amt, .tx-bal b { white-space: nowrap; }
.tx-bal-two { display: grid; gap: 1px; }
.tx-body > .tx-bal { grid-column: 2 / -1; margin-top: -6px; text-align: left; }
.tx-apply { margin-top: 4px; display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 650; cursor: pointer; }
.tx-apply:hover { border-color: var(--violet); }
.tx-bal .tx-apply { white-space: nowrap; margin-right: auto; }
.affects-row { padding: 12px 14px; border-radius: 14px; background: var(--input-bg); border: 1px solid var(--line); }
.tx-body[role=button] { cursor: pointer; }
.tx-body:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tx-bal, .tx-bal .bal-part { min-width: 0; max-width: 100%; }

/* Barra inferior en pantallas muy estrechas: letra algo menor para que los nombres no se toquen */
@media (max-width: 360px) {
  .tab { font-size: 10px; padding: 8px 0; min-width: 0; }
  .tab > span, .tab { letter-spacing: -0.01em; }
  .tabbar { gap: 0; padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 340px) {
  .tabbar { left: 6px; right: 6px; padding-left: 2px; padding-right: 2px; }
  .tab { font-size: 9.5px; }
}

/* Movimiento histórico: el texto del saldo y el botón van separados y con aire */
.tx-bal.has-apply { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 2px; padding: 2px 0 6px; }
.tx-bal.has-apply.tx-bal-two { display: grid; gap: 4px; }
.tx-bal .tx-apply {
  margin: 0; min-height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px;
  background: color-mix(in srgb, var(--violet) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--violet) 48%, transparent);
}
.tx-bal .tx-apply:hover { background: color-mix(in srgb, var(--violet) 28%, transparent); border-color: var(--violet); }
.tx-bal.has-apply.tx-bal-two .tx-apply { margin-top: 6px; justify-self: start; }

/* Acceso con llave, 2FA obligatorio, arranque en frío y llaves en Ajustes */
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.passkey-block { display: grid; gap: 12px; min-width: 0; }
.passkey-btn { white-space: normal; min-width: 0; padding-left: 14px; padding-right: 14px; line-height: 1.25; }
.passkey-btn .icon { flex: none; width: 20px; height: 20px; }
.notice { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.step-label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.tf-setup { display: grid; gap: 16px; }
.auth-view-plain .field, .auth-view-plain .btn, .auth-view-plain .auth-switch { animation: none; }
.pk-sync { margin-left: 8px; height: 20px; padding: 0 8px; font-size: 11px; background: rgba(24, 227, 160, 0.14); color: var(--pos); vertical-align: 1px; }
.pk-note { margin-top: 12px; }
.pk-list { margin-top: 14px; }

.wake-band {
  position: fixed; z-index: 90; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--text); font-size: 13.5px; line-height: 1.4;
}
.wake-spin { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .wake-spin { animation: none; } }
.search-note { margin-top: 12px; }
.hl-word { display: inline-block; white-space: nowrap; }
