/* ════════════════════════════════════════════════════════════════════════════════════════════════
   Bandeja Luminous — la capa nueva de la Bandeja (/app/inbox), encima de inbox.css.

   Reparto: TODA regla va bajo .app-shell .wa-inbox y sus piezas nuevas se llaman ibx-. Sólo tokens de
   base.css (lx-*, primary, brand-dark…); los colores de canal salen de ChannelIcon. Lo que se reajusta de
   inbox.css (lista, hilo, panel) se nombra aquí con su clase wa- para que se vea de dónde viene.
   El bloque móvil va al final.
   ════════════════════════════════════════════════════════════════════════════════════════════════ */

.app-shell .wa-inbox {
    --ibx-warn: #92400e;
    --ibx-hot: #b91c1c;
    --ibx-ok: #065f46;
    --ibx-info: var(--primary-dark);
    --ibx-row-line: color-mix(in srgb, var(--lx-line) 70%, #fff);
    background: var(--lx-ground);
}
.app-shell .wa-inbox .ibx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-shell .wa-inbox .ibx-scrim { position: fixed; inset: 0; z-index: 40; }

/* ── Columna de la lista ─────────────────────────────────────────────────────────────────────── */
.app-shell .wa-inbox .wa-sidebar { background: var(--lx-ground); border-right-color: var(--lx-line); }
.app-shell .wa-inbox .wa-search-wrap { background: transparent; }
.app-shell .wa-inbox .wa-search {
    min-height: 44px; border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card);
}
.app-shell .wa-inbox .wa-search:focus-within { border-color: var(--primary-mid); box-shadow: var(--focus-ring); }

/* Carpeta = título de la lista */
.app-shell .wa-inbox .ibx-folder-wrap { position: relative; flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-folder {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .25rem; border: 0; background: none;
    border-radius: var(--radius); color: var(--brand-dark); font: inherit; font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; cursor: pointer;
}
.app-shell .wa-inbox .ibx-folder:hover { color: var(--primary); }
.app-shell .wa-inbox .ibx-folder:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-folder-menu {
    position: absolute; inset-inline-start: 0; top: calc(100% + .3rem); z-index: 41; width: min(290px, 86vw);
    display: flex; flex-direction: column; padding: .35rem;
    border-radius: 16px; border: 1px solid var(--lx-line); background: var(--bg-card); box-shadow: var(--shadow-lg);
    animation: ibx-pop .14s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-fm {
    display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 42px; padding: 0 .65rem; box-sizing: border-box;
    border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox .ibx-fm:hover { background: var(--surface-hover); }
.app-shell .wa-inbox .ibx-fm.on { background: var(--lx-tint); color: var(--brand-dark); font-weight: 700; }
.app-shell .wa-inbox .ibx-fm.warn .ibx-fm-ic { color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-fm-ic { display: inline-grid; place-items: center; width: 22px; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-fm-n { margin-inline-start: auto; font-size: .75rem; font-weight: 700; color: var(--lx-ink-muted); font-variant-numeric: tabular-nums; }
.app-shell .wa-inbox .ibx-fm-sep { border-top: 1px solid var(--ibx-row-line); margin: .25rem .4rem; }
.app-shell .wa-inbox .ibx-fm-head { padding: .5rem .65rem .15rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-ink-muted); }

/* «Para ti»: cuatro recuentos */
.app-shell .wa-inbox .ibx-tri { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding: .35rem .75rem .25rem; }
.app-shell .wa-inbox .ibx-tile {
    display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .5rem .75rem; box-sizing: border-box;
    border-radius: 16px; border: 1px solid var(--lx-line); background: var(--bg-card); font: inherit; text-align: start; cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.app-shell .wa-inbox .ibx-tile:hover { border-color: var(--primary-mid); transform: translateY(-1px); }
.app-shell .wa-inbox .ibx-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-tile.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--lx-tint-soft); }
.app-shell .wa-inbox .ibx-tile b { font-size: 1.35rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-tile span { font-size: .76rem; line-height: 1.25; color: var(--text-secondary); }
.app-shell .wa-inbox .ibx-tile.warn b { color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-tile.hot b { color: var(--ibx-hot); }
.app-shell .wa-inbox .ibx-tile.ai b { color: var(--primary); }

/* Botón «Filtros» siempre visible junto al buscador */
.app-shell .wa-inbox .ibx-findrow { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem .25rem; }
.app-shell .wa-inbox .ibx-findrow .wa-search-wrap { flex: 1; min-width: 0; padding: 0; }
.app-shell .wa-inbox .ibx-filter-btn {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem; flex: none;
    border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark);
    font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.app-shell .wa-inbox .ibx-filter-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.app-shell .wa-inbox .ibx-filter-btn b {
    min-width: 18px; height: 18px; border-radius: var(--radius-full); background: #fff; color: var(--primary);
    display: inline-grid; place-items: center; font-size: .7rem;
}
.app-shell .wa-inbox .ibx-filter-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Filtros como diálogo lateral (era un menú de 30 controles escondido detrás de «Vistas») */
.app-shell .wa-inbox .wa-views-bar { padding-inline: .75rem; }
.app-shell .wa-inbox .wa-views-menu.ibx-filters {
    border-radius: 22px; border: 1px solid var(--lx-line); box-shadow: 0 30px 70px rgba(14, 6, 91, .22);
}
.app-shell .wa-inbox .ibx-chan-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.app-shell .wa-inbox .ibx-chip {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 34px; padding: 0 .75rem; box-sizing: border-box;
    border-radius: var(--radius-full); border: 1px solid var(--lx-line); background: var(--bg-card);
    color: var(--brand-dark); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.app-shell .wa-inbox .ibx-chip:hover { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-chip.on { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.app-shell .wa-inbox .ibx-chip small { font-size: .7rem; font-weight: 700; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-chip.on small { color: color-mix(in srgb, #fff 75%, transparent); }
.app-shell .wa-inbox .ibx-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Avisos fuera de la Entrada: una línea discreta al final */
.app-shell .wa-inbox .ibx-quiet {
    display: flex; align-items: center; gap: .5rem; margin: .5rem .75rem; padding: .6rem .75rem;
    border-radius: 14px; border: 1px dashed var(--lx-tint-line); font-size: .78rem; color: var(--text-secondary);
}
.app-shell .wa-inbox .ibx-quiet button { margin-inline-start: auto; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; min-height: 32px; }

/* La lista: tarjeta con separadores claros entre conversaciones */
.app-shell .wa-inbox .wa-conv-list-head { padding-inline: .75rem; }
.app-shell .wa-inbox .wa-conv-list {
    margin: .25rem .75rem .75rem; padding: 0; background: var(--bg-card);
    border: 1px solid var(--lx-line); border-radius: 18px;
}
.app-shell .wa-inbox .wa-conv-item {
    margin: 0; border: 0; border-radius: 0; border-top: 1px solid var(--ibx-row-line); min-height: 74px; padding: .7rem .75rem;
}
.app-shell .wa-inbox .wa-conv-item:first-child { border-top: 0; border-radius: 18px 18px 0 0; }
.app-shell .wa-inbox .wa-conv-item:hover { background: var(--lx-tint-soft); box-shadow: none; }
.app-shell .wa-inbox .wa-conv-item.active { background: var(--lx-tint); box-shadow: none; }
.app-shell .wa-inbox .wa-conv-item.active::before { inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; background: var(--primary); }
.app-shell .wa-inbox .wa-conv-avatar { border-radius: 14px; }

/* El motivo de la fila */
.app-shell .wa-inbox .ibx-why {
    display: flex; align-items: center; gap: .35rem; min-width: 0; margin-top: .15rem;
    font-size: .74rem; font-weight: 700; line-height: 1.3;
}
.app-shell .wa-inbox .ibx-why span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-why i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.app-shell .wa-inbox .ibx-why.warn { color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-why.hot { color: var(--ibx-hot); }
.app-shell .wa-inbox .ibx-why.info { color: var(--ibx-info); }
.app-shell .wa-inbox .ibx-why.ok { color: var(--ibx-ok); }

/* ── Hilo ────────────────────────────────────────────────────────────────────────────────────── */
/* Fondo con dibujos (como WhatsApp), con los motivos del producto: burbujas, estrella de IA, sobre,
   teléfono, calendario… a 4 % de tinta y trazo fino, sobre un fondo casi blanco: se nota sin pedir atención. */
.app-shell .wa-inbox .wa-messages {
    background-color: color-mix(in srgb, var(--lx-ground) 88%, var(--lx-tint));
    background-image: url('/img/chat-bg-lx.svg?v=2');
    background-size: 360px 360px;
    background-repeat: repeat;
}

/* Quién atiende */
.app-shell .wa-inbox .ibx-attend {
    display: flex; align-items: center; gap: .75rem; min-height: 52px; padding: .5rem 1.1rem; box-sizing: border-box;
    border-bottom: 1px solid var(--lx-tint-line);
    background: linear-gradient(90deg, var(--lx-tint), var(--lx-tint-soft));
}
.app-shell .wa-inbox .ibx-attend.person { background: linear-gradient(90deg, color-mix(in srgb, var(--success) 10%, #fff), var(--lx-tint-soft)); border-bottom-color: color-mix(in srgb, var(--success) 28%, transparent); }
.app-shell .wa-inbox .ibx-attend.nobody { background: linear-gradient(90deg, color-mix(in srgb, var(--warning) 12%, #fff), var(--lx-tint-soft)); border-bottom-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.app-shell .wa-inbox .ibx-attend-ic {
    width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--bg-card); color: var(--primary);
    box-shadow: 0 1px 2px rgba(14, 6, 91, .08);
}
.app-shell .wa-inbox .ibx-attend.person .ibx-attend-ic { color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-attend.nobody .ibx-attend-ic { color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-attend-copy { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-attend-copy strong { display: block; font-size: .84rem; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-attend-copy small { display: block; font-size: .76rem; color: var(--text-secondary); margin-top: 1px; }
.app-shell .wa-inbox .ibx-attend-acts { display: flex; align-items: center; gap: .5rem; flex: none; }
.app-shell .wa-inbox .ibx-btn {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: 0 .85rem; box-sizing: border-box;
    border-radius: 12px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark);
    font: inherit; font-size: .8rem; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.app-shell .wa-inbox .ibx-btn:hover:not(:disabled) { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.app-shell .wa-inbox .ibx-btn.pri:hover:not(:disabled) { background: var(--primary-dark); }
.app-shell .wa-inbox .ibx-btn:disabled { opacity: .55; cursor: not-allowed; }
.app-shell .wa-inbox .ibx-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-menu-wrap { position: relative; }
.app-shell .wa-inbox .ibx-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + .35rem); z-index: 41; min-width: 230px;
    display: flex; flex-direction: column; padding: .35rem;
    border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card); box-shadow: var(--shadow-lg);
    animation: ibx-pop .14s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-menu > button {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 42px; padding: .35rem .7rem; justify-content: center;
    border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: .85rem; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox .ibx-menu > button:hover { background: var(--surface-hover); }
.app-shell .wa-inbox .ibx-menu > button small { font-size: .72rem; color: var(--lx-ink-muted); }

/* Buscar en el hilo */
.app-shell .wa-inbox .ibx-find {
    display: flex; align-items: center; gap: .5rem; min-height: 48px; padding: .35rem 1.1rem; box-sizing: border-box;
    border-bottom: 1px solid var(--lx-line); background: var(--bg-card); color: var(--lx-ink-muted);
    animation: ibx-drop .16s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-find-input {
    flex: 1; min-width: 0; min-height: 36px; border: 0; background: none; outline: none;
    color: var(--text); font: inherit; font-size: .9rem;
}
.app-shell .wa-inbox .ibx-find-count { font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell .wa-inbox .ibx-find-nav {
    width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center;
    border: 0; border-radius: 10px; background: var(--lx-ground); color: var(--brand-dark); cursor: pointer;
}
.app-shell .wa-inbox .ibx-find-nav:disabled { opacity: .4; cursor: default; }
.app-shell .wa-inbox .ibx-find-nav:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-hit-flash { animation: ibx-flash 1.6s ease-out; border-radius: 18px; }

/* Respuestas frecuentes */
.app-shell .wa-inbox .ibx-freq { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .4rem 0 .1rem; }
.app-shell .wa-inbox .ibx-freq-label { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-freq-chip {
    max-width: 260px; min-height: 30px; padding: 0 .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border-radius: var(--radius-full); border: 1px solid var(--lx-line); background: var(--bg-card);
    color: var(--brand-dark); font: inherit; font-size: .78rem; cursor: pointer;
}
.app-shell .wa-inbox .ibx-freq-chip:hover { border-color: var(--primary-mid); background: var(--lx-tint-soft); }
.app-shell .wa-inbox .ibx-freq-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Menú «/» unificado */
.app-shell .wa-inbox .ibx-cmd {
    position: absolute; inset-inline: .5rem; bottom: calc(100% + .4rem); z-index: 30; max-height: min(420px, 60vh); overflow-y: auto;
    display: flex; flex-direction: column; padding: .4rem;
    border-radius: 18px; border: 1px solid var(--lx-line); background: var(--bg-card); box-shadow: 0 24px 60px rgba(14, 6, 91, .18);
    animation: ibx-pop .14s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-cmd-head { padding: .45rem .6rem .15rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-cmd-item {
    display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 44px; padding: .35rem .6rem; box-sizing: border-box;
    border: 0; border-radius: 11px; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox .ibx-cmd-item:hover, .app-shell .wa-inbox .ibx-cmd-item.on { background: var(--lx-tint); }
.app-shell .wa-inbox .ibx-cmd-ic {
    width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--lx-ground); color: var(--brand-dark);
}
.app-shell .wa-inbox .ibx-cmd-ic.ai { background: var(--lx-tint); color: var(--primary); }
.app-shell .wa-inbox .ibx-cmd-text { display: flex; flex-direction: column; min-width: 0; }
.app-shell .wa-inbox .ibx-cmd-text strong { font-size: .86rem; font-weight: 700; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-cmd-text small { font-size: .74rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Panel «Contexto» ────────────────────────────────────────────────────────────────────────── */
.app-shell .wa-inbox .wa-info-panel.ibx-ctx-host { background: var(--lx-ground); border-left-color: var(--lx-line); }
.app-shell .wa-inbox .ibx-ctx { display: flex; flex-direction: column; gap: .75rem; padding: .9rem; }
.app-shell .wa-inbox .ibx-ctx-tabs { display: flex; padding: 3px; border-radius: 12px; border: 1px solid var(--lx-line); background: var(--bg-card); }
.app-shell .wa-inbox .ibx-ctx-tabs button {
    flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: none; color: var(--text-secondary);
    font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
.app-shell .wa-inbox .ibx-ctx-tabs button.on { background: var(--brand-dark); color: #fff; }
.app-shell .wa-inbox .ibx-ctx-tabs button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-ctx-n { min-width: 18px; height: 18px; padding: 0 .3rem; box-sizing: border-box; border-radius: var(--radius-full); background: var(--lx-tint); color: var(--primary-dark); font-size: .68rem; display: inline-grid; place-items: center; }
.app-shell .wa-inbox .ibx-ctx-tabs button.on .ibx-ctx-n { background: color-mix(in srgb, #fff 22%, transparent); color: #fff; }

.app-shell .wa-inbox .ibx-lens {
    display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .75rem; box-sizing: border-box;
    border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--lx-ink-muted);
}
.app-shell .wa-inbox .ibx-lens:focus-within { border-color: var(--primary-mid); box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-lens input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: none; outline: none; color: var(--text); font: inherit; font-size: .86rem; }
.app-shell .wa-inbox .ibx-scope { display: flex; flex-wrap: wrap; gap: .35rem; }

.app-shell .wa-inbox .ibx-results { display: flex; flex-direction: column; gap: .35rem; }
.app-shell .wa-inbox .ibx-gh { display: flex; justify-content: space-between; padding: .35rem .25rem 0; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-hit {
    display: flex; flex-direction: column; gap: .2rem; width: 100%; padding: .6rem .75rem; box-sizing: border-box;
    border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card); font: inherit; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox .ibx-hit:hover { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-hit-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .74rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-hit-head b { color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-hit-text { font-size: .82rem; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-shell .wa-inbox .ibx-hit-text mark { background: color-mix(in srgb, var(--warning) 32%, #fff); color: inherit; border-radius: 3px; padding: 0 1px; }

.app-shell .wa-inbox .ibx-card { padding: .85rem .9rem; border-radius: 20px; border: 1px solid var(--lx-line); background: var(--bg-card); }
.app-shell .wa-inbox .ibx-card.calm { display: flex; align-items: center; gap: .55rem; font-size: .84rem; font-weight: 600; color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-card.dash { border-style: dashed; text-align: center; }
.app-shell .wa-inbox .ibx-card.dash h4 { margin: 0 0 .25rem; font-size: .9rem; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-card.dash p { margin: 0; font-size: .8rem; color: var(--text-secondary); }
.app-shell .wa-inbox .ibx-card.pend { border-color: color-mix(in srgb, var(--warning) 45%, var(--lx-line)); background: linear-gradient(180deg, color-mix(in srgb, var(--warning) 7%, #fff), var(--bg-card)); }
.app-shell .wa-inbox .ibx-ok { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--success) 14%, #fff); font-weight: 800; }
.app-shell .wa-inbox .ibx-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; }
.app-shell .wa-inbox .ibx-card-h h4 { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-card-h small { font-size: .7rem; color: var(--lx-ink-muted); }

.app-shell .wa-inbox .ibx-pend {
    display: flex; align-items: flex-start; gap: .55rem; width: 100%; padding: .45rem .1rem; box-sizing: border-box;
    border: 0; border-top: 1px solid var(--ibx-row-line); background: none; color: var(--text); font: inherit; font-size: .84rem; line-height: 1.4; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox .ibx-pend:first-of-type { border-top: 0; }
.app-shell .wa-inbox .ibx-pend:disabled { cursor: default; }
.app-shell .wa-inbox .ibx-pend:not(:disabled):hover span { color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-pend i { width: 8px; height: 8px; margin-top: .4rem; border-radius: 50%; flex: none; background: var(--warning); }
.app-shell .wa-inbox .ibx-pend small { display: block; font-size: .72rem; color: var(--lx-ink-muted); margin-top: 1px; }

.app-shell .wa-inbox .ibx-ref { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--ibx-row-line); }
.app-shell .wa-inbox .ibx-ref:first-of-type { border-top: 0; }
.app-shell .wa-inbox .ibx-ref-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--lx-tint); color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-ref-ic.file { background: color-mix(in srgb, var(--success) 12%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-ref-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-ref-t b { display: block; font-size: .84rem; color: var(--brand-dark); overflow-wrap: anywhere; }
.app-shell .wa-inbox .ibx-ref-t small { display: block; font-size: .72rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-ref-t small.ok { color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-ref-t small.ko { color: var(--ibx-hot); }
.app-shell .wa-inbox .ibx-ref-t small.wait { color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-mini {
    min-height: 32px; padding: 0 .65rem; flex: none; border-radius: 10px; border: 1px solid var(--lx-line); background: var(--bg-card);
    color: var(--brand-dark); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.app-shell .wa-inbox .ibx-mini:hover:not(:disabled) { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-mini.ghost { border-color: transparent; background: var(--lx-ground); }
.app-shell .wa-inbox .ibx-mini:disabled { opacity: .5; }
.app-shell .wa-inbox .ibx-mini:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.app-shell .wa-inbox .ibx-done { display: flex; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--ibx-row-line); font-size: .82rem; line-height: 1.4; color: var(--text); }
.app-shell .wa-inbox .ibx-done:first-of-type { border-top: 0; }
.app-shell .wa-inbox .ibx-done b { color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-done small { display: block; font-size: .72rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-st { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: .72rem; font-weight: 800; }
.app-shell .wa-inbox .ibx-st.ok { background: color-mix(in srgb, var(--success) 14%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-st.ko { background: color-mix(in srgb, var(--danger) 10%, #fff); color: var(--ibx-hot); }
.app-shell .wa-inbox .ibx-st.wait { background: color-mix(in srgb, var(--warning) 14%, #fff); color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-st.neutral { background: var(--lx-ground); color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-more { align-self: flex-start; min-height: 32px; margin-top: .3rem; padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.app-shell .wa-inbox .ibx-summarize {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: 0 1rem;
    border-radius: 14px; border: 1px solid var(--lx-tint-line); background: var(--lx-tint); color: var(--primary-dark);
    font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.app-shell .wa-inbox .ibx-summarize:hover { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-empty { margin: .25rem 0; font-size: .82rem; color: var(--lx-ink-muted); text-align: center; }
.app-shell .wa-inbox .ibx-skel { height: 58px; border-radius: 16px; background: linear-gradient(90deg, var(--bg-card), var(--lx-tint-soft), var(--bg-card)); background-size: 200% 100%; animation: ibx-shimmer 1.2s linear infinite; }
.app-shell .wa-inbox .ibx-skel.tall { height: 120px; }

/* Archivos */
.app-shell .wa-inbox .ibx-files { display: flex; flex-direction: column; gap: .45rem; }
.app-shell .wa-inbox .ibx-file { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 16px; border: 1px solid var(--lx-line); background: var(--bg-card); }
.app-shell .wa-inbox .ibx-file-ic {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px;
    background: var(--lx-tint); color: var(--primary-dark); font-size: .62rem; font-weight: 800; letter-spacing: .04em;
}
.app-shell .wa-inbox .ibx-file.image .ibx-file-ic { background: linear-gradient(135deg, var(--lx-tint-line), var(--lx-tint)); }
.app-shell .wa-inbox .ibx-file.document .ibx-file-ic { background: color-mix(in srgb, var(--danger) 9%, #fff); color: var(--ibx-hot); }
.app-shell .wa-inbox .ibx-file.audio .ibx-file-ic { background: color-mix(in srgb, var(--success) 12%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-file-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-file-t b { display: block; font-size: .82rem; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-file-t small { display: block; font-size: .72rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-file-t small.ibx-read { color: var(--ibx-ok); font-weight: 600; white-space: normal; }
.app-shell .wa-inbox .ibx-file-acts { display: flex; gap: .3rem; flex: none; }

/* La persona */
.app-shell .wa-inbox .ibx-person { display: flex; flex-direction: column; gap: .6rem; }
.app-shell .wa-inbox .ibx-person-h { display: flex; align-items: center; gap: .7rem; }
.app-shell .wa-inbox .ibx-person-av {
    width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center;
    background: var(--lx-tint); color: var(--primary-dark); font-weight: 800; font-size: 1.05rem;
}
.app-shell .wa-inbox .ibx-person-av.high { background: color-mix(in srgb, var(--success) 16%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-person-av.medium { background: color-mix(in srgb, var(--warning) 18%, #fff); color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-person-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-person-t h3 { margin: 0; font-size: 1.02rem; font-weight: 800; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-person-t small { display: block; font-size: .74rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-person-h .ibx-mini { display: inline-grid; place-items: center; width: 32px; padding: 0; text-decoration: none; }
.app-shell .wa-inbox .ibx-person-ids { display: flex; flex-wrap: wrap; gap: .35rem; }
.app-shell .wa-inbox .ibx-person-id {
    display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; min-height: 28px; padding: 0 .6rem; box-sizing: border-box;
    border-radius: var(--radius-full); background: var(--lx-ground); font-size: .74rem; color: var(--text);
}
.app-shell .wa-inbox .ibx-person-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-person-facts { margin: 0; padding: .55rem 0 0; border-top: 1px solid var(--ibx-row-line); list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.app-shell .wa-inbox .ibx-person-facts li { position: relative; padding-inline-start: .9rem; font-size: .8rem; line-height: 1.4; color: var(--text); }
.app-shell .wa-inbox .ibx-person-facts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .5rem; width: 5px; height: 5px; border-radius: 50%; background: var(--primary-mid); }

/* La fila buscar + Filtros: el diálogo de filtros ocupa el ancho de la columna */
.app-shell .wa-inbox .ibx-findrow { position: relative; }
.app-shell .wa-inbox .ibx-findrow .wa-views-menu-wrap { position: static; flex: none; }
.app-shell .wa-inbox .ibx-findrow .wa-views-menu { left: .75rem; right: .75rem; top: calc(100% + .35rem); }
.app-shell .wa-inbox .ibx-chan-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .45rem; }
.app-shell .wa-inbox .wa-sidebar-head { gap: .5rem; }
.app-shell .wa-inbox .ibx-find-toggle.active { color: var(--primary); background: var(--lx-tint); }

/* La píldora de fecha flota sólo mientras se desplaza: quieta, la que quedó pegada arriba se desvanece
   (inbox.js marca .stuck y .rex-scrolling) y deja leer la burbuja que tenía debajo. */
.app-shell .wa-inbox .wa-date-divider { transition: opacity .28s var(--ease, ease-out); }
.app-shell .wa-inbox .wa-messages:not(.rex-scrolling) .wa-date-divider.stuck { opacity: 0; }

/* ── Encabezado de «Contexto» ────────────────────────────────────────────────────────────────── */
.app-shell .wa-inbox .ibx-ctx-head {
    position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: .7rem;
    min-height: 68px; padding: .75rem .9rem; box-sizing: border-box;
    background: color-mix(in srgb, var(--lx-ground) 92%, transparent); border-bottom: 1px solid var(--lx-line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.app-shell .wa-inbox .ibx-ctx-head-ic {
    width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px;
    background: var(--brand-dark); color: #fff; box-shadow: 0 6px 16px rgba(14, 6, 91, .18);
}
.app-shell .wa-inbox .ibx-ctx-head-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-ctx-head-t h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-ctx-head-t small { display: block; margin-top: 2px; font-size: .74rem; color: var(--lx-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-ctx-collapse {
    width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px;
    border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark); cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}
.app-shell .wa-inbox .ibx-ctx-collapse:hover { border-color: var(--primary-mid); transform: translateX(2px); }
.app-shell .wa-inbox .ibx-ctx-collapse:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-ctx-n.warn { background: color-mix(in srgb, var(--warning) 22%, #fff); color: var(--ibx-warn); }

/* Contraído: una franja con las pestañas y el número de pendientes */
.app-shell .wa-inbox .ibx-ctx-rail { display: none; }
@media (min-width: 1101px) {
    .app-shell .wa-inbox .ibx-ctx-rail {
        width: 60px; flex: none; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: .9rem 0;
        border-left: 1px solid var(--lx-line); background: var(--lx-ground);
        animation: ibx-pop .16s var(--ease, ease-out);
    }
}
.app-shell .wa-inbox .ibx-ctx-rail-btn {
    position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
    border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark); cursor: pointer;
}
.app-shell .wa-inbox .ibx-ctx-rail-btn:hover { border-color: var(--primary-mid); color: var(--primary); }
.app-shell .wa-inbox .ibx-ctx-rail-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-ctx-rail-dot {
    position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
    border-radius: var(--radius-full); border: 2px solid var(--lx-ground); background: var(--warning); color: #fff;
    font-size: .62rem; font-weight: 800; display: grid; place-items: center;
}

/* Las secciones que vienen del panel anterior (Negocio, Caso) toman el aspecto de tarjeta */
.app-shell .wa-inbox .ibx-ctx-host .ibx-biz,
.app-shell .wa-inbox .ibx-ctx-host .ibx-case-extras { display: flex; flex-direction: column; gap: .75rem; }
.app-shell .wa-inbox .ibx-ctx-host .ibx-biz .wa-info-section,
.app-shell .wa-inbox .ibx-ctx-host .ibx-case-extras .wa-info-section {
    padding: .85rem .9rem; border: 1px solid var(--lx-line); border-radius: 20px; background: var(--bg-card);
}
.app-shell .wa-inbox .ibx-ctx-host .wa-info-section h4 {
    margin: 0 0 .5rem; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark);
}
.app-shell .wa-inbox .ibx-ctx-host .wa-section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.app-shell .wa-inbox .ibx-ctx-host .wa-section-head h4 { margin: 0; }
.app-shell .wa-inbox .ibx-ctx-host .wa-revenue-hero-value { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.app-shell .wa-inbox .ibx-ctx-host .wa-insights-primary { border-radius: 12px; min-height: 40px; }

/* La persona: etiquetas, editar en el sitio y abrir la ficha */
.app-shell .wa-inbox .ibx-person-tags { padding-top: .55rem; border-top: 1px solid var(--ibx-row-line); }
.app-shell .wa-inbox .ibx-person-tags h4 { margin: 0 0 .35rem; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-person-acts { display: flex; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--ibx-row-line); }
.app-shell .wa-inbox .ibx-person-acts .ibx-mini { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 36px; text-decoration: none; }
.app-shell .wa-inbox .ibx-person-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--ibx-row-line); }
.app-shell .wa-inbox .ibx-person-edit label { display: flex; flex-direction: column; gap: .25rem; font-size: .7rem; font-weight: 700; color: var(--lx-ink-muted); min-width: 0; }
.app-shell .wa-inbox .ibx-person-edit label:first-child,
.app-shell .wa-inbox .ibx-person-edit label:nth-child(3),
.app-shell .wa-inbox .ibx-person-edit label:nth-child(4) { grid-column: 1 / -1; }
.app-shell .wa-inbox .ibx-person-edit .wa-ops-input { min-height: 38px; border-radius: 10px; }
.app-shell .wa-inbox .ibx-person-edit .wa-error-text { grid-column: 1 / -1; margin: 0; }
.app-shell .wa-inbox .ibx-person-edit-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .4rem; }
.app-shell .wa-inbox .ibx-mini.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.app-shell .wa-inbox .ibx-mini.pri:hover:not(:disabled) { background: var(--primary-dark); }
.app-shell .wa-inbox .ibx-person-t h3 { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }

/* Acción fallida: el detalle y «Dar por revisado» */
.app-shell .wa-inbox .ibx-pend.ibx-pend-fail { cursor: default; }
.app-shell .wa-inbox .ibx-pend-fail i { background: var(--danger); }
.app-shell .wa-inbox .ibx-fail-det {
    display: block; margin-top: .35rem; padding: .4rem .55rem; border-radius: 10px;
    background: var(--bg-card); border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--lx-line));
    font-size: .74rem; color: var(--text-secondary); overflow-wrap: anywhere;
}
.app-shell .wa-inbox .ibx-fail-acts { display: flex; gap: .4rem; margin-top: .45rem; }
.app-shell .wa-inbox .ibx-toast {
    display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 14px;
    background: var(--brand-dark); color: #fff; font-size: .8rem; animation: ibx-pop .16s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-toast span { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-toast button {
    min-height: 32px; padding: 0 .7rem; border-radius: 9px; border: 1px solid color-mix(in srgb, #fff 35%, transparent);
    background: none; color: #fff; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer;
}
.app-shell .wa-inbox .ibx-done small.ibx-acked { color: var(--ibx-ok); font-weight: 600; }
.app-shell .wa-inbox .ibx-st.declined { background: var(--lx-ground); color: var(--text-secondary); }
.app-shell .wa-inbox .ibx-ref-t small.declined { color: var(--text-secondary); }

/* Catálogo (desde «/» › «Oferta del catálogo») */
.app-shell .wa-inbox .ibx-catalog { width: min(560px, calc(100vw - 32px)); max-height: min(720px, 88vh); overflow-y: auto; padding: 1rem 1.1rem; border-radius: 22px; }
.app-shell .wa-inbox .ibx-catalog-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.app-shell .wa-inbox .ibx-catalog-h h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-catalog .wa-info-section { padding: 0; border: 0; }

/* Quién atiende: la ficha de la cabecera y su ventanita */
.app-shell .wa-inbox .ibx-att-wrap { position: relative; }
.app-shell .wa-inbox .ibx-att {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; max-width: 240px; padding: 0 .7rem 0 .25rem; box-sizing: border-box;
    border-radius: 12px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark);
    font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.app-shell .wa-inbox .ibx-att > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.app-shell .wa-inbox .ibx-att:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-att.ai { background: var(--lx-tint-soft); border-color: var(--lx-tint-line); color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-att.person { background: color-mix(in srgb, var(--success) 8%, #fff); border-color: color-mix(in srgb, var(--success) 32%, transparent); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-att.nobody { border-style: dashed; border-color: color-mix(in srgb, var(--warning) 55%, transparent); color: var(--ibx-warn); padding-inline-start: .7rem; }
.app-shell .wa-inbox .ibx-att.paused { background: var(--lx-ground); color: var(--text-secondary); }
.app-shell .wa-inbox .ibx-att-stack { display: inline-flex; }
.app-shell .wa-inbox .ibx-att-av {
    width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px;
    background: var(--ibx-ok); color: #fff; font-size: .72rem; font-weight: 800; border: 2px solid var(--bg-card); box-sizing: border-box;
}
.app-shell .wa-inbox .ibx-att-av + .ibx-att-av { margin-inline-start: -9px; }
.app-shell .wa-inbox .ibx-att-av.ai { background: var(--primary); }
.app-shell .wa-inbox .ibx-att-av.alt { background: var(--brand-dark); }
.app-shell .wa-inbox .ibx-att-pop {
    position: absolute; inset-inline-end: 0; top: calc(100% + .4rem); z-index: 41; width: min(300px, 86vw);
    display: flex; flex-direction: column; gap: .15rem; padding: .5rem;
    border-radius: 16px; border: 1px solid var(--lx-line); background: var(--bg-card); box-shadow: var(--shadow-lg);
    animation: ibx-pop .14s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-att-row { display: flex; align-items: center; gap: .55rem; padding: .4rem; border-radius: 10px; font-size: .8rem; }
.app-shell .wa-inbox .ibx-att-row b { display: block; color: var(--text); }
.app-shell .wa-inbox .ibx-att-row small { display: block; font-size: .7rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-att-own { margin-inline-start: auto; font-size: .66rem; font-weight: 800; border-radius: var(--radius-full); padding: 1px 7px; background: color-mix(in srgb, var(--success) 14%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-att-acts { display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem .3rem .2rem; border-top: 1px solid var(--ibx-row-line); margin-top: .2rem; }
.app-shell .wa-inbox .ibx-att-note { padding: .2rem .4rem .4rem; font-size: .74rem; color: var(--text-secondary); line-height: 1.4; }
/* El nombre se recorta con «…» aunque el botón termine en la flecha del menú (antes sólo se recortaba un span que
   fuera el ÚLTIMO hijo, y la flecha lo es: el nombre largo se salía del botón). */
.app-shell .wa-inbox .ibx-att > :is(.ibx-att-av, .ibx-att-stack, svg) { flex: none; }
.app-shell .wa-inbox .ibx-att > span:not(.ibx-att-av):not(.ibx-att-stack) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Cabecera de la conversación en el teléfono: el estado y quién atiende ocupan su propia fila a todo el ancho y los
   botones (llamar, vídeo, agendar, buscar, panel) van en la siguiente, repartidos. Antes compartían una sola fila, la
   ficha de quién atiende no podía encogerse y su nombre quedaba DEBAJO de los botones. El ::after es el salto de fila. */
@media (max-width: 640px) {
    .app-shell .wa-inbox .wa-chat-header-actions { flex-wrap: wrap; row-gap: 4px; justify-content: space-between; }
    .app-shell .wa-inbox .wa-chat-header-actions::after { content: ''; flex: 0 0 100%; height: 0; order: 2; }
    .app-shell .wa-inbox .wa-chat-header-actions > .wa-badge-menu-wrap { order: 1; flex: 0 1 auto; min-width: 0; }
    .app-shell .wa-inbox .wa-chat-header-actions > .wa-badge-menu-wrap:has(.ibx-att) { flex: 1 1 0; }
    .app-shell .wa-inbox .wa-chat-header-actions > :not(.wa-badge-menu-wrap) { order: 3; flex: none; margin-left: 0; }
    .app-shell .wa-inbox .wa-chat-header-actions .wa-status-badge { max-width: 100%; min-width: 0; overflow: hidden; }
    .app-shell .wa-inbox .ibx-att { max-width: 100%; min-width: 0; }
}

@keyframes ibx-pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ibx-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ibx-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ibx-flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 55%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
    .app-shell .wa-inbox .ibx-folder-menu, .app-shell .wa-inbox .ibx-menu, .app-shell .wa-inbox .ibx-cmd,
    .app-shell .wa-inbox .ibx-find, .app-shell .wa-inbox .ibx-skel, .app-shell .wa-inbox .ibx-hit-flash,
    .app-shell .wa-inbox .ibx-ctx-rail, .app-shell .wa-inbox .ibx-toast, .app-shell .wa-inbox .ibx-att-pop,
    .app-shell .wa-inbox .ibx-rate-pop { animation: none; }
    .app-shell .wa-inbox .wa-date-divider { transition: none; }
    .app-shell .wa-inbox .ibx-tile:hover { transform: none; }
}

/* ── Sin nada abierto: la línea tranquila de «Para ti» ───────────────────────────────────────── */
.app-shell .wa-inbox .ibx-calm {
    display: flex; align-items: center; gap: .5rem; min-height: 44px; margin: 0 .75rem .5rem; padding: 0 .4rem 0 .8rem;
    border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--lx-ink-muted); font-size: .86rem;
}
.app-shell .wa-inbox .ibx-calm b { color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-calm-ok {
    width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--success); color: #fff; font-size: .7rem; font-weight: 800;
}
.app-shell .wa-inbox .ibx-calm-ai {
    margin-inline-start: auto; display: inline-flex; align-items: center; gap: .3rem; min-height: 36px; padding: 0 .65rem;
    border: 0; border-radius: var(--radius-full); background: var(--lx-tint); color: var(--primary-dark);
    font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.app-shell .wa-inbox .ibx-calm-ai:hover { background: color-mix(in srgb, var(--lx-tint) 70%, var(--primary-mid)); }
.app-shell .wa-inbox .ibx-calm-ai:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── La lista vacía dice por qué ─────────────────────────────────────────────────────────────── */
.app-shell .wa-inbox .ibx-qe {
    display: flex; flex-direction: column; align-items: center; gap: .6rem; margin: .5rem .25rem; padding: 1.7rem 1.1rem 1.4rem;
    text-align: center; border-radius: var(--lx-radius); border: 1px solid var(--lx-line); background: var(--bg-card);
}
/* Dentro de la lista (que ya es una tarjeta) no se dibuja otra tarjeta. */
.app-shell .wa-inbox .wa-conv-list > .ibx-qe { margin: 0; border: 0; background: transparent; }
.app-shell .wa-inbox .ibx-qe h3 { margin: .35rem 0 0; font-size: 1.1rem; font-weight: 800; color: var(--brand-dark); text-wrap: balance; }
.app-shell .wa-inbox .ibx-qe p { margin: 0; max-width: 260px; font-size: .86rem; line-height: 1.5; color: var(--lx-ink-muted); text-wrap: pretty; }
.app-shell .wa-inbox .ibx-qe-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .3rem; }
.app-shell .wa-inbox .ibx-qe-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1rem; box-sizing: border-box;
    border-radius: 13px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark);
    font: inherit; font-size: .86rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.app-shell .wa-inbox .ibx-qe-btn:hover:not(:disabled) { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-qe-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-qe-btn:disabled { opacity: .6; cursor: progress; }
.app-shell .wa-inbox .ibx-qe-btn.is-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.app-shell .wa-inbox .ibx-qe-btn.is-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-qe-btn.is-soft { background: var(--lx-tint); border-color: transparent; }
.app-shell .wa-inbox .ibx-qe-done { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-size: .86rem; font-weight: 700; color: var(--ibx-ok); }
/* El orbe: anillos de canal alrededor de un núcleo. Decorativo. */
.app-shell .wa-inbox .ibx-qe-orb {
    position: relative; width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 50% 46%, var(--lx-tint) 0 34%, transparent 35%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--lx-tint-line) 60%, transparent),
                0 0 0 13px color-mix(in srgb, var(--brand-indigo) 6%, transparent),
                0 0 0 26px color-mix(in srgb, var(--brand-indigo) 3.5%, transparent);
    margin-block: .9rem .2rem;
}
.app-shell .wa-inbox .ibx-qe-core { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-dark); color: #fff; }
.app-shell .wa-inbox .ibx-qe-orb.is-ok .ibx-qe-core { border-radius: 50%; background: var(--success); }
.app-shell .wa-inbox .ibx-qe-orb.is-search .ibx-qe-core { background: var(--lx-tint); color: var(--primary); }
.app-shell .wa-inbox .ibx-qe-orb.is-muted .ibx-qe-core { background: var(--lx-ground); color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-qe-orb > i { position: absolute; border-radius: 50%; }
.app-shell .wa-inbox .ibx-qe-orb > i:nth-of-type(1) { width: 9px; height: 9px; top: 6px; inset-inline-end: 14px; background: var(--success); }
.app-shell .wa-inbox .ibx-qe-orb > i:nth-of-type(2) { width: 7px; height: 7px; bottom: 10px; inset-inline-start: 6px; background: var(--accent); }
.app-shell .wa-inbox .ibx-qe-orb > i:nth-of-type(3) { width: 6px; height: 6px; top: 42px; inset-inline-end: -8px; background: var(--brand-indigo); }
/* La copia del héroe para el móvil: sólo allí no hay centro. */
.app-shell .wa-inbox .ibx-qm { display: none; }

/* ── El centro sin conversación ──────────────────────────────────────────────────────────────── */
.app-shell .wa-inbox .ibx-qc {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
    height: 100%; box-sizing: border-box; padding: 2rem 2.2rem; overflow-y: auto;
    background: linear-gradient(180deg, var(--bg) 0%, var(--lx-ground) 100%);
}
.app-shell .wa-inbox .ibx-qc > * { width: 100%; max-width: 680px; }
.app-shell .wa-inbox .ibx-qc-hero {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1rem; box-sizing: border-box;
    padding: 2rem 2.1rem 1.8rem; border-radius: var(--lx-radius-hero); background: var(--brand-dark); color: #fff;
}
.app-shell .wa-inbox .ibx-qc-hero::after {
    content: ""; position: absolute; inset-inline-end: -120px; top: -140px; width: 380px; height: 380px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--brand-indigo) 70%, transparent);
    box-shadow: 0 0 0 56px color-mix(in srgb, var(--brand-indigo) 6%, transparent), 0 0 0 112px color-mix(in srgb, var(--brand-indigo) 4%, transparent);
    pointer-events: none;
}
.app-shell .wa-inbox .ibx-qc-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 93% 16%, var(--success) 0 6px, transparent 7px),
        radial-gradient(circle at 76% 58%, var(--accent) 0 5px, transparent 6px),
        radial-gradient(circle at 90% 86%, var(--brand-indigo) 0 4px, transparent 5px),
        radial-gradient(circle at 70% 22%, color-mix(in srgb, #fff 50%, transparent) 0 3px, transparent 4px);
}
.app-shell .wa-inbox .ibx-qc-hero > * { position: relative; z-index: 1; }
.app-shell .wa-inbox .ibx-qc-kick { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-qc-star { color: var(--accent); flex: none; }
.app-shell .wa-inbox .ibx-qc-hero h2 { margin: 0; max-width: 520px; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; font-weight: 900; letter-spacing: -.01em; color: #fff; text-wrap: balance; }
.app-shell .wa-inbox .ibx-qc-sub { margin: 0; max-width: 540px; font-size: .98rem; line-height: 1.5; color: color-mix(in srgb, #fff 82%, var(--brand-indigo)); text-wrap: pretty; }
.app-shell .wa-inbox .ibx-qc-skel { display: block; height: 22px; width: 70%; border-radius: 8px; background: color-mix(in srgb, #fff 12%, transparent); animation: ibx-qc-pulse 1.4s ease-in-out infinite; }
.app-shell .wa-inbox .ibx-qc-skel.is-short { width: 45%; height: 14px; }
@keyframes ibx-qc-pulse { 50% { opacity: .5; } }
.app-shell .wa-inbox .ibx-qc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .6rem; margin: 0; }
.app-shell .wa-inbox .ibx-qc-stats > div {
    display: flex; flex-direction: column-reverse; gap: .1rem; padding: .75rem .9rem; border-radius: 16px;
    background: color-mix(in srgb, #fff 7%, transparent); border: 1px solid color-mix(in srgb, #fff 12%, transparent);
}
.app-shell .wa-inbox .ibx-qc-stats dt { font-size: .78rem; color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-qc-stats dd { margin: 0; font-size: 1.65rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.app-shell .wa-inbox .ibx-qc-next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.app-shell .wa-inbox .ibx-qc-nx {
    display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 56px; padding: .55rem .75rem; box-sizing: border-box;
    border: 0; border-radius: 16px; background: var(--bg-card); color: var(--text); font: inherit; text-align: start; cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}
.app-shell .wa-inbox .ibx-qc-nx:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -12px color-mix(in srgb, #000 60%, transparent); }
.app-shell .wa-inbox .ibx-qc-nx:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); }
.app-shell .wa-inbox .ibx-qc-av {
    width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center;
    background: var(--lx-tint); color: var(--primary-dark); font-size: .8rem; font-weight: 800;
}
.app-shell .wa-inbox .ibx-qc-nx-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.app-shell .wa-inbox .ibx-qc-nx-t b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-qc-nx-w { font-size: .78rem; color: var(--lx-ink-muted); white-space: nowrap; }
.app-shell .wa-inbox .ibx-qc-nx-go { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--lx-tint); color: var(--primary); font-weight: 800; }
.app-shell .wa-inbox .ibx-qc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.app-shell .wa-inbox .ibx-qc-row small { font-size: .8rem; color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-qc-row kbd { font: inherit; font-weight: 800; padding: .05rem .4rem; border-radius: 6px; border: 1px solid color-mix(in srgb, #fff 30%, transparent); color: #fff; }
.app-shell .wa-inbox .ibx-qc-go {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.3rem; box-sizing: border-box;
    border: 0; border-radius: 14px; background: var(--ai-action-gradient); box-shadow: var(--ai-action-shadow); color: #fff;
    font: inherit; font-size: .95rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.app-shell .wa-inbox .ibx-qc-go:hover:not(:disabled) { filter: brightness(1.06); }
.app-shell .wa-inbox .ibx-qc-go:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); }
.app-shell .wa-inbox .ibx-qc-go:disabled { opacity: .7; cursor: progress; }
.app-shell .wa-inbox .ibx-qc-done { display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; font-weight: 700; color: #fff; }
.app-shell .wa-inbox .ibx-qc-done i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--success); font-style: normal; font-size: .72rem; }
.app-shell .wa-inbox .ibx-qc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.app-shell .wa-inbox .ibx-qc-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; padding: .8rem .85rem; border-radius: 16px;
    background: var(--bg-card); color: var(--brand-dark); text-decoration: none; transition: transform var(--transition);
}
.app-shell .wa-inbox .ibx-qc-tile:hover { transform: translateY(-1px); }
.app-shell .wa-inbox .ibx-qc-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); }
.app-shell .wa-inbox .ibx-qc-tile b { font-size: .9rem; }
.app-shell .wa-inbox .ibx-qc-tile span { font-size: .8rem; font-weight: 700; color: var(--primary); }
.app-shell .wa-inbox .ibx-qc-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.app-shell .wa-inbox .ibx-qc-steps a {
    display: flex; flex-direction: column; gap: .3rem; height: 100%; box-sizing: border-box; padding: .8rem; border-radius: 18px;
    border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark); text-decoration: none;
}
.app-shell .wa-inbox .ibx-qc-steps a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-qc-steps li.is-now a { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.app-shell .wa-inbox .ibx-qc-steps b { font-size: .88rem; }
.app-shell .wa-inbox .ibx-qc-steps small { font-size: .76rem; line-height: 1.35; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-qc-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--lx-tint); color: var(--primary-dark); font-size: .76rem; font-weight: 800; }
.app-shell .wa-inbox .ibx-qc-steps li.is-now .ibx-qc-n { background: var(--primary); color: #fff; }
.app-shell .wa-inbox .ibx-qc-steps li.is-done .ibx-qc-n { background: var(--success); color: #fff; }
.app-shell .wa-inbox .ibx-qc-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; }
.app-shell .wa-inbox .ibx-qc-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; padding: .9rem; box-sizing: border-box;
    border-radius: 20px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--brand-dark);
    font: inherit; text-align: start; text-decoration: none; cursor: pointer; transition: border-color var(--transition);
}
.app-shell .wa-inbox .ibx-qc-card:hover { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-qc-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-qc-card b { font-size: .92rem; }
.app-shell .wa-inbox .ibx-qc-card small { font-size: .78rem; line-height: 1.4; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-qc-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--lx-tint); color: var(--primary); margin-bottom: .2rem; }
.app-shell .wa-inbox .ibx-qc-ic .ibx-qc-star { color: var(--primary); }
.app-shell .wa-inbox .ibx-qc kbd {
    font: inherit; font-size: .72rem; font-weight: 700; padding: .05rem .4rem; border-radius: 6px;
    border: 1px solid var(--lx-line); background: var(--bg); color: var(--brand-dark);
}
.app-shell .wa-inbox .ibx-qc-card kbd { margin-top: .2rem; }
.app-shell .wa-inbox .ibx-qc-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.1rem; margin: 0; font-size: .8rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-qc-keys kbd { margin-inline-end: .3rem; }
.app-shell .wa-inbox .ibx-qc-keys kbd + kbd { margin-inline-start: -.1rem; }
/* Compacto (dentro de la lista en el móvil): sin altura completa ni fondo propio. */
.app-shell .wa-inbox .ibx-qc.is-compact { height: auto; padding: .25rem .25rem .75rem; background: none; overflow: visible; }
.app-shell .wa-inbox .ibx-qc.is-compact .ibx-qc-hero { padding: 1.3rem 1.2rem; border-radius: 24px; gap: .7rem; }
.app-shell .wa-inbox .ibx-qc.is-compact .ibx-qc-hero h2 { font-size: 1.45rem; }

/* ── Contexto sin conversación ───────────────────────────────────────────────────────────────── */
.app-shell .wa-inbox .ibx-ghost {
    display: flex; flex-direction: column; gap: .8rem; margin: .9rem; padding: 1rem;
    border-radius: var(--lx-radius); border: 1px solid var(--lx-line); background: var(--bg-card);
}
.app-shell .wa-inbox .ibx-ghost h4 { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-ghost ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.app-shell .wa-inbox .ibx-ghost li { display: flex; gap: .65rem; align-items: flex-start; }
.app-shell .wa-inbox .ibx-ghost li > span:last-child { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.app-shell .wa-inbox .ibx-ghost b { font-size: .88rem; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-ghost small { font-size: .8rem; line-height: 1.4; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-ghost-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--lx-tint); color: var(--primary); }
.app-shell .wa-inbox .ibx-ghost-skel { display: flex; flex-direction: column; gap: .45rem; padding: .75rem; border-radius: 14px; background: var(--lx-ground); }
.app-shell .wa-inbox .ibx-ghost-skel span { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--lx-line) 80%, var(--lx-ground)); }
.app-shell .wa-inbox .ibx-ghost-skel span:nth-child(1) { width: 62%; }
.app-shell .wa-inbox .ibx-ghost-skel span:nth-child(2) { width: 88%; }
.app-shell .wa-inbox .ibx-ghost-skel span:nth-child(3) { width: 45%; }
.app-shell .wa-inbox .ibx-ghost-fact { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .8rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-ghost-fact i {
    width: 18px; height: 18px; flex: none; border-radius: 6px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--success) 14%, var(--bg-card)); color: var(--ibx-ok); font-style: normal; font-size: .68rem; font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
    .app-shell .wa-inbox .ibx-qc-skel { animation: none; }
    .app-shell .wa-inbox .ibx-qc-nx, .app-shell .wa-inbox .ibx-qc-tile { transition: none; }
    .app-shell .wa-inbox .ibx-qc-nx:hover, .app-shell .wa-inbox .ibx-qc-tile:hover { transform: none; }
}

/* ── Móvil ───────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    /* Sin centro en el móvil: el héroe va dentro de la lista; el aviso de la lista sobra si dice lo mismo. */
    .app-shell .wa-inbox .ibx-qm { display: block; }
    .app-shell .wa-inbox .ibx-qe.is-newworkspace, .app-shell .wa-inbox .ibx-qe.is-noaccess { display: none; }
    .app-shell .wa-inbox .ibx-calm { margin-inline: .5rem; }
    .app-shell .wa-inbox .ibx-tri { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
    .app-shell .wa-inbox .ibx-tile { flex-direction: column; align-items: flex-start; gap: .2rem; min-height: 60px; padding: .45rem .55rem; border-radius: 14px; }
    .app-shell .wa-inbox .ibx-tile b { font-size: 1.1rem; }
    .app-shell .wa-inbox .ibx-tile span { font-size: .68rem; }
    .app-shell .wa-inbox .wa-conv-list { margin-inline: .5rem; }
    .app-shell .wa-inbox .ibx-attend { padding: .45rem .75rem; gap: .5rem; }
    .app-shell .wa-inbox .ibx-attend-copy small { display: none; }
    .app-shell .wa-inbox .ibx-attend .ibx-btn { min-height: 40px; padding: 0 .65rem; }
    .app-shell .wa-inbox .ibx-find { padding-inline: .75rem; }
    .app-shell .wa-inbox .ibx-freq { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .app-shell .wa-inbox .ibx-freq-chip { flex: none; }
    .app-shell .wa-inbox .wa-messages { background-size: 300px 300px; }
    /* El panel Contexto sube como hoja desde abajo (lo abre la «i» de la cabecera) */
    .app-shell .wa-inbox .wa-info-panel.ibx-ctx-host { border-radius: 22px 22px 0 0; }
    .app-shell .wa-inbox .ibx-ctx { padding: .75rem; }
    .app-shell .wa-inbox .ibx-ctx-tabs { position: sticky; top: 0; z-index: 2; }
    .app-shell .wa-inbox .ibx-ctx-head { min-height: 60px; padding: .6rem .75rem; }
}
/* Entre 641 y 760 px la cabecera sigue en una fila: quién atiende se queda corto (con «…»). Por debajo de 640 tiene su
   propia fila a todo el ancho (ver «Cabecera de la conversación en el teléfono»). */
@media (min-width: 641px) and (max-width: 760px) {
    .app-shell .wa-inbox .ibx-att { max-width: 150px; }
}

/* ── Calificar las respuestas de la IA ─────────────────────────────────────────────────────────
   «Bien» / «mal» aparecen al pasar el ratón por un mensaje de la IA (en táctil, siempre, discretos).
   «Mal» abre la ventanita con el motivo y la corrección. */
.app-shell .wa-inbox .wa-bubble.ai { position: relative; }
.app-shell .wa-inbox .ibx-rate {
    position: absolute; top: 4px; inset-inline-end: calc(100% + 8px); z-index: 4;
    display: flex; gap: 2px; padding: 3px; border-radius: 12px;
    border: 1px solid var(--lx-line); background: var(--bg-card); box-shadow: 0 6px 18px rgba(14, 6, 91, .12);
    opacity: 0; transform: translateX(4px); pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
}
.app-shell .wa-inbox .wa-msg-row:hover .ibx-rate,
.app-shell .wa-inbox .ibx-rate:focus-within,
.app-shell .wa-inbox .ibx-rate.rated { opacity: 1; transform: none; pointer-events: auto; }
.app-shell .wa-inbox .ibx-rate.rated:not(:hover):not(:focus-within) { box-shadow: none; background: transparent; border-color: transparent; }
.app-shell .wa-inbox .ibx-rate.rated:not(:hover):not(:focus-within) .ibx-rate-btn:not(.on) { display: none; }
.app-shell .wa-inbox .ibx-rate-btn {
    width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px;
    background: none; color: var(--text-secondary); cursor: pointer;
}
.app-shell .wa-inbox .ibx-rate-btn:hover { background: var(--surface-hover); color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-rate-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-rate-btn.up.on { background: color-mix(in srgb, var(--success) 14%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-rate-btn.dn.on { background: color-mix(in srgb, var(--danger) 10%, #fff); color: var(--ibx-hot); }
@media (hover: none) {
    .app-shell .wa-inbox .ibx-rate { position: static; opacity: .9; transform: none; pointer-events: auto; margin: 0 0 .3rem; box-shadow: none; width: max-content; }
}

/* «Guardar como conocimiento»: bajo la respuesta de una persona que contestó lo que la IA no supo. Discreto y
   siempre visible (no sólo al pasar el ratón): es una invitación, no una acción escondida. */
.app-shell .wa-inbox .ibx-learn { display: flex; justify-content: flex-end; margin: .35rem 0 .1rem; }
.app-shell .wa-inbox .ibx-learn-btn {
    display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem; border-radius: var(--radius-full);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent); background: color-mix(in srgb, var(--bg-card) 85%, transparent);
    color: var(--brand-dark); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.app-shell .wa-inbox .ibx-learn-btn:hover { background: var(--bg-card); border-color: var(--primary); }
.app-shell .wa-inbox .ibx-learn-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-learn-q { min-height: 64px; }
@media (prefers-reduced-motion: reduce) { .app-shell .wa-inbox .ibx-learn-btn { transition: none; } }

.app-shell .wa-inbox .ibx-rate-pop {
    width: min(520px, calc(100vw - 32px)); max-height: min(720px, 90vh); overflow-y: auto; box-sizing: border-box;
    display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem 1.2rem; border-radius: 22px; text-align: start;
    animation: ibx-pop .16s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-rate-pop h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-rate-reasons { display: flex; flex-wrap: wrap; gap: .4rem; }
.app-shell .wa-inbox .ibx-rate-label { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-rate-text {
    width: 100%; box-sizing: border-box; min-height: 110px; padding: .7rem .8rem; resize: vertical;
    border-radius: 14px; border: 1px solid var(--primary-mid); background: var(--bg-card); color: var(--text);
    font: inherit; font-size: .88rem; line-height: 1.5;
}
.app-shell .wa-inbox .ibx-rate-text:focus { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-rate-dest { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem .75rem; border-radius: 14px; background: var(--lx-ground); border: 1px solid var(--lx-line); }
.app-shell .wa-inbox .ibx-rate-dest-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--brand-dark); color: #fff; }
.app-shell .wa-inbox .ibx-rate-dest b { display: block; font-size: .85rem; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-rate-dest small { display: block; margin-top: 2px; font-size: .76rem; color: var(--text-secondary); line-height: 1.4; }
.app-shell .wa-inbox .ibx-rate-acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; }
.app-shell .wa-inbox .ibx-rate-note { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .72rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-rate-done { margin: 0; font-size: .86rem; color: var(--text-secondary); line-height: 1.5; }

/* La franja sólo cuando pide algo: pidió una persona (urgente) o la IA en pausa sin nadie */
.app-shell .wa-inbox .ibx-attend.asked { background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 9%, #fff), var(--lx-tint-soft)); border-bottom-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.app-shell .wa-inbox .ibx-attend.asked .ibx-attend-ic { color: var(--ibx-hot); }
.app-shell .wa-inbox .ibx-attend.paused { background: linear-gradient(90deg, var(--lx-ground), var(--lx-tint-soft)); }
.app-shell .wa-inbox .ibx-attend.paused .ibx-attend-ic { color: var(--text-secondary); }

/* -- Por que respondio esto: el boton de la burbuja y la traza ------------------------------------ */
.app-shell .wa-inbox .ibx-why-btn {
    display: inline-flex; align-items: center; gap: .25rem; margin-inline-start: .45rem; min-height: 24px; padding: 0 .5rem;
    border: 1px solid var(--primary-mid); border-radius: var(--radius-full); background: var(--bg-card); color: var(--primary-dark);
    font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; vertical-align: middle;
}
.app-shell .wa-inbox .ibx-why-btn:hover { background: var(--lx-tint); }
.app-shell .wa-inbox .ibx-why-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-trace {
    width: min(560px, calc(100vw - 32px)); max-height: min(760px, 92vh); overflow-y: auto; box-sizing: border-box;
    display: flex; flex-direction: column; gap: .7rem; padding: 1.1rem 1.2rem; border-radius: 22px; text-align: start;
    animation: ibx-pop .16s var(--ease, ease-out);
}
.app-shell .wa-inbox .ibx-trace-head { display: flex; align-items: center; gap: .7rem; }
.app-shell .wa-inbox .ibx-trace-head h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-trace-head small { color: var(--lx-ink-muted); font-size: .8rem; }
.app-shell .wa-inbox .ibx-trace-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-dark); color: var(--accent); }
.app-shell .wa-inbox .ibx-trace-x { margin-inline-start: auto; width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; color: var(--lx-ink-muted); cursor: pointer; font-size: 1rem; }
.app-shell .wa-inbox .ibx-trace-x:hover { background: var(--surface-hover); }
.app-shell .wa-inbox .ibx-trace-outcome { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; border-radius: 14px; background: color-mix(in srgb, var(--success) 10%, var(--bg-card)); }
.app-shell .wa-inbox .ibx-trace-outcome b { color: var(--ibx-ok); font-size: .92rem; }
.app-shell .wa-inbox .ibx-trace-outcome small { color: var(--lx-ink-muted); font-size: .8rem; line-height: 1.4; }
.app-shell .wa-inbox .ibx-trace-outcome.warn { background: color-mix(in srgb, var(--warning) 12%, var(--bg-card)); }
.app-shell .wa-inbox .ibx-trace-outcome.warn b { color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-trace-outcome.info { background: var(--lx-tint); }
.app-shell .wa-inbox .ibx-trace-outcome.info b { color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-trace-sec { display: flex; flex-direction: column; gap: .45rem; padding-top: .6rem; border-top: 1px solid var(--ibx-row-line); }
.app-shell .wa-inbox .ibx-trace-sec h4 { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-trace-row { display: flex; gap: .55rem; align-items: flex-start; font-size: .84rem; line-height: 1.4; color: var(--text); }
.app-shell .wa-inbox .ibx-trace-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.app-shell .wa-inbox .ibx-trace-row b { font-weight: 700; color: var(--brand-dark); overflow-wrap: anywhere; }
.app-shell .wa-inbox .ibx-trace-row small { font-size: .76rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-trace-d { width: 22px; height: 22px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.app-shell .wa-inbox .ibx-trace-d.src { background: var(--lx-tint); color: var(--primary); }
.app-shell .wa-inbox .ibx-trace-d.mut { background: var(--lx-ground); color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-trace-d.act { background: color-mix(in srgb, var(--accent) 14%, var(--bg-card)); color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-trace-d.rule { background: color-mix(in srgb, var(--brand-indigo) 12%, var(--bg-card)); color: var(--brand-indigo); }
.app-shell .wa-inbox .ibx-trace-d.ok { background: color-mix(in srgb, var(--success) 14%, var(--bg-card)); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-trace-d.warn { background: color-mix(in srgb, var(--warning) 16%, var(--bg-card)); color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-trace-warn { color: var(--ibx-warn); font-weight: 700; }
.app-shell .wa-inbox .ibx-trace-muted, .app-shell .wa-inbox .ibx-trace-empty { margin: 0; font-size: .84rem; color: var(--lx-ink-muted); line-height: 1.45; }
.app-shell .wa-inbox .ibx-trace-foot { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding-top: .6rem; border-top: 1px solid var(--ibx-row-line); font-size: .76rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-trace-skel { display: flex; flex-direction: column; gap: .5rem; }
.app-shell .wa-inbox .ibx-trace-skel span { height: 14px; border-radius: 7px; background: var(--lx-ground); }
@media (prefers-reduced-motion: reduce) { .app-shell .wa-inbox .ibx-trace { animation: none; } }

/* ── Contexto: menos piezas, todas con valor ──────────────────────────────────────────────────────
   Orden: la persona, si te esperan (una línea), «Del caso», lo que se sabe, notas del equipo, etiquetas.
   «Negocio» es una tarjeta que sólo aparece con datos. El buscador vive tras la lupa de las pestañas. */
.app-shell .wa-inbox .ibx-ctx-tabs { align-items: center; gap: 2px; }
.app-shell .wa-inbox .ibx-ctx-find {
    flex: none; width: 36px; height: 36px; margin-inline-start: auto; display: grid; place-items: center;
    border: 0; border-radius: 10px; background: none; color: var(--brand-dark); cursor: pointer;
}
.app-shell .wa-inbox .ibx-ctx-find:hover, .app-shell .wa-inbox .ibx-ctx-find.on { background: var(--lx-tint); color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-ctx-find:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-ctx-tabs button[role="tab"] { flex: 1; }

.app-shell .wa-inbox .ibx-num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.app-shell .wa-inbox .ibx-ico { display: inline-grid; place-items: center; width: 32px; padding: 0; text-decoration: none; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-mini.ibx-ico.on { color: var(--primary); background: var(--lx-tint); }
.app-shell .wa-inbox a.ibx-mini { display: inline-flex; align-items: center; }

/* La persona: iniciales en navy, una línea sin huecos, identidades que se pueden usar */
.app-shell .wa-inbox .ibx-person-av { background: var(--brand-dark); color: #fff; font-size: .95rem; letter-spacing: .02em; }
.app-shell .wa-inbox .ibx-person-h { gap: .55rem; }
.app-shell .wa-inbox .ibx-person-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-dup {
    display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem; border-radius: 14px;
    background: color-mix(in srgb, var(--warning) 10%, #fff); border: 1px solid color-mix(in srgb, var(--warning) 38%, #fff);
    font-size: .78rem; line-height: 1.35; color: var(--ibx-warn);
}
.app-shell .wa-inbox .ibx-dup-ic { flex: none; display: grid; place-items: center; }
.app-shell .wa-inbox .ibx-dup-t { flex: 1; min-width: 0; font-weight: 700; }
.app-shell .wa-inbox .ibx-dup-t small { display: block; font-weight: 500; opacity: .85; }
.app-shell .wa-inbox .ibx-field { display: flex; flex-direction: column; gap: .25rem; font-size: .7rem; font-weight: 700; color: var(--lx-ink-muted); min-width: 0; }
.app-shell .wa-inbox .ibx-input {
    width: 100%; min-height: 40px; box-sizing: border-box; padding: 0 .7rem; border-radius: 11px;
    border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--text); font: inherit; font-size: .84rem; font-weight: 500;
}
.app-shell .wa-inbox .ibx-input:focus { outline: none; border-color: var(--primary-mid); box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-err { grid-column: 1 / -1; margin: 0; font-size: .76rem; font-weight: 600; color: var(--ibx-hot); }

/* Estado en una línea */
.app-shell .wa-inbox .ibx-state {
    display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; border-radius: 18px;
    background: color-mix(in srgb, var(--success) 8%, #fff); border: 1px solid color-mix(in srgb, var(--success) 28%, #fff);
}
.app-shell .wa-inbox .ibx-state-dot {
    width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--success); color: #fff; font-size: .82rem; font-weight: 800;
}
.app-shell .wa-inbox .ibx-state-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-state-t b { display: block; font-size: .86rem; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-state-t small { display: block; margin-top: 1px; font-size: .74rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-ppl { display: flex; flex: none; padding-inline-start: 6px; }
.app-shell .wa-inbox .ibx-ppl-av {
    width: 26px; height: 26px; margin-inline-start: -6px; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid var(--bg-card); background: hsl(var(--av) 70% 92%); color: hsl(var(--av) 55% 28%);
    font-size: .62rem; font-weight: 800;
}
.app-shell .wa-inbox .ibx-ppl-av.ai { background: var(--ai-action-gradient, var(--primary)); color: #fff; }

/* Del caso */
.app-shell .wa-inbox .ibx-ref .ibx-ref-t small { order: -1; }
.app-shell .wa-inbox .ibx-ref-ic.k-amount { background: color-mix(in srgb, var(--success) 12%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-ref-ic.k-weight { background: color-mix(in srgb, var(--warning) 16%, #fff); color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-ref-ic.k-invoice, .app-shell .wa-inbox .ibx-ref-ic.k-reference { background: var(--lx-ground); color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-src {
    flex: none; display: inline-flex; align-items: center; gap: .3rem; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .7rem; font-weight: 700; color: var(--lx-ink-muted);
}
.app-shell .wa-inbox .ibx-src::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--brand-dark); }
.app-shell .wa-inbox .ibx-src.team::before { background: var(--primary); }
.app-shell .wa-inbox .ibx-src.ai::before { background: var(--ai-action-gradient, var(--primary)); }
.app-shell .wa-inbox .ibx-ref .ibx-mini { min-height: 30px; }

/* Lo que se sabe (la tarjeta compartida, con el aspecto de Contexto) */
.app-shell .wa-inbox .ibx-ctx-host .cb-card { border-radius: 20px; border-color: var(--lx-line); background: var(--bg-card); padding: .85rem .9rem; }
.app-shell .wa-inbox .ibx-ctx-host .cb-title { color: var(--brand-dark); font-weight: 800; letter-spacing: .06em; font-size: .74rem; }
.app-shell .wa-inbox .ibx-ctx-host .cb-fact { border-radius: 10px; background: var(--lx-ground); }
.app-shell .wa-inbox .ibx-ctx-host .cb-fact-dot.ai { background: var(--primary); }
.app-shell .wa-inbox .ibx-ctx-host .cb-add-input { border-radius: 11px; min-height: 36px; border-color: var(--lx-line); }

/* Notas del equipo y bitácora de la IA */
.app-shell .wa-inbox .ibx-note-in { display: flex; gap: .4rem; align-items: center; }
.app-shell .wa-inbox .ibx-note-in input {
    flex: 1; min-width: 0; min-height: 40px; box-sizing: border-box; padding: 0 .75rem; border-radius: 12px;
    border: 1px solid var(--lx-line); background: var(--lx-ground); color: var(--text); font: inherit; font-size: .84rem;
}
.app-shell .wa-inbox .ibx-note-in input:focus { outline: none; background: var(--bg-card); border-color: var(--primary-mid); box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-note-in .ibx-mini { min-height: 40px; }
.app-shell .wa-inbox .ibx-note { display: flex; align-items: flex-start; gap: .3rem; padding: .55rem 0 .1rem; border-top: 1px solid var(--ibx-row-line); margin-top: .45rem; }
.app-shell .wa-inbox .ibx-note-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-note-t p { margin: 0; font-size: .83rem; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; white-space: pre-line; }
.app-shell .wa-inbox .ibx-note-t small { display: block; margin-top: 2px; font-size: .7rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-note.pinned .ibx-note-t p { font-weight: 600; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-note .ibx-mini { min-height: 30px; width: 30px; }
.app-shell .wa-inbox .ibx-ailog {
    display: flex; align-items: center; gap: .45rem; width: 100%; min-height: 40px; margin-top: .55rem; padding: 0 .7rem; box-sizing: border-box;
    border: 0; border-radius: 12px; background: var(--lx-ground); color: var(--text-secondary); font: inherit; font-size: .78rem; font-weight: 700; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox .ibx-ailog > svg:first-child { color: var(--primary); flex: none; }
.app-shell .wa-inbox .ibx-ailog span { flex: 1; }
.app-shell .wa-inbox .ibx-ailog .ibx-chev { transition: transform var(--transition); }
.app-shell .wa-inbox .ibx-ailog[aria-expanded="true"] .ibx-chev { transform: rotate(90deg); }
.app-shell .wa-inbox .ibx-ailog:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-ailog-list { max-height: 260px; overflow-y: auto; padding: 0 .2rem; }
.app-shell .wa-inbox .ibx-note.ai .ibx-note-t p { color: var(--text-secondary); font-size: .8rem; }
.app-shell .wa-inbox .ibx-ailog-more { display: block; padding: .45rem 0 .2rem; font-size: .72rem; color: var(--lx-ink-muted); }

/* Etiquetas: la ✦ marca las que puso la IA */
.app-shell .wa-inbox .ibx-tags-ai { display: inline-flex; align-items: center; gap: .25rem; color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-tags .tag-ai { color: var(--primary); flex: none; }
.app-shell .wa-inbox .ibx-tags .tag-pill { border-radius: 999px; min-height: 28px; box-sizing: border-box; }
.app-shell .wa-inbox .ibx-tags .form-input { min-height: 38px; border-radius: 11px; }

/* Negocio: sólo con datos */
.app-shell .wa-inbox .ibx-biz-card .ibx-biz { gap: .6rem; }
.app-shell .wa-inbox .ibx-biz-total small { display: block; font-size: .72rem; color: var(--lx-ink-muted); }
.app-shell .wa-inbox .ibx-biz-total b { display: block; font-size: 1.45rem; font-weight: 800; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-biz-events { display: flex; flex-direction: column; }
.app-shell .wa-inbox .ibx-biz-ev { display: flex; align-items: center; gap: .35rem; padding: .35rem 0; border-top: 1px solid var(--ibx-row-line); font-size: .8rem; }
.app-shell .wa-inbox .ibx-biz-ev:first-child { border-top: 0; }
.app-shell .wa-inbox .ibx-biz-ev > span { flex: 1; min-width: 0; color: var(--text-secondary); }
.app-shell .wa-inbox .ibx-biz-ev > span small { display: block; font-size: .7rem; color: var(--lx-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-biz-ev b { color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-biz-ev.editing { background: var(--lx-tint-soft); border-radius: 10px; padding-inline: .4rem; }
.app-shell .wa-inbox .ibx-biz-form { display: flex; flex-direction: column; gap: .5rem; }
.app-shell .wa-inbox .ibx-biz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.app-shell .wa-inbox .ibx-biz-grid .ibx-field:last-child { grid-column: 1 / -1; }
.app-shell .wa-inbox .ibx-biz-rows .ibx-gh { padding-inline: 0; }
.app-shell .wa-inbox .ibx-biz-row { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; font-size: .8rem; color: var(--text-secondary); }
.app-shell .wa-inbox .ibx-biz-row b { min-width: 0; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .wa-inbox .ibx-biz-lead {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 40px; padding: 0 .75rem;
    border-radius: 12px; background: var(--lx-tint); color: var(--primary-dark); font-size: .8rem; font-weight: 700; text-decoration: none;
}
.app-shell .wa-inbox .ibx-biz-lead:hover { background: var(--lx-tint-line); }
.app-shell .wa-inbox .ibx-biz-add { display: inline-flex; align-items: center; gap: .35rem; margin-top: 0; }

/* Actividad: una línea de tiempo con el mismo lenguaje */
.app-shell .wa-inbox .ibx-act { display: flex; flex-direction: column; gap: .5rem; }
.app-shell .wa-inbox .ibx-act-head { display: flex; align-items: flex-start; gap: .4rem; }
.app-shell .wa-inbox .ibx-act-head .ibx-scope { flex: 1; }
.app-shell .wa-inbox .ibx-evs { display: flex; flex-direction: column; gap: .35rem; }
.app-shell .wa-inbox .ibx-ev {
    display: flex; align-items: flex-start; gap: .6rem; width: 100%; padding: .55rem .65rem; box-sizing: border-box;
    border-radius: 14px; border: 1px solid var(--lx-line); background: var(--bg-card); color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.app-shell .wa-inbox button.ibx-ev:hover { border-color: var(--primary-mid); }
.app-shell .wa-inbox .ibx-ev.static { cursor: default; }
.app-shell .wa-inbox .ibx-ev:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-shell .wa-inbox .ibx-ev.internal { border-style: dashed; }
.app-shell .wa-inbox .ibx-ev-ic { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--lx-ground); color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-ev-ic.k-ai { background: var(--ai-action-gradient, var(--primary)); color: #fff; }
.app-shell .wa-inbox .ibx-ev-ic.k-out, .app-shell .wa-inbox .ibx-ev-ic.k-assign { background: var(--lx-tint); color: var(--primary-dark); }
.app-shell .wa-inbox .ibx-ev-ic.k-call { background: color-mix(in srgb, var(--success) 12%, #fff); color: var(--ibx-ok); }
.app-shell .wa-inbox .ibx-ev-ic.k-note, .app-shell .wa-inbox .ibx-ev-ic.k-aipaused { background: color-mix(in srgb, var(--warning) 16%, #fff); color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-ev-t { flex: 1; min-width: 0; }
.app-shell .wa-inbox .ibx-ev-t b { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; font-size: .8rem; color: var(--brand-dark); }
.app-shell .wa-inbox .ibx-ev-t b em { font-style: normal; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ibx-warn); }
.app-shell .wa-inbox .ibx-ev-t small { display: block; margin-top: 1px; font-size: .74rem; line-height: 1.4; color: var(--text-secondary); overflow-wrap: anywhere; }
.app-shell .wa-inbox .ibx-ev time { flex: none; font-size: .7rem; color: var(--lx-ink-muted); white-space: nowrap; }
.app-shell .wa-inbox .ibx-ev-link { font-size: .74rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.app-shell .wa-inbox .ibx-act .ibx-gh { margin-top: .35rem; }

@media (max-width: 760px) {
    /* La hoja de Contexto: asa arriba, pestañas pegadas, objetivos de 44 px */
    .app-shell .wa-inbox .wa-info-panel.ibx-ctx-host::before {
        content: ""; display: block; width: 40px; height: 5px; margin: .45rem auto 0; border-radius: 3px; background: var(--lx-line);
    }
    .app-shell .wa-inbox .ibx-ctx-find { width: 44px; height: 44px; }
    .app-shell .wa-inbox .ibx-ref .ibx-src { display: none; }
    .app-shell .wa-inbox .ibx-mini { min-height: 40px; }
    .app-shell .wa-inbox .ibx-note .ibx-mini, .app-shell .wa-inbox .ibx-ico { width: 40px; }
    .app-shell .wa-inbox .ibx-biz-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .app-shell .wa-inbox .ibx-ailog .ibx-chev { transition: none; } }
