/* v16: pestañas de conversación, encabezado de empresa minimalista y galería de dibujos.
   Va DESPUÉS de dark.css: usa las variables del tema (--ink, --ink-2, --line, --panel, --bg, --brand), así sirve en claro y oscuro. */

/* ---------- dibujo del bot (en lugar del cuadro de color) ---------- */
.av.av-img{background:transparent!important;color:inherit;display:grid;place-items:center;overflow:visible}
.av.av-img img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none;user-select:none}

/* ---------- encabezado de empresa: una línea delgada ---------- */
body .v5 .folder-t.sec-head,
body .v5 .folder-t.sec-head.styled,
html[data-theme=dark] body .v5 .folder-t.sec-head,
html[data-theme=dark] body .v5 .folder-t.sec-head.styled{
  background:transparent;box-shadow:none;border-radius:8px;margin:12px 0 2px;padding:4px 6px;gap:6px;
  font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-2);min-height:28px}
body .v5 .folder-t.sec-head:hover,
body .v5 .folder-t.sec-head.styled:hover,
html[data-theme=dark] body .v5 .folder-t.sec-head:hover,
html[data-theme=dark] body .v5 .folder-t.sec-head.styled:hover{background:color-mix(in srgb,var(--ink) 6%,transparent);color:var(--ink)}
body .v5 .sec-head .chev{width:10px;font-size:10px;opacity:.7;color:inherit}
body .v5 .sec-head .ft-name{font-weight:600}
body .v5 .sec-head .ft-count,
html[data-theme=dark] body .v5 .sec-head .ft-count{background:transparent;padding:0 2px;border-radius:0;font-size:11px;font-weight:500;letter-spacing:0;color:var(--ink-2);opacity:.6}
/* el color de la empresa: solo un punto de 6 px (si la empresa tiene icono propio, se usa el icono sin cuadro) */
body .v5 .sec-head.styled .ft-name::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--sec);margin-right:7px;vertical-align:middle;position:relative;top:-1px}
body .v5 .sec-head .sec-ico ~ .ft-name::before{display:none}
body .v5 .sec-head .sec-ico{width:16px;height:16px;border-radius:0;background:transparent;color:color-mix(in srgb,var(--sec,var(--ink-2)) 85%,var(--ink-2))}
body .v5 .sec-head .sec-ico .sec-emo{font-size:13px}
body .v5 .sec-head .sec-ico svg{width:14px;height:14px}
/* ⋯ y 📚: solo al pasar el mouse o con el teclado; en pantalla táctil siempre visibles pero discretos */
body .v5 .sec-head .sec-more,body .v5 .sec-head .sec-mem{opacity:0;transition:opacity .12s;color:var(--ink-2)}
body .v5 .sec-head:hover .sec-more,body .v5 .sec-head:hover .sec-mem,
body .v5 .sec-head:focus-within .sec-more,body .v5 .sec-head:focus-within .sec-mem,
body .v5 .sec-head .sec-more:focus-visible,body .v5 .sec-head .sec-mem:focus-visible{opacity:1}
body .v5 .sec-head .sec-mem{filter:grayscale(1)}
@media (hover:none),(max-width:760px){
  body .v5 .sec-head .sec-more,body .v5 .sec-head .sec-mem{opacity:.55}
}
@media (prefers-reduced-motion:reduce){body .v5 .sec-head .sec-more,body .v5 .sec-head .sec-mem{transition:none}}

/* ---------- pestañas de conversación (solo PC) ---------- */
.tabs-bar{display:none}
@media (min-width:761px){
  .tabs-bar{display:flex;align-items:flex-end;gap:2px;flex:none;min-width:0;padding:6px 8px 0;background:var(--bg);border-bottom:1px solid var(--line)}
  .tabs-scroll{display:flex;align-items:flex-end;gap:2px;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
  .ptab{display:flex;align-items:center;flex:0 1 210px;min-width:128px;max-width:230px;height:36px;position:relative;
    border:1px solid transparent;border-bottom:0;border-radius:10px 10px 0 0;background:transparent;color:var(--ink-2)}
  .ptab:hover{background:color-mix(in srgb,var(--ink) 6%,transparent)}
  .ptab.on{background:var(--panel);border-color:var(--line);color:var(--ink);margin-bottom:-1px;height:37px;box-shadow:inset 0 2px 0 var(--brand)}
  .ptab-main{flex:1 1 auto;min-width:0!important;min-height:0!important;height:100%;display:flex;align-items:center;gap:7px;padding:0 2px 0 10px!important;border:0;background:transparent;
    color:inherit;font-size:13px;text-align:left;cursor:pointer;border-radius:10px 0 0 0}
  /* v16.5: el :hover genérico de button pintaba un bloque gris encima del marco y de la línea morada */
  .ptab .ptab-main:hover{background:transparent;border-color:transparent}
  .ptab.on{box-shadow:none}
  .ptab.on::before{content:"";position:absolute;left:10px;right:10px;top:-1px;height:2px;border-radius:0 0 2px 2px;background:var(--brand);pointer-events:none;z-index:1}
  .ptab-main:focus-visible,.ptab-x:focus-visible,.ptab-new:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
  .ptab-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ptab-t b{font-weight:700}
  .ptab-t i{font-style:normal;opacity:.5}
  .ptab .av{width:20px;height:20px;border-radius:6px;font-size:9px}
  .ptab .av .av-emoji{font-size:12px}
  .ptab .av svg{width:13px;height:13px}
  .ptab-x{flex:none;width:22px;height:22px;min-width:0!important;min-height:0!important;padding:0!important;margin-right:6px;border:0;border-radius:50%;background:transparent;
    color:inherit;font-size:11px;line-height:1;opacity:.45;cursor:pointer}
  .ptab:hover .ptab-x,.ptab.on .ptab-x{opacity:.8}
  .ptab-x:hover{opacity:1;background:color-mix(in srgb,var(--ink) 12%,transparent)}
  .ptab-dot{flex:none;width:8px;height:8px;border-radius:50%;margin-left:2px}
  .ptab-dot.new{background:var(--brand)}
  .ptab-dot.busy{background:#2E9D5B;animation:ptabPulse 1.2s ease-in-out infinite}
  .ptab-new{flex:none;width:30px;height:30px;min-width:0!important;min-height:0!important;padding:0!important;margin:0 0 3px 4px;border:0;border-radius:8px;
    background:transparent;color:var(--ink-2);font-size:20px;line-height:1;cursor:pointer}
  .ptab-new:hover{background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink)}
}
@keyframes ptabPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.7)}}
@media (prefers-reduced-motion:reduce){.ptab-dot.busy{animation:none}}

/* ---------- galería de dibujos ---------- */
.dib-dialog .dialog{width:min(760px,94vw);max-height:92vh;display:flex;flex-direction:column;gap:8px}
.dib-body{display:flex;flex-direction:column;gap:8px;min-height:0}
.dib-top input{width:100%;box-sizing:border-box}
.dib-chips{display:flex;flex-wrap:wrap;gap:6px}
.dib-chip{min-width:0!important;min-height:0!important;padding:5px 12px!important;border-radius:999px;font-size:13px;border:1px solid var(--line);background:transparent;color:var(--ink-2);cursor:pointer}
.dib-chip.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.dib-hint{margin:0;font-size:13px}
.dib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;max-height:50vh;overflow-y:auto;padding:4px}
.dib-opt{min-width:0!important;height:auto!important;min-height:96px!important;display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 4px!important;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);cursor:pointer}
.dib-opt:hover{border-color:var(--brand)}
.dib-opt.on{outline:2px solid var(--brand);outline-offset:1px}
.dib-opt img{flex:none;width:64px;height:64px;object-fit:contain}
.dib-opt span{flex:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--ink-2)}
@media (max-width:760px){
  .dib-grid{grid-template-columns:repeat(auto-fill,minmax(80px,1fr));max-height:46vh}
  .dib-opt{min-height:92px!important}
}

/* ---------- v16.2: barra lateral compacta (como Hermes): + y ☑ en la fila del bot, conversaciones en una línea ---------- */
.v5 .bot8 .bot-add,.v5 .bot8 .bot-sel{flex:none;width:26px;height:26px;min-width:0;min-height:0;padding:0;border:0;border-radius:7px;background:transparent;color:var(--ink-2,#5B6070);font-size:18px;line-height:1;cursor:pointer;opacity:0;transition:opacity .12s,background .12s;display:grid;place-items:center}
.v5 .bot8 .bot-sel{font-size:14px}
.v5 .bot8:hover .bot-add,.v5 .bot8:hover .bot-sel,.v5 .bot8.active .bot-add,.v5 .bot8 .bot-add:focus-visible,.v5 .bot8 .bot-sel:focus-visible,.v5 .bot8 .bot-add.on,.v5 .bot8 .bot-sel.on{opacity:1}
.v5 .bot8 .bot-add:hover,.v5 .bot8 .bot-sel:hover{background:var(--brand-soft);color:var(--brand)}
.v5 .bot8 .bot-add.on,.v5 .bot8 .bot-sel.on{color:var(--brand);background:var(--brand-soft)}
.v5 .bot8 .bot-open{min-height:40px;padding:5px 6px;gap:8px}
.bot-convs{gap:0;margin:0 0 4px 22px;padding:0 0 0 6px;border-left:1px solid var(--line)}
.bot-convs .conv-p{display:none}
.bot-convs .conv-open{min-height:30px;padding:5px 8px;gap:0;justify-content:center}
.bot-convs .conv-t{font-size:13px;font-weight:500}
.bot-convs .conv-row.active .conv-t{font-weight:600}
.bot-convs .conv-d{font-size:11px}
.bot-convs .conv-row{border-radius:7px}
.bot-convs .conv-more{width:26px;min-height:30px;font-size:16px;opacity:0;border-radius:7px}
.bot-convs .conv-row:hover .conv-more,.bot-convs .conv-row.active .conv-more,.bot-convs .conv-more:focus-visible{opacity:1}
.bot-convs .conv-all{min-height:28px;font-size:12px;padding:0 8px}
.bot-convs .conv-arch{margin-top:2px;padding-top:2px}
.bot-convs .conv-arch>summary{min-height:28px;font-size:12px;font-weight:500;padding:0 8px}
.bot-convs .conv-clean{padding:4px 8px;font-size:12px;border-radius:7px}
.bot-convs .conv-clean button{min-height:28px;font-size:12px}
.bot-convs .conv-chk{width:16px;height:16px;margin-left:6px}
.bot-convs .conv-selbar{padding:4px 8px;margin:2px 0 4px}
.bot-convs .conv-selbar button{min-height:28px;font-size:12px;padding:0 8px}
.bot-convs .conv-none{padding:4px 8px;font-size:12px}
@media (hover:none){.v5 .bot8 .bot-add,.v5 .bot8 .bot-sel,.bot-convs .conv-more{opacity:1}}
@media (max-width:760px){
  .v5 .bot8 .bot-add,.v5 .bot8 .bot-sel{width:40px;height:44px;opacity:1;font-size:20px}
  .v5 .bot8 .bot-sel{font-size:16px}
  body .bot-convs .conv-open{min-height:44px!important}
  body .bot-convs .conv-more{opacity:1;min-height:44px!important}
  body .bot-convs .conv-chk{width:22px;height:22px}
}
.v5 .bot8 .av{width:30px;height:30px;font-size:11px}
.v5 .bot8 .av .av-emoji{font-size:16px}
.v5 .bot8 .av .dot{width:10px;height:10px}
.v5 .bot8 .bot-name{font-size:14px}
.v5 .bot8 .sub{font-size:11.5px}

/* ---------- v16.3: barra solo con bots, pestañas con «▾ Más» ---------- */
.v5 .bot8 .bot-st{flex:none;width:9px;height:9px;border-radius:50%;margin-left:2px}
.v5 .bot8 .bot-st.busy{background:#2E9D5B;animation:ptabPulse 1.2s ease-in-out infinite}
.v5 .bot8 .bot-st.new{background:var(--brand)}
@media (prefers-reduced-motion:reduce){.v5 .bot8 .bot-st.busy{animation:none}}
.ptab-dots{display:none}
@media (min-width:761px){
  .ptab-dots{display:block;flex:none;width:22px;height:22px;min-width:0!important;min-height:0!important;padding:0!important;border:0;border-radius:50%;background:transparent;color:inherit;font-size:15px;line-height:1;cursor:pointer;opacity:0}
  .ptab:hover .ptab-dots,.ptab.on .ptab-dots,.ptab-dots:focus-visible{opacity:.8}
  .ptab-dots:hover{opacity:1;background:color-mix(in srgb,var(--ink) 12%,transparent)}
  .ptab-dots:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
  .ptab-more-btn{flex:none;height:30px;min-width:0!important;min-height:0!important;padding:0 10px!important;margin:0 0 3px 2px;border:0;border-radius:8px;background:transparent;color:var(--ink-2);font-size:13px;cursor:pointer;white-space:nowrap}
  .ptab-more-btn:hover,.ptab-more-btn[aria-expanded="true"]{background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink)}
  .ptab-more-btn:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
}
.tabs-more{position:fixed;z-index:60;display:flex;flex-direction:column;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.18);overflow:hidden}
.tabs-more .tm-h{display:flex;align-items:center;gap:6px;padding:10px 10px 6px 14px}
.tabs-more .tm-h b{flex:1;min-width:0;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tabs-more .tm-h button{min-width:0!important;min-height:0!important;height:28px;padding:0 10px!important;font-size:12.5px;border-radius:8px}
.tabs-more .tm-h .tm-x{width:28px;padding:0!important;font-size:14px}
.tabs-more .tm-h .tm-sel.on{background:var(--brand-soft);color:var(--brand)}
.tabs-more .tm-s{padding:0 12px 8px}
.tabs-more .tm-q{width:100%;box-sizing:border-box;height:34px;padding:0 10px;font-size:14px}
.tabs-more .tm-body{flex:1;min-height:0;overflow-y:auto;padding:0 8px 10px}
.tabs-more .bot-convs{margin:0;padding:0;border-left:0}
.tabs-more .conv-more{opacity:.7}
.tabs-more .conv-p{display:none}

/* v16.6: puntito en el encabezado de una empresa plegada */
.v5 .sec-head .bot-st{flex:none;width:8px;height:8px;border-radius:50%;margin-left:6px}
.v5 .sec-head .bot-st.busy{background:#2E9D5B;animation:ptabPulse 1.2s ease-in-out infinite}
.v5 .sec-head .bot-st.new{background:var(--brand)}
@media (prefers-reduced-motion:reduce){.v5 .sec-head .bot-st.busy{animation:none}}
