/* Systemic site chatbot widget (v0.1.1).
 * Desktop: bottom-left (the accessibility button sits bottom-right).
 * Mobile: right side, above the accessibility button (the WhatsApp button sits bottom-left). */
.sys-chat{--sc-ink:var(--ink,#0C2E33);--sc-accent:var(--cta,var(--ink2,#13505B));--sc-accent-fg:var(--cta-fg,#fff);--sc-mint:var(--mint,#2BB8A6);
  position:fixed;left:24px;bottom:calc(var(--sys-notice-h,0px) + 24px);z-index:75;font-family:'Assistant',system-ui,sans-serif;direction:rtl;text-align:right}
.sys-chat *{box-sizing:border-box}
.sys-chat-fab{width:56px;height:56px;border-radius:50%;border:0;cursor:pointer;background:var(--sc-accent);color:var(--sc-accent-fg);
  display:flex;align-items:center;justify-content:center;box-shadow:0 10px 26px rgba(12,46,51,.28);transition:transform .15s ease,background .15s ease}
.sys-chat-fab:hover{transform:translateY(-2px)}
.sys-chat-fab:focus-visible,.sys-chat-x:focus-visible,.sys-chat-send:focus-visible{outline:3px solid var(--sc-mint);outline-offset:2px}
.sys-chat-ico,.sys-chat-x svg,.sys-chat-send svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sys-chat-ico-close{display:none}
.sys-chat.is-open .sys-chat-ico-open{display:none}
.sys-chat.is-open .sys-chat-ico-close{display:block}
/* 0.1.4: launcher pill = Mika avatar + label (avatar on the screen-edge side) */
.sys-chat-fab{width:auto;height:58px;border-radius:999px;padding:5px 5px 5px 18px;gap:10px;flex-direction:row-reverse}
.sys-chat-fab-avatar{width:48px;height:48px;border-radius:50%;flex:none}
.sys-chat-fab-label{font-family:'Rubik',sans-serif;font-size:15px;font-weight:600;white-space:nowrap;line-height:1}
.sys-chat.is-open .sys-chat-fab{width:56px;height:56px;padding:0}

.sys-chat-panel{position:absolute;left:0;bottom:68px;width:360px;max-width:calc(100vw - 32px);height:520px;max-height:calc(100vh - var(--sys-notice-h,0px) - 110px);
  background:#fff;border-radius:18px;box-shadow:0 28px 60px rgba(12,46,51,.25);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--line,#E6E8E3)}
.sys-chat-panel[hidden]{display:none}
.sys-chat-head{background:var(--sc-ink);color:#fff;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.sys-chat-who{display:flex;align-items:center;gap:10px;min-width:0}
.sys-chat-avatar{width:42px;height:42px;flex:none;border-radius:50%;box-shadow:0 0 0 2px rgba(255,255,255,.25)}
.sys-chat-titles{display:flex;flex-direction:column;line-height:1.3}
.sys-chat-titles strong{font-family:'Rubik',sans-serif;font-size:16px;font-weight:700}
.sys-chat-titles span{font-size:12.5px;opacity:.75}
.sys-chat-x{background:transparent;border:0;color:#fff;cursor:pointer;padding:4px;border-radius:8px;display:flex}
.sys-chat-x:hover{background:rgba(255,255,255,.12)}

.sys-chat-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:8px;background:var(--paper,#F5F6F2);overscroll-behavior:contain}
.sys-chat-msg{max-width:85%;padding:9px 13px;border-radius:14px;font-size:15px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:plaintext}
.sys-chat-bot{align-self:flex-start;background:#fff;color:var(--text,#122326);border:1px solid var(--line,#E6E8E3);border-start-start-radius:4px}
.sys-chat-me{align-self:flex-end;background:var(--sc-accent);color:var(--sc-accent-fg);border-start-end-radius:4px}
.sys-chat-msg a{color:inherit;text-decoration:underline;font-weight:600}
.sys-chat-bot a{color:var(--ink2,#13505B)}
.sys-chat-typing{display:flex;gap:4px;align-items:center;padding:12px 14px}
.sys-chat-typing span{width:7px;height:7px;border-radius:50%;background:var(--muted,#879B9E);animation:sysChatDot 1.2s infinite ease-in-out}
.sys-chat-typing span:nth-child(2){animation-delay:.15s}
.sys-chat-typing span:nth-child(3){animation-delay:.3s}
@keyframes sysChatDot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

.sys-chat-note{margin:0;padding:6px 14px;font-size:12px;color:var(--text2,#566B6E);background:#fff;border-top:1px solid var(--line,#E6E8E3)}
.sys-chat-note a{color:inherit}
.sys-chat-form{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;background:#fff;border-top:1px solid var(--line,#E6E8E3)}
.sys-chat-input{flex:1;resize:none;border:1px solid var(--line2,#DCDFD9);border-radius:12px;padding:9px 12px;font:inherit;font-size:15px;line-height:1.45;max-height:120px;color:var(--text,#122326);background:#fff}
.sys-chat-input:focus{outline:none;border-color:var(--sc-mint);box-shadow:0 0 0 3px rgba(43,184,166,.18)}
.sys-chat-input:disabled{background:var(--paper2,#F1F2EE)}
.sys-chat-send{width:42px;height:42px;border-radius:12px;border:0;background:var(--sc-accent);color:var(--sc-accent-fg);cursor:pointer;display:flex;align-items:center;justify-content:center;flex:none}
.sys-chat-send:disabled{opacity:.5;cursor:default}
.sys-chat-send svg{width:20px;height:20px;transform:scaleX(-1)}

@media (max-width:767.98px){
  .sys-chat{left:auto;right:12px;bottom:calc(var(--sys-notice-h,0px) + 84px)}
  .sys-chat-fab{height:54px;padding:4px 4px 4px 14px}
  .sys-chat-fab-avatar{width:46px;height:46px}
  .sys-chat-fab-label{font-size:14px}
  .sys-chat.is-open{left:0;right:0;bottom:0;top:0}
  .sys-chat.is-open .sys-chat-fab{display:none}
  .sys-chat.is-open .sys-chat-panel{position:fixed;inset:0;width:100%;max-width:none;height:100%;max-height:none;border-radius:0;border:0}
  .sys-chat-form{padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}
  .sys-chat-input{font-size:16px} /* avoids iOS zoom on focus */
}
@media (prefers-reduced-motion:reduce){.sys-chat-fab,.sys-chat-typing span{transition:none;animation:none}}
@media print{.sys-chat{display:none}}

/* === 0.1.5: futuristic Mika robot launcher (hover: wave, smile, tilt) + typed teaser === */
.sys-chat-fab{width:64px;height:64px;padding:0;gap:0;border-radius:50%;background:#13505B;color:#fff;position:relative;overflow:visible;flex-direction:row}
.sys-chat-robot{width:64px;height:64px;border-radius:50%;overflow:hidden;flex:none;transition:transform .3s}
.sys-chat-fab::after{content:"";position:absolute;top:2px;right:2px;width:13px;height:13px;border-radius:50%;background:#2BB8A6;border:2.5px solid #fff}
.sys-chat.is-open .sys-chat-fab{width:56px;height:56px}
.sys-chat.is-open .sys-chat-fab::after{display:none}
.sys-chat-panel{bottom:78px}
.sys-chat-avatar{overflow:hidden;background:#13505B}
.sc-arm{transform-origin:55px 64px;transform:rotate(168deg);transition:transform .45s cubic-bezier(.35,1.4,.5,1)}
.sc-head{transform-origin:40px 52px;transition:transform .35s}
.sc-smile,.sc-smile-eyes{opacity:0;transition:opacity .15s}
.sc-eyes,.sc-mouth{transition:opacity .15s}
@keyframes scWave{0%,100%{transform:rotate(20deg)}25%{transform:rotate(38deg)}50%{transform:rotate(14deg)}75%{transform:rotate(36deg)}}
.sys-chat-fab:hover .sc-arm,.sys-chat.is-wave .sc-arm{transform:rotate(20deg);animation:scWave 1.1s ease-in-out .45s 2}
.sys-chat-fab:hover .sc-head,.sys-chat.is-wave .sc-head{transform:rotate(-5deg)}
.sys-chat-fab:hover .sc-smile,.sys-chat-fab:hover .sc-smile-eyes,.sys-chat.is-wave .sc-smile,.sys-chat.is-wave .sc-smile-eyes{opacity:1}
.sys-chat-fab:hover .sc-eyes,.sys-chat-fab:hover .sc-mouth,.sys-chat.is-wave .sc-eyes,.sys-chat.is-wave .sc-mouth{opacity:0}
.sys-chat-fab:hover .sys-chat-robot{transform:scale(1.05)}
.sys-chat-fab:hover{transform:none}
.sys-chat-teaser{position:absolute;left:0;bottom:78px;width:270px;min-height:100px;background:#fff;color:var(--text,#122326);border:1px solid var(--line,#E6E8E3);border-radius:14px 14px 14px 4px;padding:12px 36px 12px 14px;font-size:15px;line-height:1.5;box-shadow:0 14px 34px rgba(12,46,51,.18);cursor:pointer}
.sys-chat-teaser[hidden],.sys-chat.is-open .sys-chat-teaser{display:none}
.sys-chat-teaser-x{position:absolute;top:8px;right:8px;width:22px;height:22px;border-radius:50%;border:1px solid #879B9E;background:#fff;color:#566B6E;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer}
.sys-chat-teaser-x svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round}
.sys-chat-caret{display:inline-block;width:2px;height:1em;background:var(--mint,#2BB8A6);vertical-align:-2px;margin-inline-start:1px;animation:scCaret 1s steps(1) infinite}
.sys-chat-caret[hidden]{display:none}
@keyframes scCaret{50%{opacity:0}}
@media (max-width:767.98px){
  .sys-chat-fab{width:58px;height:58px;padding:0}
  .sys-chat-robot{width:58px;height:58px}
  .sys-chat-teaser{left:auto;right:0;bottom:72px;width:min(260px,calc(100vw - 40px));font-size:14px;border-radius:14px 14px 4px 14px}
}
@media (prefers-reduced-motion:reduce){.sc-arm,.sc-head,.sys-chat-robot{transition:none!important;animation:none!important}.sys-chat-caret{animation:none}}
