/* ============================================================
   QuVi Pro · Escritorio — Shell
   (codename interno: "asesor" / "as" / "AS")
   Estructura exacta de Plan Studio v2
   QuVi · 2026
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --ink:       #0f172a;
  --mut:       #475569;
  --line:      #e2e8f0;
  --bg:        #f8fafc;
  --brand:     #0d99ff;
  --brand-d:   #0a7dd6;
  --brand-50:  #e5f3ff;
  --card:      #fff;
  --win:       #16a34a;
  --win-d:     #15803d;
  --warn:      #d97706;
  --err:       #dc2626;
  --err-50:    #fee2e2;

  --topbar-h:           56px;
  --palette-w:          60px;
  --palette-w-expanded: 228px;
  --sheet-w:            360px;
  --insights-w:         320px;

  --t:       .12s;
  --t-slide: .18s cubic-bezier(.32,.72,0,1);
  --t-grid:  .22s cubic-bezier(.32,.72,0,1);
  --r-pill:  9999px;
}

/* ---- Reset mínimo ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ---- Base tipográfica global — todo hereda desde aquí ---- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font: inherit; cursor: pointer; }

/* ============================================================
   AUTH GATE
   ============================================================ */
.as-auth-gate {
  position: fixed; inset: 0; z-index: 9900;
  background: linear-gradient(160deg, #cfe7ff 0%, #dceeff 30%, #e9f3ff 65%, #eff5fb 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .25s cubic-bezier(.32,.72,0,1), transform .25s cubic-bezier(.32,.72,0,1);
}
.as-auth-gate.is-hiding {
  opacity: 0; pointer-events: none; transform: scale(1.015);
}

.as-auth-card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,.94);
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(15,23,42,.05), 0 24px 64px rgba(13,153,255,.13);
  width: 100%; max-width: 420px;
  padding: 40px 36px 36px;
}

.as-auth-tolanding {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: oklch(0.62 0.19 252);
  margin-bottom: 20px;
  transition: opacity .15s ease;
  flex: none;
}
.as-auth-tolanding:hover { text-decoration: underline; }
.as-auth-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 32px; }
.as-auth-logo img { height: 28px; width: auto; }
.as-auth-logo-badge {
  font-size: .74rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
  color: oklch(0.62 0.19 252);
  background: oklch(0.96 0.03 252);
  padding: 3px 8px; border-radius: 7px;
}

.as-auth-title {
  font-size: 22px; font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em; color: var(--ink); margin-bottom: 6px;
}
.as-auth-sub {
  font-size: 13px; font-weight: 400; line-height: 1.55;
  color: var(--mut); margin-bottom: 28px;
}
.as-auth-panel { display: flex; flex-direction: column; gap: 14px; }
.as-auth-panel[hidden] { display: none; }

.as-auth-field { display: flex; flex-direction: column; gap: 6px; }
.as-auth-label {
  font-size: 11px; font-weight: 600; line-height: 1;
  letter-spacing: .05em; text-transform: uppercase; color: var(--mut);
}
.as-auth-input {
  font-size: 15px; font-weight: 400; line-height: 1.25;
  color: var(--ink);
  background: rgba(255,255,255,.95);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 14px; outline: none; width: 100%;
  transition: border-color var(--t), box-shadow var(--t);
}
.as-auth-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,153,255,.14);
}
.as-auth-input::placeholder { color: #94a3b8; }

.as-auth-btn {
  font-size: 14px; font-weight: 600; line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%);
  border: none; border-radius: 12px;
  padding: 13px 20px; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity var(--t), transform var(--t);
  text-decoration: none;
}
.as-auth-btn:hover { opacity: .92; }
.as-auth-btn:active { transform: scale(.98); }
.as-auth-btn:disabled { opacity: .5; cursor: not-allowed; }

.as-auth-btn-ghost {
  font-size: 13px; font-weight: 400; line-height: 1;
  color: var(--brand);
  background: none; border: none; padding: 6px 0;
  cursor: pointer; text-align: center;
  transition: opacity var(--t);
}
.as-auth-btn-ghost:hover { opacity: .72; }

.as-auth-error {
  font-size: 12.5px; font-weight: 400; line-height: 1.4;
  color: var(--err);
  background: var(--err-50);
  border: 1px solid rgba(220,38,38,.18);
  border-radius: 8px; padding: 9px 12px; display: none;
}
.as-auth-error.is-visible { display: block; }

/* OTP */
.as-otp-wrap { display: flex; gap: 6px; }
.as-otp-input {
  font-size: 20px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink);
  background: rgba(255,255,255,.95);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 0; width: 100%; min-width: 0; text-align: center; outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.as-otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.as-otp-input.is-filled { border-color: var(--brand); background: var(--brand-50); }

.as-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Upgrade */
.as-upgrade-card { text-align: center; padding: 8px 0; }
.as-upgrade-icon { font-size: 36px; margin-bottom: 16px; display: block; }
.as-upgrade-title { font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--ink); margin-bottom: 8px; }
.as-upgrade-sub   { font-size: 13px; font-weight: 400; line-height: 1.6; color: var(--mut); margin-bottom: 24px; }

/* ============================================================
   APP GRID
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--palette-w) 0 1fr 0;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar  topbar topbar  topbar"
    "palette sheet  canvas  insights";
  height: 100vh; width: 100vw;
  transition: grid-template-columns var(--t-grid);
}
.app[hidden] { display: none !important; }

.app.has-sheet         { grid-template-columns: var(--palette-w) var(--sheet-w)   1fr 0; }
.app.has-insights      { grid-template-columns: var(--palette-w) 0                1fr var(--insights-w); }
.app.has-sheet.has-insights { grid-template-columns: var(--palette-w) var(--sheet-w) 1fr var(--insights-w); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  gap: 14px; min-width: 0;
}

.tb-left  { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }

.tb-brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink);
  font-size: 14px; font-weight: 600; line-height: 1;
  white-space: nowrap; flex: none;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.tb-logo  { height: 26px; width: auto; display: block; }
/* "Pro" tag — idéntico al .pro-brand__tag de la landing /pro */
.tb-pro-tag {
  font-size: .70rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
  color: oklch(0.62 0.19 252);
  background: oklch(0.96 0.03 252);
  padding: 2px 7px; border-radius: 7px;
}
.tb-sep   { font-size: 14px; font-weight: 400; color: #cbd5e1; flex: none; }
.tb-vintage {
  font-size: 11px; font-weight: 500; line-height: 1;
  padding: 3px 9px;
  background: #f1f5f9; color: var(--mut);
  border-radius: 12px; white-space: nowrap; flex: none;
}
.tb-context {
  font-size: 13px; font-weight: 400; color: var(--mut);
  min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.tb-context .ctx-empty { font-style: italic; color: #94a3b8; }
.topbar:has(.tb-context .ctx-empty) .tb-sep { display: none; }

.tb-btn {
  font-size: 12.5px; font-weight: 500; line-height: 1;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 13px; border-radius: 9px;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--t);
}
.tb-btn:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-50); }
.tb-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.tb-btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.tb-btn svg { width: 14px; height: 14px; stroke-width: 2; flex: none; }

/* Saldo del plan (IA / cotizaciones). Mismo contenedor que el botón Buscar. */
.tb-quota {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff;
  padding: 7px 11px; border-radius: 9px;
  cursor: pointer; flex: none;
  transition: all var(--t);
}
.tb-quota:hover { border-color: var(--brand); background: var(--brand-50); }
.tb-quota .tbq-item { display: flex; align-items: center; gap: 5px; color: var(--mut); }
.tb-quota .tbq-ico { width: 14px; height: 14px; stroke-width: 2; flex: none; }  /* svg Lucide; hereda color */
.tb-quota .tbq-num { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.tb-quota .tbq-of { font-size: 11px; font-weight: 500; color: #94a3b8; line-height: 1; }
.tb-quota .tbq-inf { font-size: 15px; font-weight: 600; color: #94a3b8; line-height: 1; }
.tb-quota .tbq-sep { width: 1px; height: 14px; background: var(--line); flex: none; }
/* Estados: pocos restantes / agotado. Color por contraste, no por brillo. */
.tb-quota .tbq-item.is-low { color: #f59e0b; }
.tb-quota .tbq-item.is-low .tbq-num { color: #f59e0b; }
.tb-quota .tbq-item.is-out { color: var(--err); }
.tb-quota .tbq-item.is-out .tbq-num { color: var(--err); }

/* Overlay de uso del plan (reusa el shell .mx-goal de Métricas). */
.qov-back .mx-goal-seclbl { display: flex; align-items: center; gap: 6px; }
.qov-back .mx-goal-seclbl svg { width: 14px; height: 14px; flex: none; }
.qov-back .qov-big { font-size: 23px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -.02em; }
.qov-back .qov-big-sub { font-size: 12.5px; font-weight: 500; color: var(--mut); letter-spacing: 0; }
.qov-back .qov-foot { font-size: 12px; color: var(--mut); }
.qov-back .qov-inf-badge { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--brand-d); background: var(--brand-50); border: 1px solid #bae0ff; border-radius: 999px; padding: 3px 11px; }
.qov-back .qov-up { appearance: none; cursor: pointer; align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--brand); background: var(--brand-50); color: var(--brand-d); font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 10px; transition: all var(--t); }
.qov-back .qov-up:hover { background: var(--brand); color: #fff; }
.qov-back .qov-up svg { width: 15px; height: 15px; flex: none; }

.tb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; overflow: hidden;
  transition: opacity var(--t);
}
.tb-avatar:hover { opacity: .85; }
.tb-avatar-txt {
  font-size: 10px; font-weight: 700; line-height: 1;
  color: #fff; letter-spacing: .04em; pointer-events: none;
}

/* ============================================================
   PALETTE
   ============================================================ */
.palette {
  grid-area: palette;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  align-items: stretch;
  padding: 7px 8px;
  gap: 1px;
  overflow-y: auto; overflow-x: hidden;
  width: var(--palette-w);
  transition: width var(--t-slide);
  z-index: 5; position: relative;
}
.palette.expanded {
  width: var(--palette-w-expanded);
  box-shadow: 6px 0 24px rgba(15,23,42,.06);
}
.palette::-webkit-scrollbar { display: none; }

.palette-spacer { flex: 1; }

.tool {
  appearance: none; border: 0;
  background: transparent;
  height: 39px; padding: 0 10px;
  border-radius: 9px;
  display: flex; align-items: center; gap: 12px;
  color: var(--mut);
  position: relative;
  transition: all var(--t);
  flex: none; overflow: hidden; width: 100%;
  cursor: pointer;
  white-space: nowrap; text-align: left;
}
.tool:hover { background: #f1f5f9; color: var(--ink); }
.tool.active { background: var(--brand-50); color: var(--brand-d); }
.tool.active::before {
  content: '';
  position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 3px; background: var(--brand);
  border-radius: 0 3px 3px 0;
}

.tool-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.tool-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }

.tool-label {
  font-size: 13px; font-weight: 500; line-height: 1;
  white-space: nowrap; opacity: 0;
  transition: opacity .14s .04s;
  flex: 1;
}
.palette.expanded .tool-label { opacity: 1; }
/* Badge "PRO": destaca una sección sin color de marca ni glow. Sigue la
   visibilidad del label (solo cuando la paleta está expandida). */
.tool-pro {
  flex: 0 0 auto; align-self: center;
  font-size: 9px; font-weight: 800; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 999px; line-height: 1;
  background: var(--ink, #0f172a); color: #fff;
  opacity: 0; transition: opacity .14s .04s;
}
.palette.expanded .tool-pro { opacity: 1; }

.pal-sep { height: 1px; background: var(--line); margin: 3px 0; flex: none; }
.tool--robot { background: linear-gradient(135deg, rgba(124,58,237,0.10), rgba(139,92,246,0.05)); border: 1px solid rgba(124,58,237,0.18); color: #7c3aed; border-radius: 10px; margin-top: 4px; }
.tool--robot:hover { background: linear-gradient(135deg, rgba(124,58,237,0.16), rgba(139,92,246,0.10)); color: #6d28d9; }
.tool--robot.active { background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(99,66,182,0.14)); color: #6d28d9; }
.tool--robot.active::before { background: #8b5cf6; }
.tool--ia { color: var(--brand); }
.tool--ia:hover { color: var(--brand-d); }

/* ============================================================
   SHEET / CANVAS / INSIGHTS
   ============================================================ */
.sheet {
  grid-area: sheet;
  background: var(--card);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
.canvas {
  grid-area: canvas;
  background: var(--bg);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
.insights {
  grid-area: insights;
  background: var(--card);
  border-left: 1px solid var(--line);
  overflow-y: auto;
}

/* ============================================================
   KBD
   ============================================================ */
kbd {
  font-size: 11px; font-weight: 600; line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f1f5f9; color: var(--ink);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px;
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.32);
  z-index: 300;
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 80px;
  animation: fadeIn .18s ease-out;
}

.modal-cmd {
  width: 580px; max-width: 92vw;
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 80px rgba(15,23,42,.22);
  animation: slideUp .2s cubic-bezier(.32,.72,0,1);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 70vh;
}

.cmd-input {
  font-size: 15px; font-weight: 400; line-height: 1.25;
  border: 0; padding: 18px 22px;
  color: var(--ink); outline: 0;
  border-bottom: 1px solid var(--line);
  width: 100%; background: transparent;
}
.cmd-input::placeholder { color: #94a3b8; }

.cmd-list {
  flex: 1; overflow-y: auto;
  padding: 6px 0; list-style: none; margin: 0;
}
.cmd-item {
  padding: 9px 22px;
  display: grid; grid-template-columns: 26px 1fr auto;
  gap: 12px; align-items: center;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--t);
}
.cmd-item:hover,
.cmd-item.active { background: var(--brand-50); border-left-color: var(--brand); }

.cmd-item .ci-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--mut);
}
.cmd-item .ci-icon svg { width: 17px; height: 17px; }

.cmd-item .ci-l {
  font-size: 13.5px; font-weight: 500; line-height: 1.25;
  color: var(--ink);
}
.cmd-item .ci-s {
  font-size: 11.5px; font-weight: 400; line-height: 1.3;
  color: var(--mut); margin-top: 1px;
}
.cmd-item .ci-cat {
  font-size: 10px; font-weight: 500; line-height: 1;
  letter-spacing: .04em; text-transform: uppercase;
  color: #94a3b8;
  padding: 2px 7px; background: #f1f5f9; border-radius: 5px;
}

.cmd-foot {
  padding: 8px 22px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; font-weight: 400; line-height: 1;
  color: var(--mut); display: flex; gap: 14px; align-items: center;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.tip {
  position: fixed;
  background: #0f172a; color: #fff;
  padding: 6px 10px; border-radius: 7px;
  font-size: 11.5px; font-weight: 400; line-height: 1.4;
  max-width: 240px; text-align: center;
  z-index: 1000; pointer-events: none;
  box-shadow: 0 8px 24px rgba(15,23,42,.22);
  animation: tipIn .14s ease-out;
  white-space: normal;
}
.tip::before {
  content: "";
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}
.tip.below::before {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #0f172a;
}

/* ============================================================
   MÉTRICAS — dashboard cockpit
   ============================================================ */
.mx-canvas { background: var(--bg); }
.mx-scroll { padding: 24px 28px 40px; max-width: 1120px; margin: 0 auto; width: 100%; }

/* Toolbar */
.mx-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.mx-toolbar-l { display: flex; flex-direction: column; gap: 2px; }
.mx-h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.mx-h1-sub { font-size: 13px; font-weight: 400; color: var(--mut); }

.mx-segmented {
  display: inline-flex; background: #fff;
  border: 1px solid var(--line); border-radius: 11px;
  padding: 3px; gap: 2px;
}
.mx-seg {
  appearance: none; border: 0; background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--mut);
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  transition: all var(--t); white-space: nowrap;
}
.mx-seg:hover { color: var(--ink); }
.mx-seg.is-active { background: var(--brand-50); color: var(--brand-d); font-weight: 600; }

/* Demo banner */
.mx-demo-banner {
  display: flex; align-items: flex-start; gap: 9px;
  background: #fffbeb; border: 1px solid #fde68a;
  color: #92400e; border-radius: 11px;
  padding: 11px 15px; margin-bottom: 18px;
  font-size: 12.5px; font-weight: 400; line-height: 1.4;
}
.mx-demo-banner strong { font-weight: 600; }
.mx-demo-txt { flex: 1; min-width: 0; }
.mx-demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; flex: none; margin-top: 5px; }

/* Grid 12 col */
.mx-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }

/* Entrada en cascada de las tarjetas (se respeta prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .mx-grid > * { animation: mxRise .5s cubic-bezier(.32,.72,0,1) both; }
  .mx-grid > *:nth-child(1) { animation-delay: 20ms; }
  .mx-grid > *:nth-child(2) { animation-delay: 55ms; }
  .mx-grid > *:nth-child(3) { animation-delay: 90ms; }
  .mx-grid > *:nth-child(4) { animation-delay: 125ms; }
  .mx-grid > *:nth-child(5) { animation-delay: 160ms; }
  .mx-grid > *:nth-child(6) { animation-delay: 195ms; }
  .mx-grid > *:nth-child(7) { animation-delay: 230ms; }
  .mx-grid > *:nth-child(8) { animation-delay: 265ms; }
  .mx-grid > *:nth-child(9) { animation-delay: 300ms; }
  .mx-grid > *:nth-child(n+10) { animation-delay: 330ms; }
  /* Hero: el anillo se llena, las líneas del gráfico se trazan, el área aparece.
     Reposo (sin animación) = ya visible → robusto ante pestaña oculta / fallos. */
  .mx-ring-anim { animation: mxRingFill 1.1s cubic-bezier(.32,.72,0,1) both; }
  .mx-line-anim { animation: mxLineDraw 1.15s cubic-bezier(.22,.61,.36,1) both; }
  .mx-area-anim { animation: mxAreaFade 1s ease both; }
}
@keyframes mxRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mxRingFill { from { stroke-dashoffset: var(--ring-from); } }
@keyframes mxLineDraw { from { stroke-dashoffset: var(--line-len); } }
@keyframes mxAreaFade { from { opacity: 0; } }
.mx-section-head { display: flex; align-items: center; gap: 8px; margin: 6px 0 -4px; }
.mx-section-title { font-size: 13px; font-weight: 600; color: var(--mut); letter-spacing: -.01em; }
.mx-span-4  { grid-column: span 4; }
.mx-span-6  { grid-column: span 6; }
.mx-span-8  { grid-column: span 8; }
.mx-span-12 { grid-column: span 12; }
@media (max-width: 980px) {
  .mx-span-4, .mx-span-6, .mx-span-8 { grid-column: span 12; }
}

/* Card */
.mx-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; min-width: 0;
}
.mx-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mx-card-title { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.mx-card-sub { font-size: 12px; font-weight: 400; color: var(--mut); margin-top: 2px; }

.mx-trend {
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  padding: 4px 9px; border-radius: 8px; flex: none;
}
.mx-trend.up   { background: #ecfdf5; color: #047857; }
.mx-trend.down { background: #fef2f2; color: #b91c1c; }
.mx-trend.flat { background: #f1f5f9; color: var(--mut); }

/* KPIs */
.mx-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .mx-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.mx-kpi {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 16px 16px;
  display: flex; flex-direction: column; gap: 7px;
}
.mx-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mx-kpi-label { font-size: 12px; font-weight: 500; color: var(--mut); }
.mx-kpi-delta { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.mx-kpi-delta.is-up   { background: #ecfdf5; color: #047857; }
.mx-kpi-delta.is-down { background: #fef2f2; color: #b91c1c; }
.mx-kpi-delta.is-flat { background: #f1f5f9; color: var(--mut); }
.mx-kpi-valrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.mx-kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); line-height: 1; }
.mx-kpi-sub { font-size: 11px; font-weight: 400; color: var(--faint, #94a3b8); }
.mx-kpi-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.mx-spark { display: block; }

/* Área chart */
.mx-area-wrap { display: flex; flex-direction: column; gap: 10px; }
.mx-area { display: block; }
.mx-axis-tick { font-size: 10px; fill: #94a3b8; font-family: 'Inter', sans-serif; }
.mx-legend { display: flex; gap: 16px; }
.mx-leg-item { font-size: 11.5px; font-weight: 400; color: var(--mut); display: inline-flex; align-items: center; gap: 6px; }
.mx-leg-dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.mx-leg-line { height: 3px; border-radius: 2px; }

/* ── Score hero (anillo 0–100) ── */
.mx-score-card .mx-card-head { margin-bottom: 0; }
.mx-score { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 0; }
.mx-score-ring { position: relative; width: 130px; height: 130px; flex: none; }
.mx-score-svg { display: block; }
.mx-score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mx-score-num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.mx-score-of { font-size: 11px; font-weight: 600; color: var(--faint, #94a3b8); margin-top: 3px; }
.mx-score-meta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mx-score-tag { font-size: 12.5px; font-weight: 700; padding: 3px 12px; border: 1.5px solid; border-radius: 999px; }
.mx-score-cap { font-size: 11.5px; font-weight: 400; line-height: 1.5; color: var(--mut); max-width: 234px; }

/* Medidor del score (semicírculo con bandas de zona) */
.mx-gauge { position: relative; width: 190px; max-width: 100%; }
.mx-gauge-svg { display: block; width: 100%; height: auto; }
.mx-gauge-end { font-size: 10.5px; fill: #94a3b8; font-weight: 600; font-family: 'Inter', sans-serif; }
.mx-gauge-center { position: absolute; left: 0; right: 0; bottom: 11px; text-align: center; }
.mx-gauge-num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

/* ── Meta del mes / semana (ventas + objetivos) ── */
.mx-meta-mes { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.mx-meta-ring { position: relative; flex: none; }
.mx-meta-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mx-meta-ring-num { font-size: 31px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.mx-meta-ring-of { font-size: 11px; font-weight: 500; color: var(--mut); margin-top: 4px; }
.mx-meta-stats { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 16px; }
.mx-meta-proj { font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--mut); }
.mx-meta-proj b { font-weight: 700; }
/* Fila de datos: proyección destacada (tile) + 3 stats agrupados. */
.mx-metas-detrow { display: flex; align-items: center; gap: 28px; }
.mx-metas-detrow .mx-meta-statgrid { flex: 1; }
/* Proyección: sin fondo, separada de los stats por una línea. El monto grande
   (mayor que los stats) la mantiene predominante. (i) canónico abre el overlay. */
.mx-meta-forecast { flex: none; display: flex; flex-direction: column; gap: 2px; padding-right: 30px; border-right: 1px solid var(--line); }
.mx-fc-lbl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--mut); }
.mx-fc-lbl .mx-info-btn { width: 15px; height: 15px; }
.mx-fc-lbl .mx-info-btn svg { width: 14px; height: 14px; }
.mx-fc-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.06; margin-top: 1px; }
.mx-fc-uf { font-size: 14px; font-weight: 700; }
.mx-fc-sub { font-size: 11.5px; color: var(--mut); }
.mx-meta-statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mx-meta-statgrid--wide { max-width: 480px; }
.mx-meta-stat { min-width: 0; }
.mx-meta-stat.is-clickable { cursor: pointer; }
.mx-meta-stat-num { font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.mx-meta-stat-num .mx-meta-of { font-size: 15px; font-weight: 600; color: var(--faint, #94a3b8); }
.mx-meta-stat-num .mx-meta-uf { font-size: 14px; font-weight: 600; }
.mx-meta-stat-lbl { font-size: 11.5px; font-weight: 400; color: var(--mut); margin-top: 5px; }
.mx-meta-hint { font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--mut); margin-top: 14px; max-width: 520px; }
.mx-meta-sem { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 4px 0 2px; }
.mx-meta-sem-txt { font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--mut); }
.mx-meta-sem-txt b { font-weight: 700; }
.mx-meta-bignum { font-size: 42px; font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1; }
.mx-meta-biglbl { font-size: 12px; font-weight: 400; color: var(--mut); }

/* ── Tarjeta "Tus metas" unificada: anillos (mes+semana) izq. + detalle der. ── */
.mx-metas-card { padding: 24px 30px; }
.mx-metas { display: flex; align-items: stretch; gap: 38px; flex-wrap: wrap; }
.mx-metas-rings { display: flex; align-items: flex-start; gap: 36px; flex: none; padding: 4px 0; }
/* Espaciados a mano: un pelín más de aire entre el anillo y la etiqueta, y la
   etiqueta más pegada a "¡cumplida!". */
.mx-metaring { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mx-metaring .mx-meta-ring { position: relative; }
.mx-metaring-lbl { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 14px; }
.mx-metaring-foot { font-size: 11.5px; font-weight: 400; color: var(--mut); margin-top: 3px; }
.mx-metaring-empty { display: flex; align-items: center; justify-content: center; width: 140px; height: 140px; border-radius: 50%; border: 2px dashed var(--line); color: var(--faint, #94a3b8); }
.mx-metaring-empty-ic svg { width: 32px; height: 32px; }
.mx-meta-define--sm { padding: 3px 10px; font-size: 11.5px; margin-top: 8px; }
.mx-metas-sep { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, var(--line) 22%, var(--line) 78%, transparent); flex: none; }
.mx-metas-sep--main { margin: 0; }
/* Detalle: se reparte a lo alto (header arriba, stats abajo) para alinear con los
   anillos. align-items:stretch de .mx-metas iguala la altura de ambas columnas. */
.mx-metas-detail { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 20px; justify-content: center; padding: 2px 0; }
.mx-metas-dethead { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mx-metas-dethead .mx-meta-proj { flex: 1; min-width: 0; }
.mx-metas-dethead .mx-meta-edit { flex: none; }
.mx-metas-detail .mx-meta-proj { font-size: 13.5px; }
@media (max-width: 900px) {
  .mx-metas { flex-direction: column; align-items: stretch; }
  .mx-metas-sep--main { display: none; }
  .mx-metas-rings { justify-content: center; }
  /* Apilado: el detalle no necesita repartirse a lo alto y la fila de datos
     pasa a columna (proyección arriba sin separador lateral, stats abajo). */
  .mx-metas-detail { justify-content: flex-start; }
  .mx-metas-detrow { flex-direction: column; align-items: stretch; gap: 16px; }
  .mx-meta-forecast { padding-right: 0; border-right: 0; }
}

/* Editar / definir meta */
.mx-meta-edit { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--mut); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 9px; transition: all var(--t); flex: none; }
.mx-meta-edit:hover { border-color: var(--brand); color: var(--brand); }
.mx-meta-edit svg { width: 13px; height: 13px; }
.mx-meta-define { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--brand); background: transparent; color: var(--brand); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin-top: 10px; align-self: center; transition: background var(--t), color var(--t); }
.mx-meta-define:hover { background: var(--brand-50); }
.mx-meta-define:active { opacity: .85; }
.mx-meta-define svg { width: 13px; height: 13px; }

/* Meta del mes impuesta por la jefatura: chip-candado read-only */
.mx-meta-locked { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--brand-d, #0b6bcb); background: var(--brand-50, #eef6ff); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; flex: none; }
.mx-meta-locked svg { width: 12px; height: 12px; flex: none; }
.mx-goal-lockchip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--brand-d, #0b6bcb); background: var(--brand-50, #eef6ff); border-radius: 999px; padding: 1px 8px; text-transform: none; letter-spacing: 0; }
.mx-goal-lockchip svg { width: 11px; height: 11px; }
.mx-goal-sec.is-locked .mx-goal-field input { background: #f5f7fa; color: var(--mut); cursor: not-allowed; }

/* Modal "Mis metas" (editor de objetivos) */
.mx-goal-back { position: fixed; inset: 0; z-index: 400; background: rgba(15,23,42,.34); display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.mx-goal { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; box-shadow: 0 24px 64px rgba(15,23,42,.22); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.mx-goal-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.mx-goal-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); }
.mx-goal-ic svg { width: 19px; height: 19px; }
.mx-goal-htxt { flex: 1; min-width: 0; }
.mx-goal-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.mx-goal-sub { font-size: 12px; font-weight: 400; color: var(--mut); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-goal-x { appearance: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #f1f5f9; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background var(--t); }
.mx-goal-x:hover { background: #e2e8f0; }
.mx-goal-x svg { width: 15px; height: 15px; }
.mx-goal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.mx-goal-loading { padding: 36px 0; display: flex; justify-content: center; }
.mx-goal-sec { display: flex; flex-direction: column; gap: 9px; }
.mx-goal-seclbl { font-size: 12px; font-weight: 700; color: var(--brand); }
.mx-goal-field { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; transition: border-color var(--t), box-shadow var(--t); }
.mx-goal-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.mx-goal-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); padding: 11px 0; font-variant-numeric: tabular-nums; }
.mx-goal-unit { font-size: 12.5px; font-weight: 500; color: var(--mut); flex: none; white-space: nowrap; }
.mx-goal-hint { font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--mut); }
.mx-goal-err { font-size: 12.5px; color: var(--err); display: none; }
.mx-goal-err.is-on { display: block; }
.mx-goal-cta { appearance: none; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 13px; transition: opacity var(--t); }
.mx-goal-cta:hover { opacity: .94; }
.mx-goal-cta:disabled { opacity: .45; cursor: not-allowed; }
.mx-goal-cta-txt { display: inline-flex; align-items: center; gap: 8px; }
.mx-goal-cta-txt svg { width: 16px; height: 16px; }
/* `.as-spinner { display:inline-block }` pisa al atributo [hidden]; forzamos
   que [hidden] gane (si no, el spinner se ve siempre en el CTA). */
.mx-goal-cta-spin[hidden] { display: none; }
/* El spinner (.as-spinner) gira con su propio `transform: rotate`. Lo centra el
   flex del botón (con el texto en display:none); NO le ponemos transform propio
   para no chocar con el rotate de la animación (causaba el salto en loop). */

/* Modal "Registrar venta" (reusa el shell .mx-goal-*) */
.mx-goal-ic--win { background: #ecfdf5; color: var(--win, #16a34a); }
.mx-goal-cta--win { background: linear-gradient(135deg, var(--win, #16a34a), var(--win-d, #15803d)); }
.mx-isapre-chips, .mx-date-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.mx-isapre-chip, .mx-date-chip { appearance: none; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; transition: all var(--t); }
.mx-isapre-chip:hover { border-color: var(--ic, var(--brand)); }
.mx-isapre-chip.is-on { background: var(--ic, var(--brand)); border-color: var(--ic, var(--brand)); color: #fff; }
.mx-date-chip:hover { border-color: #cbd5e1; }
.mx-date-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mx-goal-locked { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
.mx-goal-locked > span:not(.mx-isapre-dot) { flex: 1; }
.mx-goal-locked svg { width: 14px; height: 14px; color: var(--mut); flex: none; }
.mx-isapre-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mx-goal-datehint { font-size: 12px; color: var(--mut); }
/* Fecha "Otra…": campo de texto con autoformato + calendario a la derecha. */
.mx-date-field { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mx-date-text { flex: 1; min-width: 0; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; font-variant-numeric: tabular-nums; }
.mx-date-text:focus { outline: none; border-color: var(--brand); }
.mx-date-text.is-invalid { border-color: var(--err); }
.mx-date-cal { -webkit-appearance: none; appearance: none; font: inherit; position: relative; cursor: pointer; flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--mut); transition: border-color var(--t), color var(--t); }
.mx-date-cal:hover { border-color: var(--brand); color: var(--brand); }
.mx-date-cal svg { width: 18px; height: 18px; pointer-events: none; }
/* input date real, invisible sobre el ícono: el clic abre el picker nativo y se
   cierra solo al elegir. El indicador del picker llena todo el botón. */
.mx-date-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.mx-date-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

/* Plan: buscador con dropdown (abre hacia arriba: es el último campo). */
.mx-plan-wrap { position: relative; }
.mx-plan-drop { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.16); overflow-y: auto; max-height: 220px; }
.mx-plan-opt { appearance: none; cursor: pointer; display: flex; flex-direction: column; gap: 1px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; padding: 9px 12px; text-align: left; transition: background var(--t); }
.mx-plan-opt:first-child { border-top: 0; }
.mx-plan-opt:hover { background: var(--bg); }
.mx-plan-opt b { font-size: 13px; font-weight: 600; color: var(--ink); }
.mx-plan-opt span { font-size: 11.5px; color: var(--mut); }
.mx-plan-more { font-size: 11.5px; color: var(--mut); text-align: center; padding: 8px; border-top: 1px solid var(--line); }
.mx-goal-optional { font-size: 11.5px; font-weight: 500; color: var(--faint, #94a3b8); }
.mx-goal-field--sm input { font-size: 15px; font-weight: 500; }
.mx-goal-field--alias input { font-size: 16px; font-weight: 500; letter-spacing: 0; }

/* Botones de acción en la tarjeta Meta del mes */
.mx-meta-actions { display: inline-flex; align-items: center; gap: 8px; }
.mx-meta-sale { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 0; background: linear-gradient(135deg, var(--win, #16a34a), var(--win-d, #15803d)); color: #fff; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 9px; transition: opacity var(--t), transform var(--t); flex: none; }
.mx-meta-sale:hover { opacity: .93; }
.mx-meta-sale:active { transform: scale(.97); }
.mx-meta-sale svg { width: 13px; height: 13px; }

/* ── KPIs en 2×2 (junto al score) ── */
.mx-kpi-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* ── Gráfico principal interactivo (área + crosshair) ── */
.mx-chart { position: relative; width: 100%; }
.mx-chart-svg { display: block; width: 100%; }
.mx-grid-line { stroke: #eef2f7; stroke-width: 1; }
.mx-axis-y, .mx-axis-x { font-size: 10px; fill: #94a3b8; font-family: 'Inter', sans-serif; }
.mx-chart-ov { position: absolute; inset: 0; cursor: crosshair; }
.mx-cross { position: absolute; width: 1px; background: rgba(15,23,42,.16); pointer-events: none; opacity: 0; transition: opacity .12s; }
.mx-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; transition: opacity .12s; }
.mx-tip {
  position: absolute; pointer-events: none; z-index: 4;
  background: #0f172a; color: #fff; border-radius: 10px;
  padding: 8px 11px; font-size: 11.5px; line-height: 1.5; white-space: nowrap;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .12s;
  box-shadow: 0 8px 22px rgba(15,23,42,.22);
}
.mx-tip-date { font-weight: 700; margin-bottom: 4px; }
.mx-tip-row { display: flex; align-items: center; gap: 7px; }
.mx-tip-row b { margin-left: auto; padding-left: 16px; font-variant-numeric: tabular-nums; }
.mx-tip-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }

/* ── Heatmap: leyenda de intensidad ── */
.mx-heat-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 12px; font-size: 10.5px; color: var(--faint, #94a3b8); }
.mx-heat-swatch { width: 14px; height: 14px; border-radius: 3px; }

/* ── Velocidad de reacción: barra segmentada ── */
.mx-velo { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.mx-velo-seg { height: 100%; transition: width .4s cubic-bezier(.32,.72,0,1); }
.mx-velo-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 18px; margin-top: 16px; }
.mx-velo-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.mx-velo-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.mx-velo-l { color: var(--ink); font-weight: 500; white-space: nowrap; }
.mx-velo-sub { color: var(--faint, #94a3b8); font-weight: 400; }
.mx-velo-v { margin-left: auto; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Cuándo leen: barras verticales por hora ── */
.mx-vbars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.mx-vbar { flex: 1; min-width: 0; border-radius: 4px 4px 0 0; min-height: 2px; transition: background .2s, transform var(--t); }
.mx-vbar[data-tip]:hover { transform: scaleY(1.05); transform-origin: bottom; }
.mx-vbars-x { display: flex; gap: 3px; margin-top: 8px; }
.mx-vbars-xc { flex: 1; min-width: 0; text-align: center; font-size: 10px; color: var(--faint, #94a3b8); }

/* Funnel */
.mx-funnel { display: flex; flex-direction: column; gap: 14px; }
.mx-funnel-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.mx-funnel-label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.mx-funnel-val { font-size: 13px; font-weight: 700; color: var(--ink); }
.mx-funnel-pct { font-size: 11px; font-weight: 500; color: var(--mut); margin-left: 6px; }
.mx-funnel-track { height: 8px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
.mx-funnel-fill { height: 100%; border-radius: 5px; transition: width .4s cubic-bezier(.32,.72,0,1); }

/* Heatmap */
.mx-heat { overflow-x: auto; }
.mx-heat-grid {
  display: grid;
  grid-template-columns: 34px repeat(24, 1fr);
  gap: 3px; min-width: 520px;
}
.mx-heat-corner { }
.mx-heat-hour { font-size: 9px; color: #94a3b8; text-align: center; font-weight: 500; }
.mx-heat-day { font-size: 10.5px; color: var(--mut); font-weight: 500; display: flex; align-items: center; }
.mx-heat-cell {
  aspect-ratio: 1; border-radius: 3px; min-height: 16px;
  transition: transform var(--t);
}
.mx-heat-cell.is-best { box-shadow: inset 0 0 0 2px var(--brand-d); }
.mx-heat-cell[data-tip]:hover { transform: scale(1.18); }

/* Donut */
.mx-donut-wrap { display: flex; align-items: center; gap: 22px; }
.mx-donut-c { position: relative; flex: none; }
.mx-donut { display: block; }
.mx-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mx-donut-num { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.mx-donut-lbl { font-size: 11px; font-weight: 400; color: var(--mut); }
.mx-donut-legend { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.mx-donut-leg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mx-donut-leg-l { font-size: 13px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.mx-donut-leg-v { font-size: 12.5px; font-weight: 500; color: var(--mut); }

/* Barras horizontales */
.mx-bar-row { margin-bottom: 13px; }
.mx-bar-row:last-child { margin-bottom: 0; }
.mx-bar-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.mx-bar-label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.mx-bar-sub { font-size: 11px; font-weight: 400; color: var(--faint, #94a3b8); margin-left: 4px; }
.mx-bar-val { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.mx-bar-track { height: 7px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
.mx-bar-fill { height: 100%; border-radius: 5px; transition: width .4s cubic-bezier(.32,.72,0,1); }
.mx-insight { font-size: 12px; font-weight: 400; line-height: 1.45; color: var(--mut); margin-top: 12px; }

/* Listas (planes) */
.mx-list-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.mx-list-row:last-child { border-bottom: 0; }
.mx-rank { width: 22px; height: 22px; border-radius: 7px; background: #f1f5f9; color: var(--mut); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.mx-list-mid { flex: 1; min-width: 0; }
.mx-list-l { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-list-s { font-size: 11.5px; font-weight: 400; color: var(--mut); margin-top: 1px; }
.mx-winrate { font-size: 12px; font-weight: 700; padding: 3px 9px; border: 1px solid; border-radius: 7px; flex: none; }

/* Productividad strip */
.mx-prod { display: flex; align-items: center; gap: 4px; }
.mx-prod-stat { flex: 1; min-width: 0; text-align: center; padding: 6px 8px; }
.mx-prod-num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--brand-d); line-height: 1; }
.mx-prod-lbl { font-size: 11.5px; font-weight: 400; color: var(--mut); margin-top: 5px; }
.mx-prod-div { width: 1px; align-self: stretch; background: var(--line); }

/* Empty */
.mx-empty { font-size: 12.5px; font-weight: 400; color: var(--faint, #94a3b8); text-align: center; padding: 22px 10px; font-style: italic; }

/* Skeleton */
.mx-skel { position: relative; overflow: hidden; background: #fff; }
.mx-skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(15,23,42,.04), transparent);
  animation: mxShimmer 1.3s infinite;
}
@keyframes mxShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================================================
   INSIGHTS RAIL — métricas
   ============================================================ */
.mx-insights { padding: 22px 18px; }
.mx-ins-head { margin-bottom: 16px; }
.mx-ins-title-row { display: flex; align-items: center; gap: 7px; }
.mx-ins-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.mx-ins-card-k-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mx-ins-sub { font-size: 12px; font-weight: 400; color: var(--mut); margin-top: 2px; }
.mx-ins-block { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }

.mx-lead { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.mx-lead:last-child { border-bottom: 0; }
.mx-lead-rank { width: 22px; height: 22px; border-radius: 7px; background: #f1f5f9; color: var(--mut); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.mx-lead-rank.is-top { background: #fef2f2; color: #b91c1c; }
.mx-lead-mid { flex: 1; min-width: 0; }
.mx-lead-mail { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-lead-meta { font-size: 10.5px; font-weight: 400; color: var(--mut); margin-top: 2px; line-height: 1.35; }
.mx-lead-score { font-size: 13px; font-weight: 700; padding: 4px 8px; border: 1px solid; border-radius: 8px; flex: none; min-width: 34px; text-align: center; }

.mx-ins-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; margin-bottom: 12px; }
.mx-ins-card-brand { background: var(--brand-50); border-color: rgba(13,153,255,.22); }
.mx-ins-card-k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); }
.mx-ins-card-v { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 5px; letter-spacing: -.01em; }
.mx-ins-card-s { font-size: 11.5px; font-weight: 400; line-height: 1.45; color: var(--mut); margin-top: 5px; }

.mx-cartera-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 11px; }
.mx-cartera-mini { }
.mx-cartera-num { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.mx-cartera-lbl { font-size: 10.5px; font-weight: 400; color: var(--mut); margin-top: 1px; }

.mx-ins-reg-btn { appearance: none; display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--win, #16a34a); border-radius: 10px; background: #f0fdf4; color: var(--win-d, #15803d); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--t), border-color var(--t); }
.mx-ins-reg-btn:hover { background: #dcfce7; border-color: var(--win-d, #15803d); }
.mx-ins-reg-btn svg { width: 15px; height: 15px; flex: none; }

/* ============================================================
   SIMULADOR — embed del recomendador (iframe full-bleed)
   ============================================================ */
/* Host persistente del Simulador: celda 'canvas' del grid de #asApp, hermana de
   #asCanvas (que sí se limpia entre tabs). Se muestra/oculta sin recargar el
   iframe → el motor del recomendador arranca una sola vez. Ocupa el mismo rect
   que el canvas, así #coBar / ⌘K / la alineación siguen midiendo igual. */
.sim-host { grid-area: canvas; display: none; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.sim-host.is-active { display: flex; }
.sim-wrap { position: relative; flex: 1; min-height: 0; width: 100%; }
.sim-frame { width: 100%; height: 100%; border: 0; display: block; }

.sim-loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--bg);
  transition: opacity .3s ease-out;
}
.sim-loading.is-hidden { opacity: 0; pointer-events: none; }
.sim-spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.sim-loading-txt { font-size: 13px; font-weight: 400; color: var(--mut); }

/* ── Barra de envío (sobre el iframe, cuando hay 1–3 planes) ── */
.co-bar {
  /* Una sola fila. Centrado por márgenes (NO transform): así el slideUp anima
     translateY sin pisar el centrado → sin el flash "aparece a la derecha". */
  position: absolute; left: 0; right: 0; margin-inline: auto; width: fit-content;
  bottom: 24px; z-index: 6;
  display: flex; align-items: center; gap: 16px;
  /* Mismo glass que la barra Comparar (.barra-comparar): fondo translúcido +
     blur, borde claro, esquinas 26px y sombra en capas. */
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 26px; padding: 11px 14px 11px 16px;
  min-height: 76px; box-sizing: border-box; /* misma altura que .barra-comparar (76px) */
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  box-shadow: 0 25px 50px -12px rgba(15,23,42,0.15), 0 8px 24px -8px rgba(15,23,42,0.08), 0 1px 0 rgba(255,255,255,0.6) inset;
  max-width: calc(100% - 48px);
  animation: slideUp .2s cubic-bezier(.32,.72,0,1);
}
/* Desktop: centrar la barra sobre las TARJETAS (no sobre el simulador completo).
   Descuenta el riel de filtros del recomendador (--sidebar-w: 300px en
   recomendador.css) moviendo el borde izquierdo del centrado a 300px. Así queda
   alineada con la barra Comparar, que vive dentro del iframe y se centra sobre
   la columna de tarjetas. En móvil el riel se colapsa, por eso se deja en 0. */
@media (min-width: 1025px) {
  .co-bar {
    /* Mismo ancho MÁXIMO y centrado que .barra-comparar (94% de la columna de
       tarjetas, tope 1100px). El contenedor (--container: 1280px) está CENTRADO,
       así que la columna de tarjetas va desde (margen + riel 300 + gap 40) hasta
       (ancho − margen), donde margen = mitad del espacio sobrante sobre 1280px. */
    --co-margin: max(0px, calc((100% - 1280px) / 2));
    left: calc(var(--co-margin) + 340px);
    right: var(--co-margin);
    margin-inline: auto;
    max-width: min(1100px, calc((min(100%, 1280px) - 340px) * 0.94));
  }
}
.co-bar-info { display: flex; align-items: center; gap: 11px; flex: none; }
.co-bar-count {
  /* Mismo badge que .barra-comparar__count: 32px, radius 12px, estilo claro. */
  min-width: 32px; height: 32px; border-radius: 12px; padding: 0 8px; flex: none;
  border: 1px solid color-mix(in oklch, var(--brand) 22%, transparent);
  background: color-mix(in oklch, var(--brand) 8%, #fff); color: var(--brand);
  font-size: 12px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
/* La barra ya comunica el conteo con el badge + el chip del plan; la frase
   "plan en la cotización" sobra ahí. (Se oculta solo en la barra; el modal no
   usa .co-bar-txt.) */
.co-bar-txt { display: none; }
/* Chips de planes — separación limpia (en vez de texto corrido con puntos),
   con un icono de documento que representa el plan. */
.co-chip {
  display: inline-flex; align-items: center; gap: 4px; flex: none; min-width: 0;
  padding: 2px 8px; border-radius: 6px;
  background: color-mix(in oklch, var(--brand) 8%, #fff);
  border: 1px solid color-mix(in oklch, var(--brand) 24%, #e2e8f0);
  font-size: 10.5px; font-weight: 600; color: #334155;
}
.co-chip-ic { width: 12px; height: 12px; flex: none; color: var(--brand); opacity: .85; }
.co-chip-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* "x" para quitar ese plan (solo en los chips de la barra). */
.co-chip-x {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; flex: none; padding: 0; margin-left: 1px;
  color: color-mix(in oklch, var(--mut) 75%, transparent);
  border-radius: 4px; transition: background var(--t), color var(--t);
}
.co-chip-x svg { width: 11px; height: 11px; }
.co-chip-x:hover { background: color-mix(in oklch, #ef4444 12%, transparent); color: #ef4444; }
/* Chips de la barra, en la misma fila; truncan a 160px. Si no caben en el ancho
   del embed, la fila scrollea (sin barra visible) en vez de romper el layout. */
/* Igual que la barra Comparar: los chips se ACHICAN para caber (con elipsis),
   en vez de scrollear, así no deforman el ancho de la barra con 1–3 planes. */
.co-bar-chips { display: flex; gap: 6px; flex-wrap: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; }
/* En la barra el chip va más alto (proporcional a botones/badge). El del modal
   (.co-chips .co-chip) queda como está. */
.co-bar-chips .co-chip { flex: 0 1 auto; min-width: 0; max-width: 200px; height: 36px; padding: 0 12px; border-radius: 12px; font-size: 12px; }
.co-bar-chips .co-chip-ic { width: 14px; height: 14px; }
.co-bar-chips .co-chip-x { width: 18px; height: 18px; }
.co-bar-chips .co-chip-x svg { width: 12px; height: 12px; }
/* En el modal: nombres completos, envuelven en varias líneas. */
.co-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.co-chips .co-chip { font-size: 11.5px; padding: 3px 9px; }
.co-chips .co-chip-ic { width: 13px; height: 13px; }
.co-bar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.co-bar-clear {
  /* Secundario, equivalente a .barra-comparar__btn (claro con borde, 38px). */
  appearance: none; cursor: pointer;
  border: 1px solid rgba(15,23,42,0.1); background: rgba(255,255,255,0.6);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 650; color: var(--mut);
  height: 38px; padding: 0 16px; border-radius: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all var(--t);
}
.co-bar-clear svg { width: 15px; height: 15px; flex: none; }
.co-bar-clear:hover { background: #f1f5f9; color: var(--ink); }
.co-bar-send {
  /* Primario sólido, mismas dimensiones que .barra-comparar__btn (38px, radius 14). */
  appearance: none; border: 0; cursor: pointer;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: 14px; transition: opacity var(--t);
}
.co-bar-send:hover { opacity: .92; }

/* ── Overlay de cotización (panel fixed, entra desde la derecha) ── */
.co-ov {
  position: fixed;
  top: var(--topbar-h, 56px); right: 0; bottom: 0;
  width: min(420px, calc(100vw - 24px));
  background: var(--surface, #fff);
  border-left: 1px solid var(--separator, #e6eaf0);
  display: flex; flex-direction: column;
  z-index: 350;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(.32,.72,0,1);
  will-change: transform;
  box-shadow: -24px 0 60px rgba(2,6,23,.12);
}
.co-ov.is-open { transform: translateX(0); }

/* Cabecera */
.co-ov-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--separator, #e6eaf0);
  flex: none;
}
.co-ov-title {
  font: 600 14px/1.1 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color: var(--label, #0f1422);
}
.co-ov-close {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  color: var(--muted, #6b7280);
  transition: background var(--t), color var(--t);
}
.co-ov-close svg { width: 16px; height: 16px; }
.co-ov-close:hover { background: color-mix(in oklch, var(--surface,#fff) 92%, var(--bg,#0f1422) 8%); color: var(--label, #0f1422); }

/* Cuerpo scrolleable — solo planes + resumen */
.co-ov-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }

/* Lista de planes */
.co-ov-plans { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 8px; }

/* Tarjeta de plan — igual que .cart-item del web */
.co-ov-item {
  padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--separator, #e6eaf0);
  background: color-mix(in oklch, var(--surface,#fff) 96%, var(--bg,#0f1422) 4%);
}
.co-ov-item-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  align-items: center; gap: 10px; min-width: 0;
}
.co-ov-item-main {
  display: grid; grid-template-columns: auto minmax(0,1fr);
  align-items: center; gap: 10px; min-width: 0;
}
.co-ov-item-icon {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 10px; flex: none;
  border: 1px solid color-mix(in oklch, var(--brand,#0d99ff) 14%, var(--separator,#e6eaf0));
  background: color-mix(in oklch, var(--brand,#0d99ff) 7%, white 93%);
  color: color-mix(in oklch, var(--brand,#0d99ff) 70%, black 30%);
}
.co-ov-item-icon svg { width: 14px; height: 14px; display: block; stroke-width: 1.8; }
.co-ov-item-copy { min-width: 0; display: grid; gap: 3px; }
.co-ov-item-title {
  margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 13px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color: var(--label, #0f1422); letter-spacing: -.01em;
}
.co-ov-item-sub {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 12px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color: var(--muted, #6b7280);
}
.co-ov-item-right { display: inline-flex; align-items: center; gap: 8px; justify-self: end; white-space: nowrap; }
.co-ov-item-uf { font: 700 12px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial; color: var(--label,#0f1422); font-variant-numeric: tabular-nums; }
.co-ov-item-rm {
  appearance: none; cursor: pointer;
  min-height: 28px; padding: 0 10px; border-radius: 999px;
  font: 500 12px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  white-space: nowrap; background: transparent;
  color: var(--muted, #6b7280);
  border: 1px solid var(--separator, #e6eaf0);
  transition: background var(--t), color var(--t);
}
.co-ov-item-rm:hover {
  background: color-mix(in oklch, var(--surface,#fff) 94%, var(--bg,#0f1422) 6%);
  color: var(--label, #0f1422);
}

/* Resumen — usa las mismas clases que el carrito web (byte-exact), scoped bajo .co-ov */
.co-ov-summary { margin: 0 16px 8px; }
.co-ov .cart-summary-head { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--stroke-2,#e2e8f0);border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.9)); }
.co-ov .cart-capacity-badge { display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:0 9px;border-radius:999px;border:1px solid color-mix(in oklch,var(--brand,#0d99ff) 18%,transparent);background:color-mix(in oklch,var(--brand,#0d99ff) 8%,white 92%);color:var(--brand-dark,#0a66d1);font-size:11px;font-weight:600;line-height:1; }
.co-ov .cart-summary-head small { display:block;margin-top:4px;color:var(--muted-2,#94a3b8);font-size:11px;line-height:1.25; }
.co-ov .cart-summary-head.cart-full { border-color:color-mix(in oklch,var(--warn,#f59e0b) 22%,transparent);background:linear-gradient(180deg,color-mix(in oklch,var(--warn,#f59e0b) 6%,white 94%),rgba(248,250,252,.92)); }
.co-ov .cart-summary-head.cart-full .cart-capacity-badge { border-color:color-mix(in oklch,var(--warn,#f59e0b) 24%,transparent);background:color-mix(in oklch,var(--warn,#f59e0b) 10%,white 90%);color:color-mix(in oklch,var(--warn,#f59e0b) 64%,black 36%); }
.co-ov .cart-summary-side { display:grid;justify-items:end;gap:2px;text-align:right; }
.co-ov .cart-summary-label { font-size:12px;line-height:1.1;color:var(--muted-2,#94a3b8); }
.co-ov .cart-summary-value { font-weight:600;line-height:1.1;color:var(--ink,#0f172a);font-variant-numeric:tabular-nums; }

/* Formulario — usa las mismas clases que .cart-field del web (byte-exact) */
.co-ov-form { display: flex; flex-direction: column; gap: 12px; padding: 8px 16px 12px; }
/* Dentro del overlay, .cart-field y sus hijos heredan el estilo del carrito web */
.co-ov .cart-field { display: grid; gap: 5px; }
.co-ov .cart-field-label { color: var(--ink,#0f172a); font-size: 12px; font-weight: 600; line-height: 1.2; }
.co-ov .cart-field input[type="text"],
.co-ov .cart-field input[type="email"] {
  width: 100%; min-height: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--stroke-3,#cbd5e1); border-radius: 12px;
  background: #fff; color: var(--ink,#0f172a); font: inherit; font-size: 13px;
  box-shadow: 0 1px 0 rgba(255,255,255,.72) inset;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.co-ov .cart-field input::placeholder { color: var(--muted-2,#94a3b8); }
.co-ov .cart-field input:hover { border-color: var(--stroke-4,#94a3b8); }
.co-ov .cart-field input:focus { outline: none; border-color: color-mix(in oklch,var(--brand,#0d99ff) 34%,white 66%); box-shadow: 0 0 0 3px color-mix(in oklch,var(--brand,#0d99ff) 9%,transparent); }
.co-ov-err { font: 400 12.5px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial; color: var(--err); background: var(--err-50); border-radius: 8px; padding: 9px 12px; display: none; }
.co-ov-err.is-on { display: block; }
.co-ov-hint {
  display: flex; align-items: flex-start; gap: 8px;
  font: 500 11.5px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color: var(--muted,#6b7280); padding: 10px 12px;
  background: color-mix(in oklch, var(--brand,#0d99ff) 5%, #fff);
  border: 1px solid color-mix(in oklch, var(--brand,#0d99ff) 14%, var(--separator,#e6eaf0));
  border-radius: 10px;
}
.co-ov-hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--brand,#0d99ff); opacity: .7; }

/* Sección de checkout — fija en la parte inferior, no scrollea */
.co-ov-checkout {
  border-top: 1px solid var(--separator, #e6eaf0);
  padding: 16px 16px 14px; flex: none;
  display: flex; flex-direction: column; gap: 10px;
}
.co-ov-sends { display: flex; flex-direction: column; gap: 8px; }
.co-ov-wa, .co-ov-mail {
  appearance: none; border: 0; cursor: pointer;
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  padding: 11px 16px; border-radius: 14px; position: relative;
  transition: opacity var(--t);
}
.co-ov-wa   { background: #25d366; color: #fff; }
.co-ov-mail { background: var(--brand,#0d99ff); color: #fff; }
.co-ov-wa:hover, .co-ov-mail:hover { opacity: .9; }
.co-ov-wa:disabled, .co-ov-mail:disabled { opacity: .6; cursor: default; }
.co-ov-btn-ic { width: 16px; height: 16px; flex: none; }
.co-ov-btn-txt { position: relative; }

/* Estado de éxito */
.co-ov-success {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  padding: 40px 24px; text-align: center;
}
.co-ov-suc-ic {
  width: 52px; height: 52px; border-radius: 50%;
  background: color-mix(in oklch, #22c55e 12%, #fff);
  border: 1.5px solid color-mix(in oklch, #22c55e 30%, transparent);
  color: #16a34a; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.co-ov-suc-title { font: 700 17px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial; color: var(--label,#0f1422); letter-spacing: -.01em; }
.co-ov-suc-sub { font: 400 13px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial; color: var(--muted,#6b7280); max-width: 280px; }
.co-ov-suc-btn {
  margin-top: 4px; appearance: none; border: 0; cursor: pointer;
  background: var(--brand,#0d99ff); color: #fff;
  font: 600 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  padding: 12px 32px; border-radius: 12px; transition: opacity var(--t);
}
.co-ov-suc-btn:hover { opacity: .9; }

/* ── Modal de envío ── */
.co-modal-back {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(8,19,43,.48);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .16s ease-out;
}
.co-modal {
  width: 100%; max-width: 440px;
  background: #fff; border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 24px 80px rgba(8,19,43,.32);
  animation: slideUp .2s cubic-bezier(.32,.72,0,1);
}
.co-modal-title { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.co-modal-sub { font-size: 12.5px; font-weight: 400; color: var(--mut); margin-top: 3px; line-height: 1.4; }
.co-field { display: flex; flex-direction: column; gap: 6px; }
.co-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); }
.co-input {
  font-size: 15px; font-weight: 400; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 11px;
  padding: 11px 14px; outline: none; width: 100%;
  transition: border-color var(--t), box-shadow var(--t);
}
.co-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.co-input::placeholder { color: #94a3b8; }
.co-err { font-size: 12.5px; font-weight: 400; color: var(--err); background: var(--err-50); border-radius: 8px; padding: 9px 12px; display: none; }
.co-err.is-on { display: block; }
.co-modal-actions { display: flex; gap: 10px; margin-top: 2px; }
.co-btn-ghost {
  flex: none; appearance: none; border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 500; color: var(--mut);
  padding: 12px 18px; border-radius: 12px; cursor: pointer; transition: all var(--t);
}
.co-btn-ghost:hover { background: #f1f5f9; color: var(--ink); }
.co-btn-primary {
  flex: 1; appearance: none; border: 0; cursor: pointer;
  background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 600; padding: 12px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity var(--t);
}
.co-btn-primary:hover { opacity: .92; }
.co-btn-primary:disabled { opacity: .6; cursor: default; }
/* Botón WhatsApp — verde de marca WhatsApp, sin glow. */
.co-btn-wa {
  flex: 1; appearance: none; border: 0; cursor: pointer;
  background: #25d366; color: #fff;
  font-size: 14px; font-weight: 600; padding: 12px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: opacity var(--t);
}
.co-btn-wa:hover { opacity: .92; }
.co-btn-wa:disabled { opacity: .6; cursor: default; }
.co-btn-ic { width: 16px; height: 16px; flex: none; }
.co-label-opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: color-mix(in oklch, var(--mut) 65%, transparent); }
.co-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
.co-modal-note { font-size: 11.5px; font-weight: 400; line-height: 1.5; color: var(--mut); }
/* Aviso amigable: en escritorio WhatsApp va por link; el PDF adjunto es en la app. */
.co-modal-hint {
  display: flex; align-items: flex-start; gap: 9px;
  background: color-mix(in oklch, var(--brand) 6%, #fff);
  border: 1px solid color-mix(in oklch, var(--brand) 16%, #e2e8f0);
  border-radius: 11px; padding: 10px 12px;
  font-size: 12px; line-height: 1.45; color: color-mix(in oklch, var(--ink) 72%, transparent);
}
.co-modal-hint svg { width: 16px; height: 16px; flex: none; color: var(--brand); margin-top: 1px; }
.co-modal-hint b { font-weight: 600; color: var(--ink); }
.co-success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 12px 4px 4px; }
.co-success-ic { width: 48px; height: 48px; border-radius: 50%; background: #ecfdf5; color: #047857; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.co-success-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.co-success-sub { font-size: 13px; font-weight: 400; color: var(--mut); line-height: 1.5; }
.co-success .co-btn-primary { margin-top: 8px; min-width: 120px; flex: none; }

/* ============================================================
   MODAL INFORMATIVO CANÓNICO (réplica QuVi Pro Performance)
   ============================================================ */
.am-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(8,19,43,.48);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .16s ease-out;
}
.am-backdrop.is-closing { animation: fadeOut .16s ease-in forwards; }
@keyframes fadeOut { to { opacity: 0; } }

.am-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 18px;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 24px 80px rgba(8,19,43,.32);
  animation: slideUp .2s cubic-bezier(.32,.72,0,1);
}
.am-backdrop.is-closing .am-card { animation: none; }

.am-head { display: flex; align-items: center; gap: 14px; }
.am-badge {
  width: 52px; height: 52px; border-radius: 14px;
  background: #fff; border: 2px solid;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.am-badge-icon { display: flex; }
.am-badge-icon svg { width: 22px; height: 22px; }
.am-badge-num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.am-badge-num--sm { font-size: 16px; letter-spacing: -.03em; }
.am-head-text { flex: 1; min-width: 0; }
.am-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.am-sub { font-size: 13px; font-weight: 400; color: var(--mut); line-height: 1.45; margin-top: 2px; }

.am-table {
  background: rgba(15,23,42,.04); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 12px;
}
.am-row { display: flex; align-items: flex-start; gap: 14px; }
.am-val-wrap { min-width: 48px; text-align: center; flex: none; }
.am-val { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.am-val-sub { font-size: 9px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .03em; margin-top: 1px; }
.am-row-text { flex: 1; min-width: 0; }
.am-row-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.am-row-body { font-size: 12.5px; font-weight: 400; color: var(--mut); line-height: 1.45; margin-top: 2px; }

/* Señales con barras de puntos */
.am-signal-row { display: flex; align-items: center; gap: 10px; }
.am-signal-text { flex: 1; min-width: 0; }
.am-row-detail { font-size: 11.5px; font-weight: 500; color: var(--mut); margin-top: 1px; }
.am-dots { display: flex; gap: 4px; flex: none; }
.am-dot { width: 8px; height: 8px; border-radius: 4px; }

/* Píldoras de estado */
.am-states { display: flex; gap: 6px; }
.am-state {
  flex: 1; text-align: center; padding: 8px 4px;
  border-radius: 10px; border: 1px solid rgba(15,23,42,.08);
  background: rgba(15,23,42,.03);
}
.am-state-label { font-size: 12px; font-weight: 600; color: var(--mut); }
.am-state.is-active .am-state-label { font-weight: 700; }
.am-state-range { font-size: 10px; font-weight: 500; color: var(--mut); margin-top: 2px; }

.am-cta {
  background: var(--brand); color: #fff;
  border: 0; border-radius: 12px; padding: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity var(--t);
}
.am-cta:hover { opacity: .92; }
.am-cta:active { transform: scale(.99); }

/* Robot intro modal */
.am-card.am-robot-intro { padding-top: 28px; }
.am-robot-intro-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 18px; }
.am-robot-intro-top .am-title { font-size: 17px; }
.am-robot-intro-top .am-sub { max-width: 270px; margin: 0 auto; }

/* Botón "i" en cards */
.mx-info-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--faint, #94a3b8); cursor: pointer;
  padding: 0; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: none;
  transition: color var(--t);
}
.mx-info-btn svg { width: 16px; height: 16px; }
.mx-info-btn:hover { color: var(--brand); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes tipIn    { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   Tab "Directorio de planes" (asesor-planes-view.js)
   ========================================================================== */
.canvas.dir-canvas { padding: 0; overflow-y: auto; }
/* width:100% es CLAVE: .dir-wrap es flex-item de #asCanvas (display:flex column).
   Con margin:0 auto se centra, pero sin width definido tomaría el ancho de su
   CONTENIDO (la tabla crecía con los nombres y difería de las tarjetas). Con
   width:100% queda con ancho definido (llena hasta max-width), igual en lista y
   tarjetas, con o sin overlay. */
.dir-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 28px 56px; }
.dir-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 60vh; color: var(--mut, #64748b); }

/* Hero */
.dir-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.dir-title { font-size: 30px; line-height: 1.1; letter-spacing: -0.5px; font-weight: 700; color: var(--ink, #0f172a); margin: 0; }
.dir-sub { margin: 6px 0 0; font-size: 14px; color: var(--mut, #64748b); }
.dir-sub strong { color: var(--brand, #0d99ff); }
.dir-search { flex: 1 1 280px; max-width: 380px; }
.dir-search input { width: 100%; height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line, #e2e8f0); background: #fff; font: inherit; font-size: 14px; color: var(--ink, #0f172a); outline: none; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.dir-search input:focus { border-color: var(--brand, #0d99ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0d99ff) 14%, transparent); }

/* Toolbar: chips + sort */
.dir-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 22px; }
/* Fila 2: controles de tabla (Vista/Ordenar/Por página) a la izquierda y
   "Caballitos" al extremo derecho (es otra cosa: abre tus favoritos). */
.dir-toolbar-row2 { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dir-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dir-chip { appearance: none; cursor: pointer; border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #334155); font: inherit; font-size: 13px; font-weight: 600; height: 34px; padding: 0 14px; border-radius: 999px; transition: all .15s; }
.dir-chip:hover { border-color: #cbd5e1; }
.dir-chip.is-on { color: #fff; background: var(--ink, #0f172a); border-color: transparent; }

/* Controles de la derecha (orden + por página), separados de los chips de
   isapre para que no se confundan con los filtros. */
.dir-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dir-ctl { display: flex; align-items: center; gap: 8px; }
.dir-ctl-lbl { font-size: 12px; font-weight: 600; color: var(--mut, #94a3b8); white-space: nowrap; }
/* "Ordenar" como control segmentado (un bloque con 3 opciones): claramente
   distinto de los chips de isapre (filtros sueltos). Sin glow: thumb sólido. */
.dir-seg { display: inline-flex; gap: 2px; padding: 3px; background: color-mix(in srgb, var(--line, #e2e8f0) 45%, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 10px; }
.dir-segbtn { appearance: none; cursor: pointer; border: 1px solid transparent; background: transparent; color: var(--mut, #64748b); font: inherit; font-size: 12.5px; font-weight: 600; height: 30px; padding: 0 11px; border-radius: 8px; transition: all .15s; }
.dir-segbtn:hover { color: var(--ink, #0f172a); }
.dir-segbtn.is-on { background: #fff; color: var(--ink, #0f172a); border-color: var(--line, #e2e8f0); }
/* Selector "por página": select nativo estilizado, con chevron propio. */
.dir-select { appearance: none; -webkit-appearance: none; cursor: pointer; border: 1px solid var(--line, #e2e8f0); background-color: #fff; color: var(--ink, #334155); font: inherit; font-size: 12.5px; font-weight: 600; height: 34px; padding: 0 30px 0 12px; border-radius: 10px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
.dir-select:hover { border-color: #cbd5e1; }
/* Toggle de vista: botones de solo ícono dentro del segmentado. */
.dir-segbtn-ic { padding: 0 9px; }
.dir-seg-ic { width: 15px; height: 15px; flex: none; display: block; }
/* Vista compacta = tabla densa: filas con columnas alineadas, fácil de escanear. */
.dir-tablewrap { overflow-x: auto; }
.dir-table { display: block; min-width: min-content; background: #fff; border: 1px solid var(--line, #e8edf3); border-radius: 14px; overflow: hidden; }
.dir-thead, .dir-trow { display: grid; grid-template-columns: 40px 100px minmax(180px, 1.6fr) 88px 88px 96px 72px 100px 114px; align-items: center; gap: 8px; padding: 0 16px; }
.dir-thead { height: 40px; background: color-mix(in srgb, var(--line, #f1f5f9) 40%, #fff); border-bottom: 1px solid var(--line, #e8edf3); }
.dir-th { appearance: none; border: 0; background: transparent; cursor: pointer; padding: 0; text-align: left; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--mut, #94a3b8); white-space: nowrap; transition: color .12s; }
.dir-th:hover { color: var(--ink, #334155); }
.dir-th.is-sorted { color: var(--brand, #0d99ff); }
.dir-th-static { cursor: default; }
.dir-trow { min-height: 56px; border-bottom: 1px solid color-mix(in srgb, var(--line, #e8edf3) 55%, #fff); transition: background .12s; }
.dir-trow:last-child { border-bottom: 0; }
.dir-trow:hover { background: color-mix(in srgb, var(--brand, #0d99ff) 5%, #fff); }
.dir-tc { min-width: 0; font-size: 13px; color: var(--ink, #0f172a); }
.dir-tc-isapre .dir-logo { height: 18px; }
.dir-tc-plan { display: flex; flex-direction: column; gap: 1px; }
.dir-tplan { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-tcode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--mut, #94a3b8); }
.dir-tnum { font-weight: 600; font-variant-numeric: tabular-nums; }
.dir-tnota { font-weight: 700; color: #047857; }
.dir-tc-price { display: flex; flex-direction: column; }
.dir-tprice-uf { font-weight: 700; font-size: 14px; color: var(--ink, #0f172a); }
.dir-tprice-clp { font-size: 11.5px; font-weight: 600; color: var(--mut, #94a3b8); }
.dir-tc-actions { display: flex; gap: 6px; justify-content: flex-end; }
.dir-tbtn { appearance: none; cursor: pointer; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #334155); border-radius: 9px; transition: all .15s; }
.dir-tbtn:hover { background: #f1f5f9; }
.dir-tbtn-primary { border: 0; background: var(--brand, #0d99ff); color: #fff; }
.dir-tbtn-primary:hover { background: var(--brand, #0d99ff); opacity: .92; }
.dir-tbtn-ic { width: 15px; height: 15px; flex: none; }

/* Grid de cards */
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dir-empty { grid-column: 1 / -1; text-align: center; color: var(--mut, #64748b); padding: 60px 0; }

.dir-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line, #e8edf3); border-radius: 18px; padding: 20px 20px 18px; overflow: hidden; transition: transform .18s cubic-bezier(.2,.9,.2,1), box-shadow .18s; }
.dir-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -16px rgba(15,23,42,.22), 0 4px 12px -6px rgba(15,23,42,.08); }

.dir-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dir-card-isapre { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--mut, #64748b); min-width: 0; }
.dir-logo { height: 20px; width: auto; max-width: 104px; object-fit: contain; flex: none; }
.dir-isapre-name { font-weight: 600; color: var(--ink, #0f172a); }
.dir-card-isapre .dir-linea { color: var(--mut, #94a3b8); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-nota { font-size: 13px; font-weight: 700; color: #047857; background: color-mix(in srgb, #10b981 12%, #fff); border: 1px solid color-mix(in srgb, #10b981 26%, transparent); border-radius: 9px; padding: 2px 8px; flex: none; }

.dir-name { font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--ink, #0f172a); margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dir-code { font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--mut, #94a3b8); margin: 3px 0 0; }

/* Separador sutil entre el código y los KPI + respiro vertical. */
.dir-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--line, #e8edf3) 55%, #fff); margin-bottom: 14px; }
/* KPI: ícono a la izquierda + (label arriba / valor abajo) a la derecha. */
.dir-metric { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 8px 9px; border-radius: 11px; background: color-mix(in srgb, var(--line, #f1f5f9) 45%, #fff); text-align: center; }
.dir-metric-txt { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.dir-ic { width: 17px; height: 17px; flex: none; color: var(--mut, #94a3b8); }
.dir-metric-lbl { font-size: 10.5px; font-weight: 500; color: var(--mut, #94a3b8); white-space: nowrap; }
.dir-metric-val { font-size: 14px; font-weight: 700; color: var(--ink, #0f172a); }

.dir-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.dir-price-uf { font-size: 20px; font-weight: 800; color: var(--ink, #0f172a); letter-spacing: -0.3px; }
.dir-price-clp { font-size: 13px; font-weight: 600; color: var(--mut, #94a3b8); }
.dir-price-na { font-size: 13px; font-weight: 600; color: var(--mut, #94a3b8); }
.dir-prest { font-size: 12px; color: var(--mut, #94a3b8); margin-bottom: 14px; }

.dir-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: auto; }
.dir-btn { appearance: none; cursor: pointer; height: 38px; border-radius: 12px; font: inherit; font-size: 13px; font-weight: 650; transition: all .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.dir-btn-ic { width: 14px; height: 14px; flex: none; }
.dir-btn-pdf { border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #334155); }
.dir-btn-pdf:hover { background: #f1f5f9; }
.dir-btn-detail { border: 0; background: var(--brand, #0d99ff); color: #fff; }
.dir-btn-detail:hover { opacity: .92; }
/* Botón compartir (solo ícono) en las tarjetas. */
.dir-btn-icon { width: 38px; padding: 0; flex: none; border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #334155); }
.dir-btn-icon:hover { background: #f1f5f9; }
/* Ícono de WhatsApp con su color de marca (tabla y tarjetas). */
.dir-btn-icon, .dir-tbtn[data-share] { color: #25d366; }

/* Paginación */
.dir-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 28px; }
.dir-pager:empty { display: none; }
.dir-pagebtn { appearance: none; cursor: pointer; border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #0f172a); font: inherit; font-size: 13px; font-weight: 600; height: 38px; padding: 0 16px; border-radius: 12px; transition: all .15s; }
.dir-pagebtn:hover:not([disabled]) { border-color: var(--brand, #0d99ff); color: var(--brand, #0d99ff); }
.dir-pagebtn[disabled] { opacity: .4; cursor: default; }
.dir-pageinfo { font-size: 13px; color: var(--mut, #64748b); }

/* Directorio — rango de cobertura compacto + etiqueta de precio base */
.dir-metric-val { font-size: 13px; white-space: nowrap; }
.dir-price { flex-wrap: wrap; }
.dir-price-base { flex-basis: 100%; font-size: 11px; font-weight: 500; color: var(--mut, #94a3b8); margin-top: 1px; }

/* Directorio — badge de Nota con etiqueta (para no confundir con valor base) */
.dir-nota { display: inline-flex; align-items: baseline; gap: 5px; }
.dir-nota-lbl { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }

/* Directorio — botones: "Ver PDF" y "Ver en simulador" iguales (ambos respiran) + compartir (ícono). */
.dir-actions { grid-template-columns: 1fr 1fr auto; }
.dir-btn { white-space: nowrap; font-size: 12.5px; }

/* ── Caballitos de batalla (favoritos) ─────────────────────────────────────── */
/* Estrella en tarjeta y fila: contorno gris, dorada al marcar (mismo dorado que la app). */
.dir-fav { appearance: none; border: 0; background: transparent; cursor: pointer; padding: 2px; line-height: 0; color: var(--mut, #94a3b8); transition: color .12s, transform .12s; }
.dir-fav svg { width: 19px; height: 19px; display: block; }
.dir-fav:hover { color: #d9a521; transform: scale(1.08); }
.dir-fav.is-fav { color: #d9a521; }
.dir-fav-sm svg { width: 17px; height: 17px; }
.dir-card-tr { display: flex; align-items: center; gap: 8px; flex: none; }
.dir-tc-fav { display: flex; justify-content: center; }

/* Botón "Caballitos (N)" en la barra. */
.dir-cab-btn { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #334155); font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; transition: all .15s; }
.dir-cab-btn i[data-lucide], .dir-cab-btn svg { width: 15px; height: 15px; color: #d9a521; flex: none; }
.dir-cab-btn:hover { border-color: #cbd5e1; }
.dir-cab-btn.is-on { border-color: color-mix(in srgb, #d9a521 45%, var(--line, #e2e8f0)); background: color-mix(in srgb, #d9a521 9%, #fff); }
.dir-cab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: color-mix(in srgb, var(--line, #e2e8f0) 60%, #fff); color: var(--mut, #64748b); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dir-cab-btn.is-on .dir-cab-count { background: #d9a521; color: #fff; }

/* Panel derecho de Caballitos: vive en #asInsights del shell (MISMO mecanismo
   que Métricas: app.has-insights abre la columna y el canvas se corre con
   transición). #asInsights ya trae fondo + border-left + scroll. */
.dir-rail-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px; background: var(--card, #fff); border-bottom: 1px solid var(--line, #e8edf3); }
.dir-rail-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink, #0f172a); }
.dir-rail-knight { width: 18px; height: 18px; flex: none; color: #d9a521; }
.dir-rail-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #d9a521; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dir-rail-empty { padding: 22px 18px; font-size: 12.5px; line-height: 1.5; color: var(--mut, #94a3b8); }
.dir-rail-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.dir-rail-item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 11px; transition: background .12s; }
.dir-rail-item:hover { background: color-mix(in srgb, var(--line, #f1f5f9) 45%, #fff); }
.dir-rail-logo { height: 16px; width: auto; max-width: 72px; object-fit: contain; flex: none; }
.dir-rail-logo-x { font-size: 10px; font-weight: 700; color: var(--mut, #94a3b8); width: 24px; text-transform: uppercase; flex: none; }
.dir-rail-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dir-rail-name { font-size: 12.5px; font-weight: 600; color: var(--ink, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-rail-code { font-size: 10.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--mut, #94a3b8); }
/* Item completo clickeable → ver en simulador (nombre azul al hover). */
.dir-rail-item.is-openable { cursor: pointer; }
.dir-rail-item.is-openable:hover .dir-rail-name { color: var(--brand, #0d99ff); }
/* Valor base del plan (reemplaza al ícono que estaba). */
.dir-rail-uf { font-size: 12.5px; font-weight: 700; color: var(--ink, #0f172a); white-space: nowrap; flex: none; }
/* Quitar de Caballitos: estrella dorada, rojo al hover. */
.dir-rail-rm { appearance: none; border: 0; background: transparent; cursor: pointer; padding: 4px; line-height: 0; flex: none; border-radius: 8px; color: #d9a521; transition: all .12s; }
.dir-rail-rm svg { width: 17px; height: 17px; display: block; }
.dir-rail-rm:hover { background: color-mix(in srgb, #ef4444 10%, #fff); color: #ef4444; }
/* Vista de tarjetas: 2 por fila SOLO cuando el overlay está abierto. */
.app.has-insights .dir-grid { grid-template-columns: repeat(2, 1fr); }
/* Con el overlay abierto, más aire a la derecha entre la tabla y el panel. */
.app.has-insights .dir-wrap { padding-right: 48px; }
/* Overlay un poco más ancho SOLO en el directorio (no afecta a Métricas). */
.app.dir-rail-wide { --insights-w: 360px; }

/* ── Tab Mis Caballitos de batalla ─────────────────────────────────────────── */
.canvas.cab-canvas { padding: 0; overflow-y: auto; }
.cab-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 28px 56px; }
.cab-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 60vh; color: var(--mut, #64748b); font-size: 14px; }

/* Hero */
.cab-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.cab-hero-icon { width: 52px; height: 52px; border-radius: 16px; background: color-mix(in srgb, #d9a521 11%, #fff); border: 1px solid color-mix(in srgb, #d9a521 22%, transparent); display: flex; align-items: center; justify-content: center; flex: none; }
.cab-knight-ic { width: 26px; height: 26px; color: #b8860b; display: block; }
.cab-title { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink, #0f172a); margin: 0 0 4px; }
.cab-sub { font-size: 14px; color: var(--mut, #64748b); margin: 0; }
.cab-count { font-weight: 700; color: var(--brand, #0d99ff); }

/* Controles de orden */
.cab-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cab-ctl-lbl { font-size: 12px; font-weight: 600; color: var(--mut, #94a3b8); }
.cab-table { margin-top: 0; }

/* Estado vacío */
.cab-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 24px; gap: 10px; }
.cab-empty-star { width: 52px; height: 52px; color: #d9a521; opacity: 0.35; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; }
.cab-empty-star i[data-lucide], .cab-empty-star svg { width: 52px; height: 52px; }
.cab-empty-title { font-size: 18px; font-weight: 700; color: var(--ink, #0f172a); margin: 0; }
.cab-empty-body { font-size: 14px; color: var(--mut, #64748b); max-width: 360px; margin: 0; line-height: 1.55; }
.cab-empty-btn { appearance: none; display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--line, #e2e8f0); background: #fff; color: var(--ink, #334155); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.cab-empty-btn:hover { border-color: var(--brand, #0d99ff); color: var(--brand, #0d99ff); background: var(--brand-50, #eff8ff); }
.cab-empty-btn-ic { width: 15px; height: 15px; }
.cab-empty-btn-arrow { width: 13px; height: 13px; }

/* ── Aviso para móvil/touch: el dashboard es de escritorio ──────────────────── */
.as-mobile-gate { display: none; position: fixed; inset: 0; z-index: 100000; align-items: center; justify-content: center; padding: 28px; background: linear-gradient(160deg, #eaf4ff 0%, #f6f9fc 60%); }
.as-mg-card { max-width: 360px; text-align: center; background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 22px; padding: 34px 26px; }
.as-mg-icon { display: block; width: 50px; height: 50px; margin: 0 auto 16px; color: var(--brand, #0d99ff); }
.as-mg-title { font-size: 20px; font-weight: 800; color: var(--ink, #0f172a); margin: 0 0 8px; line-height: 1.25; }
.as-mg-sub { font-size: 14px; line-height: 1.55; color: var(--mut, #64748b); margin: 0 0 14px; }
.as-mg-note { font-size: 13px; line-height: 1.5; color: var(--ink, #334155); margin: 0; }
.as-mg-note strong { color: var(--brand, #0d99ff); }
.as-mg-bypass { margin-top: 18px; width: 100%; padding: 10px 16px; background: none; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; font-size: 13px; color: var(--mut, #64748b); cursor: pointer; }
.as-mg-bypass:hover { background: var(--surface, #f8fafc); }
/* Mobile gate desactivado temporalmente */

/* ============================================================
   TAB GLOSARIO  (asesor-glosario-view.js)
   Rail A–Z (#asSheet) + buscador sticky + términos en tarjetas.
   ============================================================ */
.canvas.glos-canvas { padding: 0; background: var(--bg); }

.as-glos-wrap { width: 100%; max-width: 1140px; margin-inline: auto; padding: 30px 32px 64px; }

/* ── Hero ── */
.as-glos-hero { margin-bottom: 18px; }
.as-glos-kicker {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
  background: var(--brand-50); padding: 5px 10px; border-radius: 7px; margin-bottom: 12px;
}
.as-glos-title { font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -.025em; color: var(--ink); margin: 0; }
.as-glos-lead { font-size: 14.5px; font-weight: 400; line-height: 1.55; color: var(--mut); margin: 8px 0 0; max-width: 640px; }

/* ── Buscador sticky (bleed a los bordes del wrap) ── */
.as-glos-searchbar {
  position: sticky; top: 0; z-index: 5;
  margin-inline: -32px; padding: 14px 32px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(248,250,252,.9);
  backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.as-glos-search {
  flex: 1 1 auto; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 13px;
  padding: 0 14px; height: 46px; max-width: 560px;
  transition: border-color var(--t), box-shadow var(--t);
}
.as-glos-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.as-glos-search__ic { width: 18px; height: 18px; color: #94a3b8; flex: none; }
.as-glos-search__input { flex: 1 1 auto; border: 0; outline: 0; background: none; font: inherit; font-size: 14.5px; color: var(--ink); min-width: 0; }
.as-glos-search__input::placeholder { color: #94a3b8; }
.as-glos-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.as-glos-count { font-size: 12.5px; font-weight: 600; color: var(--mut); white-space: nowrap; flex: none; }
.as-glos-count[data-state="empty"] { color: var(--err); }

/* ── Secciones por letra ── */
.as-glos-sections { margin-top: 24px; }
.as-glos-letter { scroll-margin-top: 78px; margin-bottom: 30px; }
.as-glos-letter[hidden] { display: none; }
.as-glos-letter__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.as-glos-letter__big {
  font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -.01em;
  color: var(--brand);
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-50); border-radius: 10px;
}
.as-glos-letter__head::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.as-glos-letter__terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }

/* ── Tarjeta de término ── */
.as-glos-term {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; min-width: 0;
  transition: border-color var(--t), background var(--t);
}
.as-glos-term[hidden] { display: none; }
.as-glos-term:hover { border-color: #cbd5e1; }
.as-glos-term h3 { font-size: 15px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); margin: 0 0 6px; }
.as-glos-def { font-size: 13.5px; font-weight: 400; line-height: 1.58; color: var(--mut); margin: 0; }
.as-glos-def strong { font-weight: 600; color: var(--ink); }
.as-glos-xref { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(13,153,255,.3); cursor: pointer; transition: border-color var(--t); }
.as-glos-xref:hover { border-bottom-color: var(--brand); }

/* Términos con calculadora ocupan toda la fila (markup más ancho). */
.as-glos-term:has(.as-glos-calc) { grid-column: 1 / -1; }

/* Flash al saltar desde un cross-link o el rail. */
.as-glos-term.is-flash { animation: glosFlash 1.4s cubic-bezier(.32,.72,0,1); }
@keyframes glosFlash {
  0%   { background: var(--brand-50); border-color: var(--brand); }
  100% { background: #fff; border-color: var(--line); }
}

/* ── Calculadora embebida ── */
.as-glos-calc { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.as-glos-calc__summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  padding: 6px 11px; border-radius: 9px; background: var(--brand-50);
  transition: background var(--t);
}
.as-glos-calc__summary::-webkit-details-marker { display: none; }
.as-glos-calc__summary:hover { background: #d6ecff; }
.as-glos-calc__ic { width: 15px; height: 15px; flex: none; }
.as-glos-calc[open] .as-glos-calc__summary { margin-bottom: 14px; }
.as-glos-calc__body { display: flex; flex-direction: column; gap: 12px; }
.as-glos-calc__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.as-glos-calc__field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 180px; min-width: 150px; }
.as-glos-calc__field > span { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--mut); }
.as-glos-calc__field input {
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; outline: none; width: 100%;
  transition: border-color var(--t), box-shadow var(--t);
}
.as-glos-calc__field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.as-glos-calc__check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; flex: 0 0 auto; padding-bottom: 9px; }
.as-glos-calc__check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.as-glos-calc__outs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.as-glos-calc__outs--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.as-glos-calc__out { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.as-glos-calc__out-label { font-size: 11px; font-weight: 500; color: var(--mut); }
.as-glos-calc__out-value { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.as-glos-calc__bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.as-glos-calc__bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-d)); transition: width .25s cubic-bezier(.32,.72,0,1); }
.as-glos-calc__note { font-size: 12px; line-height: 1.5; color: var(--mut); margin: 0; }

/* ── Estado vacío del buscador ── */
.as-glos-empty { font-size: 14px; color: var(--mut); padding: 40px 4px; text-align: center; }
.as-glos-empty[hidden] { display: none; }

/* ============================================================
   RAIL del glosario  (#asSheet.glos-sheet)
   ============================================================ */
.sheet.glos-sheet { padding: 20px 16px; }
.as-glos-rail { display: flex; flex-direction: column; gap: 4px; }
.as-glos-rail__head { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; }
.as-glos-rail__ic { width: 26px; height: 26px; color: var(--brand); flex: none; }
.as-glos-rail__title { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.as-glos-rail__count { font-size: 12px; font-weight: 500; color: var(--mut); margin-top: 2px; }

.as-glos-az { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 4px; }
.as-glos-az__chip {
  appearance: none; cursor: pointer; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 700;
  height: 34px; border-radius: 9px; transition: all var(--t);
  display: inline-flex; align-items: center; justify-content: center;
}
.as-glos-az__chip:hover { border-color: var(--brand); color: var(--brand); }
.as-glos-az__chip.is-active { background: var(--ink); color: #fff; border-color: transparent; }
.as-glos-az__chip.is-empty { opacity: .32; pointer-events: none; }

.as-glos-rail__sep { height: 1px; background: var(--line); margin: 18px 8px; }
.as-glos-rail__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); padding: 0 8px 8px; }
.as-glos-tools { display: flex; flex-direction: column; gap: 6px; }
.as-glos-tool {
  appearance: none; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: #fff; border-radius: 11px;
  padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  transition: all var(--t);
}
.as-glos-tool:hover { border-color: var(--brand); background: var(--brand-50); }
.as-glos-tool__ic { width: 17px; height: 17px; color: var(--brand); flex: none; }

/* ── Responsive: en angosto, una columna de términos ── */
@media (max-width: 900px) {
  .as-glos-letter__terms { grid-template-columns: 1fr; }
  .as-glos-term:has(.as-glos-calc) { grid-column: auto; }
}

/* ============================================================
   TAB HERRAMIENTAS (#asSheet.herr-sheet + #asCanvas.herr-canvas)
   Master-detail: rail de herramientas + superficie de trabajo.
   ============================================================ */

/* ── Rail (sheet) ── */
.sheet.herr-sheet { padding: 0; }
.herr-rail { display: flex; flex-direction: column; min-height: 100%; }
.herr-rail-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card); z-index: 2;
}
.herr-rail-title { margin: 0 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.herr-rail-live {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--mut);
  margin-bottom: 12px; font-variant-numeric: tabular-nums;
}
.herr-rail-live-dot { display: none; }
.herr-refresh {
  margin-left: auto; flex: none;
  width: 22px; height: 22px; border-radius: 6px; border: none; cursor: pointer;
  background: transparent; color: var(--mut); display: flex; align-items: center; justify-content: center;
  transition: color var(--t), background var(--t);
}
.herr-refresh:hover { background: var(--bg); color: var(--ink); }
.herr-refresh svg { width: 13px; height: 13px; }
.herr-refresh.is-spinning svg { animation: herrSpin .7s linear infinite; }
.herr-rail-search { position: relative; display: flex; align-items: center; }
.herr-rail-search-ic { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--mut); pointer-events: none; }
.herr-rail-search input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px 9px 34px;
  font-size: 13px; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.herr-rail-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }

.herr-nav { padding: 10px 10px 20px; flex: 1; }
.herr-cat { margin-bottom: 6px; }
.herr-cat[hidden] { display: none; }
.herr-cat-label {
  display: block; padding: 12px 8px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut);
}
.herr-tool {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; margin-bottom: 2px;
  background: transparent; border: 1px solid transparent; border-radius: 11px;
  text-align: left; cursor: pointer; font-family: inherit;
  transition: background var(--t), border-color var(--t);
}
.herr-tool[hidden] { display: none; }
.herr-tool:hover { background: var(--bg); }
.herr-tool.is-active { background: var(--brand-50); border-color: rgba(13,153,255,.28); }
.herr-tool-ic {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ic); background: color-mix(in srgb, var(--ic) 12%, transparent);
}
.herr-tool-ic svg { width: 17px; height: 17px; }
.herr-tool-txt { display: flex; flex-direction: column; min-width: 0; }
.herr-tool-name { font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.herr-tool-desc { font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.herr-rail-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--mut); }

/* ── Detalle (canvas) ── */
.canvas.herr-canvas { padding: 0; }
.herr-detail { max-width: 720px; margin: 0 auto; padding: 32px 40px 64px; width: 100%; box-sizing: border-box; }
.herr-detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.herr-detail-ic {
  width: 52px; height: 52px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ic); background: color-mix(in srgb, var(--ic) 13%, transparent);
}
.herr-detail-ic svg { width: 25px; height: 25px; }
.herr-detail-titles h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); }
.herr-detail-titles p { margin: 2px 0 0; font-size: 14px; color: var(--mut); }
.herr-detail-body { display: flex; flex-direction: column; gap: 18px; }

/* ── Portada (overview): franja del día + cards por categoría ── */
.herr-overview { max-width: 880px; margin: 0 auto; padding: 32px 40px 64px; width: 100%; box-sizing: border-box; }
.herr-ov-head { margin-bottom: 22px; }
.herr-ov-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); }
.herr-ov-head p { margin: 3px 0 0; font-size: 14px; color: var(--mut); }

.herr-ov-live {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; margin-bottom: 30px;
}
.herr-ov-live-cell { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--card); }
.herr-ov-live-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); }
.herr-ov-live-val { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.herr-ov-live-unit { font-size: 11px; font-weight: 600; color: var(--mut); }
.herr-ov-live--loading { display: flex; align-items: center; justify-content: center; gap: 10px; grid-template-columns: none; padding: 26px; color: var(--mut); font-size: 13px; background: var(--card); }

.herr-ov-cat { margin-bottom: 26px; }
.herr-ov-cat[hidden] { display: none; }
.herr-ov-cat-label { margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.herr-ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.herr-ov-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; font-family: inherit;
  padding: 18px; border-radius: 15px; background: var(--card); border: 1px solid var(--line);
  transition: border-color var(--t), background var(--t), transform var(--t);
}
.herr-ov-card[hidden] { display: none; }
.herr-ov-card:hover { border-color: rgba(13,153,255,.4); background: #fbfdff; transform: translateY(-1px); }
.herr-ov-card-ic {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ic); background: color-mix(in srgb, var(--ic) 13%, transparent);
}
.herr-ov-card-ic svg { width: 19px; height: 19px; }
.herr-ov-card-name { font-size: 14.5px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.herr-ov-card-desc { font-size: 12.5px; color: var(--mut); line-height: 1.4; }

/* Botón volver (en el detalle) */
.herr-back {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  margin-bottom: 16px; padding: 6px 12px 6px 8px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--mut);
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.herr-back svg { width: 16px; height: 16px; }
.herr-back:hover { background: var(--bg); color: var(--ink); border-color: var(--mut); }
.herr-detail { display: flex; flex-direction: column; }

/* Título del rail clicable (vuelve a la portada) */
.herr-rail-title { cursor: pointer; }
.herr-rail-title.is-here { color: var(--brand); }

/* ── Campos de entrada ── */
.herr-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
/* Por defecto el campo NO crece (evita estiramiento vertical como hijo directo
   del body en columna). Dentro de .herr-row sí se reparte horizontalmente. */
.herr-field { display: flex; flex-direction: column; gap: 7px; }
.herr-row .herr-field { flex: 1 1 220px; min-width: 180px; }
.herr-field-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); }
.herr-field-helper { font-size: 11.5px; color: var(--mut); }
.herr-input-wrap { position: relative; display: flex; align-items: center; }
.herr-input {
  width: 100%; box-sizing: border-box;
  padding: 13px 14px; font-size: 18px; font-weight: 600; font-family: inherit;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t), box-shadow var(--t);
}
.herr-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.herr-input-wrap.has-pre .herr-input { padding-left: 32px; }
.herr-input-wrap.has-suf .herr-input { padding-right: 46px; }
.herr-affix { position: absolute; font-size: 15px; font-weight: 600; color: var(--mut); pointer-events: none; }
.herr-affix--pre { left: 14px; }
.herr-affix--suf { right: 14px; }

/* Segmento (rol) */
.herr-seg { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.herr-seg-btn {
  flex: 1; padding: 9px 12px; font-size: 13px; font-weight: 600; font-family: inherit;
  color: var(--mut); background: transparent; border: none; border-radius: 9px; cursor: pointer;
  transition: background var(--t), color var(--t);
}
.herr-seg-btn.is-active { background: var(--card); color: var(--brand); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

/* Checkbox */
.herr-check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.herr-check input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; flex: none; }
.herr-check em { font-style: normal; color: var(--mut); font-size: 12.5px; }

/* ── Resultado grande ── */
.herr-result-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 22px; border-radius: 16px;
  background: linear-gradient(180deg, #f4f9ff, #eef6ff);
  border: 1px solid rgba(13,153,255,.18);
}
.herr-result-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); }
.herr-result-value { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.herr-result-sub { font-size: 13px; color: var(--mut); font-weight: 500; }

/* Outs en grilla (bono) */
.herr-out-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.herr-out {
  display: flex; flex-direction: column; gap: 5px;
  padding: 16px 18px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line);
}
.herr-out-label { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.herr-out-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--out, var(--brand)); flex: none; }
.herr-out-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--out, var(--ink)); font-variant-numeric: tabular-nums; }

/* ── Notas ── */
.herr-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--mut); }
.herr-note--warn {
  padding: 12px 14px; border-radius: 11px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
}

/* ── Indicadores ── */
.herr-ind-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.herr-ind-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
}
.herr-ind-top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.herr-ind-ic { width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 13%, transparent); }
.herr-ind-ic svg { width: 15px; height: 15px; }
.herr-ind-name { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); }
.herr-ind-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.05; }
.herr-ind-unit { font-size: 11.5px; font-weight: 600; color: var(--mut); }
.herr-ind-sub { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--brand); }
.herr-ind-delta { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 600; }
.herr-ind-delta.up { color: var(--win); }
.herr-ind-delta.down { color: var(--err); }
.herr-ind-updated { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--mut); font-weight: 500; }

/* Loading */
.herr-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--mut); font-size: 13px; }
.herr-spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: herrSpin .7s linear infinite; }
@keyframes herrSpin { to { transform: rotate(360deg); } }

/* ── Barra de progreso (CAEC) ── */
.herr-prog { display: flex; flex-direction: column; gap: 9px; padding: 16px 18px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.herr-prog[hidden] { display: none; }
.herr-prog-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); }
.herr-prog-pct { font-size: 17px; font-weight: 800; color: var(--brand); text-transform: none; }
.herr-prog-pct.is-active { color: var(--win); }
.herr-prog-track { height: 9px; border-radius: 999px; background: rgba(15,23,42,.08); overflow: hidden; }
.herr-prog-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .35s cubic-bezier(.32,.72,0,1); }
.herr-prog-fill.is-active { background: var(--win); }
.herr-prog-falta { margin: 0; font-size: 12.5px; color: var(--mut); }

/* ── Steppers (novenos) ── */
.herr-stepper { display: flex; align-items: center; gap: 10px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 13px; }
.herr-step-btn {
  width: 42px; height: 42px; flex: none; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); color: var(--brand);
  transition: background var(--t);
}
.herr-step-btn:hover { background: var(--brand-50); }
.herr-step-btn svg { width: 19px; height: 19px; }
.herr-step-value { flex: 1; text-align: center; font-size: 14px; font-weight: 700; color: var(--ink); }
.herr-novenos { display: flex; gap: 4px; }
.herr-nov-seg { flex: 1; height: 10px; border-radius: 3px; transition: background .25s; }

/* WhatsApp */
.herr-wa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; align-self: flex-start;
  padding: 11px 18px; font-size: 14px; font-weight: 700; font-family: inherit; color: #fff;
  background: #25D366; border: none; border-radius: 12px; cursor: pointer;
}
.herr-wa-btn svg { width: 18px; height: 18px; }
.herr-wa-btn:hover { background: #1eb858; }

/* ── Mini-tabla de factores ── */
.herr-mini-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--card); }
.herr-mtr { display: grid; grid-template-columns: 1.4fr 1fr 1fr; padding: 10px 16px; font-size: 13px; color: var(--ink); }
.herr-mtr:not(.herr-mth):not(:first-child) { border-top: 1px solid rgba(15,23,42,.05); }
.herr-mtr span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.herr-mtr .emph { font-weight: 700; }
.herr-mth { background: var(--bg); border-bottom: 1px solid var(--line); }
.herr-mth span { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); }
.herr-mtr.is-active { background: var(--brand-50); }
.herr-mtr.is-active span { color: var(--brand-d); font-weight: 700; }
.herr-mini-table--lg .herr-mtr { padding: 13px 18px; font-size: 14px; }

/* ── GES ── */
.herr-ges-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--card); }
.herr-ges-row { display: flex; align-items: center; gap: 13px; padding: 13px 16px; }
.herr-ges-row:not(:first-child) { border-top: 1px solid rgba(15,23,42,.05); }
.herr-ges-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.herr-ges-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink); }
.herr-ges-vals { display: flex; flex-direction: column; align-items: flex-end; }
.herr-ges-uf { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.herr-ges-clp { font-size: 11.5px; color: var(--mut); font-variant-numeric: tabular-nums; }

/* ── Fórmula ── */
.herr-formula-box { padding: 18px 20px; border-radius: 14px; background: #eff6ff; border: 1px solid #bfdbfe; }
.herr-formula-box p { margin: 0; font-size: 14.5px; line-height: 1.6; color: #1e40af; }
.herr-formula-box p + p { margin-top: 6px; }
.herr-steps { display: flex; flex-direction: column; gap: 14px; }
.herr-step { display: flex; gap: 13px; }
.herr-step-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.herr-step strong { display: block; font-size: 14px; color: var(--ink); }
.herr-step p { margin: 2px 0 0; font-size: 12.5px; color: var(--mut); line-height: 1.5; }

/* ── Enlaces ── */
.herr-links { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--card); }
.herr-link { display: flex; align-items: center; gap: 13px; padding: 14px 16px; text-decoration: none; transition: background var(--t); }
.herr-link:not(:first-child) { border-top: 1px solid rgba(15,23,42,.05); }
.herr-link:hover { background: var(--bg); }
.herr-link-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.herr-link-ic svg { width: 16px; height: 16px; }
.herr-link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.herr-link-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.herr-link-desc { font-size: 12px; color: var(--mut); }
.herr-link-chev { font-size: 20px; color: var(--mut); }

/* Responsive: grillas a 1 columna en canvas angosto */
@media (max-width: 1180px) {
  .herr-detail { padding: 28px 28px 56px; }
}

/* ============================================================
   HISTORIAL — cockpit de envíos (namespace hx-*)
   Sheet (control) · Canvas (cola/archivo) · Insights (inteligencia).
   Sin glow: bordes sólidos, contraste por color. Tokens compartidos.
   ============================================================ */

/* ── SHEET (control) ── */
.hx-sheet { display: flex; flex-direction: column; gap: 16px; padding: 20px 18px; overflow-y: auto; }

.hx-hero { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.hx-hero-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hx-hero-head .mx-info-btn { margin: -4px -4px 0 0; }
.hx-hero-title { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.hx-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hx-hero-stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hx-hero-num { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hx-hero-lbl { font-size: 11.5px; color: var(--mut); margin-top: 2px; }
.hx-skel-stat { height: 58px; background: linear-gradient(90deg, #f1f5f9 25%, #e9eef5 50%, #f1f5f9 75%); background-size: 200% 100%; animation: hxshimmer 1.3s infinite; border-color: transparent; }

.hx-seg { width: 100%; }
.hx-seg .mx-seg { flex: 1; text-align: center; }

.hx-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 11px; padding: 0 12px; transition: border-color var(--t); }
.hx-search:focus-within { border-color: var(--brand); }
.hx-search svg { width: 16px; height: 16px; color: var(--mut); flex: none; }
.hx-search-in { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); padding: 10px 0; }

/* Filtros por estado — lista vertical, ordenada y elegante. */
.hx-filters { display: flex; flex-direction: column; }
.hx-filters-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint, #94a3b8); padding: 0 4px 4px; }
.hx-filter { appearance: none; cursor: pointer; display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); background: none; font: inherit; padding: 7px 9px; border-radius: 8px; text-align: left; transition: background var(--t); }
.hx-filter:first-of-type { border-top: 0; }
.hx-filter:hover { background: var(--bg); }
.hx-filter-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.hx-filter-dot--all { background: var(--faint, #94a3b8); }
.hx-filter-lbl { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--ink); }
.hx-filter-n { flex: none; font-size: 11px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; background: var(--bg); border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.hx-filter-n:empty { display: none; }
/* El separador desaparece junto al activo para que el tinte se vea limpio. */
.hx-filter.is-on, .hx-filter.is-on + .hx-filter { border-top-color: transparent; }
/* Activo: tinte del color de la señal (Todas cae al azul de marca). */
.hx-filter.is-on { background: var(--cbg, var(--brand-50)); }
.hx-filter.is-on .hx-filter-lbl { color: var(--cfg, var(--brand-d)); font-weight: 600; }
.hx-filter.is-on .hx-filter-n { color: var(--cfg, var(--brand-d)); background: color-mix(in srgb, var(--cfg, var(--brand)) 15%, #fff); }
/* Vacío: atenuado, sin número — no distrae de lo accionable. */
.hx-filter.is-empty { opacity: .42; }
.hx-filter.is-empty:hover { opacity: .7; }
/* "Ganados" — eje aparte (ventas cerradas), destacado en verde. */
.hx-filter-sep { height: 1px; background: var(--line); margin: 8px 6px 4px; }
.hx-filter-ico { width: 16px; height: 16px; flex: none; color: var(--win, #16a34a); }
.hx-filter--won { border-top: 0; }                 /* el separador ya divide; sin doble línea */
.hx-filter--won .hx-filter-lbl { color: var(--win-d, #15803d); font-weight: 600; }
.hx-filter--won .hx-filter-n { color: var(--win-d, #15803d); }
.hx-filter--won:hover { background: #f0fdf4; }
.hx-filter--won.is-on { background: #ecfdf5; }
.hx-filter--won.is-on .hx-filter-n { background: color-mix(in srgb, #16a34a 15%, #fff); }

/* Resumen de ganados + UF cerrada por mes + venta a la derecha de la card. */
.hx-won-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 4px 16px; }
.hx-won-sum-n { font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
.hx-won-sum-n b { font-weight: 800; }
.hx-won-sum-uf { flex: none; font-size: 12.5px; font-weight: 700; color: var(--win-d, #15803d); background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.hx-won-monthuf { font-size: 12px; font-weight: 700; color: var(--win-d, #15803d); }
/* Card cerrada: "Ganado · fecha" a la altura del nombre; monto en UF (protagonista)
   a la altura del plan. Cada uno empujado a la derecha de su fila → quedan alineados. */
.hx-cwon-sub { flex: none; margin-left: auto; padding-left: 12px; font-size: 11px; font-weight: 500; color: var(--faint, #94a3b8); white-space: nowrap; }
.hx-cwon-amt { flex: none; margin-left: auto; padding-left: 12px; font-size: 15px; font-weight: 800; color: var(--win-d, #15803d); letter-spacing: -.01em; white-space: nowrap; }

/* ── CANVAS (cola / archivo) ── */
.hx-canvas { background: var(--bg); height: 100%; overflow: hidden; }
/* width:100% es CLAVE: .hx-scroll es flex-item de #asCanvas (display:flex column);
   sin esto se encoge a su contenido y el ancho cambia entre modos (bug "Todos" angosto). */
.hx-scroll { width: 100%; height: 100%; overflow-y: auto; padding: 24px 32px 56px; max-width: 1000px; margin: 0 auto; box-sizing: border-box; }

/* Encabezado explicativo (qué es la tab + flujo) */
.hx-intro { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(180deg, #fbfdff, var(--card)); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 22px; }
.hx-intro-spacer { height: 4px; }
.hx-intro-ic { width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-d); border-radius: 11px; }
.hx-intro-ic svg { width: 20px; height: 20px; }
.hx-intro-tx { flex: 1; min-width: 0; }
.hx-intro-t { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.hx-intro-s { font-size: 13px; line-height: 1.5; color: var(--mut); margin-top: 3px; }
.hx-intro-s b { color: var(--ink); font-weight: 600; }
.hx-intro-x { appearance: none; cursor: pointer; border: 0; background: none; color: var(--faint, #94a3b8); padding: 4px; border-radius: 7px; flex: none; transition: color var(--t), background var(--t); }
.hx-intro-x:hover { color: var(--ink); background: var(--bg); }
.hx-intro-x svg { width: 15px; height: 15px; display: block; }

.hx-headline { font-size: 19px; color: var(--ink); margin-bottom: 18px; font-weight: 500; letter-spacing: -.01em; }
.hx-headline strong { font-weight: 700; }
/* P3 · toolbar de selección múltiple */
.hx-segtool { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 26px; }
.hx-segtool-txt { font-size: 19px; color: var(--ink); font-weight: 500; letter-spacing: -.01em; min-width: 0; }
.hx-segtool-txt strong { font-weight: 700; }
.hx-sel-toggle { flex: none; appearance: none; cursor: pointer; background: transparent; border: 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 8px; border-radius: 8px; transition: background var(--t); }
.hx-sel-toggle:hover { background: var(--brand-50); }
/* Checkbox en la card */
.hx-card--sel { cursor: pointer; }
.hx-card.is-checked { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 35%, #fff); }
.hx-ccheck { width: 20px; height: 20px; flex: none; border: 1.5px solid #cbd5e1; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; transition: background var(--t), border-color var(--t); }
.hx-ccheck svg { width: 13px; height: 13px; }
.hx-card.is-checked .hx-ccheck { background: var(--brand); border-color: var(--brand); }
/* Barra de acciones masivas (pegada al fondo del canvas) */
.hx-selbar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 4px; margin-top: 8px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.hx-selbar-btn { flex: 1; appearance: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; padding: 11px 14px; border-radius: 11px; transition: all var(--t); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.hx-selbar-n { font-variant-numeric: tabular-nums; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 12px; }
.hx-selbar-gest { border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.hx-selbar-gest:hover { background: var(--brand-d); border-color: var(--brand-d); }
.hx-selbar-gest .hx-selbar-n { background: rgba(255,255,255,.22); }
.hx-selbar-disc { border: 1px solid var(--line); background: var(--card); color: var(--err, #dc2626); }
.hx-selbar-disc:hover { border-color: var(--err, #dc2626); background: #fef2f2; }
.hx-selbar-disc .hx-selbar-n { background: #fef2f2; color: var(--err, #dc2626); }
.hx-divider { height: 1px; background: var(--line); margin: 28px 0 4px; }
/* El section-head que sigue a un divider ya lleva el espacio en el divider; reducimos su padding top. */
.hx-divider + .hx-sec,
.hx-divider + .hx-group > .hx-sec { padding-top: 16px; }

.hx-sec { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 4px 10px; gap: 12px; }
.hx-sec.is-collapsible { cursor: pointer; user-select: none; align-items: center; }
.hx-sec-l { min-width: 0; }
.hx-sec-head { display: flex; align-items: center; gap: 8px; }
.hx-sec-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hx-sec-lbl { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--mut); }
.hx-sec-desc { font-size: 12.5px; color: var(--faint, #94a3b8); margin-top: 4px; }
.hx-sec-r { display: flex; align-items: center; gap: 8px; flex: none; }
.hx-sec-n { font-size: 12px; font-weight: 700; color: var(--faint, #94a3b8); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 8px; font-variant-numeric: tabular-nums; }
.hx-sec-chev { color: var(--mut); display: inline-flex; transition: transform var(--t); }
.hx-sec-chev svg { width: 16px; height: 16px; }
.hx-sec.is-collapsed .hx-sec-chev { transform: rotate(-90deg); }
/* Sección "Inactivos" (P1) — header más apagado: es peso muerto, no urgencia. */
.hx-sec--inactive .hx-sec-lbl { color: var(--faint, #94a3b8); }

/* ── CARD (avatar + contenido en filas) ──
   Fila 1: nombre  ·····  (chip de calor + apertura, chiquito)
   Fila 2: plan + UF      ·····  [Se vendió] [Ya lo contacté]
   Fila 3: cohorte · renta */
.hx-card { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 20px; margin-bottom: 10px; cursor: pointer; transition: border-color var(--t), background var(--t); }
.hx-card:hover { border-color: #cbd5e1; background: #fcfdff; }

.hx-cdot { width: 38px; height: 38px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; }
.hx-cdot svg { width: 17px; height: 17px; }
.hx-cdot.is-mail { background: var(--brand-50); color: var(--brand-d); }
.hx-cdot.is-wa { background: #dcfce7; color: #15803d; }

.hx-cmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* nowrap: el nombre largo trunca (…) y los botones se quedan en su línea (no deforma) */
.hx-crow { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; min-width: 0; }
.hx-cname-wrap { display: flex; align-items: center; gap: 5px; flex: 1 1 auto; min-width: 0; }
.hx-cname { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-cname.is-anon { font-size: 12.5px; font-weight: 500; color: var(--mut); }
.hx-pencil { appearance: none; cursor: pointer; border: 0; background: none; padding: 3px; color: var(--faint, #94a3b8); border-radius: 6px; flex: none; opacity: 0; transition: opacity var(--t), color var(--t), background var(--t); }
.hx-card:hover .hx-pencil { opacity: 1; }
.hx-pencil:hover { color: var(--brand); background: var(--brand-50); }
.hx-pencil svg { width: 13px; height: 13px; display: block; }

/* chip de calor + apertura + fecha de envío: chiquito, a la derecha */
.hx-cstat { display: flex; flex-direction: row; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.hx-cstat-top { display: contents; } /* aplana el wrapper → chip y fecha en el mismo flex row */
.hx-cstat .hx-tag { font-size: 10.5px; padding: 2px 8px; }
.hx-cstat .hx-act { font-size: 11px; font-weight: 400; }
.hx-cdate { font-size: 10.5px; font-weight: 400; color: var(--faint, #94a3b8); white-space: nowrap; }
.hx-cmeta { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-cmeta-sep { margin: 0 2px; color: var(--faint, #94a3b8); }
.hx-cmeta .hx-act { font-size: 11px; font-weight: 400; }
/* chip de señal en el título de la sección (reemplaza al punto en Seguimiento) */
.hx-sec-chip { font-size: 11px; padding: 2px 9px; }

.hx-cplan { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
/* min-width:0 deja que el nombre largo se trunque (…) en vez de deformar la card */
.hx-cplan-name { flex: 0 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-cplan-uf { flex: none; font-size: 11.5px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; border: 1px solid var(--line); background: var(--bg); padding: 1px 7px; border-radius: 6px; }
.hx-cplan-more { font-size: 11.5px; font-weight: 600; color: var(--faint, #94a3b8); flex: none; }
.hx-cplan-code { color: var(--mut); }                 /* respaldo: código de plan */
.hx-cplan-empty { color: var(--faint, #94a3b8); font-weight: 500; font-style: italic; }

.hx-cmeta { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hx-tag { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid; white-space: nowrap; }
.hx-act { font-size: 12px; font-weight: 500; white-space: nowrap; }
.hx-cacts { display: flex; gap: 8px; flex: none; margin-left: auto; }
.hx-gest { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 9px; transition: all var(--t); }
.hx-gest:hover { border-color: #cbd5e1; background: var(--bg); }
.hx-gest svg { width: 13px; height: 13px; }
/* "Se vendió" — acción ganadora, verde sólido (sin glow) */
.hx-sold { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--win, #16a34a); background: var(--win, #16a34a); color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 9px; transition: all var(--t); }
.hx-sold:hover { background: var(--win-d, #15803d); border-color: var(--win-d, #15803d); }
.hx-sold svg { width: 13px; height: 13px; }

/* ── Cierre de ciclo: "No siguió" (perdido) + "Restaurar" ── */
/* "No siguió" = acción terciaria, bajo énfasis (ghost). Hover insinúa pérdida. */
.hx-discard { appearance: none; cursor: pointer; display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--faint, #94a3b8); font: inherit; font-size: 12.5px; font-weight: 500; padding: 7px 9px; border-radius: 9px; transition: color var(--t), background var(--t); }
.hx-discard:hover { color: var(--err, #dc2626); background: #fef2f2; }
.hx-restore { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 9px; transition: all var(--t); }
.hx-restore:hover { border-color: #cbd5e1; background: var(--bg); }

/* Filtro "Perdidos" — destino terminal neutro (gris, no alarmante). */
.hx-filter--lost .hx-filter-lbl { color: var(--mut); font-weight: 600; }
.hx-filter--lost .hx-filter-ico { color: var(--faint, #94a3b8); }
.hx-filter--lost:hover { background: var(--bg); }
.hx-filter--lost.is-on { background: #f1f5f9; }
.hx-filter--lost.is-on .hx-filter-lbl { color: var(--ink); }
.hx-filter--lost.is-on .hx-filter-n { background: color-mix(in srgb, var(--mut) 14%, #fff); color: var(--ink); }

/* Modal de motivo de pérdida */
.hx-disc-back { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .42); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.hx-disc { width: 100%; max-width: 380px; background: var(--card); border-radius: 18px; padding: 20px; box-shadow: 0 18px 50px rgba(15, 23, 42, .22); }
.hx-disc-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.hx-disc-htxt { flex: 1; min-width: 0; }
.hx-disc-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.hx-disc-sub { font-size: 12.5px; color: var(--mut); line-height: 1.4; margin-top: 3px; }
.hx-disc-x { appearance: none; cursor: pointer; flex: none; border: 0; background: transparent; color: var(--faint, #94a3b8); padding: 2px; border-radius: 8px; transition: color var(--t), background var(--t); }
.hx-disc-x:hover { color: var(--ink); background: var(--bg); }
.hx-disc-x svg { width: 18px; height: 18px; }
.hx-disc-reasons { display: flex; flex-direction: column; gap: 8px; }
.hx-disc-reason { appearance: none; cursor: pointer; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 500; padding: 11px 14px; border-radius: 11px; transition: all var(--t); }
.hx-disc-reason:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand-d); }
.hx-disc-reason.is-on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-d); }
.hx-snz-custom { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.hx-snz-go { appearance: none; cursor: pointer; border: none; background: var(--brand); color: #fff; font: inherit; font-size: 14px; font-weight: 650; padding: 11px 14px; border-radius: 11px; transition: all var(--t); }
.hx-snz-go:hover:not(:disabled) { background: var(--brand-d); }
.hx-snz-go:disabled { opacity: .45; cursor: default; }

/* Desglose "Por qué pierdes" (rail de Perdidos) */
.hx-lr-row { padding: 7px 2px; }
.hx-lr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.hx-lr-lbl { font-size: 13px; color: var(--ink); }
.hx-lr-n { font-size: 12.5px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; }
.hx-lr-track { height: 7px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.hx-lr-fill { display: block; height: 100%; border-radius: 4px; background: color-mix(in srgb, var(--mut) 55%, #fff); }

/* CTA "Se vendió" del detalle (estilo móvil: ícono + título + bajada) */
.hx-sold-cta { appearance: none; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 13px; background: var(--win, #16a34a); color: #fff; font: inherit; padding: 13px 15px; text-align: left; transition: background var(--t); }
.hx-sold-cta:hover { background: var(--win-d, #15803d); }
.hx-sold-cta > svg:first-child { width: 20px; height: 20px; flex: none; }
.hx-sold-cta-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-sold-cta-tx b { font-size: 14.5px; font-weight: 700; }
.hx-sold-cta-tx span { font-size: 12.5px; opacity: .9; }
.hx-sold-cta-go { width: 18px; height: 18px; flex: none; opacity: .85; }
.hx-sold-banner { display: flex; align-items: center; gap: 10px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 12px 14px; color: var(--win-d, #15803d); font-size: 13px; font-weight: 600; }
.hx-sold-banner svg { width: 18px; height: 18px; flex: none; }
.hx-sold-banner > span:not(.hx-sold-q) { flex: 1; min-width: 0; }
/* Banner "perdida" — espejo neutro (gris) del de ganada. */
.hx-lost-banner { display: flex; align-items: center; gap: 10px; background: #f1f5f9; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--mut); font-size: 13px; font-weight: 600; }
.hx-lost-banner i[data-lucide], .hx-lost-banner svg { width: 18px; height: 18px; flex: none; color: var(--faint, #94a3b8); }
.hx-lost-banner > span { flex: 1; min-width: 0; }
.hx-lost-banner .hx-sold-void { border-color: var(--line); color: var(--mut); }
.hx-lost-banner .hx-sold-void:hover { border-color: var(--brand); color: var(--brand); }
/* "Anular" venta — discreto, dentro del banner verde. */
.hx-sold-void { appearance: none; cursor: pointer; flex: none; border: 1px solid #a7f3d0; background: #fff; color: var(--win-d, #15803d); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; transition: all var(--t); }
.hx-sold-void:hover { background: #fff; border-color: var(--win-d, #15803d); }
.hx-sold-void:disabled { opacity: .6; cursor: default; }
.hx-sold-void--yes { background: var(--err); border-color: var(--err); color: #fff; }
.hx-sold-void--yes:hover { background: #dc2626; border-color: #dc2626; }
.hx-sold-confirm { display: flex; align-items: center; gap: 8px; flex: none; }
.hx-sold-confirm .hx-sold-q { font-size: 12.5px; }

/* Confetti de venta (CSS puro) */
.hx-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 600; overflow: hidden; }
.hx-confetti-pc { position: absolute; top: -24px; border-radius: 1px; opacity: 0; animation-name: hxconfetti; animation-timing-function: cubic-bezier(.25,.6,.45,1); animation-fill-mode: forwards; }
@keyframes hxconfetti {
  0% { transform: translate(0, -24px) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate(var(--drift, 0), 102vh) rotate(var(--rot, 360deg)); opacity: 1; }
}

.hx-foot { display: flex; justify-content: center; padding: 18px 0; }
.hx-more { appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 9px; transition: all var(--t); }
.hx-more:hover { border-color: var(--brand); color: var(--brand); }
.hx-end { text-align: center; font-size: 12.5px; color: var(--faint, #94a3b8); padding: 20px 0 4px; }

/* ── INSIGHTS (inteligencia) ── */
.hx-insights { display: flex; flex-direction: column; gap: 14px; padding: 20px 16px; overflow-y: auto; }
.hx-ins-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.hx-ins-title { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); margin-bottom: 12px; }
.hx-ins-empty { font-size: 12.5px; color: var(--mut); padding: 4px 0; }
.hx-ins-foot { font-size: 12px; color: var(--faint, #94a3b8); margin-top: 8px; }

.hx-nba { appearance: none; cursor: pointer; width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 11px; font: inherit; transition: all var(--t); }
.hx-nba:hover { border-color: #cbd5e1; background: #fff; }
.hx-nba-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hx-nba-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.hx-nba-txt b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-nba-txt span { font-size: 12px; color: var(--mut); }
.hx-nba-go { width: 16px; height: 16px; color: var(--faint, #94a3b8); flex: none; transition: transform var(--t); }
.hx-nba:hover .hx-nba-go { transform: translateX(2px); color: var(--brand); }

.hx-eng { display: flex; flex-direction: column; gap: 10px; }
.hx-eng-row { display: flex; align-items: center; gap: 10px; }
.hx-eng-rank { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--brand-d); background: var(--brand-50); border-radius: 6px; }
.hx-eng-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-eng-txt b { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-eng-txt span { font-size: 11.5px; color: var(--mut); }
.hx-eng-lat { font-size: 11.5px; font-weight: 600; color: var(--mut); flex: none; }

/* "Vuelven a mirar" — lista clickeable de clientes que reabrieron. */
.hx-reopen { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px; }
.hx-reopen-row { appearance: none; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; font: inherit; padding: 7px 8px; border-radius: 8px; text-align: left; transition: background var(--t); }
.hx-reopen-row:hover { background: var(--bg); }
.hx-reopen-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hx-reopen-txt b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-reopen-txt span { font-size: 12px; color: var(--mut); }
.hx-reopen-go { width: 15px; height: 15px; flex: none; color: var(--faint, #94a3b8); }
.hx-reopen-all { appearance: none; cursor: pointer; width: 100%; border: 0; background: var(--bg); color: var(--brand-d); font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px; border-radius: 8px; margin: 2px 0 8px; transition: background var(--t); }
.hx-reopen-all:hover { background: var(--brand-50); }

/* ── FILTRO POR FECHA (índice año/mes, modo Archivo) ── */
.hx-tl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hx-tl-title-wrap { display: flex; align-items: center; gap: 7px; }
.hx-tl-ico { width: 15px; height: 15px; color: var(--mut); flex: none; }
.hx-tl-head .hx-ins-title { margin-bottom: 0; }
.hx-tl-clear { appearance: none; cursor: pointer; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--brand); padding: 0; }
.hx-tl-clear:hover { color: var(--brand-d); text-decoration: underline; }
/* Año: separador visual, no botón */
.hx-tl-yearlbl { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint, #94a3b8); padding: 12px 6px 4px; }
/* Fila de mes: nombre + conteo legible + chevron */
.hx-tl-row { appearance: none; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; background: none; font: inherit; padding: 9px 10px 9px 8px; transition: background var(--t); }
.hx-tl-row:hover { background: var(--bg); }
.hx-tl-row.is-on { background: var(--brand-50); }
.hx-tl-m { flex: 1; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.hx-tl-row.is-on .hx-tl-m { color: var(--brand-d); font-weight: 600; }
.hx-tl-count { flex: none; font-size: 12px; font-weight: 500; color: var(--mut); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-tl-row.is-on .hx-tl-count { color: var(--brand-d); }
.hx-tl-count--uf { font-weight: 700; color: var(--win-d, #15803d); }
.hx-tl-y { font-weight: 400; color: var(--faint, #94a3b8); margin-left: 4px; }
.hx-tl-chev { width: 14px; height: 14px; flex: none; color: var(--faint, #94a3b8); }

/* Banner del período filtrado (en el canvas, modo Archivo) */
.hx-period-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 14px; background: var(--brand-50); border: 1px solid var(--brand); border-radius: 11px; }
.hx-period-lbl { font-size: 14px; font-weight: 700; color: var(--brand-d); }
.hx-period-n { font-size: 12.5px; color: var(--brand-d); opacity: .8; }
.hx-period-clear { margin-left: auto; appearance: none; cursor: pointer; border: 1px solid var(--brand); background: #fff; color: var(--brand-d); font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 8px; transition: all var(--t); }
.hx-period-clear:hover { background: var(--brand); color: #fff; }

/* ── EMPTY / ERROR / SKELETON ── */
.hx-empty { text-align: center; padding: 64px 24px; }
.hx-empty-ic { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--faint, #94a3b8); }
.hx-empty-ic svg { width: 52px; height: 52px; }
.hx-empty-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.hx-empty-s { font-size: 13px; color: var(--mut); margin-top: 6px; max-width: 340px; margin-left: auto; margin-right: auto; }
.hx-errbox { text-align: center; padding: 48px 24px; }
.hx-errbox-t { font-size: 15px; font-weight: 700; color: var(--ink); }
.hx-errbox-s { font-size: 13px; color: var(--err); margin: 6px 0 16px; }

.hx-skel { cursor: default; }
.hx-skel:hover { border-color: var(--line); background: var(--card); }
.hx-skel-box, .hx-skel-line { background: linear-gradient(90deg, #f1f5f9 25%, #e9eef5 50%, #f1f5f9 75%); background-size: 200% 100%; animation: hxshimmer 1.3s infinite; border-radius: 6px; }
.hx-skel-line { height: 11px; margin-bottom: 8px; }
@keyframes hxshimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── SNACKBAR ── */
.hx-snack { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); z-index: 500; display: flex; align-items: center; gap: 12px; background: #0f172a; color: #fff; border-radius: 12px; padding: 12px 14px 12px 16px; box-shadow: 0 16px 40px rgba(15,23,42,.32); opacity: 0; transition: opacity .2s, transform .2s; max-width: 440px; }
.hx-snack.is-in { opacity: 1; transform: translate(-50%, 0); }
.hx-snack.is-err { background: var(--err); }
.hx-snack-ic { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); border-radius: 50%; font-size: 12px; font-weight: 700; }
.hx-snack-msg { font-size: 13.5px; font-weight: 500; }
.hx-snack-undo { appearance: none; cursor: pointer; border: 0; background: none; color: #7cc4ff; font: inherit; font-size: 13.5px; font-weight: 700; padding: 4px 6px; margin-left: 4px; }
.hx-snack-undo:hover { color: #a9d8ff; }

/* ── MODALES (alias / detalle) — sobre la base mx-goal ── */
.hx-modal-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.hx-cta-inline { padding: 11px 20px; }
.hx-btn-ghost { appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 10px; transition: all var(--t); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.hx-btn-ghost:hover { border-color: #cbd5e1; background: var(--bg); }
.hx-btn-ghost:disabled { opacity: .5; cursor: not-allowed; }
.hx-btn-danger { color: var(--err); }
.hx-btn-danger:hover { border-color: var(--err); background: var(--err-50); }
.hx-btn-danger.is-armed { background: var(--err); color: #fff; border-color: var(--err); }

.hx-detail { max-width: 460px; }
/* Navegación entre cotizaciones (flechas) en el header del detalle */
.hx-det-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.hx-det-count { font-size: 11px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; margin-right: 4px; flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-det-arrow { appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line); background: var(--card); color: var(--mut); border-radius: 8px; transition: all var(--t); }
.hx-det-arrow:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.hx-det-arrow:disabled { opacity: .35; cursor: default; }
.hx-det-arrow:disabled:hover { border-color: var(--line); color: var(--mut); background: var(--card); }
.hx-det-arrow svg { width: 16px; height: 16px; }
.hx-detail-channel { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px; flex: none; }
.hx-detail-channel.is-mail { background: var(--brand-50); color: var(--brand-d); }
.hx-detail-channel.is-wa { background: #dcfce7; color: #15803d; }
.hx-detail-body { gap: 14px; }
.hx-detail-status { display: flex; align-items: center; gap: 10px; }
.hx-detail-act { font-size: 13px; color: var(--mut); font-weight: 500; }
.hx-detail-meta { font-size: 13px; color: var(--ink); }
.hx-detail-seclbl { font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--mut); }
.hx-plans { display: flex; flex-direction: column; gap: 8px; }
.hx-plan { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow: hidden; }
/* Barra lateral de color isapre — reemplaza el punto ambiguo */
.hx-plan-isapre { width: 3px; align-self: stretch; border-radius: 999px; flex: none; }
.hx-plan-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-plan-txt b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.hx-plan-txt span { font-size: 12px; color: var(--mut); }
.hx-plan-uf { font-size: 13px; font-weight: 700; color: var(--ink); flex: none; font-variant-numeric: tabular-nums; }
/* ── Estado del envío: ícono neutro + texto en una sola línea (sin punto) ── */
.hx-detail-signal { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.hx-signal-ico { width: 16px; height: 16px; flex: none; opacity: .8; }
.hx-signal-txt { font-size: 13.5px; font-weight: 600; }
.hx-signal--open { color: var(--ink); }
.hx-signal--wait { color: var(--mut); }
.hx-signal--bad  { color: var(--err); }

/* ── Acciones: utilidades como lista uniforme + un solo CTA fuerte ── */
.hx-detail-acts { display: flex; flex-direction: column; gap: 12px; }
.hx-act-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.hx-act-item { appearance: none; cursor: pointer; display: flex; align-items: center; gap: 11px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; padding: 13px 14px; text-align: left; width: 100%; transition: background var(--t); }
.hx-act-item:first-child { border-top: 0; }
.hx-act-item:hover { background: var(--bg); }
.hx-act-item:disabled { opacity: .5; cursor: not-allowed; }
.hx-act-ico { width: 18px; height: 18px; flex: none; color: var(--mut); }
.hx-act-lbl { flex: 1; min-width: 0; }
.hx-act-go { width: 16px; height: 16px; flex: none; color: var(--faint, #94a3b8); }
/* P2 · fila "pospuesto" en el detalle (no es botón; lleva "Reactivar") */
.hx-act-snoozed { cursor: default; }
.hx-act-snoozed:hover { background: none; }
.hx-act-snoozed .hx-act-ico { color: #d97706; }
.hx-snooze-react { appearance: none; cursor: pointer; flex: none; border: 1px solid var(--line); background: var(--card); color: var(--mut); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; transition: all var(--t); }
.hx-snooze-react:hover { border-color: var(--brand); color: var(--brand); }
/* P2 · filtro Pospuestos (neutro, como Perdidos) */
.hx-filter--snz .hx-filter-lbl { color: var(--mut); font-weight: 600; }
.hx-filter--snz .hx-filter-ico { color: #d97706; }
.hx-filter--snz:hover { background: var(--bg); }
.hx-filter--snz.is-on { background: #fffbeb; }
.hx-filter--snz.is-on .hx-filter-lbl { color: var(--ink); }
.hx-filter--snz.is-on .hx-filter-n { background: color-mix(in srgb, #d97706 14%, #fff); color: var(--ink); }
/* P2 · "Vuelve el X" en la card de Pospuestos */
.hx-snz-when { font-size: 12px; color: var(--mut); white-space: nowrap; align-self: center; }
/* P4 · nota del lead en el detalle */
.hx-detnote { margin-top: 14px; }
.hx-detnote-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.hx-detnote-ic { width: 15px; height: 15px; color: var(--mut); }
.hx-detnote-lbl { font-size: 12.5px; font-weight: 600; color: var(--mut); flex: 1; min-width: 0; }
.hx-detnote-saved { font-size: 11.5px; color: var(--win-d, #15803d); font-weight: 600; }
.hx-detnote-ta { width: 100%; box-sizing: border-box; resize: vertical; min-height: 58px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.45; padding: 10px 12px; transition: border-color var(--t); }
.hx-detnote-ta:focus { outline: none; border-color: var(--brand); }
.hx-detnote-ta::placeholder { color: var(--faint, #94a3b8); }
/* P4 · indicador de nota en la card */
.hx-cnote-ind { display: inline-flex; align-items: center; color: var(--faint, #94a3b8); margin-right: 5px; vertical-align: -2px; }
.hx-cnote-ind svg { width: 13px; height: 13px; }

/* "Seguimiento asistido" mágico: ícono morado IA + el texto azul→morado que
   respira con suavidad. Un solo gradiente, sin banda de luz ni glow. */
.hx-act-magic .hx-act-ico { color: #7c3aed; }
.hx-act-magic .hx-act-lbl {
  font-weight: 600;
  background: linear-gradient(100deg, #0d99ff 0%, #7c3aed 44%, #8b5cf6 50%, #7c3aed 56%, #0d99ff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hxSheen 6s ease-in-out infinite;
}
@keyframes hxSheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .hx-act-magic .hx-act-lbl { animation: none; background: linear-gradient(90deg, var(--brand), #7c3aed); -webkit-background-clip: text; background-clip: text; }
}

/* Reenviar (failed/bounced): item con acento de marca + formulario inline */
.hx-act-resend .hx-act-ico { color: var(--brand); }
.hx-act-resend .hx-act-lbl { color: var(--brand); font-weight: 600; }
.hx-resend-zone { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.hx-resend-zone[hidden] { display: none; }  /* el display:flex de arriba pisa al atributo hidden si no lo blindamos */
.hx-resend-hint { font-size: 12.5px; line-height: 1.45; color: var(--mut); }
.hx-resend-field { display: flex; gap: 8px; }
.hx-resend-input { flex: 1; min-width: 0; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; padding: 10px 12px; transition: border-color var(--t); }
.hx-resend-input:focus { outline: none; border-color: var(--brand); }
.hx-resend-input::placeholder { color: var(--faint, #94a3b8); }
.hx-resend-go { appearance: none; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 100px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 0 16px; transition: background var(--t); }
.hx-resend-go:hover { background: var(--brand-d); }
.hx-resend-go:disabled { opacity: .6; cursor: not-allowed; }
.hx-resend-err { font-size: 12.5px; line-height: 1.45; color: var(--err); }

/* ── Zona de borrado ── */
.hx-detail-delete { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hx-det-del-btn { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--err); padding: 0; opacity: .65; transition: opacity var(--t); }
.hx-det-del-btn:hover { opacity: 1; }
.hx-det-del-ask { font-size: 13px; color: var(--ink); font-weight: 500; text-align: center; }
.hx-det-del-btns { display: flex; gap: 8px; width: 100%; }
.hx-det-del-confirm { appearance: none; cursor: pointer; flex: 1; border: 1px solid var(--err); background: var(--err); color: #fff; font: inherit; font-size: 13px; font-weight: 600; padding: 8px; border-radius: 10px; transition: opacity var(--t); }
.hx-det-del-confirm:hover { opacity: .88; }
.hx-det-del-confirm:disabled { opacity: .5; cursor: not-allowed; }
.hx-det-del-cancel { appearance: none; cursor: pointer; flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; padding: 8px; border-radius: 10px; transition: all var(--t); }
.hx-det-del-cancel:hover { border-color: #cbd5e1; background: var(--bg); }

/* Íconos Lucide dentro del modal de detalle */
.hx-det-nav .hx-det-arrow i[data-lucide], .hx-det-nav .hx-det-arrow svg { width: 16px; height: 16px; }
.mx-goal-x i[data-lucide], .mx-goal-x svg { width: 18px; height: 18px; }
.hx-sold-cta i[data-lucide]:first-child, .hx-sold-cta svg:first-child { width: 20px; height: 20px; flex: none; stroke: #fff; }
.hx-sold-cta-go { width: 16px; height: 16px; flex: none; opacity: .8; }
.hx-sold-cta-go[data-lucide] ~ * { display: none; } /* evitar doble render */
.hx-sold-banner i[data-lucide], .hx-sold-banner svg { width: 18px; height: 18px; flex: none; }

/* Responsive: en canvas angosto el sheet/insights ya colapsan por el grid del shell */
@media (max-width: 1180px) {
  .hx-scroll { padding: 20px 18px 48px; }
}

/* ============================================================
   TAB NOTAS  (namespace nt-*)
   Sheet (buscador + filtros + lista) · Canvas (editor) · Insights
   (recordatorios + objeciones). Estrella: dictado por voz + IA.
   ============================================================ */

/* ── SHEET ── */
.sheet.nt-sheet { padding: 0; }
.nt-shead { padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.nt-shead-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.nt-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.nt-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.nt-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; line-height: 1;
  padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.nt-btn:hover { border-color: #cbd5e1; }
.nt-btn:active { transform: scale(.98); }
.nt-btn .nt-ico { width: 16px; height: 16px; }
.nt-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.nt-btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.nt-btn-call { background: #fff7ed; border-color: #fed7aa; color: #c2410c; flex: 1; justify-content: center; }
.nt-btn-call:hover { background: #ffedd5; border-color: #fdba74; }

.nt-searchwrap { position: relative; margin-bottom: 12px; }
.nt-search-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #94a3b8; pointer-events: none; }
.nt-search {
  width: 100%; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px 9px 33px; outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.nt-search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.14); }
.nt-search::placeholder { color: #94a3b8; }

.nt-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--mut);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 5px 11px; transition: all var(--t);
}
.nt-chip:hover { border-color: #cbd5e1; color: var(--ink); }
.nt-chip.is-active { background: var(--brand-50); border-color: var(--brand); color: var(--brand-d); }
.nt-chip-n { font-size: 10px; font-weight: 700; background: color-mix(in srgb, var(--brand) 16%, #fff); color: var(--brand-d); border-radius: 999px; min-width: 15px; padding: 0 4px; text-align: center; }
.nt-chip.is-active .nt-chip-n { background: color-mix(in srgb, var(--brand) 28%, #fff); }

/* ── LISTA ── */
.nt-list { flex: 1; overflow-y: auto; padding: 8px; }
.nt-empty-list { padding: 32px 18px; text-align: center; font-size: 13px; color: var(--mut); line-height: 1.5; }
.nt-item {
  padding: 11px 12px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; position: relative; transition: background var(--t), border-color var(--t);
}
/* Separador muy sutil entre notas; se borra al resaltar (hover/activa). */
.nt-item:not(:last-child)::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 1px; background: var(--line); opacity: .5; pointer-events: none;
}
.nt-item:hover::after, .nt-item.is-active::after { opacity: 0; }
.nt-item:hover { background: var(--bg); }
.nt-item.is-active { background: var(--brand-50); border-color: #bfdbfe; }
.nt-item-top { display: flex; align-items: center; gap: 6px; }
.nt-pin { color: var(--brand); display: inline-flex; flex: none; }
.nt-pin .nt-ico { width: 13px; height: 13px; }
.nt-item-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-item-snip { font-size: 12.5px; color: var(--mut); line-height: 1.4; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-item-meta { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.nt-tipo { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.nt-tipo-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.nt-badge-voz, .nt-badge-rec { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--mut); }
.nt-badge-rec { color: var(--warn); }
.nt-mini-ic { width: 12px; height: 12px; }
.nt-item-date { margin-left: auto; font-size: 11px; color: #94a3b8; flex: none; }

/* ── CANVAS / EDITOR ── */
.canvas.nt-canvas { padding: 0; }
.nt-editor-host { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.nt-empty { margin: auto; max-width: 420px; text-align: center; padding: 40px 24px; }
.nt-empty-ic { width: 52px; height: 52px; margin: 0 auto 16px; color: var(--brand); background: var(--brand-50); border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.nt-empty-ic .nt-ico { width: 26px; height: 26px; }
.nt-empty h3 { font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 8px; letter-spacing: -.01em; }
.nt-empty p { font-size: 13.5px; color: var(--mut); line-height: 1.55; margin-bottom: 20px; }
.nt-empty-actions { display: flex; gap: 10px; justify-content: center; }

.nt-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.nt-etoolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--card);
  flex-wrap: wrap;
}
.nt-tipo-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 1px; }
.nt-tipo-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--mut); padding: 5px 11px; border-radius: 7px; transition: all var(--t); }
.nt-tipo-opt:hover { color: var(--ink); }
.nt-tipo-opt.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.nt-etools { display: flex; align-items: center; gap: 6px; }
.nt-tool {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--mut); padding: 7px 10px; border-radius: 8px; border: 1px solid transparent;
  transition: all var(--t);
}
.nt-tool:hover { background: var(--bg); color: var(--ink); }
.nt-tool .nt-ico { width: 15px; height: 15px; }
.nt-tool.nt-icoonly { padding: 7px; }
.nt-tool.nt-icoonly.is-on { color: var(--brand); background: var(--brand-50); }
.nt-tool.nt-danger:hover { color: var(--err); background: var(--err-50); }
.nt-tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.nt-tool-ai { color: var(--brand-d); }
.nt-tool-ai:hover { background: var(--brand-50); }
.nt-tool-ai.is-loading { opacity: .7; cursor: default; }
/* Acción asistida por IA: SOLO el ícono en morado (acento sutil y moderno);
   el texto queda normal, sin shimmer, para que los dos botones no compitan. */
.nt-tool-magic .nt-ico, .nt-tool-magic svg { color: #7c3aed; }
.nt-tool-magic.is-loading { opacity: .7; cursor: default; }
.nt-tool.is-recording { color: var(--err); background: var(--err-50); }
.nt-tool.is-recording .nt-ico { animation: ntPulse 1.1s ease-in-out infinite; }
@keyframes ntPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.nt-ebody { flex: 1; overflow-y: auto; padding: 22px 28px 40px; max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; }
.nt-etitle { -webkit-appearance: none; appearance: none; background: transparent; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); border: none; outline: none; width: 100%; padding: 4px 0 8px; }
.nt-etitle::placeholder { color: #cbd5e1; }
.nt-flabel { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); margin: 14px 0 6px; }
.nt-etext {
  font-family: inherit; font-size: 15px; line-height: 1.6; color: var(--ink);
  border: none; outline: none; resize: none; width: 100%; min-height: 220px;
  padding: 4px 0; background: transparent;
}
.nt-etext::placeholder { color: #cbd5e1; }
.nt-etext-obj { min-height: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.nt-etext-sm { min-height: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); font-size: 14px; }

.nt-anclas { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.nt-anclas-empty { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #94a3b8; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px; }
.nt-ancla-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 10px; }

.nt-recs { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.nt-recs-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--mut); margin-bottom: 10px; }
.nt-rec { display: flex; align-items: center; gap: 9px; padding: 7px 0; }
.nt-rec.is-done .nt-rec-txt { text-decoration: line-through; color: #94a3b8; }
.nt-rec-check { width: 19px; height: 19px; flex: none; border: 1.6px solid #cbd5e1; border-radius: 6px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: all var(--t); }
.nt-rec-check:hover { border-color: var(--brand); }
.nt-rec.is-done .nt-rec-check { background: var(--win); border-color: var(--win); }
.nt-rec-check .nt-ico { width: 12px; height: 12px; }
.nt-rec-txt { flex: 1; font-size: 14px; color: var(--ink); }
.nt-rec-date { font-size: 12px; font-weight: 600; color: var(--mut); flex: none; }
.nt-rec-date.is-today { color: var(--brand-d); }
.nt-rec-date.is-overdue { color: var(--err); }
.nt-rec-del { color: #cbd5e1; flex: none; display: inline-flex; padding: 2px; transition: color var(--t); }
.nt-rec-del:hover { color: var(--err); }
.nt-rec-del .nt-ico { width: 14px; height: 14px; }
.nt-rec-add { display: flex; gap: 7px; align-items: stretch; margin-top: 8px; }
.nt-rec-in { flex: 1; min-width: 0; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; outline: none; }
.nt-rec-in:focus { border-color: var(--brand); }
.nt-rec-datewrap { position: relative; display: flex; align-items: center; flex: none; }
.nt-rec-datetxt { font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--mut); border: 1px solid var(--line); border-radius: 8px; padding: 0 34px 0 10px; height: 100%; min-width: 118px; outline: none; background: var(--card); }
.nt-rec-datetxt:focus { border-color: var(--brand); color: var(--ink); }
.nt-rec-datetxt.is-invalid { border-color: var(--err); }
.nt-rec-datetxt::placeholder { color: #c0c8d4; }
.nt-rec-datecal { position: absolute; right: 0; top: 0; bottom: 0; width: 34px; display: flex; align-items: center; justify-content: center; color: var(--mut); cursor: pointer; }
.nt-rec-datecal svg { width: 15px; height: 15px; pointer-events: none; }
.nt-rec-datecal:hover { color: var(--brand); }
.nt-rec-addbtn { flex: none; width: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; transition: all var(--t); }
.nt-rec-addbtn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.nt-rec-addbtn .nt-ico { width: 16px; height: 16px; }
.nt-rec-datechips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.nt-date-chip { appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--mut); font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; transition: all var(--t); }
.nt-date-chip:hover { border-color: #cbd5e1; color: var(--ink); }
.nt-date-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.nt-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.nt-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 5px 3px 10px; }
.nt-tag button { display: inline-flex; color: #cbd5e1; padding: 1px; }
.nt-tag button:hover { color: var(--err); }
.nt-tag button .nt-ico { width: 12px; height: 12px; }
.nt-tag-in { font-size: 12.5px; border: none; outline: none; padding: 4px 6px; min-width: 90px; background: transparent; }

.nt-efoot { display: flex; align-items: center; gap: 7px; padding: 10px 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mut); background: var(--card); }
.nt-foot-tipo { font-weight: 700; }
.nt-foot-dot { color: #cbd5e1; }
.nt-save-ind { margin-left: auto; color: var(--win); font-weight: 600; }

/* ── INSIGHTS ── */
.nt-insights { padding: 18px 16px; }
.nt-ins-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.nt-ins-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.nt-ins-title .nt-mini-ic { width: 15px; height: 15px; color: var(--brand); }
.nt-ins-empty { font-size: 12.5px; color: var(--mut); line-height: 1.5; }
/* Diálogo de confirmación de Notas (descartar nota vacía) */
.nt-confirm-ov { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,23,42,.34); }
.nt-confirm { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 18px; }
.nt-confirm-tx strong { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.nt-confirm-tx span { display: block; font-size: 13.5px; color: var(--mut); line-height: 1.55; }
.nt-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.nt-confirm-keep, .nt-confirm-yes { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; height: 38px; padding: 0 16px; border-radius: 10px; transition: background var(--t), border-color var(--t); }
.nt-confirm-keep { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.nt-confirm-keep:hover { background: var(--bg); border-color: #cbd5e1; }
.nt-confirm-yes { background: var(--brand); border: 0; color: #fff; padding: 0 18px; }
.nt-confirm-yes:hover { background: var(--brand-d); }
.nt-confirm-yes.nt-confirm-danger { background: var(--err, #dc2626); }
.nt-confirm-yes.nt-confirm-danger:hover { background: #b91c1c; }
.nt-ins-rec { display: flex; align-items: flex-start; gap: 9px; padding: 8px 6px; border-radius: 9px; cursor: pointer; transition: background var(--t); }
.nt-ins-rec:hover { background: var(--card); }
.nt-ins-rec .nt-rec-check { margin-top: 1px; }
.nt-ins-rec-main { flex: 1; min-width: 0; }
.nt-ins-rec-txt { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.nt-ins-rec-sub { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--mut); margin-top: 2px; }
.nt-ins-rec-sub > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-ins-rec-when { margin-left: auto; flex: none; font-weight: 600; }
.nt-ins-rec-when.is-today { color: var(--brand-d); }
.nt-ins-rec-when.is-overdue { color: var(--err); }
.nt-ins-obj { display: block; width: 100%; text-align: left; font-size: 12.5px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; margin-bottom: 6px; line-height: 1.4; transition: border-color var(--t); }
.nt-ins-obj:hover { border-color: var(--warn); }
.nt-ins-add { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--brand-d); padding: 6px 4px; margin-top: 4px; }
.nt-ins-add:hover { text-decoration: underline; }
.nt-ins-add .nt-mini-ic { width: 13px; height: 13px; }

/* ── Menú plantillas ── */
.nt-menu { position: fixed; z-index: 9500; background: var(--card); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 8px 28px rgba(15,23,42,.14); padding: 5px; min-width: 200px; }
.nt-menu-item { display: block; width: 100%; text-align: left; font-size: 13px; color: var(--ink); padding: 9px 11px; border-radius: 7px; transition: background var(--t); }
.nt-menu-item:hover { background: var(--bg); }

/* ── Toast ── */
.nt-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; padding: 11px 18px; border-radius: 11px; box-shadow: 0 8px 28px rgba(15,23,42,.22); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9600; }
.nt-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   TAB NOTAS · v2 — capa de claridad (pensada para 50+ y primer
   contacto con IA). Lenguaje humano, texto grande, cero jerga.
   (estas reglas van después → ganan a las de arriba)
   ============================================================ */

/* Encabezado del sheet */
.nt-help-link { font-size: 12.5px; font-weight: 600; color: var(--brand-d); padding: 2px 0; }
.nt-help-link:hover { text-decoration: underline; }
.nt-shead { padding: 18px 16px 14px; }
.nt-title { font-size: 20px; }

/* Acciones del sheet — "Dictar llamada" es el héroe (naranjo lleno) */
.nt-btn { font-size: 13.5px; padding: 11px 14px; border-radius: 11px; }
.nt-btn-call { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); border-color: #ea580c; color: #fff; flex: 1.4; justify-content: center; }
.nt-btn-call:hover { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); border-color: #c2410c; }
.nt-btn-call .nt-ico { width: 17px; height: 17px; }
.nt-actions .nt-btn:not(.nt-btn-call) { flex: 1; justify-content: center; }

.nt-chip { font-size: 12.5px; padding: 6px 12px; }

/* Tipo como etiqueta tranquila (NO selector) */
.nt-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; }
.nt-kind-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.nt-kind-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }

/* ── Bienvenida que enseña ── */
.nt-welcome { margin: 0 auto; max-width: 640px; width: 100%; padding: 46px 32px 56px; }
.nt-wel-head h2 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin-bottom: 10px; }
.nt-wel-head p { font-size: 15.5px; line-height: 1.55; color: var(--mut); margin-bottom: 26px; }
.nt-wel-cards { display: flex; flex-direction: column; gap: 12px; }
.nt-wel-card {
  display: flex; align-items: flex-start; gap: 16px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.nt-wel-card:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(15,23,42,.06); }
.nt-wel-ic { flex: none; width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.nt-wel-ic .nt-ico { width: 24px; height: 24px; }
.nt-wel-tx { display: flex; flex-direction: column; gap: 4px; }
.nt-wel-tx strong { font-size: 16.5px; font-weight: 700; color: var(--ink); }
.nt-wel-body { font-size: 14px; line-height: 1.5; color: var(--mut); }
.nt-wel-cta { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--brand-d); margin-top: 5px; }
.nt-wel-cta .nt-mini-ic { width: 14px; height: 14px; transition: transform var(--t); }
.nt-wel-card:hover .nt-wel-cta .nt-mini-ic { transform: translateX(3px); }
.nt-wel-foot { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #94a3b8; margin-top: 22px; }

/* ── Toolbar editor ── */
.nt-etoolbar { padding: 14px 30px; }
.nt-tool { font-size: 13px; padding: 8px 12px; }
.nt-tool-mic { border: 1px solid var(--line); }
.nt-tool-mic:hover { border-color: #cbd5e1; }
.nt-tool-ai { color: #fff; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%); border: 1px solid var(--brand-d); }
.nt-tool-ai:hover { background: linear-gradient(135deg, var(--brand-d) 0%, #0a6cba 100%); color: #fff; }
.nt-tool-ai.is-loading { opacity: .75; }

/* ── Cuerpo editor (texto más grande para 50+) ── */
.nt-ebody { padding: 26px 30px 48px; max-width: 760px; }
.nt-etitle { font-size: 26px; padding: 4px 0 10px; }
.nt-etext { font-size: 15px; line-height: 1.65; min-height: 260px; color: #334155; }
.nt-etext-box { min-height: 150px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg); font-size: 16px; line-height: 1.6; }

/* ── Pista contextual ── */
.nt-hint { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--brand-d); background: var(--brand-50); border-radius: 10px; padding: 10px 13px; margin-top: 14px; }
.nt-hint .nt-mini-ic { width: 15px; height: 15px; flex: none; }
.nt-hint b { font-weight: 700; }

/* ── Banner de dictado en vivo ── */
/* Guarda [hidden]: las reglas display:flex de abajo pisan el atributo hidden
   (UA stylesheet) por especificidad. Sin esto, banner y prompt salen siempre. */
.nt-dict[hidden], .nt-aiprompt[hidden] { display: none !important; }
.nt-dict { display: flex; align-items: center; gap: 11px; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 12px; padding: 12px 15px; margin: 6px 0 14px; }
.nt-dict-dot { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; flex: none; animation: ntPulse 1s ease-in-out infinite; }
.nt-dict-tx { flex: 1; font-size: 14px; font-weight: 500; color: #9f1239; }
.nt-dict-stop { font-size: 13.5px; font-weight: 700; color: #fff; background: #e11d48; border-radius: 9px; padding: 8px 18px; flex: none; }
.nt-dict-stop:hover { background: #be123c; }

/* ── Sugerencia de IA tras dictar ── */
.nt-aiprompt { display: flex; align-items: flex-start; gap: 13px; background: var(--brand-50); border: 1px solid #bfdbfe; border-radius: 14px; padding: 16px 18px; margin-top: 18px; }
.nt-aip-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.nt-aip-ic .nt-ico { width: 20px; height: 20px; }
.nt-aip-tx { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nt-aip-tx strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.nt-aip-tx span { font-size: 13.5px; line-height: 1.5; color: var(--mut); }
.nt-aip-actions { display: flex; flex-direction: column; gap: 7px; flex: none; }
.nt-aip-yes { font-size: 13.5px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 9px; padding: 9px 16px; white-space: nowrap; }
.nt-aip-yes:hover { background: var(--brand-d); }
.nt-aip-no { font-size: 13px; font-weight: 600; color: var(--mut); padding: 6px; }
.nt-aip-no:hover { color: var(--ink); }

/* ── Recordatorios ── */
.nt-recs-head { font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.nt-rec-txt { font-size: 14.5px; }
.nt-recs-foot { font-size: 12.5px; color: #94a3b8; margin-top: 8px; }

/* ── Insights ── */
.nt-ins-title { font-size: 13.5px; }
.nt-ins-empty { font-size: 13px; line-height: 1.55; }

/* ============================================================
   TAB NOTAS · v3 — pasada de consistencia (botones, iconos,
   tamaños) alineada al resto de la app. Va al final → gana.
   ============================================================ */

/* RAÍZ del problema: el reset global no limpia el chrome nativo del
   <button> (fondo gris + borde/sombra). Cada botón de la app hace
   appearance:none. Lo aplicamos a todos los botones de Notas. */
.nt-sheet button, .nt-canvas button, .nt-insights button {
  -webkit-appearance: none; appearance: none;
}

/* Escala de iconos lucide consistente por contexto */
.nt-ico { width: 16px; height: 16px; flex: none; stroke-width: 2; }
.nt-mini-ic { width: 14px; height: 14px; }

/* ── Encabezado del sheet ── */
.nt-help-link {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 0; padding: 4px 2px;
  font-size: 12.5px; font-weight: 600; color: var(--mut);
  transition: color var(--t);
}
.nt-help-link:hover { color: var(--brand-d); }
.nt-help-link .nt-mini-ic { width: 14px; height: 14px; }

/* ── Acciones del sheet ── */
.nt-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 11px 14px; border-radius: 11px; transition: background var(--t), border-color var(--t), transform var(--t); }
.nt-btn:hover { border-color: #cbd5e1; background: var(--bg); }
.nt-btn:active { transform: scale(.985); }
.nt-btn .nt-ico { width: 16px; height: 16px; }
.nt-btn-call { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); border-color: #ea580c; color: #fff; flex: 1.4; justify-content: center; }
.nt-btn-call:hover { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); border-color: #c2410c; }
.nt-btn-call .nt-ico { width: 17px; height: 17px; }
.nt-actions .nt-btn:not(.nt-btn-call) { flex: 1; justify-content: center; }

/* ── Toolbar del editor ── */
.nt-tool {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid transparent; color: var(--mut);
  font-size: 13px; font-weight: 600; padding: 8px 11px; border-radius: 9px;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.nt-tool:hover { background: var(--bg); color: var(--ink); }
.nt-tool .nt-ico { width: 16px; height: 16px; }
/* "Dictar" = botón secundario claro (mismo lenguaje que .hx-btn-ghost) */
.nt-tool-mic { background: var(--card); border-color: var(--line); }
.nt-tool-mic:hover { background: var(--bg); border-color: #cbd5e1; color: var(--ink); }
/* "Ordenar" y "Mensaje asistido" = misma cajita que "Dictar" (el ícono morado
   de .nt-tool-magic se mantiene; ver más arriba). */
.nt-tool-magic { background: var(--card); border-color: var(--line); }
.nt-tool-magic:hover { background: var(--bg); border-color: #cbd5e1; color: var(--ink); }
/* "Ordenar con IA" = primario */
.nt-tool-ai { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%); border-color: var(--brand-d); color: #fff; }
.nt-tool-ai:hover { background: linear-gradient(135deg, var(--brand-d) 0%, #0a6cba 100%); color: #fff; }
.nt-tool-ai.is-loading { opacity: .75; }
.nt-tool.is-recording { color: var(--err); background: var(--err-50); border-color: transparent; }
.nt-tool.is-recording .nt-ico { animation: ntPulse 1.1s ease-in-out infinite; }
/* Botones solo-icono (fijar, archivar, eliminar): el gap mayor del toolbar es
   para separar Dictar/Ordenar/Mensaje; este trío vuelve a ir junto como grupo. */
.nt-icoonly + .nt-icoonly { margin-left: -3px; }
.nt-icoonly { padding: 8px; border-color: transparent; color: var(--mut); }
.nt-icoonly .nt-ico { width: 18px; height: 18px; }
.nt-icoonly:hover { background: var(--bg); color: var(--ink); }
.nt-icoonly.is-on { color: var(--brand); background: var(--brand-50); }
.nt-icoonly.nt-danger:hover { color: var(--err); background: var(--err-50); }
.nt-tool-sep { width: 1px; height: 22px; background: var(--line); margin: 0 5px; align-self: center; }

/* ── Bienvenida: tile de icono con color-mix (igual que las cards de Herramientas) ── */
.nt-wel-ic { color: var(--ic); background: color-mix(in srgb, var(--ic) 12%, transparent); }
.nt-wel-ic .nt-ico { width: 24px; height: 24px; }
.nt-wel-cta { color: var(--ic); }
.nt-wel-cta .nt-mini-ic { width: 15px; height: 15px; }

/* ── Recordatorios: alturas parejas en la fila de agregar ── */
.nt-rec-add { align-items: stretch; }
.nt-rec-in { height: 40px; padding: 0 13px; }
.nt-rec-addbtn { width: 40px; height: 40px; background: var(--card); border: 1px solid var(--line); color: var(--mut); }
.nt-rec-addbtn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.nt-rec-addbtn .nt-ico { width: 17px; height: 17px; }
.nt-rec-del { background: transparent; border: 0; color: #cbd5e1; }
.nt-rec-del:hover { color: var(--err); }
.nt-rec-del .nt-ico { width: 15px; height: 15px; }
.nt-rec-check { background: var(--card); }
.nt-rec-check .nt-ico { width: 13px; height: 13px; }

/* ── Botón "Listo" del dictado ── */
.nt-dict-stop { background: #e11d48; border: 0; box-shadow: none; }
.nt-dict-stop:hover { background: #be123c; }

/* ── Sugerencia IA ── */
.nt-aip-yes { background: var(--brand); border: 0; }
.nt-aip-yes:hover { background: var(--brand-d); }
.nt-aip-no { background: transparent; border: 0; color: var(--mut); }
.nt-aip-no:hover { color: var(--ink); }

/* ── Insights: "Guardar una respuesta" = ghost button claro ── */
.nt-ins-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  background: var(--card); border: 1px solid var(--line); color: var(--brand-d);
  font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: 10px; margin-top: 8px;
  transition: background var(--t), border-color var(--t);
}
.nt-ins-add:hover { background: var(--bg); border-color: #cbd5e1; text-decoration: none; }
.nt-ins-add .nt-mini-ic { width: 14px; height: 14px; }
.nt-ins-obj { background: var(--card); }
.nt-ins-rec .nt-rec-check { background: var(--card); }

/* ── Item de lista: icono de pin a tamaño parejo ── */
.nt-pin .nt-ico { width: 13px; height: 13px; }
.nt-search-ic { width: 16px; height: 16px; }

/* ============================================================
   TAB MI PERFIL  (namespace pf-*) — sincronizado con el móvil.
   Solo canvas (sin rieles): formulario centrado, edición inline.
   ============================================================ */
.canvas.pf-canvas { padding: 0; }
.pf-canvas button { -webkit-appearance: none; appearance: none; }
.pf-ico { width: 16px; height: 16px; flex: none; }
.pf-mini { width: 15px; height: 15px; }

.pf-loading { margin: auto; padding: 60px; color: var(--mut); font-size: 14px; }
.pf-wrap { max-width: 720px; width: 100%; margin: 0 auto; padding: 36px 32px 80px; }

.pf-demo { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 11px 14px; margin-bottom: 24px; }
.pf-demo .pf-mini { color: #d97706; flex: none; }

/* ── Hero ── */
.pf-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; flex-wrap: wrap; }
/* Sin overflow:hidden en el botón: así el badge de cámara NO se recorta.
   La foto y la inicial se redondean por su cuenta (border-radius:50%). */
.pf-avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%); border: 0; flex: none; cursor: pointer; transition: transform var(--t); }
.pf-avatar:hover { transform: scale(1.02); }
.pf-avatar.is-busy { opacity: .6; pointer-events: none; }
.pf-avatar-img { position: absolute; inset: 0; border-radius: 50%; background-size: cover; background-position: center; }
.pf-avatar-fallback { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.pf-avatar.has-photo .pf-avatar-fallback { display: none; }
.pf-avatar-cam { position: absolute; right: -1px; bottom: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center; color: var(--brand-d); transition: background var(--t), color var(--t); }
.pf-avatar:hover .pf-avatar-cam { background: var(--brand); color: #fff; box-shadow: 0 0 0 1px var(--brand); }
.pf-avatar-cam .pf-ico { width: 15px; height: 15px; }
.pf-hero-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-hero-name { font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.pf-hero-email { font-size: 13.5px; color: var(--mut); }
.pf-tier-badge { display: inline-block; align-self: flex-start; margin-top: 5px; font-size: 11.5px; font-weight: 700; color: var(--brand-d); background: var(--brand-50); border: 1px solid #bfdbfe; border-radius: var(--r-pill); padding: 3px 11px; }
.pf-photo-rm { background: transparent; border: 0; color: var(--mut); font-size: 12.5px; font-weight: 600; margin-left: auto; align-self: flex-start; padding: 4px; }
.pf-photo-rm:hover { color: var(--err); }

/* topbar: avatar con foto */
.tb-avatar-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.tb-avatar { position: relative; }
.tb-avatar.has-photo .tb-avatar-txt { display: none; }

/* ── Secciones / cards ── */
.pf-section { margin-bottom: 26px; }
.pf-sec-title { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); margin-bottom: 10px; padding-left: 2px; }
.pf-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pf-hint { font-size: 12.5px; color: var(--mut); line-height: 1.5; margin-top: 9px; padding-left: 2px; }

/* ── Campo (grid: label | input, status debajo) ── */
.pf-field { display: grid; grid-template-columns: 168px 1fr; align-items: center; gap: 3px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pf-card .pf-field:last-child { border-bottom: 0; }
.pf-flabel { grid-column: 1; font-size: 13px; font-weight: 500; color: var(--mut); }
.pf-finput { grid-column: 2; width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; font-size: 14.5px; font-family: inherit; color: var(--ink); background: transparent; outline: none; transition: border-color var(--t), background var(--t), box-shadow var(--t); }
.pf-finput:hover { background: var(--bg); }
.pf-finput:focus { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px rgba(13,153,255,.12); }
.pf-finput::placeholder { color: #cbd5e1; }
.pf-fstatus { grid-column: 2; font-size: 11.5px; font-weight: 600; padding-left: 9px; }
.pf-fstatus:empty { display: none; }
.pf-fstatus.is-saving { color: var(--mut); }
.pf-fstatus.is-saved { color: var(--win); }
.pf-fstatus.is-error { color: var(--err); }

/* readonly */
.pf-field.pf-ro .pf-rovalue { grid-column: 2; font-size: 14.5px; font-weight: 500; color: var(--ink); padding: 7px 0; }

/* correo de respuestas (contact_email): fila + editor inline con código */
.pf-ce .pf-ce-val { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-ce .pf-ce-val .pf-rovalue { grid-column: auto; font-size: 14.5px; font-weight: 500; color: var(--ink); padding: 7px 0; }
.pf-ce-change { border: 1px solid var(--line); background: var(--card); color: var(--brand); font-family: inherit; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 5px 12px; cursor: pointer; transition: border-color var(--t); }
.pf-ce-change:hover { border-color: var(--brand); }
.pf-ce-edit { grid-column: 1 / -1; margin-top: 14px; padding: 16px 0 6px; border-top: 1px solid var(--line); }
.pf-ce-explain { margin: 0 0 12px; font-size: 13px; color: var(--mut); line-height: 1.55; }
.pf-ce-line { display: flex; gap: 8px; margin-bottom: 8px; }
.pf-ce-input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 14.5px; color: var(--ink); background: var(--card); outline: none; transition: border-color var(--t); }
.pf-ce-input:focus { border-color: var(--brand); }
.pf-ce-input::placeholder { color: #cbd5e1; }
.pf-ce-codein { letter-spacing: 4px; font-weight: 600; }
.pf-ce-codein::placeholder { letter-spacing: normal; font-weight: 400; }
.pf-ce-go { border: 0; background: var(--brand); color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.pf-ce-go:disabled { opacity: .55; cursor: default; }
.pf-ce-status { min-height: 18px; font-size: 13px; line-height: 1.4; margin: 2px 0 6px; }
.pf-ce-status.is-error { color: var(--err); }
.pf-ce-status.is-ok { color: var(--win); }
.pf-ce-status.is-saving { color: var(--mut); }
.pf-ce-actions { display: flex; gap: 16px; }
.pf-ce-link { border: 0; background: none; padding: 0; font-family: inherit; font-size: 13px; color: var(--mut); text-decoration: underline; cursor: pointer; }
.pf-ce-link:hover { color: var(--ink); }

/* link row */
.pf-field.pf-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; transition: background var(--t); }
.pf-field.pf-link:hover { background: var(--bg); }
.pf-field.pf-link .pf-flabel { color: var(--ink); font-weight: 600; }
.pf-link-go { color: #94a3b8; }

/* select (isapre) */
.pf-select-btn { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; font-size: 14.5px; font-family: inherit; color: var(--ink); text-align: left; transition: border-color var(--t), background var(--t); }
.pf-select-btn:hover { background: var(--bg); }
.pf-select-val.is-empty { color: #cbd5e1; }
.pf-select-btn .pf-mini { color: var(--mut); flex: none; }

/* ── Zona de cuenta ── */
.pf-danger { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pf-btn-out { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 10px 16px; border-radius: 11px; transition: background var(--t), border-color var(--t); }
.pf-btn-out:hover { background: var(--bg); border-color: #cbd5e1; }
.pf-btn-out .pf-ico { width: 16px; height: 16px; }
.pf-btn-del { background: transparent; border: 0; color: var(--err); font-size: 13px; font-weight: 600; text-decoration: underline; padding: 4px 0; }
.pf-btn-del:hover { opacity: .8; }
.pf-del-hint { font-size: 12px; color: var(--mut); }

/* ── Menú isapre ── */
.pf-menu { position: fixed; z-index: 9500; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(15,23,42,.14); padding: 5px; max-height: 360px; overflow-y: auto; }
.pf-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: transparent; border: 0; font-size: 13.5px; color: var(--ink); padding: 10px 12px; border-radius: 8px; transition: background var(--t); }
.pf-menu-item:hover { background: var(--bg); }
.pf-menu-item.is-active { background: var(--brand-50); color: var(--brand-d); font-weight: 600; }
.pf-menu-item .pf-mini { color: var(--brand-d); flex: none; }

/* Responsive: en canvas angosto, label arriba del input */
@media (max-width: 1180px) {
  .pf-field { grid-template-columns: 1fr; gap: 4px; }
  .pf-flabel, .pf-finput, .pf-fstatus, .pf-rovalue, .pf-select-btn { grid-column: 1; }
}

/* ============================================================
   TAB QUVI IA  (namespace ia-*) — chat conversacional.
   Sheet = historial · Canvas = hilo + composer.
   ============================================================ */
.ia-sheet button, .ia-canvas button { -webkit-appearance: none; appearance: none; }
.ia-ico { width: 16px; height: 16px; flex: none; }
.ia-mini { width: 14px; height: 14px; }

/* ── SHEET (historial) ── */
.sheet.ia-sheet { padding: 0; }
.ia-shead { padding: 16px 14px 10px; border-bottom: 1px solid var(--line); }
.ia-brand { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.ia-brand-ic { width: 17px; height: 17px; color: var(--brand); }
.ia-new { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin: 12px 0 8px; background: var(--brand); border: 0; color: #fff; font-size: 13.5px; font-weight: 600; padding: 10px 12px; border-radius: 11px; transition: background var(--t); }
.ia-new:hover { background: var(--brand-d); }
.ia-new .ia-ico { width: 16px; height: 16px; }
.ia-conv-labelrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px 0; }
.ia-conv-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-sel-toggle { flex: none; background: transparent; border: 0; color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; padding: 3px 4px; border-radius: 6px; transition: background var(--t); }
.ia-sel-toggle:hover { background: var(--brand-50); }
/* Modo selección: checkbox a la izquierda, sin botón de archivar individual. */
.ia-conv-main.ia-conv-main--sel { flex-direction: row; align-items: center; gap: 10px; }
.ia-conv-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ia-check { width: 18px; height: 18px; flex: none; border: 1.5px solid #cbd5e1; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; transition: background var(--t), border-color var(--t); }
.ia-check .ia-ico { width: 12px; height: 12px; }
.ia-conv--sel.is-checked { background: var(--brand-50); }
.ia-conv--sel.is-checked .ia-check { background: var(--brand); border-color: var(--brand); }
.ia-sfooter { flex: none; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ia-sel-archive { flex: 1; background: var(--err); border: 0; color: #fff; font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: 10px; cursor: pointer; transition: background var(--t), opacity var(--t); }
.ia-sel-archive:hover:not(:disabled) { opacity: .9; }
.ia-sel-archive:disabled { background: #e5e7eb; color: #9ca3af; cursor: default; }
.ia-convs { flex: 1; overflow-y: auto; padding: 8px; }
.ia-conv-empty { padding: 24px 14px; text-align: center; font-size: 12.5px; color: var(--mut); line-height: 1.5; }
.ia-conv { display: flex; align-items: center; border-radius: 10px; position: relative; transition: background var(--t); }
/* Separador muy sutil entre conversaciones; se borra al resaltar. */
.ia-conv:not(:last-child)::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0;
  height: 1px; background: var(--line); opacity: .5; pointer-events: none;
}
.ia-conv:hover::after, .ia-conv.is-active::after { opacity: 0; }
.ia-conv:hover { background: var(--bg); }
.ia-conv.is-active { background: var(--brand-50); }
.ia-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; background: transparent; border: 0; text-align: left; padding: 9px 10px; cursor: pointer; }
.ia-conv-title { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-conv.is-active .ia-conv-title { color: var(--brand-d); }
.ia-conv-meta { font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-conv-arch { background: transparent; border: 0; color: #cbd5e1; padding: 8px; opacity: 0; transition: opacity var(--t), color var(--t); flex: none; }
.ia-conv:hover .ia-conv-arch { opacity: 1; }
.ia-conv-arch:hover { color: var(--err); }
.ia-conv-arch .ia-ico { width: 15px; height: 15px; }

/* ── CANVAS (chat) ── */
.canvas.ia-canvas { padding: 0; overflow: hidden; }
.ia-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ia-scroll { flex: 1; overflow-y: auto; }

/* ── Empty state ── */
.ia-empty { max-width: 760px; margin: 0 auto; padding: 40px 32px 24px; }
.ia-welcome { display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; margin-bottom: 24px; }
.ia-welcome-ic { flex: none; display: flex; align-items: center; }
.ia-welcome-ic .ia-ico { width: 21px; height: 21px; }
.ia-welcome-tx { font-size: 15px; line-height: 1.65; color: var(--ink); }
.ia-welcome-tx .ia-p { margin: 0 0 11px; }
.ia-welcome-tx .ia-p:last-child { margin-bottom: 0; }
.ia-cats-hint { font-size: 12.5px; font-weight: 600; color: var(--mut); margin-bottom: 12px; padding-left: 2px; }
.ia-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ia-cat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.ia-cat-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.ia-cat-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.ia-cat-ic .ia-ico { width: 16px; height: 16px; }
.ia-cat-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ia-cat-prompts { display: flex; flex-direction: column; gap: 5px; }
.ia-prompt { display: flex; align-items: center; gap: 8px; justify-content: space-between; width: 100%; text-align: left; background: var(--bg); border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; font-size: 12.5px; color: var(--ink); line-height: 1.35; transition: border-color var(--t), background var(--t); }
.ia-prompt:hover { border-color: var(--brand); background: var(--brand-50); }
.ia-prompt .ia-mini { color: var(--brand); flex: none; opacity: 0; transition: opacity var(--t); }
.ia-prompt:hover .ia-mini { opacity: 1; }

/* ── Hilo de mensajes ── */
.ia-thread { max-width: 760px; margin: 0 auto; padding: 28px 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.ia-msg { display: flex; }
.ia-msg-user { justify-content: flex-end; }
.ia-bubble-user { max-width: 78%; background: var(--brand); color: #fff; font-size: 14.5px; line-height: 1.5; padding: 11px 15px; border-radius: 16px 16px 4px 16px; }
.ia-msg-ai { gap: 12px; }
.ia-ai-av { flex: none; display: flex; align-items: center; margin-top: 3px; }
.ia-ai-av .ia-ico { width: 17px; height: 17px; }
.ia-ai-body { flex: 1; min-width: 0; }
.ia-bubble-ai { font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.ia-bubble-ai .ia-p { margin: 0 0 10px; }
.ia-bubble-ai .ia-p:last-child { margin-bottom: 0; }
.ia-bubble-ai .ia-ul, .ia-bubble-ai .ia-ol { margin: 4px 0 10px; padding-left: 22px; }
.ia-bubble-ai .ia-ul li, .ia-bubble-ai .ia-ol li { margin-bottom: 4px; }
.ia-bubble-ai strong { font-weight: 700; }
.ia-verified { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--win); margin-bottom: 6px; }
.ia-verified .ia-mini { width: 13px; height: 13px; }
.ia-cursor { display: inline-block; width: 7px; height: 15px; background: var(--brand); border-radius: 2px; margin-left: 2px; vertical-align: text-bottom; animation: iaBlink 1s steps(1) infinite; }
@keyframes iaBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: .2; } }
.ia-actions { display: flex; gap: 2px; margin-top: 8px; }
.ia-act { background: transparent; border: 0; color: var(--mut); padding: 6px; border-radius: 7px; transition: background var(--t), color var(--t); }
.ia-act:hover { background: var(--bg); color: var(--ink); }
.ia-act.is-up { color: var(--brand); }
.ia-act.is-down { color: var(--err); }
.ia-act .ia-mini { width: 15px; height: 15px; }
.ia-error-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--err); background: var(--err-50); border-radius: 11px; padding: 10px 13px; max-width: 760px; margin: 0 auto; }
.ia-error-row .ia-mini { flex: none; }

/* ── Composer ── */
.ia-composer-wrap { border-top: 1px solid var(--line); background: var(--card); padding: 12px 32px 14px; }
.ia-composer-wrap > .ia-composer, .ia-pii, .ia-foot { max-width: 760px; margin-left: auto; margin-right: auto; }
.ia-pii { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 11px; margin-bottom: 8px; }
.ia-pii[hidden] { display: none; }
.ia-pii .ia-mini { color: #d97706; flex: none; }
.ia-composer { display: flex; align-items: flex-end; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; transition: border-color var(--t), box-shadow var(--t); }
.ia-composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.12); }
.ia-input { flex: 1; border: 0; outline: 0; resize: none; background: transparent; font-family: inherit; font-size: 14.5px; line-height: 1.5; color: var(--ink); padding: 6px 0; max-height: 200px; }
.ia-input::placeholder { color: #94a3b8; }
.ia-send { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); border: 0; color: #fff; display: flex; align-items: center; justify-content: center; transition: background var(--t), opacity var(--t); }
.ia-send:hover { background: var(--brand-d); }
.ia-send:disabled { background: #cbd5e1; cursor: default; }
.ia-send.is-stop { background: var(--ink); }
.ia-send .ia-ico { width: 18px; height: 18px; }
.ia-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; padding: 0 4px; }
.ia-quota { font-size: 11.5px; color: var(--mut); }
.ia-quota.is-low { color: var(--warn); font-weight: 600; }
.ia-count { font-size: 11.5px; color: #94a3b8; font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) {
  .ia-cats { grid-template-columns: 1fr; }
}

/* ============================================================
   TAB INICIO  (namespace home-*) — el copiloto del día.
   Solo canvas. Orbe IA animado (sin halo de glow) + briefing.
   ============================================================ */
.canvas.home-canvas { padding: 0; }
.home-canvas button { -webkit-appearance: none; appearance: none; }
.home-ico { width: 16px; height: 16px; flex: none; }
.home-mini { width: 14px; height: 14px; }
.home-loading { padding: 60px; text-align: center; color: var(--mut); font-size: 14px; }
.home-wrap { max-width: 860px; width: 100%; margin: 0 auto; padding: 36px 32px 72px; }

/* ── HERO concierge ── */
.home-hero { margin-bottom: 34px; }
.home-hero-row { display: flex; align-items: flex-start; gap: 18px; }
/* Orbe IA: colores que se mezclan como fluido aceitoso (blobs que se
   deforman en tiempos distintos → sin patrón) + un respiro de escala.
   Sin giro, sin logo, sin ícono. Todo contenido en el círculo. */
/* ── Robot QuVi IA — avatar del asistente (reutilizable) ──────────────
   Escalable vía `--rh` (alto de la cabeza); todo lo demás es proporcional,
   así sirve a cualquier tamaño (Inicio, bienvenida de IA, avatar de cada
   respuesta, marca del rail). Cabeza cápsula slate + 2 ojos blancos que
   miran lado a lado y parpadean. CSS puro, sin dependencias.
   El "mirar" va en el wrapper (translateX) y el "parpadear" en cada ojo
   (scaleY) → distintos elementos, sin chocar el transform.
   `.is-static` deja los ojos quietos (para evitar muchos robots animados). */
.qv-robot { --rh: 43px; position: relative; width: calc(var(--rh) * 1.767); height: var(--rh); flex: none; border-radius: 999px; background: linear-gradient(150deg, #2b3a52 0%, #131c2e 100%); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.qv-robot--home { margin-top: 4px; }
.qv-robot-eyes { display: flex; gap: calc(var(--rh) * 0.302); animation: qvRobotLook 6s ease-in-out infinite; }
.qv-robot-eye { width: calc(var(--rh) * 0.233); height: calc(var(--rh) * 0.465); border-radius: 999px; background: #fff; animation: qvRobotBlink 4.6s ease-in-out infinite; }
.qv-robot.is-static .qv-robot-eyes, .qv-robot.is-static .qv-robot-eye { animation: none; }
@keyframes qvRobotLook {
  0%, 18%   { transform: translateX(0); }
  27%, 42%  { transform: translateX(calc(var(--rh) * -0.163)); }
  51%, 66%  { transform: translateX(0); }
  75%, 90%  { transform: translateX(calc(var(--rh) * 0.163)); }
  99%, 100% { transform: translateX(0); }
}
@keyframes qvRobotBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  94%, 96%      { transform: scaleY(.12); }
}
/* ── Variantes de "ánimo" del robot (se eligen al azar en cada carga) ──
   Todas mantienen el parpadeo (en .qv-robot-eye). is-look = default. */
.qv-robot.is-bounce { animation: qvHeadBounce 1.5s ease-in-out infinite; transform-origin: center bottom; }
.qv-robot.is-bounce .qv-robot-eyes { animation: none; }
.qv-robot.is-wiggle { animation: qvHeadWiggle 2.4s ease-in-out infinite; transform-origin: center 72%; }
.qv-robot.is-wiggle .qv-robot-eyes { animation: none; }
.qv-robot.is-scan .qv-robot-eyes { animation: qvEyesScan 3.6s ease-in-out infinite; }
.qv-robot.is-peek .qv-robot-eyes { animation: qvEyesPeek 4.2s ease-in-out infinite; }
@keyframes qvHeadBounce {
  0%, 100% { transform: translateY(0) scaleY(1); }
  42%      { transform: translateY(-6px) scaleY(1.04); }
  58%      { transform: translateY(0) scaleY(.92); }
  70%      { transform: translateY(0) scaleY(1); }
}
@keyframes qvHeadWiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-6deg); }
  75%      { transform: rotate(6deg); }
}
@keyframes qvEyesScan {
  0%, 8%   { transform: translateX(0); }
  16%, 24% { transform: translateX(calc(var(--rh) * -0.19)); }
  32%, 40% { transform: translateX(calc(var(--rh) * 0.19)); }
  48%, 58% { transform: translateX(0); }
}
@keyframes qvEyesPeek {
  0%, 14%  { transform: translate(0, 0); }
  26%, 40% { transform: translate(0, calc(var(--rh) * -0.14)); }
  52%, 66% { transform: translate(calc(var(--rh) * 0.16), 0); }
  78%, 100%{ transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .qv-robot, .qv-robot-eyes, .qv-robot-eye { animation: none !important; } }

.home-hero-tx { flex: 1; min-width: 0; }
/* Indentada para alinear con el saludo (= ancho del robot 60 + gap de la fila 18) */
.home-date { font-size: 12.5px; font-weight: 600; color: var(--mut); margin-bottom: 8px; margin-left: 78px; }
.home-greet { font-size: 28px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); margin: 0 0 8px; }
.home-brief { font-size: 15px; line-height: 1.55; color: var(--ink); margin-bottom: 16px; max-width: 620px; }
.home-brief strong { font-weight: 700; }
.home-ask { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; max-width: 560px; transition: border-color var(--t), box-shadow var(--t); }
.home-ask:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.12); }
.home-ask-ic { width: 17px; height: 17px; color: var(--brand); flex: none; }
.home-ask-in { flex: 1; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 14.5px; color: var(--ink); padding: 8px 0; }
/* placeholder rotativo: fade al cambiar de sugerencia */
.home-ask-in::placeholder { transition: opacity .22s ease; }
.home-ask-in.is-fading::placeholder { opacity: 0; }

/* Confetti de micro-celebración (meta del mes cumplida) */
.home-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9000; overflow: hidden; }
.home-confetti i { position: absolute; top: -6%; width: 8px; height: 13px; border-radius: 2px; animation: homeConfettiFall linear forwards; }
@keyframes homeConfettiFall {
  0%   { transform: translate(0, -10vh) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift, 0), 108vh) rotate(560deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .home-confetti { display: none; } }
.home-ask-in::placeholder { color: #94a3b8; }
.home-ask-go { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); border: 0; color: #fff; display: flex; align-items: center; justify-content: center; transition: background var(--t); }
.home-ask-go:hover { background: var(--brand-d); }
.home-ask-go .home-ico { width: 17px; height: 17px; }

/* ── Secciones ── */
.home-sec { margin-bottom: 28px; }
/* Separador suave entre secciones del Inicio (Tu día · Pulso · Cosecha ·
   Lo que funciona). Las secciones ocultas (display:none) no pintan caja,
   así que no dejan línea fantasma. Separación uniforme de 28px entre todas. */
.home-sec + .home-sec { padding-top: 0; }
.home-sec.home-sec--sep { border-top: 1px solid var(--line); padding-top: 22px; margin-top: -8px; }
.home-sec-h { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); margin-bottom: 12px; padding-left: 2px; }
.home-sec-link { display: inline-flex; align-items: center; gap: 3px; background: transparent; border: 0; color: var(--brand-d); font-size: 11.5px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.home-sec-link:hover { text-decoration: underline; }
.home-sec-link .home-mini { width: 13px; height: 13px; }

/* ── Para hoy ── */
.home-today { display: flex; flex-direction: column; gap: 10px; }
.home-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; transition: border-color var(--t), transform var(--t), box-shadow var(--t); }
.home-card:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,23,42,.05); }
.home-card-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.home-card-ic .home-ico { width: 21px; height: 21px; }
.home-card-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-card-tx strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.home-card-tx span { font-size: 13px; color: var(--mut); line-height: 1.4; }
.home-card-arrow { width: 18px; height: 18px; color: #cbd5e1; flex: none; transition: transform var(--t), color var(--t); }
.home-card:hover .home-card-arrow { color: var(--brand); transform: translateX(3px); }

/* Enlace sencillo "Ver N más": la cola completa vive en Historial → Por seguir. */
.home-more { display: inline-flex; align-self: center; align-items: center; gap: 3px; margin-top: 2px; padding: 4px 6px; background: transparent; border: 0; color: var(--brand-d); font-size: 13px; font-weight: 700; cursor: pointer; }
.home-more:hover { text-decoration: underline; }
.home-more .home-mini { width: 15px; height: 15px; transition: transform var(--t); }
.home-more:hover .home-mini { transform: translateX(2px); }

/* ── Tu día: tarjeta-persona (rankeada, con el porqué y la acción) ── */
.home-lead { position: relative; display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; max-height: 220px; overflow: hidden; transition: max-height .32s ease, opacity .26s ease, margin .32s ease, padding .32s ease, border-color var(--t), box-shadow var(--t); }
.home-lead:hover { border-color: #cbd5e1; box-shadow: 0 6px 18px rgba(15,23,42,.05); }
/* Salida al posponer/descartar: colapsa suave y deja su lugar (sin glow). */
.home-lead.is-leaving { max-height: 0; opacity: 0; margin-top: -10px; padding-top: 0; padding-bottom: 0; border-width: 0; pointer-events: none; }
/* "×" discreta para sacar a alguien de tu día. */
.home-lead-x { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 7px; background: transparent; border: 0; color: #cbd5e1; display: grid; place-items: center; transition: color var(--t), background var(--t); }
.home-lead-x:hover { background: var(--bg); color: var(--mut); }
.home-lead-x .home-ico { width: 16px; height: 16px; }
.home-lead-rank { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #fff1f2; color: #ef4444; font-size: 13px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.home-lead-rank--cold { background: #eef2f7; color: #64748b; }
.home-lead-rank--cold .home-ico { width: 15px; height: 15px; }
/* Renovación / aniversario: verde, distinto de caliente (rojo) y frío (gris). */
.home-lead-rank--reno { background: #ecfdf5; color: #16a34a; }
.home-lead-rank--reno .home-ico { width: 15px; height: 15px; }
.home-reno-empty { font-size: 13.5px; color: var(--mut); line-height: 1.5; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.home-reno-empty strong { color: var(--ink); font-weight: 700; }

/* Encabezado de mes + "en N días" (compartido por la tab Renovaciones) */
.home-cartera-mes { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-d); margin: 14px 2px 8px; }
.home-cartera-mes:first-child { margin-top: 2px; }
.home-cartera-soon { color: var(--win-d); font-weight: 600; }

/* ════════════════════════════════════════════════════════════════════
   Tab "Renovaciones" — cartera completa por aniversario (buscador + filtros)
   ════════════════════════════════════════════════════════════════════ */
.ren-canvas { overflow-y: auto; }
.ren-wrap { max-width: 760px; width: 100%; margin: 0 auto; padding: 32px 28px 64px; }
.ren-head { margin-bottom: 18px; }
.ren-title { font-size: 24px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); margin: 0 0 6px; }
.ren-sub { font-size: 14px; color: var(--mut); margin: 0; line-height: 1.5; }
.ren-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ren-search input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14.5px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: 0; transition: border-color var(--t), box-shadow var(--t); }
.ren-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.12); }
.ren-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ren-chip { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mut); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; cursor: pointer; transition: border-color var(--t), color var(--t), background var(--t); }
.ren-chip:hover { border-color: #cbd5e1; color: var(--ink); }
.ren-chip.is-on { background: var(--brand-50); border-color: var(--brand); color: var(--brand-d); }
.ren-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.ren-row-main { min-width: 0; }
.ren-row-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.ren-row-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.ren-row-aniv { font-size: 12.5px; color: var(--mut); }
.ren-row-aniv strong { color: var(--ink); font-weight: 700; }
.ren-row-acts { display: flex; gap: 8px; flex: none; }
.ren-act { font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 9px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--mut); transition: border-color var(--t), color var(--t), background var(--t); }
.ren-act:hover { border-color: #cbd5e1; color: var(--ink); }
.ren-act--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.ren-act--primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.ren-empty { font-size: 14px; color: var(--mut); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; line-height: 1.5; }
.ren-loading { color: var(--mut); padding: 48px; text-align: center; font-size: 14px; }

/* Subtítulo de tier dentro de "Tu día" (ej. "Para reenganchar") */
.home-subh { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); margin: 4px 2px -2px; }
.home-lead--cold .home-lead-name { color: var(--ink); }
.home-lead-main { flex: 1; min-width: 0; }
.home-lead-top { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; padding-right: 26px; }
.home-lead-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.home-lead-isa { font-size: 11.5px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
/* "Se enfría": ex-caliente que se está apagando (a quién estás por perder). */
.home-lead-cool { font-size: 11px; font-weight: 700; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 1px 7px; letter-spacing: .01em; }
.home-lead-why { font-size: 13px; color: var(--mut); line-height: 1.45; margin: 0; }
/* Acciones lado a lado a la derecha, centradas en vertical contra el texto.
   margin-right deja libre el corner del × y evita que se pisen. */
.home-lead-acts { flex: none; display: flex; flex-direction: row; align-self: center; align-items: center; gap: 8px; margin-right: 22px; }
.home-lead-go { display: inline-flex; align-items: center; justify-content: center; background: var(--brand); border: 0; color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 8px; transition: background var(--t); }
.home-lead-go:hover { background: var(--brand-d); }
.home-lead-sec { background: transparent; border: 1px solid var(--line); color: var(--mut); font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 8px; transition: border-color var(--t), color var(--t); }
.home-lead-sec:hover { border-color: #cbd5e1; color: var(--ink); }
/* En pantallas angostas, las acciones bajan bajo el texto, alineadas a la izquierda. */
@media (max-width: 560px) {
  .home-lead-acts { align-self: stretch; justify-content: flex-start; margin-right: 0; margin-top: 11px; }
  .home-lead { flex-wrap: wrap; }
}

/* ── Redactor de mensaje (el mensaje ya viene escrito) ── */
.home-draft { position: relative; text-align: left; }
.home-draft .am-title, .home-draft .am-sub { text-align: left; }
.home-draft .am-sub { margin-bottom: 14px; }
.home-draft-tx { width: 100%; box-sizing: border-box; resize: vertical; min-height: 112px; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: 0; transition: border-color var(--t), box-shadow var(--t); }
.home-draft-tx:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,153,255,.12); }
.home-draft-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.home-draft-go, .home-draft-copy, .home-draft-ia { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 10px; transition: background var(--t), border-color var(--t), color var(--t); }
/* Botón WhatsApp: verde canónico de QuVi Pro (#25d366), igual que .co-ov-wa. */
.home-draft-go { background: #25d366; border: 0; color: #fff; }
.home-draft-go:hover { background: #1ebe5d; }
.home-draft-copy, .home-draft-ia { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.home-draft-copy:hover, .home-draft-ia:hover { border-color: #cbd5e1; }
.home-draft-go .home-mini, .home-draft-copy .home-mini, .home-draft-ia .home-mini { width: 15px; height: 15px; }
.home-draft-note { font-size: 12px; color: var(--mut); margin-top: 10px; }
.home-draft-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 8px; background: transparent; border: 0; color: var(--mut); display: grid; place-items: center; transition: background var(--t), color var(--t); }
.home-draft-x:hover { background: var(--bg); color: var(--ink); }
.home-draft-x .home-ico { width: 18px; height: 18px; }

/* ════════════════════════════════════════════════════════════════════
   Ficha de la persona — panel lateral con su línea de vida
   ════════════════════════════════════════════════════════════════════ */
.fx-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.28); opacity: 0; transition: opacity .26s ease; z-index: 9400; }
.fx-scrim.is-open { opacity: 1; }
.fx-ov {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, calc(100vw - 24px));
  background: var(--card); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 9450; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  will-change: transform; box-shadow: -24px 0 60px rgba(15,23,42,.12);
}
.fx-ov.is-open { transform: translateX(0); }
.fx-ico { width: 18px; height: 18px; }

/* Cabecera */
.fx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); flex: none; }
.fx-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fx-ava { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-50); color: var(--brand-d); font-size: 15px; font-weight: 800; display: grid; place-items: center; letter-spacing: .02em; }
.fx-id-tx { min-width: 0; }
.fx-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-sub { font-size: 12.5px; font-weight: 600; color: var(--mut); margin-top: 1px; }
.fx-x { flex: none; width: 32px; height: 32px; border-radius: 9px; background: transparent; border: 0; color: var(--mut); display: grid; place-items: center; transition: background var(--t), color var(--t); }
.fx-x:hover { background: var(--bg); color: var(--ink); }
.fx-x .fx-ico { width: 17px; height: 17px; }

/* Cuerpo */
.fx-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 18px; }

/* Ahora: lo accionable arriba */
.fx-now { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.fx-now-k { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-d); margin-bottom: 7px; }
.fx-now-why { font-size: 14px; line-height: 1.5; color: var(--ink); margin: 0 0 13px; }
.fx-now-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fx-go { display: inline-flex; align-items: center; gap: 7px; background: var(--brand); border: 0; color: #fff; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 10px; transition: background var(--t); }
.fx-go:hover { background: var(--brand-d); }
.fx-go .fx-ico { width: 15px; height: 15px; }
.fx-sec { background: var(--card); border: 1px solid var(--line); color: var(--mut); font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 10px; transition: border-color var(--t), color var(--t); }
.fx-sec:hover { border-color: #cbd5e1; color: var(--ink); }

/* Chips de datos */
.fx-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 4px; }
.fx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; }
.fx-chip-ic { width: 14px; height: 14px; color: var(--mut); }

/* Resumen de la relación (bajo el título de la historia) */
.fx-summary { font-size: 12.5px; color: var(--mut); margin: -4px 0 14px; line-height: 1.5; }
.fx-summary strong { color: var(--win-d); font-weight: 700; }

/* Línea de tiempo */
.fx-tl-h { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); margin: 22px 0 10px; }
.fx-tl { list-style: none; margin: 0; padding: 0; }
.fx-tl-i { position: relative; display: flex; gap: 13px; padding-bottom: 18px; }
.fx-tl-i::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.fx-tl-i:last-child { padding-bottom: 0; }
.fx-tl-i:last-child::before { display: none; }
.fx-tl-dot { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--mut); position: relative; z-index: 1; }
.fx-tl-dot .fx-ico { width: 15px; height: 15px; }
.fx-tone-hot .fx-tl-dot { background: #fff1f2; border-color: #fecaca; color: #ef4444; }
.fx-tone-danger .fx-tl-dot { background: #fff7ed; border-color: #fed7aa; color: #d97706; }
.fx-tone-won .fx-tl-dot { background: #ecfdf5; border-color: #a7f3d0; color: #16a34a; }
.fx-tone-won .fx-tl-tx span { color: var(--win-d); }
.fx-tl-tx { padding-top: 4px; min-width: 0; }
.fx-tl-tx span { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.fx-tl-tx time { font-size: 12px; color: var(--mut); }
.fx-tl-empty { font-size: 13px; color: var(--mut); }

/* Pie */
.fx-foot { flex: none; border-top: 1px solid var(--line); padding: 13px 18px; }
.fx-foot-link { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; color: var(--brand-d); font-size: 13px; font-weight: 700; }
.fx-foot-link:hover { text-decoration: underline; }
.fx-foot-link .fx-mini { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) { .fx-ov, .fx-scrim { transition: none; } }

/* ── Lo que funciona para ti (Capa 5: aprende de tus cierres) ── */
.home-learn { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; }
.home-learn-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.home-learn-ic .home-ico { width: 21px; height: 21px; }
.home-learn-tx { min-width: 0; }
.home-learn-v { font-size: 14.5px; color: var(--mut); line-height: 1.35; }
.home-learn-v strong { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.home-learn-h { font-size: 12.5px; color: var(--mut); line-height: 1.5; margin-top: 5px; }

/* ── Tu cosecha del mes (resultado tangible en UF y contratos) ── */
.home-cosecha { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; }
.home-cosecha-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.home-cosecha-ic .home-ico { width: 21px; height: 21px; }
.home-cosecha-tx { min-width: 0; flex: 1; }
.home-cosecha-go { flex: none; align-self: stretch; display: flex; flex-direction: column; justify-content: center; text-align: right; padding-left: 16px; border-left: 1px solid var(--line); }
.home-cosecha-go-k { font-size: 12px; font-weight: 800; color: var(--brand-d); letter-spacing: .01em; }
.home-cosecha-go-v { font-size: 12.5px; color: var(--mut); margin-top: 2px; white-space: nowrap; }
.home-cosecha-go-v strong { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.home-cosecha-k { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); margin-bottom: 3px; }
.home-cosecha-v { font-size: 15px; color: var(--ink); line-height: 1.35; }
.home-cosecha-v strong { font-weight: 800; letter-spacing: -.01em; }
.home-cosecha-v--empty { color: var(--mut); font-weight: 600; font-size: 14px; }
.home-cosecha-sub { font-size: 12.5px; color: var(--mut); line-height: 1.45; margin-top: 4px; }

/* ── Tu pulso ── */
.home-pulse { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 2px; }
.home-pcard { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; transition: border-color var(--t), transform var(--t); }
.home-pcard:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.home-pmeta { grid-column: span 1; }
.home-ring { flex: none; }
.home-pmeta-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-pmeta-tx strong { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.home-pmeta-tx span { font-size: 11.5px; color: var(--mut); }
.home-pic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.home-pic .home-ico { width: 20px; height: 20px; display: block; }
.home-pstat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.home-pval { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.home-plabel { font-size: 11.5px; color: var(--mut); line-height: 1.3; }

/* ── Cotizar + indicadores ── */
.home-foot { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: stretch; }
.home-cotizar { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; text-align: left; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%); border: 0; border-radius: 16px; padding: 16px 20px; color: #fff; transition: transform var(--t); }
/* contenido por encima de la grilla */
.home-cotizar > *:not(.home-grid),
.pet-cta > *:not(.home-grid) { position: relative; z-index: 1; }
/* Grilla Ultracode: cuadritos que titilan en patrón aleatorio, se enciende al hover.
   Máscara derecha→izquierda: el efecto arranca a la derecha y se difumina a la izquierda. */
.home-grid { position: absolute; inset: 0; z-index: 0; overflow: hidden; display: grid; grid-template-columns: repeat(auto-fill, 7px); grid-auto-rows: 7px; gap: 5px; opacity: 0; transition: opacity .35s ease; pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 70%);
  mask-image: linear-gradient(to left, #000 0%, transparent 70%); }
.home-cotizar:hover .home-grid,
.pet-cta:hover .home-grid { opacity: 1; }
.home-grid i { border-radius: 1.5px; background: #fff; opacity: .05; animation: homeGridTwinkle 2.4s ease-in-out infinite; animation-play-state: paused; }
.home-cotizar:hover .home-grid i,
.pet-cta:hover .home-grid i { animation-play-state: running; }
@keyframes homeGridTwinkle { 0%, 100% { opacity: .05; } 50% { opacity: var(--peak, .5); } }
@media (prefers-reduced-motion: reduce) { .home-grid i { animation: none; } .home-cotizar:hover .home-grid i, .pet-cta:hover .home-grid i { opacity: .32; } }
.home-cot-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }
.home-cot-ic .home-ico { width: 22px; height: 22px; }
.home-cot-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.home-cot-tx strong { font-size: 15.5px; font-weight: 700; }
.home-cot-tx span { font-size: 13px; opacity: .9; }
.home-cot-arrow { width: 20px; height: 20px; flex: none; }
.home-ind { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.home-ind-cell { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px 20px; background: var(--card); min-width: 110px; }
.home-ind-l { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--mut); }
.home-ind-v { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.home-demo { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px 13px; margin-top: 22px; }
.home-demo .home-mini { color: #d97706; flex: none; }

@media (max-width: 1180px) {
  .home-pulse { grid-template-columns: repeat(2, 1fr); }
  .home-foot { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   Tab "Mi robot" — el compañero que crece con tus UF vendidas
   ════════════════════════════════════════════════════════════════════ */
.pet-canvas { overflow-y: auto; }
.pet-wrap { max-width: 760px; margin: 0 auto; padding: 32px 26px 64px; position: relative; }
.pet-loading { padding: 60px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.pet-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 0 8px; }
.pet-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-top: 68px; overflow: visible; }
.pet-shadow { width: 96px; height: 13px; margin-top: 14px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(15,23,42,.16), transparent 70%); }
.pet-gain { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 18px; color: #16a34a; animation: petGainUp 1.7s ease-out forwards; pointer-events: none; }
/* Robot chico de Inicio: "+X UF" más pequeño y en una sola línea, flotando arriba. */
.pet-gain.pet-gain--home { font-size: 11px; top: -14px; white-space: nowrap; }
@keyframes petGainUp { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 18% { opacity: 1; transform: translate(-50%, -4px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }

.pet-id { margin-top: 18px; }
.pet-name-row { display: flex; justify-content: center; }
.pet-name { appearance: none; border: 1px solid var(--line); background: var(--card, #fff); border-radius: 999px; padding: 6px 14px; font-size: 17px; font-weight: 800; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: border-color .15s, background .15s; }
.pet-name:hover { border-color: var(--brand, #0d99ff); }
.pet-name-empty { color: var(--muted); font-weight: 600; font-size: 14px; }
.pet-name-edit { display: inline-flex; color: var(--muted); }
.pet-name-edit .pet-ico { width: 14px; height: 14px; }
.pet-name-form { display: flex; gap: 8px; align-items: center; }
.pet-name-in { appearance: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: 700; color: var(--ink); outline: none; min-width: 220px; text-align: center; }
.pet-name-in:focus { border-color: var(--brand, #0d99ff); }
.pet-name-save { appearance: none; border: none; background: var(--brand, #0d99ff); color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; }

.pet-level { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 9px; }
.pet-lvl-badge { color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .2px; }
.pet-stage-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.pet-mood { margin: 12px auto 0; max-width: 420px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.pet-mood strong { color: var(--ink); font-weight: 800; }

/* ── Robot con decoraciones por nivel (sobre .qv-robot) ───────────────
   Acentos SÓLIDOS (sin glow). Antena, pernos y corona según nivel. */
.pet-bot { position: relative; overflow: visible; }
.pet-bot[data-accent="1"] { box-shadow: inset 0 0 0 calc(var(--rh) * .035) var(--accent), inset 0 1px 0 rgba(255,255,255,.07); }
.pet-antenna, .pet-bolt, .pet-crown { display: none; position: absolute; }
.pet-bot[data-ant="1"] .pet-antenna { display: block; width: calc(var(--rh) * .045); height: calc(var(--rh) * .26); background: var(--accent); left: 50%; top: calc(var(--rh) * -0.26); transform: translateX(-50%); border-radius: 999px; }
.pet-bot[data-ant="1"] .pet-antenna::after { content: ''; position: absolute; top: calc(var(--rh) * -0.12); left: 50%; transform: translateX(-50%); width: calc(var(--rh) * .14); height: calc(var(--rh) * .14); border-radius: 50%; background: var(--accent); }
.pet-bot[data-bolt="1"] .pet-bolt { display: block; width: calc(var(--rh) * .15); height: calc(var(--rh) * .15); border-radius: 50%; background: var(--accent); top: 50%; transform: translateY(-50%); }
.pet-bolt-l { left: calc(var(--rh) * -0.075); }
.pet-bolt-r { right: calc(var(--rh) * -0.075); }
.pet-bot[data-crown="1"] .pet-crown { display: block; left: 50%; top: calc(var(--rh) * -0.46); transform: translateX(-50%); color: var(--accent); }
.pet-crown svg { width: calc(var(--rh) * .34); height: calc(var(--rh) * .34); display: block; }
/* "Hambre": ojos miran de lado buscando comida (reusa la mirada lenta) */
.pet-bot.is-hungry .qv-robot-eyes { animation: qvEyesScan 2.8s ease-in-out infinite; }
/* "Durmiendo": ojos casi cerrados */
.pet-bot.is-sleepy .qv-robot-eye { animation: none; transform: scaleY(.18); }
.pet-locked { filter: grayscale(1); opacity: .5; }

/* Respiración en reposo: el robot se siente vivo aunque no estés cerrando
   ventas. Solo en los ánimos quietos (los activos bounce/wiggle ya animan
   el contenedor). Más lento cuando duerme. */
.pet-hero .pet-bot.is-look,
.pet-hero .pet-bot.is-peek,
.pet-hero .pet-bot.is-hungry { animation: petBreathe 4.2s ease-in-out infinite; transform-origin: center bottom; }
.pet-hero .pet-bot.is-sleepy { animation: petBreathe 6.4s ease-in-out infinite; transform-origin: center bottom; }
@keyframes petBreathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.018); } }
/* "Salúdalo": saltito feliz al hacer clic (gana a la respiración mientras dura) */
.pet-hero .pet-bot.is-greet { animation: petGreet .9s ease-in-out 1 !important; transform-origin: center bottom; }
@keyframes petGreet {
  0%   { transform: translateY(0) scale(1); }
  25%  { transform: translateY(-12px) scale(1.05); }
  45%  { transform: translateY(0) scale(.95); }
  65%  { transform: translateY(-5px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

/* ── Progreso a la próxima evolución ─────────────────────────────────── */
.pet-prog { margin-top: 26px; }
.pet-prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.pet-prog-top strong { color: var(--ink); font-weight: 800; }
.pet-prog-uf { font-weight: 700; color: var(--ink); flex: none; font-variant-numeric: tabular-nums; }
.pet-near { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; color: #16a34a; background: color-mix(in srgb, #16a34a 14%, transparent); border-radius: 999px; padding: 2px 8px; vertical-align: middle; letter-spacing: .2px; }
.pet-bar { height: 12px; border-radius: 999px; background: var(--line, #e6edf5); overflow: hidden; }
.pet-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ── Stats ───────────────────────────────────────────────────────────── */
.pet-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.pet-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--card, #fff); }
.pet-stat-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.pet-stat-ic .pet-ico { width: 18px; height: 18px; }
.pet-stat-v { display: block; font-size: 19px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pet-stat-l { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ── Secciones ───────────────────────────────────────────────────────── */
.pet-sec { margin-top: 30px; }
.pet-sec-h { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; }
.pet-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pet-how-step { display: flex; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card, #fff); }
.pet-how-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand, #0d99ff); color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pet-how-tx strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.pet-how-tx span { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 3px; }

/* ── Mapa de evolución ───────────────────────────────────────────────── */
.pet-road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pet-road-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; padding: 16px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card, #fff); }
.pet-road-item.is-current { border-color: var(--brand, #0d99ff); box-shadow: inset 0 0 0 1px var(--brand, #0d99ff); }
.pet-road-bot { position: relative; height: 40px; display: flex; align-items: center; justify-content: center; }
.pet-road-lock { position: absolute; right: -2px; bottom: -2px; color: var(--muted); background: var(--card, #fff); border-radius: 50%; display: inline-flex; }
.pet-road-lock .pet-ico { width: 13px; height: 13px; }
.pet-road-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.pet-road-item:not(.is-unlocked) .pet-road-name { color: var(--muted); }
.pet-road-uf { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pet-mini-bot { margin: 0; }

/* ── CTA + recompensa ────────────────────────────────────────────────── */
.pet-foot { margin-top: 30px; display: grid; gap: 12px; }
.pet-cta { position: relative; overflow: hidden; appearance: none; text-align: left; width: 100%; display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: none; border-radius: 18px; background: linear-gradient(135deg, #0d99ff, #0a7fd4); color: #fff; cursor: pointer; }
.pet-cta-ic { width: 26px; height: 26px; flex: none; }
.pet-cta-tx { flex: 1; min-width: 0; }
.pet-cta-tx strong { display: block; font-size: 15.5px; font-weight: 800; }
.pet-cta-tx span { display: block; font-size: 13px; opacity: .9; margin-top: 2px; }
.pet-cta-arrow { width: 20px; height: 20px; flex: none; }
.pet-reward { display: flex; align-items: center; gap: 13px; padding: 15px 18px; border: 1px dashed var(--line); border-radius: 16px; background: var(--card, #fff); }
.pet-reward-ic { width: 24px; height: 24px; flex: none; color: #a855f7; }
.pet-reward-tx { flex: 1; min-width: 0; }
.pet-reward-tx strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.pet-reward-tx span { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.pet-soon { flex: none; font-size: 11px; font-weight: 800; color: #7c3aed; background: color-mix(in srgb, #a855f7 12%, transparent); border-radius: 999px; padding: 4px 11px; text-transform: uppercase; letter-spacing: .4px; }

.pet-demo { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px 13px; margin-top: 24px; }
.pet-demo .pet-mini { color: #d97706; flex: none; }
.pet-ico.pet-mini { width: 15px; height: 15px; }

/* ── Cartel de evolución ─────────────────────────────────────────────── */
.pet-evolve { position: fixed; left: 50%; top: 84px; transform: translateX(-50%) translateY(-8px); z-index: 9100; background: #0f172a; color: #fff; font-size: 14px; padding: 12px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(15,23,42,.28); opacity: 0; animation: petEvolveIn .35s ease-out forwards; }
.pet-evolve strong { font-weight: 800; }
.pet-evolve.is-out { animation: petEvolveOut .5s ease-in forwards; }
@keyframes petEvolveIn { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes petEvolveOut { to { opacity: 0; transform: translateX(-50%) translateY(-8px); } }

/* ── Confetti (mismo patrón que Inicio) ──────────────────────────────── */
.pet-confetti { position: fixed; inset: 0; z-index: 9000; pointer-events: none; overflow: hidden; }
.pet-confetti i { position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; animation-name: petConfettiFall; animation-timing-function: cubic-bezier(.3,.2,.6,1); animation-iteration-count: 1; }
@keyframes petConfettiFall { 0% { opacity: 1; transform: translateY(0) translateX(0) rotate(0); } 100% { opacity: 1; transform: translateY(108vh) translateX(var(--drift, 0)) rotate(560deg); } }

@media (prefers-reduced-motion: reduce) {
  .pet-gain, .pet-evolve, .pet-confetti i, .pet-bar-fill,
  .pet-hero .pet-bot, .pet-hero .pet-bot.is-greet { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) {
  .pet-stats { grid-template-columns: repeat(2, 1fr); }
  .pet-how { grid-template-columns: 1fr; }
  .pet-road { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════════════════════════════════
   Notificaciones — campana en el topbar + panel + toast + ajustes
   ════════════════════════════════════════════════════════════════════ */
.tb-bell { position: relative; padding: 7px; }
.tb-bell .tb-bell-ico { width: 17px; height: 17px; }
.tb-bell.is-active { border-color: var(--brand); color: var(--brand-d); background: var(--brand-50); }
.tb-bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; border: 2px solid #fff; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
/* display:inline-flex anula [hidden] → guard para que se oculte cuando no hay no leídas */
.tb-bell-badge[hidden] { display: none !important; }

/* ── Panel ───────────────────────────────────────────────────────────── */
.ntf-panel { position: fixed; z-index: 8000; width: 384px; max-width: calc(100vw - 24px); max-height: 72vh; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(15,23,42,.18); display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease; }
.ntf-panel.is-in { opacity: 1; transform: translateY(0); }
/* el display:flex anula el atributo [hidden] → guard explícito (panel + submenú) */
.ntf-panel[hidden], .ntf-clearmenu[hidden] { display: none !important; }
.ntf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px 13px; border-bottom: 1px solid var(--line); }
.ntf-head-tx strong { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
.ntf-head-tx span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.ntf-head-acts { display: flex; gap: 4px; flex: none; }
.ntf-act { appearance: none; width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all var(--t); position: relative; }
.ntf-act:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-50); }
.ntf-act .ntf-ico { width: 15px; height: 15px; }

.ntf-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.ntf-loading { padding: 30px 0; text-align: center; color: var(--muted); font-size: 13px; }

.ntf-row { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border-radius: 12px; cursor: pointer; transition: background var(--t); }
.ntf-row:hover { background: #f6f9fc; }
.ntf-row.is-unread { background: var(--brand-50); }
.ntf-row.is-unread:hover { background: #d9ecff; }
.ntf-row-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.ntf-row-ic .ntf-ico { width: 17px; height: 17px; }
.ntf-row-tx { flex: 1; min-width: 0; }
.ntf-row-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.ntf-row.is-unread .ntf-row-title { font-weight: 800; }
.ntf-row-body { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.ntf-row-time { display: block; font-size: 11px; color: #94a3b8; margin-top: 5px; }
.ntf-row-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 5px; }
.ntf-del { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: none; background: rgba(255,255,255,.9); border-radius: 7px; color: #94a3b8; cursor: pointer; display: none; align-items: center; justify-content: center; }
.ntf-row:hover .ntf-del { display: inline-flex; }
.ntf-del:hover { color: #ef4444; background: #fee2e2; }
.ntf-del .ntf-ico { width: 13px; height: 13px; }

.ntf-empty { padding: 36px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ntf-empty-ic { width: 30px; height: 30px; color: #cbd5e1; margin-bottom: 4px; }
.ntf-empty strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.ntf-empty span { font-size: 12.5px; line-height: 1.5; color: var(--muted); max-width: 280px; }
.ntf-retry { margin-top: 10px; appearance: none; border: 1px solid var(--line); background: #fff; color: var(--brand-d); border-radius: 9px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ntf-retry:hover { border-color: var(--brand); background: var(--brand-50); }

.ntf-clearmenu { position: absolute; top: 50px; right: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.16); padding: 5px; z-index: 2; display: flex; flex-direction: column; min-width: 190px; }
.ntf-clear-opt { appearance: none; text-align: left; border: none; background: none; border-radius: 8px; padding: 9px 11px; font-size: 13px; color: var(--ink); cursor: pointer; }
.ntf-clear-opt:hover { background: #f1f5f9; }
.ntf-clear-opt.is-danger { color: #dc2626; }
.ntf-clear-opt.is-danger:hover { background: #fee2e2; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.ntf-toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 9200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.ntf-toast { pointer-events: auto; appearance: none; text-align: left; width: 340px; max-width: calc(100vw - 40px); display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(15,23,42,.18); cursor: pointer; opacity: 0; transform: translateX(16px); transition: opacity .24s ease, transform .24s ease; }
.ntf-toast.is-in { opacity: 1; transform: translateX(0); }
.ntf-toast-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.ntf-toast-ic .ntf-ico { width: 17px; height: 17px; }
.ntf-toast-tx { flex: 1; min-width: 0; }
.ntf-toast-tx strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.ntf-toast-tx span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* ── Modal de ajustes ────────────────────────────────────────────────── */
.ntf-modal-back { position: fixed; inset: 0; z-index: 9300; background: rgba(15,23,42,.42); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .2s ease; }
.ntf-modal-back.is-in { opacity: 1; }
.ntf-modal { width: 460px; max-width: 100%; max-height: 84vh; overflow-y: auto; background: var(--card, #fff); border-radius: 18px; box-shadow: 0 24px 70px rgba(15,23,42,.3); padding: 22px 24px 24px; transform: translateY(8px); transition: transform .2s ease; }
.ntf-modal-back.is-in .ntf-modal { transform: translateY(0); }
.ntf-modal-head { display: flex; align-items: center; justify-content: space-between; }
.ntf-modal-head strong { font-size: 18px; font-weight: 800; color: var(--ink); }
.ntf-modal-x { appearance: none; width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ntf-modal-x:hover { border-color: var(--brand); color: var(--brand-d); }
.ntf-modal-x .ntf-ico { width: 16px; height: 16px; }
.ntf-modal-sub { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 8px 0 18px; }
.ntf-prefs { display: flex; flex-direction: column; gap: 4px; }
.ntf-pref { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.ntf-pref:first-child { border-top: none; }
.ntf-pref-tx { flex: 1; min-width: 0; }
.ntf-pref-tx strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.ntf-pref-tx span { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.ntf-switch { flex: none; appearance: none; width: 44px; height: 26px; border-radius: 999px; border: none; background: #cbd5e1; cursor: pointer; position: relative; transition: background .18s ease; }
.ntf-switch.is-on { background: var(--brand); }
.ntf-switch-dot { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s ease; }
.ntf-switch.is-on .ntf-switch-dot { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
  .ntf-panel, .ntf-toast, .ntf-modal-back, .ntf-modal, .ntf-switch, .ntf-switch-dot { transition: none !important; }
}
@media (max-width: 760px) {
  .ntf-panel { width: calc(100vw - 24px); }
}

/* ══════════════════════════════════════════════════════════════════════
   SEGUIMIENTO INTELIGENTE — modal de redacción con QuVi IA
   ══════════════════════════════════════════════════════════════════════ */
.sgmt-back {
  position: fixed; inset: 0; z-index: 600;
  /* Mismo scrim que el detalle (.mx-goal-back) para que el cambio no oscurezca. */
  background: rgba(15,23,42,.34); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity .28s;
}
.sgmt-back.is-open { opacity: 1; }
/* Modo reemplazo (se abre sobre otro overlay): sin fade, swap instantáneo. */
.sgmt-back.is-instant, .sgmt-back.is-instant .sgmt-modal { transition: none; }
.sgmt-modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 520px;
  box-shadow: 0 32px 80px rgba(15,23,42,.28), 0 4px 16px rgba(15,23,42,.08);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(10px); transition: transform .28s cubic-bezier(.2,.9,.2,1);
}
.sgmt-back.is-open .sgmt-modal { transform: translateY(0); }

/* Cabecera */
.sgmt-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--line);
}
.sgmt-ctx { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sgmt-ctx-logos { display: flex; gap: 4px; flex: none; }
.sgmt-logo { height: 24px; width: auto; object-fit: contain; }
.sgmt-ctx-tx { display: flex; flex-direction: column; min-width: 0; }
.sgmt-ctx-plan { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgmt-ctx-isapre { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgmt-ctx-open { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none;
  background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand-d);
  border-radius: 99px; padding: 3px 10px; font-weight: 600; }
.sgmt-close {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex: none;
  transition: background .12s, color .12s;
}
.sgmt-close svg { width: 16px; height: 16px; }
.sgmt-close:hover { background: #f1f5f9; color: var(--ink); }

/* Cuerpo */
.sgmt-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.sgmt-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0; }
.sgmt-tones { display: flex; gap: 8px; }
.sgmt-tone {
  appearance: none; flex: 1; cursor: pointer; border: 1.5px solid var(--line);
  background: #fff; border-radius: 12px; padding: 10px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: all .15s;
}
.sgmt-tone:hover { border-color: #cbd5e1; background: #f8fafc; }
.sgmt-tone.is-on { border-color: var(--brand); background: var(--brand-50); }
.sgmt-tone-em { display: inline-flex; color: var(--mut); }
.sgmt-tone-em svg { width: 20px; height: 20px; }
.sgmt-tone.is-on .sgmt-tone-em { color: var(--brand); }
.sgmt-tone-lbl { font-size: 12px; font-weight: 700; color: var(--ink); }
.sgmt-tone-desc { font-size: 10.5px; color: var(--muted); }
.sgmt-tone.is-on .sgmt-tone-lbl { color: var(--brand-d); }

/* Área del mensaje */
.sgmt-msg-wrap { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: #fafbfc; min-height: 100px; }
.sgmt-idle {
  display: flex; align-items: center; gap: 10px; padding: 18px 16px;
  font-size: 13.5px; color: var(--mut); line-height: 1.5;
}
.sgmt-idle-ico { font-size: 17px; flex: none; }
/* El atributo [hidden] no oculta elementos con display:flex; forzamos. */
.sgmt-idle[hidden], .sgmt-loader[hidden] { display: none !important; }
.sgmt-loader {
  display: flex; align-items: center; gap: 10px; padding: 18px 16px;
  font-size: 13px; color: var(--muted);
}
.sgmt-loader-dots { display: flex; gap: 5px; }
.sgmt-loader-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  animation: sgmtDot 1.2s ease-in-out infinite;
}
.sgmt-loader-dots span:nth-child(2) { animation-delay: .2s; }
.sgmt-loader-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes sgmtDot { 0%,80%,100% { opacity:.2; transform: scale(.8); } 40% { opacity:1; transform: scale(1); } }
.sgmt-preview { padding: 14px 16px; font-size: 14px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; }
.sgmt-edit {
  width: 100%; box-sizing: border-box; border: 0; outline: none; resize: none;
  font: inherit; font-size: 14px; color: var(--ink); line-height: 1.6;
  background: transparent; padding: 14px 16px; min-height: 90px;
}
.sgmt-err { padding: 14px 16px; font-size: 13px; color: #ef4444; }

/* Pie */
.sgmt-foot {
  padding: 14px 20px 18px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sgmt-regen {
  appearance: none; border: 1px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 10px; padding: 8px 14px; display: flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .15s;
}
.sgmt-regen svg { width: 15px; height: 15px; }
.sgmt-regen:not(:disabled):hover { border-color: #cbd5e1; color: var(--ink); background: #f8fafc; }
.sgmt-regen:disabled { opacity: .45; cursor: not-allowed; }
.sgmt-actions { display: flex; gap: 8px; }
.sgmt-copy, .sgmt-wa {
  appearance: none; cursor: pointer; border: 0; border-radius: 10px;
  padding: 9px 16px; display: flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600; transition: all .15s;
}
.sgmt-copy svg, .sgmt-wa svg { width: 15px; height: 15px; }
.sgmt-copy { background: #f1f5f9; color: var(--ink); }
.sgmt-copy:not(:disabled):hover { background: #e2e8f0; }
.sgmt-wa { background: #25D366; color: #fff; }
.sgmt-wa:not(:disabled):hover { background: #1ebe5d; }
.sgmt-copy:disabled, .sgmt-wa:disabled { opacity: .4; cursor: not-allowed; }

/* Botón en notificaciones */
.ntf-sgmt {
  appearance: none; border: 1px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 9px; padding: 5px 10px; display: flex; align-items: center; gap: 5px;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--brand-d);
  white-space: nowrap; transition: all .15s; flex: none;
}
.ntf-sgmt svg { width: 14px; height: 14px; }
.ntf-sgmt:hover { background: var(--brand-50); border-color: var(--brand); }

/* Botón en historial */
.hx-btn-primary {
  appearance: none; cursor: pointer; border: 0; border-radius: 11px;
  padding: 9px 18px; display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #25D366, #1ebe5d); transition: opacity .15s;
}
.hx-btn-primary:hover { opacity: .9; }
.hx-btn-primary svg { width: 16px; height: 16px; }
.hx-btn-sgmt { order: -1; }

/* ══════════════════════════════════════════════════════════════════════
   MODO REUNIÓN — pantalla limpia para compartir con el cliente
   ══════════════════════════════════════════════════════════════════════ */

/* FAB del simulador */
/* El botón "Modo reunión" vive inyectado en el toolbar del iframe
   (.qvpro-meet-btn, estilado dentro de EMBED_CSS en asesor-simulador-view.js).
   Acá solo queda el modo reunión en sí (oculta el chrome) y la píldora de salida. */

/* Meeting mode: oculta el chrome del asesor */
.app.meeting-mode .palette {
  transform: translateX(-100%); opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.2,.9,.2,1), opacity .3s;
}
.app.meeting-mode .topbar {
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.app.meeting-mode #asSimHost {
  position: fixed !important; inset: 0 !important;
  width: 100vw !important; height: 100vh !important;
  z-index: 450; display: flex !important;
}
.app.meeting-mode #asSimHost .sim-wrap,
.app.meeting-mode #asSimHost .sim-frame { width: 100% !important; height: 100% !important; flex: 1; }
.app.meeting-mode .co-bar { z-index: 460; }

/* Pill de salida con timer */
.sim-meet-pill {
  position: fixed; top: 39px; right: 20px; z-index: 500;
  display: flex; align-items: center; gap: 8px;
  background: rgba(15,23,42,.82); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 6px 12px; color: #fff;
  font-size: 12.5px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(15,23,42,.40);
  animation: pillIn .3s cubic-bezier(.2,.9,.2,1);
}
@keyframes pillIn { from { opacity:0; } to { opacity:1; } }
.sim-meet-timer { font-variant-numeric: tabular-nums; min-width: 40px; }
.sim-meet-sep { opacity: .4; }
.sim-meet-exit {
  appearance: none; border: 0; background: rgba(255,255,255,.15); cursor: pointer;
  color: #fff; border-radius: 999px; padding: 4px 8px; font: inherit; font-size: 12px;
  font-weight: 600; display: flex; align-items: center; gap: 0; transition: background .15s;
}
.sim-meet-exit svg { width: 13px; height: 13px; flex: none; }
.sim-meet-exit:hover { background: rgba(255,255,255,.25); }
/* Texto colapsado por defecto (solo se ve la X); se expande al hover del badge. */
.sim-meet-exit-label {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; margin-left: 0;
  transition: max-width .28s cubic-bezier(.2,.9,.2,1), opacity .2s, margin-left .28s;
}
.sim-meet-pill:hover .sim-meet-exit-label { max-width: 200px; opacity: 1; margin-left: 6px; }

/* ============================================================
   SUSCRIPCIÓN · modal de pago (Flow)  ·  namespace sub-*
   Sin glow, bordes sólidos, gradiente de marca para el primario.
============================================================ */
.sub-overlay {
  position: fixed; inset: 0; z-index: 99000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(15, 23, 42, .42);
  opacity: 0; transition: opacity .18s ease;
}
.sub-overlay.is-in { opacity: 1; }
.sub-modal {
  position: relative; width: 100%; max-width: 720px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 30px 22px; box-shadow: 0 24px 60px -28px rgba(15, 23, 42, .35);
  transform: translateY(8px); transition: transform .2s cubic-bezier(.2,.9,.2,1);
}
.sub-overlay.is-in .sub-modal { transform: translateY(0); }
.sub-close {
  appearance: none; cursor: pointer; position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); border-radius: 9px; color: #64748b;
  transition: all var(--t);
}
.sub-close:hover { border-color: #cbd5e1; background: var(--bg); color: var(--ink); }
.sub-close svg { width: 18px; height: 18px; }
.sub-head { text-align: center; margin-bottom: 22px; }
.sub-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.sub-sub { margin: 6px 0 0; font-size: 14px; color: #64748b; line-height: 1.5; }
.sub-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sub-plan {
  position: relative; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 20px; background: linear-gradient(180deg, #fbfdff, var(--card));
  display: flex; flex-direction: column;
}
.sub-plan.is-reco { border-color: var(--brand); border-width: 2px; }
.sub-ribbon {
  position: absolute; top: -11px; left: 20px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; padding: 4px 10px; border-radius: 7px;
}
.sub-plan-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.sub-plan-tag { font-size: 13px; color: #64748b; margin-top: 2px; }
.sub-plan-price { margin: 14px 0 16px; display: flex; align-items: baseline; gap: 5px; }
.sub-plan-price strong { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.sub-plan-price span { font-size: 14px; color: #64748b; }
.sub-feats { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sub-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: #334155; line-height: 1.35; }
.sub-feats svg { width: 17px; height: 17px; color: var(--brand); flex: none; margin-top: 1px; }
.sub-pay {
  appearance: none; cursor: pointer; position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--brand); background: var(--card); color: var(--brand-d);
  font: inherit; font-size: 15px; font-weight: 600; padding: 12px; border-radius: 11px;
  transition: all var(--t);
}
.sub-pay:hover { background: var(--brand-50); }
.sub-pay.is-primary { border-color: transparent; background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; }
.sub-pay.is-primary:hover { opacity: .92; }
.sub-pay:disabled { opacity: .6; cursor: not-allowed; }
.sub-spin {
  width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: subspin .6s linear infinite;
}
.sub-spin[hidden] { display: none; }
@keyframes subspin { to { transform: rotate(360deg); } }
/* Botón secundario "pagar solo este mes" — bajo perfil, no compite con Suscribirme */
.sub-once {
  appearance: none; cursor: pointer; position: relative; width: 100%; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: none; color: #64748b; font: inherit; font-size: 13px; font-weight: 500;
  padding: 6px; border-radius: 9px; text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--t);
}
.sub-once:hover { color: var(--ink); }
.sub-once:disabled { opacity: .6; cursor: not-allowed; }
.sub-error {
  margin: 16px 0 0; padding: 11px 14px; border-radius: 10px; text-align: center;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13px;
}
.sub-error[hidden] { display: none; }
.sub-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 20px; font-size: 12px; color: #94a3b8;
}
.sub-foot svg { width: 14px; height: 14px; flex: none; }
/* Resultado post-pago */
.sub-result { max-width: 440px; text-align: center; padding: 34px 30px 26px; }
.sub-result-icon {
  width: 60px; height: 60px; margin: 0 auto 16px; border: 2px solid; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.sub-result-icon svg { width: 30px; height: 30px; }
.sub-result .sub-pay { margin-top: 22px; }
@media (max-width: 640px) {
  .sub-plans { grid-template-columns: 1fr; }
}

/* Fila "Mejorar plan" en Perfil → Cuenta */
.pf-upgrade {
  appearance: none; cursor: pointer; width: 100%; margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 12px;
  transition: opacity var(--t);
}
.pf-upgrade:hover { opacity: .92; }
.pf-upgrade svg { width: 16px; height: 16px; }

/* Suscripción — loading + vista de gestión */
.sub-loading { display: flex; align-items: center; justify-content: center; min-height: 180px; color: var(--brand); }
.sub-loading .sub-spin { width: 26px; height: 26px; }
.sub-manage { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.sub-mrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; font-size: 14px; color: #64748b; }
.sub-mrow + .sub-mrow { border-top: 1px solid var(--line); }
.sub-mrow strong { color: var(--ink); font-weight: 600; }
.sub-note { background: var(--brand-50); border: 1px solid #bfe0ff; border-radius: 11px; padding: 12px 14px; font-size: 13px; color: #0a5a96; margin-bottom: 14px; line-height: 1.45; }

/* Plan único (prueba / activar) + precio con ancla tachada y precio de fundador */
.sub-single { max-width: 420px; margin: 0 auto; }
.sub-price { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; }
.sub-price strong { font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.sub-anchor { font-size: 17px; color: #94a3b8; text-decoration: line-through; }
.sub-permes { font-size: 14px; color: #64748b; }
.sub-founder { font-size: 12px; font-weight: 600; color: var(--brand-d); margin-bottom: 16px; }

/* Spinners centrados en botones (margen, no transform: choca con el giro) */
.as-auth-btn { position: relative; }
.as-auth-btn .as-spinner { position: absolute; left: 50%; top: 50%; margin: -8px 0 0 -8px; }
.sub-pay .sub-spin, .sub-once .sub-spin { position: absolute; left: 50%; top: 50%; margin: -8.5px 0 0 -8.5px; }

/* Panel de administración de accesos (modal admin) */
.adm-form { display: flex; flex-direction: column; gap: 12px; }
.adm-input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--ink); outline: none; transition: border-color var(--t); }
.adm-input:focus { border-color: var(--brand); }
.adm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-listwrap { margin-top: 18px; }
.adm-listtitle { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin-bottom: 8px; }
.adm-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 220px; overflow-y: auto; }
.adm-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 14px; }
.adm-item + .adm-item { border-top: 1px solid var(--line); }
.adm-item-name { color: var(--ink); font-weight: 600; }
.adm-item-email { color: #64748b; font-size: 13px; }
.adm-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.adm-plan { display: flex; align-items: center; gap: 8px; }
.adm-plan-lbl { font-size: 13px; color: #64748b; margin-right: 2px; }
.adm-seg { appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: #64748b; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 9px; transition: all var(--t); }
.adm-seg:hover { border-color: #cbd5e1; }
.adm-seg.is-on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-d); }

/* Onboarding inicial (primera vez) — namespace ob-* */
.ob-overlay { position: fixed; inset: 0; z-index: 99500; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #eaf4ff 0%, #f6f9fc 60%); overflow-y: auto; }
.ob-card { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 28px 24px; box-shadow: 0 24px 60px -28px rgba(15,23,42,.35); }
.ob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.ob-back-sp { width: 32px; height: 32px; }
.ob-back { appearance: none; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--card); border-radius: 9px; color: #64748b; transition: all var(--t); }
.ob-back:hover { background: var(--bg); color: var(--ink); }
.ob-back svg { width: 18px; height: 18px; }
.ob-dots { display: flex; gap: 7px; align-items: center; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: all var(--t); }
.ob-dot.is-on { background: var(--brand); width: 20px; border-radius: 4px; }
.ob-dot.is-done { background: var(--brand-d); }
.ob-body { text-align: center; }
.ob-logo { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 14px; }
.ob-logo img { height: 28px; width: auto; }
/* Etiqueta "Pro" idéntica al canónico (.tb-pro-tag / landing /pro) */
.ob-logo-tag { font-size: .74rem; font-weight: 700; letter-spacing: .02em; line-height: 1; color: oklch(0.62 0.19 252); background: oklch(0.96 0.03 252); padding: 3px 8px; border-radius: 7px; }
.ob-title { margin: 6px 0 0; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.ob-sub { margin: 8px 0 18px; font-size: 14px; color: #64748b; line-height: 1.5; }
.ob-input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; font: inherit; font-size: 15px; color: var(--ink); outline: none; transition: border-color var(--t); }
.ob-input:focus { border-color: var(--brand); }
.ob-options { display: flex; flex-direction: column; gap: 12px; }
.ob-option { appearance: none; cursor: pointer; display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 16px; transition: all var(--t); }
.ob-option:hover { border-color: #cbd5e1; }
.ob-option.is-on { border-color: var(--brand); border-width: 2px; }
.ob-option-ic { flex: none; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand-d); display: flex; align-items: center; justify-content: center; }
.ob-option-ic svg { width: 20px; height: 20px; }
.ob-option-tx { display: flex; flex-direction: column; gap: 3px; }
.ob-option-tx strong { font-size: 15px; color: var(--ink); font-weight: 600; }
.ob-option-tx span { font-size: 13px; color: #64748b; }
.ob-isapres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ob-isapre { appearance: none; cursor: pointer; border: 2px solid var(--line); background: #fff; border-radius: 12px; height: 62px; display: flex; align-items: center; justify-content: center; padding: 10px 14px; transition: border-color var(--t); }
.ob-isapre:hover { border-color: #cbd5e1; }
.ob-isapre.is-on { border-color: var(--brand); }
.ob-isapre img { max-height: 30px; max-width: 100%; width: auto; object-fit: contain; }
.ob-primary { appearance: none; cursor: pointer; position: relative; width: 100%; margin-top: 18px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; font: inherit; font-size: 15px; font-weight: 600; padding: 13px; transition: opacity var(--t); }
.ob-primary:hover { opacity: .92; }
.ob-primary:disabled { opacity: .5; cursor: not-allowed; }
.ob-spin { position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -9px; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.ob-spin[hidden] { display: none; }
.ob-skip { appearance: none; cursor: pointer; width: 100%; margin-top: 10px; border: 0; background: none; color: #64748b; font: inherit; font-size: 13px; font-weight: 500; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.ob-skip:hover { color: var(--ink); }
.ob-optional { display: inline-block; background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 6px; margin-bottom: 6px; }
.ob-error { margin-top: 14px; padding: 11px 14px; border-radius: 10px; text-align: center; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13px; }

/* Botón "Administrar accesos" en Perfil (solo admin) */
.pf-admin { appearance: none; cursor: pointer; width: 100%; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; padding: 11px; transition: all var(--t); }
.pf-admin:hover { border-color: #cbd5e1; background: var(--bg); }
.pf-admin svg { width: 16px; height: 16px; }


/* ============================================================
   TAB NOTAS · v4 — propuesta de agenda (fecha detectada),
   mensaje IA para el cliente y agenda agrupada en insights.
   Va al final → gana. Sin glow, bordes sólidos.
   ============================================================ */

/* ── Propuesta de agenda ── */
.nt-agenda { display: flex; align-items: flex-start; gap: 13px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px; padding: 15px 17px; margin-top: 16px; }
.nt-ag-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; background: #16a34a; color: #fff; display: flex; align-items: center; justify-content: center; }
.nt-ag-ic .nt-ico { width: 19px; height: 19px; }
.nt-ag-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nt-ag-tx strong { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.nt-ag-what { font-size: 13.5px; line-height: 1.45; color: var(--mut); }
.nt-ag-when { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #15803d; }
.nt-ag-when .nt-mini-ic { width: 14px; height: 14px; }
.nt-ag-edit { -webkit-appearance: none; appearance: none; background: transparent; border: 0; padding: 0; font: inherit; margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--mut); text-decoration: underline; cursor: pointer; }
.nt-ag-edit:hover { color: var(--ink); }
.nt-ag-actions { display: flex; flex-direction: column; gap: 7px; flex: none; }
.nt-ag-yes { font-size: 13.5px; font-weight: 700; color: #fff; background: #16a34a; border: 0; border-radius: 9px; padding: 9px 16px; white-space: nowrap; }
.nt-ag-yes:hover { background: #15803d; }
.nt-ag-no { font-size: 13px; font-weight: 600; color: var(--mut); background: transparent; border: 0; padding: 6px; }
.nt-ag-no:hover { color: var(--ink); }

/* ── Ancla al pipeline (isapre + plan del cliente) ── */
.nt-ancla { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; margin: 12px 0 18px; }
.nt-ancla-main { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; flex: 1; min-width: 0; }
.nt-ancla-isa { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.nt-ancla-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.nt-ancla-plan { font-size: 13px; color: var(--mut); position: relative; padding-left: 14px; }
.nt-ancla-plan::before { content: ""; position: absolute; left: 5px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--line2, #cbd5e1); transform: translateY(-50%); }
.nt-ancla-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.nt-ancla-cot { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--brand); background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; white-space: nowrap; transition: border-color var(--t), background var(--t); }
.nt-ancla-cot:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); }
.nt-ancla-cot .nt-mini-ic { width: 14px; height: 14px; }
.nt-ancla-edit { -webkit-appearance: none; appearance: none; background: transparent; border: 0; padding: 6px 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--mut); text-decoration: underline; cursor: pointer; }
.nt-ancla-edit:hover { color: var(--ink); }
.nt-ancla-add { -webkit-appearance: none; appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mut); background: transparent; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 13px; margin: 12px 0 18px; transition: color var(--t), border-color var(--t); }
.nt-ancla-add:hover { color: var(--ink); border-color: #cbd5e1; }
.nt-ancla-add .nt-mini-ic { width: 14px; height: 14px; }
/* Editor inline del ancla */
.nt-ancla-editing { flex-direction: column; align-items: stretch; gap: 10px; }
.nt-ancla-lbl { font-size: 13px; font-weight: 700; color: var(--ink); }
.nt-isa-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.nt-isa-chip { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; transition: color var(--t), border-color var(--t), background var(--t); }
.nt-isa-chip:hover { border-color: #cbd5e1; color: var(--ink); }
.nt-isa-chip.is-on { color: var(--brand); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); font-weight: 700; }
.nt-plan-box { position: relative; }
.nt-ancla-plan-in { -webkit-appearance: none; appearance: none; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
.nt-ancla-plan-in:focus { outline: none; border-color: var(--brand); }
.nt-plan-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .10); max-height: 264px; overflow-y: auto; padding: 4px; }
.nt-plan-opt { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 7px; padding: 8px 10px; }
.nt-plan-opt:hover { background: var(--bg); }
.nt-plan-opt b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.nt-plan-opt span { font-size: 11.5px; color: var(--mut); }
.nt-plan-hint { font-size: 11.5px; color: var(--mut); margin-top: 6px; }
.nt-plan-more { font-size: 11.5px; color: var(--mut); text-align: center; padding: 7px 8px 4px; border-top: 1px solid var(--line); margin-top: 3px; }
.nt-ancla-ed-actions { display: flex; align-items: center; gap: 8px; }
.nt-ancla-save { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 9px; padding: 9px 16px; }
.nt-ancla-save:hover { background: var(--brand-d); }
.nt-ancla-clear, .nt-ancla-cancel { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--mut); background: transparent; border: 0; padding: 8px 6px; }
.nt-ancla-clear:hover, .nt-ancla-cancel:hover { color: var(--ink); }
/* Tag de isapre en la fila de la lista */
.nt-isa-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--mut); }

/* ── Mensaje IA para el cliente ── */
.nt-msg { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; margin-top: 16px; }
.nt-msg-head { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.nt-msg-head strong { font-size: 14.5px; font-weight: 700; }
.nt-msg-head .nt-mini-ic { color: var(--brand-d); }
.nt-msg-sub { font-size: 12.5px; color: var(--mut); margin-top: 3px; }
.nt-msg-text { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; min-height: 96px; resize: vertical; background: #fff; color: var(--ink); }
.nt-msg-text:focus { outline: none; border-color: var(--brand); }
.nt-msg-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.nt-msg-copy { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 16px; transition: background var(--t), border-color var(--t); }
.nt-msg-copy:hover { background: var(--bg); border-color: #cbd5e1; }
.nt-msg-close { font-size: 13px; font-weight: 600; color: var(--mut); background: transparent; border: 0; padding: 6px 8px; }
.nt-msg-close:hover { color: var(--ink); }

/* ── Agenda agrupada en "Para no olvidar" ── */
.nt-ins-group { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; margin: 12px 6px 3px; }
.nt-ins-group:first-child { margin-top: 2px; }
.nt-ins-group.is-late { color: var(--err); }

/* ============================================================
   TAB NOTAS · v5 — feedback Gonzalo: (1) banner visible mientras
   la IA trabaja; (2) recordatorio en UNA caja que entiende la
   fecha escrita ("llamar el lunes"), sin campo DD-MM-AAAA.
   Va al final → gana.
   ============================================================ */

/* ── Banner "la IA está trabajando" ── */
.nt-think[hidden] { display: none !important; }
.nt-think { display: flex; align-items: center; gap: 11px; background: var(--brand-50); border: 1px solid #bfdbfe; border-radius: 12px; padding: 12px 15px; margin: 6px 0 14px; }
.nt-think-orb { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; animation: ntThinkPulse 1.4s ease-in-out infinite; }
.nt-think-orb .nt-ico { width: 16px; height: 16px; }
.nt-think-tx { font-size: 14px; font-weight: 600; color: var(--brand-d); }
.nt-think-dots { display: inline-flex; align-items: center; gap: 3px; }
.nt-think-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-d); animation: ntThinkDot 1.2s ease-in-out infinite; }
.nt-think-dots i:nth-child(2) { animation-delay: .2s; }
.nt-think-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ntThinkPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes ntThinkDot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ── Recordatorio en una caja ── */
.nt-rec-new { margin-top: 8px; }
.nt-rec-new .nt-rec-in { width: 100%; font-size: 13.5px; }
.nt-rec-hint[hidden] { display: none !important; }
.nt-rec-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; font-size: 12.5px; color: var(--mut); }
.nt-rh-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #15803d; }
.nt-rh-ok b { font-weight: 800; }
.nt-rh-q { font-weight: 600; color: var(--ink); }
.nt-rh-skip { font-size: 12px; color: #94a3b8; }
.nt-chip-cal { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.nt-chip-cal .nt-mini-ic { width: 13px; height: 13px; }
.nt-chip-cal input[type="date"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nt-rec-go { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 9px; padding: 9px 16px; transition: background var(--t); }
.nt-rec-go:hover { background: var(--brand-d); }

/* ── v5.1: pendientes con acción explícita "Hecho" ── */
.nt-recs-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
.nt-rec-hecho { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; font-weight: 600; color: var(--mut); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; transition: all var(--t); }
.nt-rec-hecho .nt-mini-ic { width: 12px; height: 12px; }
.nt-rec-hecho:hover { border-color: #16a34a; color: #15803d; background: #f0fdf4; }
.nt-rec.is-done .nt-rec-hecho:hover { border-color: #cbd5e1; color: var(--ink); background: var(--card); }

/* ============================================================
   TAB NOTAS · v6 — sección Recordatorios (segmented en el sheet
   + agenda completa en el canvas), hora en recordatorios y
   selección múltiple de notas (patrón QuVi IA). Va al final.
   ============================================================ */

/* ── Segmented Notas / Recordatorios ──
   Contraste por color (no por brillo): contenedor gris, pill activa blanca
   con texto + borde azul → se aprecia cuál está activo de un vistazo.
   Más alto (padding 9px) para no verse más bajo que "Dictar llamada", y
   más separación (margin-bottom 18px) respecto a los botones de acción. */
.nt-seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.nt-seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--mut); background: transparent; border: 1.5px solid transparent; border-radius: 9px; padding: 9px 4px; transition: all var(--t); }
.nt-seg-btn:hover { color: var(--ink); }
.nt-seg-btn .nt-mini-ic { width: 15px; height: 15px; }
.nt-seg-btn.is-on { background: #fff; color: var(--brand-d); border-color: var(--brand); font-weight: 700; }
.nt-seg-btn.is-on .nt-ico { color: var(--brand); }
.nt-seg-n { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; }
.nt-seg-n[hidden] { display: none; }

/* ── Barra de lista + selección múltiple ── */
.nt-listbar { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.nt-listbar-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; }
.nt-sel-toggle { background: transparent; border: 0; color: var(--brand); font-size: 12px; font-weight: 600; padding: 3px 4px; border-radius: 6px; transition: background var(--t); }
.nt-sel-toggle:hover { background: var(--brand-50); }
.nt-item--sel { display: flex; align-items: flex-start; gap: 10px; }
.nt-check { width: 18px; height: 18px; flex: none; margin-top: 2px; border: 1.5px solid #cbd5e1; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; transition: background var(--t), border-color var(--t); }
.nt-check .nt-ico { width: 12px; height: 12px; }
.nt-item--sel.is-checked { background: var(--brand-50); }
.nt-item--sel.is-checked .nt-check { background: var(--brand); border-color: var(--brand); }
.nt-item-seltxt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-sfooter { padding: 10px 14px; border-top: 1px solid var(--line); }
.nt-sfooter[hidden] { display: none; }
.nt-sel-del { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: #fff; background: var(--err, #dc2626); border: 0; border-radius: 9px; padding: 10px; transition: opacity var(--t); }
.nt-sel-del:disabled { opacity: .45; cursor: default; }

/* ── Sección Recordatorios (canvas) ──
   Va dentro de .nt-ebody--agd, que le da el MISMO padding/ancho/scroll que
   el editor → deja de quedar pegada a los bordes y se alinea al cambiar de
   vista (sin salto horizontal). Por eso .agd ya no fija su propio ancho. */
.nt-ebody--agd { display: block; }
.agd { width: 100%; }
.agd-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 4px; }
.agd-head p { font-size: 14px; color: var(--mut); margin: 0 0 18px; }
.agd-head p b { color: var(--ink); }
.agd-add { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; }
.agd-group { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; margin: 18px 2px 6px; }
.agd-group.is-late { color: var(--err); }
.agd-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; margin-bottom: 7px; }
.agd-row.is-done { opacity: .62; }
.agd-row.is-done .agd-row-txt { text-decoration: line-through; }
.agd-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agd-row-txt { font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.agd-row-nota { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 0; padding: 0; font-size: 12px; font-weight: 600; color: var(--mut); transition: color var(--t); }
.agd-row-nota:hover { color: var(--brand-d); }
.agd-row-nota .nt-mini-ic { width: 11px; height: 11px; }

/* Pastilla de fecha como botón (toca para posponer/reprogramar). */
.nt-rec-date-btn { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 3px 9px; transition: all var(--t); }
.nt-rec-date-btn:hover { border-color: var(--line); background: var(--bg); color: var(--ink); }
/* Botón lápiz (editar fila). */
.agd-row-edit-btn { -webkit-appearance: none; appearance: none; cursor: pointer; background: transparent; border: 0; padding: 2px; flex: none; color: #cbd5e1; display: inline-flex; transition: color var(--t); }
.agd-row-edit-btn:hover { color: var(--brand); }
.agd-row-edit-btn .nt-ico { width: 15px; height: 15px; }

/* Popover "Recordármelo…" (posponer). */
.agd-snz { z-index: 9700; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 38px rgba(15,23,42,.16); padding: 7px; width: 184px; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; }
.agd-snz-h { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .03em; padding: 4px 8px 5px; }
.agd-snz-opt { -webkit-appearance: none; appearance: none; cursor: pointer; text-align: left; border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); border-radius: 8px; padding: 8px 9px; display: flex; align-items: center; gap: 7px; transition: background var(--t); }
.agd-snz-opt:hover { background: var(--bg); }
.agd-snz-cal { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 9px; border-radius: 0 0 8px 8px; color: var(--mut); }
.agd-snz-cal .nt-mini-ic { width: 14px; height: 14px; }

/* Fila en edición inline. */
.agd-row-editing { display: block; }
.agd-ed { display: flex; flex-direction: column; gap: 9px; }
.agd-ed-txt { width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none; box-sizing: border-box; transition: border-color var(--t); }
.agd-ed-txt:focus { border-color: var(--brand); }
.agd-ed-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.agd-ed-field { -webkit-appearance: none; appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; transition: border-color var(--t); }
.agd-ed-field:hover { border-color: var(--brand); }
.agd-ed-field .nt-mini-ic { width: 14px; height: 14px; color: var(--mut); }
.agd-ed-time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); }
.agd-ed-time .nt-mini-ic { width: 14px; height: 14px; }
.agd-ed-time input[type=time] { font: inherit; font-size: 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; outline: none; }
.agd-ed-time input[type=time]:focus { border-color: var(--brand); }
.agd-ed-deft { font-size: 11.5px; color: #94a3b8; }
.agd-ed-clear { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--mut); background: transparent; border: 0; padding: 4px 6px; border-radius: 6px; transition: color var(--t); }
.agd-ed-clear:hover { color: var(--err); }
.agd-ed-actions { display: flex; gap: 8px; }
.agd-ed-save { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 9px; padding: 8px 16px; transition: background var(--t); }
.agd-ed-save:hover { background: var(--brand-d); }
.agd-ed-cancel { -webkit-appearance: none; appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--mut); background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; transition: all var(--t); }
.agd-ed-cancel:hover { border-color: #cbd5e1; color: var(--ink); }
.agd-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 36px 20px; color: var(--mut); }
.agd-empty .nt-ico { width: 28px; height: 28px; color: #cbd5e1; }
.agd-empty strong { font-size: 15.5px; color: var(--ink); }
.agd-empty span { font-size: 13.5px; line-height: 1.55; max-width: 420px; }
.agd-add .nt-rec-in { width: 100%; font-size: 13.5px; }

/* ============================================================
   TAB RECORDATORIOS (#asCanvas.rec-canvas) — sección propia
   (su botón en el menú izquierdo). Solo canvas, sin rieles.
   Reusa los estilos .agd-* / .nt-rec-* de la libreta.
   ============================================================ */
.canvas.rec-canvas { padding: 0; }
.rec-scroll { width: 100%; padding: 30px 32px 52px; }
.rec-scroll .agd { max-width: 760px; margin: 0 auto; width: 100%; }

/* ============================================================
   ASISTENTE "Nueva nota" paso a paso (#ntEditorHost > .wiz)
   Una pregunta a la vez, pensado para 50+. Vive en el canvas
   del editor; reusa tokens y el lenguaje visual de Notas.
   ============================================================ */
.wiz { max-width: 600px; margin: 0 auto; padding: 24px 30px 44px; width: 100%; display: flex; flex-direction: column; }
.wiz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.wiz-steps { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-d); background: var(--brand-50); padding: 4px 9px; border-radius: 999px; }
.wiz-x { display: inline-flex; align-items: center; gap: 5px; height: 38px; box-sizing: border-box; font-size: 13px; font-weight: 600; color: var(--mut); background: var(--card); border: 1px solid var(--line); padding: 0 14px; border-radius: 9px; transition: background var(--t), border-color var(--t), color var(--t); }
.wiz-x:hover { color: var(--ink); background: var(--bg); border-color: #cbd5e1; }
.wiz-x .nt-mini-ic { width: 13px; height: 13px; }
.wiz-q { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.25; margin: 0 0 5px; }
/* Fila del título con "Tocar y dictar" a la derecha (paso de dictado). */
.wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.wiz-head .wiz-q { margin: 0; }
.wiz-head .wiz-mic { margin-bottom: 0; align-self: center; flex: none; }
.wiz-help { font-size: 13.5px; line-height: 1.5; color: var(--mut); margin: 0 0 18px; }
.wiz-flabel { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 0 7px; }
.wiz-nombre + .wiz-flabel { margin-top: 12px; }

/* Paso "¿de quién?" — tarjetas */
.wiz-choices { display: flex; flex-direction: column; gap: 9px; }
.wiz-choice { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; transition: border-color var(--t), background var(--t); }
.wiz-choice:hover { border-color: var(--ic); background: color-mix(in srgb, var(--ic) 5%, #fff); }
.wiz-choice-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ic) 13%, transparent); color: var(--ic); }
.wiz-choice-ic .nt-ico { width: 17px; height: 17px; }
.wiz-choice-tx { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wiz-choice-tx strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.wiz-choice-tx span { font-size: 12.5px; line-height: 1.4; color: var(--mut); }
.wiz-choice-arrow { width: 16px; height: 16px; flex: none; color: #cbd5e1; }
.wiz-choice:hover .wiz-choice-arrow { color: var(--ic); }

/* Paso captura */
.wiz-nombre { width: 100%; font-size: 13.5px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; background: #fff; color: var(--ink); }
.wiz-nombre:focus { outline: none; border-color: var(--brand); }
.wiz-mic { display: inline-flex; align-items: center; justify-content: center; gap: 7px; align-self: flex-start; height: 38px; box-sizing: border-box; font-size: 13.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); border: 0; border-radius: 10px; padding: 0 16px; margin-bottom: 11px; transition: filter var(--t); }
/* En la fila de acciones (junto a Continuar) no necesita el margen inferior ni
   el align propio de cuando iba suelto arriba. */
.wiz-actions .wiz-mic { align-self: auto; margin-bottom: 0; }
.wiz-text + .wiz-dict { margin-top: 10px; }
.wiz-mic:hover { filter: brightness(1.05); }
.wiz-mic.is-recording { background: linear-gradient(135deg, #ef4444 0%, #be123c 100%); }
.wiz-mic .nt-ico { width: 16px; height: 16px; }
.wiz-dict { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: #9f1239; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 10px; padding: 10px 13px; margin-bottom: 11px; }
.wiz-dict[hidden] { display: none !important; }
.wiz-text { width: 100%; min-height: 150px; font: inherit; font-size: 13.5px; line-height: 1.55; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #fff; color: var(--ink); resize: vertical; }
.wiz-text:focus { outline: none; border-color: var(--brand); }

/* Paso ordenar */
.wiz-preview { font-size: 13px; line-height: 1.55; color: var(--mut); background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; margin-bottom: 18px; max-height: 180px; overflow-y: auto; white-space: pre-wrap; }

/* Acciones */
.wiz-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.wiz-actions-col { flex-direction: column; align-items: stretch; }
.wiz-actions-end { justify-content: flex-end; }
/* Cancelar + botón principal agrupados a la derecha (mic, si hay, queda a la izq). */
.wiz-actions-r { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.wiz-actions-r .wiz-next { margin-left: 0; }
.wiz-ord-foot { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 2px; }
.wiz-next { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-left: auto; height: 38px; box-sizing: border-box; font-size: 13.5px; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 10px; padding: 0 18px; transition: background var(--t); }
.wiz-actions-col .wiz-next { margin-left: 0; }
.wiz-next:hover { background: var(--brand-d); }
.wiz-next .nt-ico { width: 16px; height: 16px; }
.wiz-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--mut); background: transparent; border: 0; padding: 9px 4px; }
.wiz-back:hover { color: var(--ink); }
.wiz-back .nt-mini-ic { width: 14px; height: 14px; }
.wiz-plain { font-size: 13px; font-weight: 600; color: var(--mut); background: transparent; border: 0; padding: 9px; }
.wiz-plain:hover { color: var(--ink); }
.wiz-proc { padding-top: 40px; }

/* ── Notas v11: sidebar sin botones grandes + filtros verticales ── */
.nt-newbtn { -webkit-appearance: none; appearance: none; cursor: pointer; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; transition: border-color var(--t), background var(--t); }
.nt-newbtn:hover { border-color: #cbd5e1; background: var(--bg); }
.nt-newbtn .nt-mini-ic { width: 15px; height: 15px; }
/* Filtros verticales (reusa .hx-filter del historial), con aire arriba */
.nt-vfilters { margin: 4px 0 2px; }

/* ── Aviso de recordatorio (reloj de alarmas), clickeable → Recordatorios ── */
.as-alarma-toast { display: flex; align-items: center; gap: 10px; cursor: pointer; pointer-events: auto; max-width: 420px; padding: 12px 16px; }
.as-alarma-ic { font-size: 16px; flex: none; }
.as-alarma-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-alarma-go { flex: none; font-weight: 700; color: #93c5fd; }

/* ── Tarjeta de avisos en la pestaña Recordatorios ── */
.agd-aviso-card { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 18px 0 22px; }
.agd-aviso-card.is-on { border-color: #bfdbfe; background: var(--brand-50); }
.agd-aviso-card.is-blocked { border-color: #fde68a; background: #fffbeb; }
.agd-aviso-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--mut); }
.agd-aviso-card.is-on .agd-aviso-ic { background: #dbeafe; color: var(--brand-d); }
.agd-aviso-card.is-blocked .agd-aviso-ic { background: #fef3c7; color: #b45309; }
.agd-aviso-ic .nt-ico { width: 18px; height: 18px; }
.agd-aviso-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agd-aviso-info strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.agd-aviso-info span { font-size: 12.5px; line-height: 1.45; color: var(--mut); }
.agd-aviso-sw { -webkit-appearance: none; appearance: none; cursor: pointer; flex: none; position: relative; width: 42px; height: 24px; border: 0; border-radius: 999px; background: #cbd5e1; transition: background var(--t); }
.agd-aviso-card.is-on .agd-aviso-sw { background: var(--brand); }
.agd-aviso-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--t); }
.agd-aviso-card.is-on .agd-aviso-knob { transform: translateX(18px); }

/* ── Badge del menú: pendientes de Recordatorios para hoy ── */
.tool-icon { position: relative; }
.tool-badge { position: absolute; top: -5px; right: -7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; box-sizing: border-box; pointer-events: none; }
.tool-badge[hidden] { display: none; }

/* ── "Hechos hace poco" colapsable + agrupado por fecha ── */
.agd-hechos-tog { -webkit-appearance: none; appearance: none; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 10px 2px; margin-top: 16px; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; transition: color var(--t); }
.agd-hechos-tog:hover { color: var(--mut); }
.agd-hechos-chev { width: 14px; height: 14px; flex: none; transition: transform var(--t); }
.agd-hechos-tog.is-open .agd-hechos-chev { transform: rotate(90deg); }
.agd-hechos-n { font-size: 10.5px; font-weight: 700; color: var(--mut); background: var(--bg); border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center; }
.agd-group-done { color: #94a3b8; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12px; margin: 14px 2px 6px; }
.agd-hechos-more { font-size: 12px; color: #94a3b8; padding: 10px 2px; text-align: center; }

/* ── Date picker propio (popover) — reemplaza el calendario nativo ── */
.dp-pop { z-index: 9700; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 38px rgba(15,23,42,.16); padding: 13px; width: 252px; box-sizing: border-box; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.dp-title { font-size: 13.5px; font-weight: 700; color: var(--ink); text-transform: capitalize; }
.dp-nav { -webkit-appearance: none; appearance: none; cursor: pointer; width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1; transition: background var(--t); }
.dp-nav:hover { background: #e2e8f0; }
.dp-dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dp-dows span { text-align: center; font-size: 10.5px; font-weight: 700; color: #94a3b8; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-cell { height: 31px; }
.dp-day { -webkit-appearance: none; appearance: none; cursor: pointer; width: 100%; height: 31px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); transition: background var(--t); }
.dp-day:hover { background: var(--brand-50); }
.dp-day.is-today { font-weight: 800; color: var(--brand-d); }
.dp-day.is-sel { background: var(--brand); color: #fff; font-weight: 700; }
.dp-day.is-sel:hover { background: var(--brand-d); }
.dp-day.is-dis { color: #cbd5e1; cursor: default; }
.dp-day.is-dis:hover { background: transparent; }

/* ============================================================
   Identidad real del cliente: correo bajo el nombre + modo discreto
   ============================================================ */
/* Correo real, solo en la Ficha del cliente (las listas muestran solo el nombre,
   para no recargarlas). */
.fx-mail { font-size: 13px; color: var(--mut); margin-top: 2px; word-break: break-all; }

/* Aviso de seguridad al pie de Inicio: acordeón (cerrado por defecto), tono
   disclaimer pero legible. Separado del botón Cotizar, solo separador arriba. */
.home-seg { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }
.home-seg-head { display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; user-select: none; }
.home-seg-head::-webkit-details-marker { display: none; }
.home-seg-title { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--mut); }
.home-ico.home-seg-shield { width: 14px; height: 14px; color: var(--mut); }
.home-ico.home-seg-chev { width: 15px; height: 15px; color: var(--mut); margin-left: auto; transition: transform .18s ease; }
.home-seg[open] .home-seg-chev { transform: rotate(90deg); }
.home-seg-list { list-style: none; margin: 11px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.home-seg-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45; color: #475569; }
.home-ico.home-seg-ic { width: 13px; height: 13px; color: #16a34a; flex: 0 0 auto; margin-top: 1.5px; }

/* Switch "modo discreto" en el topbar: ojo abierto (datos a la vista) vs. ojo
   tachado (datos ocultos). Estado activo sutil, sin resplandor. */
.tb-discreet .ic-eyeoff { display: none; }
.tb-discreet.is-on .ic-eye { display: none; }
.tb-discreet.is-on .ic-eyeoff { display: inline-block; }
.tb-discreet.is-on { color: var(--brand); background: var(--brand-50); border-color: var(--brand-50); }

/* ── Ayuda y soporte ──────────────────────────────────────────────────
   Botón "Ayuda" en el topbar (junto a Buscar) + panel con dos caminos.
   Sin resplandor: bordes sólidos, contraste por color. */
.tb-ayuda .ayu-ico { width: 14px; height: 14px; }
.tb-ayuda.is-active { border-color: var(--brand); color: var(--brand-d); background: var(--brand-50); }

.ayu-panel { position: fixed; z-index: 8000; width: 340px; max-width: calc(100vw - 24px); background: var(--card, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(15,23,42,.18); overflow: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease; }
.ayu-panel.is-in { opacity: 1; transform: translateY(0); }
.ayu-panel[hidden] { display: none !important; }
.ayu-ico { flex: none; }

.ayu-head { padding: 15px 16px 12px; border-bottom: 1px solid var(--line); }
.ayu-head strong { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
.ayu-head span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.ayu-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ayu-opt { appearance: none; width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; transition: border-color var(--t), background var(--t); }
.ayu-opt:hover { border-color: var(--brand); background: #f6f9fc; }
.ayu-opt-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.ayu-opt-ic .ayu-ico { width: 19px; height: 19px; }
.ayu-ic-warn { color: #ef4444; background: #fee2e2; }
.ayu-ic-chat { color: var(--brand-d); background: var(--brand-50); }
.ayu-opt-tx { flex: 1; min-width: 0; }
.ayu-opt-tx strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ayu-opt-tx span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.ayu-chev { width: 16px; height: 16px; color: #cbd5e1; flex: none; }
.ayu-opt:hover .ayu-chev { color: var(--brand); }

.ayu-foot { padding: 4px 8px 12px; }
.ayu-mail { appearance: none; width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: none; background: none; border-radius: 10px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; transition: background var(--t); }
.ayu-mail:hover { background: #f1f5f9; }
.ayu-mail strong { font-weight: 700; color: var(--brand-d); }
.ayu-mail-ic { width: 16px; height: 16px; color: var(--muted); }
.ayu-note { margin: 6px 12px 0; font-size: 11.5px; line-height: 1.45; color: #94a3b8; }

@media (prefers-reduced-motion: reduce) {
  .ayu-panel { transition: none !important; }
}
