/* Chatbot Widget — Component CSS */
#sh-chat-window .sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0; }
#sh-chat-window, #sh-chat-window * { box-sizing: border-box; }
#sh-chat-window button { font-family: inherit; }
#sh-chat-window { position: fixed; bottom: 16px; right: 80px; width: 380px; max-width: calc(100vw - 100px); z-index: var(--z-chatbot, 9998); font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif; }
.sh-chat-hidden { opacity: 0; transform: translateY(12px) scale(0.96); pointer-events: none; transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.sh-chat-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.sh-chat-container { border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04); overflow: hidden; display: flex; flex-direction: column; height: 560px; max-height: calc(100vh - 40px); }
.sh-chat-header { background: linear-gradient(135deg, var(--pi-primary, #007d3d), #059669); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.sh-chat-header-btn { width: 28px; height: 28px; border-radius: 7px; background: rgba(255,255,255,0.12); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.sh-chat-header-btn:hover { background: rgba(255,255,255,0.25); }
.sh-chat-header-left { display: flex; align-items: center; gap: 0.625rem; }
.sh-chat-avatar { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; }
.sh-chat-name { color: #fff; font-weight: 700; font-size: 0.84375rem; line-height: 1.2; }
.sh-chat-status { color: rgba(255,255,255,0.7); font-size: 0.65625rem; display: flex; align-items: center; gap: 0.25rem; margin-top: 1px; }
.sh-chat-dot { width: 5px; height: 5px; border-radius: 50%; background: #22c55e; display: inline-block; }
.sh-chat-header-actions { display: flex; gap: 0.375rem; }
.sh-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; background: var(--pi-bg-alt, #f3f4f6); padding: 14px 12px 24px; }
.sh-chat-greeting { color: var(--pi-text, #0f172a); font-weight: 600; font-size: 0.8125rem; margin-bottom: 0.125rem; }
.sh-chat-intro { color: var(--pi-text-2, #334155); font-size: 0.78125rem; line-height: 1.625; }
.sh-chat-quick-btns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 0.5rem; }
.dark .sh-chat-container { background: var(--pi-bg-card, #1e293b); border-color: var(--pi-border, #334155); }
.dark .sh-chat-messages { background: var(--pi-bg, #0f172a); }
.dark .sh-chat-greeting { color: #fff; }
.dark .sh-chat-intro { color: var(--pi-text-2, #e2e8f0); }
.sh-chat-brand { color: var(--pi-primary, #007d3d); font-weight: 700; }
.dark .sh-chat-brand { color: var(--pi-primary-light, #00a84d); }
.sh-chat-engine-label { color: var(--pi-text-3, #94a3b8); font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.dark .sh-chat-engine-label { color: var(--pi-text-muted, #475569); }
.sh-chat-provider-btn { color: var(--pi-text-2, #334155); background: var(--pi-bg-alt, #f1f5f9); border: 1px solid var(--pi-border, #e2e8f0); border-radius: 0.375rem; cursor: pointer; padding: 3px 1.25rem 3px 0.5rem; display: flex; align-items: center; gap: 0.25rem; font-weight: 600; user-select: none; position: relative; font-size: 10px; transition: border-color 0.2s; }
.sh-chat-provider-btn:hover { border-color: var(--pi-primary, #007d3d); }
.dark .sh-chat-provider-btn { color: var(--pi-text-2, #e2e8f0); background: var(--pi-bg-elevated, #334155); border-color: var(--pi-border, #334155); }
.sh-chat-provider-menu { background: var(--pi-bg-card, #ffffff); border: 1px solid var(--pi-border, #e2e8f0); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); position: absolute; bottom: calc(100% + 6px); right: 0; width: max-content; min-width: 110px; border-radius: 0.5rem; overflow: hidden; display: flex; flex-direction: column; z-index: 100; transform-origin: bottom right; opacity: 0; pointer-events: none; transform: scale(0.95) translateY(0.25rem); transition: all 0.2s; }
.dark .sh-chat-provider-menu { background: var(--pi-bg-elevated, #334155); border-color: var(--pi-border, #334155); }
.sh-chat-textarea { flex: 1; background: var(--pi-bg-alt, #f1f5f9); color: var(--pi-text, #0f172a); border: 1.5px solid transparent; border-radius: 12px; padding: 9px 13px; font-size: 12.5px; line-height: 1.4; font-family: inherit; outline: none; transition: all 0.2s; min-height: 38px; max-height: 80px; resize: none; }
.dark .sh-chat-textarea { background: var(--pi-bg-elevated, #334155); color: var(--pi-text, #f1f5f9); }
.sh-chat-input-area { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--sh-border, #e5e7eb); flex-shrink: 0; }
.sh-chat-input-area textarea { flex: 1; min-height: 44px; max-height: 80px; resize: none; border: 1.5px solid var(--sh-border, #e5e7eb); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; line-height: 1.4; outline: none; transition: all 0.15s; }
.sh-chat-send-btn { width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.sh-bot { display: flex; gap: 7px; align-items: flex-start; max-width: 92%; }
.sh-user { display: flex; justify-content: flex-end; max-width: 85%; margin-left: auto; }
.sh-av { width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; margin-top: 2px; background: linear-gradient(135deg, var(--pi-primary, #007d3d), #059669); display: flex; align-items: center; justify-content: center; }
.sh-bb { background: var(--sh-bg-card, #fff); color: var(--sh-text-2, #374151); border-radius: 4px 14px 14px 14px; border: 1px solid var(--sh-border, #eef0f2); box-shadow: 0 1px 2px rgba(0,0,0,0.04); padding: 9px 13px; font-size: 12.5px; line-height: 1.55; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%; }
.sh-ub { background: linear-gradient(135deg, var(--pi-primary, #007d3d), #059669); color: #fff; border-radius: 14px 4px 14px 14px; padding: 9px 13px; font-size: 12.5px; line-height: 1.55; box-shadow: 0 2px 8px rgba(0,125,61,0.18); word-wrap: break-word; overflow-wrap: break-word; }
.sh-bb strong, .sh-bb b { color: var(--pi-primary, #007d3d); font-weight: 700; }
.sh-bb em { color: var(--pi-text-2, #4b5563); font-style: italic; }
.sh-bb h3 { font-size: 13.5px; font-weight: 700; color: var(--pi-primary, #007d3d); margin: 8px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--sh-border, #e5e7eb); }
.sh-bb h4, .sh-bb h5 { font-size: 12.5px; font-weight: 700; color: var(--sh-text, #111); margin: 6px 0 3px; }
.sh-bb p { margin: 4px 0; }
.sh-bb hr { border: none; border-top: 1.5px solid var(--sh-border, #e5e7eb); margin: 8px 0; }
.sh-bb a { color: var(--pi-primary, #007d3d); text-decoration: none; font-weight: 600; background: #f0fdf4; padding: 1px 6px; border-radius: 4px; border: 1px solid #bbf7d0; transition: all 0.15s; }
.sh-bb a:hover { background: var(--pi-primary, #007d3d); color: #fff; border-color: var(--pi-primary, #007d3d); }
.sh-ub a { color: #bbf7d0; background: rgba(255,255,255,0.15); padding: 1px 5px; border-radius: 3px; text-decoration: none; }
.sh-bb .sh-phone { display: inline-flex; align-items: center; gap: 3px; color: var(--pi-primary, #007d3d); font-weight: 700; background: #f0fdf4; padding: 2px 8px; border-radius: 6px; border: 1px solid #bbf7d0; text-decoration: none; font-size: 12px; transition: all 0.15s; }
.sh-bb .sh-phone:hover { background: var(--pi-primary, #007d3d); color: #fff; }
.sh-bb .sh-phone::before { content: '\1F4DE'; font-size: 11px; }
.sh-bb .sh-url { color: var(--pi-primary, #007d3d); text-decoration: none; font-size: 11.5px; font-weight: 600; background: #f0fdf4; padding: 2px 8px; border-radius: 6px; border: 1px solid #bbf7d0; display: inline-block; max-width: 100%; transition: all 0.15s; }
.sh-bb .sh-url:hover { background: var(--pi-primary, #007d3d); color: #fff; }
.sh-bb ul, .sh-bb ol { padding-left: 1.2em; margin: 5px 0 3px; }
.sh-bb li { margin-bottom: 2px; line-height: 1.5; }
.sh-bb li::marker { color: var(--pi-primary, #007d3d); }
.sh-bb table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0; font-size: 11px; border: 1px solid var(--sh-border, #d1d5db); border-radius: 8px; overflow: hidden; }
.sh-bb th { background: var(--pi-primary, #007d3d); color: #fff; font-weight: 600; font-size: 10.5px; padding: 7px 10px; text-align: left; text-transform: uppercase; letter-spacing: 0.3px; }
.sh-bb td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--sh-border, #e5e7eb); color: var(--sh-text-2, #374151); }
.sh-bb tr:last-child td { border-bottom: none; }
.sh-bb tr:nth-child(even) td { background: var(--sh-bg-alt, #f9fafb); }
.sh-bb code { background: var(--sh-bg-alt, #f3f4f6); color: #dc2626; padding: 1px 5px; border-radius: 4px; font-size: 11px; font-family: 'Courier New', monospace; }
.sh-bb blockquote { border-left: 3px solid var(--pi-primary, #007d3d); background: var(--sh-bg-alt, #f0fdf4); margin: 6px 0; padding: 6px 10px; border-radius: 0 6px 6px 0; font-size: 12px; color: var(--sh-text-2, #065f46); }
.sh-bb .sh-price { display: inline-block; color: #dc2626; font-weight: 800; font-size: 13px; background: #fef2f2; padding: 1px 6px; border-radius: 4px; border: 1px solid #fecaca; }
.sh-qb { background: #f0fdf4; color: var(--pi-primary, #007d3d); border: 1px solid #bbf7d0; border-radius: 16px; padding: 4px 10px; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; line-height: 1.4; }
.sh-qb:hover { background: var(--pi-primary, #007d3d); color: #fff; border-color: var(--pi-primary, #007d3d); }
.sh-dot { width: 5px; height: 5px; border-radius: 50%; background: #9ca3af; display: inline-block; animation: sh-bonce 1.2s infinite; }
@keyframes sh-bonce { 0%,60%,100% { transform: translateY(0) } 30% { transform: translateY(-4px) } }
#sh-input:focus { border-color: var(--pi-primary, #007d3d); background: var(--sh-bg-card, #fff); box-shadow: 0 0 0 3px rgba(0,125,61,0.08); }
#sh-send:disabled { opacity: 0.2 !important; cursor: not-allowed !important; background: #6b7280 !important; }
#sh-send:not(:disabled) { opacity: 1 !important; background: #00b359 !important; box-shadow: 0 2px 12px rgba(0,179,89,0.5); animation: sh-send-pulse 1.5s ease-in-out infinite; }
#sh-send:not(:disabled):hover { background: #059669 !important; transform: scale(1.08); }
@keyframes sh-send-pulse { 0%,100% { box-shadow: 0 2px 12px rgba(0,179,89,0.4) } 50% { box-shadow: 0 2px 20px rgba(0,179,89,0.7) } }
#sh-msgs { scrollbar-width: thin; scrollbar-color: rgba(0,125,61,0.25) transparent; }
#sh-msgs::-webkit-scrollbar { width: 5px; }
#sh-msgs::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
#sh-msgs::-webkit-scrollbar-thumb { background: rgba(0,125,61,0.2); border-radius: 10px; }
#sh-msgs:hover::-webkit-scrollbar-thumb { background: rgba(0,125,61,0.45); }
.sh-meta { display: flex; flex-wrap: wrap; gap: 5px; padding-left: 36px; margin-top: -4px; margin-bottom: 6px; align-items: center; }
.sh-provider { font-size: 10px; color: var(--pi-text-3, #6b7280); background: var(--sh-bg-alt, #f3f4f6); border: 1px solid var(--sh-border, #e5e7eb); border-radius: 6px; padding: 1px 8px; font-weight: 500; }
.sh-skill-tag { font-size: 9px; background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; border-radius: 8px; padding: 1px 6px; }
.sh-dropdown .sh-opt { padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--pi-text-2, #4b5563); transition: all 0.15s; font-size: 10px; }
.sh-dropdown .sh-opt:hover { background: #f0fdf4; color: var(--pi-primary, #007d3d); }
.sh-dropdown .sh-opt.active { background: #e5e7eb; color: #111; font-weight: 800; }
.sh-dropdown.open #sh-provider-options { opacity: 1 !important; pointer-events: auto !important; transform: translateY(0) scale(1) !important; }
.sh-dropdown.open #sh-provider-selected { border-color: var(--pi-primary, #007d3d) !important; box-shadow: 0 0 0 2px rgba(0,125,61,0.1); }
/* Dark mode */
.dark .sh-bb { background: var(--pi-bg-card, #1f2937); color: var(--pi-text-2, #e5e7eb); border-color: var(--pi-border, #374151); }
.dark .sh-bb strong, .dark .sh-bb b { color: #00a84d; }
.dark .sh-bb h3 { color: #00a84d; border-color: var(--pi-border, #374151); }
.dark .sh-bb h4, .dark .sh-bb h5 { color: var(--pi-text, #f9fafb); }
.dark .sh-bb a { color: #00a84d; background: rgba(0,125,61,0.1); border-color: rgba(0,125,61,0.2); }
.dark .sh-bb .sh-phone { color: #00a84d; background: rgba(0,125,61,0.1); }
.dark .sh-bb table { border-color: var(--pi-border, #374151); }
.dark .sh-bb th { background: #065f46; color: #a7f3d0; }
.dark .sh-bb td { border-color: var(--pi-border, #374151); color: var(--pi-text-muted, #d1d5db); }
.dark .sh-bb tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
.dark .sh-bb code { background: var(--pi-bg, #111827); color: #fca5a5; }
.dark .sh-bb blockquote { border-color: #00a84d; background: rgba(0,125,61,0.1); color: #00a84d; }
.dark .sh-bb .sh-price { color: #fca5a5; background: rgba(220,38,38,0.15); }
.dark .sh-qb { background: rgba(255,255,255,0.05); color: #00a84d; border-color: rgba(255,255,255,0.1); }
.dark .sh-qb:hover { background: #059669; color: #fff; }
.dark .sh-provider { background: var(--pi-bg-elevated, #374151); border-color: var(--pi-text-2, #4b5563); color: var(--pi-text-muted, #9ca3af); }
.dark #sh-input:focus { border-color: #00a84d; background: var(--pi-bg, #111827); box-shadow: 0 0 0 2px rgba(0,125,61,0.2); }
.dark .sh-chat-container { background-color: var(--pi-bg, #0f172a); border-color: var(--pi-border, #334155); }
.dark .sh-chat-input-area { border-top-color: var(--pi-border, #334155); }
.dark .sh-chat-input-area textarea { background: var(--sh-bg-input); border-color: var(--pi-border, #334155); color: var(--pi-text, #f1f5f9); }
/* Mobile */
@media (max-width: 480px) {
    #sh-chat-window { width: calc(100vw - 16px) !important; max-width: none !important; right: 8px !important; bottom: 72px !important; left: 8px !important; }
    .sh-chat-container { height: 55dvh !important; max-height: 55dvh !important; border-radius: 16px !important; }
}
@media (max-width: 480px) and (max-height: 700px) {
    .sh-chat-container { height: 45dvh !important; max-height: 45dvh !important; }
}
@media (max-height: 600px) {
    .sh-chat-container { height: 40dvh !important; }
}
