/* BG7 · La vista staff utiliza las clases visuales de Arleyn: sidebar, chat-header,
   conversation, avatar, message-row, message, message-meta y variables --wa-*.
   No carga app.js ni sus APIs comerciales. */
.arleyn-staff-inbox{height:100%;min-width:0;overflow:hidden;background:var(--wa0,#111212);color:var(--wa-text,#f0f2f5);color-scheme:dark}
.arleyn-staff-inbox [hidden]{display:none!important}
.arleyn-staff-workspace{height:100%;min-height:0;display:grid;grid-template-columns:minmax(280px,32%) minmax(0,1fr)}
.arleyn-staff-chat-list{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;background:var(--wa1,#161717);border-right:1px solid var(--wa-line,rgba(255,255,255,.07))}
.arleyn-staff-list-head{flex:0 0 66px;height:66px;display:flex;align-items:center;justify-content:space-between;padding:0 18px}
.arleyn-staff-list-head strong{font-size:19px}.arleyn-staff-list-head small{font-size:11px;color:var(--wa-muted,#a0a2a3)}
.arleyn-staff-readonly-label,.arleyn-staff-header-tag{font-size:11px;color:var(--wa-soft,#d5d7d8);border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));padding:4px 9px;border-radius:999px;background:var(--wa4,#2a2c2c)}
.arleyn-staff-search-wrap{position:relative;flex:0 0 auto;padding:12px 14px}
.arleyn-staff-search-wrap svg{position:absolute;left:27px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--wa-muted,#a0a2a3);pointer-events:none}
.arleyn-staff-search-wrap input{width:100%;padding:10px 12px 10px 42px;border-radius:9px;background:var(--wa5,#2e3030);color:var(--wa-text,#f0f2f5);border:1px solid var(--wa-line,rgba(255,255,255,.07));font:inherit;outline:none}
.arleyn-staff-search-wrap input:focus-visible{outline:2px solid var(--wa-info,#53bdeb)}
.arleyn-staff-filters{display:flex;gap:7px;padding:0 14px 12px;border-bottom:1px solid var(--wa-line,rgba(255,255,255,.07))}
.arleyn-staff-filters button{padding:7px 13px;border:0;border-radius:999px;background:var(--wa5,#2e3030);color:var(--wa-soft,#d5d7d8);font:inherit;cursor:pointer}
.arleyn-staff-filters button[aria-pressed="true"]{color:var(--wa-text,#f0f2f5);background:var(--wa-outgoing,#144d37)}
#staffChats{flex:1;min-height:0;overflow-y:auto;height:auto}
#staffChats button.conversation{width:100%;min-height:73px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;padding:12px 14px;align-items:center;text-align:left;border:0;border-bottom:1px solid var(--wa-line-soft,rgba(255,255,255,.055));border-left:0;background:transparent;color:var(--wa-text,#f0f2f5);font:inherit;cursor:pointer;box-shadow:none;transition:background .15s ease}
#staffChats button.conversation:hover,#staffChats button.conversation:focus-visible,#staffChats button.conversation[aria-current="true"]{background:var(--wa5,#2e3030)}
#staffChats .avatar{background:var(--wa5,#2e3030);color:var(--wa-text,#f0f2f5);font-weight:600;font-size:13px}
#staffChats .staff-chat-info{display:grid;gap:4px;min-width:0}
#staffChats .chat-title{font-size:14px;font-weight:600;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#staffChats .staff-chat-subtitle{font-size:12px;color:var(--wa-muted,#a0a2a3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#staffChats .staff-chat-side{display:flex;flex-direction:column;align-items:flex-end;gap:5px;min-width:42px}
#staffChats .staff-chat-time{color:var(--wa-muted,#a0a2a3);font-size:11px}
#staffChats .unread{min-width:18px;padding:2px 5px;border-radius:999px;text-align:center;background:var(--wa-green,#00d756);color:#072914;font-size:10px;font-weight:700;white-space:nowrap}
#staffChats .unread:empty{display:none}
#staffChats .staff-filter-empty{padding:20px 14px;color:var(--wa-muted,#a0a2a3);text-align:center}
.arleyn-staff-chat-area{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--wa0,#111212)}
.arleyn-staff-chat-header{flex:0 0 66px;height:66px;gap:12px;background:var(--wa2,#1d1f1f);border-bottom:1px solid var(--wa-line,rgba(255,255,255,.07))}
.arleyn-staff-chat-header .chat-title{min-width:0;flex:1;overflow:hidden}
.arleyn-staff-chat-header .chat-title strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.arleyn-staff-chat-header .avatar{flex:0 0 42px;background:var(--wa5,#2e3030);color:var(--wa-text,#f0f2f5);font-size:13px}
.arleyn-staff-back{display:none;border:0;background:transparent;color:var(--wa-text,#f0f2f5);font-size:21px;cursor:pointer}
#staffMessages{flex:1;min-height:0;overflow:auto;padding:18px 5%;background:var(--wa0,#111212);color:var(--wa-text,#f0f2f5);display:block}
#staffMessages p{color:var(--wa-soft,#d5d7d8)}
#staffMessages .message-row{max-width:100%;margin:3px 0}
#staffMessages .message{max-width:min(560px,82%);width:auto;white-space:normal;box-sizing:border-box;padding:7px 9px 5px;display:flex;flex-direction:column;gap:4px}
#staffMessages .message-text{white-space:pre-wrap;line-height:1.45;font-size:13px}
#staffMessages .message-meta{align-self:flex-end;color:var(--wa-muted,#a0a2a3);font-size:10px;margin:0}
#staffMessages .message.inbound{background:var(--wa3,#202222)}
#staffMessages .message.outbound{background:var(--wa-outgoing,#144d37)}
#staffMessages .arleyn-staff-empty{min-height:70%;display:grid;place-content:center;text-align:center;gap:8px;color:var(--wa-muted,#a0a2a3)}
#staffMessages .arleyn-staff-empty strong{font-size:19px;color:var(--wa-text,#f0f2f5)}
#staffMessages .arleyn-staff-empty p{margin:0}
#staffMessages button{border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));border-radius:9px;padding:8px 12px;background:var(--wa5,#2e3030);color:var(--wa-text,#f0f2f5);cursor:pointer}
#staffMessages .staff-attachment{display:grid;gap:6px;border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));padding:9px;border-radius:9px;background:var(--wa4,#2a2c2c);overflow-wrap:anywhere}
#staffMessages .staff-attachment strong{font-size:12px}
#staffMessages .staff-attachment small{font-size:11px;color:var(--wa-muted,#a0a2a3)}
#staffMessages .staff-attachment-actions{display:flex;gap:8px;flex-wrap:wrap}
#staffMessages .staff-attachment-actions a{display:inline-flex;padding:6px 9px;border:1px solid var(--wa-line,rgba(255,255,255,.07));border-radius:8px;color:var(--wa-text,#f0f2f5);background:var(--wa5,#2e3030);text-decoration:none;font-size:12px}
.arleyn-staff-readonly-hint{padding:13px 16px;background:var(--wa2,#1d1f1f);color:var(--wa-muted,#a0a2a3);font-size:12px;border-top:1px solid var(--wa-line,rgba(255,255,255,.07));text-align:center}
#staffComposer{border-top:1px solid var(--wa-line,rgba(255,255,255,.07));background:var(--wa2,#1d1f1f);padding:10px 14px;display:grid;gap:8px}
#staffComposer label{font-weight:600;font-size:12px;color:var(--wa-soft,#d5d7d8)}
#staffTextInput{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;max-height:180px;background:var(--wa4,#2a2c2c);color:var(--wa-text,#f0f2f5);border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));border-radius:10px;padding:10px;font:inherit}
#staffTextInput:focus-visible{outline:2px solid var(--wa-info,#53bdeb)}
.arleyn-staff-composer-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}
#staffSendButton,#staffMediaSendButton{border:0;border-radius:999px;background:var(--wa-action,#1f8f72);color:#fff;padding:10px 16px;cursor:pointer;font:inherit;font-weight:700}
#staffSendButton:disabled,#staffMediaSendButton:disabled{opacity:.6;cursor:wait}
#staffSendStatus,#staffMediaStatus{font-size:12px;color:var(--wa-muted,#a0a2a3);overflow-wrap:anywhere}
#staffMediaComposer{display:grid;gap:7px;border-top:1px solid var(--wa-line,rgba(255,255,255,.07));padding-top:10px}
#staffMediaFile,#staffMediaCaption{width:100%;box-sizing:border-box;padding:9px;background:var(--wa4,#2a2c2c);color:var(--wa-text,#f0f2f5);border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));border-radius:8px}
@media(max-width:700px){.arleyn-staff-workspace{display:block;position:relative}.arleyn-staff-chat-list,.arleyn-staff-chat-area{position:absolute;inset:0}.arleyn-staff-chat-list{z-index:1}.arleyn-staff-chat-area{z-index:2;display:none}.arleyn-staff-chat-area.staff-mobile-chat-open{display:flex}.arleyn-staff-chat-header .arleyn-staff-back{display:inline-flex}#staffMessages{padding:12px}#staffMessages .message{max-width:90%}.arleyn-staff-header-tag{display:none}}
@media(min-width:701px) and (max-width:980px){.arleyn-staff-workspace{grid-template-columns:minmax(255px,37%) minmax(0,1fr)}}

/* BG7B · Paridad visual segura de lectura: fechas, emojis y adjuntos protegidos. */
#staffMessages .staff-date-divider{display:table;max-width:calc(100% - 32px);margin:16px auto 13px;padding:5px 12px;border-radius:9px;background:var(--wa3,#202222);color:var(--wa-soft,#d5d7d8);box-shadow:0 1px 2px #0004;font-size:11px;line-height:1.4;text-align:center}
#staffMessages .message-row.staff-grouped-outbound{margin-top:-2px}
#staffMessages .staff-grouped-outbound .message.outbound{border-top-right-radius:6px}
#staffMessages .message.staff-emoji-only{background:transparent!important;box-shadow:none!important;padding:4px 0;min-height:50px}
#staffMessages .staff-emoji-only .message-text{font-size:44px;line-height:1.2}
#staffMessages .staff-emoji-only .message-meta{margin-inline:5px}
#staffMessages .message.staff-sticker-bubble{background:transparent!important;padding:0;box-shadow:none!important}
#staffMessages .staff-sticker-bubble .staff-attachment{background:var(--wa3,#202222);border-radius:12px}
#staffMessages .staff-attachment{min-width:min(240px,100%);max-width:100%;padding:11px;border-radius:12px;gap:9px}
#staffMessages .staff-attachment-heading{display:flex;align-items:center;gap:10px;min-width:0}
#staffMessages .staff-attachment-icon{width:42px;min-width:42px;height:44px;display:grid;place-items:center;background:var(--wa5,#2e3030);color:var(--wa-text,#f0f2f5);border-radius:9px;font-weight:700;font-size:12px}
#staffMessages .staff-attachment-copy{min-width:0;display:grid;gap:2px}
#staffMessages .staff-attachment-copy strong{overflow-wrap:anywhere;font-size:12px;font-weight:600}
#staffMessages .staff-attachment-copy small{color:var(--wa-muted,#a0a2a3);font-size:11px}
#staffMessages .staff-attachment-actions{display:flex;gap:8px;flex-wrap:wrap}
#staffMessages .staff-attachment-actions button{padding:6px 9px;font-size:12px}
#staffMessages .staff-attachment-actions[hidden],#staffMessages .staff-inline-preview[hidden],#staffMessages .staff-media-unavailable[hidden]{display:none!important}
#staffMessages .staff-inline-preview{display:grid;gap:8px;justify-items:center;max-width:360px}
#staffMessages .staff-image-inline{display:block;width:auto;height:auto;max-width:100%;max-height:250px;object-fit:contain;border-radius:8px;background:var(--wa0,#111212)}
#staffMessages .staff-image-enlarge{justify-self:center}
@media(max-width:700px){#staffMessages .staff-date-divider{margin:12px auto}#staffMessages .staff-emoji-only .message-text{font-size:36px}}

/* BG7C · Paridad de lienzo con Arleyn principal; valores desde theme-whatsapp.css. */
.arleyn-staff-profile .arleyn-staff-rail{background:var(--wa2,#1d1f1f);border-right:1px solid var(--wa-line,rgba(255,255,255,.07));color:var(--wa-text,#f0f2f5)}
.arleyn-staff-profile .arleyn-staff-rail button{color:var(--wa-soft,#d5d7d8);font-weight:600}
.arleyn-staff-profile .arleyn-staff-rail button[aria-current="true"]{background:var(--wa5,#2e3030);border-color:var(--wa-line-strong,rgba(255,255,255,.115));color:var(--wa-text,#f0f2f5)}
.arleyn-staff-profile .arleyn-staff-rail button:hover:not(:disabled){background:var(--wa6,#383a3a)}
.arleyn-staff-profile .arleyn-staff-chat-area.has-chat-wallpaper{background-color:var(--wa0,#111212)!important;background-image:linear-gradient(rgba(17,18,18,.14),rgba(17,18,18,.14)),var(--chat-wallpaper-image)!important;background-size:cover,cover!important;background-position:center center,center center!important;background-repeat:no-repeat,no-repeat!important}
.arleyn-staff-profile .arleyn-staff-chat-area.has-chat-wallpaper #staffMessages{background:transparent!important;background-image:none!important}
.arleyn-staff-profile .arleyn-staff-chat-area.has-chat-wallpaper .arleyn-staff-readonly-hint{background:rgba(29,31,31,.94)}
.arleyn-staff-profile .arleyn-staff-chat-area:not(.has-chat-wallpaper){background:var(--wa0,#111212)}
.arleyn-staff-profile #staffMessages{padding:22px clamp(18px,5%,72px);font-size:14px}
.arleyn-staff-profile #staffMessages .message-row{display:flex;align-items:flex-start;margin:3px 0;min-width:0}
.arleyn-staff-profile #staffMessages .message-row.outbound-row{justify-content:flex-end}
.arleyn-staff-profile #staffMessages .message{position:relative;max-width:min(520px,82%);border-radius:9px;padding:7px 9px 5px;font-size:14px;line-height:1.4;overflow-wrap:anywhere;box-shadow:0 1px 2px rgba(0,0,0,.16)}
.arleyn-staff-profile #staffMessages .message-text{font-size:14px;line-height:1.4}
.arleyn-staff-profile #staffMessages .message.inbound{background:var(--wa3,#202222)!important}
.arleyn-staff-profile #staffMessages .message.outbound{background:var(--wa-outgoing,#144d37)!important}
.arleyn-staff-profile #staffMessages .message-meta{font-size:11px;color:var(--wa-muted,#a0a2a3);line-height:1.1}
.arleyn-staff-profile #staffMessages .staff-date-divider{position:sticky;top:4px;z-index:2;font-size:12px;background:var(--wa4,#2a2c2c)}
.arleyn-staff-profile #staffChats .staff-chat-subtitle{font-size:12px}
.arleyn-staff-profile #staffChats button.conversation{min-height:76px;padding:10px 14px;gap:12px}
.arleyn-staff-profile #staffChats .chat-title{font-size:14px}
.arleyn-staff-profile #staffChats .avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;flex:0 0 44px;font-size:13px}
.arleyn-staff-profile .arleyn-staff-chat-header{min-height:66px;padding:0 16px}
.arleyn-staff-profile .arleyn-staff-chat-header .chat-title strong{font-size:15px}
.arleyn-staff-profile #staffMessages .staff-attachment{background:var(--wa4,#2a2c2c)}
@media(max-width:700px){.arleyn-staff-profile #staffMessages{padding:14px 12px}.arleyn-staff-profile #staffMessages .message{max-width:90%}.arleyn-staff-profile .arleyn-staff-chat-area.has-chat-wallpaper{background-position:center center!important}}

/* BG7E — misma fecha del transcript original; nunca sticky para evitar solapamientos. */
.arleyn-staff-profile #staffMessages .message-day-separator{
  position:relative!important;top:auto!important;z-index:auto;
  display:table;max-width:calc(100% - 32px);margin:16px auto 13px;
  padding:0;background:transparent!important;border:0!important;box-shadow:none!important;
  text-align:center;
}
.arleyn-staff-profile #staffMessages .message-day-separator>span{
  display:inline-block;padding:6px 12px;border-radius:8px;
  background:var(--wa4,#2a2c2c);color:var(--wa-soft,#d5d7d8);
  font-size:11px;line-height:1.4;box-shadow:0 1px 2px rgba(0,0,0,.16);
}
.arleyn-staff-profile #staffMessages .message-time{white-space:nowrap}

/* BG7F: los mismos reproductores y stickers del renderizador principal. */
.arleyn-staff-profile #staffMessages .staff-inline-player{width:min(100%,360px);min-width:0}
.arleyn-staff-profile #staffMessages .audio-player{display:block;width:100%;max-width:360px;height:46px;margin:4px 0;color-scheme:dark}
.arleyn-staff-profile #staffMessages .video-player{display:block;width:100%;max-width:360px;max-height:340px;background:#111;border-radius:10px;margin:4px 0}
.arleyn-staff-profile #staffMessages .staff-inline-sticker{width:min(100%,230px);max-width:230px}
.arleyn-staff-profile #staffMessages .sticker-stage{display:grid;place-items:center;background:transparent;padding:4px}
.arleyn-staff-profile #staffMessages .sticker-preview{display:block;max-width:100%;max-height:210px;object-fit:contain;cursor:zoom-in}
.arleyn-staff-profile #staffMessages .message.staff-sticker-bubble .staff-attachment{background:transparent!important;border:0!important;padding:0!important}
.arleyn-staff-profile #staffMessages .staff-sticker-bubble .staff-attachment-heading{display:none}
.arleyn-staff-profile #staffMessages .staff-sticker-bubble .staff-attachment-actions{justify-content:center}
@media(max-width:700px){.arleyn-staff-profile #staffMessages .audio-player,.arleyn-staff-profile #staffMessages .video-player{max-width:100%}}

/* BG7G1 — el documento utiliza las mismas clases de media que el propietario. */
.arleyn-staff-profile #staffMessages .staff-document-wrapper{background:transparent;border:0;padding:0;gap:8px}
.arleyn-staff-profile #staffMessages .staff-document-wrapper .document-card{display:flex;align-items:center;gap:12px;min-width:min(260px,100%);padding:12px;border-radius:10px;background:var(--wa4,#2a2c2c);border:1px solid var(--wa-line,rgba(255,255,255,.07))}
.arleyn-staff-profile #staffMessages .staff-document-wrapper .document-icon{display:grid;place-items:center;flex:0 0 46px;width:46px;height:50px;background:var(--wa5,#2e3030);border-radius:8px;color:var(--wa-soft,#d5d7d8);font-weight:700}
.arleyn-staff-profile #staffMessages .staff-document-wrapper .document-info{min-width:0;flex:1;display:grid;gap:3px}
.arleyn-staff-profile #staffMessages .staff-document-wrapper .document-info strong{font-size:13px;overflow-wrap:anywhere}
.arleyn-staff-profile #staffMessages .staff-document-wrapper .document-info small{font-size:11px;color:var(--wa-muted,#a0a2a3)}
.arleyn-staff-profile #staffMessages .staff-document-wrapper .staff-attachment-actions{padding:0 4px}
.arleyn-staff-profile #staffMessages .staff-inline-preview .media-preview-image{max-width:100%;max-height:280px;border-radius:9px;object-fit:contain;cursor:zoom-in}

/* BG7G2B: fotografía únicamente si contact.photo lo autoriza. */
.arleyn-staff-conversation .avatar,.arleyn-staff-chat-header .avatar{position:relative;overflow:hidden;flex-shrink:0}
.arleyn-staff-contact-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}

/* BG7G2C1 — opción de impresión de archivos autorizados, dentro de Arleyn Desktop. */
.arleyn-staff-profile #staffMessages .staff-print-action{display:inline-flex;align-items:center;justify-content:center;font-size:12px;padding:6px 10px;border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));background:var(--wa5,#2e3030);color:var(--wa-text,#f0f2f5)}
.arleyn-staff-profile #staffMessages .staff-print-action[hidden]{display:none!important}
.arleyn-staff-profile #staffMessages .staff-print-action:disabled{opacity:.5;cursor:not-allowed}
.arleyn-staff-profile #staffMessages .staff-print-feedback{color:var(--wa-muted,#a0a2a3);font-size:11px}

/* BG7H1 — Reutiliza .composer, .composer-shell, .attach-btn del propietario.
   Sólo se agregan diferencias de contenedor/permiso de la sesión staff. */
.arleyn-staff-profile .arleyn-staff-composer-shell{flex:0 0 auto;min-width:0;padding:7px 10px 9px;background:var(--wa1,#161717);border-top:1px solid var(--wa-line,rgba(255,255,255,.07));box-sizing:border-box}
.arleyn-staff-profile #staffComposer{display:flex;gap:8px;align-items:flex-end;margin:0;padding:3px 6px;min-height:44px;border:0;border-radius:22px;background:var(--wa4,#2a2c2c);box-shadow:none}
.arleyn-staff-profile #staffTextInput{display:block;flex:1;min-width:0;width:auto;min-height:36px;max-height:112px;resize:none;overflow-y:auto;padding:8px 5px;border:0;border-radius:0;background:transparent;color:var(--wa-text,#f0f2f5);font:inherit;font-size:13px;line-height:1.35;box-shadow:none}
.arleyn-staff-profile #staffTextInput:focus-visible{outline:0}
.arleyn-staff-profile #staffTextInput::placeholder{color:var(--wa-muted,#a0a2a3)}
.arleyn-staff-profile #staffSendButton,.arleyn-staff-profile #staffAttachToggle{flex:0 0 36px;width:36px;height:36px;min-width:36px;display:grid;place-items:center;border:0;border-radius:50%;padding:6px;background:transparent;color:var(--wa-soft,#d5d7d8);cursor:pointer;box-shadow:none}
.arleyn-staff-profile #staffSendButton svg,.arleyn-staff-profile #staffAttachToggle svg{display:block;width:21px;height:21px}
.arleyn-staff-profile #staffSendButton:not(:disabled){color:var(--wa-green,#00d756)}
.arleyn-staff-profile #staffSendButton:hover:not(:disabled),.arleyn-staff-profile #staffAttachToggle:hover:not(:disabled){background:var(--wa5,#2e3030)}
.arleyn-staff-profile #staffSendButton:disabled,.arleyn-staff-profile #staffAttachToggle:disabled{opacity:.42;cursor:default}
.arleyn-staff-profile #staffSendStatus:empty{display:none}
.arleyn-staff-profile #staffSendStatus:not(:empty){display:block;padding:7px 11px;font-size:12px;color:var(--wa-soft,#d5d7d8)}
.arleyn-staff-profile #staffMediaComposer{margin-top:7px;padding:10px;border:1px solid var(--wa-line,rgba(255,255,255,.07));border-radius:12px;background:var(--wa3,#202222)}
.arleyn-staff-profile .arleyn-staff-composer-shell[hidden],.arleyn-staff-profile #staffComposer[hidden],.arleyn-staff-profile #staffTextInput[hidden],.arleyn-staff-profile #staffSendButton[hidden],.arleyn-staff-profile #staffAttachToggle[hidden],.arleyn-staff-profile #staffMediaComposer[hidden]{display:none!important}
@media(max-width:700px){.arleyn-staff-profile .arleyn-staff-composer-shell{padding:5px 7px max(7px,env(safe-area-inset-bottom))}}

/* BG7I1 — imágenes inline: utilizar el markup compartido del propietario.
   La descarga/impresión continúan protegidas por permisos individuales. */
.arleyn-staff-profile #staffMessages .staff-image-bubble .staff-attachment{
  padding:0;border:0;background:transparent;gap:5px;overflow:visible;
}
.arleyn-staff-profile #staffMessages .staff-image-bubble .staff-attachment-heading{display:none}
.arleyn-staff-profile #staffMessages .staff-image-bubble .staff-inline-preview{display:block;min-width:0;line-height:0}
.arleyn-staff-profile #staffMessages .staff-image-bubble .media-preview-image{
  display:block;width:auto;max-width:min(360px,100%);max-height:340px;
  object-fit:contain;border-radius:8px;cursor:zoom-in;
}
.arleyn-staff-profile #staffMessages .staff-image-bubble .media-preview-image:focus-visible{
  outline:2px solid var(--wa-info,#53bdeb);outline-offset:2px;
}
.arleyn-staff-profile #staffMessages .staff-image-bubble .staff-attachment-actions{
  padding:3px 0;gap:6px;
}
.arleyn-staff-profile #staffMessages .staff-inline-error{display:block;padding:8px 0;font-size:12px;line-height:1.35}
@media(max-width:700px){
  .arleyn-staff-profile #staffMessages .staff-image-bubble .media-preview-image{max-width:100%;max-height:280px}
}

/* BG7I2 — se reutiliza el formato de vista previa del propietario.
 * Respetar el truncado de la lista sin mostrar URLs ni identificadores. */
.arleyn-staff-profile #staffChats .staff-chat-subtitle{
  display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  min-width:0;line-height:1.3;max-width:100%;
}
.arleyn-staff-profile #staffChats .staff-chat-subtitle strong,
.arleyn-staff-profile #staffChats .staff-chat-subtitle em{font:inherit}
.arleyn-staff-profile #staffChats .staff-chat-subtitle strong{font-weight:700}
.arleyn-staff-profile #staffChats .staff-chat-subtitle em{font-style:italic}
.arleyn-staff-profile #staffChats .unread{font-size:11px;min-width:21px;height:21px;display:grid;place-content:center;border-radius:999px;padding:0 5px}

/* BG7I2: terminación autorizada visible junto al título sin ocultar el último mensaje. */
.arleyn-staff-profile #staffChats .staff-chat-title-line{display:flex;align-items:baseline;gap:7px;min-width:0}
.arleyn-staff-profile #staffChats .staff-chat-title-line .chat-title{flex:1;min-width:0}
.arleyn-staff-profile #staffChats .staff-chat-last4{flex-shrink:0;font-size:11px;font-weight:400;color:var(--wa-muted,#a0a2a3);white-space:nowrap}
.arleyn-staff-profile #staffChats .staff-chat-last4:empty{display:none}


/* F9Z-BG7I2R: la regla grid de BG7I2 no debe reactivar badges vacíos.
 * Garantizar visibilidad sólo si el contador es verdaderamente >0. */
.arleyn-staff-profile #staffChats button.conversation .unread:empty,
.arleyn-staff-profile #staffChats button.conversation[data-unread="0"] .unread{
  display:none!important;
  min-width:0;height:0;padding:0;border:0;
}
/* El horario completo debe mantenerse en una sola línea. */
.arleyn-staff-profile #staffChats button.conversation .staff-chat-time{
  display:block;white-space:nowrap;font-variant-numeric:tabular-nums;
}
.arleyn-staff-profile #staffChats button.conversation .staff-chat-side{min-width:max-content}
/* Mostrar diagnósticos mínimos sin modificar el diseño del chat principal. */
.arleyn-staff-profile #staffMessages .staff-media-missing{
  display:block;font-size:11px;line-height:1.35;
  color:var(--wa-muted,#a0a2a3);max-width:300px;
}

/* F9Z-BG7P1 — El DOM de empleados usa las mismas clases multimedia canónicas
   que el propietario: .media-message.{audio,sticker,image,video}-message.
   Sólo adaptar el contenedor propio de staff, sin otro reproductor o visor. */
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message,
.arleyn-staff-profile #staffMessages .message.staff-native-media.audio-message {
  padding:0!important;background:transparent!important;border:0!important;
  box-shadow:none!important;overflow:visible!important;width:auto!important;
  min-width:0!important;gap:0!important;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message::before,
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message::after,
.arleyn-staff-profile #staffMessages .message.staff-native-media.audio-message::before,
.arleyn-staff-profile #staffMessages .message.staff-native-media.audio-message::after{
  display:none!important;content:none!important;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message .staff-attachment,
.arleyn-staff-profile #staffMessages .message.staff-native-media.audio-message .staff-attachment,
.arleyn-staff-profile #staffMessages .message.staff-native-media.image-message .staff-attachment,
.arleyn-staff-profile #staffMessages .message.staff-native-media.video-message .staff-attachment{
  display:flex;flex-direction:column;gap:3px;min-width:0;max-width:100%;padding:0!important;
  border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;overflow:visible;
}
.arleyn-staff-profile #staffMessages .staff-native-media .staff-attachment-heading{display:none!important}
.arleyn-staff-profile #staffMessages .message.staff-native-media.audio-message .audio-player{
  width:min(340px,68vw)!important;max-width:100%!important;margin:0!important;
  background:var(--wa3,#202222)!important;border-radius:999px!important;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message .staff-inline-sticker{
  display:block;width:min(210px,100%);max-width:210px;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message .sticker-stage{
  padding:0!important;display:block!important;background:transparent!important;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media.sticker-message .sticker-preview{
  width:auto;max-width:210px;max-height:210px;background:transparent!important;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media:is(.audio-message,.sticker-message) .message-meta{
  width:max-content;align-self:flex-end;background:rgba(11,18,32,.62)!important;
  border-radius:999px;padding:2px 5px!important;margin-top:2px;
}
.arleyn-staff-profile #staffMessages .message.staff-native-media:is(.audio-message,.sticker-message) .staff-attachment-actions:empty{display:none!important}
.arleyn-staff-profile #staffMessages .message.staff-native-media .staff-attachment-actions[hidden]{display:none!important}
/* La zona del separador reutiliza el mismo estilo .sidebar-resizer que el propietario.
   Su ancho se almacena por tenant + user_id, nunca con la clave global del dueño. */
.arleyn-staff-profile .arleyn-staff-workspace{
  grid-template-columns:minmax(280px,var(--staff-sidebar-width,32%)) 6px minmax(0,1fr);
}
.arleyn-staff-profile #staffSidebarResizer{
  display:block;position:relative;z-index:3;cursor:col-resize;
  min-width:6px;width:6px;touch-action:none;background:var(--wa1,#161717);
  border:0;border-inline:1px solid var(--wa-line,rgba(255,255,255,.07));
}
.arleyn-staff-profile #staffSidebarResizer:hover,
.arleyn-staff-profile #staffSidebarResizer:focus-visible,
.arleyn-staff-profile #staffSidebarResizer.is-dragging{
  background:var(--wa-action,#1f8f72);outline-offset:-2px;
}
@media(max-width:980px) and (min-width:701px){
  .arleyn-staff-profile .arleyn-staff-workspace{grid-template-columns:minmax(255px,var(--staff-sidebar-width,37%)) 6px minmax(0,1fr)}
}
@media(max-width:700px){
  .arleyn-staff-profile .arleyn-staff-workspace{display:block}
  .arleyn-staff-profile #staffSidebarResizer{display:none!important}
}

/* BG7P3A: clases de agrupación canónicas, sólo en la bandeja staff.
   No activar agrupación de entrantes de grupos sin identidad de participante. */
.arleyn-staff-profile #staffMessages .message-row.group-with-prev{margin-top:-2px}
.arleyn-staff-profile #staffMessages .message-row.group-with-prev .message.outbound{border-top-right-radius:5px}
.arleyn-staff-profile #staffMessages .message-row.group-with-next .message.outbound{border-bottom-right-radius:5px}

/* BG7P3B: citas y reacciones con las clases originales y datos filtrados por servidor. */
.arleyn-staff-profile #staffMessages .message-reply-quote{display:flex;gap:8px;max-width:100%;min-width:0;border-radius:7px;background:rgba(0,0,0,.16);margin:1px 0 7px;overflow:hidden;cursor:pointer}
.arleyn-staff-profile #staffMessages .message-reply-bar{width:3px;flex:0 0 3px;background:var(--wa-green,#00d756)}
.arleyn-staff-profile #staffMessages .message-reply-quote.quoted-inbound .message-reply-bar{background:var(--wa-info,#53bdeb)}
.arleyn-staff-profile #staffMessages .message-reply-content{display:grid;min-width:0;gap:2px;padding:6px 7px 6px 0}
.arleyn-staff-profile #staffMessages .message-reply-content strong{font-size:12px;color:var(--wa-soft,#d5d7d8)}
.arleyn-staff-profile #staffMessages .message-reply-content span{font-size:12px;color:var(--wa-muted,#a0a2a3);overflow-wrap:anywhere}
.arleyn-staff-profile #staffMessages .message-reply-quote:focus-visible{outline:2px solid var(--wa-info,#53bdeb)}
.arleyn-staff-profile #staffMessages .message-reactions{display:flex;margin-top:4px}
.arleyn-staff-profile #staffMessages .message-reactions-pill{display:inline-flex;gap:5px;align-items:center;border-radius:999px;padding:2px 7px;background:var(--wa4,#2a2c2c);border:1px solid var(--wa-line-strong,rgba(255,255,255,.115));font-size:13px}
.arleyn-staff-profile #staffMessages .reaction-emojis{display:inline-flex;align-items:center;gap:2px}
.arleyn-staff-profile #staffMessages .reaction-count{font-size:11px;color:var(--wa-muted,#a0a2a3)}
.arleyn-staff-profile #staffMessages .staff-quote-jump-highlight{animation:staffQuoteHighlight 1.3s ease-out}
@keyframes staffQuoteHighlight{0%{outline:2px solid var(--wa-info,#53bdeb)}100%{outline:2px solid transparent}}

/* BG7P3C1: mismo estado operativo de atención Meta/Business del propietario.
 * Sólo datos redactados por el servidor, sin exponer números de origen. */
.arleyn-staff-profile .arleyn-staff-route-notice{display:flex;flex-direction:column;gap:4px;padding:9px 15px;background:var(--wa2,#1d1f1f);border-top:1px solid var(--wa-line,rgba(255,255,255,.07));color:var(--wa-soft,#d5d7d8);font-size:12px}
.arleyn-staff-profile .arleyn-staff-route-notice[hidden]{display:none!important}
.arleyn-staff-profile .arleyn-staff-route-notice strong{font-size:12px;font-weight:600}
.arleyn-staff-profile .arleyn-staff-route-notice.staff-route-closed{border-left:3px solid var(--wa-warning,#e3a154)}
.arleyn-staff-profile .arleyn-staff-route-notice.staff-route-closed strong{color:var(--wa-warning,#e3a154)}

/* BG7U2C — barra de acciones original de Arleyn, en ambos perfiles.
 * Los botones usan las mismas clases y SVG que el propietario; no tarjetas staff.
 * Se conserva la regla de ocultación por permisos (también con specificity del tema). */
.arleyn-staff-profile #staffMessages .staff-attachment-actions.media-actions{
  display:flex;flex-wrap:nowrap;gap:1px;padding:0;margin-top:5px;
  border:1px solid var(--arleyn-line);border-radius:7px;background:rgba(0,0,0,.09);
  overflow:hidden;justify-content:stretch;
}
.arleyn-staff-profile #staffMessages .staff-attachment-actions.media-actions .media-action-btn{
  box-sizing:border-box;display:inline-flex;flex:1 1 0;min-width:0;min-height:36px;
  align-items:center;justify-content:center;gap:6px;padding:6px 8px;
  border:0;border-radius:0;background:transparent;color:var(--wa-soft,var(--arleyn-text));
  font-size:calc(10px * var(--app-small-text-scale));font-weight:600;text-decoration:none;
  white-space:nowrap;line-height:1.15;
}
.arleyn-staff-profile #staffMessages .staff-attachment-actions.media-actions .media-action-btn + .media-action-btn{
  border-left:1px solid var(--arleyn-line);
}
.arleyn-staff-profile #staffMessages .staff-attachment-actions.media-actions .media-action-btn:hover{
  background:rgba(255,255,255,.045);color:var(--wa-text,var(--arleyn-text));
}
.arleyn-staff-profile #staffMessages .staff-attachment-actions.media-actions .media-action-btn[hidden],
.arleyn-staff-profile #staffMessages .staff-attachment-actions.media-actions[hidden]{display:none!important}

/* BG7U2D: la imagen nativa usa exactamente la barra original single-image-actions.
 * Las reglas de permisos y hidden del visor mantienen prioridad. */
.arleyn-staff-profile #staffMessages .staff-image-bubble .staff-attachment-actions.single-image-actions{
  display:flex;flex-wrap:nowrap;gap:0;padding:0;margin-top:5px;
  border-radius:7px;overflow:hidden;
}
.arleyn-staff-profile #staffMessages .staff-image-bubble .single-image-actions[hidden]{display:none!important}

/* BG7U2E1: mismo mosaico original de Arleyn. Las burbujas ocultas se
 * conservan para que sus acciones reales y el visor sigan funcionando. */
.arleyn-staff-profile #staffMessages .message-row.staff-album-source{display:none!important}
.arleyn-staff-profile #staffMessages .staff-image-album{display:flex;margin:3px 0;min-width:0}
.arleyn-staff-profile #staffMessages .staff-image-album.outbound-row{justify-content:flex-end}
.arleyn-staff-profile #staffMessages .staff-image-album .image-group{width:min(430px,64%);max-width:100%;}
.arleyn-staff-profile #staffMessages .staff-image-album .image-group-tile:focus-visible{outline:2px solid var(--wa-green,#25d366);outline-offset:-2px}
.arleyn-staff-profile #staffMessages .staff-image-album .image-group-instructions{display:flex;flex-direction:column}
.arleyn-staff-profile #staffMessages .staff-image-album .image-group-instruction{width:100%;text-align:left;overflow-wrap:anywhere}
@media(max-width:680px){.arleyn-staff-profile #staffMessages .staff-image-album .image-group{width:min(430px,88%)}}
