/* =========================================================
   Holgura — estilos
   ========================================================= */
:root {
  --bg: #f4efe6;
  --ink: #15302a;
  --ink-soft: #4d5f59;
  --muted: #7a8781;
  --accent: #1f6b57;
  --accent-2: #2f8f75;
  --gold: #d99a45;
  --danger: #c2492f;
  --line: rgba(var(--ink-rgb), 0.12);
  --glass: rgba(255, 255, 255, 0.5);
  --glass-solid: rgba(255, 252, 246, 0.9);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 20px 50px -24px rgba(var(--ink-rgb), 0.35);
  --r: 22px;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-accent: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 4vw, 40px);
  --soft: rgba(255, 255, 255, 0.6);
  --soft-strong: #fff;
  --soft-faint: rgba(255, 255, 255, 0.3);
  --ink-rgb: 21, 48, 42;
  --accent-rgb: 31, 107, 87;
  --accent-hover: #185a49;
  --on-accent: #f6f1e6;
  --tag-ink: #8a5a17;
  color-scheme: light;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  overflow-x: hidden;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 8px; }

/* ---------- Fondo malla ---------- */
.mesh { position: fixed; inset: -10%; z-index: -1; pointer-events: none; filter: blur(70px) saturate(140%); }
.mesh span { position: absolute; border-radius: 50%; opacity: 0.75; animation: drift 28s ease-in-out infinite; }
.mesh span:nth-child(1) { width: 48vw; height: 48vw; left: -4vw; top: -6vw; background: #b8e3cf; }
.mesh span:nth-child(2) { width: 42vw; height: 42vw; right: -6vw; top: 18vh; background: #f4d7a4; animation-delay: -9s; animation-duration: 34s; }
.mesh span:nth-child(3) { width: 38vw; height: 38vw; left: 30vw; bottom: -12vw; background: #cdd8f3; animation-delay: -16s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6vw, 4vh) scale(1.12); }
  66% { transform: translate(-4vw, 6vh) scale(0.94); }
}

/* ---------- Cristal ---------- */
.glass {
  background: var(--glass-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .glass {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
  }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 14px; z-index: 50;
  margin: 14px auto 0; width: min(var(--max), calc(100% - 2 * var(--gutter)));
  display: flex; align-items: center; gap: 20px;
  padding: 10px 12px 10px 16px; border-radius: 999px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 750 1.25rem/1 var(--f-display); letter-spacing: -0.03em; }
.nav-links { position: relative; display: flex; gap: 4px; margin-left: auto; }
.nav-links a { position: relative; z-index: 1; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--ink-soft); transition: color .25s; }
.nav-links a:hover { color: var(--ink); }
.nav-ink { position: absolute; top: 0; height: 100%; border-radius: 999px; background: rgba(var(--accent-rgb), 0.1); opacity: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1), opacity .25s; pointer-events: none; }
.nav-profile { display: flex; align-items: center; gap: 6px; }
.pill-select { appearance: none; border: 1px solid var(--line); background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2315302a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; padding: 8px 32px 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; cursor: pointer; max-width: 160px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); cursor: pointer; font-size: 1.2rem; line-height: 1; transition: background .2s, transform .2s; }
.icon-btn:hover { background: var(--soft-strong); transform: translateY(-1px); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 0.95rem; text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 26px -12px rgba(var(--accent-rgb), .8); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: var(--soft); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--soft-strong); }
.btn-danger { background: transparent; border-color: rgba(194, 73, 47, .35); color: var(--danger); }
.btn-danger:hover { background: rgba(194, 73, 47, .08); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; font-size: 0.86rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.magnetic { will-change: transform; }

/* ---------- Hero ---------- */
.hero {
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto; padding: clamp(56px, 10vh, 110px) 0 clamp(48px, 8vh, 90px);
  display: grid; grid-template-columns: 1.25fr 0.85fr; gap: clamp(32px, 5vw, 72px); align-items: center;
}
.eyebrow { margin: 0 0 14px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); font-weight: 650; letter-spacing: -0.045em; text-wrap: balance; }
.hero h1 em, .page-title em { font-family: var(--f-accent); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -0.01em; }
.hero-sub { max-width: 34rem; margin: 22px 0 30px; font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 30px 0 0; font-size: 0.88rem; color: var(--ink-soft); font-weight: 600; }
.hero-points li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent-2); vertical-align: middle; }

.hero-card { padding: 26px; border-radius: 28px; }
.float { animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(0.5deg); } }
.hc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hc-label { font-weight: 700; }
.chip { font-size: 0.78rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: rgba(var(--accent-rgb), .1); color: var(--accent); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-caption { margin: 26px 0 2px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.hc-amount { margin: 0 0 18px; font: 650 clamp(2.4rem, 4.4vw, 3.3rem)/1 var(--f-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hc-amount.neg, .kpi-big.neg { color: var(--danger); }
.hc-bar { height: 10px; border-radius: 99px; background: rgba(var(--ink-rgb), .08); overflow: hidden; }
.hc-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.hc-bar span.warn { background: linear-gradient(90deg, #e6b25e, var(--gold)); }
.hc-bar span.over { background: linear-gradient(90deg, #db6a4f, var(--danger)); }
.hc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.hc-grid div { padding: 12px; border-radius: 14px; background: var(--soft); }
.hc-grid span { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.hc-grid strong { font: 650 1.05rem/1.2 var(--f-display); font-variant-numeric: tabular-nums; }

/* ---------- App ---------- */
.app { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin: 0 auto; padding-bottom: 60px; }
.app-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.app-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 650; }
.month-nav { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; }
#monthLabel { min-width: 9.5em; text-align: center; font-weight: 700; }

.kpis { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kpi { padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.kpi-hero { flex-direction: row; align-items: center; gap: 22px; }
.kpi-label { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.kpi-val { margin: 0; font: 650 1.65rem/1.1 var(--f-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi-big { margin: 0; font: 650 clamp(2rem, 3.4vw, 2.7rem)/1 var(--f-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpi-note { margin: 0; font-size: 0.84rem; color: var(--muted); }
.kpi .link-btn { align-self: flex-start; margin-top: auto; }

.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-track { stroke: rgba(var(--ink-rgb), .08); }
.ring-fill { stroke: var(--accent-2); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.ring-fill.warn { stroke: var(--gold); }
.ring-fill.over { stroke: var(--danger); }
.ring-pct { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 650 1.5rem/1 var(--f-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring-pct small { display: block; font: 600 0.68rem/1 var(--f-body); letter-spacing: 0.02em; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.panel { padding: 22px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 1.25rem; font-weight: 650; }

.filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select, .modal input, .modal select {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 0.92rem;
}
.filters input:focus, .filters select:focus, .modal input:focus, .modal select:focus { outline: 2px solid rgba(47,143,117,.45); outline-offset: 0; border-color: transparent; }

.tx-list, .fx-list, .bars, .profile-list { list-style: none; margin: 0; padding: 0; }
.tx-list { max-height: 520px; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.tx-day { padding: 14px 0 6px; font-size: 0.76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.tx { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 14px; transition: background .2s; }
.tx:hover { background: var(--soft); }
.tx-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .09); color: var(--accent); font: 700 0.82rem/1 var(--f-display); text-transform: uppercase; }
.tx-main { min-width: 0; }
.tx-main strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-main span { font-size: 0.8rem; color: var(--muted); }
.tx-amt { font: 650 1rem/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.tx:hover .tx-actions, .tx:focus-within .tx-actions, .fx:hover .tx-actions, .fx:focus-within .tx-actions { opacity: 1; }
.mini-btn { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink-soft); display: grid; place-items: center; }
.mini-btn:hover { background: rgba(var(--ink-rgb), .07); color: var(--ink); }
.mini-btn.del:hover { color: var(--danger); background: rgba(194,73,47,.08); }

.empty { text-align: center; padding: 40px 10px; color: var(--ink-soft); }
.empty p { margin: 4px 0; }
.empty-inline { margin: 6px 0 0; }

.bars li { display: grid; grid-template-columns: minmax(90px, 9.5em) 1fr auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 0.9rem; }
.bars .b-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .b-track { height: 12px; background: rgba(var(--ink-rgb), .06); border-radius: 0 4px 4px 0; }
.bars .b-fill { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 0 4px 4px 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.bars .b-val { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; white-space: nowrap; }
.bars .b-val small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.bars li { position: relative; }
.bars li:hover .b-fill { background: var(--accent); }

.goal-line { margin: 0 0 12px; color: var(--ink-soft); }
.goal-line strong { color: var(--ink); }

.fx { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 14px; border-top: 1px solid var(--line); }
.fx:first-child { border-top: 0; }
.fx-check { appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid rgba(var(--ink-rgb), .3); background: var(--soft-strong); cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.fx-check:checked { background: var(--accent); border-color: var(--accent); }
.fx-check:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.fx-dot { width: 22px; height: 22px; border-radius: 7px; background: rgba(var(--accent-rgb), .12); display: grid; place-items: center; color: var(--accent); font-weight: 800; font-size: .8rem; }
.fx.paid .fx-main strong { text-decoration: line-through; text-decoration-color: rgba(var(--ink-rgb), .35); color: var(--ink-soft); }
.fx-main { min-width: 0; }
.fx-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-main span { font-size: 0.8rem; color: var(--muted); }

.data-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.data-panel h3 { font-size: 1.25rem; margin-bottom: 4px; }
.data-panel p { margin: 0; max-width: 38rem; }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Modales ---------- */
.modal { width: min(460px, calc(100% - 32px)); padding: 26px; color: var(--ink); background: var(--glass-solid); }
.modal::backdrop { background: rgba(var(--ink-rgb), .28); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal[open] { animation: pop .3s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 1.45rem; margin-bottom: 18px; }
.modal form { display: grid; gap: 14px; }
.modal label { display: grid; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); }
.modal label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.modal label.check input { width: auto; margin-top: 3px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.align-end { align-self: end; }
.profile-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.profile-list li:first-child { border-top: 0; }
.profile-list input { flex: 1; }

/* ---------- Toast & cookies ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.9rem; transition: opacity .3s, transform .3s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.cookie { position: fixed; z-index: 80; right: 20px; bottom: 20px; width: min(420px, calc(100% - 32px)); padding: 18px; display: flex; gap: 14px; align-items: center; }
.cookie p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.cookie[hidden] { display: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px var(--gutter) 40px; }
.footer-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.footer nav a { text-decoration: none; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); }
.footer nav a:hover { color: var(--ink); }
.version-badge { font-size: 0.78rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(var(--accent-rgb), .1); color: var(--accent); text-decoration: none; }
.footer-note { max-width: var(--max); margin: 18px auto 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- Páginas interiores ---------- */
.page { width: min(820px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: clamp(48px, 9vh, 96px) 0 40px; }
.page-title { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 650; letter-spacing: -0.04em; margin-bottom: 14px; }
.page-lead { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 36px; max-width: 38rem; }
.prose { padding: clamp(22px, 4vw, 40px); }
.prose h2 { font-size: 1.35rem; margin: 30px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 10px 0; }
.prose th, .prose td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent-2), rgba(47,143,117,.1)); }
.tl-item { position: relative; padding-left: 44px; margin-bottom: 22px; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 26px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent-2); }
.tl-item:first-child::before { background: var(--accent-2); box-shadow: 0 0 0 6px rgba(47,143,117,.18); }
.tl-card { padding: 22px 24px; }
.tl-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tl-head h2 { font-size: 1.5rem; }
.tl-date { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.tl-tag { font-size: 0.72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: rgba(217,154,69,.18); color: var(--tag-ink); }
.tl-card ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.tl-card li { margin: 4px 0; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in, .no-js .reveal { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
.hero .reveal:nth-child(4) { transition-delay: .24s; }
.hero .reveal:nth-child(5) { transition-delay: .32s; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-profile { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-card { max-width: 440px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav { padding: 8px 8px 8px 14px; gap: 10px; }
  .brand span { font-size: 1.1rem; }
  .pill-select { max-width: 120px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi-hero { gap: 16px; }
  .ring { width: 92px; height: 92px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input { grid-column: 1 / -1; }
  .tx { grid-template-columns: 36px 1fr auto; }
  .tx-ico { width: 36px; height: 36px; }
  .tx-actions { grid-column: 2 / -1; justify-content: flex-end; opacity: 1; margin-top: -6px; }
  .fx { grid-template-columns: auto 1fr auto; }
  .fx .tx-actions { grid-column: 2 / -1; }
  .bars li { grid-template-columns: 1fr auto; }
  .bars .b-track { grid-column: 1 / -1; grid-row: 2; }
  .month-nav { width: 100%; justify-content: space-between; }
  .cookie { flex-direction: column; align-items: stretch; left: 16px; right: 16px; width: auto; bottom: 16px; }
  .modal .row { grid-template-columns: 1fr; }
  .footer nav { margin-left: 0; }
}
@media (hover: none) { .tx-actions { opacity: 1; } }

/* ---------- Perfiles: pestañas y vista conjunta (v0.3.0) ---------- */
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); font: 700 0.78rem/1 var(--f-display); }
.profile-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: -6px 0 14px; scrollbar-width: thin; }
.ptab { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s; }
.ptab:hover { background: var(--soft-strong); }
.ptab.on { background: var(--soft-strong); border-color: rgba(var(--accent-rgb), .45); box-shadow: 0 8px 20px -12px rgba(var(--accent-rgb), .6); }
.ptab:not(.on) .avatar { background: rgba(var(--accent-rgb), .15); color: var(--accent); }
.ptab-add { padding: 6px 14px; color: var(--accent); border-style: dashed; }
.ptab-add small { color: var(--muted); font-weight: 600; }

.overview { padding-bottom: 40px; }
.ov-hint { margin: 0; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.ov-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .2s; }
.ov-card:hover { transform: translateY(-3px); }
.ov-card.on { border-color: rgba(var(--accent-rgb), .5); }
.ov-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; min-width: 0; }
.ov-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-top .chip { margin-left: auto; }
.ov-cap { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.ov-amt { font: 650 1.7rem/1.05 var(--f-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.ov-amt.neg { color: var(--danger); }
.ov-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.ov-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ov-add { align-items: center; justify-content: center; text-align: center; min-height: 170px; border-radius: var(--r); border: 1.5px dashed rgba(var(--accent-rgb), .35); background: var(--soft-faint); }
.ov-add:hover { background: var(--soft); }
.ov-plus { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(var(--accent-rgb), .12); color: var(--accent); font: 600 1.5rem/1 var(--f-display); }
.ov-total { margin-top: 14px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ov-total[hidden] { display: none; }
.ov-total .kpi-label { margin-bottom: 4px; }
.ov-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.ov-sum span { padding: 10px 14px; border-radius: 14px; background: var(--soft); font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.ov-sum b { display: block; color: var(--ink); font: 650 1.1rem/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
#profileAddRow[hidden], #profileLimit[hidden] { display: none; }
@media (max-width: 560px) {
  .ov-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ov-card { padding: 14px; }
  .ov-amt { font-size: 1.3rem; }
  .ov-row { flex-direction: column; gap: 2px; }
  .ov-add { min-height: 140px; }
  .ov-sum { width: 100%; }
  .ov-sum span { flex: 1 1 40%; }
}

/* ---------- Modo oscuro (v0.5.0) ---------- */
:root[data-theme="dark"] {
  --bg: #0e1513;
  --ink: #e8eee9;
  --ink-soft: #b3c2bb;
  --muted: #8a9a93;
  --accent: #5cc3a2;
  --accent-2: #3fa888;
  --gold: #e3ad5c;
  --danger: #ff8a70;
  --line: rgba(232, 238, 233, 0.1);
  --glass: rgba(24, 36, 32, 0.55);
  --glass-solid: rgba(20, 30, 27, 0.94);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --soft: rgba(255, 255, 255, 0.05);
  --soft-strong: rgba(255, 255, 255, 0.1);
  --soft-faint: rgba(255, 255, 255, 0.03);
  --ink-rgb: 232, 238, 233;
  --accent-rgb: 92, 195, 162;
  --accent-hover: #7fd6b9;
  --on-accent: #0b1a16;
  --tag-ink: #f0c27e;
  color-scheme: dark;
}
:root[data-theme="dark"] .mesh span { opacity: 0.32; }
:root[data-theme="dark"] .mesh span:nth-child(1) { background: #1f6b57; }
:root[data-theme="dark"] .mesh span:nth-child(2) { background: #7a5520; }
:root[data-theme="dark"] .mesh span:nth-child(3) { background: #2b3f74; }
:root[data-theme="dark"] .pill-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e8eee9' stroke-width='1.5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .pill-select option, :root[data-theme="dark"] select option { background: #16211e; color: var(--ink); }
:root[data-theme="dark"] .btn-primary { box-shadow: 0 12px 26px -14px rgba(92, 195, 162, .6); }
:root[data-theme="dark"] .modal::backdrop { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .fx-check { background: transparent; border-color: rgba(232, 238, 233, .35); }
:root[data-theme="dark"] .fx-check:checked::after { border-color: var(--on-accent); }
:root[data-theme="dark"] .brand img { filter: drop-shadow(0 0 10px rgba(92, 195, 162, .25)); }
body, .glass, .nav, .btn, .ptab, .icon-btn { transition-property: background-color, border-color, color, box-shadow, transform; transition-duration: .35s; }

.theme-btn .i-moon { display: block; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }

/* ---------- Calendario (v0.6.0) ---------- */
.dp-field { display: grid; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); }
.dp-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 0.92rem; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.dp-btn svg { color: var(--accent); flex: none; }
.dp-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-btn:hover, .dp-btn[aria-expanded="true"] { border-color: rgba(var(--accent-rgb), .5); background: var(--soft-strong); }
.dp-panel { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--soft); animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
.dp-panel[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-head .icon-btn { width: 32px; height: 32px; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.dp-week span { font-size: 0.72rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.dp-day { aspect-ratio: 1; min-height: 34px; border: 0; border-radius: 10px; background: none; font-weight: 600; font-size: 0.88rem; cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.dp-day:hover { background: rgba(var(--accent-rgb), .12); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .6); }
.dp-day.future { color: var(--muted); }
.dp-day.sel { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.dp-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.dp-quick .ptab { padding: 6px 12px; font-size: 0.82rem; }

/* ---------- Herramientas de la tarjeta de perfil (v0.4.0) ---------- */
.ov-card { position: relative; }
.ov-tools { display: flex; align-items: center; gap: 2px; margin: -6px 0 4px -6px; }
.ov-tools .chip { margin-left: auto; }
.ov-tools .mini-btn { width: 28px; height: 28px; }
.ov-tools .mini-btn:disabled { opacity: .35; cursor: not-allowed; background: none; color: var(--ink-soft); }
.ov-card:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* ---------- Confirmación (v0.6.1) ---------- */
.modal-confirm { width: min(400px, calc(100% - 32px)); }
.modal-confirm h3 { margin-bottom: 4px; }
.modal-confirm p { margin: 0 0 6px; }
.btn-danger-solid { background: var(--danger); color: #fff; box-shadow: 0 12px 26px -14px rgba(194, 73, 47, .8); }
.btn-danger-solid:hover { filter: brightness(1.08); transform: translateY(-1px); }
:root[data-theme="dark"] .btn-danger-solid { color: #1a0d0a; }

/* ---------- Vista calendario (v0.7.0) ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.head-actions .btn svg { flex: none; }
.modal-cal { width: min(880px, calc(100% - 24px)); padding: 24px; }
.cal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-top .eyebrow { margin-bottom: 6px; }
.cal-top h3 { margin: 0; font-size: 1.6rem; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cal-nav strong { min-width: 9.5em; text-align: center; }
.cal-close { font-size: 1.4rem; }
.cal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.cal-stats span { padding: 10px 12px; border-radius: 14px; background: var(--soft); font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.cal-stats b { display: block; margin-top: 2px; font: 650 1.05rem/1.2 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-undated { grid-column: 1 / -1; margin: 0; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week span { font-size: 0.74rem; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 6px; }
.cal-day {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 74px; padding: 8px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--soft); text-align: left; cursor: pointer; color: var(--ink); font: inherit;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.cal-day.has { background: linear-gradient(rgba(var(--accent-rgb), var(--heat)), rgba(var(--accent-rgb), var(--heat))), var(--soft); }
.cal-day:hover { transform: translateY(-1px); border-color: rgba(var(--accent-rgb), .45); }
.cal-day.today { box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), .7); }
.cal-day.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.cal-day.future { opacity: .55; }
.cd-num { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 0.82rem; }
.cd-amt { margin-top: auto; font: 650 0.95rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.cd-n { font-size: 0.68rem; color: var(--ink-soft); font-weight: 600; }
.cal-fx-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.cal-swatch { display: inline-block; width: 28px; height: 9px; border-radius: 3px; vertical-align: middle; background: linear-gradient(90deg, rgba(var(--accent-rgb), .1), rgba(var(--accent-rgb), .6)); }
.cal-legend { margin: 10px 0 0; }
.cal-detail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.cal-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-detail-head h4 { margin: 0; font: 650 1.15rem/1.2 var(--f-display); }
.cal-detail-head p { margin: 2px 0 0; }
.cal-list { max-height: 240px; margin-top: 8px; }
.tag-fx { font-style: normal; font-size: 0.68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: rgba(217,154,69,.18); color: var(--tag-ink); vertical-align: middle; }
@media (max-width: 700px) {
  .modal-cal { padding: 16px; }
  .cal-top h3 { font-size: 1.3rem; }
  .cal-nav { margin-left: 0; width: 100%; justify-content: space-between; }
  .cal-close { position: absolute; top: 12px; right: 12px; }
  .cal-stats { grid-template-columns: 1fr 1fr; }
  .cal-week, .cal-grid { gap: 4px; }
  .cal-week span { font-size: 0.66rem; }
  .cal-day { min-height: 52px; padding: 5px; border-radius: 9px; align-items: center; }
  .cd-num { font-size: 0.74rem; }
  .cd-amt { font-size: 0.7rem; letter-spacing: -0.02em; }
  .cd-n { display: none; }
}

/* ---------- Menú «Exportar mes en…» (v0.8.0) ---------- */
.export-menu { position: relative; }
.export-menu #exportToggle svg { transition: transform .2s; }
.export-menu #exportToggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.export-list { position: absolute; z-index: 30; right: 0; bottom: calc(100% + 8px); width: 300px; padding: 6px; border-radius: 16px; background: var(--glass-solid); display: grid; gap: 2px; animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
.export-list[hidden] { display: none; }
.export-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; color: var(--ink); }
.export-list button:hover, .export-list button:focus-visible { background: rgba(var(--accent-rgb), .1); outline: none; }
.export-list strong { display: block; font-size: 0.92rem; }
.export-list small { display: block; font-size: 0.76rem; color: var(--muted); }
.fmt { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; font: 800 0.62rem/1 var(--f-body); letter-spacing: .04em; color: #fff; }
.fmt-xlsx { background: #1d7a46; }
.fmt-ods { background: #2a7ab0; }
.fmt-pdf { background: #c2412f; }
.fmt-csv { background: #6b7a74; }
@media (max-width: 560px) { .export-list { left: 0; right: auto; width: min(300px, calc(100vw - 40px)); } }

/* ---------- Intro al abrir la página (v0.10.0) ---------- */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
.splash { display: none; }
.js .splash {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: var(--bg); clip-path: inset(0);
  transition: clip-path .9s var(--ease-out), opacity .4s ease .6s, visibility 0s linear .95s;
  animation: splashSafety .5s ease 3.2s forwards; /* red de seguridad si el JS no llega */
}
.js .splash.is-done { clip-path: inset(0 0 100%); opacity: 0; visibility: hidden; pointer-events: none; }
.splash-in { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.splash-in img { width: 84px; height: 84px; animation: splashLogo .9s var(--ease-out) both; filter: drop-shadow(0 18px 30px rgba(var(--accent-rgb), .35)); }
.splash-name { font: 750 1.05rem/1 var(--f-display); letter-spacing: .32em; text-transform: uppercase; margin-right: -.32em; color: var(--ink); animation: splashLogo .9s var(--ease-out) .12s both; }
.splash-bar { position: relative; width: 120px; height: 2px; border-radius: 2px; overflow: hidden; background: var(--line); margin-top: 4px; }
.splash-bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent-2), var(--gold)); transform-origin: left; transform: scaleX(0); animation: splashFill 1.15s cubic-bezier(.65, 0, .35, 1) .15s forwards; }
@keyframes splashLogo { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes splashFill { to { transform: scaleX(1); } }
@keyframes splashSafety { to { opacity: 0; visibility: hidden; pointer-events: none; clip-path: inset(0 0 100%); } }

/* Titular que sube línea a línea y el resto entra escalonado */
.js { --hd: 1.5s; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.hero-title .line > span { display: inline-block; }
.js .hero-title .line > span { transform: translateY(112%); animation: lineUp 1.1s var(--ease-out) calc(var(--hd) + var(--i, 0) * .12s) forwards; }
.hero-title .line:nth-child(2) { --i: 1; }
.hero-title .line:nth-child(3) { --i: 2; }
.js .hero-in { opacity: 0; animation: heroFade .9s var(--ease-out) calc(var(--hd) + var(--d, 0s)) forwards; }
.js .hero-in-card { animation: heroFade 1.1s var(--ease-out) calc(var(--hd) + var(--d, 0s)) forwards, bob 7s ease-in-out calc(var(--hd) + 1.4s) infinite; }
@keyframes lineUp { to { transform: none; } }
@keyframes heroFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Aviso de cookies (v0.9.0) ---------- */
.cookie-pop {
  position: fixed; z-index: 150; left: 20px; bottom: 20px; width: min(380px, calc(100% - 32px));
  padding: 18px; border-radius: 20px; background: var(--glass-solid);
  transform: translateY(20px); opacity: 0; transition: transform .45s var(--ease-out), opacity .3s;
}
.cookie-pop.show { transform: none; opacity: 1; }
.cookie-pop[hidden] { display: none; }
.cookie-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cookie-head svg { flex: none; color: var(--gold); }
.cookie-head strong { font: 650 1.05rem/1.2 var(--f-display); }
.cookie-pop p { margin: 0 0 12px; font-size: 0.86rem; color: var(--ink-soft); }
.cookie-pop p a { color: var(--accent); font-weight: 600; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cookie-actions .btn { flex: 1 1 auto; }
.cookie-actions .link-btn { flex-basis: 100%; text-align: center; margin-top: 2px; }
.cookie-prefs { display: grid; gap: 8px; margin: 0 0 12px; }
.cookie-prefs[hidden] { display: none; }
.cookie-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 0.85rem; }
.cookie-opt b { display: block; font-size: 0.88rem; }
.cookie-opt small { color: var(--muted); }
.switch { position: relative; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(var(--ink-rgb), .2); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .55; }
.switch input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.link-quiet { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.link-quiet:hover { color: var(--ink); }
@media (max-width: 560px) { .cookie-pop { left: 16px; right: 16px; bottom: 16px; width: auto; } }

/* ---------- Día de cobro con calendario (v0.11.0) ---------- */
.dp-note { margin: 10px 0 0; }
[data-day-panel] .dp-head { justify-content: flex-start; }

/* ---------- Selector de mes y año (v0.12.0) ---------- */
.month-nav, .cal-nav { position: relative; z-index: 30; }
.month-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 10.5em; padding: 7px 12px; border: 0; border-radius: 999px; background: none; font-weight: 700; color: var(--ink); cursor: pointer; transition: background .2s; }
.month-btn:hover, .month-btn[aria-expanded="true"] { background: rgba(var(--accent-rgb), .1); }
.month-btn .chev { color: var(--accent); transition: transform .2s; }
.month-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.month-btn #monthLabel, .month-btn #calMonth { min-width: 0; }
.cal-nav strong { min-width: 0; }
.mp-pop { position: absolute; z-index: 40; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 280px; padding: 14px; border-radius: 18px; background: var(--glass-solid); animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.mp-pop[hidden] { display: none; }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-head strong { font: 650 1.15rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.mp-head .icon-btn { width: 32px; height: 32px; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-m { position: relative; padding: 11px 4px; border: 0; border-radius: 12px; background: var(--soft); font-weight: 650; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.mp-m:hover { background: rgba(var(--accent-rgb), .12); }
.mp-m.now { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .6); }
.mp-m.sel { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.mp-dot { position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.mp-foot { display: flex; justify-content: center; margin-top: 10px; }
@media (max-width: 560px) { .mp-pop { left: 0; transform: none; width: min(280px, calc(100vw - 40px)); } }

/* ---------- Versión móvil (v0.13.0) ---------- */
.tabbar { display: none; }
@media (max-width: 700px) {
  body.page-home { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: 84px; }

  /* Barra inferior con botón central para apuntar */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px 6px 8px; border-radius: 22px; background: var(--glass-solid);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center;
    border: 0; background: none; padding: 4px 0; border-radius: 14px; font: 600 0.7rem/1 var(--f-body);
    color: var(--ink-soft); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar a.on { color: var(--accent); }
  .tabbar a:active, .tabbar button:active { background: rgba(var(--accent-rgb), .1); }
  .tabbar .tab-add {
    align-self: center; justify-self: center; width: 58px; height: 58px; min-height: 0; margin-top: -26px; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); box-shadow: 0 14px 28px -10px rgba(var(--accent-rgb), .8), 0 0 0 5px var(--bg);
  }
  .tabbar .tab-add span { font: 500 2rem/1 var(--f-display); margin-top: -2px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .page-home .cookie-pop { bottom: calc(92px + env(safe-area-inset-bottom)); }

  /* Formularios como hoja que sube desde abajo */
  .modal.sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0; border-bottom: 0;
    max-height: 92dvh; padding: 26px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .modal.sheet::before { content: ""; display: block; width: 42px; height: 5px; margin: -14px auto 12px; border-radius: 99px; background: rgba(var(--ink-rgb), .2); }
  .modal.sheet[open] { animation: sheetUp .35s cubic-bezier(.2, .9, .3, 1); }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .modal .row { grid-template-columns: 1fr 1fr; }
  .modal h3 { font-size: 1.3rem; }
  .modal-actions { position: sticky; bottom: -1px; margin: 4px -18px 0; padding: 12px 18px 2px; background: var(--glass-solid); }
  .modal-actions .btn { flex: 1; padding: 14px; }
  .modal-cal.sheet { padding-top: 26px; }

  /* 16px en campos: evita el zoom automático de iPhone al escribir */
  .modal input, .modal select, .filters input, .filters select, .dp-btn { font-size: 16px; min-height: 46px; }
  .dp-day { min-height: 40px; font-size: 0.95rem; }

  /* Cifras del mes más compactas: la principal arriba y tres pequeñas debajo */
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpi-hero { grid-column: 1 / -1; }
  .kpi:not(.kpi-hero) { padding: 12px; gap: 4px; }
  .kpi:not(.kpi-hero) .kpi-label { font-size: 0.72rem; }
  .kpi:not(.kpi-hero) .kpi-val { font-size: 1.02rem; letter-spacing: -0.02em; }
  .kpi:not(.kpi-hero) .kpi-note, .kpi:not(.kpi-hero) .link-btn { font-size: 0.7rem; }

  /* Listas: sin scroll dentro del scroll y botones fáciles de pulsar */
  .tx-list { max-height: none; overflow: visible; margin-right: 0; padding-right: 0; }
  .cal-list { max-height: none; }
  .mini-btn { width: 40px; height: 40px; }
  .fx-check { width: 26px; height: 26px; }
  .panel { padding: 16px; }
  .panel-head h3 { font-size: 1.15rem; }
  .head-actions .btn { padding: 9px 12px; }
  #movimientos .head-actions .btn-primary { display: none; } /* ya está el + de la barra inferior */
  .app-head { margin-bottom: 16px; }
  .hero { padding-bottom: 36px; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:not(.kpi-hero):last-child { grid-column: 1 / -1; }
}

/* ---------- Vaciar de golpe (v0.14.0) ---------- */
.btn-clear { background: transparent; border-color: rgba(194, 73, 47, .3); color: var(--danger); gap: 6px; }
.btn-clear:hover { background: rgba(194, 73, 47, .08); }
.btn-clear[hidden] { display: none; }
@media (max-width: 700px) { .btn-clear span { display: none; } .btn-clear { padding: 9px 11px; } }

/* ---------- Mes de cobro a cobro (v0.16.0) ---------- */
.month-nav { flex-wrap: wrap; justify-content: center; }
.period-range { flex-basis: 100%; margin: -2px 0 2px; text-align: center; font-size: 0.78rem; color: var(--ink-soft); }
.cd-mon { margin-left: 3px; font-size: 0.62rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* ---------- Botón día de cobro (v0.17.0) ---------- */
.period-range { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; }
.payday-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid rgba(var(--accent-rgb), .35); border-radius: 999px; background: rgba(var(--accent-rgb), .08); color: var(--accent); font: 650 0.76rem/1.2 var(--f-body); cursor: pointer; transition: background .2s; }
.payday-btn:hover { background: rgba(var(--accent-rgb), .16); }
@media (max-width: 700px) { .payday-btn { padding: 7px 12px; font-size: 0.82rem; } }

/* ---------- Saltar un fijo este mes (v0.18.0) ---------- */
.fx-skip { display: block; width: fit-content; margin-top: 5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: none; font: 600 0.72rem/1.4 var(--f-body); color: var(--ink-soft); cursor: pointer; }
.fx-skip:hover { border-color: rgba(var(--accent-rgb), .45); color: var(--accent); }
.fx.skipped .fx-main strong, .fx.skipped .tx-amt { text-decoration: line-through; text-decoration-color: rgba(var(--ink-rgb), .35); color: var(--muted); }
.fx.skipped .fx-check { opacity: .35; cursor: default; }
.fx.skipped .fx-skip { border-color: rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .08); color: var(--accent); }
@media (max-width: 700px) { .fx-skip { padding: 5px 11px; font-size: 0.78rem; } }

/* ---------- Ingresos en Movimientos (v0.19.0) ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 2px 0 6px; border-radius: 14px; background: var(--soft); }
.seg button { padding: 10px 8px; border: 0; border-radius: 10px; background: none; font: 700 0.92rem/1 var(--f-body); color: var(--ink-soft); cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--danger); color: #fff; box-shadow: 0 6px 14px -8px rgba(194, 73, 47, .8); }
.seg button[data-kind="ingreso"][aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 14px -8px rgba(var(--accent-rgb), .8); }
.only-gasto[hidden] { display: none; }
.btn-income { background: rgba(var(--accent-rgb), .1); border-color: rgba(var(--accent-rgb), .35); color: var(--accent); }
.btn-income:hover { background: rgba(var(--accent-rgb), .18); }
.tx-in .tx-ico { background: rgba(var(--accent-rgb), .16); font-size: 1.15rem; }
.tx-in .tx-amt, .tx-day .pos { color: var(--accent); }
.tx-day .pos { font-weight: 700; }
.cal-in-dot { display: inline-grid; place-items: center; width: 12px; height: 12px; margin-left: 3px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 800 9px/1 var(--f-body); font-style: normal; vertical-align: 1px; }
.cal-adds { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) {
  /* Cabeceras con varios botones: título arriba y botones en una fila debajo */
  #movimientos .panel-head, #fijos .panel-head { flex-wrap: wrap; row-gap: 10px; }
  #movimientos .head-actions, #fijos .head-actions { flex: 1 0 100%; flex-wrap: nowrap; justify-content: flex-start; }
  #movimientos .head-actions .btn-income, #fijos .head-actions #addFixed { margin-left: auto; }
  .cal-adds { width: 100%; }
  .cal-adds .btn { flex: 1; }
}
.cal-range { display: block; margin-top: 2px; font: 600 0.74rem/1.2 var(--f-body); color: var(--ink-soft); }
#calMonthBtn { flex-direction: row; text-align: center; }
/* Movimientos: título arriba y los cuatro botones en una fila (todas las pantallas) */
#movimientos .panel-head { flex-wrap: wrap; row-gap: 10px; }
#movimientos .head-actions { flex: 1 0 100%; flex-wrap: nowrap; justify-content: flex-start; }
#movimientos .head-actions .btn-income { margin-left: auto; }

/* ---------- Selector de idioma (v0.20.0) ---------- */
.lang-wrap { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--ink); font: 700 0.8rem/1 var(--f-body); letter-spacing: .04em; cursor: pointer; transition: background .2s, border-color .2s; }
.lang-btn:hover, .lang-wrap.open .lang-btn { background: rgba(var(--accent-rgb), .1); border-color: rgba(var(--accent-rgb), .45); }
.lang-chev { transition: transform .2s; }
.lang-wrap.open .lang-chev { transform: rotate(180deg); }
.lang-menu { position: absolute; z-index: 70; top: calc(100% + 8px); right: 0; min-width: 170px; padding: 6px; border-radius: 16px; background: var(--glass-solid); animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
.lang-menu[hidden] { display: none; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 11px; background: none; color: var(--ink); font: 600 0.92rem/1.2 var(--f-body); text-align: left; cursor: pointer; }
.lang-item:hover, .lang-item:focus-visible { background: rgba(var(--accent-rgb), .1); outline: none; }
.lang-chk { color: var(--accent); visibility: hidden; }
.lang-item[aria-checked="true"] .lang-chk { visibility: visible; }
@media (max-width: 560px) { .lang-btn { padding: 0 9px; gap: 4px; } .lang-chev { display: none; } }

/* ---------- Sobre nosotros (v0.20.0) ---------- */
.about { padding-top: 30px; padding-bottom: 90px; }
.about-intro { max-width: 760px; margin-bottom: 30px; }
.about-intro h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 650; margin: 0 0 16px; }
.about-lead { margin: 0; font-size: 1.08rem; line-height: 1.65; color: var(--ink-soft); }
.about-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.about-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 22px; }
.about-card h3 { margin: 0; font: 650 1.12rem/1.25 var(--f-display); }
.about-card p { margin: 0; color: var(--ink-soft); line-height: 1.55; font-size: 0.95rem; }
.about-card .link-btn { align-self: flex-start; margin-top: auto; }
.about-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(var(--accent-rgb), .12); color: var(--accent); }
@media (max-width: 1000px) { .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .about-grid { grid-template-columns: 1fr; } .about-card { padding: 18px; } .about { padding-bottom: 60px; } }

/* Menú con más enlaces: sin saltos de línea y los secundarios se ocultan en pantallas medianas */
.nav-links a { white-space: nowrap; }
@media (max-width: 1240px) { .nav-links a { padding: 8px 11px; } }
@media (max-width: 1140px) { .nav-links .nav-opt { display: none; } }
/* Cabecera en móvil: con el selector de idioma, el nombre deja sitio y queda solo el logo */
@media (max-width: 480px) {
  .nav .brand > span { display: none; }
  .nav-profile { gap: 5px; }
  .nav-profile .pill-select { max-width: 120px; }
}
/* ---------- Página Sobre nosotros (v0.21.0) ---------- */
.about-page .page-lead { max-width: 44rem; }
.about-page .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.about-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 28px; padding: 24px; border-radius: 22px; }
.about-cta h2 { margin: 0 0 6px; font: 650 1.4rem/1.2 var(--f-display); }
.about-cta p { margin: 0; color: var(--ink-soft); }
@media (max-width: 560px) { .about-page .about-grid { grid-template-columns: 1fr; } .about-cta .btn { width: 100%; } }

/* ---------- Fijos anuales (v0.22.0) ---------- */
.only-anual[hidden] { display: none; }
.seg-freq button[aria-pressed="true"], .seg-freq button[data-freq="anual"][aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 14px -8px rgba(var(--accent-rgb), .8); }
.tag-yr { background: rgba(var(--accent-rgb), .14); color: var(--accent); }
.fx.off { opacity: .6; }
.fx.off .fx-check { visibility: hidden; }
.fx-when { display: block; margin-top: 5px; font: 600 0.74rem/1.4 var(--f-body); color: var(--accent); }

/* ---------- Previsión (v0.23.0) ---------- */
.pv-link { display: inline-block; margin-top: 10px; }
.pv-page { width: min(1100px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: clamp(48px, 9vh, 96px) 0 60px; }
.pv-page .page-lead { max-width: 46rem; }
.pv-empty { padding: 26px; border-radius: 22px; display: grid; gap: 10px; justify-items: start; }
.pv-empty[hidden], #prevision[hidden] { display: none; }
.pv-empty h2 { margin: 0; font: 650 1.4rem/1.2 var(--f-display); }
.pv-empty p { margin: 0; color: var(--ink-soft); }
.pv-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 18px 8px 8px; border-radius: 999px; margin-bottom: 16px; }
.pv-when { display: grid; min-width: 11em; text-align: center; }
.pv-when strong { font-weight: 700; }
.pv-when small { color: var(--muted); font-size: 0.78rem; }
.pv-when small:empty { display: none; }
.pv-who { margin-left: auto; font-size: 0.86rem; color: var(--ink-soft); }
.pv-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pv-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.pv-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.chip-btn { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); font: 600 0.8rem/1.2 var(--f-body); color: var(--ink-soft); cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.chip-btn:hover { border-color: rgba(var(--accent-rgb), .45); color: var(--accent); }
.chip-btn.danger:hover { border-color: rgba(194, 73, 47, .45); color: var(--danger); }
.pv-cats { list-style: none; margin: 0; padding: 0; display: grid; }
.pv-cat { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 150px); align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.pv-cat:first-child { border-top: 0; }
.pv-cat label { font-weight: 600; color: var(--ink-soft); }
.pv-cat.has label { color: var(--ink); }
.pv-input { position: relative; display: block; }
.pv-input input { width: 100%; padding: 9px 30px 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 0.95rem; font-variant-numeric: tabular-nums; text-align: right; }
.pv-input input:focus { outline: 2px solid rgba(47,143,117,.45); border-color: transparent; }
.pv-input > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.9rem; pointer-events: none; }
.pv-real { display: grid; gap: 4px; }
.pv-real .hc-bar { height: 6px; }
.pv-real small { color: var(--muted); font-size: 0.76rem; }
.pv-summary h3 { margin: 0 0 14px; font-size: 1.25rem; font-weight: 650; }
.pv-income { display: grid; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 16px; }
.pv-income small { font-weight: 500; font-size: 0.76rem; }
.pv-lines { margin: 0 0 16px; display: grid; gap: 8px; }
.pv-lines div { display: flex; justify-content: space-between; gap: 12px; }
.pv-lines dt { color: var(--ink-soft); }
.pv-lines dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-result { padding: 16px; border-radius: 16px; background: rgba(var(--accent-rgb), .08); display: grid; gap: 8px; }
.pv-result p { margin: 0; }
.pv-result #pvLeftLabel { font-weight: 700; color: var(--ink-soft); font-size: 0.9rem; }
.pv-left { font: 650 clamp(2rem, 3.4vw, 2.6rem)/1 var(--f-display); letter-spacing: -0.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.pv-result.neg { background: rgba(194, 73, 47, .09); }
.pv-result.neg .pv-left { color: var(--danger); }
.pv-note { font-size: 0.84rem; color: var(--ink-soft); }
.pv-note:empty { display: none; }
.pv-fixed summary { cursor: pointer; font-weight: 700; }
.pv-fixed ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }
.pv-fixed li { display: flex; justify-content: space-between; gap: 12px; }
.pv-fixed li span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.nav-links a[aria-current="page"] { color: var(--accent); }
@media (max-width: 900px) {
  .pv-grid { grid-template-columns: 1fr; }
  .pv-side { position: static; }
  .pv-page { padding-bottom: 110px; }
  .pv-page .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .pv-float { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 999px; background: var(--glass-solid); text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: 0.9rem; }
  .pv-float strong { font: 650 1.3rem/1 var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
  .pv-float.neg strong { color: var(--danger); }
}
@media (min-width: 901px) { .pv-float { display: none; } }
@media (max-width: 560px) {
  .pv-bar { border-radius: 22px; padding: 8px; justify-content: space-between; }
  .pv-when { min-width: 0; flex: 1; }
  .pv-who { margin: 0; width: 100%; text-align: center; }
  .pv-cat { grid-template-columns: minmax(0, 1fr) 118px; gap: 6px 10px; }
  .pv-real { grid-column: 1 / -1; }
  .pv-real:empty { display: none; }
}

/* ---------- Previsión con conceptos (v0.24.0) ---------- */
.pv-add span { font-size: 1.15em; line-height: 1; }
.pv-items { list-style: none; margin: 0 0 14px; padding: 0; }
.pv-items:empty { display: none; }
.pv-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line); }
.pv-item:first-child { border-top: 0; }
.pv-name { font-weight: 600; overflow-wrap: anywhere; }
.pv-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-item:hover .tx-actions, .pv-item:focus-within .tx-actions { opacity: 1; }
.pv-items-empty { margin: 4px 0 16px; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; font-size: 0.9rem; }
.pv-items-empty[hidden], .chip-btn[hidden] { display: none; }
.pv-tools { margin: 0; }
@media (max-width: 560px) { .pv-item { gap: 8px; padding: 10px 2px; } .pv-item .tx-actions { opacity: 1; grid-column: auto; margin-top: 0; } }

/* ---------- Previsión por categoría (v0.25.0) ---------- */
.pv-name small { display: block; margin-top: 2px; font-weight: 500; font-size: 0.78rem; color: var(--muted); }
.pv-track { grid-column: 1 / -1; display: grid; gap: 4px; margin-top: -2px; }
.pv-track .hc-bar { height: 6px; }
.pv-track small { font-size: 0.78rem; color: var(--ink-soft); }
#pvExtraRow[hidden] { display: none; }
#pvExtraRow dd { color: var(--danger); }

/* ---------- Selector de mes en Previsión (v0.28.0) ---------- */
.pv-bar { position: relative; z-index: 30; }
.pv-when { position: relative; justify-items: center; }
.pv-when .month-btn { min-width: 0; padding: 5px 12px; }

/* =========================================================
   Estilo «Noche» (v0.29.0)
   Capa que se pone encima de todo lo anterior: colores, letra,
   superficies y animaciones nuevas. Para volver al estilo de antes
   basta con borrar desde aquí hasta el final (o usar _backup/).
   ========================================================= */

/* ---------- Colores: claro («papel») ---------- */
:root {
  --bg: #eef1ea;
  --ink: #0e241d;
  --ink-soft: #43574e;
  --muted: #6e8077;
  --accent: #17694c;
  --accent-2: #2c8c64;
  --accent-rgb: 23, 105, 76;
  --accent-hover: #0f563d;
  --on-accent: #f3f7ee;
  --gold: #c98a1f;
  --danger: #c2412f;
  --ink-rgb: 14, 36, 29;
  --line: rgba(var(--ink-rgb), 0.1);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-solid: #ffffff;
  --glass-border: rgba(var(--ink-rgb), 0.08);
  --shadow: 0 18px 44px -26px rgba(var(--ink-rgb), 0.35);
  --soft: rgba(var(--ink-rgb), 0.045);
  --soft-strong: rgba(var(--ink-rgb), 0.08);
  --soft-faint: rgba(var(--ink-rgb), 0.02);
  --signal: #c6f04f;
  --signal-rgb: 198, 240, 79;
  --signal-hover: #d6f77a;
  --on-signal: #0b1a14;
  --on-signal-soft: rgba(11, 26, 20, 0.66);
  --tag-ink: #8a5a17;
  --r: 24px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
/* ---------- Colores: oscuro («noche», el de por defecto) ---------- */
:root[data-theme="dark"] {
  --bg: #0a1512;
  --ink: #eef3ec;
  --ink-soft: #b4c4bb;
  --muted: #7e9188;
  --accent: #c6f04f;
  --accent-2: #9bd63f;
  --accent-rgb: 198, 240, 79;
  --accent-hover: #d7f77e;
  --on-accent: #0b1a14;
  --gold: #f2b84b;
  --danger: #ff7b63;
  --ink-rgb: 238, 243, 236;
  --line: rgba(var(--ink-rgb), 0.09);
  --glass: rgba(19, 37, 31, 0.62);
  --glass-solid: #12221c;
  --glass-border: rgba(var(--ink-rgb), 0.08);
  --shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.85);
  --soft: rgba(var(--ink-rgb), 0.05);
  --soft-strong: rgba(var(--ink-rgb), 0.1);
  --soft-faint: rgba(var(--ink-rgb), 0.025);
  --tag-ink: #f2c46e;
}

/* ---------- Letra: titulares gruesos y apretados ---------- */
h1, h2, h3 { letter-spacing: -0.035em; }
.brand { font-weight: 800; letter-spacing: -0.04em; }
.hero h1 { font-weight: 800; letter-spacing: -0.055em; line-height: .98; }
.page-title, .app-head h2, .about-intro h2 { font-weight: 800; letter-spacing: -0.05em; }
.panel-head h3, .pv-summary h3, .data-panel h3, .modal h3, .about-card h3, .about-cta h2, .pv-empty h2, .tl-head h2, .cal-top h3 { font-weight: 750; letter-spacing: -0.03em; }
.hc-amount, .kpi-big, .kpi-val, .ov-amt, .pv-left { font-weight: 800; }
.hero h1 em, .page-title em {
  font-family: var(--f-display); font-style: normal; font-weight: 800; letter-spacing: inherit; color: var(--accent);
  background: linear-gradient(rgba(var(--signal-rgb), .38), rgba(var(--signal-rgb), .38)) no-repeat 0 90% / 100% .16em;
}
.js .hero h1 em, .js .page-title em { background-size: 0% .16em; animation: markIn 1s var(--ease-out) calc(var(--hd) + .95s) forwards; }
@keyframes markIn { to { background-size: 100% .16em; } }

/* ---------- Fondo: brillo lima y rejilla de puntos ---------- */
.mesh { filter: blur(90px) saturate(130%); }
.mesh span { opacity: .55; }
.mesh span:nth-child(1) { width: 40vw; height: 40vw; left: -10vw; top: -14vw; background: rgba(var(--signal-rgb), .55); }
.mesh span:nth-child(2) { width: 36vw; height: 36vw; right: -10vw; top: 22vh; background: #9fd8c0; }
.mesh span:nth-child(3) { width: 34vw; height: 34vw; left: 28vw; bottom: -16vw; background: #e9dca8; }
:root[data-theme="dark"] .mesh span { opacity: .22; }
:root[data-theme="dark"] .mesh span:nth-child(1) { background: #8fc23a; }
:root[data-theme="dark"] .mesh span:nth-child(2) { background: #1d6b55; opacity: .4; }
:root[data-theme="dark"] .mesh span:nth-child(3) { background: #24543f; opacity: .35; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(var(--ink-rgb), .11) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 75%);
}

/* ---------- Superficies ---------- */
.glass { border-radius: var(--r); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), var(--shadow); }
:root:not([data-theme="dark"]) .glass { box-shadow: var(--shadow); }
.kpi, .panel, .ov-card, .about-card { transition: transform .35s var(--ease-out), border-color .25s, background-color .35s, box-shadow .35s; }
.kpi:not(.kpi-hero):hover, .about-card:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), .35); }

/* Entrada escalonada: la transición del cristal no incluía la opacidad */
.reveal, .glass.reveal { transition-property: opacity, transform, background-color, border-color, box-shadow; transition-duration: .8s, .8s, .35s, .25s, .35s; transition-timing-function: var(--ease-out); }
.reveal { transform: translateY(26px); }
.reveal.in, .no-js .reveal { transform: none; }

/* ---------- Botones: acción en lima ---------- */
.btn { font-weight: 700; letter-spacing: -0.005em; }
.btn-primary, :root[data-theme="dark"] .btn-primary { background: var(--signal); color: var(--on-signal); box-shadow: 0 14px 30px -16px rgba(var(--signal-rgb), .9); }
.btn-primary:hover { background: var(--signal-hover); transform: translateY(-2px); box-shadow: 0 18px 36px -16px rgba(var(--signal-rgb), 1); }
.hero-cta .btn-primary::after { content: "→"; display: inline-block; margin-left: 2px; transition: transform .3s var(--ease-out); }
.hero-cta .btn-primary:hover::after { transform: translateX(4px); }
.btn-ghost { background: transparent; border-color: rgba(var(--ink-rgb), .18); }
.btn-ghost:hover { background: var(--soft); border-color: rgba(var(--accent-rgb), .55); }
.link-btn { text-decoration-color: rgba(var(--accent-rgb), .5); }
:root:not([data-theme="dark"]) .btn-primary { box-shadow: 0 12px 26px -14px rgba(110, 150, 20, .7); }

/* ---------- Navegación ---------- */
.nav-links a[aria-current="page"], .nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--signal); }
.nav-ink { background: rgba(var(--accent-rgb), .12); }
:root[data-theme="dark"] .brand img { filter: drop-shadow(0 0 12px rgba(var(--signal-rgb), .22)); }

/* ---------- Etiquetas pequeñas con punto que late ---------- */
.eyebrow { display: flex; align-items: center; gap: 10px; width: fit-content; font-size: 0.72rem; letter-spacing: 0.18em; color: var(--accent); }
.eyebrow::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(var(--signal-rgb), .7); animation: dotPulse 2.4s ease-out infinite; }
:root:not([data-theme="dark"]) .eyebrow::before { background: var(--accent-2); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .45); }
@keyframes dotPulse { 70% { box-shadow: 0 0 0 9px rgba(var(--signal-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--signal-rgb), 0); } }

/* ---------- Inicio: esfera lima detrás del tique ---------- */
.hero { position: relative; isolation: isolate; overflow-x: clip; } /* las ondas de la esfera no ensanchan la página en el móvil */
.hero-orb { position: absolute; z-index: -1; right: calc(31% - 40px); top: clamp(30px, 7vh, 70px); width: clamp(120px, 15vw, 210px); aspect-ratio: 1; pointer-events: none; }
.hero-orb b { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #f6ffd6 0, var(--signal) 36%, #6fae2a 100%); box-shadow: 0 30px 80px -18px rgba(var(--signal-rgb), .6); }
.hero-orb i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(var(--signal-rgb), .55); animation: orbRing 3.8s ease-out infinite; }
.hero-orb i:nth-child(2) { animation-delay: 1.9s; }
.js .hero-orb { animation: orbUp 1.6s var(--ease-out) calc(var(--hd) + .1s) both, orbFloat 9s ease-in-out calc(var(--hd) + 1.7s) infinite; }
@keyframes orbUp { from { opacity: 0; transform: translateY(90px) scale(.7); } }
@keyframes orbFloat { 50% { transform: translateY(-14px); } }
@keyframes orbRing { from { transform: scale(1); opacity: .8; } to { transform: scale(1.9); opacity: 0; } }

/* ---------- Inicio: tarjeta convertida en tique del mes ---------- */
.ticket { position: relative; padding: 24px 26px 18px; border-radius: 26px; }
:root[data-theme="dark"] .ticket { background: rgba(17, 33, 27, .86); }
.ticket .hc-label { font: 700 0.7rem/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ticket .hc-caption { margin-top: 18px; }
.tk-route { display: flex; align-items: center; gap: 10px; margin-top: 18px; font: 700 0.62rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tk-route i { position: relative; flex: 1; border-top: 2px dashed rgba(var(--ink-rgb), .2); }
.tk-route b { position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(var(--signal-rgb), .22); animation: travel 3.4s var(--ease-out) infinite; }
@keyframes travel { 0% { left: 0; opacity: 0; } 12%, 84% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; } }
.tk-cut { position: relative; margin: 22px -26px 4px; border-top: 2px dashed rgba(var(--ink-rgb), .14); }
.tk-cut::before, .tk-cut::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--glass-border); }
.tk-cut::before { left: -12px; clip-path: inset(0 0 0 50%); }
.tk-cut::after { right: -12px; clip-path: inset(0 50% 0 0); }
.ticket .hc-grid div { background: var(--soft); }
.tk-code { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.tk-code span { position: relative; flex: 1; height: 30px; border-radius: 3px; overflow: hidden; opacity: .8;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 17px); }
.tk-code span::after { content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--signal); box-shadow: 0 0 12px 2px rgba(var(--signal-rgb), .8); animation: scan 3.2s ease-in-out infinite alternate; }
@keyframes scan { from { left: 0; } to { left: calc(100% - 3px); } }
.tk-code small { flex: none; font: 700 0.6rem/1.2 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* ---------- Cifras que giran como un panel de salidas ---------- */
.fl-row { display: inline-flex; white-space: nowrap; }
.fl { display: inline-block; font-variant-numeric: tabular-nums; transform-origin: 50% 55%; white-space: pre; }
.fl.go { animation: flapTurn .1s linear; }
@keyframes flapTurn { 50% { transform: scaleY(.15); opacity: .55; } }

/* ---------- Cinta que pasa sola ---------- */
.tapes { position: relative; z-index: 2; margin: 6px 0 clamp(44px, 8vh, 80px); overflow: hidden; padding: 26px 0; }
.tapes::before { content: ""; position: absolute; left: -5%; right: -5%; top: 50%; height: 46px; margin-top: -23px; transform: rotate(2.2deg); background: rgba(var(--accent-rgb), .12); border-block: 1px solid rgba(var(--accent-rgb), .25); }
.tape { position: relative; width: 110%; margin-left: -5%; transform: rotate(-1.6deg); background: var(--signal); color: var(--on-signal); padding: 13px 0; box-shadow: 0 18px 40px -22px rgba(var(--signal-rgb), .8); }
.tape-track { display: flex; width: max-content; animation: tapeRun 42s linear infinite; }
.tape ul { display: flex; list-style: none; margin: 0; padding: 0; }
.tape li { display: flex; align-items: center; gap: 22px; padding-right: 22px; font: 800 0.95rem/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tape li::after { content: "✦"; font-size: .8em; }
.tapes:hover .tape-track { animation-play-state: paused; }
@keyframes tapeRun { to { transform: translateX(-50%); } }

/* ---------- Panel del mes: la cifra principal sobre lima ---------- */
.kpi.kpi-hero { position: relative; overflow: hidden; background: var(--signal); color: var(--on-signal); border-color: transparent; box-shadow: 0 24px 50px -28px rgba(var(--signal-rgb), .9); }
.kpi.kpi-hero::after { content: ""; position: absolute; right: -50px; bottom: -70px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid rgba(11, 26, 20, .06); pointer-events: none; }
.kpi-hero .kpi-label, .kpi-hero .kpi-note, .kpi-hero .ring-pct small { color: var(--on-signal-soft); }
.kpi-hero .kpi-big { color: var(--on-signal); }
.kpi-hero .kpi-big.neg { color: #a8231a; }
.kpi-hero .ring-track { stroke: rgba(11, 26, 20, .14); }
.kpi-hero .ring-fill { stroke: var(--on-signal); }
.kpi-hero .ring-fill.warn { stroke: #8a5200; }
.kpi-hero .ring-fill.over { stroke: #a8231a; }
.kpi-label { text-transform: uppercase; letter-spacing: .08em; font-size: 0.72rem; }
.tx-ico { background: rgba(var(--accent-rgb), .12); }
.bars .b-track { border-radius: 99px; }
.bars .b-fill { border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.hc-bar span { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* Campos con el foco en el color de acento */
.filters input:focus, .filters select:focus, .modal input:focus, .modal select:focus, .pv-input input:focus { outline-color: rgba(var(--accent-rgb), .55); }
:root[data-theme="dark"] .pill-select option, :root[data-theme="dark"] select option { background: #12221c; }

/* Calendario: en oscuro el lima tiñe menos para que se lean las cifras */
:root[data-theme="dark"] .cal-day.has { background: linear-gradient(rgba(var(--accent-rgb), calc(var(--heat) * .55)), rgba(var(--accent-rgb), calc(var(--heat) * .55))), var(--soft); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { color: #1a0d0a; }

/* ---------- Previsión: el resultado también sobre lima ---------- */
.pv-result { background: var(--signal); color: var(--on-signal); }
.pv-result #pvLeftLabel, .pv-result .pv-note { color: var(--on-signal-soft); }
.pv-result .pv-left { color: var(--on-signal); }
.pv-result .hc-bar { background: rgba(11, 26, 20, .14); }
.pv-result .hc-bar span:not(.warn):not(.over) { background: var(--on-signal); }
.pv-result.neg { background: rgba(255, 123, 99, .14); color: var(--ink); }
.pv-result.neg #pvLeftLabel, .pv-result.neg .pv-note { color: var(--ink-soft); }
.pv-result.neg .hc-bar { background: rgba(var(--ink-rgb), .1); }

/* ---------- Detalles ---------- */
.toast { background: var(--signal); color: var(--on-signal); font-weight: 700; box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .6); }
.splash-bar i { background: linear-gradient(90deg, var(--signal), var(--accent-2)); }
.version-badge, .chip { background: rgba(var(--accent-rgb), .12); }
@media (max-width: 700px) {
  .tabbar .tab-add { background: var(--signal); color: var(--on-signal); box-shadow: 0 14px 28px -10px rgba(var(--signal-rgb), .8), 0 0 0 5px var(--bg); }
}
.timeline::before { background: linear-gradient(var(--accent-2), rgba(var(--accent-rgb), .08)); }
.tl-item:first-child::before { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .18); }

/* Pie con el nombre en grande, que se desvanece hacia abajo */
.footer { overflow: hidden; }
.footer::after {
  content: "Holgura"; display: block; max-width: var(--max); margin: 34px auto -0.2em;
  font: 800 clamp(4.5rem, 17vw, 14rem)/.85 var(--f-display); letter-spacing: -.065em; text-align: center;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), .34), rgba(var(--accent-rgb), 0) 88%);
  -webkit-background-clip: text; background-clip: text; color: transparent; pointer-events: none; user-select: none;
}

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  /* En una columna, la esfera asoma por detrás de la esquina del tique */
  .hero-orb { top: auto; right: 4%; bottom: 360px; width: 120px; }
}
@media (max-width: 560px) {
  .hero-orb { width: 96px; right: 0; bottom: 350px; }
  .tape li { font-size: 0.82rem; gap: 16px; padding-right: 16px; }
  .tapes { padding: 20px 0; margin-bottom: 36px; }
  .ticket { padding: 20px 18px 16px; }
  .tk-cut { margin-left: -18px; margin-right: -18px; }
}

/* Avisos de varias líneas: rectángulo redondeado en vez de píldora */
.toast { border-radius: 16px; text-align: center; }
/* Previsión en el móvil: el mes cabe en una línea */
@media (max-width: 560px) {
  .pv-when .month-btn { padding: 5px 8px; gap: 6px; white-space: nowrap; font-size: 0.95rem; }
  .pv-bar { gap: 6px; }
}

/* Sin animaciones si el sistema lo pide */
@media (prefers-reduced-motion: reduce) {
  .tape-track, .hero-orb, .hero-orb i, .tk-route b, .tk-code span::after, .eyebrow::before, .float, .js .hero-in-card { animation: none !important; }
  .js .hero-in, .js .hero-in-card { opacity: 1; }
  .js .hero h1 em, .js .page-title em { animation: none; background-size: 100% .16em; }
}

/* ==========================================================================
   Versiones por etapas (v0.30.0)
   ========================================================================== */
.ver-summary { padding: 22px 24px; margin: 0 0 40px; display: grid; gap: 18px; }
.ver-stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 28px; }
.ver-stat { display: grid; gap: 2px; }
.ver-stat strong { font: 800 2.2rem/1 var(--f-display); letter-spacing: -0.04em; color: var(--ink); }
.ver-stat:first-child strong { color: var(--accent); }
.ver-stat span { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.ver-since { margin: 0 0 0 auto; font-size: 0.85rem; color: var(--muted); align-self: flex-end; }
.ver-index { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px dashed var(--line); }
.ver-jump { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--ink-soft); font-weight: 650; font-size: 0.86rem; text-decoration: none; transition: border-color .2s, color .2s, transform .2s; }
.ver-jump b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(var(--accent-rgb), .14); color: var(--accent); font-size: 0.75rem; }
.ver-jump small { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
.ver-jump:hover { border-color: rgba(var(--accent-rgb), .5); color: var(--accent); transform: translateY(-1px); }

.tl-stage { position: relative; padding: 8px 0 18px 44px; scroll-margin-top: 96px; }
.tl-stage:not(:first-child) { margin-top: 34px; }
.tl-stage::before { content: ""; position: absolute; left: 0; top: 12px; width: 24px; height: 24px; border-radius: 8px; background: var(--accent); transform: rotate(45deg) scale(.78); box-shadow: 0 0 0 6px var(--bg); }
.tl-stage-kicker { margin: 0 0 4px; font-size: 0.74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.tl-stage h2 { margin: 0 0 6px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -0.04em; }
.tl-stage p:last-child { margin: 0; max-width: 40rem; color: var(--ink-soft); }

.timeline .tl-item::before { background: var(--bg); box-shadow: none; }
.timeline .tl-current::before { background: var(--accent-2); box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .18); }
.tl-head h3 { margin: 0; font-size: 1.4rem; font-weight: 750; letter-spacing: -0.03em; }
.tl-now { background: var(--accent); color: var(--bg); }
.tl-patch { margin-bottom: 14px; }
.tl-patch::before { width: 10px; height: 10px; left: 7px; top: 20px; border-width: 2px; }
.tl-patch .tl-card { padding: 12px 18px; background: transparent; box-shadow: none; border-style: dashed; }
.tl-patch .tl-head { margin-bottom: 4px; }
.tl-patch .tl-head h3 { font-size: 1.05rem; }
.tl-patch .tl-card ul { font-size: 0.92rem; }

@media (max-width: 560px) {
  .ver-summary { padding: 18px; }
  .ver-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .ver-stat strong { font-size: 1.8rem; }
  .ver-since { margin: 0; grid-column: 1 / -1; }
  .ver-jump { font-size: 0.82rem; }
  .tl-stage { padding-left: 38px; }
  .tl-item { padding-left: 34px; }
}

/* ==========================================================================
   Intro nueva (v0.31.0): el logo late y la pantalla se abre por una ventana
   con la forma del logo, que gira y crece desde él hasta descubrir la página.
   El fondo de la intro es la sombra enorme de ese hueco.
   ========================================================================== */
.js .splash {
  --sp-io: cubic-bezier(.77, 0, .18, 1);
  background: none; clip-path: none; overflow: hidden;
  transition: opacity .35s ease 1.1s, visibility 0s linear 1.45s;
  animation: splashGone .5s ease 4s forwards; /* red de seguridad si el JS no llega */
}
.js .splash.is-done { clip-path: none; opacity: 0; visibility: hidden; pointer-events: none; }
.splash-hole {
  position: absolute; left: var(--hx, 50%); top: var(--hy, 50%); width: 0; height: 0; border-radius: 30%;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent, 0 0 0 170vmax var(--bg), inset 0 0 0 0 transparent;
  transition: width 1.3s var(--sp-io), height 1.3s var(--sp-io), transform 1.3s var(--sp-io), box-shadow .35s ease;
}
.splash.is-done .splash-hole {
  width: 140vmax; height: 140vmax; transform: translate(-50%, -50%) rotate(0deg);
  box-shadow: 0 0 0 2px var(--accent), 0 0 48px 10px rgba(var(--accent-rgb), .32), 0 0 0 170vmax var(--bg), inset 0 0 44px 4px rgba(var(--accent-rgb), .24);
}
.splash-in { position: relative; z-index: 1; gap: 16px; }
.splash.is-done .splash-in { opacity: 0; transform: scale(.86); transition: opacity .35s ease, transform .8s var(--sp-io); }
/* El logo late: ondas con la forma de su baldosa */
.splash-mark { position: relative; display: grid; place-items: center; width: 84px; height: 84px; }
.splash-mark::before { content: ""; position: absolute; inset: -28px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb), .16) 0%, transparent 68%); pointer-events: none; }
.splash-mark::after, .splash-mark i { content: ""; position: absolute; inset: 5px; border-radius: 30%; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; animation: splashRipple 2s .55s var(--ease-out) infinite; }
.splash-mark i { animation-delay: 1.55s; }
.splash-mark img { position: relative; filter: none; }
/* El nombre, con un brillo que lo recorre una vez y un cursor que parpadea */
.splash-name { display: inline-flex; align-items: baseline; font: 800 26px/1 var(--f-display); letter-spacing: -0.04em; text-transform: none; margin-right: 0; }
.splash-name .nm {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 38%, var(--accent) 50%, var(--ink) 62%, var(--ink) 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: splashShine 1.5s .35s var(--sp-io) forwards;
}
.splash-name .caret { display: inline-block; width: .42em; height: .42em; margin-left: .08em; border-radius: 2px; background: var(--accent); animation: caretBlink 1s steps(1) infinite; }
.splash-bar { width: 120px; }
.splash-bar i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
@keyframes splashGone { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes splashRipple { 0% { opacity: .75; transform: scale(1); } 100% { opacity: 0; transform: scale(1.85); } }
@keyframes splashShine { to { background-position: 0 0; } }
@keyframes caretBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .splash-mark::after, .splash-mark i, .splash-name .caret { animation: none; }
  .splash-name .nm { animation: none; background: none; color: var(--ink); }
  .splash-hole { transition: none; }
  .js .splash { transition: opacity .3s ease, visibility 0s linear .3s; }
}

/* ---------- Cuentas (v0.32.0) ---------- */
/* Página de entrar */
.page-entrar .page.entrar { width: min(1120px, calc(100% - 2 * var(--gutter))); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.entrar-copy .page-lead { margin-bottom: 24px; }
.entrar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.entrar-list li { position: relative; padding-left: 30px; color: var(--ink-soft); font-weight: 600; }
.entrar-list li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 18px; height: 18px; border-radius: 50%; background: rgba(var(--accent-rgb), .14); }
.entrar-list li::after { content: ""; position: absolute; left: 3px; top: calc(0.2em + 3px); width: 12px; height: 12px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.entrar-card { padding: clamp(22px, 3.4vw, 34px); display: grid; gap: 16px; }
.entrar-tabs { margin: 0; }
.entrar-tabs[hidden] { display: none; }
.entrar-tabs button[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); box-shadow: 0 6px 14px -8px rgba(var(--signal-rgb), .8); }
.entrar-form { display: grid; gap: 14px; }
.entrar-form[hidden] { display: none; }
.entrar-form h2 { margin: 0; font: 750 1.5rem/1.15 var(--f-display); letter-spacing: -0.03em; }
.entrar-form p { margin: 0; }
.entrar-form .btn { width: 100%; }
.entrar-form .link-btn { justify-self: center; }
.entrar-card label, .acct-dlg label { display: grid; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); }
.entrar-card label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; line-height: 1.45; }
.entrar-card label.check input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.entrar-card input:not([type="checkbox"]) { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 1rem; min-height: 46px; }
.entrar-card input:focus, .acct-dlg input:focus { outline: 2px solid rgba(var(--accent-rgb), .55); outline-offset: 0; border-color: transparent; }
.entrar-aviso { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--ink); font-weight: 600; font-size: 0.9rem; line-height: 1.45; }
.entrar-aviso[hidden] { display: none; }
.entrar-aviso.ok { background: rgba(var(--accent-rgb), .14); }
.entrar-aviso.bad { background: rgba(194, 73, 47, .12); color: var(--danger); }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
@media (max-width: 900px) {
  .page-entrar .page.entrar { grid-template-columns: 1fr; gap: 22px; padding-top: 28px; }
  .entrar-copy .page-title { font-size: clamp(2rem, 8.6vw, 3rem); margin-bottom: 0; }
  .entrar-copy .eyebrow { margin-bottom: 10px; }
  .entrar-copy .page-lead, .entrar-list { display: none; }
}

/* Botón y menú de cuenta en la cabecera */
.acct-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .12); color: var(--ink); font: 800 0.95rem/1 var(--f-display); cursor: pointer; transition: background .2s, transform .2s; }
.acct-btn:hover, .acct-wrap.open .acct-btn { background: rgba(var(--accent-rgb), .22); transform: translateY(-1px); }
.acct-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); background: var(--accent); opacity: 0; transition: opacity .2s, background .2s; }
html[data-sync="pendiente"] .acct-dot { opacity: 1; background: var(--gold); }
html[data-sync="offline"] .acct-dot, html[data-sync="error"] .acct-dot { opacity: 1; background: var(--danger); }
.acct-menu { min-width: 230px; }
.acct-head { display: grid; gap: 2px; margin: 0 0 4px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
.acct-head small { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.acct-head strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.acct-sync { margin-top: 4px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.acct-menu .lang-item svg { color: var(--muted); }

/* Ventana «Tu cuenta» */
.acct-dlg .acct-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.acct-dlg .acct-mail strong { overflow-wrap: anywhere; }
.acct-dlg .acct-mail .chip { max-width: none; }
.acct-dlg p { margin: 0; }
.acct-sec { border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.acct-sec summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.acct-sec[open] summary { padding-bottom: 6px; }
.acct-sec-in { display: grid; gap: 12px; padding-bottom: 14px; }
.acct-sec-in .btn { justify-self: start; }
.acct-dlg input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 0.92rem; }
.acct-msg { font-weight: 600; color: var(--ink); }
.acct-msg:empty { display: none; }
.acct-msg.bad { color: var(--danger); }
@media (max-width: 700px) { .acct-dlg input { font-size: 16px; min-height: 46px; } }

/* ---------- Presentación en la página de entrar (v1.0.0) ---------- */
.ld-down { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; font-weight: 700; font-size: 0.92rem; color: var(--accent); text-decoration: none; }
.ld-down svg { animation: ldBob 1.8s ease-in-out infinite; }
@keyframes ldBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .ld-down svg { animation: none; } }
.landing { width: min(1120px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: clamp(40px, 8vh, 90px) 0 20px; display: grid; gap: clamp(72px, 12vh, 130px); }
.landing section[id], .page.entrar { scroll-margin-top: 100px; }
.ld-h2 { margin: 0 0 18px; font: 750 clamp(1.9rem, 4vw, 3rem)/1.05 var(--f-display); letter-spacing: -0.045em; max-width: 22ch; }
.ld-h2 em { font-family: var(--f-accent); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -0.01em; }
.ld-lead { margin: 0; font-size: 1.08rem; line-height: 1.65; color: var(--ink-soft); max-width: 36rem; }

/* Intro con dos móviles */
.ld-intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.ld-stats { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ld-stats li { display: grid; gap: 4px; padding: 14px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--soft-faint); }
.ld-stats b { font: 800 1.7rem/1 var(--f-display); letter-spacing: -0.04em; color: var(--accent); }
.ld-stats span { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); line-height: 1.3; }
.ld-phones { position: relative; height: clamp(440px, 52vw, 600px); }
.phone { position: absolute; margin: 0; width: clamp(200px, 21vw, 270px); aspect-ratio: 600 / 1022; padding: 9px; border-radius: 40px; background: #050c0a; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), inset 0 0 0 2px rgba(255, 255, 255, .04); }
.phone img { display: block; width: 100%; height: 100%; border-radius: 32px; object-fit: cover; object-position: top; }
.phone::before { content: ""; position: absolute; z-index: 1; top: 17px; left: 50%; width: 30%; height: 18px; transform: translateX(-50%); border-radius: 99px; background: #050c0a; }
.phone-front { right: 4%; top: 0; transform: rotate(4deg); }
.phone-back { left: 4%; bottom: 0; transform: rotate(-7deg); opacity: .9; }

/* Funciones con capturas */
.ld-features { display: grid; gap: clamp(64px, 10vh, 110px); }
.feat { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.feat-flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
.feat-flip .feat-copy { order: 2; }
.feat-wide { grid-template-columns: 1fr; gap: 26px; }
.feat-wide .feat-copy { max-width: 40rem; }
.feat-num { display: inline-block; margin-bottom: 12px; font: 700 0.8rem/1 var(--f-body); letter-spacing: .16em; color: var(--accent); }
.feat h3 { margin: 0 0 12px; font: 750 clamp(1.45rem, 2.6vw, 2rem)/1.12 var(--f-display); letter-spacing: -0.035em; }
.feat-copy p { margin: 0; color: var(--ink-soft); line-height: 1.65; font-size: 1.02rem; }
.feat-tags { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feat-tags li { padding: 6px 12px; border-radius: 999px; background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: 0.8rem; font-weight: 700; }
.shot { margin: 0; overflow: hidden; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .1); background: #0a1512; box-shadow: 0 34px 70px -34px rgba(0, 0, 0, .65); transition: transform .5s var(--ease-out); }
.shot:hover { transform: translateY(-4px); }
.shot img { display: block; width: 100%; height: auto; }
.shot-tall img { max-height: 620px; object-fit: cover; object-position: top; }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #101d19; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.shot-bar i:first-child { background: #ff6b5a; } .shot-bar i:nth-child(2) { background: #f2b84b; } .shot-bar i:nth-child(3) { background: #8fd14f; }
.shot-bar span { flex: 1; margin: 0 40px 0 14px; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .06); color: rgba(238, 243, 236, .6); font: 600 0.72rem/1.2 var(--f-body); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Y además, pasos, preguntas */
.ld-grid { margin-top: 26px; }
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: none; }
.steps li { padding: 24px; border-radius: 22px; }
.steps h3 { margin: 14px 0 8px; font: 700 1.15rem/1.25 var(--f-display); letter-spacing: -0.02em; }
.steps p { margin: 0; color: var(--ink-soft); line-height: 1.55; font-size: 0.95rem; }
.step-n { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--signal); color: var(--on-signal); font: 800 1.15rem/1 var(--f-display); }
.faq { display: grid; gap: 10px; max-width: 820px; margin-top: 22px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--soft-faint); padding: 0 20px; transition: background .2s, border-color .2s; }
.faq details[open] { background: var(--soft); border-color: rgba(var(--accent-rgb), .3); }
.faq summary { position: relative; padding: 18px 34px 18px 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font: 400 1.5rem/1 var(--f-body); color: var(--accent); transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.6; }
.faq a { color: var(--accent); }
.ld-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(28px, 5vw, 48px); border-radius: 28px; }
.ld-cta h2 { margin: 0 0 8px; font: 750 clamp(1.6rem, 3.4vw, 2.4rem)/1.1 var(--f-display); letter-spacing: -0.04em; }
.ld-cta h2 em { font-family: var(--f-accent); font-style: italic; font-weight: 400; color: var(--accent); }
.ld-cta p { margin: 0; color: var(--ink-soft); }

@media (max-width: 900px) {
  .ld-intro, .feat, .feat-flip { grid-template-columns: 1fr; }
  .feat-flip .feat-copy { order: 0; }
  .ld-phones { height: auto; display: flex; justify-content: center; gap: 0; padding: 10px 0 20px; }
  .phone { position: relative; width: min(46vw, 230px); }
  .phone-front { right: auto; top: auto; transform: rotate(3deg); margin-left: -28px; }
  .phone-back { left: auto; bottom: auto; transform: rotate(-5deg) translateY(26px); }
  .steps { grid-template-columns: 1fr; }
  .shot-tall img { max-height: 520px; }
}
@media (max-width: 560px) {
  .ld-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone { padding: 6px; border-radius: 30px; }
  .phone img { border-radius: 25px; }
  .phone::before { top: 12px; height: 13px; }
  .shot { border-radius: 14px; }
  .shot-bar span { margin-right: 0; }
  .ld-cta .btn { width: 100%; }
}

/* En el móvil, las capturas son recortes de cada sección tal como se ve en el móvil */
@media (max-width: 700px) {
  .shot { border-radius: 18px; background: var(--bg); }
  .shot-bar { display: none; }
  .shot img, .shot-tall img { max-height: none; -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
  .shot:hover { transform: none; }
  .ld-features > .feat:first-of-type .shot img { -webkit-mask-image: none; mask-image: none; }
}

/* Contraseñas: ojo para verla y requisitos que se marcan al escribir (v1.0.2) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px !important; }
.pw-ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.pw-ver:hover, .pw-ver[aria-pressed="true"] { color: var(--accent); background: var(--soft); }
.pw-reglas { list-style: none; margin: -2px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.pw-reglas li { position: relative; padding-left: 22px; transition: color .2s; }
.pw-reglas li::before { content: ""; position: absolute; left: 0; top: 0.12em; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .7; transition: background .2s, border-color .2s; }
.pw-reglas li.ok { color: var(--accent); }
.pw-reglas li.ok::before { opacity: 1; border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230b1a14' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 10px; }
:root:not([data-theme="dark"]) .pw-reglas li.ok::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (max-width: 380px) { .pw-reglas { grid-template-columns: 1fr; } }
.pw-reglas li[data-regla="igual"] { grid-column: 1 / -1; }

/* Entrar con Google (v1.1.0) */
.oauth { display: grid; gap: 12px; }
.oauth[hidden] { display: none; }
.btn-google { width: 100%; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; box-shadow: none; }
.btn-google:hover { background: #f6f8f7; transform: translateY(-1px); }
.btn-google:disabled { opacity: .7; cursor: progress; }
.oauth-nota { margin: -4px 0 0; text-align: center; }
.oauth-nota a { color: var(--accent); }
.oauth-sep { display: flex; align-items: center; gap: 12px; margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.oauth-sep::before, .oauth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kpi-pend { margin-top: 6px; font-weight: 600; }
.kpi-pend[hidden] { display: none; }

/* Porcentaje de carga encima de la barra de la intro (v1.3.1) */
.splash-pct { display: flex; align-items: baseline; gap: 2px; margin: 6px 0 -10px; font-variant-numeric: tabular-nums; color: var(--ink); animation: splashLogo .9s var(--ease-out) .2s both; }
.splash-pct b { min-width: 3ch; font: 700 15px/1 var(--f-body); letter-spacing: .02em; text-align: right; }
.splash-pct small { font: 700 10px/1 var(--f-body); color: var(--accent); }
