/* SHI AI chatbot widget v3 */
.shi-chat{--g-dark:#1e2903;--g-deep:#2f4207;--g-lime:#b2dd4c;--g-mid:#6f9a1c;--g-soft:#f5f9ec;--ink:#1f2a12;--muted:#7a8569;font-family:inherit;-webkit-font-smoothing:antialiased}
.shi-chat *{box-sizing:border-box}
.shi-chat-fab{position:fixed;right:22px;bottom:22px;width:62px;height:62px;border-radius:50%;border:0;background:linear-gradient(145deg,var(--g-deep),var(--g-dark));color:var(--g-lime);display:flex;align-items:center;justify-content:center;box-shadow:0 10px 28px rgba(30,41,3,.38),0 2px 6px rgba(0,0,0,.15);z-index:10001;cursor:pointer;transition:transform .25s cubic-bezier(.2,.8,.3,1.2),box-shadow .25s}
.shi-chat-fab:hover{transform:translateY(-2px) scale(1.05);box-shadow:0 14px 34px rgba(30,41,3,.45)}
.shi-chat-fab svg{transition:transform .3s,opacity .2s;position:absolute}
.shi-chat-ico-close{opacity:0;transform:rotate(-90deg) scale(.6)}
.shi-chat.is-open .shi-chat-ico-open{opacity:0;transform:rotate(90deg) scale(.6)}
.shi-chat.is-open .shi-chat-ico-close{opacity:1;transform:none}
.shi-chat-pulse{position:absolute;inset:0;border-radius:50%;background:var(--g-lime);opacity:.45;animation:shiPulse 2.4s ease-out infinite;z-index:-1}
.shi-chat.is-open .shi-chat-pulse,.shi-chat.seen:not(.has-unread) .shi-chat-pulse{display:none}
@keyframes shiPulse{0%{transform:scale(1);opacity:.45}80%,100%{transform:scale(1.6);opacity:0}}
.shi-chat-badge{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;border-radius:10px;background:#e5483b;color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;border:2px solid #fff}
.shi-chat.is-open .shi-chat-badge,.shi-chat.seen:not(.has-unread) .shi-chat-badge{display:none}
.shi-chat-tip{position:fixed;right:22px;bottom:96px;max-width:240px;background:#fff;color:var(--ink);border-radius:14px 14px 4px 14px;padding:12px 30px 12px 14px;box-shadow:0 10px 30px rgba(20,30,5,.18);z-index:10001;font-size:13.5px;line-height:1.4;cursor:pointer;animation:shiTip .45s cubic-bezier(.2,.8,.3,1.2)}
.shi-chat-tip strong{display:block;font-size:14.5px;margin-bottom:2px}
.shi-chat-tip span{color:var(--muted)}
.shi-chat-tip-x{position:absolute;top:4px;right:6px;border:0;background:none;color:#9aa38c;font-size:18px;line-height:1;cursor:pointer;padding:4px}
@keyframes shiTip{from{opacity:0;transform:translateY(10px) scale(.95)}to{opacity:1;transform:none}}
.shi-chat-panel{position:fixed;right:22px;bottom:98px;width:384px;height:min(620px,calc(100vh - 124px));background:#fff;border-radius:20px;box-shadow:0 24px 60px rgba(20,30,5,.28),0 4px 14px rgba(0,0,0,.08);z-index:10002;display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:shiOpen .32s cubic-bezier(.2,.8,.3,1.1)}
.shi-chat-panel[hidden]{display:none}
@keyframes shiOpen{from{opacity:0;transform:translateY(16px) scale(.94)}to{opacity:1;transform:none}}
.shi-chat-head{background:linear-gradient(135deg,var(--g-deep) 0%,var(--g-dark) 100%);color:#fff;padding:16px 12px 16px 16px;display:flex;align-items:center;gap:12px;position:relative}
.shi-chat-head:after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:linear-gradient(90deg,var(--g-lime),var(--g-mid))}
.shi-chat-logo{width:46px;height:46px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;flex:none;box-shadow:0 0 0 3px rgba(178,221,76,.35),0 2px 8px rgba(0,0,0,.2);padding:8px}
.shi-chat-logo img{max-width:100%;max-height:100%;object-fit:contain}
.shi-chat-title{flex:1;min-width:0;line-height:1.25}
.shi-chat-title strong{display:block;font-size:14.5px;font-weight:700;letter-spacing:.1px;line-height:1.25;color:#fff}
.shi-chat-title span{font-size:12.5px;color:#d5e6b0;display:flex;align-items:center;gap:6px;margin-top:3px}
.shi-online{width:8px;height:8px;border-radius:50%;background:#4ade3a;box-shadow:0 0 0 3px rgba(74,222,58,.25);display:inline-block}
.shi-chat-hbtn{width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.08);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none;transition:background .2s}
.shi-chat-hbtn:hover{background:rgba(255,255,255,.18)}
.shi-chat-body{flex:1;overflow-y:auto;padding:18px 14px 8px;background:var(--g-soft);display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.shi-row{display:flex;gap:8px;align-items:flex-end;animation:shiMsg .28s ease-out}
.shi-row.user{justify-content:flex-end}
@keyframes shiMsg{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.shi-av{width:28px;height:28px;border-radius:50%;background:#fff;flex:none;display:flex;align-items:center;justify-content:center;padding:3px;box-shadow:0 1px 4px rgba(0,0,0,.12);margin-bottom:18px}
.shi-av img{max-width:100%;max-height:100%;object-fit:contain}
.shi-col{display:flex;flex-direction:column;max-width:80%;min-width:0}
.shi-row.user .shi-col{align-items:flex-end}
.shi-msg{padding:10px 14px;border-radius:18px;font-size:14px;line-height:1.5;word-wrap:break-word;overflow-wrap:anywhere;color:var(--ink)}
.shi-row.bot .shi-msg{background:#fff;border-bottom-left-radius:6px;box-shadow:0 1px 3px rgba(20,30,5,.08)}
.shi-row.user .shi-msg{background:linear-gradient(135deg,var(--g-deep),var(--g-dark));color:#fff;border-bottom-right-radius:6px}
.shi-msg p{margin:0 0 6px}.shi-msg p:last-child{margin:0}
.shi-msg ul,.shi-msg ol{margin:4px 0 6px;padding-left:20px}.shi-msg li{margin:2px 0}
.shi-msg a{color:var(--g-mid);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.shi-row.user .shi-msg a{color:var(--g-lime)}
.shi-msg strong{font-weight:700}
.shi-msg[dir=rtl]{text-align:right;font-size:15px;line-height:1.8}
.shi-time{font-size:10.5px;color:#a0a891;margin:4px 6px 0}
.shi-typing{display:flex;gap:4px;padding:14px 16px}
.shi-typing span{width:7px;height:7px;border-radius:50%;background:#9db36a;animation:shiDot 1.2s infinite ease-in-out}
.shi-typing span:nth-child(2){animation-delay:.15s}.shi-typing span:nth-child(3){animation-delay:.3s}
@keyframes shiDot{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}
.shi-wa-btn{align-self:flex-start;margin-left:36px;display:inline-flex;align-items:center;gap:8px;background:#25d366;color:#fff!important;padding:9px 16px;border-radius:22px;font-size:13.5px;font-weight:600;text-decoration:none;box-shadow:0 4px 12px rgba(37,211,102,.3)}
.shi-wa-btn:hover{background:#1ebe5a}
.shi-chat-chips{display:flex;flex-wrap:wrap;gap:7px;padding:4px 14px 10px;background:var(--g-soft)}
.shi-chat-chips:empty{display:none}
.shi-chip{border:1.5px solid #c7dd8f;background:#fff;color:var(--g-dark);border-radius:999px;padding:7px 14px;font-size:13px;font-weight:500;cursor:pointer;transition:all .18s;line-height:1.2}
.shi-chip:hover{background:var(--g-dark);color:#fff;border-color:var(--g-dark);transform:translateY(-1px)}
.shi-chat-form{display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid #edf1e4;background:#fff}
.shi-chat-form input{flex:1;min-width:0;border:1.5px solid #e3e9d6;border-radius:24px;padding:11px 16px;font-size:16px;outline:0;background:#fafcf6;color:var(--ink);transition:border-color .2s,box-shadow .2s}
.shi-chat-form input:focus{border-color:var(--g-mid);box-shadow:0 0 0 3px rgba(178,221,76,.25);background:#fff}
.shi-chat-form button{width:44px;height:44px;border-radius:50%;border:0;background:var(--g-dark);color:var(--g-lime);display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none;transition:transform .15s,opacity .2s}
.shi-chat-form button:hover{transform:scale(1.06)}
.shi-chat-form button:disabled{opacity:.45;cursor:default;transform:none}
.shi-chat-foot{text-align:center;font-size:11px;color:#9aa38c;padding:0 10px 9px;background:#fff}
.shi-chat-foot strong{color:var(--g-mid)}
.shi-chat.has-unread:not(.is-open) .shi-chat-pulse{display:block;animation-duration:1.4s;opacity:.6}
.shi-chat.has-unread:not(.is-open) .shi-chat-badge{animation:shiBadge .5s cubic-bezier(.2,.8,.3,1.4)}
.shi-chat.has-unread:not(.is-open) .shi-chat-fab{animation:shiNudge 1.6s ease-in-out 2}
@keyframes shiBadge{from{transform:scale(0)}to{transform:scale(1)}}
@keyframes shiNudge{0%,100%{transform:none}10%{transform:rotate(-10deg)}20%{transform:rotate(9deg)}30%{transform:rotate(-6deg)}40%{transform:rotate(3deg)}50%{transform:none}}
.shi-status{color:#a0a891}.shi-status.seen{color:var(--g-mid);font-weight:600}
.shi-typing{align-items:center}
.shi-typing em{font-style:normal;font-size:12px;color:var(--muted);margin-left:6px}
.shi-chat-mute.is-muted{background:rgba(229,72,59,.25)}
.shi-chat-mute .shi-ico-off{display:none}.shi-chat-mute.is-muted .shi-ico-on{display:none}.shi-chat-mute.is-muted .shi-ico-off{display:block}
@media (max-width:575px){
  .shi-chat-panel{inset:0;width:100%;height:100%;height:100dvh;border-radius:0;padding-bottom:env(safe-area-inset-bottom)}
  .shi-chat-head{padding-top:calc(14px + env(safe-area-inset-top))}
  .shi-chat-fab{right:16px;bottom:calc(16px + env(safe-area-inset-bottom));width:58px;height:58px}
  .shi-chat.is-open .shi-chat-fab{display:none}
  .shi-chat-tip{right:16px;bottom:calc(86px + env(safe-area-inset-bottom))}
}
@media (prefers-reduced-motion:reduce){.shi-chat *{animation:none!important;transition:none!important}}
