:root{--ab-brand:#ff8b00;--ab-gold:#ff8b00;--ab-dark:#182126;--ab-bg:#f7f4ee;--ab-white:#fff;--ab-muted:#697278}
#ab-ai-root,#ab-ai-root *{box-sizing:border-box}
#ab-ai-root{font-family:var(--ab-site-font,Cairo,Tahoma,Arial,sans-serif);direction:rtl;position:fixed;z-index:9999;left:0;bottom:20px;color:var(--ab-dark)}
#ab-ai-root .ab-ai-launcher{width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;padding:7px 6px 8px!important;border:0!important;border-radius:0 13px 13px 0!important;background-color:rgba(0,0,0,.78)!important;background-image:none!important;color:#fff!important;cursor:pointer;box-shadow:0 7px 20px rgba(0,0,0,.2);display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:5px;font-family:inherit!important;font-weight:800!important;line-height:1!important;appearance:none;backdrop-filter:blur(5px);transition:.2s filter,.2s transform}
.ab-ai-launcher:hover{filter:brightness(.94);transform:translateX(2px)}
.ab-ai-launcher:focus-visible{outline:3px solid #fff;outline-offset:-5px}
.ab-ai-badge{min-width:0;height:auto;padding:3px 6px;border:1px solid rgba(255,255,255,.82);border-radius:9px;display:grid;place-items:center;background:transparent;color:#fff;font-family:Arial,sans-serif;font-size:11px;font-weight:900;line-height:1;letter-spacing:.4px;box-shadow:none}
.ab-ai-launcher-label{writing-mode:vertical-rl;transform:rotate(180deg);font-size:13px;font-weight:800;line-height:1;white-space:nowrap}
#ab-ai-root.ab-ai-attached{bottom:auto;top:calc(var(--ab-contact-top) - var(--ab-launcher-height,166px) - 8px)}
#ab-ai-root.ab-ai-attached .ab-ai-launcher{width:auto!important}
html body .aa-contact-fab>.aa-contact-toggle{width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;padding:7px 6px 8px!important;gap:5px!important;background:rgba(255,139,0,.84)!important;background-color:rgba(255,139,0,.84)!important;background-image:none!important;border-radius:0 13px 13px 0!important;backdrop-filter:blur(5px)}
.aa-contact-toggle__icon{width:24px!important;height:24px!important;flex:0 0 24px!important}
.aa-contact-toggle__desktop,.aa-contact-toggle__mobile{font-size:13px!important;line-height:1!important}
.ab-ai-panel{position:fixed;left:78px;top:50%;transform:translateY(-50%);width:min(390px,calc(100vw - 96px));max-width:calc(100vw - 20px);height:min(620px,calc(100vh - 36px));max-height:calc(100vh - 20px);background:var(--ab-white);border-radius:20px;overflow:hidden;overflow-x:hidden;overscroll-behavior:contain;box-shadow:0 18px 50px rgba(0,0,0,.22);display:none;flex-direction:column;border:1px solid rgba(24,33,38,.08)}
.ab-ai-panel.open{display:flex;animation:abAiIn .2s ease-out}
@keyframes abAiIn{from{opacity:0;transform:translateY(calc(-50% + 10px)) scale(.98)}to{opacity:1;transform:translateY(-50%) scale(1)}}
.ab-ai-head{background:var(--ab-dark);color:#fff;padding:16px;display:flex;align-items:center;gap:11px;flex:0 0 auto;min-width:0}
.ab-ai-head>div{min-width:0}.ab-ai-title,.ab-ai-status{overflow-wrap:anywhere}
.ab-ai-avatar{width:42px;height:42px;border-radius:50%;background:var(--ab-gold);display:grid;place-items:center;font-size:20px}
.ab-ai-title{font-weight:700;font-size:15px}.ab-ai-status{font-size:11px;opacity:.82;margin-top:4px}.ab-ai-status span{display:inline-block;width:7px;height:7px;background:#42d67b;border-radius:50%;margin-left:4px}
.ab-ai-close{margin-right:auto;background:transparent;border:0;color:#fff;font-size:24px;cursor:pointer;line-height:1;padding:5px}
.ab-ai-messages{flex:1;min-width:0;min-height:0;max-width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:15px;background:var(--ab-bg);scroll-behavior:smooth}
.ab-ai-msg{max-width:88%;padding:10px 12px;border-radius:14px;margin:0 0 10px;line-height:1.75;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.ab-ai-msg.bot{background:#fff;margin-left:auto;border-bottom-right-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.ab-ai-msg.user{background:var(--ab-dark);color:#fff;margin-right:auto;border-bottom-left-radius:4px}
.ab-ai-msg.typing{color:var(--ab-muted);font-size:13px}
.ab-ai-topics{display:flex;flex-wrap:wrap;gap:7px;margin:5px 0 12px;min-width:0;max-width:100%}
.ab-ai-chip{max-width:100%;white-space:normal;overflow-wrap:anywhere;border:1px solid var(--ab-gold);background:#fff;color:var(--ab-dark);border-radius:20px;padding:7px 10px;cursor:pointer;font:inherit;font-size:12px}
.ab-ai-chip:hover{background:var(--ab-gold);color:#fff}
.ab-ai-form{display:flex;flex:0 0 auto;width:100%;min-width:0;max-width:100%;overflow:hidden;gap:7px;padding:11px 11px 6px;background:#fff;border-top:1px solid #ece7dd}
.ab-ai-input{flex:1;width:100%;max-width:100%;border:1px solid #d7d9da;border-radius:22px;padding:10px 13px;font:inherit;font-size:14px;outline:none;min-width:0}
.ab-ai-input:focus{border-color:var(--ab-gold)}
.ab-ai-send{border:0;border-radius:50%;width:40px;height:40px;flex:0 0 40px;background:var(--ab-gold);color:#fff;cursor:pointer;font-size:18px}
.ab-ai-send:disabled,.ab-ai-input:disabled{opacity:.6;cursor:wait}
.ab-ai-note{flex:0 0 auto;max-width:100%;overflow-wrap:anywhere;text-align:center;background:#fff;color:var(--ab-muted);font-size:10px;padding:2px 8px 8px}
@media(max-width:480px){#ab-ai-root{left:0}#ab-ai-root .ab-ai-launcher{width:auto!important;min-height:0!important;padding:6px 5px 7px!important;border-radius:0 12px 12px 0!important;gap:4px}.ab-ai-launcher-label{font-size:12px}.ab-ai-badge{min-width:0;height:auto;padding:3px 5px;font-size:10px}#ab-ai-root.ab-ai-attached{top:calc(var(--ab-contact-top) - var(--ab-launcher-height,120px) - 7px)}#ab-ai-root.ab-ai-attached .ab-ai-launcher{width:auto!important}html body .aa-contact-fab>.aa-contact-toggle{padding:6px 5px 7px!important;gap:4px!important;border-radius:0 12px 12px 0!important}.aa-contact-toggle__icon{width:22px!important;height:22px!important;flex-basis:22px!important}.aa-contact-toggle__desktop,.aa-contact-toggle__mobile{font-size:12px!important}.ab-ai-panel{position:fixed;left:10px;right:10px;top:auto;bottom:10px;transform:none;width:auto;height:min(640px,calc(100vh - 20px))}.ab-ai-panel.open{animation:abAiMobileIn .2s ease-out}}
@keyframes abAiMobileIn{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:640px){#ab-ai-root .ab-ai-panel{position:fixed!important;left:8px!important;right:8px!important;top:auto!important;bottom:8px!important;transform:none!important;width:auto!important;max-width:none!important;height:min(640px,calc(100vh - 16px))!important;max-height:calc(100vh - 16px)!important;border-radius:16px!important;overflow-x:hidden!important}#ab-ai-root .ab-ai-panel.open{animation:abAiMobileIn .2s ease-out}.ab-ai-messages{padding:12px}.ab-ai-msg{max-width:92%;overflow-wrap:anywhere}.ab-ai-form{padding:10px 10px 7px;gap:6px}.ab-ai-input{font-size:16px!important;line-height:1.25!important;padding:10px 12px!important}.ab-ai-send{width:42px;height:42px;flex-basis:42px}.ab-ai-note{padding:3px 8px 8px}}
@supports(height:100dvh){@media(max-width:640px){#ab-ai-root .ab-ai-panel{height:min(640px,calc(100dvh - 16px))!important;max-height:calc(100dvh - 16px)!important}}}
@media(prefers-reduced-motion:reduce){.ab-ai-panel.open{animation:none}.ab-ai-messages{scroll-behavior:auto}}

/* Unified production layout v2.1.0 */
#ab-ai-root,
#ab-ai-root.ab-ai-attached{
  position:fixed!important;
  left:0!important;
  right:auto!important;
  top:auto!important;
  bottom:152px!important;
  margin:0!important;
  z-index:999999!important;
  transform:none!important;
  transition:none!important;
  animation:none!important;
}
#ab-ai-root .ab-ai-launcher{
  transform:none!important;
  transition:filter .15s ease!important;
}
.ab-ai-avatar{font-family:Arial,sans-serif;font-size:13px;font-weight:900;letter-spacing:.4px}
.ab-ai-panel{
  left:56px!important;
  top:50%!important;
  bottom:auto!important;
  width:min(350px,calc(100vw - 76px))!important;
  height:min(520px,calc(100vh - 48px))!important;
  max-height:calc(100vh - 24px)!important;
  transform:translateY(-50%)!important;
}
.ab-ai-panel.open{display:flex!important}
.aa-contact-fab{width:max-content!important}
.aa-contact-menu{
  position:absolute!important;
  left:calc(100% + 10px)!important;
  right:auto!important;
  top:auto!important;
  bottom:0!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:stretch!important;
  width:min(360px,calc(100vw - 56px))!important;
  max-width:calc(100vw - 56px)!important;
  gap:6px!important;
}
.aa-contact-option{flex:1 1 0!important;width:auto!important;min-width:0!important}
html body .aa-contact-fab>.aa-contact-toggle{
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:118px!important;
  min-height:118px!important;
  max-height:118px!important;
}
@media(max-width:640px){
  #ab-ai-root,
  #ab-ai-root.ab-ai-attached,
  body:has(.aa-contact-fab.is-open) #ab-ai-root:not(:has(.ab-ai-panel.open)){
    position:fixed!important;
    left:0!important;
    right:auto!important;
    top:auto!important;
    bottom:calc(142px + 100dvh - 100svh)!important;
    margin:0!important;
    transform:none!important;
    transition:none!important;
    animation:none!important;
  }
  #ab-ai-root .ab-ai-launcher{transform:none!important;transition:none!important}
  #ab-ai-root .ab-ai-panel{
    position:fixed!important;
    left:42px!important;
    right:8px!important;
    top:auto!important;
    bottom:10px!important;
    width:auto!important;
    max-width:none!important;
    height:min(520px,calc(100dvh - 20px))!important;
    max-height:calc(100dvh - 20px)!important;
    transform:none!important;
    border-radius:16px!important;
    overflow-x:hidden!important;
  }
  #ab-ai-root .ab-ai-panel.open{display:flex!important;animation:abAiMobileIn .16s ease-out!important}
  html body .aa-contact-fab>.aa-contact-toggle{
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    height:107px!important;
    min-height:107px!important;
    max-height:107px!important;
  }
  .aa-contact-menu{
    left:calc(100% + 8px)!important;
    right:auto!important;
    top:auto!important;
    bottom:0!important;
    width:calc(100vw - 48px)!important;
    max-width:calc(100vw - 48px)!important;
  }
  .aa-contact-option{
    flex:1 1 0!important;
    width:auto!important;
    min-width:0!important;
    padding:8px 3px!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:center!important;
    gap:4px!important;
    text-align:center!important;
  }
  .aa-contact-option__text strong{display:block!important;font-size:10px!important;line-height:1.35!important;white-space:normal!important}
  .aa-contact-option__text small{display:none!important}
  .ab-ai-messages{padding:12px}
  .ab-ai-msg{max-width:92%;overflow-wrap:anywhere}
  .ab-ai-form{padding:10px 10px 7px;gap:6px}
  .ab-ai-input{font-size:16px!important;line-height:1.25!important;padding:10px 12px!important}
  .ab-ai-send{width:42px;height:42px;flex-basis:42px}
  .ab-ai-note{padding:3px 8px 8px}
}
@media(prefers-reduced-motion:reduce){
  .ab-ai-panel.open{animation:none!important}
  .ab-ai-messages{scroll-behavior:auto}
}

.ab-ai-msg.bot .ab-ai-link{color:#0866cc!important;text-decoration:underline!important;text-underline-offset:2px;font-weight:700;overflow-wrap:anywhere;word-break:break-word}
.ab-ai-msg.bot .ab-ai-link:hover{color:#034ea2!important}
.ab-ai-msg.bot .ab-ai-link:focus-visible{outline:2px solid #0866cc;outline-offset:2px;border-radius:3px}


/* CODEX MOBILE FULLSCREEN CHAT — START */
@media (max-width: 640px) {
  #ab-ai-root .ab-ai-panel,
  #ab-ai-root .ab-ai-panel.open {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
  }
}
@supports (height: 100dvh) {
  @media (max-width: 640px) {
    #ab-ai-root .ab-ai-panel,
    #ab-ai-root .ab-ai-panel.open {
      height: 100dvh !important;
      min-height: 100dvh !important;
      max-height: 100dvh !important;
    }
  }
}
/* CODEX MOBILE FULLSCREEN CHAT — END */


/* iPhone Safari floating launchers fix — 2026-07-16 */
@media (max-width: 767px) {
  html body div#ab-ai-root button#ab-ai-launcher#ab-ai-launcher {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    left: max(0px, env(safe-area-inset-left, 0px)) !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 145px) !important;
    margin: 0 !important;
    z-index: 999999 !important;
  }

  html body div.aa-contact-fab.aa-contact-fab button.aa-contact-toggle.aa-contact-toggle {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    left: max(0px, env(safe-area-inset-left, 0px)) !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
    margin: 0 !important;
    z-index: 999998 !important;
  }
}


/* AI assistant logo */
.ab-ai-avatar{overflow:hidden;background:#fff!important;padding:3px}
.ab-ai-avatar img{display:block;width:100%;height:100%;object-fit:contain;border-radius:50%}
.ab-ai-badge{width:30px!important;height:30px!important;padding:2px!important;border-radius:9px!important;background:#fff!important;overflow:hidden}
.ab-ai-badge img{display:block;width:100%;height:100%;object-fit:contain;border-radius:6px}
@media(max-width:480px){.ab-ai-badge{width:28px!important;height:28px!important;padding:2px!important}}


/* AI assistant logo size v2 */
.ab-ai-avatar{width:48px!important;height:48px!important;flex:0 0 48px!important}
.ab-ai-badge{width:36px!important;height:36px!important;min-width:36px!important}
@media(max-width:480px){.ab-ai-avatar{width:46px!important;height:46px!important;flex-basis:46px!important}.ab-ai-badge{width:34px!important;height:34px!important;min-width:34px!important}}
