/* coko-web — identidad Coko (claro, verde bosque, serif para cifras).
   Portado del mockup aprobado 2026-07-24/25. */

:root {
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f2f2f2; --card: #ffffff; --accent: #1a6b3c; --accent-soft: #e6f0ea;
  --text: #1c1f1d; --muted: #6a736e; --border: #e7e7e5;
  --ok: #1a6b3c; --warn: #c98a1a; --crit: #c0392b; --income: #1a6b3c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); font-family: var(--sans); color: var(--text);
  overscroll-behavior-y: contain; overflow-x: hidden;
}
/* Sensación nativa: sin selección accidental ni destello azul al tocar */
button, .tab, .fab, .chip-q, .grow, .opt, .set-row, .card-label, .crumb,
.day-label, .month-pill, .tg-cta { user-select: none; -webkit-user-select: none; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Shell: móvil a pantalla completa; en escritorio, columna centrada */
#appShell { max-width: 480px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; background: var(--bg); position: relative; }
@media (min-width: 520px) {
  #appShell { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
/* `hidden` debe ganar a los display de abajo (si no, la portada no se oculta tras el login) */
#loginView[hidden], #appView[hidden] { display: none !important; }

/* ── Arranque ── */
/* Visible desde el primer pintado (no lleva [hidden] en el HTML): mientras se
   piden la sesión y los datos, se ve Coko en vez de una pantalla en blanco. */
#cargando { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 32px 24px; text-align: center; }
#cargando[hidden] { display: none; }
#cargando img { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 8px; }
@media (prefers-reduced-motion: no-preference) {
  #cargando img { animation: latido 1.6s ease-in-out infinite; }
}
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
#cargando .carg-t { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0; }
#cargando .carg-s { font-size: 14px; color: var(--muted); margin: 0; }

/* ── Login ── */
#loginView { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 32px 24px; text-align: center; }
#loginView img { width: 84px; height: 84px; border-radius: 22px; }
#loginView h1 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0; }
#loginView h1 small { display: block; font-family: var(--sans); font-weight: 400;
  font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
#tgWidget { min-height: 48px; display: grid; place-items: center; }
.dev-btn { border: 1px dashed var(--border); background: var(--card); color: var(--muted);
  font-family: var(--sans); font-size: 14px; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.login-note { font-size: 13.5px; color: var(--muted); line-height: 1.55; max-width: 300px; }
.login-note a { color: var(--accent); }

/* ── Error de carga (mes/histórico que no llegó) ── */
.mes-err { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 48px 24px; text-align: center; }
.mes-err .err-t { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0; }
.mes-err .err-s { font-size: 14px; color: var(--muted); margin: 0 0 6px; }

/* ── Cabecera ── */
/* Altura FIJA: el cuerpo reserva 60px para la cabecera, así que si esta crece
   (p. ej. el pill partido en dos líneas) tapa el principio del contenido. */
.app-head { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 12px; display: flex;
  align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border);
  background: var(--card); z-index: 12; gap: 10px;
  height: calc(60px + env(safe-area-inset-top)); box-sizing: border-box; }
/* La marca NO se encoge: quien cede sitio si falta espacio es el pill del mes
   (abajo), que ya recorta con puntos en vez de partir «CokoApp». */
.app-head .brand { flex: none; }
.app-head .brand .name { white-space: nowrap; }
.head-right { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
/* Es un <button> (lleva al inicio), así que se le quitan los adornos de botón. */
.brand { display: flex; align-items: center; gap: 9px; border: 0; background: none;
  padding: 0; margin: 0; color: inherit; font-family: inherit; cursor: pointer; }
.brand img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.brand .name { font-family: var(--serif); font-weight: 600; font-size: 19px;
  display: inline-flex; align-items: center; }
/* Flechas de mes: un toque para el anterior o el siguiente, sin desplegar nada. */
.mes-nav { border: 1px solid var(--border); background: #f4f5f3; width: 26px; height: 28px;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none;
  color: var(--accent); font-family: var(--sans); font-size: 17px; line-height: 1; padding: 0; }
.mes-nav:disabled { color: #c9cfcb; cursor: default; }
.mes-nav[hidden] { display: none; }
.head-right { display: flex; align-items: center; gap: 6px; }
/* NUNCA en dos líneas: un mes largo («Septiembre 2026») partía el pill, engordaba
   la cabecera fija y esta tapaba el principio del contenido. Si no cabe, se
   recorta con puntos suspensivos, pero la cabecera mantiene su altura. */
.month-pill { font-size: 14px; font-weight: 500; background: #f4f5f3; color: var(--text);
  border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px;
  display: flex; align-items: center; gap: 5px; cursor: pointer; font-family: var(--sans);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw;
  flex: 0 1 auto; min-width: 0; }
.icon-btn { border: 1px solid var(--border); background: #f4f5f3; width: 32px; height: 32px;
  border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 1.9; }
.month-menu { position: absolute; top: calc(48px + env(safe-area-inset-top)); right: 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16); overflow: hidden; z-index: 20; min-width: 160px; }
.month-menu[hidden] { display: none; }
.month-menu button { display: flex; width: 100%; justify-content: space-between;
  align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px 14px;
  font-family: var(--sans); font-size: 15px; color: var(--text); cursor: pointer; text-align: left; }
.month-menu button:hover { background: var(--accent-soft); }
.month-menu button.sel { color: var(--accent); font-weight: 600; }

/* ── Cuerpo ── */
.app-body { flex: 1; padding: calc(60px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 14px; }
@media (prefers-reduced-motion: no-preference) { .screen { animation: fadeUp .32s ease both; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.card-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 10px; }

/* Modo incógnito: difumina SOLO cifras */
.big, .bal-strip .r b, .lv, .g-amt, .bg-top .amt, .num, .acc .av, .acc .mv,
.total-card .big, .donut, .pig-big { transition: filter .28s ease; }
.money-blur .big, .money-blur .bal-strip .r b, .money-blur .lv, .money-blur .g-amt,
.money-blur .bg-top .amt, .money-blur .num, .money-blur .acc .av, .money-blur .acc .mv,
.money-blur .total-card .big, .money-blur .pig-big { filter: blur(7px); }
/* el donut entero (número central incluido): filtrar el <text> del SVG no es fiable en Safari */
.money-blur .donut { filter: blur(6px); }
/* el cerdito: el relleno de saldo (SVG + barra) también cuenta como cifra */
.money-blur .pig-fill, .money-blur .pig-bar-fill { filter: blur(4px); }

/* Resumen */
.bal-strip { display: flex; align-items: center; justify-content: space-between; }
.bal-strip .l .sub { font-size: 12px; color: var(--muted); letter-spacing: .07em;
  text-transform: uppercase; font-weight: 600; }
.bal-strip .l .big { font-family: var(--serif); font-size: 32px; font-weight: 600;
  color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bal-strip .l .delta { font-size: 13px; color: var(--muted); }
.bal-strip .r { text-align: right; display: flex; flex-direction: column; gap: 6px; }
.bal-strip .r div { font-size: 13px; color: var(--muted); }
.bal-strip .r b { font-family: var(--serif); font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 16px; }
.bal-strip .r b.in { color: var(--income); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 132px; height: 132px; flex: none; }
.dslice { transition: stroke-dasharray .9s cubic-bezier(.35,0,.25,1); }
@media (prefers-reduced-motion: reduce) { .dslice { transition: none; } }
.donut .d-c { font-family: var(--serif); font-size: 6.2px; font-weight: 600;
  fill: var(--text); text-anchor: middle; }
.donut .d-s { font-family: var(--sans); font-size: 2.6px; fill: var(--muted);
  text-anchor: middle; letter-spacing: .04em; text-transform: uppercase; }
.legend { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lg { display: grid; grid-template-columns: 11px 1fr auto; align-items: center; gap: 8px; }
.lg .dot { width: 11px; height: 11px; border-radius: 3px; }
.lg .ln { font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg .lv { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Chat Coko (encabeza el Resumen) */
.chat-card { order: -1; padding: 12px 14px 10px; border-color: #cfe2d6;
  box-shadow: 0 4px 16px rgba(26,107,60,.06); }
.chat-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.chat-head img { width: 26px; height: 26px; border-radius: 8px; display: block; }
.chat-head .t { font-size: 14.5px; font-weight: 600; }
.chat-head .t small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.chat-log { display: flex; flex-direction: column; gap: 9px; max-height: 128px;
  overflow-y: auto; padding-right: 2px; }
.b { max-width: 82%; padding: 9px 12px; font-size: 14.5px; line-height: 1.45; border-radius: 14px; }
.b.coko { background: var(--accent-soft); color: #143d26; border-top-left-radius: 4px; align-self: flex-start; }
.b.me { background: var(--accent); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.b.espera { color: var(--muted); background: #f4f5f3; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip-q { border: 1px solid #cfe2d6; background: #fff; color: var(--accent);
  font-family: var(--sans); font-size: 13px; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.chip-q:hover { background: var(--accent-soft); }
.chat-input { display: flex; gap: 8px; align-items: center; margin-top: 11px;
  border-top: 1px solid var(--border); padding-top: 11px; }
.chat-input input { flex: 1; border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 14px; font-family: var(--sans); font-size: 17px; color: var(--text); outline: 0; }
.chat-input input:focus { border-color: var(--accent); }
.chat-input button { border: 0; background: var(--accent); width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; }
.chat-input button svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }

/* Dinero */
.total-card { text-align: center; padding: 20px 16px; }
.total-card .sub { font-size: 12px; color: var(--muted); letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600; }
.total-card .big { font-family: var(--serif); font-size: 38px; font-weight: 600;
  margin-top: 6px; font-variant-numeric: tabular-nums; }
.acc { display: flex; align-items: center; gap: 12px; padding: 13px 4px; }
.acc + .acc { border-top: 1px solid var(--border); }
.acc .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft);
  display: grid; place-items: center; flex: none; }
.acc .ic svg { width: 19px; height: 19px; stroke: var(--accent); fill: none; stroke-width: 1.9; }
.acc .txt { flex: 1; }
.acc .an { font-size: 15px; font-weight: 500; }
.acc .ab { font-size: 13px; color: var(--muted); }
.acc .rt { text-align: right; }
.acc .av { font-family: var(--serif); font-size: 17px; font-variant-numeric: tabular-nums; }
.acc .av.neg { color: var(--crit); }
.acc .mv { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--muted);
  background: #f4f5f3; border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 12px; margin-top: 12px; }
.note svg { flex: none; width: 15px; height: 15px; stroke: var(--muted); fill: none;
  stroke-width: 2; margin-top: 1px; }

/* Ahorro: el cerdito */
.pig-row { display: flex; align-items: center; gap: 18px; }
.pig-svg { flex: none; overflow: visible; }
.pig-txt { flex: 1; min-width: 0; }
.pig-bg { fill: #eef0ed; }
.pig-fill { fill: var(--accent); transform-origin: 50% 100%; transform: scaleY(0);
  transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.pig-outline { fill: none; stroke: var(--accent); stroke-width: .9; }
.pig-details { fill: none; stroke: var(--accent); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; }
.pig-eye { fill: var(--accent); stroke: none; }
.pig-big { font-family: var(--serif); font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.pig-of { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pig-bar { margin-top: 10px; }
.pig-bar-fill { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .pig-fill { transition: none; } }

/* Presupuestos / jerarquía Gastos */
.bg-item { display: flex; flex-direction: column; gap: 7px; }
.bg-top { display: flex; justify-content: space-between; align-items: baseline; }
.bg-top .n { font-size: 15px; font-weight: 500; }
.bg-top .amt { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bg-bar { height: 9px; background: #eef0ed; border-radius: 999px; overflow: hidden; }
.bg-bar > span { display: block; height: 100%; border-radius: 999px;
  transition: width .8s cubic-bezier(.35,0,.25,1); }
.bg-foot { font-size: 13px; }
.fill-ok > span { background: var(--ok); } .fill-warn > span { background: var(--warn); }
.fill-crit > span { background: var(--crit); }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-crit { color: var(--crit); }

.crumb { display: flex; align-items: center; gap: 6px; font-size: 13.5px;
  margin: 0 2px 2px; flex-wrap: wrap; }
.crumb .back { color: var(--accent); cursor: pointer; font-size: 19px; line-height: 1; margin-right: 2px; }
.crumb button { border: 0; background: none; color: var(--accent); font-family: var(--sans);
  font-size: 13.5px; cursor: pointer; padding: 0; }
.crumb .sep { color: var(--muted); }
.crumb .cur { color: var(--text); font-weight: 600; }
.grow { display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  padding: 12px 4px; border-top: 1px solid var(--border); }
.grow.first { border-top: 0; }
.grow .g-top { display: flex; align-items: center; gap: 10px; }
.grow .g-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.grow .g-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; display: flex;
  align-items: center; gap: 7px; }
/* El nombre se recorta CON puntos suspensivos si no cabe; las etiquetas (auto,
   ingreso, recurrente) son aparte y NUNCA se recortan ni desaparecen. «auto» es
   texto corto (se entiende solo); «ingreso» y «recurrente» son iconos (↑, ↻):
   flechas ya reconocibles, sin necesitar la palabra al lado. */
.grow .g-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow .autochip { flex: none; }
.grow .g-amt { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grow .g-chev { color: var(--muted); font-size: 17px; }
.grow:active { background: #fafbfa; }
.autochip { font-size: 10.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #cfe2d6; padding: 1px 6px; border-radius: 999px; flex: none; }
.inchip { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--income);
  padding: 1px 7px; border-radius: 999px; flex: none; }
/* Recurrente: ámbar, para distinguirlo de un vistazo del «auto» (verde) y del
   «ingreso». Marca tanto un apunte que viene de un recurrente como la categoría
   que tiene recurrentes dentro, y así se localiza sin recorrer el árbol. */
.recchip { font-size: 10.5px; font-weight: 700; color: var(--warn); background: #fbf3e3;
  border: 1px solid #eeddbb; padding: 1px 7px; border-radius: 999px; flex: none;
  white-space: nowrap; margin-left: 5px; }
.mv-sub .recchip, .mov-head .recchip { margin-left: 0; }

/* Movimientos */
.day-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 4px 2px 2px; }
.mv { display: flex; align-items: center; gap: 12px; padding: 11px 4px; }
.mv + .mv { border-top: 1px solid var(--border); }
.mv .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; flex: none; }
.mv .ic svg { width: 17px; height: 17px; stroke: var(--accent); fill: none; stroke-width: 2; }
.mv .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mv .cpt { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv .mv-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; }
.mv .tag { min-width: 0; font-size: 12px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid #cfe2d6; padding: 1px 8px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv .mv-date { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mv .num { font-family: var(--serif); font-size: 16px; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.mv .num.in { color: var(--income); }

/* Cokonsejos */
.coach-intro { font-size: 14px; color: var(--muted); line-height: 1.5; padding: 2px 4px; }
.msg { display: flex; gap: 11px; }
.msg img { width: 32px; height: 32px; border-radius: 9px; flex: none; display: block; }
.msg .bubble { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  border-top-left-radius: 4px; padding: 12px 14px; }
.msg .bubble p { margin: 0; font-size: 15px; line-height: 1.5; }
.msg .chip { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted);
  background: #f4f5f3; border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }

/* Barra inferior + FAB */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex; border-top: 1px solid var(--border);
  background: var(--card); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tab { flex: 1; border: 0; background: transparent; cursor: pointer; padding: 9px 2px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted);
  font-family: var(--sans); font-size: 10.5px; font-weight: 500; }
.tab svg { width: 21px; height: 21px; stroke: var(--muted); fill: none; stroke-width: 1.9; }
.tab.active { color: var(--accent); } .tab.active svg { stroke: var(--accent); }
.tab-gap { flex: 1; }
.tabbar.no-gap .tab-gap { display: none; }
/* Se suma `--kb` para que, cuando la barra de escribir sube con el teclado (iOS),
   la conversación no quede escondida detrás de ella. */
#appBody.with-chatbar { padding-bottom: calc(122px + env(safe-area-inset-bottom) + var(--kb, 0px)); }
.tab.pinged { position: relative; }
.tab.pinged::after { content: ''; position: absolute; top: 5px; right: calc(50% - 15px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--card); }

.fab { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 15; width: 62px; height: 62px; border-radius: 50%;
  background: var(--accent); border: 4px solid var(--card);
  box-shadow: 0 6px 18px rgba(26,107,60,.45); display: grid; place-items: center; cursor: pointer; }
.fab:active { transform: translateX(-50%) scale(.94); }
.fab svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 2.4; fill: none; }

/* Barra de chat fija «Habla con Coko» — sobre las pestañas; el + flota encima */
.chatbar { position: fixed; bottom: max(calc(52px + env(safe-area-inset-bottom)), var(--kb, 0px)); left: 50%;
  transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 16;
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--card); border-top: 1px solid var(--border); }
.chatbar[hidden] { display: none; }
.chatbar input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; font-family: var(--sans); font-size: 17px; color: var(--text); outline: 0; background: #f4f5f3; }
.chatbar input:focus { border-color: var(--accent); background: #fff; }
.chatbar .cb-send { flex: none; border: 0; background: var(--accent); width: 40px; height: 40px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.chatbar .cb-send svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2; }

/* Pestaña Cokonsejos = chat: proactivos (tarjetas) + conversación (burbujas) */
.coko-screen { gap: 12px; }
.msg .msg-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.cbub { max-width: 84%; padding: 10px 13px; font-size: 15px; line-height: 1.45; border-radius: 15px; }
.cbub.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cbub.coko { align-self: flex-start; background: var(--accent-soft); color: #143d26; border-bottom-left-radius: 4px;
  display: flex; gap: 8px; align-items: flex-start; }
.cbub.coko .cbub-av { width: 22px; height: 22px; border-radius: 6px; flex: none; margin-top: 1px; }
.cbub.espera { opacity: .7; font-style: italic; }
/* Las respuestas de Coko pueden traer varias líneas (p. ej. la vista previa de un
   apunte rápido): se respetan los saltos, pero el texto sigue ajustándose. */
.cbub.coko > span, .ask-a { white-space: pre-line; }
.coko-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Elegir la etiqueta de un apunte ya escrito (fase 2). El apunte YA está
   guardado: esto no confirma nada, solo responde a «esa etiqueta está en varios
   sitios, ¿cuál es?». Van pegados bajo la tarjeta y alineados con ella: son la
   continuación de lo que Coko acaba de decir, no una acción suelta.
   Prefijo `apu-` (apunte) a propósito: `acc-` ya es de las CUENTAS de Dinero
   (`.acc`, `.acc-movs`, línea 193). Este bloque nació como `.acc` y le pisó el
   estilo a las filas de cuentas, que salían en columna y con sangría. */
.apu-acc { align-self: flex-start; display: flex; flex-direction: column; gap: 8px;
  max-width: 84%; margin: -2px 0 2px 30px; }
.apu-cands { display: flex; flex-wrap: wrap; gap: 6px; }
.apu-cand { border: 1px solid #cfe2d6; background: #fff; color: var(--accent);
  font-family: var(--sans); font-size: 13px; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.apu-cand:hover { background: var(--accent-soft); }
/* «Sí, ponle esa»: la sugerencia es UNA sola opción, así que va rellena — es la
   respuesta esperada, no una más de una lista. */
.apu-cand.si { background: var(--accent); border-color: var(--accent); color: #fff; }
.apu-cand.si:hover { background: #155c33; }
/* Mientras se guarda: apagados, para que dos toques seguidos no manden dos
   reescrituras de la misma fila. */
.apu-cand:disabled { opacity: .5; cursor: default; }

/* Editar · Eliminar · Listo — las mismas acciones que el bot pone bajo cada
   apunte recién guardado. Discretas (contorno, no relleno): la tarjeta ya dice
   lo importante, esto es lo que puedes hacerle. */
.apu-ops { display: flex; flex-wrap: wrap; gap: 6px; }
.apu-op { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-family: var(--sans); font-size: 13px;
  padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.apu-op svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.apu-op:hover { border-color: var(--accent); color: var(--accent); }
/* Eliminar en rojo, pero SIN gritar: es reversible escribiéndolo otra vez, no
   el borrado de una contabilidad. */
.apu-op.peligro { color: var(--crit); }
.apu-op.peligro:hover { border-color: var(--crit); color: var(--crit); }
/* «Editar» aún no opera: el mismo punto que marca lo pendiente en Ajustes. */
.apu-op.soon::after { content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn); margin-left: 1px; }
.apu-op:disabled { opacity: .5; cursor: default; }

/* «Pregúntale a Coko» (ventana fija en Resumen) + input del chat en Cokonsejos */
.ask-card { display: flex; flex-direction: column; gap: 11px; border-color: #cfe2d6; }
.ask-head { display: flex; align-items: center; gap: 9px; }
.ask-head img { width: 26px; height: 26px; border-radius: 8px; }
.ask-head span { font-size: 15px; font-weight: 600; }
.ask-conv { display: flex; flex-direction: column; gap: 8px; }
.ask-q { align-self: flex-end; max-width: 88%; background: var(--accent); color: #fff;
  padding: 8px 12px; border-radius: 14px; border-bottom-right-radius: 4px; font-size: 14.5px; line-height: 1.4; }
.ask-a { align-self: flex-start; max-width: 92%; background: var(--accent-soft); color: #143d26;
  padding: 8px 12px; border-radius: 14px; border-bottom-left-radius: 4px; font-size: 14.5px; line-height: 1.45; }
.ask-a.espera { opacity: .7; font-style: italic; }
.ask-more { align-self: flex-start; border: 0; background: none; color: var(--accent);
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 0; }
.ask-input { display: flex; align-items: center; gap: 8px; }
.ask-input .ask-field { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 15px; font-family: var(--sans); font-size: 17px; color: var(--text); outline: 0; background: #f4f5f3; }
.ask-input .ask-field:focus { border-color: var(--accent); background: #fff; }
.ask-input .ask-send { flex: none; border: 0; background: var(--accent); width: 38px; height: 38px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.ask-input .ask-send svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }
.coko-ask { margin-top: 6px; }

/* Paneles (bottom sheets) */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.34); z-index: 30; }
.backdrop[hidden] { display: none; }
/* Un panel NUNCA debe pasar de la pantalla: sin este tope, en un móvil bajito el
   final del panel (p. ej. «Cerrar sesión») se salía por abajo y no había forma de
   llegar a él. Con max-height + scroll interno, como mucho se desliza dentro. */
.sheet { position: fixed; left: 50%; transform: translateX(-50%); width: 100%;
  max-width: 480px; bottom: 0; background: var(--card); border-radius: 20px 20px 0 0;
  z-index: 31; padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.18); touch-action: pan-y;
  max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .sheet:not([hidden]) { animation: sheetUp .28s cubic-bezier(.3,0,.2,1); }
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
/* El ASA es la zona por la que se arrastra el panel para cerrarlo. Necesita
   `touch-action: none` para que el dedo no se lo lleve el scroll del navegador;
   por eso el arrastre vive AQUÍ y no en todo el panel (el resto tiene que poder
   deslizarse para leer). Se le da alto de sobra para acertar sin mirar. */
.sheet-asa { touch-action: none; cursor: grab; padding: 4px 0 8px; margin: 0 -18px;
  display: block; }
.sheet-asa:active { cursor: grabbing; }
.grabber { width: 40px; height: 5px; background: #d7dbd7; border-radius: 999px; margin: 6px auto 6px; }
/* Con un panel abierto, el fondo NO se mueve: antes el dedo arrastraba la
   pantalla de debajo en vez de cerrar el panel. */
body.con-sheet { overflow: hidden; }
.sheet h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; }
.sheet .s-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 15px; line-height: 1.5; }
.badge2 { display: inline-block; font-size: 12px; font-weight: 600; color: var(--warn);
  background: #fbf3e3; border: 1px solid #eeddbb; padding: 2px 9px; border-radius: 999px;
  margin-bottom: 10px; }
/* Cuentas desplegables: los movimientos de una cuenta, dentro de su propia fila. */
.acc { cursor: pointer; }
.acc .g-chev { color: var(--muted); font-size: 17px; margin-left: 2px;
  transition: transform .18s ease; }
.acc.open .g-chev { transform: rotate(90deg); }
.acc-movs { padding: 2px 0 10px 12px; border-left: 2px solid var(--accent-soft); margin: 0 0 4px 18px; }
.acc-movs[hidden] { display: none; }
.acc-movs .mv:first-child { border-top: 0; }
.acc-vacio { font-size: 13.5px; color: var(--muted); margin: 8px 0 4px; }
@media (prefers-reduced-motion: no-preference) {
  .acc-movs:not([hidden]) { animation: fadeUp .22s ease both; }
}

/* Barra de presupuesto pulsable (abre su ajuste). El lápiz avisa de que se toca. */
.bg-item.bg-edit { cursor: pointer; }
.bg-pencil { display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 7px; background: var(--accent-soft); margin-left: 8px; flex: none; }
.bg-pencil svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; stroke-width: 2; }
/* Con lápiz hay 3 hijos: el nombre empuja, e importe y lápiz quedan juntos a la derecha. */
.bg-item.bg-edit .bg-top { align-items: center; }
.bg-item.bg-edit .bg-top .n { flex: 1; }

/* «Ver todos los movimientos» (pie del acordeón de una cuenta) y «Ver más»
   (paginación del histórico en la pantalla de la cuenta). */
.ver-todos { display: flex; align-items: center; gap: 6px; width: 100%;
  border: 0; background: none; padding: 11px 4px 4px; margin-top: 2px;
  border-top: 1px solid var(--border); color: var(--accent);
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer; }
.ver-todos span { font-size: 16px; }
.ver-mas { display: block; width: 100%; margin: 10px 0 2px; padding: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  color: var(--accent); font-family: var(--sans); font-size: 15px; font-weight: 600;
  cursor: pointer; }
.ver-mas span { color: var(--muted); font-weight: 400; }
.ver-mas:disabled { color: var(--muted); }
.total-card .big.neg { color: var(--crit); }
.cta-tot { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Cabecera de la hoja de un movimiento: el apunte que se está mirando. */
.mov-head { display: flex; align-items: center; gap: 12px; padding: 0 0 13px;
  border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.mov-head .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft);
  display: grid; place-items: center; flex: none; }
.mov-head .ic svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.9; }
.mov-head .txt { flex: 1; min-width: 0; }
.mov-head .cpt { font-family: var(--serif); font-size: 17px; font-weight: 600;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-head .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; }
.mov-head .tag { min-width: 0; font-size: 12px; color: var(--accent); background: var(--accent-soft);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-head .fch { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mov-head .num { font-family: var(--serif); font-size: 19px; flex: none;
  font-variant-numeric: tabular-nums; }
.mov-head .num.in { color: var(--income); }
/* Opciones aún no operativas: se ven, pero se nota que no van (fase 2). */
.opt.soon { opacity: .62; }
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 13px 6px; border: 1px solid var(--border); border-radius: 14px; background: #fafbfa; }
.opt .oi { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft);
  display: grid; place-items: center; }
.opt .oi svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.9; }
.opt .ol { font-size: 13px; text-align: center; }
/* La única opción del «+» que ya opera: se marca para que no parezca una más de
   las que todavía remiten a Telegram. */
.opt.opt-ok { border-color: var(--accent); background: #fff; cursor: pointer; }
.opt.opt-ok .ol { font-weight: 600; color: var(--accent); }
/* «Eliminar» dentro de la rejilla de un movimiento: en rojo, pero sin gritar. */
.opt.opt-del:not(.soon) .oi { background: #fbecea; }
.opt.opt-del:not(.soon) .oi svg { stroke: var(--crit); }
.opt.opt-del:not(.soon) .ol { color: var(--crit); }

/* Editar un movimiento: el panel que sustituye a la rejilla mientras escribes
   un valor o eliges de una lista. Va DENTRO de la misma hoja para no encadenar
   paneles (en un móvil, un panel sobre otro se pierde de vista). */
/* Mientras se edita, la rejilla de 3 columnas deja paso a un panel a todo el
   ancho: un campo de texto o una lista de categorías en un tercio no se leen. */
.opt-grid.editando { display: block; }
.mov-edit { display: flex; flex-direction: column; gap: 10px; }
.me-lbl { font-size: 13px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.me-lbl.peligro { color: var(--crit); }
.me-nota { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.45; }
.me-in { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-family: var(--sans); font-size: 17px; color: var(--text); outline: 0; width: 100%; }
.me-in:focus { border-color: var(--accent); }
.me-lista { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.me-op { text-align: left; border: 1px solid var(--border); background: #fff; color: var(--text);
  font-family: var(--sans); font-size: 15px; padding: 11px 14px; border-radius: 12px; cursor: pointer; }
.me-op:hover { border-color: var(--accent); color: var(--accent); }
.me-op-x { color: var(--muted); font-style: italic; }
.me-btns { display: flex; gap: 8px; justify-content: flex-end; }
.me-x { border: 0; background: none; color: var(--muted); font-family: var(--sans);
  font-size: 15px; padding: 11px 14px; cursor: pointer; }
.me-ok { border: 0; background: var(--accent); color: #fff; font-family: var(--sans);
  font-size: 15px; font-weight: 600; padding: 11px 20px; border-radius: 12px; cursor: pointer; }
.me-ok:disabled { background: #cfd6d1; color: #6a736e; cursor: default; }
.me-ok-del { background: var(--crit); }

/* Confirmación breve tras editar. Se va sola; no es el toast de Cokonsejos. */
.mov-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px;
  z-index: 60; max-width: 88%; background: #1c1f1d; color: #fff; font-size: 14px;
  line-height: 1.4; padding: 11px 16px; border-radius: 12px; white-space: pre-line;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); transition: opacity .4s ease; }
.mov-toast.ir { opacity: 0; }
.tg-cta { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; background: var(--accent); color: #fff; text-decoration: none;
  font-size: 15px; font-weight: 600; padding: 12px; border-radius: 12px; }
.tg-cta svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2; }
/* Reparto del total en Dinero + accesos a Gastos desde Resumen. */
.rep-nota { font-size: 12px; color: var(--muted); margin-top: 4px; }
.a-gastos { cursor: pointer; }
.cl-mas { float: right; color: var(--accent); text-transform: none; letter-spacing: 0;
  font-weight: 600; font-size: 12px; }

/* Tu objetivo, bajo el balance del mes (solo si lo tienes puesto). */
.obj-linea { display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding-top: 11px; border-top: 1px solid var(--border); cursor: pointer; }
.obj-linea svg { width: 15px; height: 15px; stroke: var(--accent); fill: none;
  stroke-width: 1.9; flex: none; }
.obj-linea span { font-size: 13.5px; color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Premium. Destaca sin gritar: no es un ajuste, es una oferta — pero tampoco
   un banner agresivo. Verde suave, y si YA eres Premium cambia a nota de gracias. */
.prem-card { display: block; width: 100%; text-align: left; margin: 14px 0 2px;
  padding: 13px 14px; border: 1px solid #cfe2d6; border-radius: 14px;
  background: linear-gradient(180deg, #f4faf6, #eef6f1); cursor: pointer;
  font-family: var(--sans); }
.prem-top { display: flex; align-items: center; gap: 10px; }
.prem-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; flex: none; }
.prem-ico svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 1.8; }
.prem-t { flex: 1; font-size: 15.5px; font-weight: 600; color: var(--text); }
.prem-chev { color: var(--accent); font-size: 18px; }
.prem-sub { display: block; font-size: 13px; color: var(--muted); margin: 6px 0 0 40px; }
.prem-card.ya { background: #fff; border-color: var(--border); }

.prem-lista { display: flex; flex-direction: column; gap: 13px; margin: 4px 0 4px; }
.prem-item { display: flex; align-items: flex-start; gap: 11px; font-size: 14px;
  line-height: 1.45; }
.prem-item .pi { width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.prem-item .pi svg { width: 16px; height: 16px; stroke: var(--accent); fill: none;
  stroke-width: 1.9; }
.prem-nota { margin-top: 14px !important; }

/* «Y además» del panel de apuntar: separa los tres principales del resto. */
.opt-mas { font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 16px 2px 9px; }

/* Volver al menú de arriba desde un submenú (en vez de cerrarlo todo). */
.sheet-back { border: 0; background: none; padding: 0 0 6px; margin: 0;
  color: var(--accent); font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer; display: block; }

/* Ajustes: el perfil va en la cabecera, en pequeño, para no gastar una fila. */
.aj-cab { display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; }
.aj-cab h3 { margin: 0; }
.aj-uid { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--muted); flex: none; }
.aj-uid svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; stroke-width: 2; }

/* Recomendar Coko, colgando de la tarjeta de Premium (no gasta fila propia). */
.prem-ref { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 2px 12px; color: var(--accent); font-family: var(--sans);
  font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* Lo que borra de verdad se ve distinto ANTES de tocarlo. */
.set-row.peligro .st { color: var(--crit); }
.set-row.peligro .si { background: #fbeae8; }
.set-row.peligro .si svg { stroke: var(--crit); }
.peligro-badge { color: var(--crit) !important; background: #fbeae8 !important;
  border-color: #f0cdc8 !important; }
.peligro-cta { background: var(--crit) !important; }
.borrar-lista { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.bo-item { display: flex; gap: 11px; font-size: 13px; line-height: 1.45; }
.bo-item > span:first-child { flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fbeae8; color: var(--crit); font-weight: 700; font-size: 12px;
  display: grid; place-items: center; }

/* Ajustes: grupos, filas-enlace y filas que aún no se pueden tocar (fase 2). */
.set-grupo { font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 16px 2px 0; }
a.set-row { text-decoration: none; color: inherit; }
.set-row[data-aj] { cursor: pointer; }
.set-row.soon .st::after { content: 'pronto'; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; color: var(--warn); background: #fbf3e3;
  border: 1px solid #eeddbb; padding: 1px 6px; border-radius: 999px;
  margin-left: 7px; vertical-align: 1px; text-transform: uppercase; }
.info-cuerpo { white-space: pre-line; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 2px;
  border-top: 1px solid var(--border); }
.set-row.first { border-top: 0; }
.set-row .si { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; flex: none; }
.set-row .si svg { width: 17px; height: 17px; stroke: var(--accent); fill: none; stroke-width: 1.9; }
.set-row .st { flex: 1; font-size: 15px; }
.set-row .sv { font-size: 13px; color: var(--muted); }
.set-row.link { cursor: pointer; }
.set-tele { margin-top: 12px; display: flex; gap: 9px; font-size: 13.5px; line-height: 1.5;
  color: var(--muted); background: var(--accent-soft); border: 1px solid #cfe2d6;
  border-radius: 12px; padding: 11px 12px; }
.set-tele svg { flex: none; width: 16px; height: 16px; stroke: var(--accent); fill: none;
  stroke-width: 1.9; margin-top: 1px; }

/* Toast de Cokonsejos */
.toast { position: fixed; bottom: calc(98px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); width: calc(100% - 24px); max-width: 440px; z-index: 25;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 18px 46px rgba(0,0,0,.28); padding: 16px 16px 14px;
  transition: transform .5s cubic-bezier(.4,0,.2,1), opacity .4s ease; }
@media (prefers-reduced-motion: no-preference) {
  .toast:not(.flyaway) { animation: popUp .5s cubic-bezier(.34,1.4,.64,1); }
}
@keyframes popUp { from { transform: translate(-50%, 130%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; } }
.toast .th { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.toast .th img { width: 30px; height: 30px; border-radius: 9px; display: block; }
.toast .th b { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.toast p { margin: 0 0 9px; font-size: 16px; line-height: 1.5; color: var(--text); }
.toast .t-chip { display: inline-block; font-size: 12px; color: var(--muted); background: #f4f5f3;
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.toast .t-ok { display: block; width: 100%; margin-top: 14px; border: 0; background: var(--accent);
  color: #fff; font-family: var(--sans); font-size: 16px; font-weight: 600; padding: 12px;
  border-radius: 12px; cursor: pointer; }
.toast.flyaway { transform: translate(120px, 46vh) scale(.1); opacity: 0; }

/* Banner "Instala Coko" (PWA) */
.install-banner { position: fixed; bottom: calc(98px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); width: calc(100% - 24px); max-width: 440px; z-index: 24;
  background: var(--card); border: 1px solid #cfe2d6; border-radius: 18px;
  box-shadow: 0 18px 46px rgba(0,0,0,.26); padding: 16px; }
@media (prefers-reduced-motion: no-preference) { .install-banner:not([hidden]) { animation: popUp .5s cubic-bezier(.34,1.4,.64,1); } }
.install-banner[hidden] { display: none; }
.install-banner .ib-top { display: flex; align-items: center; gap: 11px; }
.install-banner .ib-top img { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.install-banner .ib-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.install-banner .ib-txt b { font-size: 16px; }
.install-banner .ib-txt span { font-size: 13.5px; color: var(--muted); }
.install-banner .ib-actions { display: flex; gap: 10px; margin-top: 14px; }
.install-banner .ib-go { flex: 1; border: 0; background: var(--accent); color: #fff; font-family: var(--sans);
  font-size: 16px; font-weight: 600; padding: 12px; border-radius: 12px; cursor: pointer; }
.install-banner .ib-x { border: 0; background: #f4f5f3; color: var(--muted); font-family: var(--sans);
  font-size: 15px; padding: 12px 16px; border-radius: 12px; cursor: pointer; }

/* Aviso de datos desactualizados: una barra fina, sin alarma (nada de rojo). */
.stale-bar { position: fixed; bottom: calc(98px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); width: calc(100% - 24px); max-width: 440px; z-index: 23;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 11px 14px; }
.stale-bar span { flex: 1; font-size: 13px; line-height: 1.4; color: var(--muted); }
.stale-bar b { flex: none; font-size: 13px; color: var(--accent); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .stale-bar { animation: popUp .4s cubic-bezier(.34,1.4,.64,1); } }

/* Skeletons (primera carga sin caché) */
.skel { border-radius: 16px; background: linear-gradient(100deg, #ececea 40%, #f6f6f4 50%, #ececea 60%);
  background-size: 200% 100%; animation: skel 1.1s linear infinite; border: 1px solid var(--border); }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
