/* ==========================================================================
   AzBeep Central — estilos (escritos a mano, sin compilar)
   Base visual: docs/referencia-visual.html
   ========================================================================== */

/* ---------- fuentes locales (variables, subconjunto latino) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('../fonts/space-grotesk-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-wght.woff2') format('woff2'); }

/* ---------- tokens ----------
   Todo sale de dos colores por persona (Perfil → Colores de la app):
   --t1 = acento (botones, enlaces, sombras) y --t2 = degradado. Los pone <html style="...">.
   Fondos, bordes y sombras se derivan con color-mix(), por eso cualquier par de colores funciona. */
:root {
  --t1: #C0668A; --t2: #9C82C9;   /* Rosa mate (valores por defecto) */

  /* Neutros del modo claro. El modo oscuro solo cambia estos; lo demás se deriva. */
  --n-bg: #F6F4F7; --n-surface: #FFFFFF; --n-soft: #F4F2F6;
  --n-line: #DEDBE3; --n-line-strong: #CFCBD6; --n-line-suave: #ECEAF0; --n-line-strong-suave: #E0DDE6;
  --mix: #FFFFFF;                                   /* base para los tonos "soft" */
  --ink: #1B1920; --ink-soft: #69656F; --ink-faint: #A09BA6;
  --solid: #1B1920; --on-solid: #FFFFFF;            /* pastillas seleccionadas, aviso flotante */
  --warn-text: #A8661B; --bad-text: #B4492F; --ok-text: #2F7A4B;
  --drop: rgba(27,25,32,.06);                       /* sombra neutra de contacto */
  color-scheme: light;

  --bg: color-mix(in srgb, var(--t1) 6%, var(--n-bg));
  --surface: var(--n-surface);
  --surface-soft: color-mix(in srgb, var(--t1) 6%, var(--n-soft));
  --line: color-mix(in srgb, var(--t1) 22%, var(--n-line));          /* bordes visibles */
  --line-strong: color-mix(in srgb, var(--t1) 38%, var(--n-line-strong));
  --shadow-sm: 0 1px 2px var(--drop), 0 8px 22px -12px color-mix(in srgb, var(--t1) 55%, transparent);
  --shadow-md: 0 22px 44px -18px color-mix(in srgb, var(--t1) 65%, transparent), 0 2px 6px var(--drop);
  --grad: linear-gradient(135deg, var(--t1), var(--t2));
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--t1) 12%, var(--mix)), color-mix(in srgb, var(--t2) 12%, var(--mix)));
  --card-border: 1.5px;
  --radius: 18px;

  /* Colores de los módulos, en versión mate */
  --violet: #7C6FC0; --coral: #D17A6E; --blue: #5B82C0; --pink: #C46F98; --teal: #4E9C85;
  --rose: #C27089;   --amber: #CC9A45; --cyan: #4B97AB; --green: #4F9A6C; --danger: #BF4A40;
  --violet-soft: color-mix(in srgb, var(--violet) 13%, var(--mix));
  --coral-soft: color-mix(in srgb, var(--coral) 13%, var(--mix));
  --blue-soft: color-mix(in srgb, var(--blue) 13%, var(--mix));
  --pink-soft: color-mix(in srgb, var(--pink) 13%, var(--mix));
  --teal-soft: color-mix(in srgb, var(--teal) 13%, var(--mix));
  --rose-soft: color-mix(in srgb, var(--rose) 13%, var(--mix));
  --amber-soft: color-mix(in srgb, var(--amber) 16%, var(--mix));
  --cyan-soft: color-mix(in srgb, var(--cyan) 13%, var(--mix));
  --green-soft: color-mix(in srgb, var(--green) 13%, var(--mix));
  --danger-soft: color-mix(in srgb, var(--danger) 12%, var(--mix));

  --accent: var(--t1); --accent-soft: color-mix(in srgb, var(--t1) 13%, var(--mix));
  --bottom-nav-h: 64px;
}

/* ---------- Modo oscuro (Perfil → Colores de la app) ----------
   "oscuro" siempre; "auto" sigue el ajuste del celular o la computadora. */
:root[data-mode="oscuro"] {
  --n-bg: #121015; --n-surface: #1C1920; --n-soft: #25212A;
  --n-line: #36313D; --n-line-strong: #463F4E; --n-line-suave: #2A262F; --n-line-strong-suave: #332E39;
  --mix: #1C1920;
  --ink: #F1EDF4; --ink-soft: #B2ABB9; --ink-faint: #7D7685;
  --solid: #EDE8F1; --on-solid: #1B1920;
  --warn-text: #E4B56B; --bad-text: #EC9A82; --ok-text: #8FCDA3;
  --drop: rgba(0,0,0,.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-mode="auto"] {
    --n-bg: #121015; --n-surface: #1C1920; --n-soft: #25212A;
    --n-line: #36313D; --n-line-strong: #463F4E; --n-line-suave: #2A262F; --n-line-strong-suave: #332E39;
    --mix: #1C1920;
    --ink: #F1EDF4; --ink-soft: #B2ABB9; --ink-faint: #7D7685;
    --solid: #EDE8F1; --on-solid: #1B1920;
    --warn-text: #E4B56B; --bad-text: #EC9A82; --ok-text: #8FCDA3;
    --drop: rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

/* Bordes y sombras suaves (opción del perfil) */
:root[data-contrast="suave"] {
  --line: color-mix(in srgb, var(--t1) 10%, var(--n-line-suave));
  --line-strong: color-mix(in srgb, var(--t1) 20%, var(--n-line-strong-suave));
  --shadow-sm: 0 1px 2px var(--drop);
  --shadow-md: 0 16px 36px -14px color-mix(in srgb, var(--t1) 40%, transparent);
  --card-border: 1px;
}

/* color de acento por módulo (Finanzas usa el color personal) */
.s-finanzas        { --accent: var(--t1);     --accent-soft: color-mix(in srgb, var(--t1) 13%, var(--mix)); }
.s-calendario      { --accent: var(--coral);  --accent-soft: var(--coral-soft); }
.s-vault           { --accent: var(--blue);   --accent-soft: var(--blue-soft); }
.s-entretenimiento { --accent: var(--pink);   --accent-soft: var(--pink-soft); }
.s-nutricion       { --accent: var(--teal);   --accent-soft: var(--teal-soft); }
.s-ciclo           { --accent: var(--rose);   --accent-soft: var(--rose-soft); }
.s-super           { --accent: var(--amber);  --accent-soft: var(--amber-soft); }
.s-proyectos       { --accent: var(--cyan);   --accent-soft: var(--cyan-soft); }
.s-medico          { --accent: var(--green);  --accent-soft: var(--green-soft); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; margin: 0; letter-spacing: -0.02em; font-weight: 600; }
.mono { font-family: 'JetBrains Mono', monospace; }
a { color: var(--accent); }
/* En oscuro, los enlaces se aclaran para que se lean (los acentos profundos como Inframundo no contrastan) */
:where(:root[data-mode="oscuro"]) a { color: color-mix(in srgb, var(--accent) 68%, #fff); }
@media (prefers-color-scheme: dark) { :where(:root[data-mode="auto"]) a { color: color-mix(in srgb, var(--accent) 68%, #fff); } }
button { font-family: inherit; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   Shell de la app
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 248px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; text-decoration: none; color: inherit; }
/* El logo es fijo (la ilustración de la pareja): no cambia con los colores de cada perfil */
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; display: block;
  background: #1a0b0b; box-shadow: 0 6px 14px -6px rgba(90, 10, 10, .55), 0 0 0 1px rgba(201, 162, 74, .45);
}
.brand h1 { font-size: 18.5px; }
.brand span { display: block; font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  color: var(--ink-soft); padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav .ic {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); transition: background .15s ease, color .15s ease;
}
.nav .ic svg.i { width: 15px; height: 15px; }
.nav a:hover { color: var(--ink); background: var(--surface-soft); }
.nav a.active { color: var(--ink); font-weight: 600; }
.nav a.active .ic { background: var(--accent); color: #fff; }
.nav .soon { margin-left: auto; font-size: 9.5px; font-weight: 600; color: var(--ink-faint); letter-spacing: .02em; }

.household-card {
  margin-top: auto; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.household-card:hover { background: var(--surface-soft); }
.avatars { display: flex; }
.av {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--blue)); flex: none;
}
.avatars .av + .av { margin-left: -8px; background: linear-gradient(135deg, var(--pink), var(--coral)); }
.household-card .txt { font-size: 11.5px; color: var(--ink-soft); line-height: 1.3; min-width: 0; }
.household-card .txt b { color: var(--ink); display: block; font-size: 12.5px; }

/* ---------- main + topbar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Sin overflow: hidden, para que los menús (avisos, usuario) puedan salir de la barra */
.topbar {
  position: relative; z-index: 20;
  padding: 26px 40px 22px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle 240px at calc(100% - 30px) 0, color-mix(in srgb, var(--accent) 12%, transparent), transparent 100%);
}
/* z-index: el menú del usuario y la campanita quedan encima de la fila del título (view-transition-name crea capa propia) */
.topbar-top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
/* Logo en la barra superior: solo en celular (en escritorio está en la barra lateral) */
.top-logo { display: none; }
.top-logo img {
  width: 34px; height: 34px; border-radius: 10px; object-fit: cover; display: block; background: #1a0b0b;
  box-shadow: 0 6px 14px -6px rgba(90, 10, 10, .55), 0 0 0 1px rgba(201, 162, 74, .45);
}
.eyebrow {
  margin-right: auto;
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 100px; padding: 5px 12px 5px 10px; background: var(--surface);
}
.eyebrow .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); position: relative; }
.eyebrow .pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--green); opacity: .35;
  animation: pulse 2s ease-out infinite;
}
.topbar-row { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.topbar h2 { font-size: 30px; }
.topbar .sub { font-size: 13px; color: var(--ink-soft); margin-top: 5px; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 100px; padding: 4px 12px 4px 4px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.user-btn:hover { background: var(--surface-soft); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: 6px;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; text-decoration: none;
  background: none; border: none; padding: 9px 10px; border-radius: 9px; font-size: 13px; color: var(--ink); cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-soft); }
.dropdown hr { border: none; border-top: 1px solid var(--line); margin: 5px 0; }

.content { padding: 32px 40px 64px; animation: fade .3s ease; }

/* ---------- barra inferior (móvil) ---------- */
.bottom-nav, .fab, .sheet-backdrop { display: none; }

/* ==========================================================================
   Primitivas
   ========================================================================== */
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card.hover { transition: box-shadow .2s ease, transform .2s ease; }
.card.hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { font-size: 15px; margin-bottom: 4px; }
.card .card-sub { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 16px; }

.tag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 4px 10px; border-radius: 100px;
  background: var(--surface-soft); color: var(--ink-soft); }
.tag.good { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--warn-text); }
.tag.bad { background: var(--coral-soft); color: var(--bad-text); }
.tag.brand { background: var(--accent-soft); color: var(--accent); }

.alert { font-size: 12.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--green-soft); color: var(--ok-text); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: color-mix(in srgb, var(--t1) 14%, #1B1920); color: #fff; font-size: 13px; font-weight: 500; border: 1px solid rgba(255,255,255,.08);
  padding: 11px 18px; border-radius: 100px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px;
}

/* ---------- formularios ---------- */
.field { margin-top: 14px; }
.field:first-child { margin-top: 0; }
label, .label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=time], input[type=month], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface-soft);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.field-error { font-size: 11.5px; color: var(--danger); margin-top: 5px; }
.hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin-top: 14px; font-weight: 500; }
.check input { accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: none; border-radius: 12px; text-decoration: none;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: var(--surface-soft); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- "Próximamente" ---------- */
.soon-hero {
  position: relative; overflow: hidden; text-align: center; padding: 56px 24px;
}
.soon-hero .big-ic {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent);
}
.soon-hero .big-ic svg.i { width: 30px; height: 30px; stroke-width: 1.7; }
.soon-hero h3 { font-size: 22px; margin-bottom: 8px; }
.soon-hero p { color: var(--ink-soft); max-width: 420px; margin: 0 auto; }

/* ---------- perfil ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.qr-box { display: inline-block; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 6px 0 12px; }
.qr-box svg { display: block; width: 180px; height: 180px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 14px; background: var(--surface-soft);
  border-radius: 12px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; margin: 10px 0; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; }

/* ==========================================================================
   Pantallas de acceso
   ========================================================================== */
.guest { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.guest-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  /* degradado de la paleta (sin sesión: Inframundo), oscuro y en movimiento lento; la ilustración solo va en el logo */
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--t1) 22%, #000) 0%,
      color-mix(in srgb, var(--t1) 70%, #000) 22%,
      color-mix(in srgb, color-mix(in srgb, var(--t2) 55%, var(--t1)) 55%, #000) 42%,
      color-mix(in srgb, var(--t1) 35%, #000) 62%,
      color-mix(in srgb, var(--t1) 75%, #000) 82%,
      color-mix(in srgb, var(--t1) 22%, #000) 100%);
  background-size: 300% 300%;
  animation: guest-flow 22s ease-in-out infinite alternate;
  display: flex; flex-direction: column; justify-content: space-between;
}
@keyframes guest-flow {
  0%   { background-position: 0% 30%; }
  50%  { background-position: 100% 60%; }
  100% { background-position: 40% 100%; }
}
.guest-art::before, .guest-art::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.guest-art::before { width: 520px; height: 520px; top: -180px; right: -160px; }
.guest-art::after { width: 380px; height: 380px; bottom: -160px; left: -120px; opacity: .7; }
.guest-art .brand h1 { color: #fff; }
.guest-art .pitch { position: relative; max-width: 440px; }
.guest-art .pitch h2 { font-size: 40px; line-height: 1.08; margin-bottom: 14px; }
.guest-art .pitch p { font-size: 15px; opacity: .85; margin: 0; }
.module-chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.module-chips span {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500;
  padding: 7px 12px 7px 9px; border-radius: 100px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
}
.module-chips span i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(255,255,255,.7); }

.guest-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.guest-card { width: 100%; max-width: 380px; animation: fade .35s ease; }
.guest-card .brand { display: none; margin-bottom: 26px; padding: 0; }
.guest-card h2 { font-size: 26px; margin-bottom: 6px; }
.guest-card p.sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 24px; }
.guest-card .links { margin-top: 18px; font-size: 13px; text-align: center; }
.guest-card .links a { text-decoration: none; font-weight: 500; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none;
  color: var(--ink-faint); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-soft); }

/* página de error */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; }
.error-page .code { font-family: 'Space Grotesk', sans-serif; font-size: 72px; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h2 { font-size: 22px; margin: 10px 0 6px; }
.error-page p { color: var(--ink-soft); margin: 0 0 22px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .top-logo { display: block; flex: none; }
  .topbar-top .eyebrow { min-width: 0; white-space: nowrap; }
  .topbar-top .eyebrow > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .topbar { padding: 18px 16px 18px; }
  .topbar h2 { font-size: 25px; }
  .content { padding: 18px 16px calc(var(--bottom-nav-h) + 40px); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .user-btn .user-name { display: none; }
  .user-btn { padding: 4px; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; background: none; border: none; color: var(--ink-faint); font-size: 10.5px; font-weight: 600; cursor: pointer;
  }
  .bottom-nav svg.i { width: 21px; height: 21px; }
  .bottom-nav .active { color: var(--accent); }
  .bottom-nav .spacer { flex: 1; }

  .fab {
    display: flex; position: fixed; z-index: 45; left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom) + var(--bottom-nav-h) - 38px);
    width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--bg);
    background: linear-gradient(135deg, var(--violet), var(--pink)); color: #fff; cursor: pointer;
    align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(108,92,231,.35);
  }
  .fab svg.i { width: 24px; height: 24px; stroke-width: 2.4; }

  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(16,16,20,.35); }
  /* La hoja se abre ENCIMA de la barra inferior, que queda visible para cerrar con "Más" */
  .sheet {
    position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); z-index: 55; background: var(--surface);
    border-radius: 22px 22px 0 0; padding: 6px 16px 16px;
    box-shadow: 0 -10px 30px rgba(16,16,20,.12); max-height: calc(85vh - var(--bottom-nav-h)); overflow-y: auto;
  }
  .menu-open .bottom-nav { z-index: 60; }
  .sheet .grip { display: block; width: 60px; height: 22px; margin: 0 auto 4px; padding: 0; border: none; cursor: pointer;
    background: linear-gradient(var(--line), var(--line)) center / 38px 4px no-repeat; border-radius: 8px; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .sheet h4 { font-size: 13px; color: var(--ink-faint); margin: 4px 4px 10px; }
  .sheet-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); display: flex; align-items: center; justify-content: center; cursor: pointer; margin-bottom: 6px; }
  .sheet-close svg.i { width: 18px; height: 18px; }
  .sheet .nav a { padding: 10px; }

  .guest { grid-template-columns: 1fr; }
  .guest-art { display: none; }
  .guest-card .brand { display: flex; }
}

@media (min-width: 861px) {
  .sheet { display: none !important; }
}

@media (max-width: 520px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .codes { grid-template-columns: 1fr; }
}

/* acciones rápidas (hoja del botón +) */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 4px; }
.quick-actions button {
  display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: none; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--ink);
}
.quick-actions .qa-ic {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.quick-actions .qa-ic svg.i { width: 22px; height: 22px; }

/* ==========================================================================
   Finanzas
   ========================================================================== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 12px; }
.section-head h3 { font-size: 17px; }
.section-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.back-link { display: inline-block; font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 14px; color: var(--ink-soft); }
.back-link:hover { color: var(--accent); }

/* ---------- patrimonio (estilo Revolut) ---------- */
.hero { text-align: center; padding: 30px 20px 24px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 220px; pointer-events: none;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.hero > * { position: relative; }
.hero-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.hero-value { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; margin: 6px 0 10px; line-height: 1.1; }
.hero-sub { display: flex; justify-content: center; gap: 6px 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }
.hero-sub b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.hero-actions { max-width: 460px; margin: 24px auto 0; }

/* ---------- tarjetas de cuenta deslizables ---------- */
.acct-rail {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.acct-card {
  flex: 0 0 250px; scroll-snap-align: start; min-height: 158px; border-radius: 20px; padding: 18px;
  color: #fff; text-decoration: none; display: flex; flex-direction: column;
  /* brillo arriba a la derecha + degradado claro → color → oscuro */
  background:
    radial-gradient(120% 95% at 100% 0%, rgba(255,255,255,.30), transparent 52%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--c) 55%, #000), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 38%, color-mix(in srgb, var(--c) 58%, #000) 100%);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 34%, transparent), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.acct-card:hover { transform: translateY(-3px); }
.acct-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.acct-ic { width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.acct-owner { font-size: 11px; font-weight: 600; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 100px; }
.acct-name { font-weight: 600; font-size: 14.5px; }
.acct-type { font-size: 11.5px; opacity: .75; }
.acct-balance { font-size: 22px; font-weight: 600; margin-top: auto; padding-top: 12px; letter-spacing: -0.02em; }
.acct-meta { font-size: 11px; opacity: .8; }
.acct-new {
  --c: var(--ink-faint); background: var(--surface); color: var(--ink-soft); border: 1.5px dashed var(--line);
  box-shadow: none; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 13.5px;
}
.acct-new .acct-ic { background: var(--surface-soft); }

/* ---------- listas ---------- */
.list-card { padding: 6px 18px; }
.list-card.archived { opacity: .65; }
.list-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.row-ic {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 14%, var(--mix)); color: var(--c);
}
.row-main { flex: 1; min-width: 0; }
.row-main b { font-size: 14px; margin-right: 6px; }
.row-main span:not(.tag) { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.row-amount { font-weight: 600; font-size: 14px; text-align: right; white-space: nowrap; }
.row-amount small { display: block; font-family: 'Inter', sans-serif; font-size: 10.5px; color: var(--ink-faint); font-weight: 500; }
.row-amount.neg { color: var(--ink); }
.row-actions { position: relative; }
.icon-btn { border: none; background: none; color: var(--ink-faint); padding: 6px; border-radius: 9px; cursor: pointer; display: flex; }
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.danger-text { color: var(--danger) !important; }

/* ---------- formularios de Finanzas ---------- */
.form-card { max-width: 620px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; padding: 9px 15px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; margin: 0;
  transition: all .15s ease;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.choice.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-weight: 600; }
.money-input input { padding-left: 26px; font-family: 'JetBrains Mono', monospace; }
.credit-box { background: var(--surface-soft); border-radius: 14px; padding: 14px; margin-top: 14px; }
.credit-box input { background: var(--surface); }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; margin: 0;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .15s ease; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.acct-swatches .swatch { width: 34px; height: 34px;
  background: radial-gradient(90% 90% at 100% 0%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 45%, color-mix(in srgb, var(--c) 58%, #000)); }
.icon-pick { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); cursor: pointer; margin: 0; }
.icon-pick.on { background: var(--c, var(--accent)); border-color: transparent; color: #fff; }
.icon-pick svg.i { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .hero-value { font-size: 36px; }
  .acct-card { flex-basis: 78%; }
  .topbar-row .btn { padding: 9px 12px; font-size: 12.5px; }
}
@media (max-width: 400px) { .spaces a { font-size: 12px; padding: 8px 2px; } }
.subnav { display: flex; gap: 4px; margin: -8px 0 22px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.subnav a {
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- pestañas tipo pastilla ---------- */
.pill-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pill {
  padding: 8px 16px; border-radius: 100px; font: inherit; font-size: 13px; font-weight: 600; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; color: var(--ink-soft); transition: all .15s ease;
}
.pill:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pill.on { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }

/* ---------- árbol de categorías ---------- */
.list-row.child { padding-left: 34px; position: relative; }
.list-row.child::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 50%; width: 10px;
  border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); border-bottom-left-radius: 6px; }
.list-row.child .row-ic { width: 32px; height: 32px; }
.list-row.child .row-ic svg.i { width: 14px; height: 14px; }
.list-row.child b { font-weight: 500; font-size: 13.5px; }
.archived-box { margin-top: 22px; }
.archived-box summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 2px 12px; }
.cat-preview { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface-soft); border-radius: 14px; margin-bottom: 18px; }
.cat-preview .row-ic { width: 42px; height: 42px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6D79' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }

/* ==========================================================================
   Captura rápida (estilo Bluecoins)
   ========================================================================== */
.qe-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(16,16,20,.4); }
.qe {
  position: fixed; z-index: 75; background: var(--surface); overflow-y: auto; overscroll-behavior: contain;
  left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 860px);
  border-radius: 24px; padding: 14px 22px 22px; box-shadow: 0 30px 70px rgba(16,16,20,.25);
}
.qe .grip { display: none; width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.qe-enter { transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1); }
.qe-enter-start { opacity: 0; transform: translate(-50%, -46%); }
.qe-leave { transition: opacity .15s ease; }

.qe-types { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.qe-types button:not(.qe-close) {
  border: none; background: var(--surface-soft); color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 100px; cursor: pointer;
}
.qe-types button.on { background: var(--solid); color: var(--on-solid); }
.qe-close { margin-left: auto; border: none; background: none; color: var(--ink-faint); cursor: pointer; padding: 6px; border-radius: 10px; display: flex; }
.qe-close:hover { background: var(--surface-soft); color: var(--ink); }

.qe-amount { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 14px 0 4px; cursor: text; }
.qe-sign { font-family: "JetBrains Mono", monospace; font-size: 30px; font-weight: 600; color: var(--ink-faint); }
.qe-amount input {
  width: 4ch; min-width: 2ch; max-width: 100%; field-sizing: content; border: none; background: none; box-shadow: none; padding: 0; text-align: center;
  font-family: "JetBrains Mono", monospace; font-size: 46px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink);
}
.qe-amount input:focus { box-shadow: none; background: none; }
.qe-amount input::placeholder { color: var(--line); }
.qe-amount.income input, .qe-amount.income .qe-sign { color: var(--green); }
.qe-center { text-align: center; }
/* Nombre del movimiento, justo debajo del monto */
.qe-name { margin: 6px 0 2px; }
.qe-name input { width: 100%; text-align: center; font-size: 16px; font-weight: 600; padding: 10px 12px; }
.qe-name input.invalid { border-color: var(--danger); }
.qe-name .qe-options { justify-content: center; }
.qe-name .field-error { text-align: center; }
/* Aviso de confirmación antes de guardar */
.qe-confirm-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(16,16,20,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qe-confirm {
  position: fixed; z-index: 85; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px); overflow-y: auto; background: var(--surface); border-radius: 20px; padding: 20px 18px 16px;
  box-shadow: 0 30px 70px -20px rgba(16,16,20,.55);
}
.qe-confirm-head { text-align: center; }
.qe-confirm-head .tag.expense { background: var(--danger-soft); color: var(--danger); }
.qe-confirm-head .tag.income { background: color-mix(in srgb, var(--green) 14%, var(--surface)); color: var(--green); }
.qe-confirm-amount { display: block; margin: 8px 0 2px; font-family: "JetBrains Mono", monospace; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }
.qe-confirm-amount.income { color: var(--green); }
.qe-confirm-head h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.qe-confirm-rows { margin: 14px 0 0; border-top: 1px solid var(--line); }
.qe-confirm-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.qe-confirm-rows dt { color: var(--ink-faint); flex: none; }
.qe-confirm-rows dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.qe-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.qe-label { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 8px; }
.qe-sub { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin: 10px 0 8px; }
.qe-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.qe-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px 8px 10px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.qe-chip svg.i { color: var(--c); width: 15px; height: 15px; }
.qe-chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.qe-chip.on svg.i { color: #fff; }

.qe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qe-cat {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px;
  border: 1px solid transparent; background: none; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink);
  text-align: center; line-height: 1.2; position: relative; transition: background .12s ease;
}
.qe-cat:hover { background: var(--surface-soft); }
.qe-cat.on { background: color-mix(in srgb, var(--c) 12%, var(--mix)); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.qe-cat small { position: absolute; top: 6px; right: 8px; color: var(--ink-faint); font-size: 13px; }
.qe-cat-ic {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 14%, var(--mix)); color: var(--c);
}
.qe-cat-ic svg.i { width: 20px; height: 20px; }
.qe-back { border: none; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; padding: 4px 0 10px; }
.qe-suggest {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 8px; padding: 8px 12px 8px 8px;
  border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 7%, var(--mix));
  font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.qe-suggest .qe-cat-ic { width: 34px; height: 34px; }

.qe-more {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 16px; padding: 12px 0 4px;
  border: none; border-top: 1px solid var(--line); background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent);
}
.qe-more .faint { font-weight: 400; font-size: 12px; }
.qe-details { padding-top: 6px; }
.qe-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.qe-options button { border: 1px solid var(--line); background: var(--surface); border-radius: 100px; padding: 5px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.qe-file { font-size: 12.5px; width: 100%; }
.qe-save { margin-top: 18px; }
.btn.qe-save:disabled { opacity: .6; cursor: wait; }
.qe-saving { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 12px 0 0; }

@media (max-width: 860px) {
  .qe {
    left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 92vh;
    border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .qe .grip { display: block; }
  .qe-enter-start { opacity: 0; transform: translateY(40px); }
  .qe-amount input { font-size: 42px; }
}

/* ==========================================================================
   Lista de movimientos
   ========================================================================== */
.day-group { margin-bottom: 16px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.day-head span:first-child::first-letter { text-transform: uppercase; }
.day-head .mono { font-weight: 600; }
.tx-row { text-decoration: none; color: inherit; }
.tx-row:hover b { color: var(--accent); }
.tx-row .row-main span em { font-style: normal; color: var(--ink); }
.tx-tag { font-style: normal; color: var(--accent); margin-left: 3px; }
.pos { color: var(--green) !important; }

.toast-action { border: none; background: rgba(255,255,255,.16); color: #fff; font: inherit; font-weight: 700; font-size: 12.5px;
  padding: 5px 12px; border-radius: 100px; cursor: pointer; margin-left: 4px; }
.toast-action:hover { background: rgba(255,255,255,.26); }

.filters { padding: 14px; margin-bottom: 14px; }
.filters-top { display: flex; gap: 10px; }
.search { position: relative; flex: 1; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.search input { padding-left: 36px; }
.filters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; margin-top: 14px; }
.filters-grid .field { margin-top: 0; margin-bottom: 12px; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.totals div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.totals span { display: block; font-size: 11.5px; color: var(--ink-soft); }
.totals b { font-size: 16px; font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-soft); border-radius: 10px; margin-bottom: 8px; font-size: 13px; }
.attach-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }

@media (max-width: 860px) {
  .filters-grid { grid-template-columns: 1fr 1fr; }
  .totals b { font-size: 13.5px; }
  .qe-grid { gap: 4px; }
}

/* ---------- ajustes móviles: totales y aviso ---------- */
.totals div { min-width: 0; }
.totals b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast { width: max-content; max-width: calc(100vw - 32px); white-space: nowrap; }
.toast > span { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 860px) {
  .toast { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 34px); }
  .totals { gap: 6px; }
  .totals div { padding: 10px; }
  .totals b { font-size: 11.5px; letter-spacing: -0.02em; }
  .totals span { font-size: 11px; }
}

/* ==========================================================================
   Ayuda rápida (x-help)
   ========================================================================== */
.help { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.help-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: none; background: none;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.help-ic { width: 24px; height: 24px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.help-hint { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent); }
.help-body { padding: 0 16px 16px; }
.help-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.help-grid > div { background: var(--surface); border-radius: 12px; padding: 12px 13px; border: 1px solid var(--line); }
.help-grid b { display: block; font-size: 13px; margin-bottom: 4px; }
.help-grid p { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.help-grid p b { display: inline; font-size: inherit; color: var(--ink); margin: 0; }
.help-foot { margin: 12px 2px 0; font-size: 12.5px; color: var(--ink-soft); }
.help-close { display: block; margin: 12px 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--surface); color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }

/* ==========================================================================
   Split de pareja
   ========================================================================== */
.owe-card { text-align: center; padding: 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.owe-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: 15px; }
.owe-line .av { width: 32px; height: 32px; font-size: 13px; }
.owe-amount { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.owe-even { font-family: "Space Grotesk", sans-serif; font-size: 26px; font-weight: 600; }

.month-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 14px; }
.month-nav h3 { font-size: 18px; min-width: 180px; text-align: center; }
.split-grid { align-items: start; }

.split-donut { width: 150px; height: 150px; border-radius: 50%; margin: 16px auto 8px; display: flex; align-items: center; justify-content: center; }
.split-donut .hole { width: 100px; height: 100px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.split-donut .hole b { font-size: 16px; }
.split-legend { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
.split-legend span, .st-head span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.adjust { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.adjust summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.adjust-row { display: flex; justify-content: space-between; font-size: 13px; margin: 14px 0 8px; }
.range { width: 100%; accent-color: var(--accent); }

.split-table { font-size: 13px; margin: 6px 0 10px; }
.st-head, .st-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.st-head { font-weight: 600; color: var(--ink-soft); font-size: 12px; }
.st-row span:not(:first-child), .st-head span:not(:first-child) { text-align: right; justify-content: flex-end; }
.st-row span:first-child { color: var(--ink-soft); }
.st-row.total { border-bottom: none; font-weight: 700; }
.st-row.total span:first-child { color: var(--ink); }
.neg-red { color: var(--danger); }

.split-mini { display: flex; align-items: center; gap: 13px; margin-top: 22px; padding: 14px 18px; text-decoration: none; color: inherit; }
.split-mini .row-main b { display: block; font-size: 14px; }
.split-mini .row-main span { font-size: 12px; color: var(--ink-soft); }
.split-mini > svg.i { color: var(--ink-faint); }
.split-mini:hover { box-shadow: var(--shadow-md); }

@media (max-width: 1100px) {
  .help-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .help-grid { grid-template-columns: 1fr; gap: 8px; }
  .st-head, .st-row { grid-template-columns: 1.2fr 1fr 1fr; font-size: 12px; }
}

/* ==========================================================================
   Meses sin intereses
   ========================================================================== */
.msi-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.msi-list.archived { opacity: .7; }
.msi-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msi-head { display: flex; align-items: center; gap: 12px; }
.msi-bar { height: 8px; border-radius: 100px; background: var(--line); overflow: hidden; }
.msi-bar span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); transition: width .6s ease; }
.msi-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.msi-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); }
.msi-meta b { color: var(--ink); font-weight: 600; }
.msi-chips { margin-top: 8px; gap: 6px; }
.msi-chips .choice { padding: 6px 12px; font-size: 12.5px; }
.msi-preview { display: flex; flex-direction: column; gap: 2px; background: var(--accent-soft); color: var(--accent);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.msi-preview b { font-size: 15px; }
.msi-preview span { font-size: 12.5px; }
fieldset.plain { border: none; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled { opacity: .6; }
.msi-mini { margin-top: 14px; }

@media (max-width: 860px) {
  .msi-list { grid-template-columns: 1fr; }
}
.qe-msi { display: block; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; margin: 2px 0 14px; }
.qe-msi:hover { text-decoration: underline; }
.toast-text { display: flex; flex-direction: column; min-width: 0; }
.toast-text > span { overflow: hidden; text-overflow: ellipsis; }
.toast-warning { color: #FCD34D; font-size: 12px; font-weight: 600; white-space: normal; margin-top: 2px; }
.toast.has-warning { border-radius: 16px; }

/* ==========================================================================
   Presupuestos
   ========================================================================== */
.budget-total { padding: 18px 20px; margin-bottom: 16px; }
.bt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.bt-amount { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.bt-amount .faint { font-size: 14px; font-weight: 500; }
.bt-free { text-align: right; }
.bt-free span { display: block; font-size: 12px; color: var(--ink-soft); }
.bt-free b { font-size: 17px; color: var(--green); }
.bt-free.over b { color: var(--danger); }
.bt-note { margin: 10px 0 0; font-size: 12px; color: var(--ink-soft); }

.budget-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.budget-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.budget-card .row-main .tag { margin-top: 4px; }

.budget-bar { position: relative; height: 10px; border-radius: 100px; background: var(--line); }
.budget-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .6s ease; }
.budget-bar.warn > span { background: var(--amber); }
.budget-bar.over > span { background: var(--danger); }
.budget-bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: .45; }

.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.budget-mini .budget-bar { margin-top: 8px; }

@media (max-width: 860px) {
  .budget-list { grid-template-columns: 1fr; }
}
.link-btn { border: none; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.budget-mini { display: block; }
.budget-mini .bm-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ==========================================================================
   Recurrentes y avisos
   ========================================================================== */
.inline-input { display: flex; align-items: center; gap: 10px; }
.inline-input input { width: 90px; }
.inline-input span { font-size: 13px; color: var(--ink-soft); }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.bell-btn:hover { background: var(--surface-soft); }
.bell-btn svg.i { width: 18px; height: 18px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface); }
.bell-panel { width: 360px; max-width: calc(100vw - 24px); padding: 8px; max-height: 70vh; overflow-y: auto; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; font-size: 14px; }
.bell-head .link-btn, .bell-panel .link-btn { width: auto; padding: 0; font-size: 12px; font-weight: 600; color: var(--accent); }
.bell-empty { text-align: center; padding: 18px 10px; margin: 0; font-weight: 600; font-size: 14px; }
.bell-empty span { font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.dropdown a.bell-all { justify-content: center; font-weight: 600; color: var(--accent); font-size: 12.5px; margin-top: 4px; }

.notice { display: flex; gap: 11px; padding: 10px 8px; border-radius: 12px; }
.notice + .notice { border-top: 1px solid var(--line); border-radius: 0; }
.notice.read { opacity: .6; }
.notice .row-ic { width: 32px; height: 32px; }
.notice .row-ic svg.i { width: 16px; height: 16px; }
.notice-main { flex: 1; min-width: 0; font-size: 13px; }
.dropdown .notice-main a, .notice-main a { display: inline; padding: 0; color: var(--ink); text-decoration: none; }
.notice-main a:hover b { text-decoration: underline; }
.notice-main p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.notice-time { display: block; font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.notice-actions { display: flex; gap: 6px; margin-top: 8px; }
.dropdown .notice-actions button.btn { width: auto; display: inline-flex; padding: 6px 12px; font-size: 12px; }
.dropdown .notice-actions button.btn:not(.ghost) { color: #fff; background: var(--accent); }
.dropdown .notice-actions button.btn.ghost:hover { background: var(--line); }
.notices-page .notice { padding: 14px 6px; }
@media (max-width: 560px) {
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-width: none; }
}

/* ==========================================================================
   Tema: colores mate, degradados y sombras teñidas del color personal.
   Va al final para ajustar lo de arriba sin tocar cada componente.
   ========================================================================== */
body {
  background:
    radial-gradient(1100px 520px at 105% -8%, color-mix(in srgb, var(--t2) 13%, transparent), transparent 62%),
    radial-gradient(900px 480px at -8% 108%, color-mix(in srgb, var(--t1) 11%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Tarjetas y rectángulos: borde visible + sombra rosada */
.card, .totals div, .help-grid > div, .household-card, .list-card {
  border: var(--card-border) solid var(--line);
}
.card { box-shadow: var(--shadow-sm); }
.card.hover:hover, .split-mini:hover { box-shadow: var(--shadow-md); }
.totals div { box-shadow: var(--shadow-sm); }

/* Tarjetas destacadas: borde en degradado */
.hero, .owe-card, .budget-total, .help {
  border: var(--card-border) solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  box-shadow: var(--shadow-md);
}
.help { background: linear-gradient(color-mix(in srgb, var(--t1) 4%, var(--surface)), color-mix(in srgb, var(--t2) 5%, var(--surface))) padding-box, var(--grad) border-box; box-shadow: var(--shadow-sm); }
.hero::before { background: radial-gradient(ellipse at center, color-mix(in srgb, var(--t2) 16%, transparent), transparent 70%); }

/* Barra lateral y superior */
.sidebar {
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--t1) 5%, var(--surface)) 100%);
  border-right: 1px solid var(--line);
}
.topbar {
  background: linear-gradient(120deg, var(--surface) 55%, color-mix(in srgb, var(--t2) 7%, var(--surface)));
  border-bottom: 1px solid var(--line);
}
.nav a.active { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.nav a.active .ic { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--t2))); }
.av { background: var(--grad); }
.avatars .av + .av { background: linear-gradient(135deg, var(--t2), var(--t1)); }

/* Botones con degradado y sombra del mismo tono */
.btn {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--t2)));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 75%, transparent);
}
.btn.ghost { background: var(--surface-soft); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; box-shadow: none; filter: saturate(.6); }
.btn:disabled:active { transform: none; }
.choice { border-color: var(--line); }
.choice.on { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--t2))); border-color: transparent;
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent) 80%, transparent); }

/* Pestañas: subrayado en degradado */
.subnav { box-shadow: inset 0 -1.5px 0 var(--line); }
.subnav a { border-bottom: none; }
.subnav a.on { color: var(--accent); background: var(--grad) bottom / 100% 2.5px no-repeat; }

/* Móvil: botón + y hoja de captura */
.fab { background: var(--grad); box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--t1) 75%, transparent); }
.bottom-nav { border-top: 1px solid var(--line); }
.qe { border: var(--card-border) solid var(--line); box-shadow: 0 30px 70px -20px color-mix(in srgb, var(--t1) 55%, rgba(16,16,20,.4)); }
.toast { box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--t1) 70%, transparent); }
.dropdown { border: 1px solid var(--line); box-shadow: var(--shadow-md); }

/* Acceso: panel de color con el degradado personal (por defecto, rosa mate) */

/* ---------- Perfil: colores de la app ---------- */
.theme-card { grid-column: 1 / -1; }
.theme-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.theme-swatch {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font: inherit; text-align: left; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.on { border-color: var(--a); box-shadow: 0 10px 22px -12px var(--a), 0 0 0 3px color-mix(in srgb, var(--a) 18%, transparent); }
.theme-chip { width: 100%; height: 44px; border-radius: 10px; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 8px 16px -10px var(--a); }
.theme-swatch b { font-size: 12.5px; }
.theme-swatch small { font-size: 10.5px; color: var(--ink-faint); }
.theme-custom { margin-top: 4px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 52px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.theme-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--line-strong); }
.theme-preview .card { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.theme-preview .card b { font-size: 13px; }

@media (max-width: 1100px) { .theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   Reportes
   ========================================================================== */
.report-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.report-bar .pill-row { margin-bottom: 0; }
a.pill { text-decoration: none; }
.report-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-range input { width: auto; }
.report-title { margin: 18px 0 14px; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-note { font-size: 12px; color: var(--ink-soft); }
.delta { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.delta small { font-weight: 500; color: var(--ink-faint); margin-left: 3px; }
.delta.good, .cat-delta.good { color: var(--green); }
.delta.bad, .cat-delta.bad { color: var(--danger); }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.report-grid .stack { gap: 16px; }
.report-card { padding: 18px 20px; min-width: 0; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.report-head h3 { margin: 0; }
.report-head .muted { font-size: 12px; }
.report-head .legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-soft); }
.report-head .legend span { display: inline-flex; align-items: center; gap: 5px; }

.donut-wrap { position: relative; height: 230px; margin: 4px 0 12px; }
.chart-box { position: relative; height: 240px; }
.cat-list { display: flex; flex-direction: column; }
.cat-line, .merchant-line { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit; font-size: 13px; border-radius: 8px; }
.cat-line:hover, .merchant-line:hover { background: var(--surface-soft); }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-pct { color: var(--ink-soft); font-size: 12px; width: 44px; text-align: right; }
.cat-line b, .merchant-line b { font-size: 13px; font-weight: 600; min-width: 92px; text-align: right; }
.cat-delta { font-size: 11px; font-weight: 600; color: var(--ink-faint); width: 52px; text-align: right; }
.rank { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }

.person-bar { margin-bottom: 14px; }
.person-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.split-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.split-kinds div { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.split-kinds span { display: block; font-size: 11.5px; color: var(--ink-soft); }
.split-kinds b { font-size: 14px; }

@media (max-width: 1100px) {
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi:last-child { grid-column: 1 / -1; }
  .kpi-value { font-size: 18px; }
  .cat-pct { display: none; }
  .cat-line b, .merchant-line b { min-width: 0; }
}

/* ---------- Exportar ---------- */
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.export-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; padding: 16px 18px;
  transition: box-shadow .2s ease, transform .2s ease; }
.export-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.export-card .row-main span.faint { color: var(--ink-faint); }
@media (max-width: 860px) { .export-grid { grid-template-columns: 1fr; } }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill-export { margin-left: auto; }
@media (max-width: 560px) { .pill-export { margin-left: 0; } }

/* ---------- Perfil: instalar la app ---------- */
.install-card { grid-column: 1 / -1; }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.install-head img { border-radius: 14px; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--t1) 80%, transparent); flex: none; }
.install-head .card-sub { margin: 2px 0 0; }
.install-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.install-steps > div { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-soft); font-size: 13px; }
.install-steps > div.on { border-color: var(--t1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t1) 15%, transparent); }
.install-steps ol { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); line-height: 1.6; }
.install-card .hint { margin-top: 12px; }
@media (max-width: 560px) { .install-steps { grid-template-columns: 1fr; } }

/* ==========================================================================
   Movimientos divididos en varias categorías
   ========================================================================== */
.split-parts { display: flex; flex-direction: column; gap: 10px; }
.split-part { display: grid; grid-template-columns: 1fr 150px 36px; gap: 8px; align-items: center; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
/* 2º renglón: nota + reparto (si solo hay una persona, la nota ocupa todo) */
.split-part .split-note, .split-part .split-who { font-size: 13px; }
.split-part .split-note { grid-column: 1 / 2; }
.split-part .split-who { grid-column: 2 / 4; }
.split-part .split-note:has(+ .split-who[style*="none"]) { grid-column: 1 / -1; }
.split-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding: 10px 12px;
  border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); font-weight: 600; }
.split-total b { font-size: 18px; }
@media (max-width: 560px) {
  /* celular: categoría a todo lo ancho; debajo monto + quitar; luego nota + reparto */
  .split-part { grid-template-columns: 1fr 1fr 32px; }
  .split-part > select:first-of-type { grid-column: 1 / -1; }
  .split-part > .money-input { grid-column: 1 / 3; }
}

/* Fila agrupada en Movimientos (se despliega con sus partes) */
.tx-group > summary { list-style: none; cursor: pointer; }
.tx-group > summary::-webkit-details-marker { display: none; }
.tx-group .tx-parts { border-top: 1px dashed var(--line); padding-left: 22px; background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.tx-group .tx-parts .list-row { padding-top: 9px; padding-bottom: 9px; }
.tx-group .tx-parts .row-ic { width: 30px; height: 30px; }
.tx-group[open] .grp-caret { transform: rotate(90deg); }
.grp-caret { display: inline-block; transition: transform .15s ease; color: var(--ink-faint); margin-left: 4px; }
.grp-badge { display: inline-block; width: fit-content; white-space: nowrap; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
.grp-edit { display: block; text-align: right; font-size: 12.5px; font-weight: 600; padding: 8px 14px; color: var(--accent); }

/* Captura rápida: dividir en varias categorías */
.qe-label:has(.qe-link) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qe-link { border: none; background: none; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; text-transform: none; letter-spacing: 0; }
.qe-split { display: flex; flex-direction: column; gap: 8px; }
.qe-part { display: grid; grid-template-columns: 1fr 32px; gap: 6px; align-items: center; padding: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.qe-part select, .qe-part input { min-width: 0; font-size: 14px; }
.qe-part select, .qe-part .qe-part-note { grid-column: 1 / -1; }
.qe-part .qe-part-note { font-size: 13px; }
.qe-split-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qe-split-foot .btn { padding: 7px 12px; font-size: 13px; }
.qe-left { font-size: 13px; font-weight: 600; color: var(--ok-text, var(--ink-soft)); }
.qe-left.warn { color: var(--warn-text, var(--danger)); }

/* ==========================================================================
   Calendario de Finanzas
   ========================================================================== */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cal-card { padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h3 { margin: 0; font-size: 16px; }
.cal-head .icon-btn { font-size: 22px; line-height: 1; text-decoration: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); padding: 6px 0; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-height: 52px; padding: 7px 0 5px;
  border: 1px solid transparent; border-radius: 12px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.cal-day:hover { background: var(--surface-soft); }
.cal-day.empty { cursor: default; }
.cal-day.today .cal-num { color: var(--accent); font-weight: 800; }
.cal-day.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cal-num { font-size: 14px; font-weight: 600; }
.cal-dots { display: flex; gap: 3px; min-height: 7px; }
.cal-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: 1px; }
.cal-dot.income { background: var(--green); }
.cal-dot.expense { background: var(--danger); }
.cal-dot.transfer { background: var(--blue); }
.cal-dot.scheduled { background: transparent; box-shadow: inset 0 0 0 1.6px var(--violet); }
.cal-month-totals { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.cal-month-totals b { margin-left: 4px; color: var(--ink); }
.cal-month-totals b.pos { color: var(--ok-text); }
.cal-day-title { margin: 0 0 10px; font-size: 15px; }
.cal-detail .day-group:first-of-type .day-head { display: none; } /* el título del día ya lo dice */
.sched-ic { --c: var(--violet); font-size: 16px; }
.cal-sched { margin-bottom: 16px; }
.cal-empty { text-align: center; padding: 22px; color: var(--ink-soft); }
.cal-empty p { margin: 0 0 12px; }
.cal-cards { padding: 6px 16px; }
.cal-cardrow { display: block; padding: 12px 0; color: inherit; text-decoration: none; }
.cal-cardrow + .cal-cardrow { border-top: 1px solid var(--line); }
.cal-cardrow-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cal-cardrow-foot { font-size: 12px; margin-top: 6px; }
@media (max-width: 860px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-card { padding: 12px 8px; }
  .cal-day { min-height: 46px; }
}
.cal-sched .list-row { text-decoration: none; color: inherit; }

/* Etiquetas */
.tag-row { gap: 10px; }
.tag-row .row-main { color: inherit; text-decoration: none; }
.tag-actions { display: flex; gap: 2px; }
.tag-actions form { margin: 0; }
.tag-rename { display: flex; gap: 8px; flex: 1; align-items: center; }
.tag-rename input { flex: 1; min-width: 0; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-suggest button { border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--surface); color: var(--accent);
  border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.qe-repeat .qe-chip { --c: var(--accent); }

/* ==========================================================================
   Navegación por módulos: selector (cuadrícula), menú lateral por espacios y pestañas en celular
   ========================================================================== */
/* Pestañas dentro de la página: solo en celular (en escritorio está la barra lateral) */
.finnav .subnav-space { align-self: center; padding: 0 8px 0 2px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-faint); white-space: nowrap; }
@media (min-width: 861px) { .finnav { display: none; } }

/* Botón "módulo actual" de la barra lateral y de la hoja Menú */
.module-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-faint); font: inherit; box-shadow: var(--shadow-sm); }
.module-switch:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }
.module-switch .ic { width: 32px; height: 32px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; }
.module-switch .ic svg.i { width: 17px; height: 17px; }
.module-switch > svg.i { width: 16px; height: 16px; margin-left: auto; flex: none; }
.module-switch-txt { min-width: 0; line-height: 1.25; }
.module-switch-txt b { display: block; color: var(--ink); font-size: 14px; }
.module-switch-txt small { font-size: 11px; color: var(--ink-faint); }
.sidebar { gap: 16px; }
.module-nav { gap: 1px; }
.nav-space { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); padding: 12px 10px 4px; }
.nav-space:first-child { padding-top: 0; }
.module-nav a { padding: 6px 10px; }
.module-nav .ic { width: 26px; height: 26px; }
.sheet-switch { margin-bottom: 8px; }
.sheet .module-nav { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; }
.sheet .module-nav .nav-space { grid-column: 1 / -1; }
.sheet-extra { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Selector de módulos (estilo "app launcher"): ventana centrada en PC, hoja inferior en el celular */
.launcher-btn { color: var(--ink-soft); }
.launcher-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(16,16,20,.34); backdrop-filter: blur(3px); }
.launcher { position: fixed; z-index: 75; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 48px)); max-height: calc(100vh - 64px); overflow-y: auto; overflow-x: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px 22px; box-shadow: var(--shadow-md);
  scrollbar-width: thin; }
.launcher-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.launcher-head h3 { margin: 0; font-size: 18px; }
.launcher-hello p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.launcher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.launcher-item { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-width: 0; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.launcher-item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.launcher-item .ic { width: 42px; height: 42px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.launcher-item .ic svg.i { width: 20px; height: 20px; }
.launcher-item.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.launcher-item.on .ic { background: var(--grad); color: #fff; }
.launcher-txt { min-width: 0; line-height: 1.3; }
.launcher-txt b { display: block; font-size: 14.5px; }
.launcher-txt small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.launcher-item.soon { background: var(--surface-soft); box-shadow: none; }
.launcher-item.soon b, .launcher-item.soon .ic { opacity: .5; }
.launcher-item.soon small { color: var(--ink-faint); }
@media (max-width: 860px) {
  .launcher { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; max-height: 85vh; border-radius: 22px 22px 0 0;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
  .launcher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .launcher-item { gap: 8px; padding: 12px; }
  .launcher-btn { display: none; } /* en el celular se cambia desde "Menú" */
}

/* ==========================================================================
   Módulo Calendario
   ========================================================================== */
.ev-grid .cal-day { min-height: 92px; align-items: stretch; padding: 5px 4px; gap: 3px; text-align: left; }
.ev-grid .cal-day .cal-num { text-align: center; }
.ev-grid .cal-day.other { opacity: .45; }
.ev-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-chip { display: block; font-size: 11px; font-weight: 600; line-height: 1.35; padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--ink));
  border-left: 3px solid var(--c); }
.ev-more { font-size: 10.5px; color: var(--ink-faint); padding-left: 4px; }
.ev-dots { display: none; justify-content: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--ink-soft); text-decoration: none; background: var(--surface); }
.cal-legend-item.off { opacity: .45; text-decoration: line-through; }
.cal-day-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cal-day-title-row .cal-day-title { margin: 0; }
.cal-day-title-row .btn { padding: 6px 12px; font-size: 13px; }

/* Fila de evento */
.ev-row { position: relative; text-decoration: none; color: inherit; gap: 12px; }
.ev-row .ev-bar { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--c); }
.ev-row .ev-time { flex: none; width: 88px; font-size: 12px; color: var(--ink-soft); padding-left: 8px; }
.ev-row.masked { color: var(--ink-soft); cursor: default; }
.ev-row.masked .ev-bar { background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); }
.ev-who { display: flex; }
.ev-who .av { width: 24px; height: 24px; font-size: 10px; }
.ev-who .av + .av { margin-left: -7px; }

/* Semana */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 180px; box-shadow: var(--shadow-sm); }
.week-day.today { border-color: var(--accent); }
.week-day header { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.week-day header span { font-size: 12px; color: var(--ink-faint); font-weight: 700; text-transform: uppercase; }
.week-day header b { font-size: 18px; }
.week-day.today header b { color: var(--accent); }
.week-day header .icon-btn { margin-left: auto; font-size: 18px; line-height: 1; text-decoration: none; }
.week-day .ev-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 6px 6px 12px; }
.week-day .ev-row .ev-time { width: auto; padding: 0; }
.week-day .ev-row .ev-who { display: none; }
.week-empty { margin: 8px 4px; color: var(--ink-faint); }

/* Formulario de evento */
.weekday-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picks label { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-weight: 700; cursor: pointer; margin: 0; background: var(--surface); }
.weekday-picks label.on { background: var(--accent); border-color: transparent; color: var(--on-solid, #fff); }
.ev-repeat { padding: 12px 14px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--line); margin-bottom: 16px; }
.ev-custom-reminder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--line); }
.ev-custom-reminder input { width: 80px; }
.ev-custom-reminder select { width: auto; flex: 1 1 140px; }
.choice .choice-x { margin-left: 7px; font-size: 15px; line-height: 1; opacity: .85; }
.ev-scope { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }

/* Cumpleaños y calendarios */
.bday-row { text-decoration: none; color: inherit; }
.bday-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: color-mix(in srgb, var(--amber) 16%, var(--surface)); flex: none; }
.bday-when { font-size: 13px; font-weight: 600; color: var(--ink-soft); font-family: inherit; }
.bday-when.soon { color: var(--accent); }
.cal-row { gap: 12px; flex-wrap: wrap; }
.cal-swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.cal-edit { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 220px; }
.cal-palette { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-new { margin-top: 18px; }
.cal-new h3 { margin: 0 0 12px; font-size: 16px; }

@media (max-width: 860px) {
  .ev-grid .cal-day { min-height: 50px; align-items: center; }
  .ev-chips { display: none; }
  .ev-dots { display: flex; }
  .week-grid { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .ev-row .ev-time { width: 64px; }
}

/* ==========================================================================
   Apartados (Presupuestos → Mis apartados)
   ========================================================================== */
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); }
.seg-tabs a { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.seg-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.alloc-card { border-left: 4px solid var(--c); }
.alloc-pct { display: grid; place-items: center; min-width: 46px; height: 38px; padding: 0 6px; border-radius: 11px; font-size: 13px; font-weight: 700;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.alloc-card .row-main .tag { margin: 4px 4px 0 0; }
.alloc-left { text-align: right; font-size: 17px; font-weight: 600; white-space: nowrap; }
.alloc-left small { display: block; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.alloc-bar > span { position: absolute; left: 0; top: 0; }
.alloc-bar > span.sched { border-radius: 0 100px 100px 0; opacity: .38; }
.alloc-bar.ok > span.sched { background: var(--green); }
.alloc-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-soft); }
.alloc-foot b { color: var(--ink); font-weight: 600; }

.alloc-rows { display: flex; flex-direction: column; gap: 10px; }
.alloc-row { display: grid; grid-template-columns: 28px 1fr 96px 36px; gap: 8px; align-items: center; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.alloc-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.alloc-percent { position: relative; }
.alloc-percent input { padding-right: 24px; text-align: right; font-family: 'JetBrains Mono', monospace; }
.alloc-percent span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-weight: 600; }
.alloc-extra { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.alloc-extra .check { margin-top: 0; }
.alloc-extra select { flex: 1 1 180px; font-size: 13px; }
.alloc-amount { font-size: 13px; color: var(--ink-soft); min-width: 90px; }
.alloc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.split-total.over { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }

.alloc-cats { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.alloc-cat { display: grid; grid-template-columns: 1fr minmax(150px, 220px); gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.alloc-cats > .alloc-cat:first-child { border-top: 0; }
.alloc-cat-name { font-size: 14px; font-weight: 500; }
.alloc-cat select { font-size: 13px; }
.alloc-sub { grid-column: 1 / -1; font-size: 13px; }
.alloc-sub summary { cursor: pointer; color: var(--ink-soft); font-size: 12px; }
.alloc-sub .alloc-cat { padding: 6px 0 6px 14px; border-top: 1px dashed var(--line); }
.alloc-sub .alloc-cat-name { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 560px) {
  .alloc-row { grid-template-columns: 26px 1fr 80px 32px; }
  .alloc-cat { grid-template-columns: 1fr; gap: 4px; }
  .seg-tabs { display: flex; }
  .seg-tabs a { flex: 1; text-align: center; }
}
.alloc-mini { flex-wrap: wrap; }
.alloc-mini-list { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 4px; }
.alloc-mini-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 84px; gap: 10px; align-items: center; font-size: 12px; }
.alloc-mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.alloc-mini-row .budget-bar { height: 7px; }
.alloc-mini-left { text-align: right; }

/* Rangos rápidos de fechas (Movimientos) */
.range-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
.range-chips::-webkit-scrollbar { display: none; }
.range-chip { flex: none; padding: 6px 12px; border-radius: 100px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); }
.range-chip.on { color: #fff; background: var(--grad); border-color: transparent; }

/* ==========================================================================
   Cuentas por banco, página de cuenta y montos ocultos
   ========================================================================== */
.hide-amounts .sensitive { filter: blur(7px); user-select: none; }
.sensitive { transition: filter .2s ease; }
.eye-btn { display: inline-flex; vertical-align: middle; margin-left: 6px; padding: 3px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.eye-btn:hover { background: var(--surface-soft); color: var(--ink); }
.eye-btn svg.i { width: 16px; height: 16px; }

.acct-card { position: relative; }
.acct-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.acct-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acct-pay { position: relative; z-index: 2; padding: 4px 11px; border-radius: 100px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.18); color: #fff; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.acct-pay:hover { background: rgba(255,255,255,.3); }

.bank-head { display: flex; align-items: baseline; justify-content: space-between; }
.bank-head h3 { letter-spacing: .04em; }
.bank-head span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { text-decoration: underline; }

.acct-hero { max-width: 460px; min-height: 190px; padding: 22px; cursor: default; }
.acct-hero .acct-balance { font-size: 30px; }
.acct-hero:hover { transform: none; }
.acct-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(320px, 1fr); gap: 18px; align-items: start; }
.acct-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.acct-fact { padding: 12px 14px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--line); }
.acct-fact span { display: block; font-size: 12px; color: var(--ink-soft); }
.acct-fact b { font-size: 16px; }
.pay-box { margin-top: 14px; }
.pay-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pay-option { flex: 1 1 150px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font: inherit; color: inherit; }
.pay-option:hover { border-color: var(--accent); }
.pay-option small { display: block; font-size: 11.5px; color: var(--ink-soft); }
.pay-option b { font-size: 15px; }
@media (max-width: 1180px) { .acct-layout { grid-template-columns: 1fr; } .acct-hero { max-width: none; } }

/* Movimientos de cuentas de tu pareja: se ven, no se abren */
.tx-row.readonly { cursor: default; }
.tx-row.readonly:hover { background: transparent; }

/* Guardado seguro: aviso de datos que no se guardaron */
.draft-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line)); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.draft-banner b { display: block; font-size: 14px; }
.draft-banner span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.draft-actions { display: flex; gap: 8px; }
.error-note { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--amber) 14%, var(--surface)); color: var(--ink); }

/* ==========================================================================
   Ajustes de Finanzas: ordenar cuentas, filtros aplicados, tarjetas que llevan a movimientos
   ========================================================================== */
.section-links { display: inline-flex; align-items: center; gap: 14px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.acct-sort { padding: 14px; margin-bottom: 14px; }
.acct-sort-tip { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-soft); }
.acct-sort-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acct-sort-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 4px; border-radius: 14px;
  background: var(--surface-soft); border: 1px solid var(--line); transition: box-shadow .15s ease, transform .15s ease; }
.acct-sort-row.dragging { box-shadow: 0 8px 24px rgba(0,0,0,.18); transform: scale(1.01); border-color: var(--c); }
.acct-sort-handle { cursor: grab; touch-action: none; padding: 6px 8px; font-size: 18px; line-height: 1; color: var(--ink-soft); user-select: none; }
.acct-sort-row.dragging .acct-sort-handle { cursor: grabbing; }
.acct-sort-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.acct-sort-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acct-sort-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sort-main small { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sort-row .icon-btn:disabled { opacity: .3; cursor: default; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 100px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.filter-chip span { font-size: 15px; line-height: 1; }
.filter-chip.clear { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.share-note { margin: -4px 0 14px; font-size: 12.5px; color: var(--ink-soft); }

.budget-card.is-link { position: relative; transition: border-color .15s ease, transform .15s ease; }
.budget-card.is-link:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.budget-card.is-link:active { transform: scale(.995); }
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.budget-card.is-link .row-actions { position: relative; z-index: 2; }
.alloc-more { margin-left: auto; color: var(--accent); font-weight: 600; }

.report-bar .range-chips { margin-top: 0; }

/* Celular: tocar texto no lo selecciona (evita la búsqueda de Google al tocar). Los campos sí se pueden seleccionar. */
@media (hover: none) and (pointer: coarse) {
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  input, textarea, select, [contenteditable], .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
}

/* ==========================================================================
   Calendario · Ver en Google (enlace de suscripción)
   ========================================================================== */
.feed-new { padding: 18px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.feed-warn { margin: 4px 0 12px; font-size: 12.5px; color: var(--ink-soft); }
.feed-url { display: flex; gap: 8px; }
.feed-url input { flex: 1; min-width: 0; font-family: var(--mono, monospace); font-size: 12.5px; }
.feed-quick { margin-top: 10px; }
.feed-status { padding: 14px 16px; margin-bottom: 14px; }
.feed-status .row-main span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.feed-grid { align-items: start; gap: 14px; }
.feed-steps, .feed-form { padding: 18px; }
.feed-steps h3, .feed-form h3 { margin: 0 0 12px; }
.feed-steps ol { margin: 6px 0 14px; padding-left: 20px; font-size: 13.5px; color: var(--ink-soft); }
.feed-steps li { margin: 3px 0; }
.feed-cals { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px 4px; }
.feed-cals .cal-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px; }
.feed-off { margin-top: 14px; }
@media (max-width: 760px) { .feed-grid { grid-template-columns: 1fr; } }

/* Aviso de privacidad (página pública) */
.legal h3 { font-size: 15px; margin: 18px 0 6px; }
.legal p, .legal li { font-size: 14px; line-height: 1.55; color: var(--muted, inherit); }
.legal ul { padding-left: 20px; margin: 6px 0; }

/* Calendario: conexión con Google */
.g-card { padding: 16px 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.g-card .row-main { flex: 1; min-width: 200px; }
.g-card .row-main span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.g-card .g-error { color: var(--danger, #C0504D); }
.g-status.revocado, .g-status.error { border: 1px solid color-mix(in srgb, #D9785F 45%, var(--line)); }
.g-logo { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px; background: var(--surface-2, #f1f1f1); color: #4285F4; }
.g-form { padding: 18px; }
.g-form h3 { margin: 0 0 4px; }
.g-list { display: flex; flex-direction: column; margin: 12px 0 6px; }
.g-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.g-row:first-child { border-top: 0; }
.g-check { flex: 1; min-width: 180px; margin: 0; }
.g-check .cal-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px; flex: none; }
.g-name small { color: var(--ink-soft); }
.g-row select { width: auto; min-width: 190px; }
.g-row select:disabled { opacity: .45; }
@media (max-width: 560px) { .g-row select { width: 100%; } }
.g-hogar .g-logo { color: var(--accent); font-size: 18px; }
.g-on { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin-left: 6px; background: color-mix(in srgb, #4F9A6C 18%, transparent); color: #3d7d56; }

/* ---------- Supermercado: lista compartida ---------- */
.gl-sync { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; margin-bottom: 12px; background: var(--accent-soft); color: var(--ink); }
.gl-sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.gl-sync.off { background: var(--danger-soft); }
.gl-sync.off .dot { background: var(--danger); }
.gl-add { padding: 14px; margin-bottom: 14px; }
.gl-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gl-add-input { position: relative; flex: 1 1 220px; min-width: 0; }
.gl-add-input input { width: 100%; }
.gl-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; }
.gl-suggest button { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--ink); font: inherit; cursor: pointer; }
.gl-suggest button:first-child { border-top: 0; }
.gl-suggest button:hover, .gl-suggest button:focus { background: var(--accent-soft); }
.gl-suggest small { margin-left: auto; color: var(--ink-soft); font-size: 11.5px; }
.gl-qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.gl-qty button { width: 34px; height: 38px; border: 0; background: var(--surface-soft); color: var(--ink); font-size: 18px; cursor: pointer; }
.gl-qty input { width: 52px; border: 0; border-radius: 0; text-align: center; padding: 8px 2px; -moz-appearance: textfield; }
.gl-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.gl-unit { width: auto; }
.gl-new { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
.gl-new select { width: auto; min-width: 180px; }
.gl-note-btn { margin-top: 8px; font-size: 12.5px; }
.gl-add input[x-ref="note"] { margin-top: 8px; width: 100%; }
.gl-frequent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.gl-frequent .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-right: 4px; }
.gl-frequent .chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.gl-frequent .chip:hover { background: var(--accent-soft); }
.gl-aisle { padding: 12px 14px 6px; margin-bottom: 12px; }
.gl-aisle h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; }
.gl-aisle h4 small { margin-left: auto; font-weight: 600; background: var(--surface-soft); border-radius: 99px; padding: 1px 8px; }
.gl-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.gl-aisle h4 + .gl-item, .gl-aisle template + .gl-item { border-top: 0; }
.gl-check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; }
.gl-check.on { background: var(--accent); border-color: var(--accent); }
.gl-check.on span { width: 11px; height: 6px; border: solid var(--on-solid, #fff); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.gl-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 2px 0; font: inherit; color: var(--ink); cursor: pointer; }
.gl-name { display: block; }
.gl-name em { font-style: normal; font-weight: 600; color: var(--accent); margin-left: 4px; font-family: var(--mono, monospace); font-size: .9em; }
.gl-main small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 1px; }
.gl-item.done .gl-name b { text-decoration: line-through; color: var(--ink-soft); font-weight: 500; }
.gl-edit { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 4px 0 6px 38px; }
.gl-edit select { width: auto; }
.gl-edit input[type="text"] { flex: 1 1 160px; }
.gl-edit-actions { display: flex; gap: 6px; }
.gl-cart { opacity: .92; }
.gl-cart .form-actions { margin: 8px 0 8px; }
.gl-counter { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.gl-counter b { font-size: 22px; }
.gl-counter span { color: var(--ink-soft); font-size: 13px; }
.gl-switch { margin: 6px 0 20px; text-align: center; }
/* Modo súper: letras grandes y renglones fáciles de tocar */
.gl-super .gl-item { padding: 12px 0; }
.gl-super .gl-name { font-size: 18px; }
.gl-super .gl-check { width: 36px; height: 36px; }
.gl-super .gl-aisle h4 { font-size: 14px; }

/* Supermercado: productos y pasillos */
.gp-search { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.gp-search input { flex: 1; max-width: 420px; }
.gp-aisle h4 { margin: 4px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); display: flex; gap: 6px; }
.gp-aisle h4 small { margin-left: auto; }
.gp-row { flex-wrap: wrap; }
.gp-edit { flex-basis: 100%; }
.gp-edit-grid { display: grid; grid-template-columns: 64px 1fr 1fr 120px; gap: 8px; margin: 6px 0 8px; }
.gp-edit-grid input[name="brand"], .gp-edit-grid input[name="notes"] { grid-column: span 2; }
.gp-emoji { width: 64px; text-align: center; }
.gp-aisle-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; }
.gp-aisle-edit input[name="name"] { flex: 1 1 180px; }
@media (max-width: 640px) {
  .gp-edit-grid { grid-template-columns: 64px 1fr; }
  .gp-edit-grid select, .gp-edit-grid input[name="brand"], .gp-edit-grid input[name="notes"] { grid-column: span 2; }
  .gl-add-row .btn { flex: 1; }
}

/* Supermercado: terminar compra, historial y ajustes */
.gt .card { margin-bottom: 14px; }
.gt-total { font-size: 22px; font-family: var(--mono, monospace); }
.gt-pay h3, .gt-items h3 { margin: 0 0 10px; }
.gt-items h3 small { color: var(--ink-soft); font-weight: 500; }
.gt-pay-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.gt-pay h3 + .gt-pay-row { border-top: 0; }
.gt-pay-row .row-main { flex: 1; min-width: 200px; }
.gt-pay-row .row-main span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.gt-pay-row .row-main select { margin-top: 6px; max-width: 320px; }
.gt-amount { width: 140px; text-align: right; }
b.gt-amount { font-size: 17px; }
.gt-summary { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.gt-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.gt-item .gt-name { flex: 1; min-width: 0; }
.gt-item em { font-style: normal; color: var(--accent); font-weight: 600; margin-left: 4px; }
.gt-item input { width: 130px; text-align: right; }
.gt-month .section-head { margin-bottom: 4px; }
.gs-locked { padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); }
.gt-pay-row input.gt-amount { width: 140px; flex: none; }

/* Supermercado: reseñas */
.stars { color: var(--line-strong); letter-spacing: 1px; white-space: nowrap; }
.stars .on { color: var(--amber, #CC9A45); }
.rv-pending { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; text-decoration: none; color: inherit; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.rv-pending > span:first-child { font-size: 24px; }
.rv-pending .row-main { flex: 1; }
.rv-pending .row-main span { display: block; font-size: 12.5px; color: var(--ink-soft); }
.rv-go { font-weight: 600; color: var(--accent); }
.rv-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rv-filters input { flex: 1 1 200px; }
.rv-filters select { width: auto; }
.rv-aisle { margin: 18px 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.rv-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 12px; text-decoration: none; color: inherit; transition: transform .12s ease; }
.rv-card:hover { transform: translateY(-2px); }
.rv-card.rv-no { border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); }
.rv-emoji { font-size: 34px; line-height: 1.1; }
.rv-name { font-size: 14.5px; }
.rv-brand { color: var(--ink-soft); font-size: 12px; margin-top: -2px; }
.rv-card .stars { font-size: 15px; }
.rv-people { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 11.5px; color: var(--ink-soft); }
.rv-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 4px; font-size: 11.5px; }
.rv-meta span { background: var(--surface-soft); border-radius: 99px; padding: 2px 8px; }
.rv-rebuy.si { background: var(--green-soft); }
.rv-rebuy.tal_vez { background: var(--amber-soft); }
.rv-rebuy.no { background: var(--danger-soft); }
.pv-grid { align-items: start; gap: 14px; }
.pv-form h3 { margin: 0 0 12px; }
.pv-stars { display: flex; gap: 4px; }
.pv-stars button { font-size: 32px; line-height: 1; background: none; border: 0; padding: 2px; cursor: pointer; color: var(--line-strong); }
.pv-stars button.on { color: var(--amber, #CC9A45); }
.pv-rebuy { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-rebuy .choice input { position: absolute; opacity: 0; pointer-events: none; }
.pv-attr label b { font-weight: 600; color: var(--accent); margin-left: 6px; }
.pv-attr input[type="range"] { width: 100%; padding: 0; }
.pv-reviews .section-head .stars { font-size: 16px; }
.pv-reviews form { padding: 6px 0 4px; }
.gl-sug-stars { color: var(--amber, #CC9A45); font-size: 11.5px; }
.gl-warn, .gl-sug-warn { font-size: 12px; }
.gp-attrs { margin-top: 6px; }
@media (max-width: 760px) { .pv-grid { grid-template-columns: 1fr; } }

/* Supermercado: despensa */
.pn-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.pn-stats .card { padding: 12px 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.pn-stats b { font-size: 22px; font-family: var(--mono, monospace); }
.pn-stats span { font-size: 12px; color: var(--ink-soft); }
.pn-stats .warn { border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); }
.pn-stats .warn b { color: var(--danger); }
.pn-add { padding: 16px; margin-bottom: 14px; }
.pn-add h3 { margin: 0 0 10px; }
.pn-add-grid { display: grid; grid-template-columns: 1fr 80px 80px 170px 150px auto; gap: 8px; align-items: center; }
.pn-row { flex-wrap: wrap; }
.pn-row .row-main em { font-style: normal; color: var(--accent); font-weight: 600; margin-left: 4px; }
.pn-actions { display: flex; gap: 6px; align-items: center; }
.pn-actions form { margin: 0; }
.pn-edit { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 6px 0; }
.pn-edit input[type="number"] { width: 80px; }
.pn-edit select, .pn-edit input[type="date"] { width: auto; }
.pn-remove { flex-basis: 100%; padding-bottom: 6px; }
.pn-badge { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 1px 8px; margin-right: 4px; background: var(--surface-soft); }
.pn-badge.vencido { background: var(--danger-soft); color: var(--danger); }
.pn-badge.pronto { background: var(--coral-soft, var(--danger-soft)); color: var(--coral, var(--danger)); }
.pn-badge.semana { background: var(--amber-soft); }
.pn-trip { padding: 16px; margin-top: 14px; }
.pn-trip h3 { margin: 0 0 4px; }
.pn-trip-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pn-trip-row .check { flex: 1 1 180px; margin: 0; }
.pn-trip-row select, .pn-trip-row input[type="date"] { width: auto; }
.pn-trip-row :disabled { opacity: .45; }
@media (max-width: 760px) {
  .pn-stats { grid-template-columns: repeat(2, 1fr); }
  .pn-add-grid { grid-template-columns: 1fr 1fr; }
  .pn-add-grid input[name="name"] { grid-column: span 2; }
  .pn-actions { flex-basis: 100%; justify-content: flex-end; }
}

/* ---------- Supermercado: ajustes tras la simulación ---------- */
/* Emojis en las pantallas vacías (el estilo base es para íconos de línea) */
.soon-hero .big-ic { font-size: 30px; line-height: 1; }
/* Renglones que son enlace: como los demás renglones, sin subrayado ni color de enlace */
a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.row-link b, a.row-link { color: inherit; text-decoration: none; }
a.row-link:hover { text-decoration: underline; }
/* Tarjetas seguidas: con aire entre ellas */
.s-super .list-card + .list-card, .s-super .list-card + form.card, .s-super .pv-grid .card + .card { margin-top: 14px; }
/* Estrellas y etiquetas dentro de un renglón: en línea (la regla general vuelve bloque los span) */
.row-main span.stars, .row-main .stars span { display: inline; margin: 0; font-size: inherit; }
.row-main .stars span.on, .stars .on { color: var(--amber, #CC9A45); }
.row-main span.pn-badge { display: inline-block; margin: 0 4px 0 0; }
/* Terminar compra: etiquetas a la misma altura */
.gt .grid { align-items: end; }
/* Nuevo pasillo / editar pasillo */
.gp-aisle-edit .gp-emoji, input.gp-emoji { width: 64px; flex: none; text-align: center; }
.gp-aisle-form { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.gp-aisle-form .gp-line { display: flex; gap: 8px; }
.gp-aisle-form .gp-line input[name="name"] { flex: 1; min-width: 0; }
.gp-aisle-form label.hint { margin: 0; }
.list-row.editing { flex-wrap: wrap; }
/* Barras de atributos con el color de la app; sin calificar se ven tenues */
.pv-attr input[type="range"] { accent-color: var(--accent); }
.pv-attr input[type="range"].unset { opacity: .35; }
/* Despensa: agregar se acomoda solo */
.pn-add-grid { display: flex; flex-wrap: wrap; }
.pn-add-grid input[name="name"] { flex: 1 1 220px; }
.pn-add-grid input[name="quantity"] { width: 80px; }
.pn-add-grid select { width: auto; }
.pn-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.pn-date input { width: auto; }
/* Reseñas: filtros en celular */
@media (max-width: 640px) {
  .rv-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .rv-filters input { grid-column: span 2; }
  .rv-filters select { width: 100%; }
  /* "Lo de siempre" en una sola fila deslizable */
  .gl-frequent { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .gl-frequent::-webkit-scrollbar { display: none; }
  .gl-frequent .chip { flex: none; }
  .pn-add-grid input[name="name"] { flex-basis: 100%; }
}

/* ==========================================================================
   Hojas y ventanas: la página de atrás no se mueve y el scroll no "se escapa" al llegar al fondo
   ========================================================================== */
html.qe-lock, html.qe-lock body, body.no-scroll { overflow: hidden; }
.sheet, .launcher, .qe, .qe-confirm { overscroll-behavior: contain; }
@supports (height: 100dvh) {
  @media (max-width: 860px) { .sheet { max-height: calc(85dvh - var(--bottom-nav-h)); } }
  .launcher { max-height: calc(100dvh - 64px); }
}
/* El título y la × de la hoja Menú se quedan arriba al desplazarse */
.sheet .sheet-head { position: sticky; top: -6px; z-index: 2; background: var(--surface); margin: 0 -16px; padding: 4px 16px 0; }

/* ==========================================================================
   Fecha y hora: mismo aspecto que los demás campos (en iOS y Android), con su ícono a la derecha.
   Tocar cualquier parte del campo abre el selector (ver app.js).
   ========================================================================== */
input[type=date], input[type=time], input[type=month], input[type=datetime-local] {
  -webkit-appearance: none; appearance: none; position: relative; display: block; min-height: 44px; line-height: 20px;
  text-align: left; cursor: pointer; padding-right: 40px;
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6D79' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
}
input[type=time] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6D79' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value,
input[type=month]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit, input[type=datetime-local]::-webkit-datetime-edit { padding: 0; }
/* El ícono nativo se vuelve invisible pero sigue respondiendo encima del nuestro */
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator {
  position: absolute; right: 0; top: 0; width: 44px; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
input[type=date]:disabled, input[type=time]:disabled { cursor: default; opacity: .55; }

/* ==========================================================================
   Teclado-calculadora del monto (captura rápida)
   ========================================================================== */
.qe-amount { min-height: 60px; border-radius: 16px; padding: 4px 10px; cursor: pointer; }
.qe-amount:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qe-expr { font-family: "JetBrains Mono", monospace; font-size: 46px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; text-align: center; }
.qe-expr.long { font-size: 34px; }
.qe-expr.longer { font-size: 24px; }
.qe-expr.empty { color: var(--line-strong, var(--line)); }
.qe-amount.income .qe-expr { color: var(--green); }
.qe-caret { width: 2px; height: 38px; margin-left: 2px; background: var(--accent); border-radius: 2px; animation: qe-blink 1s steps(1) infinite; }
@keyframes qe-blink { 50% { opacity: 0; } }
.qe-result { text-align: center; margin: 0 0 2px; font-family: "JetBrains Mono", monospace; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.qe-pad {
  position: sticky; bottom: -22px; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px;
  margin: 16px -22px -22px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface-soft) 85%, var(--surface)); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px -14px rgba(16,16,20,.25);
}
.qe-key {
  height: 50px; border: none; border-radius: 13px; background: var(--surface); color: var(--ink); cursor: pointer;
  font-family: "JetBrains Mono", monospace; font-size: 21px; font-weight: 600; box-shadow: 0 1px 0 var(--line);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none;
}
.qe-key:active { transform: scale(.96); background: var(--surface-soft); }
.qe-key.op { background: var(--accent-soft); color: var(--accent); font-size: 23px; }
.qe-key.fn { color: var(--ink-soft); font-size: 18px; }
.qe-key.ok { grid-column: span 2; background: var(--accent); color: var(--on-solid, #fff); font-family: inherit; font-size: 16px; }
@media (max-width: 860px) {
  .qe-expr { font-size: 42px; }
  .qe-expr.long { font-size: 32px; }
  .qe-expr.longer { font-size: 22px; }
  .qe-pad { bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 14px -16px calc(-20px - env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Revisión general (celular y PC)
   ========================================================================== */
/* iPhone hace zoom al enfocar un campo con letra menor a 16px: en el celular todos van a 16px */
@media (max-width: 860px) {
  input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=time],
  input[type=month], input[type=datetime-local], input[type=search], input[type=tel], input[type=url], select, textarea { font-size: 16px !important; }
}
/* «Ver ayuda» nunca en dos renglones */
.help-hint { white-space: nowrap; flex-shrink: 0; }
/* Presupuestos / apartados: «de $30,000.00» no se parte; en el celular «Les queda» se alinea a la izquierda al bajar de renglón */
.bt-amount .faint { white-space: nowrap; }
@media (max-width: 520px) {
  .bt-free { text-align: left; }
}
/* Encabezado en el celular: los botones van juntos en un renglón (si no caben junto al título, bajan juntos) */
@media (max-width: 860px) {
  .topbar-row { flex-wrap: wrap; row-gap: 10px; }
  .topbar-actions { flex-wrap: nowrap; flex-shrink: 0; }
}
/* Espaciado parejo en formularios: dentro de una cuadrícula manda el gap (no se suma el margen del campo),
   y una cuadrícula que va después de otro campo lleva el mismo espacio que un campo */
.grid > .field { margin-top: 0; }
form :not(input[type=hidden], template, .sr-only) + :is(.grid, fieldset) { margin-top: 14px; }
/* Botones chiquitos: área para tocar más grande sin cambiar cómo se ven */
.eye-btn, .alloc-dot { position: relative; }
.eye-btn::after, .alloc-dot::after { content: ''; position: absolute; inset: -10px; }

/* ==========================================================================
   Proyectos: pendientes, tablero, detalle, mantenimiento y áreas
   ========================================================================== */
.s-proyectos .list-card + .list-card, .s-proyectos .list-card + details.card, .s-proyectos .card + .card { margin-top: 14px; }

/* Agregar rápido (pendientes y tareas de un proyecto) */
.pj-add { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pj-add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-add-row select, .pj-add-row input[type=date] { width: auto; flex: 1 1 140px; }
.pj-add-row .btn { flex: 0 0 auto; }
.pj-add-inline { margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pj-filters { margin-bottom: 14px; }

/* Renglón de un pendiente */
.pj-task { gap: 12px; }
.pj-task form { margin: 0; }
a.pj-task-main { color: inherit; text-decoration: none; }
a.pj-task-main:hover b { color: var(--accent); }
.pj-task.done b { color: var(--ink-faint); text-decoration: line-through; font-weight: 500; }
.pj-meta { display: flex !important; flex-wrap: wrap; gap: 4px 10px; }
.pj-meta em { font-style: normal; }
.pj-due { font-weight: 600; }
.pj-due.vencido { color: var(--danger); }
.pj-due.hoy { color: var(--accent); }
.pj-proj { color: var(--ink); }
.pj-group.vencido .section-head h3 { color: var(--danger); }
.pj-done summary, .pj-finished summary { list-style: none; cursor: pointer; margin: 0; }
.pj-done summary::-webkit-details-marker, .pj-finished summary::-webkit-details-marker { display: none; }
.pj-done[open] summary, .pj-finished[open] summary { margin-bottom: 6px; }
.pj-done summary h3::after, .pj-finished summary h3::after { content: ' ›'; color: var(--ink-faint); }
.pj-done[open] summary h3::after, .pj-finished[open] summary h3::after { content: ' ⌄'; }
.pj-done-inline { margin-top: 8px; }
.pj-done-inline summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 8px 0; }
.pj-empty { margin: 14px 0 6px; font-size: 13px; }

/* Tablero */
.pj-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pj-col { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj-col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; font-size: 13px; font-weight: 700; }
.pj-col-head small { font-weight: 600; color: var(--ink-faint); }
.pj-col-add { font-size: 12.5px; font-weight: 600; text-decoration: none; color: var(--ink-soft); padding: 6px 4px; border-radius: 10px; text-align: center; border: 1px dashed var(--line-strong, var(--line)); }
.pj-col-add:hover { color: var(--accent); border-color: var(--accent); }
a.pj-card { display: block; padding: 12px 14px; text-decoration: none; color: inherit; border-radius: 14px; }
a.pj-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pj-card.prio-alta { box-shadow: inset 3px 0 0 var(--danger); }
.pj-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pj-card-top b { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.pj-card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
.pj-card-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--ink-soft); }
.pj-card-foot .late { color: var(--danger); font-weight: 600; }
.pj-progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 10px; }
.pj-progress i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.pj-progress.big { height: 10px; margin: 12px 0 4px; }
.pj-finished { margin-top: 18px; }
@media (max-width: 860px) {
  /* En el celular las columnas van una debajo de otra; las vacías quedan en un renglón */
  .pj-board { grid-template-columns: 1fr; gap: 10px; }
  .pj-col.empty { flex-direction: row; align-items: center; justify-content: space-between; padding: 6px 10px; }
  .pj-col.empty .pj-col-head small { display: none; }
  .pj-col.empty .pj-col-add { border: none; padding: 4px 6px; }
}

/* Detalle de un proyecto */
.pj-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pj-status .pill { padding: 7px 13px; }
.pj-summary-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.pj-summary-num { font-size: 24px; font-weight: 700; }
.pj-summary-num .faint { font-size: 14px; font-weight: 500; }
.pj-summary-pct { font-family: "JetBrains Mono", monospace; font-size: 22px; color: var(--accent); }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.pj-facts dt { font-size: 11.5px; color: var(--ink-faint); }
.pj-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }
.pj-notes { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-soft); white-space: normal; }
.pj-delete { margin: 18px 4px 0; text-align: right; }

/* Formularios */
.pj-title-row { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: start; }
.pj-title-row .field { margin-top: 0; }
.pj-emoji-field input, .pj-emoji-input { text-align: center; font-size: 20px !important; padding-left: 6px; padding-right: 6px; }
.pj-every { flex-wrap: wrap; }
.pj-every input { width: 80px; }
.pj-every select { width: auto; flex: 1 1 140px; }

/* Mantenimiento */
.pj-mt { align-items: center; }
.pj-mt.paused { opacity: .6; }
.pj-mt form { margin: 0; flex: none; }
.pj-presets { margin-top: 14px; }
.pj-presets h3 { margin: 0 0 4px; }
.pj-presets .muted { margin: 0 0 12px; font-size: 13px; }
.pj-preset-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* Áreas */
.pj-area { flex-wrap: wrap; }
.pj-area-form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; align-items: center; }
.pj-area-form input[name=name] { flex: 1 1 160px; width: auto; }
.pj-emoji-input { width: 64px !important; flex: none; }
.pj-area-add { margin-top: 14px; }
.pj-area-add h3 { margin: 0 0 10px; }
/* Fecha con su etiqueta adentro («Para …») en los formularios rápidos */
.pj-date { position: relative; display: flex; flex: 1 1 140px; min-width: 0; }
.pj-date span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--ink-faint); pointer-events: none; }
.pj-date input { width: 100%; padding-left: 48px; }
@media (max-width: 860px) {
  .pj-add-row { display: grid; grid-template-columns: 1fr 1fr; }
  .pj-add-row > * { min-width: 0; }
  .pj-add-row .btn { justify-content: center; }
  .pj-add-inline .pj-add-row .btn { grid-column: span 2; }
}
.pj-add-row .pj-date input { width: 100%; min-width: 0; flex: 1 1 auto; }
.pj-date span { z-index: 1; }
.pj-group .section-head, .s-proyectos .list-card > .section-head:first-child, .pj-done summary.section-head, .pj-finished summary.section-head { margin-top: 2px; }
.pj-add-row .pj-date input { background-image: none; padding-left: 44px; padding-right: 8px; }
.pj-add-row select, .pj-add-row .pj-date input, .pj-add-row .btn { height: 46px; min-height: 46px; }
.pj-add-row .pj-date span { left: 10px; font-size: 11.5px; }
.pj-add-row .pj-date input { padding-left: 40px; padding-right: 4px; letter-spacing: -0.01em; }
.pj-title-row input { height: 48px; }
.pj-presets.first { margin-top: 0; }
/* Captura: aviso de que el gasto va para un proyecto */
.qe-project { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; padding: 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); font-size: 13px; }

/* Proyectos fase 2: dinero y cotizaciones */
.pj-money .section-head, .pj-quotes .section-head { margin-top: 2px; align-items: center; }
.pj-money-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pj-money-left { text-align: right; }
.pj-money-left span { display: block; font-size: 12px; color: var(--ink-soft); }
.pj-money-left b { font-size: 17px; color: var(--green); }
.pj-money-left.over b { color: var(--danger); }
.pj-progress.money.warn i { background: var(--amber); }
.pj-progress.money.over i { background: var(--danger); }
.pj-money-hint { font-size: 13px; font-weight: 600; text-decoration: none; }
.pj-movements { margin-top: 10px; border-top: 1px solid var(--line); }
.pj-more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.pj-quote { align-items: flex-start; }
.pj-quote.rechazada { opacity: .6; }
.pj-quote.rechazada .pj-quote-side > b { text-decoration: line-through; }
.pj-quote-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.pj-quote-side > b { font-size: 15px; }
.pj-quote-actions { display: flex; align-items: center; gap: 6px; }
.pj-quote-actions form { margin: 0; }
.pj-quote-add { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pj-quote-add .pj-add-row input[name=provider], .pj-quote-add .pj-add-row input[name=notes] { flex: 2 1 180px; }
.pj-quote-add .pj-add-row input[name=amount] { flex: 1 1 110px; }
.pj-card-money { margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.pj-card-money span { font-weight: 500; color: var(--ink-soft); }
.pj-card-money.over { color: var(--danger); }
.tx-project { font-style: normal; }
@media (max-width: 860px) {
  .pj-quote-add .pj-add-row input[name=provider], .pj-quote-add .pj-add-row input[name=notes] { grid-column: span 2; }
  .pj-quote-add .pj-add-row .btn { grid-column: span 2; }
  .pj-money .section-head .btn { padding: 7px 12px; }
}
/* Avisos (toast) largos: en el celular bajan de renglón en vez de cortarse con «…» */
@media (max-width: 860px) {
  .toast { white-space: normal; border-radius: 16px; }
  .toast > span, .toast-text > span { overflow: visible; text-overflow: clip; }
  .pj-money-left { text-align: left; }
}
.pj-quote + .pj-quote-add { border-top: none; padding-top: 6px; }

/* ==========================================================================
   Proyectos fase 3: proveedores, visitas y material
   ========================================================================== */
.pj-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pj-search .search { flex: 1 1 200px; }
.pj-search select { width: auto; flex: 0 1 200px; }
.pj-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); }
.pj-avatar.big { width: 56px; height: 56px; font-size: 22px; }
.pj-contractor { gap: 12px; }
.pj-phone { font-size: 12.5px; color: var(--ink-soft); flex: none; }
.pj-contact-top { display: flex; gap: 14px; align-items: center; }
.pj-contact-top > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pj-contact-top b { font-size: 17px; }
.pj-contact-top span { font-size: 13px; color: var(--ink-soft); }
.pj-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pj-rating h3 { margin: 0 0 8px; }
.pj-rating input[name=comment] { margin-top: 10px; }
.pj-rating .form-actions { margin-top: 10px; }
.pj-other-rating { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.pj-other-rating p { margin: 4px 0 0; color: var(--ink-soft); }
a.pj-link { color: inherit; text-decoration: none; }
a.pj-link:hover b { color: var(--accent); }

/* Visitas */
.pj-visits .section-head, .pj-materials .section-head { margin-top: 2px; align-items: center; }
.pj-materials .section-head form { margin: 0; }
.pj-visit { gap: 12px; }
.pj-visit.past { opacity: .6; }
.pj-visit-date { width: 44px; flex: none; text-align: center; border-radius: 12px; padding: 5px 0; background: var(--accent-soft); color: var(--accent); line-height: 1.1; }
.pj-visit-date b { display: block; font-size: 17px; }
.pj-visit-date small { font-size: 11px; font-weight: 600; text-transform: uppercase; }

/* Material */
.pj-qty { font-style: normal; font-weight: 500; color: var(--ink-soft); font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.pj-sent { color: var(--accent); font-weight: 600; }
.pj-material-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.pj-material-actions form { margin: 0; }
.pj-material-total { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
.pj-material-add { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pj-material + .pj-material-add, .pj-material-total + .pj-material-add { border-top: none; padding-top: 6px; }
.pj-material-add .pj-add-row input[name=name] { flex: 3 1 200px; }
.pj-material-add .pj-add-row input[name=quantity] { flex: 0 1 80px; width: 80px; }
.pj-material-add .pj-add-row select { flex: 0 1 90px; }
.pj-material-add .pj-add-row input[name=price] { flex: 1 1 120px; }
@media (max-width: 860px) {
  .pj-material-add .pj-add-row input[name=name], .pj-material-add .pj-add-row input[name=price], .pj-material-add .pj-add-row .btn { grid-column: span 2; }
  .pj-material-add .pj-add-row input[name=quantity] { width: auto; }
  .pj-contact-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.ev-project { margin-top: 14px; }

/* Sin doble línea entre el título de la sección y su formulario de agregar */
.section-head + .pj-add, .section-head + form.pj-add { border-top: none; padding-top: 0; margin-top: 0; }
@media (max-width: 860px) { .pj-search select { flex: 1 1 100%; } }

/* ==========================================================================
   Proyectos fase 4: fotos y archivos
   ========================================================================== */
.pj-files .section-head { margin-top: 2px; }
.pj-files-kind { margin: 14px 0 8px; font-size: 13px; color: var(--ink-soft); }
.pj-files-kind small { font-weight: 500; color: var(--ink-faint); }
.pj-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pj-photo { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--surface-soft); }
.pj-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.pj-photo:hover img { transform: scale(1.04); }
.pj-photo-ph { display: grid; place-items: center; height: 100%; font-size: 26px; }
.pj-photo-ph small { display: block; font-size: 10.5px; color: var(--ink-soft); }
.pj-photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11px; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-doc { gap: 12px; }
.pj-doc form { margin: 0; }
.pj-doc-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--danger-soft); color: var(--danger); }
.pj-upload { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pj-file-pick { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px; border: 1.5px dashed var(--line-strong, var(--line));
  border-radius: 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--surface-soft); text-align: center; }
.pj-file-pick:hover { border-color: var(--accent); }
.pj-file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pj-file-pick.small { min-height: 46px; font-size: 13px; flex: 2 1 180px; }
.pj-file-link { color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; }
.pj-inline-upload { display: inline; margin: 0; }
.pj-doc-ic.thumb { overflow: hidden; padding: 0; background: var(--surface-soft); }
.pj-doc-ic.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-doc .icon-btn { flex: none; }
.pj-doc-edit { padding: 0 0 12px 52px; border-bottom: 1px solid var(--line); }
.pj-doc-item:has(+ .pj-upload) .list-row, .pj-doc-item:has(+ .pj-upload) .pj-doc-edit { border-bottom: none; }
.pj-doc-edit input[name=caption], .pj-upload .pj-add-row input[name=caption] { width: auto; flex: 3 1 200px; }
.pj-doc-edit .pj-date, .pj-upload .pj-add-row .pj-date { flex: 1 1 150px; }
.pj-upload .pj-add-row select { flex: 0 1 190px; }
/* «Vence» es más largo que «Para»/«Día»: más espacio para que no se encime con la fecha */
.pj-doc-edit .pj-date input, .pj-upload .pj-date input, .pj-viewer-edit .pj-date input { padding-left: 56px; }
@media (max-width: 860px) {
  .pj-upload .pj-add-row input[name=caption], .pj-upload .pj-add-row .btn { grid-column: span 2; }
  .pj-doc-edit { padding-left: 0; }
  .pj-doc-edit > *, .pj-upload .pj-add-row > * { grid-column: span 2; }
  .pj-quote-add .pj-file-pick.small { grid-column: span 2; }
}

/* Visor de fotos */
.pj-viewer { position: fixed; inset: 0; z-index: 90; background: rgba(10,10,14,.94); display: flex; flex-direction: column;
  padding-top: calc(62px + env(safe-area-inset-top)); }
/* La foto ocupa lo que deja libre la barra de abajo (no se encima con ella) */
.pj-viewer-stage { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 12px; cursor: zoom-out; touch-action: pan-y pinch-zoom; }
.pj-viewer-pic, .pj-viewer-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pj-viewer-thumb { filter: blur(6px); transform: scale(.98); }
.pj-viewer-close, .pj-viewer-nav { z-index: 2; }
.pj-viewer-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.pj-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 34px; cursor: pointer; }
.pj-viewer-nav.prev { left: 8px; }
.pj-viewer-nav.next { right: 8px; }
.pj-viewer-bar { flex: none; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  color: #fff; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; }
.pj-viewer-bar b { display: block; font-size: 14px; }
.pj-viewer-bar small { font-size: 12px; opacity: .75; }
.pj-viewer-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pj-viewer-actions form { margin: 0; }
.pj-viewer-actions .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
.pj-viewer-actions .danger-text { color: #FCA5A5; }
.pj-viewer-edit { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.pj-viewer-edit select, .pj-viewer-edit input { width: auto; flex: 1 1 140px; }

/* Súper fase 5: foto del ticket */
.gt-ticket .pj-file-pick { margin-top: 4px; }
.gt-tickets .pj-photos { margin-bottom: 12px; }
.gt-ticket-photo > a { display: block; height: 100%; }
.gt-ticket-photo img { object-position: top; }
.gt-ticket-del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 18px; line-height: 1; }
.gt-ticket-photo form { margin: 0; }
.gt-ticket-add { margin: 0; }
.attach-row a + a { margin-left: 10px; }
/* Títulos de tarjetas del Súper sin el hueco de 28px arriba (igual que en Proyectos) */
.s-super .list-card > .section-head:first-child { margin-top: 10px; }
.s-super .gt-tickets > .section-head:first-child { margin-top: 0; }

/* Súper: leer el ticket con IA */
.gt-ocr-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.gt-ocr { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); font-size: 13.5px; }
.gt-ocr p { margin: 0 0 6px; }
.gt-ocr-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.gt-ocr-line .row-main { flex: 1 1 160px; min-width: 0; }
.gt-ocr-line .row-main span { font-size: 12px; color: var(--ink-soft); font-family: "JetBrains Mono", monospace; }
.gt-ocr-line select { width: auto; flex: 1 1 100%; }
.gt-ocr-from { display: block; flex-basis: 100%; order: 3; font-size: 11.5px; color: var(--ink-faint); font-family: "JetBrains Mono", monospace; }
.gs-ocr h3 { margin: 0 0 10px; }
.gs-ocr-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 12px; }
.gs-ocr-facts dt { font-size: 12px; color: var(--ink-soft); }
.gs-ocr-facts dd { margin: 2px 0 0; font-weight: 600; }
.gt-item { flex-wrap: wrap; }
.gt-ticket h3 { margin: 0 0 10px; }
.gs-ocr { margin-top: 14px; }

/* Súper → Tiendas */
.gs-store-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--accent-soft); }
.gs-store .list-row { gap: 12px; }
.gs-store-edit { display: flex; flex-direction: column; gap: 8px; padding: 0 0 14px 52px; border-bottom: 1px solid var(--line); }
.gs-store-edit form { margin: 0; }
.gs-store-edit input[name=name] { width: auto; flex: 3 1 200px; }
.gs-store-edit select { flex: 3 1 200px; }
.gs-store-edit .link-btn { align-self: flex-start; }
@media (max-width: 860px) { .gs-store-edit { padding-left: 0; } .gs-store-edit .pj-add-row > * { grid-column: span 2; } }
.gs-store:last-child .gs-store-edit { border-bottom: none; padding-bottom: 6px; }
.gs-store:last-child > .list-row { border-bottom: none; }

/* Súper: escáner de código de barras */
.gl-scan-super { width: 100%; justify-content: center; margin: 0 0 14px; }
.gl-scan { position: fixed; inset: 0; z-index: 95; background: rgba(10,10,14,.6); display: flex; align-items: flex-end; justify-content: center; }
.gl-scan-box { width: min(480px, 100%); max-height: 100dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 861px) { .gl-scan { align-items: center; } .gl-scan-box { border-radius: 22px; } }
.gl-scan-head { display: flex; align-items: center; justify-content: space-between; }
.gl-scan-video { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #000; }
.gl-scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-scan-frame { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid rgba(255,255,255,.85); border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.gl-scan-frame::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ef4444; animation: gl-scan-line 1.6s ease-in-out infinite; }
@keyframes gl-scan-line { 0%, 100% { transform: translateY(-14px); } 50% { transform: translateY(14px); } }
.gl-scan-status { margin: 0; text-align: center; }
.gl-scan-result { display: flex; flex-direction: column; gap: 10px; }
.gl-scan-result p { margin: 0; }
.gl-scan-manual { display: flex; gap: 8px; margin: 0; }
.gl-scan-manual input { flex: 1; min-width: 0; }
.gl-scan .link-btn { align-self: center; }
.gl-add-input { position: relative; }
.gl-add-input > input { padding-right: 52px; }
.gl-scan-btn { position: absolute; right: 5px; top: 5px; width: 42px; height: calc(100% - 10px); max-height: 44px; border: 0; border-radius: 10px;
  background: var(--accent-soft); font-size: 18px; cursor: pointer; padding: 0; }

/* ---------- Nutrición: semana, recetas, qué cocino, ingredientes a la lista ---------- */
form.inline { display: inline; margin: 0; }
.nt-week-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.nt-week-nav { display: flex; align-items: center; gap: 8px; }
.nt-week-nav b { font-size: 15px; min-width: 110px; text-align: center; }
.nt-week-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-week-actions form { margin: 0; }
.nt-first { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nt-first p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.nt-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.nt-day { padding: 14px 16px; scroll-margin-top: 90px; }
.nt-day.today { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow-sm); }
.nt-day.past:not(:target) { opacity: .78; }
.nt-day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.nt-day-head h3 { font-size: 15.5px; }
.nt-day-head h3 small { color: var(--ink-faint); font-weight: 600; margin-left: 4px; }
.nt-entry { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nt-entry form { margin: 0; }
.nt-entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nt-entry-main a { color: inherit; text-decoration: none; }
.nt-entry-main a:hover b { color: var(--accent); }
.nt-entry-main b { font-size: 14px; overflow-wrap: anywhere; }
.nt-entry-main .pj-meta { font-size: 12px; color: var(--ink-soft); }
.nt-meal { font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-faint); }
.nt-entry.done b { color: var(--ink-faint); text-decoration: line-through; font-weight: 500; }
.nt-entry-edit { padding: 10px 0 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.nt-entry-edit > form:last-child { margin: 0; }
.nt-empty { margin: 6px 0 2px; font-size: 13px; color: var(--ink-faint); }
.nt-add { padding-top: 10px; }
.nt-add-btn { margin-top: 8px; font-size: 13.5px; }
.nt-entry-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.nt-entry-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.nt-entry-row > * { min-width: 0; }
.nt-entry-actions { display: flex; align-items: center; gap: 14px; }

.nt-tags { margin-top: -4px; }
.nt-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
a.nt-recipe-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; color: inherit; text-decoration: none; transition: border-color .15s ease; }
a.nt-recipe-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.nt-recipe-emoji { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); }
.nt-recipe-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nt-recipe-main b { font-size: 15px; overflow-wrap: anywhere; }
.nt-recipe-main .pj-meta { font-size: 12px; color: var(--ink-soft); }
.nt-warn { color: var(--warn-text); font-weight: 600; }
.nt-tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.nt-tag-list i { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink-soft); }
.nt-use { font-size: 12px; font-weight: 600; color: var(--warn-text); }
.nt-miss { font-size: 12px; color: var(--ink-soft); }

.nt-recipe { display: flex; flex-direction: column; gap: 14px; }
.nt-recipe .section-head { margin: 0 0 6px; align-items: center; gap: 10px; flex-wrap: wrap; }
.nt-servings { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.nt-servings .icon-btn { font-size: 18px; font-weight: 600; }
.nt-servings b { color: var(--ink); font-size: 15px; }
.nt-ing { gap: 12px; padding: 10px 0; }
.nt-ing-qty { flex: none; width: 76px; font-size: 13px; color: var(--ink-soft); }
.nt-state { flex: none; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 100px; white-space: nowrap; }
.nt-state small { font-weight: 500; margin-left: 4px; }
.nt-state.hay { background: var(--green-soft); color: var(--ok-text); }
.nt-state.lista { background: var(--blue-soft); color: var(--blue); }
.nt-state.falta { background: var(--amber-soft); color: var(--warn-text); }
.pj-meta em.nt-state { padding: 1px 8px; font-size: 11px; }
.nt-pad { padding: 8px 0; }
.nt-recipe-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.nt-recipe-actions form { margin: 0; }
.nt-plan-card .section-head { margin-bottom: 8px; }
.nt-upcoming { margin: 4px 0; font-size: 13.5px; }
.nt-steps h3 { font-size: 17px; margin-bottom: 10px; }
.nt-steps ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.nt-steps li::marker { color: var(--accent); font-weight: 700; }
.nt-notes p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.nt-notes p:last-child { margin-bottom: 0; }
.nt-foot { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-foot .link-btn { font-size: 12.5px; }

.nt-ings-field { border: none; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.nt-ing-row { display: grid; grid-template-columns: minmax(0, 3fr) 70px 86px minmax(0, 2fr) auto auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.nt-ing-row > * { min-width: 0; }
.nt-ing-opt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.nt-ing-opt input { width: auto; }
.nt-ing-add { margin-bottom: 6px; }
.nt-new-tag { display: flex; gap: 8px; margin-top: 8px; max-width: 360px; }
@media (max-width: 860px) {
  .nt-ing-row { grid-template-columns: 58px 90px minmax(0, 1fr) auto; padding: 8px 0 10px; margin: 0; border-bottom: 1px solid var(--line); }
  .nt-ing-row .nt-ing-name { grid-column: 1 / 4; grid-row: 1; }
  .nt-ing-row .icon-btn { grid-column: 4; grid-row: 1; justify-self: end; }
  .nt-ing-row .nt-ing-note { grid-column: 3; grid-row: 2; }
  .nt-ing-row .nt-ing-opt { grid-column: 4; grid-row: 2; }
  .nt-ing-add { margin-top: 10px; }
}

.nt-shop-row { cursor: pointer; gap: 12px; }
.nt-shop-row.off .row-main b { color: var(--ink-faint); font-weight: 500; }
.nt-shop-check { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.nt-shop-qty { flex: none; display: flex; gap: 6px; }
.nt-shop-qty input { width: 74px; padding-left: 10px; padding-right: 6px; }
.nt-shop-qty select { width: 92px; }
.nt-shop-foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
@media (max-width: 560px) {
  .nt-shop-row { flex-wrap: wrap; }
  .nt-shop-row .row-main { flex: 1 1 0; }
  .nt-shop-qty { flex-basis: 100%; padding-left: 34px; }
  .nt-shop-qty input, .nt-shop-qty select { height: 38px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
}
.nt-to-list { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; font-size: 13.5px; }
.nt-to-list input { width: auto; accent-color: var(--accent); }
.nt-expiring { margin-bottom: 4px; }
.nt-expiring h3 { font-size: 15px; margin-bottom: 8px; }
.nt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-chip { font-size: 13px; padding: 5px 10px; border-radius: 100px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line)); }
.nt-chip small { color: var(--warn-text); font-weight: 600; margin-left: 4px; }
.nt-day.mini { padding: 10px 16px; }
.nt-day.mini .nt-day-head { margin: 0; justify-content: flex-start; gap: 10px; }
.nt-day.mini .nt-day-head h3 { font-size: 14px; }
.nt-mini-empty { font-size: 12.5px; color: var(--ink-faint); }
.nt-day.mini .nt-empty { display: none; }
.nt-day.mini { position: relative; }
.nt-day.mini .nt-add-btn { position: absolute; right: 16px; top: 11px; margin: 0; font-size: 12.5px; }

/* ---------- Nutrición fase 2: Mi día, registrar, alimentos ---------- */
.nt-totals { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.nt-kcal { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nt-kcal b { font-size: 30px; letter-spacing: -0.02em; }
.nt-kcal span { font-size: 13px; color: var(--ink-soft); margin-left: 4px; }
.nt-bar { height: 10px; border-radius: 100px; background: var(--surface-soft); border: 1px solid var(--line); overflow: hidden; }
.nt-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad, var(--accent)); }
.nt-bar.thin { height: 6px; margin-top: 4px; }
.nt-macros { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.nt-macro { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nt-macro small { font-size: 11.5px; color: var(--ink-soft); }
.nt-macro b { font-size: 16px; }
.nt-macro b em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.nt-totals .hint { margin: 0; }
.nt-water { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 16px; }
.nt-water-main { display: flex; align-items: center; gap: 10px; }
.nt-water-main > span { font-size: 24px; }
.nt-water-btns { display: flex; align-items: center; gap: 8px; }
.nt-water-btns .icon-btn { font-size: 20px; font-weight: 600; }
.nt-from-plan { margin-bottom: 14px; }
.nt-from-plan h3 { font-size: 15px; margin-bottom: 6px; }
.nt-plan-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.nt-plan-row .row-main { display: flex; flex-direction: column; min-width: 140px; }
.nt-plan-btns { display: flex; gap: 6px; }
.nt-plan-btns form { margin: 0; }
.nt-meal-card { margin-bottom: 12px; scroll-margin-top: 90px; }
.nt-meal-card .section-head { margin: 0 0 4px; align-items: center; }
.nt-meal-card .section-head h3 { font-size: 15.5px; }
.nt-sub { font-size: 13px; color: var(--ink-soft); }
.nt-log { padding: 10px 0; }
.nt-log-edit { padding: 6px 0 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.nt-log-edit form { margin: 0; }
.nt-meal-actions { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 8px; }
.nt-meal-actions form { margin: 0; }
.nt-meal-actions .link-btn { font-size: 13.5px; }

.nt-reg { display: flex; flex-direction: column; gap: 6px; }
.nt-meal-choices .choice { cursor: pointer; }
.nt-search-row { display: flex; gap: 8px; }
.nt-search-row .search { flex: 1; }
.nt-scan-btn { flex: none; width: 48px; padding: 0; justify-content: center; font-size: 18px; }
.nt-results { display: flex; flex-direction: column; margin-top: 8px; }
.nt-result { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.nt-result:hover b { color: var(--accent); }
.nt-result-emoji { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); }
.nt-result-main { display: flex; flex-direction: column; min-width: 0; }
.nt-result-main b { font-size: 14px; overflow-wrap: anywhere; }
.nt-result-main small { font-size: 12px; color: var(--ink-soft); }
.nt-not-found { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.nt-picked { display: flex; flex-direction: column; gap: 10px; }
.nt-picked-head { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.nt-picked-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nt-picked-head small { font-size: 12.5px; color: var(--ink-soft); }
.nt-serv { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-serv .choice { min-width: 46px; justify-content: center; }
.nt-serv input { width: 90px; }
.nt-preview { margin: 0; font-size: 15px; font-weight: 700; color: var(--accent); }
.nt-recipe-emoji.sm { width: 36px; height: 36px; font-size: 18px; border-radius: 11px; }
a.nt-food { color: inherit; text-decoration: none; }
.nt-nutrient-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.nt-off { margin: 12px 2px 0; font-size: 13px; }
.nt-recipe-nutri { margin: 10px 0 0; font-size: 13.5px; }
.nt-picked > .link-btn { align-self: flex-start; }
.nt-meal-actions a.link-btn, .nt-week-nav a.link-btn, .nt-not-found a.link-btn { text-decoration: none; }

/* ---------- Nutrición fase 3: con IA ---------- */
.nt-ai { margin-top: 14px; }
.nt-ai-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.nt-ai-box .hint { margin: 0; }
.nt-label-ai { margin-bottom: 16px; }
.nt-ai-photo { position: relative; display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--accent); cursor: pointer; }
.nt-ai-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.nt-ai-done { margin: 0; font-size: 13px; font-weight: 600; color: var(--ok-text); }
.nt-ai-note { margin: 0; }

/* ---------- Nutrición fase 4: Progreso y peso ---------- */
.nt-prog-chips { margin: 0; }
.nt-prog-grid { margin-bottom: 16px; }
.nt-prog-hit { margin: 10px 0 0; }
.nt-dash { display: inline-block; width: 16px; border-top: 2px dashed var(--ink-soft); vertical-align: middle; }
.nt-prog-days { margin-bottom: 16px; }
.nt-prog-days .section-head { margin: 0 0 4px; }
.nt-prog-day { display: grid; grid-template-columns: minmax(90px, 1.2fr) 1fr 1fr 50px; gap: 10px; align-items: center; font-size: 13.5px; padding: 9px 0; }
.nt-prog-day.empty { color: var(--ink-faint); }
.nt-prog-water { text-align: right; font-size: 12.5px; }
.nt-weight { margin-bottom: 16px; scroll-margin-top: 90px; }
.nt-weight-now { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nt-weight-now b { font-size: 30px; letter-spacing: -0.02em; }
.nt-weight-now b small { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.nt-weight-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.nt-weight-facts .pill { cursor: default; }
.nt-weight-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.nt-weight-form .field { margin: 0; }
.nt-weight-history { margin-top: 12px; }
.nt-weight-history summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.nt-weight-history .list-row { gap: 10px; padding: 6px 0; font-size: 13px; }
.nt-weight-history form { margin: 0; }
@media (max-width: 640px) {
  .nt-weight-form { grid-template-columns: 1fr 1fr; }
  .nt-weight-form .field:last-of-type, .nt-weight-form .btn { grid-column: 1 / -1; }
  .nt-prog-day { grid-template-columns: 1fr auto 44px; }
  .nt-prog-day > :nth-child(3) { display: none; }
}
.nt-prog-link { align-self: flex-start; font-size: 13.5px; text-decoration: none; }
.nt-times { color: var(--ink-soft); font-size: 12.5px; }

/* ---------- Fitness (fase 5): ejercicio y rutinas ---------- */
.nt-move { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.nt-move-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.nt-move-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-soft); }
.nt-move-day small { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; }
.nt-move-day span { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.nt-move-day.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.nt-move-day.on span { color: var(--accent); }
.nt-move-day.today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.nt-move-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-soft); }
.nt-move-facts:empty { display: none; }
.nt-move-form { margin-bottom: 14px; scroll-margin-top: 90px; }
.nt-move-form h3 { font-size: 15.5px; margin: 0; }
.nt-move-form .nt-serv input { width: 80px; }
.nt-move-both { padding-top: 14px; }
.nt-move-list { margin-bottom: 14px; }
.nt-move-list .section-head { margin: 0 0 4px; }
.nt-move-empty { margin: 6px 0 4px; }
.nt-move-history { margin-bottom: 16px; display: flex; flex-direction: column; }
.nt-move-history .section-head { margin: 0 0 6px; }
.nt-move-hrow { display: grid; grid-template-columns: 64px 1fr 56px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; color: inherit; text-decoration: none; }
.nt-move-hrow .nt-bar { margin: 0; }
.nt-move-hrow b { text-align: right; font-size: 12.5px; }
.nt-move-hrow:hover span { color: var(--accent); }
.nt-rt-step { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; font-size: 14.5px; }
.nt-rt-step input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.nt-rt-step.done span { text-decoration: line-through; color: var(--ink-faint); }
.nt-rt-notes { margin: 0; font-size: 14px; white-space: pre-line; }
.nt-rt-done-row { display: flex; align-items: flex-end; gap: 12px; }
.nt-rt-done-row .field { margin: 0; width: 120px; }
.nt-rt-done-row .btn { flex: 1; }
.nt-rt-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.nt-rt-meta .hint { margin: 0; }
.nt-today-move { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 16px; }
.nt-today-move > div { display: flex; align-items: center; gap: 10px; }
.nt-today-move > div > span { font-size: 24px; }
.nt-today-move a { text-decoration: none; }

.nt-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
a.nt-kpi-link { color: inherit; text-decoration: none; }
a.nt-kpi-link:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
@media (max-width: 1100px) { .nt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .nt-kpis .kpi:last-child { grid-column: auto; } }
.nt-prog-day { grid-template-columns: minmax(90px, 1.2fr) 1fr 1fr 90px; }
@media (max-width: 640px) { .nt-prog-day { grid-template-columns: 1fr auto 80px; } }
.nt-today-move .btn { flex: none; white-space: nowrap; }
.nt-today-move > div { min-width: 0; }

/* ==========================================================================
   Entretenimiento
   ========================================================================== */
.en-tabs { margin: 0 0 12px; }
.en-tabs .range-chip small { opacity: .7; margin-left: 3px; font-weight: 500; }
.en-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.en-search { max-width: 420px; }
.en-pills { margin: 0; }
.en-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.en-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.en-card-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; flex: 1; }
.en-card-link:hover b { color: var(--accent); }
.en-poster { position: relative; aspect-ratio: 2 / 3; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--t2) 18%, var(--surface))); display: grid; place-items: center; font-size: 44px; }
.en-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.en-badge { position: absolute; left: 8px; bottom: 8px; font-style: normal; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 100px; background: rgba(20, 18, 24, .78); color: #fff; font-family: "JetBrains Mono", monospace; }
.en-card-main { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.en-card-main b { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.en-meta { font-size: 12px; color: var(--ink-soft); }
.en-stars { color: #D9982B; font-weight: 600; }
.en-who { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.en-where { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.en-where img { width: 22px; height: 22px; border-radius: 6px; }
.en-where em { font-style: normal; font-size: 11px; color: var(--ink-soft); }
.en-quick { margin: 0; padding: 0 12px 12px; }
.en-quick .btn { width: 100%; justify-content: center; }
.en-credit { font-size: 11.5px; color: var(--ink-faint); margin: 8px 2px 16px; }
.en-credit a { color: inherit; }

.en-add { display: flex; flex-direction: column; gap: 4px; }
.en-search-step { display: flex; flex-direction: column; gap: 8px; }
.en-search-step > .link-btn, .en-manual > .link-btn { align-self: flex-start; margin-top: 4px; }
.en-results { display: flex; flex-direction: column; }
.en-result, .en-picked { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.en-picked { border: 0; padding: 0 0 6px; }
.en-result-poster { width: 46px; height: 69px; flex: none; border-radius: 8px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; font-size: 22px; }
.en-picked .en-result-poster { width: 70px; height: 105px; }
.en-result-poster img { width: 100%; height: 100%; object-fit: cover; }
.en-result-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.en-result-main b { font-size: 14.5px; overflow-wrap: anywhere; }
.en-result-main small { font-size: 12px; color: var(--ink-soft); }
.en-result-overview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.en-result .btn, .en-result .link-btn { flex: none; }
.en-no-tmdb { margin: 0 0 4px; }

.en-ficha { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 16px; }
.en-ficha-poster { position: sticky; top: 90px; aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--t2) 18%, var(--surface))); display: grid; place-items: center; font-size: 70px; box-shadow: 0 10px 30px var(--drop, rgba(0,0,0,.12)); }
.en-ficha-poster img { width: 100%; height: 100%; object-fit: cover; }
.en-ficha-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.en-ficha-main > .card { margin: 0; }
.en-ficha-main h3 { font-size: 15px; margin: 0 0 8px; }
.en-status-card { display: flex; flex-direction: column; gap: 12px; }
.en-status-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.en-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 100px; background: var(--accent-soft); color: var(--accent); }
.en-st-vista { background: color-mix(in srgb, var(--green) 15%, var(--surface)); color: var(--ok-text); }
.en-st-dejada { background: var(--surface-soft); color: var(--ink-soft); }
.en-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.en-progress > div { display: flex; flex-direction: column; }
.en-progress b { font-size: 24px; letter-spacing: -0.02em; }
.en-progress form { margin: 0; }
.en-progress .btn small { font-weight: 500; opacity: .85; margin-left: 4px; }
.en-set-progress summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.en-progress-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 8px; }
.en-progress-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.en-progress-form input { width: 96px; }
.en-set-progress .hint { margin: 6px 0 0; }
.en-status-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.en-status-actions form { margin: 0; }
.en-about p { margin: 10px 0 0; font-size: 14px; line-height: 1.55; }
.en-about .nt-tag-list { margin: 0; }
.en-about .en-original { font-size: 12.5px; }
.en-where-row { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.en-where-row > small { width: 64px; flex: none; font-size: 12px; color: var(--ink-soft); padding-top: 6px; }
.en-where-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.en-prov { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 100px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.en-prov img { width: 24px; height: 24px; border-radius: 7px; }
.en-prov.ours { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.en-where-card .hint { margin: 4px 0 0; }
.en-rate-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.en-rate-form input[type=text] { flex: 1; min-width: 180px; }
.en-rate-stars { display: flex; align-items: center; gap: 2px; width: 100%; }
.en-rate-stars button { border: 0; background: none; font-size: 28px; line-height: 1; padding: 2px; cursor: pointer; color: var(--line-strong); }
.en-rate-stars button.on { color: #E0A33A; }
.en-rate-stars .faint { margin-left: 8px; font-size: 12.5px; }
.en-other-rating { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; }
.en-other-rating p { margin: 4px 0 0; color: var(--ink-soft); }
.en-history .section-head { margin: 0 0 4px; }
.en-history .list-row { font-size: 13px; padding: 8px 0; gap: 10px; }
.en-edit summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.en-edit form { margin-top: 4px; }
.en-notes { margin: 0; }
.en-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.en-foot .hint { margin: 0; }

.en-tonight { margin-bottom: 16px; }
.en-tonight .nt-to-list { padding-top: 10px; }
.en-picks-head { margin: 0 0 10px; align-items: center; }
.en-service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 40%), 1fr)); gap: 8px; margin: 8px 0 4px; }
.en-service { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.en-service input { width: auto; accent-color: var(--accent); }
.en-service:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }

@media (max-width: 760px) {
  .en-ficha { grid-template-columns: 1fr; }
  .en-ficha-poster { position: static; width: 150px; justify-self: center; font-size: 50px; }
}
@media (max-width: 520px) {
  .en-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .en-card-main { padding: 8px 10px 10px; }
  .en-quick { padding: 0 10px 10px; }
}
@media (max-width: 760px) { .en-ficha-poster.empty { width: 96px; font-size: 40px; border-radius: 14px; } }

/* Entretenimiento · Estrenos */
.en-rel-head { justify-content: space-between; margin-bottom: 12px; }
.en-rel-head form { margin: 0; }
.en-rel-card { padding-top: 14px; padding-bottom: 4px; }
.en-rel-card h3 { font-size: 15px; margin: 0 0 2px; }
.en-rel-row { color: inherit; text-decoration: none; }
.en-rel-row:hover b { color: var(--accent); }
.en-rel-row .en-who { display: block; }
.en-rel-date { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; min-width: 64px; }
.en-rel-date b { font-size: 15px; font-family: "JetBrains Mono", monospace; white-space: nowrap; }
.en-rel-date small { font-size: 12px; color: var(--ink-soft); }
.en-rel-date.today b, .en-rel-date.today small { color: var(--accent); font-weight: 700; }
.en-next { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: color-mix(in srgb, #D9673F 14%, var(--surface)); color: var(--ink); text-decoration: none; }

/* Entretenimiento · juegos y libros */
.en-bar { height: 8px; border-radius: 100px; background: var(--surface-soft); overflow: hidden; }
.en-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.en-kind { margin-bottom: 6px; }

/* Entretenimiento · Suscripciones */
.en-subs-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.en-subs-total > div { display: flex; flex-direction: column; }
.en-subs-total b { font-size: 26px; letter-spacing: -0.02em; }
.en-sub { display: flex; flex-direction: column; gap: 12px; }
.en-sub.idle { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.en-sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.en-sub-head > div:first-child { min-width: 0; }
.en-sub-head h3 { font-size: 16px; margin: 0 0 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.en-sub-head .faint { font-size: 12.5px; }
.en-sub-idle { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: color-mix(in srgb, var(--amber) 16%, var(--surface)); color: var(--ink); }
.en-sub-cost { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.en-sub-cost b { font-size: 18px; }
.en-sub-cost small { font-size: 11.5px; max-width: 140px; }
.en-sub-titles { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.en-sub-titles a { flex: none; width: 44px; height: 66px; border-radius: 8px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; font-size: 20px; text-decoration: none; }
.en-sub-titles img { width: 100%; height: 100%; object-fit: cover; }
.en-sub-link { display: flex; gap: 8px; align-items: center; margin: 0; }
.en-sub-link select { flex: 1; min-width: 0; }
.en-sub .hint { margin: -4px 0 0; }

/* Entretenimiento · en el celular, los filtros de tipo en un renglón que se desliza */
@media (max-width: 640px) {
    .en-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
    .en-pills::-webkit-scrollbar { display: none; }
    .en-pills .pill { flex: none; }
}
.en-sub, .en-subs-total, .en-rel-card { margin-bottom: 14px; }

/* ==========================================================================
   Vault
   ========================================================================== */
.vt-search { max-width: 520px; margin-bottom: 14px; }
.vt-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.vt-filter-head .back-link { margin: 0; }
.vt-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.vt-cat { display: flex; flex-direction: column; gap: 4px; padding: 16px; color: inherit; text-decoration: none; margin: 0; }
.vt-cat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.vt-cat-ic { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.vt-cat b { font-size: 14px; }
.vt-cat small { font-size: 12px; color: var(--ink-soft); }
.vt-cat.empty { opacity: .62; }
.vt-soon, .vt-group { margin-bottom: 14px; }
.vt-row { color: inherit; text-decoration: none; }
.vt-row:hover b { color: var(--accent); }
.vt-row-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 18px; }
.vt-exp { flex: none; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 100px; background: var(--surface-soft); color: var(--ink-soft); white-space: nowrap; }
.vt-exp-pronto { background: color-mix(in srgb, var(--amber) 18%, var(--surface)); color: var(--ink); }
.vt-exp-vencido { background: color-mix(in srgb, var(--coral) 18%, var(--surface)); color: var(--ink); }
@media (max-width: 640px) { .vt-row { flex-wrap: wrap; } .vt-row .vt-exp { margin-left: 49px; } }

.vt-form .vt-private { margin-top: 10px; }
.vt-fields { display: flex; flex-direction: column; gap: 8px; }
.vt-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto auto; gap: 8px; align-items: center; }
.vt-secret { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.vt-secret input { width: auto; accent-color: var(--accent); }
@media (max-width: 640px) {
    .vt-field-row { grid-template-columns: minmax(0, 1fr) auto auto; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
    .vt-field-row input[type=text]:first-child { grid-column: 1 / -1; }
}
.vt-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.vt-suggest .pill { cursor: pointer; }
.vt-picked { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--ink-soft); }
.vt-lock { margin: 4px 0 0; }
.vt-files-edit { margin-top: 14px; }

.vt-doc { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.vt-doc > .card { margin: 0; }
.vt-expiry { display: flex; align-items: center; gap: 12px; }
.vt-expiry-ic { font-size: 26px; }
.vt-expiry b { display: block; font-size: 16px; }
.vt-expiry small { font-size: 12.5px; }
.vt-expiry-pronto { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.vt-expiry-vencido { border-color: color-mix(in srgb, var(--coral) 50%, var(--line)); }
.vt-datum .row-main small { display: block; font-size: 11.5px; }
.vt-datum .row-main b { font-size: 15px; overflow-wrap: anywhere; }
.vt-datum-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.vt-files .hint { margin: 0; }
.vt-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.vt-file { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.vt-file img, .vt-file-ic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--line); }
.vt-file-ic { display: grid; place-items: center; font-size: 34px; }
.vt-file small { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-notes h3 { font-size: 15px; margin: 0 0 6px; }
.vt-notes p { margin: 0; white-space: pre-line; font-size: 14px; }
.vt-log .row-main { font-size: 13.5px; }
.vt-log .row-main a { color: var(--accent); }
.vt-log-when { flex: none; font-size: 12px; }
@media (max-width: 640px) {
    .vt-cats { gap: 8px; }
    .vt-cat { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 0; align-items: center; padding: 10px 12px; }
    .vt-cat-ic { grid-row: span 2; font-size: 22px; margin: 0; }
    .vt-cat b { font-size: 13px; line-height: 1.2; }
    .vt-cat small { font-size: 11px; }
}
.pj-vault { margin-top: 14px; }
.pj-vault .hint { margin: 0; }
.vt-linked .vt-row .row-main span { white-space: normal; }

/* ==========================================================================
   Médico
   ========================================================================== */
.md-pending, .md-upcoming, .md-past { margin-bottom: 14px; }
.md-pending { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.md-link { color: inherit; text-decoration: none; }
.md-row-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.md-row-actions form { margin: 0; }
.md-profiles-head { margin-top: 6px; }
.md-add { display: flex; gap: 14px; }
.md-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.md-profile { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; margin: 0; }
.md-profile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.md-profile > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.md-profile b { font-size: 15px; }
.md-profile small { font-size: 12px; color: var(--ink-soft); }
.md-alert { color: var(--ink) !important; font-weight: 600; }
.md-avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; background: color-mix(in srgb, #4F9A6C 18%, var(--surface)); color: var(--ink); }

.md-visit { align-items: center; }
.md-date { width: 46px; flex: none; text-align: center; display: flex; flex-direction: column; border-radius: 12px; background: color-mix(in srgb, #4F9A6C 14%, var(--surface)); padding: 5px 0; }
.md-date b { font-size: 18px; line-height: 1.1; }
.md-date small { font-size: 11px; color: var(--ink-soft); text-transform: capitalize; }
.md-date.big { width: 64px; padding: 8px 0; }
.md-date.big b { font-size: 26px; }
.md-cancelled .row-main b { text-decoration: line-through; opacity: .7; }
.md-more { display: inline-block; margin-top: 8px; }

.md-perfil { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.md-perfil > .card { margin: 0; }
.md-vitals { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; }
.md-vital { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-soft); }
.md-vital b { font-size: 18px; }
.md-vital-wide b { font-size: 14px; }
.md-vital.alert { background: color-mix(in srgb, var(--coral) 14%, var(--surface)); }
@media (max-width: 640px) { .md-vitals { grid-template-columns: 1fr 1fr; } .md-vital-wide { grid-column: 1 / -1; } }
.md-text { white-space: pre-line; font-weight: 500 !important; font-size: 14px !important; }
.md-delete { align-self: flex-start; }

.md-form .md-after { margin: 6px 0 4px; border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; }
.md-form .md-after summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); }
.md-form .md-after[open] summary { margin-bottom: 8px; }
@media (max-width: 640px) { .md-when.grid.cols-3 { grid-template-columns: 1fr 1fr; } .md-when > .field:first-child { grid-column: 1 / -1; } }

.md-visit-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.md-visit-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; flex: 1; min-width: 160px; }
.md-visit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.md-visit-actions form { margin: 0; }
.md-visit-page .vt-datum .row-main span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.md-doctor { margin-bottom: 12px; }
.md-doctor-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.md-doctor-head > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.md-doctor-head b { font-size: 15px; }
.md-doctor-head small { font-size: 12.5px; }
.md-doctor-new h3 { font-size: 15px; margin: 0 0 6px; }

/* Ficha de emergencia */
.md-sheet { max-width: 680px; padding: 24px; }
.md-sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.md-sheet-head h2 { margin: 0; font-size: 22px; }
.md-sheet-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.md-sheet-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-bottom: 14px; }
.md-sheet-box { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.md-sheet-box small { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.md-sheet-box b { font-size: 22px; }
.md-sheet-box.alert { border-color: var(--coral); }
.md-sheet-box.alert b { font-size: 17px; }
.md-sheet-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.md-sheet-list dt { color: var(--ink-soft); font-weight: 600; }
.md-sheet-list dd { margin: 0; white-space: pre-line; }
.md-sheet-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--ink-faint); }
@media (max-width: 640px) { .md-sheet { padding: 16px; } .md-sheet-grid { grid-template-columns: 1fr; } .md-sheet-list { grid-template-columns: 1fr; gap: 2px; } .md-sheet-list dd { margin-bottom: 8px; } }
@media print {
    .sidebar, .topbar-top, .topbar-actions, .bottom-nav, .fab, .help, .md-noprint, .toast { display: none !important; }
    body, .content { background: #fff !important; color: #000 !important; }
    .md-sheet { box-shadow: none !important; border: 1px solid #999 !important; max-width: none; }
}

/* Médico: medicamentos y tomas */
.md-today { margin-bottom: 14px; border-color: color-mix(in srgb, #4F9A6C 40%, var(--line)); }
.md-dose { align-items: center; }
.md-dose-time { width: 46px; flex: none; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.md-dose .row-main { flex: 1 1 80px; min-width: 0; }
.md-dose .row-main span { display: block; }
.md-dose-st { font-size: 12px !important; font-weight: 600; }
.md-dose-tomada .md-dose-st { color: #3F8A5C; }
.md-dose-tomada .md-dose-time, .md-dose-tomada .row-main b { opacity: .6; }
.md-dose-omitida .md-dose-st { color: var(--ink-soft); }
.md-dose-omitida .row-main b { text-decoration: line-through; opacity: .6; }
.md-dose-late .md-dose-st, .md-dose-late .md-dose-time { color: var(--coral); }
.md-med-off { opacity: .65; }
.md-take-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.md-take-now > div { display: flex; flex-direction: column; gap: 2px; }
.md-take-now form { margin: 0; }
.md-stock-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.md-refill-hint { margin: 10px 0 0; }
.md-refill { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.md-refill label { font-size: 13.5px; font-weight: 600; }
.md-refill input { width: 110px; }
.md-to-super { margin: 12px 0 0; }
.md-times { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.md-time { display: inline-flex; align-items: center; gap: 6px; }
.md-time input { width: 150px; }
.md-form fieldset.md-after { margin: 4px 0; min-width: 0; }
@media (max-width: 640px) {
    .md-dose { flex-wrap: wrap; }
    .md-dose .md-row-actions { margin-left: auto; }
    .md-stock-fields.grid.cols-3 { grid-template-columns: 1fr 1fr; }
    .md-stock-fields > .field:last-child { grid-column: 1 / -1; }
}
.md-refill label { margin: 0; }

/* Médico: estudios y vacunas */
.md-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.md-value { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 12px 14px; color: inherit; text-decoration: none; border-left: 4px solid var(--line); }
.md-value:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.md-value small { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.md-value b { font-size: 20px; }
.md-value span { font-size: 12px; }
.md-value em { font-style: normal; }
.md-value.md-st-normal { border-left-color: var(--green); }
.md-value.md-st-alto, .md-value.md-st-bajo { border-left-color: var(--coral); }
.md-st-alto .md-lab-val small, .md-st-bajo .md-lab-val small, .md-value.md-st-alto span:first-of-type, .md-value.md-st-bajo span:first-of-type { color: var(--coral); font-weight: 600; }
.md-st-normal .md-lab-val small, .md-value.md-st-normal span:first-of-type { color: #3F8A5C; font-weight: 600; }
.md-lab-row { color: inherit; text-decoration: none; align-items: center; }
.md-lab-row .row-main span { white-space: normal; }
.md-lab-val { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.md-lab-val b { font-size: 16px; }
.md-lab-val small { font-size: 12px; }
.md-lab-values legend { font-weight: 600; font-size: 14px; color: var(--accent); padding: 0 4px; }
.md-lab-input { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.md-lab-input .field { margin: 0; }
.md-lab-input label { font-size: 12px; }
.md-lab-del { padding-bottom: 10px; }
.md-chart { height: 280px; }
.md-trend-head { margin: 0; }
.md-vaccine { align-items: center; flex-wrap: wrap; }
.md-vaccine .row-main { flex: 1 1 170px; min-width: 0; }
.md-vaccine .md-row-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
    .md-values { grid-template-columns: 1fr 1fr; }
    .md-value b { font-size: 17px; }
    .md-lab-input { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-lab-input { position: relative; }
    .md-lab-input .md-lab-name { grid-column: 1 / -1; }
    .md-lab-input .field:not(.md-lab-name) input { padding-left: 8px; padding-right: 6px; font-size: 15px; }
    .md-lab-del { position: absolute; top: 0; right: 0; padding: 0; }
    .md-vaccine .md-row-actions { margin-left: auto; }
    .md-chart { height: 230px; }
}

/* Médico: gastos */
.md-exp-sum { margin-bottom: 14px; }
.md-amount { flex: none; font-variant-numeric: tabular-nums; font-size: 15px; }
.md-pill-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.md-tax legend { font-weight: 600; font-size: 14px; color: var(--accent); padding: 0 4px; }

/* Médico: registro digestivo */
.md-g-estrenimiento { --g: var(--amber); }
.md-g-normal { --g: var(--green); }
.md-g-diarrea { --g: var(--coral); }
.md-bristol-ic { width: 44px; height: 22px; flex: none; fill: color-mix(in srgb, var(--g, #7A4E2D) 75%, #6B4423); }
.md-bristol-ic .md-crack { fill: none; stroke: var(--surface); stroke-width: 1.6; stroke-linecap: round; }
.md-bristol-ic .md-snake { fill: none; stroke: color-mix(in srgb, var(--g) 75%, #6B4423); stroke-width: 6; stroke-linecap: round; }
.md-bristol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.md-bristol { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.md-bristol:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.md-bristol.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.md-bristol:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.md-bristol-n { position: absolute; top: 8px; right: 10px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.md-bristol b { font-size: 14px; }
.md-bristol small { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }
.md-color i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); vertical-align: -1px; }
.md-flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; margin: 4px 0 10px; }

.md-gut-strip { margin-bottom: 14px; }
.md-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.md-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--surface-soft); min-height: 74px; }
.md-day small { font-size: 10.5px; color: var(--ink-soft); text-transform: capitalize; }
.md-day b { font-size: 15px; }
.md-day.none b { color: var(--ink-faint); }
.md-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.md-day em { font-style: normal; color: var(--violet); font-weight: 700; line-height: 1; }
.md-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 26px; }
.md-dots i, .md-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--g); }
.md-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.md-gut-stats, .md-gut-today { margin-bottom: 14px; }
.md-sym-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.md-sym-grid .field { margin-bottom: 8px; }
.md-sym-grid label { font-size: 12px; }
.md-gut-day { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 10px 0 2px; }
.md-gut-row { align-items: center; }
.md-gut-row .row-main span { white-space: normal; }
.md-gut-warn .row-main b, tr.md-gut-warn td { color: var(--coral); }
@media (max-width: 640px) {
    .md-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .md-sym-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-bristol-grid { grid-template-columns: 1fr; gap: 6px; }
    .md-bristol { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 8px 12px; }
    .md-bristol .md-bristol-ic { grid-row: span 2; }
    .md-bristol small { grid-column: 2; }
}

/* Reporte digestivo */
.md-report { display: flex; flex-direction: column; gap: 14px; }
.md-report > .card { margin: 0; }
.md-report-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.md-report-stats .md-small { font-size: 13px; }
.md-range { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.md-range input { width: auto; padding: 6px 8px; font-size: 13px; }
.md-bars { display: flex; flex-direction: column; gap: 8px; }
.md-bar-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 32px; gap: 10px; align-items: center; font-size: 13.5px; }
.md-bar-label { display: flex; align-items: center; gap: 6px; }
.md-bar { height: 12px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.md-bar i { display: block; height: 100%; border-radius: 6px; background: var(--g); }
.md-bar-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.md-freq { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 90px; align-items: end; }
.md-freq-col { height: 100%; display: flex; align-items: flex-end; background: var(--surface-soft); border-radius: 3px; }
.md-freq-col span { display: block; width: 100%; background: var(--accent); border-radius: 3px; min-height: 0; }
.md-freq-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.md-report-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.md-report-two > .card { margin: 0; }
.md-report-row { align-items: center; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th { text-align: left; font-size: 12px; color: var(--ink-soft); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.md-table td { padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: top; }
.md-table .md-sym-row td { color: var(--violet); font-size: 12.5px; }
@media (max-width: 640px) {
    .md-report-stats { grid-template-columns: 1fr 1fr !important; }
    .md-report-two { grid-template-columns: 1fr; }
    .md-bar-row { grid-template-columns: 1fr 70px 26px; }
    .md-bar-label .md-bristol-ic { display: none; }
    .md-report-log { overflow-x: auto; }
}
@media print {
    .md-report .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #bbb !important; }
    .md-freq-col span { background: #555 !important; }
    .md-bar i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .en-pills, .md-range { display: none !important; }
}

.md-sym-grid { align-items: end; }

/* ---------- Cycle Tracker ---------- */
.s-ciclo .card > .section-head:first-of-type, .s-ciclo .card > form > .section-head:first-of-type { margin-top: 0; }
.s-ciclo .list-card > .section-head:first-child { margin-top: 12px; }
.cy-hero { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-bottom: 14px; }
.cy-hero-main { flex: 1; }
.cy-ring { --pct: 0; flex: none; width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--rose) calc(var(--pct) * 1%), var(--rose-soft) 0); }
.cy-ring > div { width: 86px; height: 86px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.cy-ring b { font-size: 28px; }
.cy-ring small { font-size: 11.5px; color: var(--ink-faint); }
.cy-hero-main { min-width: 0; }
.cy-phase { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--rose); background: var(--rose-soft); padding: 3px 10px; border-radius: 999px; }
.cy-ph-fertil .cy-phase, .cy-ph-folicular .cy-phase { color: var(--green); background: var(--green-soft); }
.cy-ph-retraso .cy-phase { color: var(--amber); background: var(--amber-soft); }
.cy-next { margin: 8px 0 2px; font-size: 20px; }
.cy-range { margin: 0 0 6px; color: var(--ink-soft); }
.cy-hero .hint { margin: 0; }
.cy-fertile-line { margin: 6px 0 0; font-size: 14px; }
.cy-note { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-soft); background: var(--surface-soft); padding: 8px 10px; border-radius: 10px; }
.cy-guide { flex-basis: 100%; margin-top: -6px; border-top: 1px solid var(--line); padding-top: 8px; }
.cy-guide > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--rose); list-style: none; padding: 4px 0; }
.cy-guide > summary::-webkit-details-marker { display: none; }
.cy-guide > summary::after { content: '▾'; display: inline-block; margin-left: 6px; transition: transform .2s ease; }
.cy-guide[open] > summary::after { transform: rotate(180deg); }
.cy-guide dl { margin: 8px 0 0; display: grid; gap: 8px; }
.cy-guide dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); }
.cy-guide dd { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
.cy-steps { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; }
.cy-steps li { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 10px; background: var(--surface-soft); min-width: 0; }
.cy-steps li b { font-size: 13px; }
.cy-steps li small { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.cy-steps li.on { background: var(--rose-soft); }
.cy-steps li.on b { color: var(--rose); }
.cy-quick { margin-bottom: 14px; }
.cy-flows { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cy-quick form:not(.cy-flows) .cy-flows { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cy-flow { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cy-flow:hover { border-color: color-mix(in srgb, var(--rose) 45%, var(--line)); }
.cy-flow.on { background: var(--rose-soft); border-color: var(--rose); }
.cy-drops { display: flex; gap: 3px; min-height: 14px; align-items: center; }
.cy-drops i, .cy-mark i { display: inline-block; width: 9px; height: 12px; background: var(--rose); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.cy-drops i.spot, .cy-mark i.spot { width: 7px; height: 7px; border-radius: 50%; background: none; box-shadow: inset 0 0 0 1.6px var(--rose); }
.cy-start-hint { margin: 10px 0 4px; }
.cy-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.cy-other { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cy-other input[type="date"] { width: auto; }
.cy-spot { display: inline-block; margin-top: 10px; text-decoration: none; }
.cy-factors { margin: 0 0 14px; }
.cy-stats { margin-bottom: 14px; }
.cy-drop-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--rose-soft); font-size: 16px; }
.cy-disclaimer { text-align: center; margin-top: 18px; }
.cy-period-row .row-main { min-width: 0; }
.cy-cycle-len { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--ink-soft); }
.cy-cycle-len b { font-size: 16px; color: var(--ink); }
.cy-cycle-len.off b { color: var(--ink-faint); text-decoration: line-through; }
.cy-cycle-len small { font-size: 11.5px; }
/* calendario */
.cy-cal { margin-bottom: 14px; }
.cy-day { text-decoration: none; position: relative; }
.cy-day.cy-period { background: var(--rose); border-color: var(--rose); }
.cy-day.cy-period .cal-num { color: #fff; }
.cy-day.cy-period .cy-mark i { background: #fff; }
.cy-day.cy-period .cy-mark i.spot { background: none; box-shadow: inset 0 0 0 1.6px #fff; }
.cy-day.cy-predicted { border: 1.6px dashed var(--rose); background: var(--rose-soft); }
.cy-day.cy-range-day { border: 1.6px dashed color-mix(in srgb, var(--rose) 70%, var(--line)); }
.cy-day.cy-fertile { background: var(--green-soft); }
.cy-day.cy-ovulation { box-shadow: inset 0 0 0 2px var(--green); }
.cy-day.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.cy-day.today.cy-period .cal-num { color: #fff; }
.cy-mark { display: flex; gap: 2px; min-height: 12px; align-items: center; }
.cy-mark i { width: 6px; height: 8px; }
.cy-mark i.spot { width: 6px; height: 6px; }
.cy-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.cy-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.cy-lg-period { background: var(--rose); }
.cy-lg-predicted { background: var(--rose-soft); border: 1.4px dashed var(--rose); }
.cy-lg-range { border: 1.6px dashed color-mix(in srgb, var(--rose) 70%, var(--line)); }
.cy-lg-fertile { background: var(--green-soft); }
.cy-lg-ovulation { box-shadow: inset 0 0 0 2px var(--green); }
.cy-today-link { display: inline-block; margin-top: 10px; }
.cy-cal-sum p { margin: 0; }
/* día */
.cy-day-card .pill-row { margin-bottom: 12px; }
.cy-pill-period { background: var(--rose); border-color: var(--rose); color: #fff; }
.cy-day-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.cy-flow-head { margin-top: 18px; }
.cy-day-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
/* periodos y ajustes */
.cy-rows { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cy-row { display: grid; grid-template-columns: minmax(0, 170px) 74px 24px; gap: 8px; align-items: center; }
.cy-row-head { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.cy-import { margin-bottom: 14px; }
.cy-imported { margin-bottom: 14px; padding: 14px 16px; }
.cy-privacy { margin-bottom: 14px; }
.cy-privacy p { margin: 0; }
.cy-checks { display: flex; flex-direction: column; gap: 4px; }
.cy-factor.past { opacity: .65; }
.cy-add-factor { margin-top: 12px; }
@media (max-width: 640px) {
    .cy-hero { gap: 14px; align-items: flex-start; }
    .cy-ring { width: 86px; height: 86px; }
    .cy-ring > div { width: 68px; height: 68px; }
    .cy-ring b { font-size: 22px; }
    .cy-next { font-size: 17px; }
    .cy-flows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cy-quick form:not(.cy-flows) .cy-flows { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cy-day { min-height: 46px; }
    .cy-factor { flex-wrap: wrap; }
    .cy-factor .md-row-actions { margin-left: auto; }
}
/* Cycle Tracker fase 2: registro del día, tratamientos y patrones */
.cy-chips .choice:has(input:checked), .cy-flow-radios .cy-flow:has(input:checked) { background: var(--rose); border-color: var(--rose); color: #fff; }
.cy-flow-radios .cy-flow:has(input:checked) .cy-drops i { background: #fff; }
.cy-flow-radios .cy-flow:has(input:checked) .cy-drops i.spot { background: none; box-shadow: inset 0 0 0 1.6px #fff; }
.cy-chips .choice:has(input:focus-visible), .cy-scale label:has(input:focus-visible) { outline: 2px solid var(--rose); outline-offset: 2px; }
.cy-log { margin-top: 14px; padding-top: 6px; }
.cy-sec { border-bottom: 1px solid var(--line); padding: 4px 0 14px; }
.cy-sec > summary, .cy-sub > summary { cursor: pointer; font-weight: 700; padding: 12px 0 8px; list-style: none; }
.cy-sec > summary::-webkit-details-marker, .cy-sub > summary::-webkit-details-marker { display: none; }
.cy-sec > summary { font-size: 15.5px; }
.cy-sec > summary::after, .cy-sub > summary::after { content: "▾"; float: right; color: var(--ink-faint); transition: transform .15s; }
.cy-sec[open] > summary::after, .cy-sub[open] > summary::after { transform: rotate(180deg); }
.cy-sec > summary .faint { font-weight: 500; }
.cy-sec .field { margin-top: 12px; }
.cy-sub { margin-top: 10px; padding: 0 12px 10px; border: 1px dashed var(--line); border-radius: 12px; }
.cy-sub > summary { font-size: 14px; padding: 10px 0 6px; }
.cy-none { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.cy-aftersex { margin-top: 10px; }
.cy-products { width: 100%; border-collapse: collapse; margin-top: 4px; }
.cy-products th { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-align: left; padding: 4px 6px 4px 0; }
.cy-products thead th { text-align: center; }
.cy-products td { padding: 3px; }
.cy-products input { width: 100%; min-width: 0; text-align: center; padding: 8px 4px; }
.cy-scale { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cy-scale label { cursor: pointer; }
.cy-scale span { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; }
.cy-scale-6 span { min-width: 64px; height: 48px; }
.cy-scale span small { font-size: 10.5px; font-weight: 600; color: var(--ink-faint); }
.cy-scale label:has(input:checked) span { color: #fff; border-color: transparent; }
.cy-scale .cy-lv-lo:has(input:checked) span { background: var(--green); }
.cy-scale .cy-lv-mid:has(input:checked) span { background: var(--amber); }
.cy-scale .cy-lv-hi:has(input:checked) span { background: var(--danger); }
.cy-scale .cy-scale-none:has(input:checked) span { background: var(--surface-soft); color: var(--ink-soft); border-color: var(--line); }
.cy-scale label:has(input:checked) span small { color: #fff; }
.cy-notes { margin-top: 14px; }
.cy-add-sym { display: inline-block; margin-top: 10px; }
.cy-inline { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.cy-inline input { flex: 1; min-width: 0; }
.cy-own-sym { margin-top: 14px; }
.cy-own-sym > summary { cursor: pointer; font-weight: 600; }
.cy-own-list { margin-bottom: 14px; }
.cy-own-list .choice-grid form { display: inline; }
.cy-today-log { margin-bottom: 14px; }
.cy-today-sum { margin: 0 0 6px; }
.cy-suggest { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--green-soft); font-size: 14px; }
.cy-alerts { margin-bottom: 14px; border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.cy-alerts .list-row { align-items: center; }
.cy-muted { opacity: .6; }
.cy-day-uses { margin-top: 14px; }
.cy-use-form { padding: 6px 0 10px; }
.cy-use-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cy-use-form.compact .cy-use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cy-use-form .form-actions { margin-top: 8px; }
.cy-effect { flex: none; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); }
.cy-effect-0 { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.cy-effect-1 { background: var(--amber-soft); color: color-mix(in srgb, var(--amber) 75%, var(--ink)); }
.cy-effect-2, .cy-effect-3 { background: var(--green-soft); color: color-mix(in srgb, var(--green) 80%, var(--ink)); }
.cy-effect-x { background: var(--rose-soft); color: var(--rose); }
.cy-effects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cy-effect-opt { cursor: pointer; padding: 0; background: none; }
.cy-effect-opt span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; font-size: 22px; background: var(--surface); }
.cy-effect-opt b { font-size: 13px; color: var(--ink); }
.cy-effect-opt:has(input:checked) span { border-color: var(--rose); background: var(--rose-soft); box-shadow: inset 0 0 0 1px var(--rose); }
.cy-works { margin-bottom: 14px; }
.cy-work + .cy-work { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cy-work h4 { margin: 0 0 8px; font-size: 14.5px; }
.cy-work-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 0; text-decoration: none; color: var(--ink); }
.cy-work-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cy-work-bar { height: 10px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.cy-work-bar i { display: block; height: 100%; border-radius: 99px; }
.cy-eff-hi { background: var(--green); }
.cy-eff-mid { background: var(--amber); }
.cy-eff-lo { background: var(--danger); }
.cy-work-n { text-align: right; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; }
.cy-work-n small { font-weight: 500; color: var(--ink-faint); font-size: 11.5px; }
.cy-archived { opacity: .6; }
.cy-ideas { padding: 8px 0 12px; }
.cy-ideas a.choice { text-decoration: none; }
.cy-compare { margin-bottom: 14px; }
.cy-compare-table td, .cy-compare-table th { text-align: center; }
.cy-compare-table tbody th { text-align: left; font-weight: 600; }
.cy-pre { margin: 0; white-space: pre-line; }
.cy-lengths, .cy-mood, .cy-phases { margin-bottom: 14px; }
.cy-len-chart { position: relative; display: flex; flex-direction: column; gap: 6px; padding-left: 60px; }
.cy-len-row { position: relative; display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 8px; }
.cy-len-row small { position: absolute; left: -60px; width: 56px; font-size: 12px; color: var(--ink-faint); }
.cy-len-bar { height: 14px; border-radius: 4px;
  background: linear-gradient(to right, transparent var(--lo), var(--green-soft) var(--lo), var(--green-soft) var(--hi), transparent var(--hi)); }
.cy-len-bar i { display: block; height: 100%; border-radius: 99px; background: var(--rose); }
.cy-len-row.off .cy-len-bar i { background: var(--ink-faint); opacity: .5; }
.cy-len-row b { font-size: 13px; text-align: right; }
.cy-mood .md-vitals { margin: 0 0 8px; }
.cy-phase-table { overflow-x: auto; }
.cy-phase-table th small { display: block; font-weight: 500; color: var(--ink-faint); font-size: 11px; }
.cy-phase-table td { text-align: center; }
.cy-phase-table tbody th { font-weight: 600; text-align: left; white-space: nowrap; }
.cy-top { background: var(--rose-soft); font-weight: 800; color: var(--rose); border-radius: 6px; }
.cy-score { flex: none; text-align: right; font-size: 12.5px; color: var(--ink-soft); }
.cy-score b { font-size: 16px; color: var(--ink); }
.cy-score.heavy b { color: var(--danger); }
.cy-logged { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.cy-day.cy-period .cy-logged { background: #fff; }
@media (max-width: 640px) {
    .cy-use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cy-scale span { min-width: 30px; height: 36px; font-size: 13px; }
    .cy-scale-6 span { min-width: 46px; height: 46px; }
    .cy-scale-6 span small { font-size: 9.5px; }
    .cy-effects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cy-work-row { grid-template-columns: minmax(0, 1fr) 70px auto; gap: 8px; }
    .cy-products th { font-size: 12px; }
}
.cy-day-card, .cy-day-uses, .cy-own-sym, .cy-day-nav { max-width: 620px; }
.cy-pending { margin-bottom: 14px; }
@media (max-width: 640px) {
    .cy-phase-table .md-table th, .cy-phase-table .md-table td { padding: 6px 3px; font-size: 12px; }
    .cy-phase-table tbody th { white-space: normal; max-width: 92px; }
    .cy-phase-table thead th { font-size: 11px; }
}
@media (max-width: 640px) {
    .cy-scale:not(.cy-scale-6) { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .cy-scale:not(.cy-scale-6) span { width: 100%; }
    .cy-scale-6 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cy-scale-6 span { width: 100%; }
}
@media (max-width: 640px) {
    .grid.cy-levels { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .cy-levels select { padding-left: 8px; padding-right: 4px; }
}
/* Cycle Tracker fase 3: pareja, reporte y datos */
.launcher-shared { display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 999px; background: var(--rose-soft); color: var(--rose); font-size: 13px; font-weight: 600; text-decoration: none; }
.launcher-shared + .launcher-shared { margin-left: 6px; }
.cy-tell { margin-bottom: 14px; }
.cy-tell .section-head { flex-wrap: wrap; gap: 4px 12px; }
.cy-tell-presets .choice { font: inherit; font-size: 13px; font-weight: 600; }
.cy-partner { margin-bottom: 14px; }
.cy-partner .section-head { align-items: center; }
.cy-partner-status { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.cy-tips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.cy-tips li { padding: 9px 12px; border-radius: 12px; background: var(--green-soft); font-size: 14px; }
.cy-partner-days { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.cy-partner-days h4 { margin: 0 0 8px; font-size: 14.5px; }
.cy-partner-day { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 5px 0; font-size: 14px; }
.cy-partner-day span { color: var(--ink-soft); }
.cy-levels-choice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cy-level-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.cy-level-opt input { margin-top: 3px; accent-color: var(--rose); }
.cy-level-opt span { display: flex; flex-direction: column; gap: 2px; }
.cy-level-opt small { color: var(--ink-soft); font-size: 13px; }
.cy-level-opt.on { border-color: var(--rose); background: var(--rose-soft); }
.cy-data { margin-top: 14px; }
.cy-data p { margin: 0 0 10px; }
.cy-data-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cy-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.cy-danger > summary { color: var(--danger); }
.cy-heavy { color: var(--danger); font-weight: 700; }
.cy-report .card { margin-bottom: 14px; }
.cy-report-work { margin: 0 0 8px; font-size: 14px; }
.md-period { font-size: 10px; line-height: 1; }
.md-freq-col.md-freq-period { background: var(--rose-soft); border-radius: 3px; }

/* ==========================================================================
   Movimiento y respuesta al tocar: hojas que suben y se cierran deslizando, botones que responden,
   barra de carga al navegar y transición suave entre páginas (donde el navegador la soporta)
   ========================================================================== */
.nav a, .bottom-nav a, .bottom-nav button, .module-switch, .launcher-item, .sheet-close, .qe-close, .link-btn, .chip, .fab,
.list-row a, a.list-row, .icon-btn, .tabs a, .range-chips a { transition: transform .12s ease, background-color .15s ease, color .15s ease, opacity .15s ease; }
.nav a:active, .module-switch:active, .launcher-item:active, .list-row a:active, a.list-row:active, .tabs a:active, .range-chips a:active { transform: scale(.97); }
.nav a:active, .module-switch:active { background: var(--surface-soft); }
.bottom-nav a:active, .bottom-nav button:active { transform: scale(.9); color: var(--accent); }
.sheet-close:active, .qe-close:active, .icon-btn:active, .chip:active { transform: scale(.92); }
.link-btn:active { opacity: .6; }
.fab:active { transform: translateX(-50%) scale(.92); }
.launcher-item:active { border-color: var(--accent); }

/* Hoja del Menú (celular) */
:root { --ease-sheet: cubic-bezier(.32,.72,0,1); --ease-exit: cubic-bezier(.4,0,.9,.5); }
.sheet-in { transition: transform .42s var(--ease-sheet); }
.sheet-out { transition: transform .26s var(--ease-exit); }
.sheet-from { transform: translateY(105%); }
/* Fondos oscuros de las hojas: entran y salen junto con la hoja */
.bd-in { transition: opacity .32s ease; }
.bd-out { transition: opacity .24s ease; }
.bd-from { opacity: 0; }

/* Selector de módulos: ventana que aparece (PC) u hoja que sube (celular); los módulos entran escalonados */
.lx-in { transition: opacity .22s ease, transform .32s var(--ease-sheet); }
.lx-out { transition: opacity .16s ease, transform .2s var(--ease-exit); }
.launcher.lx-from { opacity: 0; transform: translate(-50%, -47%) scale(.98); }
@keyframes lx-item { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.launcher .launcher-item { animation: lx-item .38s var(--ease-sheet) backwards; }
.launcher .launcher-item:nth-child(2) { animation-delay: .03s; } .launcher .launcher-item:nth-child(3) { animation-delay: .06s; }
.launcher .launcher-item:nth-child(4) { animation-delay: .09s; } .launcher .launcher-item:nth-child(5) { animation-delay: .12s; }
.launcher .launcher-item:nth-child(6) { animation-delay: .15s; } .launcher .launcher-item:nth-child(n+7) { animation-delay: .18s; }
@media (max-width: 860px) {
  .lx-in { transition: transform .42s var(--ease-sheet); }
  .lx-out { transition: transform .26s var(--ease-exit); }
  .launcher.lx-from { opacity: 1; transform: translateY(105%); }
  /* La barrita para deslizar hacia abajo */
  .launcher::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: -6px auto 10px; }
}
.is-dragging { transition: none !important; }

/* Barra de carga al tocar un enlace o mandar un formulario (si la página tarda) */
@keyframes nav-load { 0% { transform: scaleX(0); } 40% { transform: scaleX(.6); } 100% { transform: scaleX(.92); } }
html.navigating body::after { content: ''; position: fixed; z-index: 200; top: 0; left: 0; right: 0; height: 3px; transform-origin: left;
  background: var(--grad, var(--accent)); animation: nav-load 2.4s cubic-bezier(.1,.7,.2,1) .12s forwards; transform: scaleX(0); }

/* Entre páginas: la barra de arriba y la de abajo se quedan quietas y el contenido cambia suave */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .topbar-top { view-transition-name: az-topbar; }
  .bottom-nav { view-transition-name: az-bottomnav; }
  .sidebar { view-transition-name: az-sidebar; }
  ::view-transition-old(root) { animation: .18s ease both pg-out; }
  ::view-transition-new(root) { animation: .34s var(--ease-sheet) .04s both pg-in; }
  @keyframes pg-out { to { opacity: 0; transform: scale(.995); } }
  @keyframes pg-in { from { opacity: 0; transform: translateY(10px); } }
}

/* Cuenta: ¿cuenta como disponible / en el patrimonio? */
.acct-counts { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; display: grid; gap: 10px; }
.acct-counts legend { padding: 0; margin-bottom: 8px; }
.acct-counts .check { align-items: flex-start; margin-top: 0; color: var(--ink); }
.acct-counts .check input { margin-top: 3px; }
.acct-counts .check small { display: block; margin-top: 2px; font-weight: 400; }

/* Selector de módulos: «Ordenar módulos» (mantener presionado un módulo y arrastrarlo) */
.launcher-sort { border-style: dashed; background: transparent; box-shadow: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.launcher-sort .ic { background: var(--surface-soft); color: var(--ink-soft); }
.launcher-sort small { color: var(--ink-faint); }
.launcher-sortbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px;
  padding: 10px 12px; border-radius: 14px; background: var(--surface-soft); }
.launcher-sortbar p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.launcher-sortbar > div { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.launcher-item[data-key] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.launcher-item[data-key].pressing { transform: scale(.95); transition: transform .4s var(--ease-sheet); }
@keyframes lx-wiggle { from { transform: rotate(-.8deg); } to { transform: rotate(.8deg); } }
.is-sorting .launcher-item[data-key] { cursor: grab; border-style: dashed; animation: lx-wiggle .26s ease-in-out infinite alternate; }
.is-sorting .launcher-item[data-key]:nth-child(2n) { animation-delay: -.13s; animation-direction: alternate-reverse; }
.is-sorting .launcher-item[data-key]:hover { transform: none; }
.launcher-item.dragging { cursor: grabbing; animation: none !important; transform: scale(1.06) !important; z-index: 2; position: relative;
  box-shadow: 0 18px 36px -12px color-mix(in srgb, var(--accent) 55%, rgba(16,16,20,.35)); border-style: solid; border-color: var(--accent); }
html.is-reordering, html.is-reordering * { cursor: grabbing !important; }

/* ==========================================================================
   Al elegir un módulo: una animación breve y propia de cada uno (palomitas, monedas, candado…)
   mientras carga. partials/module-open + moduleOpen en app.js.
   ========================================================================== */
.mo { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.mo-in { transition: opacity .18s ease; }
.mo-from { opacity: 0; }
.mo-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mo-card > b { font-size: 19px; color: var(--ink); animation: mo-name .45s var(--ease-sheet) .12s backwards; }
@keyframes mo-name { from { opacity: 0; transform: translateY(8px); } }
.mo-scene { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.mo-scene > span { font-size: 74px; line-height: 1; grid-area: 1 / 1; }
.mo-scene i { position: absolute; display: block; font-style: normal; }
@keyframes mo-enter { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } to { transform: scale(1); } }
.mo-scene > span:first-child { animation: mo-enter .38s var(--ease-sheet) backwards; }

/* Entretenimiento: palomitas que brincan de la bolsa */
.mo-pop > span:first-child { animation: mo-enter .32s var(--ease-sheet) backwards, mo-shake .1s .3s 5 alternate; }
@keyframes mo-shake { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.mo-pop i { left: 50%; top: 42%; width: 15px; height: 13px; border-radius: 52% 48% 45% 55%; opacity: 0;
  background: radial-gradient(circle at 35% 35%, #fff 0 45%, #FFF1C9 70%, #F4D27A); box-shadow: 0 1px 2px rgba(120,80,0,.25);
  animation: mo-kernel .62s cubic-bezier(.2,.7,.4,1) var(--d) forwards; }
@keyframes mo-kernel {
  0% { transform: translate(-50%, 0) scale(.3); opacity: 0; }
  20% { opacity: 1; }
  55% { transform: translate(calc(-50% + var(--x)), var(--h)) scale(1.1) rotate(120deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x) * 1.5), calc(var(--h) * -.1 + 30px)) scale(.9) rotate(260deg); opacity: 0; }
}

/* Finanzas y Nutrición: cosas que caen y se meten (monedas a la cartera, comida al plato).
   La cartera va enfrente: lo que cae desaparece adentro y ella da un saltito con cada una. */
.mo-drop > span:first-child { position: relative; z-index: 2;
  animation: mo-enter .3s var(--ease-sheet) backwards, mo-gulp .13s ease-out .47s 3; }
@keyframes mo-gulp { 50% { transform: scale(1.1, .9) translateY(3px); } }
.mo-drop i { z-index: 1; left: 50%; top: 0; font-size: 30px; opacity: 0; animation: mo-fall .42s cubic-bezier(.55,0,.9,.6) var(--d) forwards; }
@keyframes mo-fall {
  0% { transform: translate(calc(-50% + var(--x)), -56px) rotate(-25deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(-50%, 66px) rotate(0); opacity: 1; }
}

/* Calendario: la hoja da la vuelta y se palomea */
.mo-flip > span:first-child { animation: mo-enter .3s var(--ease-sheet) backwards, mo-turn .55s var(--ease-sheet) .22s; }
@keyframes mo-turn { from { transform: perspective(400px) rotateX(0); } to { transform: perspective(400px) rotateX(360deg); } }
.mo-flip i { right: 14px; bottom: 16px; font-size: 34px; opacity: 0; animation: mo-check .35s var(--ease-sheet) .6s forwards; }
@keyframes mo-check { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Vault: el candado abierto se cierra con un «clac» */
.mo-lock > span:first-child { animation: mo-enter .3s var(--ease-sheet) backwards, mo-hide .01s .44s forwards; }
@keyframes mo-hide { to { opacity: 0; } }
.mo-lock > span:nth-child(2) { opacity: 0; animation: mo-clack .34s var(--ease-sheet) .44s forwards; }
@keyframes mo-clack { 0% { opacity: 1; transform: translateY(-7px) scale(1.06); } 55% { opacity: 1; transform: translateY(2px) scale(.95, 1.04); } 100% { opacity: 1; transform: none; } }
.mo-ring { inset: 25px; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; animation: mo-ring .5s ease-out .5s forwards; }
@keyframes mo-ring { from { transform: scale(.5); opacity: .8; } to { transform: scale(1.5); opacity: 0; } }

/* Cycle Tracker: la flor abre y suelta pétalos */
.mo-bloom > span:first-child { animation: mo-open .6s var(--ease-sheet) backwards; }
@keyframes mo-open { from { transform: rotate(-140deg) scale(0); } 70% { transform: rotate(8deg) scale(1.12); } to { transform: none; } }
.mo-bloom i { left: 50%; top: 50%; width: 16px; height: 21px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 30%, #FFD3E2, #F27BA6);
  opacity: 0; animation: mo-petal .6s ease-out .35s forwards; }
@keyframes mo-petal {
  0% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(-20px) scale(.4); opacity: .9; }
  100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(-92px) scale(1.05); opacity: 0; }
}

/* Súper: el carrito llega rodando. Es el emoji del celular; cada marca lo dibuja mirando a un lado distinto,
   así que app.js revisa hacia dónde mira y lo voltea (.flip) para que siempre avance de frente. */
.mo-cart > span:first-child { animation: mo-roll .58s cubic-bezier(.2,.9,.3,1.12) backwards; }
@keyframes mo-roll { from { transform: translateX(-150px) rotate(-6deg); opacity: 0; } 50% { opacity: 1; } }
.mo-face { display: inline-block; }
.mo-face.flip { transform: scaleX(-1); }
.mo-cart i { left: 2px; height: 3px; border-radius: 3px; background: var(--accent); opacity: 0; animation: mo-line .45s ease-out var(--d) forwards; }
@keyframes mo-line { 0% { width: 0; opacity: .7; transform: translateX(0); } 100% { width: 38px; opacity: 0; transform: translateX(-24px); } }

/* Proyectos: el martillo da tres golpes con chispas */
.mo-hammer > span:first-child { transform-origin: 75% 80%; animation: mo-enter .28s var(--ease-sheet) backwards, mo-hit .2s ease-in .25s 3; }
@keyframes mo-hit { 0% { transform: rotate(0); } 45% { transform: rotate(-35deg); } 100% { transform: rotate(4deg); } }
.mo-hammer i { left: 26px; bottom: 26px; font-size: 22px; opacity: 0; animation: mo-spark .2s ease-out var(--d) 1 forwards; }
@keyframes mo-spark { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.2) translate(var(--x), -14px); opacity: 0; } }

/* Salud: el estetoscopio llega columpiándose, «escucha» con dos ondas y aparece un latido */
.mo-steth > span:first-child { transform-origin: 50% 6%; animation: mo-swing .7s cubic-bezier(.3,1.4,.5,1) backwards; }
@keyframes mo-swing { 0% { transform: rotate(-40deg); opacity: 0; } 25% { opacity: 1; } 100% { transform: rotate(0); } }
.mo-wave { left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 3px solid var(--accent);
  opacity: 0; animation: mo-wave .55s ease-out var(--d) forwards; }
@keyframes mo-wave { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
.mo-steth .mo-hb { right: -4px; top: 4px; font-size: 34px; opacity: 0; animation: mo-hb .5s ease-out .56s forwards; }
@keyframes mo-hb { 0% { transform: scale(0); opacity: 0; } 40% { transform: scale(1.3); opacity: 1; } 70% { transform: scale(.95); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* Resto: el ícono rebota */
.mo-default > span:first-child { animation: mo-enter .45s var(--ease-sheet) backwards; }

/* ==========================================================================
   IA: reportes mensuales, «Pregúntale» y Ajustes → IA
   ========================================================================== */
.ai-home { display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); }
.ai-home-ic { font-size: 26px; flex: none; }
.ai-home-main { flex: 1; min-width: 0; }
.ai-home-main p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.ai-home-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 640px) {
  .ai-home { flex-wrap: wrap; }
  .ai-home-actions { width: 100%; }
  .ai-home-actions .btn { flex: 1; justify-content: center; }
}
.ai-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ai-cta p { margin: 2px 0 0; }
.ai-report-row { text-decoration: none; color: inherit; }
.ai-month { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.05; }
.ai-month b { font-size: 14px; text-transform: capitalize; color: var(--accent); }
.ai-month small { font-size: 10.5px; color: var(--ink-faint); }
.ai-report { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.ai-report > .card { margin: 0; }
.ai-summary { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.ai-summary p { margin: 0; font-size: 16px; line-height: 1.5; }
.ai-points { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.ai-suggestions { display: grid; gap: 12px; margin-top: 10px; }
.ai-suggestion { display: flex; gap: 12px; align-items: flex-start; }
.ai-suggestion p { margin: 2px 0 4px; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.ai-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ai-facts > summary { cursor: pointer; font-weight: 600; }
.ai-facts-list { margin: 10px 0 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.ai-facts-list dt { color: var(--ink-faint); }
.ai-facts-list dd { margin: 0; overflow-wrap: anywhere; }
.ai-facts-list .ai-facts-list { margin: 0; padding-left: 8px; border-left: 2px solid var(--line); }
@media (max-width: 640px) { .ai-facts-list { grid-template-columns: minmax(0, 1fr); } .ai-facts-list dd { margin-bottom: 4px; } }

.ai-chat-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.ai-chat-layout > .card { margin: 0; }
.ai-convs .list-row { text-decoration: none; color: inherit; }
.ai-convs .list-row.on b { color: var(--accent); }
.ai-convs .row-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.ai-chat { display: flex; flex-direction: column; gap: 12px; min-height: 340px; }
.ai-messages { display: flex; flex-direction: column; gap: 12px; }
.ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; scroll-margin-top: 90px; }
.ai-msg p { margin: 0; }
.ai-msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.ai-msg.ia { align-self: flex-start; background: var(--surface-soft); border-bottom-left-radius: 6px; }
.ai-answer p { margin: 0 0 8px; } .ai-answer p:last-child { margin-bottom: 0; }
.ai-answer ul { margin: 4px 0 8px; padding-left: 20px; }
.ai-msg small { display: block; margin-top: 6px; font-size: 11.5px; }
.ai-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px 0 8px; }
.ai-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ai-starters .pill { cursor: pointer; font: inherit; font-size: 13px; margin: 0; }
.ai-new { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; }
.ai-new.soft { background: var(--surface-soft); color: var(--ink-soft); }
.ai-ask { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.ai-ask textarea { resize: vertical; min-height: 56px; }
.ai-ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-del { text-align: right; }
@media (max-width: 860px) {
  .ai-chat-layout { grid-template-columns: minmax(0, 1fr); }
  .ai-convs { order: 2; }
  .ai-msg { max-width: 94%; }
}

.ai-meter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.ai-meter-grid > div { background: var(--surface-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ai-meter-grid small { font-size: 12px; color: var(--ink-faint); }
.ai-meter-grid b { font-size: 17px; }
@media (max-width: 640px) { .ai-meter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ai-modules { display: grid; gap: 10px; margin: 6px 0 14px; }
.ai-module { margin-top: 0; align-items: flex-start; color: var(--ink); }
.ai-module input { margin-top: 3px; }
.ai-module small { display: block; font-weight: 400; }
.ai-module.soon { opacity: .6; }
.ai-profile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ai-meter > .section-head:first-child, .ai-settings > .section-head:first-of-type, .ai-convs > .section-head:first-child { margin-top: 0; }
