/* Expensas Demo — diseño
   Tipografía: la de apple.com (SF Pro Display para títulos, SF Pro Text para texto; respaldo Helvetica Neue, Helvetica, Arial).
   Paleta: grises de Apple + verde roble y oro tomados del logo del barrio. */

:root {
  color-scheme: light dark;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* paleta base (imagen Art Deco del usuario) */
  --deco-verde: #2f4f3a;
  --deco-musgo: #5f7a5a;
  --deco-oro: #c6b06a;
  --deco-crema: #f6f0dc;
  --deco-negro: #1a1c1a;

  /* lienzo y superficies: crema en claro, casi negro en oscuro */
  --bg: light-dark(#f6f0dc, #1a1c1a);
  --surface: light-dark(#fcf9ee, #232623);
  --surface-2: light-dark(#f9f4e3, #1e201e);
  --surface-3: light-dark(#ece5cb, #2e322d);
  --ink: light-dark(#1a1c1a, #f6f0dc);
  --ink-2: light-dark(#3b3f39, #d9d3bd);
  --muted: light-dark(#64685e, #aaa690);
  --faint: light-dark(#8b8e80, #84826f);
  --line: light-dark(#d8d0b2, #3b3e38);
  --line-2: light-dark(#e6dfc6, #2b2e29);

  /* marca: verde profundo + musgo + dorado */
  --brand: light-dark(#2f4f3a, #8db087);
  --brand-2: light-dark(#4a6a4b, #a9c7a3);
  --brand-ink: light-dark(#f6f0dc, #1a1c1a);
  --brand-soft: light-dark(#e6ead4, #25302a);
  --moss: light-dark(#5f7a5a, #8aa985);
  --moss-soft: light-dark(#e9edd8, #252d26);
  --gold: light-dark(#7a6528, #c6b06a);
  --gold-2: #c6b06a;
  --gold-soft: light-dark(#f2e8c2, #2d2916);
  --link: light-dark(#2f4f3a, #a9c7a3);

  /* estados: verdes y dorados de la paleta; el rojo se mantiene solo para lo que requiere atención */
  --ok: light-dark(#2f6a3c, #86c892);
  --ok-soft: light-dark(#e0ebd3, #1f2f23);
  --warn: light-dark(#85600d, #d9b35a);
  --warn-soft: light-dark(#f4e8c0, #31290f);
  --bad: light-dark(#a8301f, #ff8272);
  --bad-soft: light-dark(#f6dcd2, #3a1d18);
  --info: light-dark(#4d6b52, #a9c7a3);
  --info-soft: light-dark(#e6ead4, #24302a);

  /* gráficos: todo dentro de la paleta; el terracota se reserva para deuda */
  --c1: light-dark(#2f4f3a, #7fa77a);
  --c2: #c6b06a;
  --c3: light-dark(#5f7a5a, #9bbb95);
  --c4: light-dark(#8a7434, #e0cf8f);
  --c5: light-dark(#86a27e, #5f7a5a);
  --c6: light-dark(#b5533c, #e0866f);
  --c7: light-dark(#a8a06a, #a8a06a);
  --c8: light-dark(#4a6a4b, #c3d9be);
  --c9: light-dark(#7b7f70, #9a9d8e);

  --rail-bg: light-dark(#2f4f3a, #1f3126);
  --rail-ink: #f6f0dc;
  --rail-muted: rgb(246 240 220 / .66);
  --rail-line: rgb(246 240 220 / .14);
  --rail-active: light-dark(#4a6a4b, #2f4a38);

  --radius: 18px;
  --radius-sm: 12px;
  /* sombra de todas las tarjetas (la de la ficha del resumen): cae hacia abajo, verde y suave, con un filo de luz arriba */
  --shadow: 0 16px 26px -18px light-dark(rgb(47 79 58 / .6), rgb(0 0 0 / .7)), inset 0 1px 0 light-dark(#ffffff, rgb(255 255 255 / .06));
  --ease: cubic-bezier(.25, .1, .25, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: linear(0, .25 8%, .64 17%, .95 27%, 1.06 37%, 1.07 44%, 1.02 57%, .995 72%, 1);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: 15px; line-height: 1.47; letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-variant-numeric: tabular-nums;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--link) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in oklab, var(--gold-2) 45%, transparent); }
h1, h2, h3, .display { font-family: var(--font-display); margin: 0; }
small { font-size: inherit; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .55s var(--spring); }
.rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 18px;
  background: var(--rail-bg); color: var(--rail-ink); border-right: 1px solid rgb(0 0 0 / .25); overflow-y: auto; overflow-x: hidden; box-shadow: 10px 0 34px -22px rgb(0 0 0 / .55); z-index: 5;
  transition: padding .45s var(--spring);
  scrollbar-width: thin; scrollbar-color: rgb(246 240 220 / .22) transparent;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; border-bottom: 1px solid var(--rail-line); }
.brand-logo { width: 54px; height: 54px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px var(--gold-2), 0 8px 18px -8px rgb(0 0 0 / .6); transition: transform .6s var(--spring); }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.05); }
.brand b { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; color: var(--deco-crema); }
.brand small { display: block; color: var(--rail-muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sec { font-size: 12px; color: #d8c789; font-weight: 500; padding: 14px 10px 4px; letter-spacing: .02em; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px; color: var(--rail-ink); text-decoration: none;
  font-size: 14.5px; font-weight: 500; transition: background .2s var(--ease), color .2s var(--ease);
}
.nav a:hover { background: rgb(246 240 220 / .08); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--rail-active); color: var(--deco-crema); box-shadow: inset 0 0 0 .5px rgb(246 240 220 / .16); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold-2); }
.nav a[aria-current="page"] .lbl { font-weight: 600; }
.tile { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--ti, #f6f0dc);
  background: linear-gradient(180deg, color-mix(in oklab, var(--t) 82%, #fff), var(--t)); box-shadow: inset 0 0 0 .5px rgb(246 240 220 / .35), 0 1px 3px rgb(0 0 0 / .35); }
.tile svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav .count, .mn-grid .count, .mn-n { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff6ee; background: #b5382a; }
.nav .count[hidden], .mn-n[hidden] { display: none; }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.rail-foot .priv { font-size: 12.5px; color: var(--rail-muted); line-height: 1.45; padding: 12px; border-radius: 12px; background: rgb(0 0 0 / .18); border: 1px solid var(--rail-line); display: flex; gap: 9px; }
.rail-foot .priv svg { width: 16px; height: 16px; flex: none; stroke: var(--gold-2); fill: none; stroke-width: 1.8; margin-top: 1px; }
.rail-foot .btn { color: var(--rail-ink); border-color: var(--rail-line); background: transparent; }
.rail-foot .btn:hover { background: rgb(246 240 220 / .09); }

.main { padding: 14px clamp(16px, 3.2vw, 48px) 96px; min-width: 0; max-width: 1480px; }
.topbar { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; position: sticky; top: 0; z-index: 20; padding: 10px 0; background: color-mix(in oklab, var(--bg) 84%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); }
.segmented { position: relative; display: flex; gap: 8px; padding: 2px 2px 8px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.mcard {
  position: relative; flex: none; min-width: 116px; padding: 9px 13px 11px; border-radius: 12px; cursor: pointer; text-align: left; line-height: 1.25;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); display: grid; gap: 1px;
  transition: transform .35s var(--spring), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
}
.mcard b { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.mcard .mm { font-size: 12.5px; color: var(--muted); transition: color .25s var(--ease); }
.mcard .mbar { display: block; height: 4px; border-radius: 4px; margin-top: 7px; background: color-mix(in oklab, var(--brand) 14%, var(--surface-3)); overflow: hidden; }
.mcard .mbar i { display: block; height: 100%; width: var(--w); border-radius: 4px; background: var(--c1); transform-origin: left; transition: background .25s var(--ease); }
.mcard.entra { animation: mrise .6s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
.mcard.entra .mbar i { animation: growx .9s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 55ms + 160ms); }
@keyframes mrise { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.mcard:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--brand) 40%, var(--line-2)); box-shadow: 0 10px 22px -14px rgb(47 79 58 / .5); }
.mcard:active { transform: scale(.97); }
.mcard[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 12px 24px -12px rgb(47 79 58 / .65); transform: translateY(-1px); }
.mcard[aria-pressed="true"] b { color: var(--brand-ink); }
.mcard[aria-pressed="true"] .mm { color: color-mix(in oklab, var(--brand-ink) 75%, transparent); }
.mcard[aria-pressed="true"] .mbar { background: rgb(255 255 255 / .22); }
.mcard[aria-pressed="true"] .mbar i { background: var(--gold-2); }
:root[data-theme="dark"] .mcard[aria-pressed="true"] .mbar { background: rgb(0 0 0 / .25); }
.top-actions { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border-radius: 980px; border: 1px solid transparent;
  background: var(--surface-3); color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none; transition: background .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: color-mix(in oklab, var(--surface-3) 85%, var(--ink) 9%); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tipografía de página ---------- */
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: clamp(30px, 3.4vw, 40px); font-weight: 600; line-height: 1.1; letter-spacing: 0; }
.page-sub { color: var(--muted); font-size: 17px; line-height: 1.47; letter-spacing: -0.022em; margin: 8px 0 0; max-width: 70ch; }
.section { margin-top: 40px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 21px; font-weight: 600; letter-spacing: .011em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 80ch; }
.mut { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- notas aclaratorias ---------- */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.note > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: var(--info); stroke-width: 1.8; stroke-linecap: round; }
.note b { color: var(--ink); font-weight: 600; }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.note li + li { margin-top: 3px; }
.note.gold { background: var(--gold-soft); } .note.gold > svg { stroke: var(--gold); }
.note.warn { background: var(--warn-soft); } .note.warn > svg { stroke: var(--warn); }
.note.ok { background: var(--ok-soft); } .note.ok > svg { stroke: var(--ok); }
.ihelp { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10.5px; font-weight: 700; font-style: normal; color: var(--muted); border: 1.2px solid var(--line); cursor: help; margin-left: 6px; flex: none; }

/* ---------- grillas y tarjetas ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: stretch; gap: 24px; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-h span { color: var(--muted); font-size: 12.5px; }
button.card { text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
button.card:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 14px 30px -18px rgb(0 0 0 / .3); }
button.card[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }

/* ---------- KPI ---------- */
.card.t-verde { background: color-mix(in oklab, var(--brand) 7%, var(--surface)); border-color: color-mix(in oklab, var(--brand) 22%, var(--line-2)); }
.card.t-oro { background: color-mix(in oklab, var(--gold-2) 13%, var(--surface)); border-color: color-mix(in oklab, var(--gold-2) 38%, var(--line-2)); }
.card.t-cielo { background: color-mix(in oklab, var(--moss) 11%, var(--surface)); border-color: color-mix(in oklab, var(--moss) 30%, var(--line-2)); }
.card.t-aviso { background: color-mix(in oklab, var(--warn) 8%, var(--surface)); border-color: color-mix(in oklab, var(--warn) 26%, var(--line-2)); }
.card.t-rojo { background: color-mix(in oklab, var(--bad) 6%, var(--surface)); border-color: color-mix(in oklab, var(--bad) 22%, var(--line-2)); }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .lab { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; }
.kpi .val { font-family: var(--font-display); font-size: clamp(22px, 2vw, 28px); font-weight: 600; letter-spacing: -0.012em; line-height: 1.12; white-space: nowrap; }
.cents { font-size: .62em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 980px; width: fit-content; }
.delta.up { color: var(--bad); background: var(--bad-soft); }
.delta.down { color: var(--ok); background: var(--ok-soft); }
.delta.up-good { color: var(--ok); background: var(--ok-soft); }
.delta.down-bad { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--surface-3); }

/* ---------- hero ---------- */
.hero { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 6px 0; }
.hero-kicker { display: flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 600; font-size: 14px; }
.hero-kicker::before { content: ""; width: 26px; height: 1.5px; background: var(--gold-2); border-radius: 2px; }
.hero h1 { font-size: clamp(42px, 5.2vw, 64px); font-weight: 600; letter-spacing: -0.009em; line-height: 1.05; }
.hero .lead { font-size: 19px; line-height: 1.45; color: var(--ink-2); letter-spacing: .005em; max-width: 34em; margin: 0; }
.hero .lead b { color: var(--ink); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 980px; font-size: 12.5px; font-weight: 500; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.alta { background: var(--bad-soft); color: var(--bad); }
.chip.media { background: var(--warn-soft); color: var(--warn); }
.chip.baja { background: var(--info-soft); color: var(--info); }
.chip.info { background: var(--surface-3); color: var(--muted); }
.chip.dato { background: var(--brand-soft); color: var(--brand); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* escena 3D */
.scene-card { padding: 0; overflow: hidden; min-height: 430px; background: radial-gradient(120% 90% at 50% 0%, var(--surface) 30%, var(--surface-2)); }
.scene-title { position: absolute; left: 22px; top: 18px; z-index: 3; pointer-events: none; }
.scene-title b { font-size: 15px; font-weight: 600; display: block; }
.scene-title span { font-size: 12.5px; color: var(--muted); }
.scene-card { --sg: #c6b06a; --sc: light-dark(#2f4f3a, #5fa882); --sa: light-dark(#6b866a, #9dbe9b); --sped: light-dark(#efe6c6, #3b4a41); --sfloor: light-dark(#fffdf5, #1f2a24); --sline: light-dark(#d8d0b2, #34423a); --stxt: light-dark(#6b6f60, #a9b3a6); --sgold: light-dark(#7a6528, #e7d79c); --sgoldl: light-dark(#c6b06a, #e7d79c); }
.scene { position: absolute; inset: 58px 0 46px 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: -3px; }
.scene svg { display: block; width: 100%; height: 100%; }
.scene .sp { position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.scene-legend { position: absolute; left: 22px; bottom: 15px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); z-index: 3; pointer-events: none; }
.scene-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.scene-hint { position: absolute; right: 20px; top: 21px; font-size: 12px; color: var(--faint); z-index: 3; pointer-events: none; }
@media (max-width: 520px) { .scene-hint { display: none; } }

/* ---------- hallazgos ---------- */
.list { display: grid; gap: 10px; }
.finding { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); transition: border-color .2s var(--ease); }
.finding[open] { border-color: var(--line); box-shadow: var(--shadow); }
.finding summary { list-style: none; display: grid; grid-template-columns: 4px minmax(0, 1fr) auto 16px; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.finding summary::-webkit-details-marker { display: none; }
.finding summary:hover { background: var(--surface-2); }
.finding .bar { align-self: stretch; border-radius: 4px; background: var(--faint); }
.finding .bar.alta { background: var(--bad); } .finding .bar.media { background: var(--warn); } .finding .bar.baja { background: var(--info); }
.finding .t { font-weight: 600; line-height: 1.35; font-size: 15px; }
.finding .m { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.finding .amt { font-weight: 600; font-size: 15px; white-space: nowrap; text-align: right; }
.finding .chev { width: 14px; height: 14px; stroke: var(--faint); fill: none; stroke-width: 2; transition: transform .25s var(--ease); }
.finding[open] .chev { transform: rotate(90deg); }
.finding .body { padding: 0 18px 18px 34px; display: grid; gap: 12px; color: var(--ink-2); font-size: 14px; animation: rise .3s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }
.finding .ask { padding: 11px 13px; border-radius: 10px; background: var(--brand-soft); }
.finding .ask b, .finding .ref b { color: var(--ink); }
.finding .ref { font-size: 13px; color: var(--muted); }
.finding .ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line-2); padding-top: 12px; }
.field { padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.finding .ctl input[type=text] { flex: 1; min-width: 200px; }
.check-inline { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; cursor: pointer; }

/* ---------- tablas ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); max-height: 72vh; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--ink); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in oklab, var(--brand) 4%, transparent); }
td.n, th.n { text-align: right; white-space: nowrap; }
tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; position: sticky; bottom: 0; }
tr.exp td { background: var(--surface-2); }
tr.click { cursor: pointer; }
.tag-sf { color: var(--warn); font-weight: 600; font-size: 12.5px; }
.heat { border-radius: 6px; padding: 2px 6px; display: inline-block; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .field { min-width: 170px; padding: 8px 12px; }
.toolbar input[type=search] { min-width: 240px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--font-text); }
.chart .gridl { stroke: var(--line-2); }
.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.3s var(--ease-out) .05s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fade-in { opacity: 0; animation: fade .6s var(--ease) .45s forwards; }
@keyframes fade { to { opacity: 1; } }
.grow-y { transform-origin: bottom; transform-box: fill-box; animation: growy .9s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes growy { from { transform: scaleY(0); } }
.pop { transform-origin: center; transform-box: view-box; animation: pop .8s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.hit { fill: transparent; cursor: crosshair; }
.donut-seg { transition: opacity .2s; }
.donut-wrap:hover .donut-seg { opacity: .5; } .donut-wrap .donut-seg:hover { opacity: 1; }
.legend-c { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.legend-c i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 210px) minmax(60px, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.bar-row:last-child { border-bottom: 0; }
.bar-row .tr { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.bar-row .fl { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform-origin: left; animation: growx .9s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
.bar-row .fl.neg { background: var(--bad); }
.bar-row .fl.gold { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
@keyframes growx { from { transform: scaleX(0); } }
.tip { position: fixed; z-index: 100; pointer-events: none; padding: 10px 12px; border-radius: 12px; background: color-mix(in oklab, var(--surface) 94%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--ink); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; max-width: 320px; box-shadow: 0 16px 36px -14px rgb(0 0 0 / .35); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }

/* ---------- carga ---------- */
.drop { display: block; border: 1.5px dashed var(--line); border-radius: 20px; padding: 42px 24px; text-align: center; background: var(--surface-2); cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop.over { transform: scale(1.01); }
.drop svg { width: 44px; height: 44px; stroke: var(--brand); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop b { display: block; font-family: var(--font-display); font-size: 21px; font-weight: 600; margin: 10px 0 4px; }
.check { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 3px 0; }
.check .ic { width: 16px; flex: none; font-weight: 700; }
.check.ok .ic { color: var(--ok); } .check.no .ic { color: var(--bad); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--brand); transition: width .25s var(--ease); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); }
details.plain > summary { cursor: pointer; color: var(--link); font-size: 13.5px; list-style: none; }
details.plain > summary::-webkit-details-marker { display: none; }
dialog { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); padding: 0; width: min(760px, 94vw); box-shadow: 0 40px 90px -30px rgb(0 0 0 / .5); }
dialog::backdrop { background: rgb(0 0 0 / .4); backdrop-filter: blur(6px); }
dialog[open] { animation: dlg .35s var(--spring); }
@keyframes dlg { from { opacity: 0; transform: scale(.96) translateY(8px); } }
dialog .dh { padding: 20px 22px 6px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
dialog .dh h2 { font-size: 24px; font-weight: 600; }
dialog .db { padding: 8px 22px 22px; display: grid; gap: 12px; max-height: 70vh; overflow: auto; }
dialog textarea { width: 100%; min-height: 260px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; line-height: 1.55; }

/* transición entre secciones */
::view-transition-old(root) { animation: .18s var(--ease) both vt-out; }
::view-transition-new(root) { animation: .32s var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-hero, .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid rgb(0 0 0 / .25); }
  .nav a[aria-current="page"]::before { display: none; }
  .brand { padding: 0 2px 10px; }
  .brand-logo { width: 42px; height: 42px; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .nav-sec { display: none; }
  .nav a { white-space: nowrap; padding: 6px 10px 6px 6px; }
  .rail-foot { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .top-actions { display: none; }
  .scene-card { min-height: 360px; }
  .bar-row { grid-template-columns: minmax(90px, 130px) minmax(40px, 1fr) auto; }
  .finding summary { grid-template-columns: 4px minmax(0, 1fr) 16px; }
  .finding .amt { grid-column: 2; text-align: left; }
  .finding .body { padding-left: 18px; }
  .hero .lead { font-size: 17px; }
  .toolbar input[type=search] { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .prism { --grow: 1; }
}
@media print {
  .rail, .topbar, .scene-card, .no-print { display: none !important; }
  .app { display: block; } body { background: #fff; color: #1a1c1a; }
  .card, .finding, .table-wrap { box-shadow: none; break-inside: avoid; }
  .table-wrap { max-height: none; overflow: visible; }
}

/* ---------- barra plegable (riel de íconos) ---------- */
.rail-toggle { display: none; }
.rail .lbl, .brand > div, .rail-foot .btn span { white-space: nowrap; overflow: hidden; max-width: 220px; transition: opacity .28s var(--ease) .18s, max-width .45s var(--spring), transform .35s var(--ease-out) .12s; }
.nav-sec { transition: opacity .25s var(--ease) .15s, padding .4s var(--spring), font-size .3s var(--ease); }
.brand-logo { transition: transform .6s var(--spring), width .5s var(--spring), height .5s var(--spring); }
.tile { transition: transform .35s var(--spring), box-shadow .25s var(--ease); }
.nav a:hover .tile { transform: scale(1.1) rotate(-3deg); }
.rail-foot .priv { transition: opacity .25s var(--ease) .15s, max-height .45s var(--spring), padding .4s var(--spring); max-height: 120px; overflow: hidden; }
@media (min-width: 881px) {
  .rail-toggle {
    display: grid; place-items: center; position: fixed; z-index: 40; top: 34px; left: 251px; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; padding: 0;
    background: var(--rail-bg); border: 1.5px solid var(--gold-2); color: var(--gold-2);
    box-shadow: 0 6px 16px -6px rgb(0 0 0 / .55); transition: left .55s var(--spring), transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  }
  .rail-toggle:hover { background: var(--gold-2); color: var(--deco-verde); transform: scale(1.1); }
  .rail-toggle:active { transform: scale(.94); }
  .rail-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .55s var(--spring); }
  .app[data-rail="min"] { grid-template-columns: 82px minmax(0, 1fr); }
  .app[data-rail="min"] .rail-toggle { left: 68px; }
  .app[data-rail="min"] .rail-toggle svg { transform: rotate(180deg); }
  .app[data-rail="min"] .rail { padding-left: 15px; padding-right: 15px; }
  .app[data-rail="min"] .rail .lbl, .app[data-rail="min"] .brand > div, .app[data-rail="min"] .rail-foot .btn span { opacity: 0; max-width: 0; transform: translateX(-8px); transition-delay: 0s, 0s, 0s; }
  .app[data-rail="min"] .brand { justify-content: center; padding: 4px 0 16px; gap: 0; }
  .app[data-rail="min"] .brand-logo { width: 44px; height: 44px; }
  .app[data-rail="min"] .nav a { justify-content: center; gap: 0; padding: 6px 0; }
  .app[data-rail="min"] .nav a[aria-current="page"]::before { left: -15px; }
  .app[data-rail="min"] .nav-sec { font-size: 0; opacity: 1; padding: 11px 0 5px; position: relative; }
  .app[data-rail="min"] .nav-sec::after { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 1px; background: var(--rail-line); }
  .app[data-rail="min"] .nav .count { position: absolute; top: 2px; right: 6px; min-width: 0; width: 10px; height: 10px; padding: 0; font-size: 0; border: 2px solid var(--rail-bg); box-sizing: content-box; margin: 0; }
  .app[data-rail="min"] .rail-foot .priv { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; transition-delay: 0s; }
  .app[data-rail="min"] .rail-foot .btn { width: 42px; height: 42px; padding: 0; margin: 0 auto; border-radius: 50%; gap: 0; }
  .app[data-rail="min"] .rail-foot .btn svg { width: 18px; height: 18px; }
}
@media (max-width: 880px) { .brand > div { max-width: none; } }
@media print { .rail-toggle { display: none !important; } }

/* resplandor que sigue al mouse (js/brillo.js guarda la posición en --x); no mueve nada, solo pinta encima */
.btn:hover:not(:disabled), .mcard:hover, .tm:hover, .seg button:hover, button.card:hover { background-image: radial-gradient(130px circle at var(--x, 50%) 50%, rgb(198 176 106 / .5), rgb(198 176 106 / .16) 45%, transparent 72%) !important; }
.btn.primary:hover:not(:disabled), .mcard[aria-pressed="true"]:hover, .tm[aria-pressed="true"]:hover, .rail .nav a:hover, .rail-foot .btn:hover, .rail-toggle:hover { background-image: radial-gradient(130px circle at var(--x, 50%) 50%, rgb(255 246 208 / .55), rgb(198 176 106 / .22) 45%, transparent 72%) !important; }

/* tarjetas de rubros (Gastos): tono propio, ícono redondo con aro y marca de agua */
.rcard { --tc: light-dark(var(--t), color-mix(in srgb, var(--t) 36%, #f6f0dc)); position: relative; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--t) 20%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--t) 30%, var(--line-2)); }
.rcard > .card-h, .rcard > .display, .rcard > div { position: relative; }
.rcard .mk { position: absolute; right: -10px; bottom: -16px; width: 104px; height: 104px; color: var(--tc); opacity: .13; transform: rotate(-12deg); pointer-events: none; }
.rcard .mk svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.rcard .card-h { align-items: center; flex-wrap: nowrap; }
.rcard .rt { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rcard .rt h3 { color: color-mix(in srgb, var(--tc) 62%, var(--ink)); line-height: 1.25; }
.rcard .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--tc); background: color-mix(in srgb, var(--t) 12%, var(--surface)); box-shadow: 0 0 0 1.5px var(--tc), 0 0 0 4px color-mix(in srgb, var(--t) 16%, transparent); }
.rcard .ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rcard[aria-pressed="true"] { border-color: var(--tc); box-shadow: 0 0 0 2px var(--tc), var(--shadow); }
button.rcard:hover { background-image: radial-gradient(130px circle at var(--x, 50%) 50%, rgb(198 176 106 / .35), transparent 72%), linear-gradient(135deg, color-mix(in srgb, var(--t) 20%, var(--surface)), var(--surface) 70%) !important; }
.rcard .card-h > span:last-child { white-space: nowrap; align-self: flex-start; padding-top: 2px; }

/* tarjetas de cifras con ícono (Cobranza): mismo diseño que los rubros */
.kcard .lab { gap: 10px; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--tc) 62%, var(--ink)); }
.kcard .lab .kt { min-width: 0; }
.kcard .lab .ihelp { margin-left: auto; }
.kcard .val, .kcard .sub { position: relative; }
.kcard { overflow: hidden; }

/* Estado financiero (Cobranza): tres tarjetas parejas con encabezado de color y saldo al cierre fijo abajo */
.fin3 { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
@media (min-width: 900px) { .fin3 { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) and (max-width: 1240px) { .fr { padding: 9px 12px; font-size: 12.5px; } .fhd { padding: 0 12px; } .ffoot { padding: 11px 12px; } .ffoot b { font-size: 16px; } }
.fincard { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid color-mix(in srgb, var(--t) 24%, var(--line-2)); box-shadow: var(--shadow); }
.fhd { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; flex: none; height: 64px; padding: 0 16px; color: #fff; font-size: 13px; font-weight: 650; background: linear-gradient(120deg, var(--t), color-mix(in srgb, var(--t) 55%, #000)); }
.fhd .mk { position: absolute; right: -8px; top: -10px; width: 78px; height: 78px; opacity: .16; transform: rotate(-12deg); pointer-events: none; }
.fhd .mk svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.fhd > *:not(.mk) { position: relative; }
.fhd .tt { min-width: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fhd .imp { margin-left: auto; font-weight: 500; font-size: 12.5px; opacity: .85; }
.fhd .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgb(255 255 255 / .18); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 0 0 1.5px rgb(255 255 255 / .55); }
.fhd .ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.frows { flex: 1; display: flex; flex-direction: column; }
.fr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13.5px; border-top: 1px solid var(--line-2); }
.fr:first-child { border-top: 0; }
.fr span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fr.fb { font-weight: 700; }
.fgap { flex: 1; }
.ffoot { flex: none; padding: 13px 16px; border-top: 2px solid var(--t); background: color-mix(in srgb, var(--t) 10%, var(--surface)); color: color-mix(in srgb, var(--t) 70%, #000); color: light-dark(color-mix(in srgb, var(--t) 70%, #000), color-mix(in srgb, var(--t) 30%, #f6f0dc)); }
.ffoot small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.ffoot b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- tira de meses (idea 4): caja flotante con brillo arriba y filo dorado abajo; la pieza verde se desliza al mes elegido ---------- */
.segmented.tira {
  position: relative; display: flex; gap: 4px; padding: 5px; border-radius: 16px; overflow-x: auto; max-width: 100%; scrollbar-width: none;
  width: 50%; min-width: min(100%, 552px); /* hasta la mitad del ancho del contenido; con muchos meses, scroll */
  background: linear-gradient(180deg, #ffffff, #f8f3e0); background: linear-gradient(180deg, light-dark(#ffffff, #2b2e2a), light-dark(#f8f3e0, #222522));
  border: 1px solid #ece4c6; border: 1px solid light-dark(#ece4c6, #363a33);
  box-shadow: 0 20px 34px -18px rgb(47 79 58 / .55), 0 6px 14px -6px rgb(47 79 58 / .22), inset 0 1px 0 #ffffff, inset 0 -2px 0 rgb(198 176 106 / .35); box-shadow: 0 20px 34px -18px rgb(47 79 58 / .55), 0 6px 14px -6px rgb(47 79 58 / .22), inset 0 1px 0 light-dark(#ffffff, rgb(255 255 255 / .07)), inset 0 -2px 0 rgb(198 176 106 / .35);
}
.tira .ind {
  position: absolute; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: 11px; pointer-events: none;
  background: linear-gradient(145deg, var(--brand), color-mix(in oklab, var(--brand) 82%, #ffffff));
  box-shadow: 0 8px 16px -8px var(--brand);
  transition: left .45s var(--spring), width .45s var(--spring);
}
.tira .ind::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 5px; height: 3px; border-radius: 3px; background: var(--gold-2); }
.tira .tm {
  position: relative; z-index: 1; flex: 1 0 64px; display: grid; gap: 1px; justify-items: center; align-content: center; padding: 11px 4px 11px; border: 1px solid #efe8cd; border: 1px solid light-dark(#efe8cd, #3a3e37); border-radius: 11px;
  background: #fffdf5; background: light-dark(#fffdf5, #2f332e); box-shadow: 0 3px 7px -4px rgb(47 79 58 / .35), inset 0 1px 0 light-dark(#ffffff, rgb(255 255 255 / .06));
  color: var(--ink-2); cursor: pointer; line-height: 1.25;
  transition: transform .35s var(--spring), box-shadow .25s var(--ease), color .3s var(--ease), border-color .25s var(--ease);
}
.tira .tm b { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.tira .tm .mm { font-size: 11.5px; color: var(--muted); transition: color .3s var(--ease); }
.tira .tm:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgb(47 79 58 / .55), inset 0 1px 0 #ffffff; box-shadow: 0 10px 22px -14px rgb(47 79 58 / .55), inset 0 1px 0 light-dark(#ffffff, rgb(255 255 255 / .06)); border-color: color-mix(in oklab, var(--brand) 30%, light-dark(#efe8cd, #3a3e37)); color: var(--ink); }
.tira .tm:active { transform: scale(.97); }
.tira .tm[aria-pressed="true"] { color: var(--brand-ink); background: transparent; border-color: transparent; box-shadow: none; }
.tira .tm[aria-pressed="true"] .mm { color: color-mix(in oklab, var(--brand-ink) 78%, transparent); }
.tira .tm[aria-pressed="true"]:hover { transform: none; box-shadow: none; color: var(--brand-ink); }
.tira .tm.entra { animation: mrise .6s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
.topbar { margin-bottom: 24px; }

/* ---------- fondo: velo crema con la foto de la entrada del barrio (idea 1) ---------- */
.main { position: relative; isolation: isolate; }
.main::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 560px; pointer-events: none;
  background: url("../img/intro/entrada.jpg") center 35% / cover no-repeat; opacity: .17; filter: saturate(.75) sepia(.12);
  -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent 100%), linear-gradient(90deg, #000 0, #000 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 35%, transparent 100%), linear-gradient(90deg, #000 0, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
:root[data-theme="dark"] .main::before { opacity: .11; filter: saturate(.7) brightness(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .main::before { opacity: .11; filter: saturate(.7) brightness(.8); } }
/* la barra de meses flota sobre la foto: sin franja de fondo propia */
.topbar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (max-width: 880px) { .main::before { height: 380px; } }
@media print { .main::before { display: none; } }

/* ---------- ficha del resumen (idea 4): franja tricolor, aros de color y accesos alineados ---------- */
.ficha { margin-top: 18px; max-width: 640px; overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.ficha-tri { height: 7px; background: linear-gradient(90deg, #2f4f3a 0 33.3%, #3f7566 33.3% 66.6%, #c58f4a 66.6%); }
.ficha-gr { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); }
.ficha-ce { --tc: light-dark(var(--t), color-mix(in srgb, var(--t) 36%, #f6f0dc)); position: relative; overflow: hidden; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 14px; min-height: 68px; background: linear-gradient(135deg, color-mix(in srgb, var(--t) 20%, var(--surface)), var(--surface) 70%); }
.ficha-mk { position: absolute; right: -10px; bottom: -20px; width: 96px; height: 96px; color: var(--tc); opacity: .13; transform: rotate(-12deg); pointer-events: none; }
.ficha-mk svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.ficha-ce:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ficha-ic { position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--t) 12%, var(--surface)); box-shadow: 0 0 0 1.5px var(--tc), 0 0 0 4px color-mix(in srgb, var(--t) 16%, transparent); }
.ficha-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ficha-tx { position: relative; display: grid; gap: 3px; min-width: 0; }
.ficha-lab { font-size: 12.5px; font-weight: 600; color: color-mix(in srgb, var(--tc) 62%, var(--ink)); line-height: 1.2; }
.ficha-val { font-size: 15.5px; font-weight: 650; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ficha-ac { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.fbtn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border: 0; padding: 0 10px; background-color: transparent; color: var(--brand); font: 600 13.5px var(--font-text); cursor: pointer; transition: background-color .25s var(--ease); }
.fbtn + .fbtn { border-left: 1px solid var(--line-2); }
.fbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fbtn.p { color: var(--brand-ink); background-color: var(--brand); background-image: linear-gradient(120deg, color-mix(in srgb, var(--brand) 92%, #fff), color-mix(in srgb, var(--brand) 82%, #000)); }
.fbtn:hover { background-color: color-mix(in srgb, var(--brand) 8%, transparent); background-image: radial-gradient(130px circle at var(--x, 50%) 50%, rgb(198 176 106 / .45), transparent 72%) !important; }
.fbtn.p:hover { background-image: radial-gradient(130px circle at var(--x, 50%) 50%, rgb(255 246 208 / .45), transparent 72%), linear-gradient(120deg, color-mix(in srgb, var(--brand) 92%, #fff), color-mix(in srgb, var(--brand) 82%, #000)) !important; }
@media (max-width: 520px) { .ficha-gr { grid-template-columns: 1fr; } .ficha-ac { grid-template-columns: 1fr; } .fbtn + .fbtn { border-left: 0; border-top: 1px solid var(--line-2); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.table-wrap:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* pantallas muy angostas (320–420 px): la barra pasa debajo del nombre y el importe para que nada se salga de la pantalla */
@media (max-width: 420px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .bar-row .tr { grid-column: 1 / -1; order: 3; }
  .bar-row > span:last-child { white-space: normal; text-align: right; }
}
/* en pantallas táctiles, los botones chicos y las casillas se pueden tocar sin errar */
@media (pointer: coarse) {
  .btn.small { min-height: 40px; }
  .check-inline { min-height: 40px; }
  .check-inline input[type="checkbox"] { width: 20px; height: 20px; }
  .field, select.field, input.field { font-size: 16px; min-height: 40px; } /* 16 px evita que el iPhone agrande la pantalla al tocar un campo */
  details.plain > summary { display: inline-block; padding: 10px 0; }
}
@media (max-width: 560px) { .toolbar input[type=search] { flex: 1 1 100%; min-width: 100%; } .toolbar select.field { flex: 1 1 100%; } }

/* respaldo para navegadores que todavía no entienden light-dark() (Chrome < 123, Safari < 17.5, Firefox < 120): colores de la versión clara */
@supports not (color: light-dark(red, blue)) {
  :root {
    --bg: #f6f0dc;
    --surface: #fcf9ee;
    --surface-2: #f9f4e3;
    --surface-3: #ece5cb;
    --ink: #1a1c1a;
    --ink-2: #3b3f39;
    --muted: #64685e;
    --faint: #8b8e80;
    --line: #d8d0b2;
    --line-2: #e6dfc6;
    --brand: #2f4f3a;
    --brand-2: #4a6a4b;
    --brand-ink: #f6f0dc;
    --brand-soft: #e6ead4;
    --moss: #5f7a5a;
    --moss-soft: #e9edd8;
    --gold: #7a6528;
    --gold-soft: #f2e8c2;
    --link: #2f4f3a;
    --ok: #2f6a3c;
    --ok-soft: #e0ebd3;
    --warn: #85600d;
    --warn-soft: #f4e8c0;
    --bad: #a8301f;
    --bad-soft: #f6dcd2;
    --info: #4d6b52;
    --info-soft: #e6ead4;
    --c1: #2f4f3a;
    --c3: #5f7a5a;
    --c4: #8a7434;
    --c5: #86a27e;
    --c6: #b5533c;
    --c7: #a8a06a;
    --c8: #4a6a4b;
    --c9: #7b7f70;
    --rail-bg: #2f4f3a;
    --rail-active: #4a6a4b;
  }
}
@supports not (color: light-dark(red, blue)) {
  :root { --shadow: 0 16px 26px -18px rgb(47 79 58 / .6), inset 0 1px 0 #ffffff; }
  .ffoot { color: color-mix(in srgb, var(--t) 70%, #000); }
  .tira .tm:hover { border-color: color-mix(in oklab, var(--brand) 30%, #efe8cd); }
  .rcard, .ficha-ce { --tc: var(--t); }
  .scene-card { --sc: #2f4f3a; --sa: #6b866a; --sped: #efe6c6; --sfloor: #fffdf5; --sline: #d8d0b2; --stxt: #6b6f60; --sgold: #7a6528; --sgoldl: #c6b06a; }
}

/* ---------- Resumen: bloque personal (nombre, unidad e importe a pagar) ---------- */
.hero-p { gap: 16px; }
.hero-p .hp-k { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0; color: var(--gold); font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: 0; }
.hero-p .hp-k::before { content: ""; flex: none; width: 32px; height: 1.5px; background: var(--gold-2); border-radius: 2px; }
.hp-mes { color: var(--brand); font-weight: 700; }
.hp-card { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; padding: 22px 24px; border-radius: 20px; color: #f6f0dc;
  background: radial-gradient(120% 140% at 0% 0%, #3d6650, #223a2b 70%); box-shadow: 0 24px 34px -22px rgb(8 28 18 / .75), inset 0 0 0 1px rgb(198 176 106 / .4); }
/* la unidad, como una chapa de llavero: crema, con agujero y borde dorado */
.hp-tag { position: relative; flex: none; width: 84px; padding: 26px 0 14px; border-radius: 16px; text-align: center; color: #24432f; transform: rotate(-4deg);
  background: linear-gradient(180deg, #fffdf4, #efe5c4); box-shadow: 0 0 0 2px #c9a437, 0 14px 20px -8px rgb(0 0 0 / .65); }
.hp-tag::before { content: ""; position: absolute; left: 50%; top: 8px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: #2a4634; box-shadow: inset 0 2px 3px rgb(0 0 0 / .6), 0 0 0 2px #c9a437; }
.hp-tag small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .2em; color: #8a6d3b; }
.hp-tag b { display: block; font-size: 34px; line-height: 1.05; letter-spacing: -.02em; }
.hp-pr { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #d8c789; }
.hp-nm { margin: 2px 0 8px; font-size: 24px; font-weight: 650; line-height: 1.15; overflow-wrap: anywhere; }
.hp-am { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.hp-am b { font-size: 34px; font-weight: 600; letter-spacing: -.01em; color: #fff6d8; white-space: nowrap; }
.hp-am span { font-size: 13px; color: #cfd8c4; }
/* vencimientos: los puntos van en orden cronológico; «Hoy» marca dónde estamos */
.hp-tl { position: relative; list-style: none; height: 6px; margin: 12px 36px 56px; padding: 0; border-radius: 9px; background: var(--surface-3); }
.hp-tl .hp-fi { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; background: linear-gradient(90deg, #2f4f3a, #c6b06a); }
.hp-tl li:not(.hp-fi) { position: absolute; top: -5px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.hp-tl li i { width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box; background: var(--surface); border: 3px solid #c6b06a; }
.hp-tl li.ya i { background: #c6b06a; }
.hp-tl li.hoy i { background: #2f4f3a; border-color: #2f4f3a; box-shadow: 0 0 0 4px rgb(47 79 58 / .18); }
.hp-tl li span { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--muted); text-align: center; white-space: nowrap; }
.hp-tl li span b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.hp-tl li span em { display: block; font-style: normal; font-weight: 600; color: var(--ink-2); }
.hp-lab { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hp-b3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hp-b3 > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.hp-b3 span { display: block; font-size: 12px; color: var(--muted); }
.hp-b3 b { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.hp-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.hp-meta span { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.hp-meta svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hp-meta .ok { color: var(--ok); }
.hp-meta .mal { color: var(--bad); }
/* botones con las mismas esquinas que las tarjetas (--radius), separados y con sombra */
.hp-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.hp-btns .fbtn { height: 52px; padding: 0 24px; border-radius: var(--radius); border: 1px solid var(--line-2); background-color: var(--surface); box-shadow: var(--shadow); }
.hp-btns .fbtn.p { border-color: transparent; color: var(--brand-ink); background-color: var(--brand); background-image: linear-gradient(120deg, color-mix(in srgb, var(--brand) 92%, #fff), color-mix(in srgb, var(--brand) 82%, #000)); box-shadow: 0 14px 20px -12px rgb(8 28 18 / .7); }
@media (max-width: 420px) { .hp-btns .fbtn { flex: 1 1 100%; } }
@media (max-width: 560px) {
  .hp-card { gap: 14px; padding: 18px 16px; }
  .hp-tag { width: 68px; padding: 22px 0 10px; }
  .hp-tag b { font-size: 27px; }
  .hp-nm { font-size: 20px; }
  .hp-am b { font-size: 28px; }
  .hp-tl { margin-left: 30px; margin-right: 30px; }
  .hp-tl li span { font-size: 11px; }
  .hp-b3 { grid-template-columns: 1fr; }
}

/* ---------- nombre reservado por privacidad (unidades con deuda): texto fijo difuminado, sin ningún nombre detrás ---------- */
.nom-res { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; vertical-align: middle; }
.nom-res i { font-style: normal; color: var(--ink-2); filter: blur(3.5px); opacity: .8; user-select: none; -webkit-user-select: none; pointer-events: none; }
.nom-res svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hp-nm .nom-res { color: #e9dfc0; gap: 10px; }
.hp-nm .nom-res i { color: #f6f0dc; filter: blur(6px); opacity: .85; }
.hp-nm .nom-res svg { width: 18px; height: 18px; }

/* ---------- Gastos: rubros en una columna a la izquierda, resumen y renglones a la derecha ---------- */
.gx { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.gx .gl { display: flex; flex-direction: column; gap: 10px; }
.gx .gr { min-width: 0; }
.gx .gr > .section { margin-top: 0; }
.gi { --tc: light-dark(var(--t), color-mix(in srgb, var(--t) 36%, #f6f0dc)); position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer; color: var(--ink);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); font: inherit; }
.gi { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.gi .am { justify-self: end; text-align: right; font-variant-numeric: tabular-nums; } /* montos y variaciones pegados al borde derecho, todos parejos */
.gi .delta { justify-self: end; }
/* resplandor dorado que sigue al mouse (como los botones de la barra) y leve elevación */
.gi:hover { background-image: radial-gradient(150px circle at var(--x, 50%) 50%, light-dark(rgb(255 246 208 / .7), rgb(226 205 130 / .3)), light-dark(rgb(198 176 106 / .38), rgb(198 176 106 / .16)) 45%, transparent 72%); border-color: rgb(198 176 106 / .8); transform: translateY(-3px); box-shadow: 0 18px 26px -14px rgb(47 79 58 / .6), 0 0 0 1px rgb(198 176 106 / .6); }
.gi[aria-pressed="true"]:hover { box-shadow: 0 18px 26px -14px rgb(47 79 58 / .6), 0 0 0 2px color-mix(in srgb, var(--tc) 40%, transparent); }
@media (prefers-reduced-motion: reduce) { .gi:hover { transform: none; } }
@media (hover: none) { .gi:hover { transform: none; } }
.gi[aria-pressed="true"] { border-color: var(--tc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 40%, transparent), var(--shadow); background-color: color-mix(in srgb, var(--t) 8%, var(--surface)); }
.gi .ic, .gsum .ic { display: grid; place-items: center; flex: none; border-radius: 50%; color: var(--tc, var(--t)); border: 2px solid color-mix(in srgb, var(--tc, var(--t)) 55%, transparent); background: color-mix(in srgb, var(--t) 12%, var(--surface)); }
.gi .ic { width: 34px; height: 34px; }
.gi .ic svg, .gsum .ic svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gi .ic svg { width: 17px; height: 17px; }
.gi .nm { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.2; color: color-mix(in srgb, var(--tc) 62%, var(--ink)); }
.gi .am { grid-column: 3; grid-row: 1; font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.gi .am .cents { font-size: 11.5px; opacity: .55; }
.gi .pc { grid-column: 2; font-size: 12px; color: var(--muted); }
.gi .delta { grid-column: 3; justify-self: end; font-size: 11.5px; }
.gsum { --tc: light-dark(var(--t), color-mix(in srgb, var(--t) 36%, #f6f0dc)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 18px; align-items: center; margin-bottom: 18px; padding: 18px 22px; border-radius: 18px; box-shadow: var(--shadow);
  background: linear-gradient(135deg, color-mix(in srgb, var(--t) 16%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--tc) 40%, var(--line-2)); }
.gsum .ic { width: 52px; height: 52px; border-width: 3px; }
.gsum .ic svg { width: 24px; height: 24px; }
.gsum .nm { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 70%, var(--ink)); }
.gsum .am { font-size: 30px; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.gsum .am .cents { font-size: 16px; opacity: .55; }
.gsum .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gx.una .gr table th:nth-child(5), .gx.una .gr table td:nth-child(5) { display: none; } /* con un rubro elegido, la columna «Rubro» repite el resumen */
@media (max-width: 1100px) {
  .gx { grid-template-columns: 1fr; }
  .gx .gl { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}
@media (max-width: 560px) {
  .gsum { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .gsum .rt { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .gsum .am { font-size: 24px; }
}
.gx .gr .table-wrap > table { width: 100%; }
/* celular: el resumen del rubro va arriba y los 9 rubros pasan a una tira que se desliza de costado (antes eran 800 px de tarjetas antes del resumen) */
@media (max-width: 700px) {
  .gx { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .gx .gr { display: contents; }
  .gx .gsum { order: 1; margin: 0; }
  .gx .gl { order: 2; display: flex; flex-direction: row; align-items: stretch; gap: 8px; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 4px 2px 12px; scrollbar-width: none; }
  .gx .gl::-webkit-scrollbar { display: none; }
  .gx .gr > .section { order: 3; margin-top: 6px; }
  .gx .gi { flex: 0 0 160px; width: 160px; scroll-snap-align: start; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 8px; padding: 10px; }
  .gx .gi .ic { grid-column: 1; grid-row: 1; }
  .gx .gi .nm { grid-column: 2; grid-row: 1; font-size: 13px; overflow-wrap: anywhere; }
  .gx .gi .am { grid-column: 1 / -1; grid-row: 2; justify-self: start; font-size: 15px; }
  .gx .gi .pc { grid-column: 1 / -1; grid-row: 3; }
  .gx .gi .delta { grid-column: 1 / -1; grid-row: 4; justify-self: start; white-space: nowrap; font-size: 11px; padding: 2px 6px; gap: 3px; max-width: 100%; }
  .gsum .delta { white-space: nowrap; }
  .gsum .rt { flex-wrap: wrap; gap: 8px 12px; }
}

/* ---------- tablas en celular: cada renglón es una tarjeta (las marcas data-l / data-r las pone js/app.js, tablasCel) ---------- */
@media (max-width: 700px) {
  .table-wrap.tc-w { overflow: visible; border: 0; background: none; max-height: none; }
  table.tc, table.tc tbody, table.tc tfoot { display: block; width: 100%; }
  table.tc thead { display: none; }
  table.tc tbody tr:not(.exp), table.tc tfoot tr.tcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; margin-bottom: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); }
  table.tc td[data-l] { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; }
  table.tc tbody tr:hover td { background: none; }
  table.tc td[data-vacio] { display: none; }
  table.tc td[data-r="t"] { grid-column: 1; grid-row: 1; font-weight: 700; font-size: 14px; }
  table.tc td[data-r="t"][data-pre]::before { content: attr(data-pre); }
  table.tc td[data-r="m"] { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; white-space: nowrap; }
  table.tc td[data-r="c"] { grid-column: 1 / -1; grid-row: 2; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
  table.tc td[data-r="fe"] { grid-column: 1; grid-row: 3; font-size: 12px; color: var(--muted); }
  table.tc td[data-r="fa"] { grid-column: 2; grid-row: 3; justify-self: end; text-align: right; font-size: 12px; }
  /* el resto de las columnas: «nombre ........ valor» una debajo de otra (las vacías no se muestran) */
  table.tc td[data-l]:not([data-r]):not([data-vacio]) { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 14px; font-size: 13px; text-align: right; }
  table.tc td[data-l]:not([data-r]):not([data-vacio])::before { content: attr(data-l); flex: none; text-align: left; font-size: 12px; color: var(--muted); }
  .gx.una table.tc td[data-l="Rubro"] { display: none; } /* con un rubro elegido, el rubro lo dice el panel de arriba */
  table.tc tbody tr.exp { display: block; margin: -4px 0 10px; }
  table.tc tbody tr.exp td { display: block; padding: 0 6px; border: 0; }
  table.tc tfoot tr:not(.tcard) { display: flex; justify-content: space-between; gap: 12px; padding: 6px 6px; }
  table.tc tfoot td { padding: 0; border: 0; background: none; position: static; }
table.tc tfoot tr.tcard { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
}

/* ---------- menú del celular (js/menu-cel.js): botón con la sección actual + panel con las 9 secciones y los ajustes ---------- */
.mn-btn, .mn-scrim, .mn-panel { display: none; }
@media (max-width: 880px) {
  .rail { overflow: visible; }
  .nav { display: none; }
  .mn-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 7px 12px 7px 8px; border-radius: 14px; border: 1px solid rgb(246 240 220 / .25); background: rgb(246 240 220 / .08); color: var(--rail-ink); font: inherit; text-align: left; cursor: pointer; }
  .mn-btn:hover { background: rgb(246 240 220 / .13); }
  .mn-btn[aria-expanded="true"] { position: relative; z-index: 61; } /* con el panel abierto, el botón queda por encima del fondo oscurecido */
  .mn-cur { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .mn-cur b { display: block; font-size: 15px; font-weight: 600; }
  .mn-cur small { display: block; font-size: 12px; color: var(--rail-muted); }
  .mn-n { margin-left: auto; position: static; }
  .mn-chev { flex: none; width: 20px; height: 20px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
  .mn-n:not([hidden]) + .mn-chev { margin-left: 8px; }
  .mn-btn[aria-expanded="true"] .mn-chev { transform: rotate(180deg); }
  .mn-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 59; background: rgb(0 0 0 / .38); }
  .mn-panel:not([hidden]) { display: block; position: absolute; left: 8px; right: 8px; top: calc(100% - 6px); z-index: 60; max-height: calc(100vh - 150px); overflow-y: auto; padding: 12px; border-radius: 18px; background: var(--rail-bg); color: var(--rail-ink); border: 1px solid rgb(246 240 220 / .2); box-shadow: 0 22px 40px -12px rgb(0 0 0 / .6); }
  .mn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mn-grid a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 68px; padding: 10px 4px 8px; border-radius: 14px; background: rgb(246 240 220 / .07); color: var(--rail-ink); text-decoration: none; font-size: 13px; font-weight: 500; text-align: center; }
  .mn-grid a:hover { background: rgb(246 240 220 / .13); text-decoration: none; }
  .mn-grid a[aria-current="page"] { background: rgb(246 240 220 / .18); box-shadow: inset 0 0 0 1px rgb(246 240 220 / .3); }
  .mn-grid a[aria-current="page"] .lbl { font-weight: 700; }
  .mn-grid a .count { position: absolute; top: 4px; right: 6px; margin: 0; }
  .mn-grid .lbl { white-space: normal; max-width: none; }
  .mn-foot { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rail-line); }
  .mn-foot button { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 4px; border-radius: 12px; border: 1px solid rgb(246 240 220 / .22); background: transparent; color: var(--rail-ink); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; }
  .mn-foot button:hover { background: rgb(246 240 220 / .1); }
  .mn-foot svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mn-foot button[aria-pressed="false"] { opacity: .7; }
  .mn-av { flex: none; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 3px; border-radius: 12px; background: var(--gold-2); color: #1a1c1a; font-size: 11px; font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) { .mn-chev { transition: none; } }

/* ---------- pantallas táctiles: áreas de toque de 44 px y campos sin zoom ----------
   Los campos de 13,5 px hacen que Safari del iPhone agrande la página al tocarlos; con 16 px no. Los botones, campos y el casillero llegan a 44 px de alto; la «i» de ayuda
   conserva su tamaño visible (16 px) pero se toca en un área de 44 px. En la compu (puntero fino) no cambia nada. */
@media (pointer: coarse) {
  .field, select.field, input.field, .toolbar .field { min-height: 44px; font-size: 16px; }
  .btn, .btn.small { min-height: 44px; }
  .check-inline { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
  .check-inline input[type="checkbox"] { width: 22px; height: 22px; flex: none; }
  .ihelp { position: relative; }
  .ihelp::after { content: ""; position: absolute; inset: -14px; }
}

/* ---------- notas explicativas largas en celular: 2 renglones + «Ver más» (las marca js/app.js, notasCel) ---------- */
.nota-vm { display: none; }
@media (max-width: 700px) {
  .note.nc { flex-wrap: wrap; }
  .note.nc > div { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .note.nc.abierta > div { display: block; }
  .note.nc .nota-vm, .note.abierta .nota-vm { display: block; flex: 0 0 100%; min-height: 44px; margin: -2px 0 -12px; padding: 4px 0 0; border: 0; background: none; text-align: right; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--brand); cursor: pointer; }
  .note .nota-vm[hidden] { display: none; }
}

/* ---------- botón flotante «Filtros» / «Arriba» en celular (js/subir-cel.js) ---------- */
.subir-cel { display: none; }
@media (max-width: 700px) {
  .subir-cel.on { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 22px -8px rgb(0 0 0 / .55); }
  .subir-cel svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
}
@media print { .subir-cel { display: none !important; } }

/* ---------- cartel «Instalá Expensas Demo» (js/instalar-cel.js) y panel de diagnóstico (?diag=1) ---------- */
.inst-cel[hidden] { display: none; }
.inst-cel { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 70; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -12px rgb(0 0 0 / .5); }
.inst-ic { width: 48px; height: 48px; border-radius: 12px; grid-row: 1; }
.inst-tx { grid-row: 1; min-width: 0; }
.inst-tx b { display: block; font-size: 16px; font-weight: 650; }
.inst-tx span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.inst-bs { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 6px; }
.inst-bs button { flex: 1; min-height: 46px; border-radius: 14px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.inst-si { border: 0; background: var(--brand); color: var(--brand-ink); }
.inst-no { border: 1px solid var(--line); background: transparent; color: var(--ink-2); }
@media (min-width: 701px) { .inst-cel { left: auto; right: 16px; bottom: 16px; width: 380px; } }
@media print { .inst-cel { display: none !important; } }

/* ---------- selector de meses del celular (js/meses-cel.js): tarjeta con flechas y una barrita por mes, en lugar de la tira que se desliza ---------- */
.mes-cel { display: none; }
@media (max-width: 700px) {
  #timeline { display: none; }
  .mes-cel { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 6px; width: 100%; padding: 10px 8px 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
  .mc-ar { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2, var(--surface)); color: var(--brand); display: grid; place-items: center; font-family: inherit; cursor: pointer; }
  .mc-ar:disabled { opacity: .3; cursor: default; }
  .mc-ar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .mc-ce { min-width: 0; text-align: center; }
  .mc-nom { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
  .mc-fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin-top: 3px; }
  .mc-gas { font-size: 13px; color: var(--muted); }
  .mc-dl { font-size: 12px; white-space: nowrap; }
  .mc-dl[hidden] { display: none; }
  .mc-barras { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 5px; height: 62px; padding: 6px 6px 0; }
  .mc-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; padding: 0; border: 0; background: none; color: var(--muted); font-family: inherit; font-size: 10.5px; cursor: pointer; }
  .mc-bar i { display: block; width: 100%; max-width: 30px; border-radius: 5px 5px 2px 2px; background: color-mix(in oklab, var(--brand) 28%, var(--surface-3)); }
  .mc-bar[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
  .mc-bar[aria-pressed="true"] i { background: var(--brand); }
}
@media print { .mes-cel { display: none !important; } }

/* ---------- «En qué se gastó» (Resumen): dona + tabla donde la tabla entra (≥ 1181 px); dona arriba y lista de rubros abajo en celular, tablet y compu angosta (la tabla necesita ~486 px y a menos de 1181 px quedaba cortada) ---------- */
.rub-grid { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); align-items: center; gap: 28px; }
.rub-lista { display: none; }
@media (max-width: 1180px) {
  .rub-grid { display: block; }
  .rub-grid > svg { display: block; width: 100%; max-width: 230px; margin: 0 auto 8px; }
  .rub-tabla { display: none; }
  .rub-lista { display: block; max-width: 640px; margin: 0 auto; padding: 0; list-style: none; }
  .rub-fila { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--line-2); }
  .rub-fila i { grid-row: 1 / 3; align-self: start; width: 12px; height: 12px; margin-top: 4px; border-radius: 4px; }
  .rub-fila b { grid-column: 2; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
  .rub-fila .am { grid-column: 2; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .rub-fila .pc { grid-column: 3; grid-row: 1; justify-self: end; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
  .rub-fila .dl { grid-column: 3; grid-row: 2; justify-self: end; }
  .rub-tot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-top: 2px; padding: 12px 2px 2px; border-top: 2px solid var(--line); font-size: 14.5px; }
  .rub-tot .am { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
}

/* ---------- firma del creador (js/firma.js): línea al pie de cada pantalla y cuadro oscuro de contacto por WhatsApp (marca Dominio Visual) ---------- */
.firma { margin: 44px 0 30px; padding: 20px 0 0; border-top: 1px solid var(--line-2); text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
/* pie: línea «Diseñada y desarrollada por [sello] Oficina Virtual · Contacto» (js/firma.js); el sello lleva un arco verde que gira despacio */
.fx-linea { margin: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; }
.fx-marca { display: inline-flex; align-items: center; gap: 10px; }
.fx-marca b { color: var(--ink); font-weight: 650; letter-spacing: .01em; font-size: 14px; }
.fx-sello { position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; }
.fx-sello img { position: absolute; inset: 3px; width: 30px; height: 30px; border-radius: 50%; display: block; }
.fx-sello::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 1.6px; background: conic-gradient(transparent 0 55%, #6fcf0a 80%, #b6f23a 90%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: fx-sello 5s linear infinite; }
@keyframes fx-sello { to { transform: rotate(360deg); } }
.firma button { font: inherit; font-size: 13px; font-weight: 600; color: light-dark(#25780a, #8fd45a); background: transparent; border: 1px solid rgb(45 143 12 / .4); border-radius: 99px; padding: 5px 15px; cursor: pointer; transition: background .25s var(--ease), border-color .25s var(--ease), transform .35s var(--spr); }
.firma button:hover { background: rgb(111 207 10 / .12); border-color: #2d8f0c; transform: translateY(-1px); }
@media (max-width: 880px) { .firma { margin: 32px 16px 30px; } }
@media (max-width: 700px) {
  .firma { padding-bottom: 56px; } /* deja lugar para el botón flotante «Arriba» */
  .fx-linea { flex-direction: column; gap: 8px; }
}
@media (pointer: coarse) { .firma button { min-height: 44px; padding: 0 20px; } }

/* cuadro de contacto «Tarjeta con sello»: tarjeta blanca redondeada (verde oscuro en el tema oscuro) con el logo circular asomando por arriba y ondas suaves que salen de él.
   Entrada y salida con @starting-style + display discreto; el logo y cada renglón entran con un resorte (animaciones de CSS que corren al abrir). */
.firma-dlg { --fx-g: light-dark(#2d8f0c, #8fd45a); --fx-bg: light-dark(#fff, #172219); --fx-bg2: light-dark(#edf5e8, #16221a); --fx-ink: light-dark(#12301a, #eaf3e4); --fx-mut: light-dark(#587060, #9db5a2); --fx-line: light-dark(rgb(20 90 20 / .16), rgb(255 255 255 / .12));
  width: min(90vw, 410px); max-width: none; margin: auto; padding: 84px 28px 28px; overflow: visible; border: 0; border-radius: 38px; text-align: center; color: var(--fx-ink);
  background: linear-gradient(180deg, var(--fx-bg), var(--fx-bg2)); box-shadow: 0 50px 100px -30px rgb(10 70 16 / .5), 0 0 0 1px var(--fx-line);
  opacity: 0; transition: opacity .4s ease, scale .8s var(--spr), translate .8s var(--spr), display .8s allow-discrete, overlay .8s allow-discrete; }
.firma-dlg[open] { opacity: 1; }
@starting-style { .firma-dlg[open] { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .firma-dlg { scale: .94; translate: 0 75px; }
  .firma-dlg[open] { scale: 1; translate: 0 35px; } /* 35 px hacia abajo: el logo asoma 70 px por arriba y el conjunto queda centrado */
  @starting-style { .firma-dlg[open] { scale: .94; translate: 0 75px; } }
}
@media (prefers-reduced-motion: reduce) { .firma-dlg[open] { translate: 0 35px; } }
.firma-dlg::backdrop { background: rgb(8 36 14 / 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background .5s, backdrop-filter .5s, display .5s allow-discrete, overlay .5s allow-discrete; }
.firma-dlg[open]::backdrop { background: rgb(8 36 14 / .34); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
@starting-style { .firma-dlg[open]::backdrop { background: rgb(8 36 14 / 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
.fx-deco { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.fx-deco i { position: absolute; border-radius: 50%; border: 26px solid transparent; border-top-color: rgb(111 207 10 / .2); border-left-color: rgb(45 143 12 / .16); width: 300px; height: 300px; }
.fx-deco i:nth-child(1) { left: -170px; top: -190px; }
.fx-deco i:nth-child(2) { right: -190px; bottom: -200px; transform: rotate(180deg); width: 340px; height: 340px; }
.fx-logo { position: absolute; left: 50%; top: -70px; width: 140px; height: 140px; margin-left: -70px; }
.fx-logo img { position: relative; z-index: 2; display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 7px var(--fx-bg), 0 18px 36px -12px rgb(10 80 16 / .6); }
.fx-logo b { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgb(111 207 10 / .7); opacity: 0; }
.firma-dlg[open] .fx-logo b { animation: fx-onda 4.2s 1s ease-out infinite; }
.firma-dlg[open] .fx-logo b:nth-of-type(2) { animation-delay: 2.1s; }
@keyframes fx-onda { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
.firma-dlg[open] .fx-logo img { animation: fx-pop .9s .25s var(--spr) both; }
@keyframes fx-pop { from { opacity: 0; transform: scale(.5) rotate(-40deg); } }
.firma-dlg[open] .fx-i { animation: fx-sube .7s calc(.5s + var(--i, 0) * .08s) var(--spr) both; }
@keyframes fx-sube { from { opacity: 0; transform: translateY(12px); } }
.fx-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fx-quien { position: relative; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .34em; text-transform: uppercase; color: var(--fx-g); }
.fx-txt { position: relative; margin: 10px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--fx-mut); }
.fx-chips { position: relative; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0 0; padding: 0; }
.fx-chips li { padding: 5px 12px; border-radius: 99px; font-size: 12px; color: light-dark(#1b6d0f, #b6f23a); background: rgb(111 207 10 / .14); box-shadow: inset 0 0 0 1px light-dark(rgb(45 143 12 / .22), rgb(111 207 10 / .3)); }
.fx-x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px; border: 0; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; color: var(--fx-ink); background: light-dark(rgb(20 90 20 / .08), rgb(255 255 255 / .1)); transition: transform .3s var(--spr), background .2s; }
.fx-x:hover { transform: rotate(90deg); background: light-dark(rgb(20 90 20 / .16), rgb(255 255 255 / .18)); }
.fx-wa { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; margin-top: 22px; padding: 0 22px; border-radius: 99px; color: #04140a; font-weight: 700; font-size: 15px; text-decoration: none;
  background: linear-gradient(180deg, #4be58a 0%, #25d366 48%, #1cb558 100%); /* verde de WhatsApp (#25D366); el texto va oscuro para que se lea bien */
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 12px 22px -10px rgb(10 80 30 / .6); transition: transform .15s var(--ease), filter .2s var(--ease); }
.fx-wa:hover { text-decoration: none; filter: brightness(1.05); }
.fx-wa:active { transform: scale(.985); }
.fx-wa svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.firma-dlg :focus-visible { outline: 2px solid var(--fx-g); outline-offset: 2px; }
/* celular acostado: el logo a la izquierda (dentro de la tarjeta) y el texto con el botón a la derecha */
@media (max-height: 520px) and (min-width: 560px) {
  .firma-dlg[open] { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 24px; align-items: center; width: min(94vw, 640px); padding: 22px 28px 22px 24px; text-align: left; translate: 0 0; }
  .fx-logo { position: static; grid-column: 1; grid-row: 1 / 5; width: 150px; height: 150px; margin: 0; }
  .fx-logo b { display: none; } /* en horizontal las ondas se saldrían de la tarjeta */
  .fx-quien { grid-column: 2; grid-row: 1; } .fx-txt { grid-column: 2; grid-row: 2; margin-top: 8px; } .fx-chips { grid-column: 2; grid-row: 3; justify-content: flex-start; margin-top: 12px; } .fx-wa { grid-column: 2; grid-row: 4; margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .fx-sello::before, .firma-dlg[open] .fx-logo img, .firma-dlg[open] .fx-i { animation: none; } .fx-logo b { display: none; } .firma button, .fx-wa, .fx-x { transition: none; } .firma-dlg, .firma-dlg::backdrop { transition-duration: .1s; } }
@media print { .firma-dlg { display: none !important; } }

/* ---------- Copias de seguridad de la nube (lista de tarjetas; en compu una fila por copia, en celular apilada) ---------- */
.copias-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.copias-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.copias-lista .cl-t { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.copias-lista .cl-t span { color: var(--ink-2, inherit); font-size: .92em; }
.copias-lista .cl-m { grid-column: 1; color: var(--muted); font-size: .9em; overflow-wrap: anywhere; }
.copias-lista .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; min-height: 40px; }
@media (max-width: 520px) {
  .copias-lista li { grid-template-columns: 1fr; }
  .copias-lista .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
}

/* ---------- celular: barra de arriba fija (logo, sugerencias y menú) con la foto del barrio ahumada; brillo dorado en el cartel de la unidad ---------- */
@media (max-width: 880px) {
  .app { display: block; } /* con la grilla, la barra «pegajosa» no podía quedarse: su celda medía lo mismo que ella */
  html { scroll-padding-top: 156px; } /* los saltos a un título (y scrollIntoView) no quedan debajo de la barra */
  .app .rail { position: sticky; top: 0; z-index: 40; isolation: isolate; box-shadow: 0 12px 24px -16px rgb(0 0 0 / .65); }
  .rail::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; filter: saturate(.85);
    background: linear-gradient(90deg, light-dark(rgb(30 54 40 / .94), rgb(18 32 24 / .94)) 0%, light-dark(rgb(34 60 44 / .66), rgb(22 38 29 / .7)) 52%, light-dark(rgb(30 54 40 / .88), rgb(18 32 24 / .9)) 100%),
      url("../img/intro/entrada.jpg") 50% 46% / cover;
  }
}
/* cartel de la unidad (celular y compu): un destello cruza la chapa y el borde dorado late, cada 2 segundos */
.hp-tag { overflow: hidden; animation: hp-halo 2s ease-in-out infinite; }
.hp-tag::after {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: 0; width: 55%; pointer-events: none;
  background: linear-gradient(105deg, transparent 0, rgb(255 255 255 / 0) 22%, rgb(255 255 255 / .95) 50%, rgb(255 255 255 / 0) 78%, transparent);
  transform: translateX(-140%) skewX(-12deg); animation: hp-brillo 2s ease-in-out infinite;
}
@keyframes hp-brillo { 0%, 30% { transform: translateX(-140%) skewX(-12deg); } 75%, 100% { transform: translateX(260%) skewX(-12deg); } }
@keyframes hp-halo {
  0%, 100% { box-shadow: 0 0 0 2px #c9a437, 0 14px 20px -8px rgb(0 0 0 / .65), 0 0 0 0 rgb(236 214 143 / 0); }
  50% { box-shadow: 0 0 0 2px #e6c458, 0 14px 20px -8px rgb(0 0 0 / .65), 0 0 24px 5px rgb(236 214 143 / .6); }
}
@media (prefers-reduced-motion: reduce) { .hp-tag { animation: none; } .hp-tag::after { display: none; } }

/* ---------- menú del celular: botones con relieve y sombras, y cada ícono con su gesto (se repite cada vez que se abre) ---------- */
:root { --spr: cubic-bezier(.34, 1.4, .64, 1); }
@supports (transition-timing-function: linear(0, 1)) { :root { --spr: linear(0, 0.026 2.8%, 0.093 5.6%, 0.189 8.3%, 0.301 11.1%, 0.419 13.9%, 0.537 16.7%, 0.648 19.4%, 0.749 22.2%, 0.837 25.0%, 0.911 27.8%, 0.971 30.6%, 1.018 33.3%, 1.052 36.1%, 1.075 38.9%, 1.088 41.7%, 1.094 44.4%, 1.094 47.2%, 1.089 50.0%, 1.081 52.8%, 1.071 55.6%, 1.06 58.3%, 1.049 61.1%, 1.038 63.9%, 1.028 66.7%, 1.019 69.4%, 1.011 72.2%, 1.005 75.0%, 1.0 77.8%, 0.996 80.6%, 0.994 83.3%, 0.992 86.1%, 0.991 88.9%, 0.991 91.7%, 0.991 94.4%, 0.992 97.2%, 1); } } /* resorte suave: rebota ~9 % y se asienta */
@media (max-width: 880px) {
  .mn-grid a:nth-child(1) { --i: 0; }
  .mn-grid a:nth-child(2) { --i: 1; }
  .mn-grid a:nth-child(3) { --i: 2; }
  .mn-grid a:nth-child(4) { --i: 3; }
  .mn-grid a:nth-child(5) { --i: 4; }
  .mn-grid a:nth-child(6) { --i: 5; }
  .mn-grid a:nth-child(7) { --i: 6; }
  .mn-grid a:nth-child(8) { --i: 7; }
  .mn-grid a:nth-child(9) { --i: 8; }
  /* relieve: luz arriba, sombra abajo, como el resto de la app */
  .mn-grid a { background: linear-gradient(180deg, rgb(246 240 220 / .17), rgb(246 240 220 / .05)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 0 0 1px rgb(246 240 220 / .12), 0 14px 18px -10px rgb(0 0 0 / .8), 0 3px 6px -2px rgb(0 0 0 / .35); transition: scale .3s var(--spr); }
  .mn-grid a:hover { background: linear-gradient(180deg, rgb(246 240 220 / .24), rgb(246 240 220 / .09)); }
  .mn-grid a[aria-current="page"] { background: linear-gradient(180deg, rgb(246 240 220 / .32), rgb(246 240 220 / .12)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), inset 0 0 0 1px rgb(198 176 106 / .6), 0 14px 20px -10px rgb(0 0 0 / .85), 0 0 20px -4px rgb(198 176 106 / .4); }
  .mn-grid .tile { box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -2px 3px rgb(0 0 0 / .2), 0 8px 12px -5px rgb(0 0 0 / .7), 0 2px 3px rgb(0 0 0 / .4); }
  .mn-foot button { background: linear-gradient(180deg, rgb(246 240 220 / .13), rgb(246 240 220 / .03)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 10px 14px -9px rgb(0 0 0 / .75), 0 2px 4px -1px rgb(0 0 0 / .3); }
  .mn-panel:not([hidden]) { box-shadow: 0 26px 44px -14px rgb(0 0 0 / .7), inset 0 1px 0 rgb(255 255 255 / .12); transform-origin: 50% 0; animation: mn-panel .5s var(--spr) both; }
  .mn-grid a:active { scale: .94; }
  /* entrada: el panel cae con resorte, los botones suben de a uno y después cada ícono hace lo suyo */
  .mn-grid a { animation: mn-sube .6s var(--spr) both; animation-delay: calc(.04s + var(--i) * .04s); }
  .mn-grid .tile svg { animation: .95s ease-in-out both; animation-delay: calc(.45s + var(--i) * .1s); }
  .mn-grid a:nth-child(1) .tile svg { transform-origin: 50% 90%; animation-name: mn-g1; }  /* Resumen: las barras se estiran */
  .mn-grid a:nth-child(2) .tile svg { transform-origin: 50% 5%; animation-name: mn-g2; }   /* Gastos: el ticket se balancea */
  .mn-grid a:nth-child(3) .tile svg { animation-name: mn-g3; }                              /* Cobranza: el billete gira */
  .mn-grid a:nth-child(4) .tile svg { animation-name: mn-g4; }                              /* Multas: la alerta tiembla */
  .mn-grid a:nth-child(5) .tile svg { transform-origin: 50% 100%; animation-name: mn-g5; }  /* Mi unidad: la casa salta */
  .mn-grid a:nth-child(6) .tile svg { transform-origin: 50% 20%; animation-name: mn-g6; }   /* Proveedores: el toldo se mece */
  .mn-grid a:nth-child(7) .tile svg { animation-name: mn-g7; }                              /* Personal: asienten */
  .mn-grid a:nth-child(8) .tile svg { animation-name: mn-g8; }                              /* Hallazgos: la lupa busca */
  .mn-grid a:nth-child(9) .tile svg { animation-name: mn-g9; }                              /* Respaldo: la flecha sube */
}
@keyframes mn-panel { from { opacity: 0; scale: .94; translate: 0 -10px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes mn-sube { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes mn-g1 { 0% { scale: 1 1; } 30% { scale: 1 .55; } 60% { scale: 1 1.22; } 100% { scale: 1 1; } }
@keyframes mn-g2 { 0% { rotate: 0deg; } 25% { rotate: -14deg; } 55% { rotate: 11deg; } 80% { rotate: -5deg; } 100% { rotate: 0deg; } }
@keyframes mn-g3 { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
@keyframes mn-g4 { 0%, 100% { rotate: 0deg; } 15% { rotate: -12deg; } 30% { rotate: 11deg; } 45% { rotate: -9deg; } 60% { rotate: 7deg; } 75% { rotate: -3deg; } }
@keyframes mn-g5 { 0% { translate: 0 0; scale: 1 1; } 25% { translate: 0 0; scale: 1.12 .8; } 50% { translate: 0 -5px; scale: .94 1.1; } 75% { translate: 0 0; scale: 1.08 .88; } 100% { translate: 0 0; scale: 1 1; } }
@keyframes mn-g6 { 0% { transform: skewX(0); } 25% { transform: skewX(-12deg); } 55% { transform: skewX(10deg); } 80% { transform: skewX(-4deg); } 100% { transform: skewX(0); } }
@keyframes mn-g7 { 0%, 100% { translate: 0 0; rotate: 0deg; } 30% { translate: 0 2px; rotate: 6deg; } 60% { translate: 0 -2px; rotate: -5deg; } }
@keyframes mn-g8 { 0% { translate: 0 0; } 25% { translate: 3px -2px; } 50% { translate: 0 -4px; } 75% { translate: -3px -1px; } 100% { translate: 0 0; } }
@keyframes mn-g9 { 0% { translate: 0 0; scale: 1; } 35% { translate: 0 -5px; scale: 1.08; } 65% { translate: 0 1px; scale: .96; } 100% { translate: 0 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .mn-panel, .mn-grid a, .mn-grid .tile svg { animation: none !important; } }

/* ---------- barra lateral de la compu: íconos con relieve suave (luz fina arriba, sombra abajo y una sombra apoyada) ---------- */
@media (min-width: 881px) {
  .rail .nav a .tile,
  .rail .nav a[aria-current="page"] .tile { box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -2px 2px rgb(0 0 0 / .16), 0 5px 8px -3px rgb(0 0 0 / .55), 0 1px 2px rgb(0 0 0 / .35); }
  .rail .nav a:hover .tile { box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), inset 0 -2px 2px rgb(0 0 0 / .16), 0 8px 12px -4px rgb(0 0 0 / .55), 0 1px 2px rgb(0 0 0 / .35); }
}
