/* arlem-nucleo front/pizarra @ 239f19d · no editar acá, editar en el núcleo */
/* arlem-nucleo · front/pizarra.css · la pizarra de agentes con la forma de Fleetdeck (09/11 b): los chats a la izquierda | SÓLO EL CHAT en el
   medio, a todo el alto (columna centrada de 760 px, lo tuyo en burbuja, el bot en texto plano, la caja abajo con sombra) | pestañas a la derecha.
   Tema: la app pisa las --ag-* con `.ag-app, .ag-cab{…}` cargado después (Charlene las toma de sus tokens). `--ag-alto` = alto de las
   columnas (por defecto la pantalla menos la barra de la app). Botones: `.ag-btn` salvo que la app pase sus clases
   (`clases: { btn: 'btn', sm: 'sm', prim: 'primary', fant: 'ghost', xs: 'xs' }`). */
.ag-app, .ag-cab { --ag-fondo: #fff; --ag-linea: #e3e5e1; --ag-hover: #f3f4f1; --ag-inset: #f1f2ee; --ag-tinta: #1b1d1a; --ag-tinta-2: #4a4d48; --ag-tinta-3: #777b74;
  --ag-acento: #1f6f4a; --ag-acento-suave: #e3f0e8; --ag-acento-hondo: #175638; --ag-rojo: #b4232a; --ag-rojo-suave: #fbe7e7; --ag-naranja: #b8620f;
  --ag-radio: 12px; --ag-radio-control: 8px; --ag-alto: calc(100dvh - 120px);
  --ag-sombra: 0 0 0 1px color-mix(in srgb, var(--ag-tinta) 7%, transparent), 0 1px 2px rgb(0 0 0 / 6%), 0 4px 14px rgb(0 0 0 / 8%); }
.ag-cab { margin: 0 0 14px; } .ag-cab h1 { margin: 0; font-size: 22px; } .ag-cab p { margin: 2px 0 0; color: var(--ag-tinta-3); font-size: 13px; }
.ag-app { display: grid; grid-template-columns: 250px minmax(0, 1fr) 350px; gap: 12px; height: var(--ag-alto); min-height: 520px; color: var(--ag-tinta); }
.ag-app *, .ag-app *::before, .ag-app *::after { box-sizing: border-box; }

/* ── los chats (izquierda) ── */
.ag-bots { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; padding: 2px; }
.ag-bot { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none;
  border-radius: var(--ag-radio-control); padding: 7px 9px; cursor: pointer; color: inherit; font: inherit; }
.ag-bot:hover { background: var(--ag-hover); }
.ag-bot.on { background: var(--ag-fondo); box-shadow: var(--ag-sombra); }
.ag-bot-t { min-width: 0; } .ag-bot-t b { display: block; font-size: 13.5px; font-weight: 600; }
.ag-bot-t small { display: block; font-size: 11.5px; color: var(--ag-tinta-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-bot.ag-esp { opacity: .7; }
.ag-sep { height: 1px; background: var(--ag-linea); margin: 6px 9px; flex: none; }
.ag-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ag-acento-suave); color: var(--ag-acento-hondo); flex: none; font-size: 13px; }
.ag-av svg, .ag-av .i { width: 16px; height: 16px; }
.ag-esp .ag-av { background: var(--ag-inset); color: var(--ag-tinta-3); }
.ag-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--ag-inset); color: var(--ag-tinta-2); }
.ag-n.p1 { background: var(--ag-rojo); color: #fff; } .ag-n.p2 { background: var(--ag-naranja); color: #fff; }
.ag-nota-chat { font-size: 11.5px; margin: 10px 9px 0; color: var(--ag-tinta-3); }

/* ── el chat (medio) ── */
.ag-chatp { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--ag-fondo); border: 1px solid var(--ag-linea); border-radius: var(--ag-radio); overflow: hidden; }
.ag-ch-cab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ag-linea); flex: none; }
.ag-ch-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-ch-t b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ag-est { font-size: 12px; color: var(--ag-tinta-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 8px; }
.ag-col { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.65; }
.ag-intro { color: var(--ag-tinta-3); font-size: 13px; padding: 0 8px 8px; border-bottom: 1px dashed var(--ag-linea); margin-bottom: 4px; }
.ag-m { display: flex; flex-direction: column; min-width: 0; }
.ag-m.yo { align-self: flex-end; align-items: flex-end; max-width: 78%; }
.ag-bur { background: var(--ag-inset); border-radius: 12px; padding: 8px 14px; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgb(0 0 0 / 4%); }
.ag-bot-m { padding: 0 8px; }
.ag-md { overflow-wrap: anywhere; } .ag-md b { font-weight: 600; }
.ag-md a, .ag-bur a { color: var(--ag-acento-hondo); }
.ag-bar { font-size: 11px; line-height: 18px; color: var(--ag-tinta-3); opacity: .8; padding: 0 2px; }
.ag-m.yo .ag-bar { padding-right: 6px; }
.ag-ev { flex-direction: row; align-items: baseline; gap: 8px; padding: 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--ag-tinta-2); }
.ag-ev-p { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ag-tinta-3) 45%, transparent); flex: none; transform: translateY(-1px); }
.ag-ev.imp .ag-ev-p { background: var(--ag-naranja); }
.ag-ev-t { flex: 1; min-width: 0; overflow-wrap: anywhere; } .ag-ev-t b { font-weight: 600; color: var(--ag-tinta); }
.ag-ev-t a { color: inherit; text-decoration: none; } .ag-ev-t a:hover { text-decoration: underline; }
.ag-time { flex: none; font-size: 11px; color: var(--ag-tinta-3); }
.ag-imp { color: var(--ag-naranja); }
.ag-pensando { flex-direction: row; align-items: center; gap: 8px; padding: 0 8px; color: var(--ag-tinta-3); font-size: 12.5px; }
.ag-puntos { display: inline-flex; gap: 3px; } .ag-puntos i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: ag-p 1.2s infinite ease-in-out; }
.ag-puntos i:nth-child(2) { animation-delay: .15s; } .ag-puntos i:nth-child(3) { animation-delay: .3s; }
@keyframes ag-p { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ag-puntos i { animation: none; opacity: .6; } }
.ag-vacio { margin: 4px 0; font-size: 12.5px; color: var(--ag-tinta-3); list-style: none; }
.ag-col > .ag-vacio { padding: 0 8px; }
/* la caja: tarjeta con sombra, el texto crece, el clip a la izquierda y mandar a la derecha */
.ag-compose { flex: none; width: calc(100% - 32px); max-width: 760px; margin: 4px auto 14px; background: var(--ag-fondo); border-radius: var(--ag-radio); box-shadow: var(--ag-sombra); }
.ag-compose textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--ag-tinta); font: inherit; font-size: 13.5px;
  line-height: 1.6; padding: 12px 16px 4px; min-height: 64px; max-height: 220px; }
.ag-compose textarea::placeholder { color: var(--ag-tinta-3); opacity: .8; }
.ag-compose-b { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px 10px; }
.ag-clips { flex: 1; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ag-tinta-3); }
.ag-clip { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--ag-tinta-3); cursor: pointer; flex: none; }
.ag-clip:hover { background: var(--ag-hover); color: var(--ag-tinta); }
.ag-mandar { width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; background: var(--ag-acento); color: #fff; cursor: pointer; flex: none; }
.ag-mandar:hover { background: var(--ag-acento-hondo); } .ag-mandar:disabled { opacity: .5; cursor: default; }

/* ── las pestañas (derecha) ── */
.ag-panel { display: flex; flex-direction: column; min-height: 0; background: var(--ag-fondo); border: 1px solid var(--ag-linea); border-radius: var(--ag-radio); overflow: hidden; }
.ag-tabs { display: flex; gap: 0; padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--ag-linea); flex: none; }
.ag-tab { flex: none; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 500; color: var(--ag-tinta-3); padding: 6px 6px 8px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ag-tab:hover { color: var(--ag-tinta); } .ag-tab.on { color: var(--ag-tinta); border-bottom-color: var(--ag-acento); }
.ag-tab span { font-size: 11px; font-weight: 600; background: var(--ag-inset); color: var(--ag-tinta-2); border-radius: 9px; padding: 0 6px; margin-left: 2px; }
.ag-tb { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.ag-tb[hidden] { display: none; }
.ag-col-panel { gap: 8px; } .ag-col-panel .ag-ev { padding: 0; }
.ag-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ag-lista li > a, .ag-lista li > span { display: block; padding: 6px 8px; border-radius: var(--ag-radio-control); color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.ag-lista li > a:hover { background: var(--ag-hover); }
.ag-lista li.mal > a, .ag-lista li.mal > span { border-left-color: var(--ag-rojo); background: color-mix(in srgb, var(--ag-rojo-suave) 55%, transparent); }
.ag-it-t { display: block; font-weight: 500; font-size: 13px; overflow-wrap: anywhere; } .ag-it-s { display: block; font-size: 12px; color: var(--ag-tinta-3); }
.ag-asig li { display: flex; align-items: center; gap: 6px; } .ag-asig li > span:first-child { flex: 1; min-width: 0; }
.ag-asig li.ag-cerrado { opacity: .6; }
.ag-lista li > span.ag-enc-b { display: flex; flex-direction: column; gap: 2px; flex: none; padding: 0; border: 0; background: none; } /* los botones no llevan la raya ni el fondo del ítem */
.ag-enlace { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ag-acento-hondo); cursor: pointer; }
.ag-enlace:hover { text-decoration: underline; }
.ag-desp { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--ag-tinta-2); }
.ag-t-acc { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-tar { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-t { display: grid; gap: 3px; justify-items: start; border: 1px solid var(--ag-linea); border-left: 3px solid var(--ag-linea); border-radius: var(--ag-radio-control); padding: 9px 11px; }
.ag-t.p1 { border-left-color: var(--ag-rojo); } .ag-t.p2 { border-left-color: var(--ag-naranja); }
.ag-t-cab { display: flex; gap: 6px; align-items: center; }
.ag-pri { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; border-radius: 5px; padding: 1px 6px; background: var(--ag-inset); color: var(--ag-tinta-2); }
.ag-pri.p1 { background: var(--ag-rojo); color: #fff; } .ag-pri.p2 { background: color-mix(in srgb, var(--ag-naranja) 18%, var(--ag-fondo)); color: var(--ag-naranja); }
.ag-t-bot { font-size: 11px; color: var(--ag-tinta-3); }
.ag-t-tit { font-size: 13.5px; overflow-wrap: anywhere; } .ag-t-det { font-size: 12.5px; color: var(--ag-tinta-2); overflow-wrap: anywhere; }
.ag-t-por { font-size: 11.5px; color: var(--ag-tinta-3); }
.ag-t > a, .ag-t > button, .ag-t-acc { margin-top: 5px; }
.ag-tar-vacio { display: flex; gap: 8px; align-items: center; color: var(--ag-tinta-3); font-size: 13px; padding: 10px 2px; }

/* botones propios (si la app no pasa los suyos) */
.ag-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--ag-radio-control); border: 1px solid var(--ag-linea); background: var(--ag-fondo);
  color: var(--ag-tinta); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.ag-btn:hover { background: var(--ag-hover); } .ag-btn:disabled { opacity: .5; cursor: default; }
.ag-btn.ag-prim { background: var(--ag-acento); border-color: var(--ag-acento); color: #fff; } .ag-btn.ag-prim:hover { background: var(--ag-acento-hondo); }
.ag-btn.ag-fant { background: transparent; border-color: transparent; color: var(--ag-tinta-2); } .ag-btn.ag-fant:hover { background: var(--ag-hover); }
.ag-btn.ag-xs { height: 26px; padding: 0 8px; font-size: 12px; }

/* cabecera del chat: botones chicos a la derecha (cómo se activa, y el panel en pantallas angostas) */
.ag-cab-b { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--ag-linea); border-radius: 14px; background: var(--ag-fondo);
  color: var(--ag-tinta-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; flex: none; }
.ag-cab-b:hover { background: var(--ag-hover); color: var(--ag-tinta); }
.ag-cab-n { font-size: 11px; font-weight: 600; background: var(--ag-inset); color: var(--ag-tinta-2); border-radius: 9px; padding: 0 6px; }
.ag-cab-n.p1 { background: var(--ag-rojo); color: #fff; }
/* chat angosto (3 columnas en una laptop): el botón queda en ⚡ N y el nombre del bot no se corta */
.ag-chatp { container-type: inline-size; }
@container (max-width: 520px) { .ag-cab-l { display: none; } }
.ag-panel-btn, .ag-panel-x { display: none; }
.ag-panel-x { margin-left: auto; width: 28px; height: 28px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ag-tinta-3); cursor: pointer; border-radius: 6px; flex: none; }
.ag-panel-x:hover { background: var(--ag-hover); color: var(--ag-tinta); }
/* el pop up de cómo se activa (margin: auto lo centra aunque la app tenga `* { margin: 0 }`, como Kura) */
.ag-pop { width: min(520px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 48px)); margin: auto; padding: 0; border: 0; border-radius: var(--ag-radio); background: var(--ag-fondo);
  color: var(--ag-tinta); box-shadow: 0 12px 40px rgb(0 0 0 / 22%); overflow: hidden; }
.ag-pop[open] { display: flex; flex-direction: column; }
.ag-pop::backdrop { background: rgb(0 0 0 / 28%); }
.ag-pop-cab { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--ag-linea); }
.ag-pop-cab b { font-size: 15px; font-weight: 600; } .ag-pop-cab .ag-panel-x { display: block; }
.ag-pop-c { overflow-y: auto; padding: 10px 18px 18px; }
.ag-pop .ag-sub { margin: 16px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ag-tinta-3); }
.ag-pop .ag-sub .ag-enlace { text-transform: none; letter-spacing: 0; font-size: 13px; }
.ag-act { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.ag-act li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--ag-linea); border-radius: var(--ag-radio-control); font-size: 13px; }
.ag-act-c { display: inline-flex; align-items: flex-start; gap: 5px; font-weight: 600; color: var(--ag-acento-hondo); }
.ag-act-c svg { margin-top: 3px; }
@media (max-width: 560px) { .ag-act li { grid-template-columns: 1fr; gap: 2px; } }
.ag-act-c svg { flex: none; } .ag-act-q { color: var(--ag-tinta-2); overflow-wrap: anywhere; }

/* angosto: dos columnas y el panel se abre encima, a la derecha; celular: los chats en una fila y el chat a todo lo que queda.
   La pizarra NUNCA se estira hacia abajo: tiene el alto de la pantalla y adentro scrollea cada parte. */
.ag-app { position: relative; }
@media (max-width: 1180px) { .ag-app { grid-template-columns: 220px minmax(0, 1fr); }
  .ag-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 20; display: none; box-shadow: 0 8px 32px rgb(0 0 0 / 18%); }
  .ag-app.ag-panel-on .ag-panel { display: flex; }
  .ag-panel-btn, .ag-tabs .ag-panel-x { display: inline-flex; } .ag-tabs .ag-panel-x { align-items: center; justify-content: center; order: 9; }
  .ag-app .ag-ch-cab .ag-abrir { display: none; } }
@media (max-width: 760px) { .ag-app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: var(--ag-alto-movil, calc(100dvh - 140px)); min-height: 380px; gap: 8px; }
  .ag-bots { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .ag-bot { width: auto; grid-template-columns: 26px auto auto; flex: none; } .ag-av { width: 26px; height: 26px; }
  .ag-bot-t small, .ag-nota-chat, .ag-sep { display: none; }
  .ag-panel { width: 100%; } .ag-cab-l { display: none; } .ag-ch-cab { padding: 8px 10px; gap: 8px; }
  .ag-feed { padding: 14px 10px 6px; } .ag-compose { width: calc(100% - 20px); margin-bottom: 10px; }
  .ag-m.yo { max-width: 88%; } .ag-compose textarea { font-size: 16px; min-height: 48px; max-height: 120px; } .ag-btn { height: 40px; } }
