:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --text: #0B0B0F;
  --muted: #6C6C70;
  --line: #E5E5EA;
  --field: #E9E9EE;
  --accent: #0071E3;
  --accent-ink: #FFFFFF;
  --ok-bg: #E4F6E8;   --ok-fg: #1E7B34;
  --warn-bg: #FFF1E0; --warn-fg: #A34400;
  --bad-bg: #FFE7E8;  --bad-fg: #C8102E;
  --info-bg: #E5F0FF; --info-fg: #0050C8;
  --off-bg: #EEEEF0;  --off-fg: #5A5A5F;
  --wa: #1E7B34;
  --nav: rgba(255, 255, 255, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --c-ing: #0071E3;
  --c-gas: #E8710A;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1C1C1E;
    --text: #F5F5F7;
    --muted: #A1A1A6;
    --line: #38383A;
    --field: #2C2C2E;
    --accent: #3D9BFF;
    --accent-ink: #001A33;
    --ok-bg: #12351C;   --ok-fg: #6EE08F;
    --warn-bg: #3D2508; --warn-fg: #FFB561;
    --bad-bg: #42121A;  --bad-fg: #FF8A96;
    --info-bg: #0E2A4D; --info-fg: #8EC2FF;
    --off-bg: #2C2C2E;  --off-fg: #B0B0B5;
    --wa: #6EE08F;
    --nav: rgba(28, 28, 30, 0.78);
    --shadow: none;
    --c-ing: #2F86E8;
    --c-gas: #D9741F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Splash y login ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.logo {
  width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 26px;
}
.logo.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }

.login {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  max-width: 400px; margin: 0 auto; padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  gap: 28px;
}
.login h1 { margin: 16px 0 4px; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.login p { margin: 0; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent;
  background: var(--card); box-shadow: var(--shadow); font-size: 17px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.btn {
  min-height: 50px; border: 0; border-radius: 14px; padding: 0 18px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 17px;
}
.btn:disabled { opacity: .6; }
.btn.ghost { background: var(--field); color: var(--text); }
.error { color: var(--bad-fg); background: var(--bad-bg); padding: 10px 12px; border-radius: 12px; font-size: 14px; margin: 0; }

/* ---------- Estructura ---------- */
.shell { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.top { padding: calc(14px + env(safe-area-inset-top)) 20px 6px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.top-date { font-size: 13px; color: var(--muted); font-weight: 500; }
.top h1 { margin: 4px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -0.025em; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--muted);
}
.back {
  min-height: 44px; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 17px;
  display: inline-flex; align-items: center; gap: 2px; padding: 0 8px 0 0;
}
main { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Tarjetas de Inicio ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--card); border-radius: 18px; padding: 14px; border: 0; text-align: left;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); min-height: 104px;
}
.stat-ic { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; }
.stat-ic svg.i { width: 18px; height: 18px; }
.stat-n { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.stat-l { font-size: 14px; color: var(--muted); font-weight: 600; }
.tone-ok { background: var(--ok-bg); color: var(--ok-fg); }
.tone-warn { background: var(--warn-bg); color: var(--warn-fg); }
.tone-bad { background: var(--bad-bg); color: var(--bad-fg); }
.tone-info { background: var(--info-bg); color: var(--info-fg); }
.tone-off { background: var(--off-bg); color: var(--off-fg); }

.section-h { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 4px 0; }
.section-h h2 { margin: 0; font-size: 20px; font-weight: 700; }
.section-h span { font-size: 14px; color: var(--muted); }

/* ---------- Listas ---------- */
.list { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px;
  background: none; border: 0; text-align: left; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
}
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.chev { color: var(--muted); opacity: .6; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 15px; }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- Buscador y filtros ---------- */
.search { position: relative; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input {
  width: 100%; min-height: 44px; border-radius: 12px; border: 0; background: var(--field);
  padding: 0 14px 0 38px; font-size: 17px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--card); box-shadow: var(--shadow); font-size: 15px; font-weight: 600; color: var(--text);
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.chip .n { opacity: .7; margin-left: 4px; font-weight: 500; }

/* ---------- Ficha ---------- */
.hero { background: var(--card); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero .avatar { width: 56px; height: 56px; font-size: 22px; }
.hero h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.hero .phone { color: var(--muted); font-size: 15px; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.act {
  min-height: 48px; border-radius: 14px; border: 0; background: var(--field); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; text-decoration: none;
}
.act.wa { background: var(--ok-bg); color: var(--wa); }
.vence { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; }
.vence b { font-size: 17px; }
.vence span { font-size: 14px; font-weight: 600; }
.kv { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 4px 14px; }
.kv h3 { margin: 10px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv h3 + .kv-row { border-top: 0; }
.kv-row dt { color: var(--muted); }
.kv-row dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv dl { margin: 0; }
.note { padding: 11px 0; font-size: 15px; white-space: pre-wrap; }
.pay { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.kv h3 + .pay { border-top: 0; }
.pay-main { flex: 1; min-width: 0; }
.pay-main b { display: block; }
.pay-main span { font-size: 14px; color: var(--muted); }

/* ---------- Hoja "Registrar pago" ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 22px 22px 0 0; background: var(--bg); color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.35); }
@media (min-width: 600px) { .sheet { margin: auto; border-radius: 22px; } }
.sheet-body .act { min-height: 50px; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; padding: 12px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.sheet-who { margin: -6px 0 0; color: var(--muted); font-size: 15px; text-align: center; }
.link { border: 0; background: none; color: var(--accent); font-size: 17px; min-height: 44px; min-width: 64px; text-align: left; padding: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 12px; background: var(--field); }
.seg button { min-height: 40px; border: 0; border-radius: 10px; background: none; font-weight: 600; font-size: 15px; color: var(--text); }
.seg button[aria-checked="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer;
}
.toggle span { display: flex; flex-direction: column; gap: 2px; }
.toggle small { color: var(--muted); font-size: 13px; }
.toggle input {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 999px; flex: none;
  background: var(--line); position: relative; cursor: pointer; transition: background .2s ease;
}
.toggle input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 999px;
  background: #FFFFFF; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform .2s ease;
}
.toggle input:checked { background: #34C759; }
.toggle input:checked::after { transform: translateX(20px); }
.preview { border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.preview span { font-weight: 600; font-size: 15px; }
.preview b { font-size: 20px; text-align: right; }
.preview small { grid-column: 1 / -1; opacity: .85; font-size: 13px; }
.mini {
  flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0;
  background: var(--info-bg); color: var(--info-fg); font-weight: 700; font-size: 13px;
}
.hero .btn { width: 100%; }
.hero .icon-btn { background: var(--field); box-shadow: none; color: var(--accent); }
main > .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; }
.sheet-sub { margin: 6px 0 -4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.field textarea {
  padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; background: var(--card);
  box-shadow: var(--shadow); font-size: 17px; resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--accent); }
.sheet .field input { background: var(--card); }

/* ---------- Calendario ---------- */
.cal { background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head .icon-btn { background: var(--field); box-shadow: none; color: var(--accent); }
.cal-title { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.cal-title b { font-size: 18px; }
.cal-title span { font-size: 13px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.cal-cell {
  min-height: 48px; border: 0; border-radius: 12px; background: none; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; color: var(--text);
}
.cal-cell.vacio { pointer-events: none; }
.cal-n { font-size: 15px; font-weight: 600; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; }
.cal-cell.hoy .cal-n { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.sel .cal-n { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.cal-dots { display: flex; gap: 3px; min-height: 10px; }
.dot {
  min-width: 8px; height: 8px; border-radius: 999px; font-style: normal; font-size: 9px; font-weight: 800; line-height: 8px;
  display: inline-grid; place-items: center; padding: 0 1px;
}
.dot.tone-bad { background: var(--bad-fg); color: var(--card); }
.dot.tone-warn { background: #FF8D28; color: #FFFFFF; }
.dot.tone-info { background: var(--info-fg); color: var(--card); }
.dot.tone-ok { background: #34C759; color: #FFFFFF; }
.cal-dots .dot:not(:empty) { min-width: 14px; height: 14px; line-height: 14px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Finanzas ---------- */
.fin-hero { text-align: center; font-size: 40px; font-weight: 800; letter-spacing: -0.02em; padding: 2px 0; }
.fin-hero.neg { color: var(--bad-fg); }
.fin-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fin-kpis div { background: var(--field); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.fin-kpis .key { font-size: 12px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.fin-kpis b { font-size: 15px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.sw.ing { background: var(--c-ing); }
.sw.gas { background: var(--c-gas); }
.chart-card { padding-bottom: 12px; }
.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; height: 160px; padding: 8px 0 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.bar-col { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px; border-radius: 10px; min-width: 0; color: var(--muted); }
.bar-col.sel { background: rgba(127, 127, 127, 0.10); color: var(--text); }
.bar-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 6px; }
.bar { width: 40%; max-width: 18px; border-radius: 4px 4px 0 0; }
.bar.ing { background: var(--c-ing); }
.bar.gas { background: var(--c-gas); }
.bar-lbl { font-size: 12px; font-weight: 600; text-align: center; padding-bottom: 4px; }
.cat-row { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.kv h3 + .cat-row { border-top: 0; }
.cat-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.cat-bar { height: 6px; border-radius: 999px; background: var(--field); overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--c-gas); border-radius: 999px; }
.tone-ing { background: var(--info-bg); color: var(--info-fg); }
.tone-gas { background: var(--warn-bg); color: var(--warn-fg); }
.mov-monto { font-weight: 700; font-size: 15px; white-space: nowrap; flex: none; }
.mov-monto.ingreso { color: var(--ok-fg); }
.btn.danger { background: var(--bad-bg); color: var(--bad-fg); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.field select { min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid transparent; background: var(--card); box-shadow: var(--shadow); font-size: 17px; }
.cobro-top { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0 8px; }
.cobro-top > div { display: flex; flex-direction: column; gap: 2px; }
.cobro-top .key { font-size: 13px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.cobro-top b { font-size: 20px; }
.cobro-bar { display: block; margin-bottom: 6px; }
.cobro-bar i { background: var(--c-ing); }
.cobro-row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; font: inherit; text-align: left; }
.hint { margin: -6px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Embudo de prospectos ---------- */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 78%); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none;
}
.board::-webkit-scrollbar { display: none; }
@media (min-width: 600px) { .board { grid-auto-columns: 260px; } }
.col { scroll-snap-align: start; background: var(--field); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px; }
.col-n { font-weight: 700; color: var(--muted); font-size: 14px; }
.col-body { display: flex; flex-direction: column; gap: 8px; }
.col-empty { margin: 8px 4px; color: var(--muted); font-size: 14px; }
.card-p {
  background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); border: 0; text-align: left; font: inherit; width: 100%;
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text); min-height: 44px;
}
.card-p span { font-size: 14px; color: var(--muted); }
.card-p .card-meta { font-size: 13px; }
.card-p em { font-style: normal; color: var(--warn-fg); font-weight: 600; }

/* ---------- Chats ---------- */
.chat-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.chat-time { font-size: 12px; color: var(--muted); }
.dot-unread { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.chat-head div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-head b { font-size: 18px; }
.chat-head span { font-size: 14px; color: var(--muted); }
.bot-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; padding: 10px 14px; }
.bot-toggle.on { background: var(--ok-bg); color: var(--ok-fg); }
.bot-toggle.off { background: var(--warn-bg); color: var(--warn-fg); }
.bot-toggle > span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.bot-toggle small { grid-column: 2; font-size: 13px; opacity: .9; }
.bot-toggle .mini { background: var(--card); color: var(--text); }
.msgs { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.dia-sep { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--field); padding: 3px 10px; border-radius: 999px; margin: 8px 0 2px; }
.msg { max-width: 82%; padding: 8px 12px 6px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.msg.cliente { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.msg.bot { align-self: flex-end; background: var(--info-bg); color: var(--text); border-bottom-right-radius: 6px; }
.msg.randy { align-self: flex-end; background: var(--ok-bg); color: var(--text); border-bottom-right-radius: 6px; }
.msg-who { font-size: 11px; font-weight: 700; color: var(--muted); }
.msg-txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.msg-hora { align-self: flex-end; font-size: 11px; color: var(--muted); }
.composer {
  position: sticky; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-radius: 22px;
  background: var(--card); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.composer textarea {
  flex: 1; border: 0; background: var(--field); border-radius: 16px; padding: 10px 14px; font-size: 16px;
  resize: none; min-height: 42px; max-height: 140px; line-height: 1.35;
}
.composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.send { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .5; }
.wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: #1E7B34; color: #FFFFFF; }

/* ---------- Barra inferior ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: var(--nav); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14), inset 0 0 0 0.5px rgba(127, 127, 127, 0.25);
  z-index: 10;
}
.nav button {
  min-width: 62px; min-height: 52px; padding: 0 4px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600;
}
.nav button[aria-current="page"] { color: var(--accent); background: rgba(127, 127, 127, 0.12); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom));
  background: #1C1C1E; color: #FFFFFF; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .stat, .act, .chip, .btn, .nav button { transition: transform .2s ease; }
  .stat:active, .act:active, .chip:active, .btn:active, .row:active { transform: scale(0.98); }
}
