/* WP Support Pro — Core Styles v3.1.0 */
:root{
  --wsp-bg:#f6f8fc; --wsp-card:#fff; --wsp-border:#e4e8ef;
  --wsp-text:#172033; --wsp-muted:#7c8798; --wsp-primary:#2563eb;
  --wsp-primary-hover:#1d4ed8; --wsp-success:#10b981; --wsp-warning:#f59e0b;
  --wsp-danger:#dc2626; --wsp-info:#3b82f6; --wsp-radius:14px;
  --wsp-shadow:0 14px 45px rgba(20,30,60,.08);
  --wsp-shadow-sm:0 2px 8px rgba(20,30,60,.06);
  --wsp-transition:.22s cubic-bezier(.4,0,.2,1);
}
[data-wsp-dark]{
  --wsp-bg:#0f172a; --wsp-card:#1e293b; --wsp-border:#334155;
  --wsp-text:#f1f5f9; --wsp-muted:#94a3b8;
}
*{box-sizing:border-box}
.wsp-wrap{direction:rtl;font-family:Tahoma,Arial,sans-serif}
.wsp-page-title{margin:20px 0;font-size:26px}
.wsp-primary{border:0;border-radius:10px;padding:10px 16px;background:var(--wsp-primary);color:#fff;cursor:pointer;font-weight:600;transition:var(--wsp-transition);font-family:inherit}
.wsp-primary:hover{background:var(--wsp-primary-hover);transform:translateY(-1px);box-shadow:0 6px 20px rgba(37,99,235,.35)}
.wsp-primary:disabled{opacity:.6;cursor:not-allowed;transform:none}
.wsp-danger{border:0;border-radius:8px;padding:8px 12px;background:var(--wsp-danger);color:#fff;cursor:pointer;font-weight:600}
.wsp-danger:hover{background:#b91c1c}
.wsp-empty{text-align:center;padding:70px 20px;color:var(--wsp-muted)}
.wsp-empty-icon{font-size:48px;margin-bottom:14px;opacity:.5}
.wsp-empty strong{display:block;font-size:18px;color:var(--wsp-text);margin-bottom:8px}
.wsp-empty p{margin:0;font-size:13px}

/* Priority */
.wsp-priority-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-left:6px;vertical-align:middle;background:#94a3b8}
.wsp-priority-urgent .wsp-priority-dot{background:#dc2626}
.wsp-priority-high .wsp-priority-dot{background:#f59e0b}
.wsp-priority-normal .wsp-priority-dot{background:#3b82f6}
.wsp-priority-low .wsp-priority-dot{background:#94a3b8}
.wsp-ticket-row.wsp-priority-urgent{border-right:4px solid #dc2626}
.wsp-ticket-row.wsp-priority-high{border-right:4px solid #f59e0b}
.wsp-ticket-row.wsp-priority-normal{border-right:4px solid #3b82f6}
.wsp-ticket-row.wsp-priority-low{border-right:4px solid #94a3b8}

/* Attachment */
.wsp-attachment-preview.wsp-attachment-telegram{width:min(340px,100%);max-width:100%;margin:8px 0 0;box-sizing:border-box}
.wsp-attachment-telegram .wsp-media-preview{display:block;width:100%;height:190px;overflow:hidden;border-radius:12px;background:#eef1f5}
.wsp-attachment-telegram .wsp-media-preview img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.wsp-attachment-telegram .wsp-media-video{display:block;width:100%;height:190px;object-fit:cover;border-radius:12px;background:#111}
.wsp-attachment-telegram .wsp-media-audio{display:block;width:100%;max-width:340px;height:42px}
.wsp-attachment-telegram .wsp-document-card{display:flex;width:100%;max-width:340px;box-sizing:border-box;align-items:center;gap:10px;padding:10px 11px;border:1px solid #dfe5ec;border-radius:12px;background:#fff;text-decoration:none;color:inherit}
.wsp-document-icon{width:40px;height:40px;display:grid;place-items:center;flex:0 0 40px;border-radius:9px;background:#eef3f8;font-size:20px}
.wsp-document-info{min-width:0;display:flex;flex-direction:column;gap:3px}
.wsp-document-info strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wsp-document-info small{font-size:10px;color:var(--wsp-muted)}
.wsp-document-arrow{margin-right:auto;color:var(--wsp-muted)}
.wsp-selected-preview{display:flex;align-items:center;gap:9px;max-width:340px;min-width:0}
.wsp-selected-preview img{width:58px!important;height:58px!important;object-fit:cover;border-radius:9px;display:block}
.wsp-selected-meta{min-width:0;display:flex;flex-direction:column;gap:3px;overflow:hidden}
.wsp-selected-meta strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wsp-selected-meta small{font-size:10px;color:var(--wsp-muted)}
.wsp-selected-file{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--wsp-border);border-radius:10px;background:#fff;min-width:0}
.wsp-file-icon{font-size:22px}

/* Toast */
.wsp-live-toast{position:fixed;top:22px;right:22px;z-index:1000000;width:min(360px,calc(100vw - 32px));pointer-events:none}
.wsp-live-toast-item{background:var(--wsp-card);border:1px solid var(--wsp-border);border-radius:14px;padding:12px 14px;margin-bottom:8px;box-shadow:var(--wsp-shadow);transform:translateY(-12px);opacity:0;transition:var(--wsp-transition);direction:rtl;text-align:right;pointer-events:auto}
.wsp-live-toast-item.show{transform:translateY(0);opacity:1}
.wsp-live-toast-item strong{display:block;font-size:13px;color:var(--wsp-text)}
.wsp-live-toast-item span{display:block;margin-top:5px;font-size:11px;line-height:1.7;color:var(--wsp-muted)}
@media(max-width:600px){.wsp-live-toast{top:10px;right:10px;left:10px;width:auto}}

/* Lightbox */
.wsp-lightbox{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:1000001;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:.25s}
.wsp-lightbox.show{opacity:1;pointer-events:auto}
.wsp-lightbox img{max-width:95vw;max-height:95vh;border-radius:8px}
.wsp-lightbox-close{position:absolute;top:20px;left:20px;background:rgba(255,255,255,.15);border:0;color:#fff;font-size:28px;width:44px;height:44px;border-radius:50%;cursor:pointer}

/* Typing */
.wsp-typing{display:inline-flex;gap:4px;padding:10px 14px;background:var(--wsp-card);border-radius:14px;border:1px solid var(--wsp-border)}
.wsp-typing i{width:7px;height:7px;background:var(--wsp-muted);border-radius:50%;animation:wsp-typing 1.4s infinite}
.wsp-typing i:nth-child(2){animation-delay:.2s}
.wsp-typing i:nth-child(3){animation-delay:.4s}
@keyframes wsp-typing{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-5px);opacity:1}}

/* Emoji */

/* Canned */
.wsp-canned-list{position:absolute;bottom:100%;right:0;background:var(--wsp-card);border:1px solid var(--wsp-border);border-radius:12px;box-shadow:var(--wsp-shadow);z-index:100;width:300px;max-height:280px;overflow-y:auto}
.wsp-canned-list button{display:block;width:100%;text-align:right;border:0;background:none;padding:10px 12px;cursor:pointer;border-bottom:1px solid var(--wsp-border);font-family:inherit}
.wsp-canned-list button:hover{background:#eef2ff}
.wsp-canned-list button strong{display:block;font-size:12px;color:var(--wsp-text)}
.wsp-canned-list button small{display:block;font-size:10px;color:var(--wsp-muted);margin-top:3px}

/* Dark mode */
[data-wsp-dark] .wsp-card,[data-wsp-dark] .wsp-stat{background:var(--wsp-card);border-color:var(--wsp-border);color:var(--wsp-text)}

/* Scrollbar */
.wsp-messages::-webkit-scrollbar,#wsp-admin-list::-webkit-scrollbar{width:8px}
.wsp-messages::-webkit-scrollbar-thumb,#wsp-admin-list::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}
.wsp-messages::-webkit-scrollbar-thumb:hover,#wsp-admin-list::-webkit-scrollbar-thumb:hover{background:#94a3b8}
/* WSP 3.1.6 — mobile messenger + reliable canned popup */
.wsp-canned-backdrop{position:fixed!important;inset:0!important;z-index:2147483646!important;background:rgba(8,18,35,.58)!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:14px!important;box-sizing:border-box!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important}
.wsp-canned-popup{position:relative!important;width:min(440px,calc(100vw - 28px))!important;max-height:min(76vh,560px)!important;overflow-y:auto!important;overflow-x:hidden!important;background:var(--wsp-card)!important;border:1px solid var(--wsp-border)!important;border-radius:16px!important;box-shadow:var(--wsp-shadow)!important;margin:auto!important;direction:rtl!important;display:block!important}
.wsp-canned-popup button{display:block!important;width:100%!important;text-align:right!important;border:0!important;background:transparent!important;padding:14px!important;cursor:pointer!important;font-family:inherit!important;border-bottom:1px solid var(--wsp-border)!important;color:var(--wsp-text)!important}
.wsp-canned-popup button:last-child{border-bottom:0!important}
.wsp-canned-popup button:hover,.wsp-canned-popup button:focus{background:#eef4ff!important;outline:0!important}
.wsp-canned-popup button strong{display:block!important;font-size:13px!important;color:var(--wsp-text)!important}
.wsp-canned-popup button small{display:block!important;font-size:11px!important;color:var(--wsp-muted)!important;margin-top:5px!important;white-space:normal!important;line-height:1.8!important}
.wsp-mobile-back{display:none;border:0;background:transparent;color:var(--wsp-primary);font-family:inherit;font-size:14px;cursor:pointer;padding:7px 10px;border-radius:8px}
@media(max-width:850px){
  .wsp-app.wsp-mobile-chat-open .wsp-front-sidebar{display:none!important}
  .wsp-app.wsp-mobile-chat-open .wsp-front-chat{display:flex!important;flex-direction:column!important;width:100%!important;max-width:none!important;height:calc(100dvh - 12px)!important;min-height:calc(100dvh - 12px)!important;max-height:none!important;overflow:hidden!important}
  .wsp-app.wsp-mobile-chat-open .wsp-chat-title{flex:0 0 auto!important;min-height:56px!important;padding:8px 10px!important;display:flex!important;align-items:center!important;gap:8px!important}
  .wsp-app.wsp-mobile-chat-open .wsp-mobile-back{display:inline-flex!important;align-items:center!important;gap:4px!important;flex:0 0 auto!important}
  .wsp-app.wsp-mobile-chat-open .wsp-messages{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;padding:14px 12px!important;-webkit-overflow-scrolling:touch!important}
  .wsp-app.wsp-mobile-chat-open .wsp-composer{flex:0 0 auto!important;min-height:0!important;padding:9px!important;padding-bottom:max(9px,env(safe-area-inset-bottom))!important}
  .wsp-app.wsp-mobile-chat-open .wsp-composer textarea{min-height:52px!important;max-height:120px!important}
  .wsp-app.wsp-mobile-chat-open .wsp-compose-actions{margin-top:6px!important}
  .wsp-app.wsp-mobile-chat-open .wsp-compose-actions .wsp-primary{min-height:42px!important}
}
@media(max-width:900px){
  #wsp-admin-app.wsp-mobile-chat-open>aside{display:none!important}
  #wsp-admin-app.wsp-mobile-chat-open main{display:flex!important;width:100%!important;height:calc(100dvh - 90px)!important;min-height:0!important;max-height:none!important;overflow:hidden!important}
  #wsp-admin-app.wsp-mobile-chat-open main .wsp-chat-title{flex:0 0 auto!important;min-height:56px!important;padding:8px 10px!important;display:flex!important;align-items:center!important;gap:8px!important}
  #wsp-admin-app.wsp-mobile-chat-open .wsp-mobile-back{display:inline-flex!important;align-items:center!important;gap:4px!important}
  #wsp-admin-app.wsp-mobile-chat-open main .wsp-messages{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding:14px 12px!important;-webkit-overflow-scrolling:touch!important}
  #wsp-admin-app.wsp-mobile-chat-open main .wsp-composer{flex:0 0 auto!important;min-height:0!important;padding:9px!important;padding-bottom:max(9px,env(safe-area-inset-bottom))!important}
  #wsp-admin-app.wsp-mobile-chat-open main .wsp-compose-actions .wsp-primary{min-height:42px!important}
}
