/* Hucha Fiscal · oscuro, cabecera con degradado iridiscente (lima, lavanda, menta),
   píldoras redondas, tarjetas grafito y tipografía geométrica con contraste fino/negrita. */

@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 200 700; font-display: swap; src: url(fonts/outfit-latin.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); }

:root {
  /* oscuro (por defecto) */
  --bg: #111111;
  --card: #1d1d1d;
  --card-2: #262626;
  --card-3: #2e2e2e;
  --ink: #f3f3f1;
  --ink-2: #a5a5a2;
  --slate: #747472;
  --rule: rgba(255, 255, 255, .08);
  --accent: #e7eba4;            /* lima pastel: texto de acento */
  --lav: #d7d6f3;
  --mint: #cedccd;
  --pink: #ecc9df;
  --white: #f3f3f1;
  --on-grad: #151515;
  --grad: radial-gradient(120% 140% at 100% 0%, #e9eca0 0%, rgba(233, 236, 160, 0) 55%),
          radial-gradient(110% 120% at 85% 110%, #d6d4f4 0%, rgba(214, 212, 244, 0) 60%),
          linear-gradient(160deg, #cdd6cb 0%, #dfe3c4 45%, #d5d5ee 100%);
  --bar: linear-gradient(90deg, #e9eca0 0%, #d7d6f3 100%);
  --alert: #f0a39a;
  --alert-tint: rgba(240, 163, 154, .12);
  --tint: rgba(231, 235, 164, .12);
  --grey-tint: rgba(255, 255, 255, .07);
  --c-iva: #e7eba4; --c-irpf: #d7d6f3; --c-renta: #ecc9df; --c-cuota: #cedccd;
  --display: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --r-sm: 10px; --r-md: 18px; --r-lg: 24px; --r-xl: 34px; --r-pill: 99px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #efefec; --card: #ffffff; --card-2: #f4f4f1; --card-3: #e9e9e5; --ink: #161616; --ink-2: #5f5f5c; --slate: #8a8a86;
  --rule: rgba(0, 0, 0, .07); --accent: #6b7326; --white: #2a2a2a; --grey-tint: rgba(0, 0, 0, .05); --tint: rgba(107, 115, 38, .1);
  --alert: #b0453b; --alert-tint: rgba(176, 69, 59, .1); --c-iva: #d9de7c; --c-irpf: #bdbbec; --c-renta: #e6b3d3; --c-cuota: #b4cab3;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #efefec; --card: #ffffff; --card-2: #f4f4f1; --card-3: #e9e9e5; --ink: #161616; --ink-2: #5f5f5c; --slate: #8a8a86;
    --rule: rgba(0, 0, 0, .07); --accent: #6b7326; --white: #2a2a2a; --grey-tint: rgba(0, 0, 0, .05); --tint: rgba(107, 115, 38, .1);
    --alert: #b0453b; --alert-tint: rgba(176, 69, 59, .1); --c-iva: #d9de7c; --c-irpf: #bdbbec; --c-renta: #e6b3d3; --c-cuota: #b4cab3;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15.5px; font-weight: 400; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--accent); }
b, strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.disp { font-family: var(--display); }
[hidden] { display: none !important; }

/* ---------- estructura ---------- */
.app { min-height: 100dvh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: 0 0 calc(80px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar h1 { font-family: var(--display); font-size: 30px; font-weight: 300; letter-spacing: -.01em; margin: 0; flex: 1; }
.content { max-width: 760px; margin: 0 auto; padding: 4px 18px 100px; }

.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; display: flex; justify-content: space-around;
  padding: 6px; background: color-mix(in srgb, var(--card) 88%, transparent); border-radius: var(--r-pill);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px var(--rule);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border-radius: var(--r-pill);
  color: var(--slate); font-size: 10.5px; font-weight: 500; text-decoration: none;
}
.tab svg { width: 21px; height: 21px; stroke-width: 1.7; }
.tab[aria-current="page"] { color: var(--ink); background: var(--grey-tint); }
.fab {
  position: fixed; right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 31; height: 54px; padding: 0 22px 0 18px;
  border-radius: var(--r-pill); border: 0; background: var(--grad); color: var(--on-grad); display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 500; font-size: 16px; box-shadow: 0 10px 28px rgba(0, 0, 0, .4); transition: transform .15s ease;
}
.fab:active { transform: scale(.96); }
.fab svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; width: 256px; flex: none; padding: 26px 16px; position: sticky; top: 0; height: 100dvh;
    border-right: 1px solid var(--rule);
  }
  .sidebar .brand { margin: 0 8px 30px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-weight: 450;
  }
  .side-link svg { width: 19px; height: 19px; stroke-width: 1.7; }
  .side-link:hover { background: var(--grey-tint); color: var(--ink); }
  .side-link[aria-current="page"] { background: var(--card); color: var(--ink); }
  .side-add { margin-top: 18px; }
  .side-foot { margin-top: auto; font-size: 12px; color: var(--slate); padding: 0 16px; line-height: 1.45; }
  .tabbar, .fab { display: none; }
  .main { padding-bottom: 40px; }
  .topbar { padding: 26px 40px 14px; }
  .topbar h1 { font-size: 36px; }
  .content { padding: 8px 40px 48px; }
}

.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 600; font-size: 17px; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: var(--on-grad); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-family: var(--font); font-weight: 400; color: var(--ink-2); font-size: 12px; }

/* ---------- cabecera iridiscente (inicio) ---------- */
.top {
  background: var(--grad); color: var(--on-grad); margin: 0 -18px 14px; padding: calc(16px + env(safe-area-inset-top)) 18px 18px;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.round {
  height: 42px; min-width: 64px; padding: 0 18px; border-radius: var(--r-pill); border: 0; background: #1b1b1b; color: #f3f3f1;
  display: inline-grid; place-items: center; text-decoration: none;
}
.round svg { width: 19px; height: 19px; }
.round.light { background: rgba(255, 255, 255, .45); color: #151515; }
.greet { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.greet h1 { font-family: var(--display); font-size: 38px; line-height: 1.08; font-weight: 300; margin: 0; letter-spacing: -.01em; }
.greet h1 b { font-weight: 650; display: block; }
.balance { background: #1b1b1b; color: #f3f3f1; border-radius: var(--r-lg); padding: 18px 20px 18px; }
.balance .k { font-size: 13.5px; color: #b9b9b6; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.balance .big { font-family: var(--display); font-size: 40px; font-weight: 500; text-align: right; margin: 6px 0 12px; letter-spacing: -.01em; }
.balance .track { height: 10px; border-radius: 99px; background: #2c2c2c; position: relative; overflow: visible; }
.balance .track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--bar); }
.balance .track > i::after { content: ""; position: absolute; right: 0; top: -3px; bottom: -3px; width: 2px; background: #f3f3f1; border-radius: 2px; }
.balance .foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: #b9b9b6; gap: 10px; }
.balance .foot b { color: #f3f3f1; font-weight: 500; }
.balance .upd { white-space: nowrap; flex: none; background: #2c2c2c; color: #f3f3f1; border: 0; border-radius: var(--r-pill); height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 500; }
@media (min-width: 900px) {
  .top { margin: 0 0 14px; border-radius: var(--r-xl); padding: 22px 26px 24px; }
  .top-bar { display: none; }
}

/* ---------- tarjetas ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 20px; margin-bottom: 12px; }
.card h2, .sec-title { font-family: var(--display); font-size: 19px; font-weight: 400; margin: 0 0 16px; letter-spacing: 0; }
.sec-title { margin: 26px 4px 12px; font-size: 21px; font-weight: 300; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.more { font-size: 12.5px; color: var(--ink-2); text-decoration: none; background: none; border: 0; padding: 0; }
.grid2 { display: grid; gap: 12px; margin-bottom: 12px; }
.grid2 > .card { margin-bottom: 0; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.lines { background: var(--card); border-radius: var(--r-lg); padding: 4px 20px; margin-bottom: 12px; }
.lines .ln { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); }
.lines .ln:first-child { border-top: 0; }
.lines .ln b { color: var(--ink); font-weight: 500; }
.lines .ln b.acc { color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.tile {
  background: var(--card); border: 0; border-radius: var(--r-lg); padding: 14px 12px 14px 14px; text-align: left; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: var(--ink);
}
.tile .ic { align-self: flex-end; width: 24px; height: 24px; color: var(--ink); }
.tile .ic svg { width: 24px; height: 24px; stroke-width: 1.5; }
.tile small { display: block; font-size: 11.5px; color: var(--ink-2); }
.tile span { font-family: var(--display); font-size: 18px; font-weight: 400; }
.tile.acc span, .tile.acc .ic { color: var(--accent); }
.tile:active { transform: scale(.98); }

.bars { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; height: 130px; margin-bottom: 18px; }
.bar { background: var(--card-2); border-radius: 14px 14px 10px 10px; position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.bar .p { text-align: center; font-size: 12px; color: var(--ink-2); padding-top: 9px; }
.bar i { display: block; border-radius: 14px 14px 10px 10px; min-height: 5px; transition: height .5s cubic-bezier(.2, .8, .2, 1); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

.goal .sub { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.goal .scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--slate); position: relative; height: 16px; }
.goal .scale b { position: absolute; transform: translateX(-50%); color: var(--ink); font-weight: 500; }
.ptrack { height: 18px; border-radius: 99px; background: var(--card-2); position: relative; margin: 4px 0 18px; }
.ptrack > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px 0 0 99px; background: var(--bar); }
.ptrack > i::after { content: ""; position: absolute; right: -1px; top: -2px; bottom: -2px; width: 2px; background: var(--ink); border-radius: 2px; }
.ptrack > i.full { border-radius: 99px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trio .k { font-size: 11.5px; color: var(--ink-2); }
.trio .v { font-size: 14.5px; font-weight: 500; margin-top: 3px; }
.goal hr { border: 0; border-top: 1px solid var(--rule); margin: 0 0 14px; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--rule); }
.row:first-child { border-top: 0; padding-top: 0; }
.row .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 500; }
.row .d { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.row .v { font-weight: 500; text-align: right; white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat .k { font-size: 12.5px; color: var(--ink-2); }
.stat .v { font-family: var(--display); font-size: 22px; font-weight: 400; margin-top: 4px; }
.stat .v.ok { color: var(--accent); }
.stat .v small { font-size: 13px; color: var(--ink-2); }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill); height: 26px; padding: 0 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip svg { width: 13px !important; height: 13px !important; }
.chip.ok, .chip.in { background: var(--tint); color: var(--accent); }
.chip.warn, .chip.mute { background: var(--grey-tint); color: var(--ink-2); }
.chip.bad { background: var(--alert-tint); color: var(--alert); }

.note { font-size: 12.5px; color: var(--ink-2); }
.legal { font-size: 11.5px; color: var(--slate); margin: 24px 4px 0; line-height: 1.5; }
.banner { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); font-size: 14px; margin-bottom: 12px; }
.banner > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.banner .grow { flex: 1; color: var(--ink-2); }
.banner .grow b { color: var(--ink); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--card-2); color: var(--ink);
  border-radius: var(--r-pill); height: 44px; padding: 0 20px; font-weight: 500; font-size: 14.5px; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); color: var(--on-grad); }
.btn.tint { background: var(--card-2); }
.btn.danger { background: var(--alert-tint); color: var(--alert); }
.btn.ghost { background: transparent; color: var(--accent); padding: 0 10px; }
.btn.small { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn svg { width: 17px; height: 17px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn { width: 44px; height: 42px; border-radius: var(--r-pill); border: 0; background: var(--card); display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- listas ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--card); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; height: 34px; padding: 0 15px; border-radius: var(--r-pill); font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card-3); color: var(--ink); }
select.btn { appearance: none; -webkit-appearance: none; background: var(--card); }
.search { flex: 1; min-width: 180px; position: relative; }
.search input { width: 100%; height: 42px; padding: 0 16px 0 42px; border-radius: var(--r-pill); border: 0; background: var(--card); font-size: 15px; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--slate); }
.month { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 4px 10px; }
.month b { font-family: var(--display); font-size: 19px; font-weight: 300; text-transform: capitalize; }
.month span { font-size: 12.5px; color: var(--ink-2); }
.list { background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 0; border-top: 1px solid var(--rule); width: 100%; background: none; text-align: left; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--card-2); }
.item .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.item .ico svg { width: 17px; height: 17px; }
.item .ico.in { background: var(--grad); color: var(--on-grad); }
.item .ico.out { background: var(--card-2); color: var(--ink-2); }
.item .grow { flex: 1; min-width: 0; }
.item .t { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .d { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; margin-top: 1px; }
.item .d svg { width: 13px; height: 13px; }
.item .v { font-weight: 500; white-space: nowrap; text-align: right; }
.item .v.in { color: var(--accent); }
.item .v small { display: block; font-size: 11.5px; color: var(--slate); font-weight: 400; margin-top: 1px; }

.empty { text-align: center; padding: 40px 22px; }
.empty .art { width: 62px; height: 62px; border-radius: 50%; background: var(--grad); color: var(--on-grad); display: grid; place-items: center; margin: 0 auto 18px; }
.empty .art svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 8px; font-family: var(--display); font-size: 22px; font-weight: 400; }
.empty p { margin: 0 auto 20px; max-width: 340px; font-size: 14.5px; color: var(--ink-2); }

/* ---------- trimestres ---------- */
.q { padding: 0; overflow: hidden; }
.q-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; list-style: none; }
.q-head::-webkit-details-marker { display: none; }
.q-head .grow { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.q-head .t { font-family: var(--display); font-weight: 400; font-size: 20px; }
.q-head .d { font-size: 12.5px; color: var(--ink-2); }
.q-head .v { font-family: var(--display); font-weight: 400; font-size: 22px; text-align: right; }
.q-head .chev { width: 20px; height: 20px; color: var(--slate); transition: transform .2s; flex: none; }
.q[open] .q-head .chev { transform: rotate(180deg); }
.q-body { padding: 0 8px 12px; }
@media (min-width: 640px) { .q-body { padding: 0 20px 20px; } }
.q-body > .note, .q-body > .q-actions { padding: 0 8px; }
.model { background: var(--card-2); border-radius: var(--r-md); margin-top: 12px; overflow: hidden; }
.model-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; font-family: var(--display); font-size: 16px; font-weight: 400; }
.model-h small { font-family: var(--font); font-size: 12px; color: var(--ink-2); }
.box { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-top: 1px solid var(--rule); font-size: 14px; }
.box .n { width: 38px; flex: none; font-size: 11.5px; font-weight: 600; color: var(--on-grad); background: var(--grad); border-radius: var(--r-pill); text-align: center; padding: 3px 0; font-variant-numeric: tabular-nums; }
.box .l { flex: 1; color: var(--ink-2); }
.box .val { font-weight: 500; font-variant-numeric: tabular-nums; }
.box.total { background: var(--tint); }
.box.total .l { color: var(--ink); font-weight: 500; }
.box.total .val { color: var(--accent); }
.copy { border: 0; background: none; color: var(--slate); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.copy svg { width: 15px; height: 15px; }
.copy:hover { color: var(--ink); background: var(--grey-tint); }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > label, .field > .lab { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid transparent; background: var(--card); border-radius: var(--r-md); padding: 0 16px; height: 50px; font-size: 16px;
}
.field input::placeholder { color: var(--slate); }
.field input:focus, .field select:focus, .search input:focus { outline: none; border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--slate); }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.money { position: relative; }
.money input { padding-right: 38px; font-variant-numeric: tabular-nums; font-family: var(--display); font-size: 24px; font-weight: 400; height: 58px; }
.money::after { content: "€"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--slate); pointer-events: none; font-size: 20px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { border: 0; background: var(--card); border-radius: var(--r-pill); height: 40px; padding: 0 16px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
.pills button[aria-pressed="true"] { background: var(--grad); color: var(--on-grad); }
.typeswitch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 20px; background: var(--card); border-radius: var(--r-pill); padding: 4px; }
.typeswitch button { border: 0; background: none; border-radius: var(--r-pill); height: 42px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); font-size: 14.5px; }
.typeswitch button svg { width: 16px; height: 16px; }
.typeswitch button[aria-pressed="true"] { background: var(--grad); color: var(--on-grad); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch .grow { flex: 1; }
.switch input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--card-3); position: relative; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: #c9cf7a; }
.switch input:checked::after { transform: translateX(20px); background: #151515; }
.summary { background: var(--card); border-radius: var(--r-md); padding: 16px 18px; margin: 4px 0 18px; font-size: 14px; color: var(--ink-2); }
.summary div { display: flex; justify-content: space-between; padding: 3px 0; }
.summary .num { color: var(--ink); }
.summary .tot { color: var(--ink); font-weight: 500; border-top: 1px solid var(--rule); margin-top: 8px; padding-top: 10px; }
.summary .save { background: var(--grad); color: var(--on-grad); font-weight: 500; margin: 12px -8px 0; padding: 10px 12px; border-radius: var(--r-sm); }
.summary .save .num { color: var(--on-grad); }
.attach { display: flex; gap: 10px; align-items: center; }
.attach img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--r-sm); }
.attach .pdf { width: 60px; height: 60px; border-radius: var(--r-sm); background: var(--card); display: grid; place-items: center; font-weight: 600; color: var(--ink-2); font-size: 12px; }
.attach label.btn { cursor: pointer; }
.attach input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.set-group { margin-bottom: 24px; }
.set-group > h3 { font-family: var(--display); font-size: 19px; font-weight: 300; color: var(--ink); margin: 0 4px 10px; }
.set-group .card { margin-bottom: 0; padding: 4px 20px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.set-row:first-child { border-top: 0; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .t { font-weight: 500; }
.set-row .d { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.set-row select, .set-row input[type=date], .set-row input[type=text], .set-row input[type=number] {
  border: 0; background: var(--card-2); border-radius: var(--r-pill); padding: 0 14px; height: 38px; max-width: 48%; font-size: 14.5px;
}

/* ---------- hoja / diálogo ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .2s ease; }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 28px 28px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .3s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain;
}
.sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--card-3); margin: 4px auto 12px; }
.sheet-h { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.sheet-h h2 { flex: 1; margin: 0; font-family: var(--display); font-size: 28px; font-weight: 300; }
.sheet-foot { display: flex; gap: 10px; position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--bg); padding: 12px 0 calc(6px + env(safe-area-inset-bottom)); margin-bottom: calc(-20px - env(safe-area-inset-bottom)); }
.sheet-foot .btn { flex: 1; height: 54px; font-size: 16px; font-family: var(--display); }
.sheet-foot .btn.danger { flex: 0 0 54px; padding: 0; }
@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 28px; padding-bottom: 20px; max-height: 88dvh; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
  .sheet-grip { display: none; }
  .sheet-h { margin-top: 14px; }
}
@keyframes up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel, .sheet-bg, .toast { animation: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--grad); color: var(--on-grad);
  padding: 12px 20px; border-radius: var(--r-pill); font-weight: 500; font-size: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); animation: up .25s ease;
  max-width: calc(100% - 40px); text-align: center;
}
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* ---------- bienvenida ---------- */
.onb { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom)); }
.onb-panel { width: 100%; max-width: 440px; }
.onb .brand { margin-bottom: 36px; }
.onb-hero { background: var(--grad); color: var(--on-grad); border-radius: var(--r-xl); padding: 26px 22px; margin-bottom: 20px; }
.onb h1 { font-family: var(--display); font-size: 40px; font-weight: 300; line-height: 1.05; margin: 0 0 12px; letter-spacing: -.01em; }
.onb h1 b { font-weight: 650; }
.onb h1.sm { font-size: 32px; }
.onb p.lead { color: var(--ink-2); font-size: 16px; margin: 0 0 26px; }
.onb-hero p.lead { color: #3a3a3a; margin: 0; }
.onb-feats { display: flex; flex-direction: column; margin: 0 0 26px; padding: 4px 20px; list-style: none; background: var(--card); border-radius: var(--r-lg); }
.onb-feats li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--rule); }
.onb-feats li:first-child { border-top: 0; }
.onb-feats .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--card-2); color: var(--accent); display: grid; place-items: center; flex: none; }
.onb-feats .ic svg { width: 17px; height: 17px; }
.onb-feats b { display: block; font-weight: 500; }
.onb-feats span { font-size: 13.5px; color: var(--ink-2); }
.steps { display: flex; gap: 6px; margin-bottom: 30px; }
.steps i { flex: 1; height: 4px; border-radius: 9px; background: var(--card-2); }
.steps i.on { background: var(--bar); }
.choice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.choice button { text-align: left; border: 1px solid transparent; background: var(--card); border-radius: var(--r-lg); padding: 16px 18px; }
.choice button b { display: block; font-weight: 500; }
.choice button span { font-size: 13.5px; color: var(--ink-2); }
.choice button[aria-pressed="true"] { border-color: var(--accent); background: var(--card-2); }
.onb-actions { display: flex; flex-direction: column; gap: 8px; }
.onb-actions .btn { height: 54px; font-size: 16px; font-family: var(--display); }

@media print { .tabbar, .fab, .sidebar, .topbar .icon-btn { display: none !important; } }

/* ---------- conocerte / personalización ---------- */
.kicker { font-size: 13px; font-weight: 500; color: var(--accent); margin: 0 0 10px; letter-spacing: .02em; }
.kicker.dark { color: #4a4f1c; }
.big-in { font-family: var(--display) !important; font-size: 26px !important; height: 64px !important; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips button { border: 1px solid transparent; background: var(--card); border-radius: var(--r-pill); height: 44px; padding: 0 16px; font-size: 14.5px; font-weight: 450; color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--grad); color: var(--on-grad); }
.onb-hero.reveal h1 b { font-weight: 650; }
.onb-hero.reveal .lead b { color: #151515; }
.tips { display: flex; flex-direction: column; gap: 8px; }
.tip { background: var(--card); border-radius: var(--r-md); padding: 14px 16px; border-left: 3px solid var(--accent); }
.tip b { display: block; font-weight: 500; margin-bottom: 4px; }
.tip span { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.lema { margin: 10px 0 0; font-size: 14.5px; color: #3c3c3a; max-width: 260px; }
.estim-big { font-family: var(--display); font-size: 24px; font-weight: 300; margin: 0; }
.estim-big b { font-weight: 600; color: var(--accent); }
.tipcard { border-left: 3px solid var(--accent); }
.tip-t { font-weight: 500; font-size: 15.5px; }
.banner > svg:last-child { width: 18px; height: 18px; color: var(--slate); }
