:root {
  --glo-guide-gold: #f3c018;
  --glo-guide-ink: #f7f4e8;
  --glo-guide-muted: rgba(239, 241, 235, .64);
  --glo-guide-panel: rgba(7, 13, 16, .78);
  --glo-guide-border: rgba(255, 255, 255, .12);
}

.glo-guide,
.glo-guide * { box-sizing: border-box; }

.glo-guide {
  position: fixed;
  z-index: 999990;
  inset-inline-end: 22px;
  bottom: 22px;
  font-family: Cairo, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--glo-guide-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.glo-guide[data-lang="en"] { font-family: Manrope, Cairo, system-ui, sans-serif; }

.glo-guide__launcher {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid rgba(243,192,24,.32);
  border-radius: 999px;
  color: #fff3bf;
  background:
    linear-gradient(120deg, rgba(243,192,24,.10), rgba(10,16,18,.86) 42%, rgba(7,12,15,.80));
  box-shadow: 0 18px 52px rgba(0,0,0,.34), 0 0 0 1px rgba(243,192,24,.035) inset;
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  cursor: pointer;
  transition: transform .28s ease, border-color .28s ease, background .28s ease, box-shadow .28s ease;
  animation: gloGuideAttention 5.6s cubic-bezier(.22,.8,.26,1) 1.4s infinite;
}
.glo-guide__launcher::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30% -55%;
  background: linear-gradient(105deg, transparent 38%, rgba(255,230,139,.02) 44%, rgba(255,220,96,.28) 50%, rgba(255,244,193,.10) 54%, transparent 61%);
  transform: translateX(-72%) rotate(2deg);
  animation: gloGuideShimmer 5.6s ease-in-out 2s infinite;
  pointer-events: none;
}
.glo-guide.has-interacted .glo-guide__launcher,
.glo-guide.is-open .glo-guide__launcher { animation: none; }
.glo-guide.has-interacted .glo-guide__launcher::before,
.glo-guide.is-open .glo-guide__launcher::before { animation: none; opacity: 0; }
.glo-guide__launcher:hover { transform: translateY(-2px); border-color: rgba(243,192,24,.56); box-shadow: 0 24px 68px rgba(0,0,0,.42), 0 0 22px rgba(243,192,24,.08); }
.glo-guide__launcher:focus-visible,
.glo-guide button:focus-visible,
.glo-guide a:focus-visible,
.glo-guide textarea:focus-visible { outline: 2px solid var(--glo-guide-gold); outline-offset: 3px; }

.glo-guide__launcher-label { position:relative; z-index:1; font-size:13px; font-weight:700; white-space:nowrap; letter-spacing:0; }

.glo-guide__panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: 68px;
  width: min(410px, calc(100vw - 30px));
  height: min(620px, calc(100svh - 110px));
  min-height: 480px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--glo-guide-border);
  border-radius: 26px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(243,192,24,.10), transparent 46%),
    radial-gradient(100% 90% at 0% 100%, rgba(39,83,83,.12), transparent 52%),
    var(--glo-guide-panel);
  box-shadow: 0 36px 100px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(28px) saturate(138%);
  -webkit-backdrop-filter: blur(28px) saturate(138%);
  transform-origin: bottom inline-end;
  animation: gloGuideIn .30s cubic-bezier(.22,.8,.26,1) both;
}
.glo-guide__panel[hidden] { display: none !important; }

.glo-guide__header {
  min-height: 76px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding: 16px 17px 14px 19px;
  border-bottom: 1px solid rgba(255,255,255,.075);
}
.glo-guide[dir="rtl"] .glo-guide__header { padding:16px 19px 14px 17px; }
.glo-guide__identity { display:flex; align-items:center; gap:12px; min-width:0; }
.glo-guide__headcopy { display:grid; gap:3px; min-width:0; }
.glo-guide__headcopy strong { font-size:14px; font-weight:700; color:#fffaf0; }
.glo-guide__headcopy small { display:flex; align-items:center; gap:7px; color:rgba(235,239,232,.54); font-size:10.5px; line-height:1.4; }
.glo-guide__headcopy i { width:6px;height:6px;border-radius:50%;background:#8ac89d;box-shadow:0 0 0 4px rgba(138,200,157,.08); }
.glo-guide__close { width:38px;height:38px;border-radius:50%;display:grid;place-items:center;color:rgba(255,255,255,.62);background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.065);cursor:pointer;transition:.2s ease; }
.glo-guide__close:hover { color:#fff;background:rgba(255,255,255,.085); }
.glo-guide__close svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round; }

.glo-guide__body { min-height:0; display:grid; grid-template-rows:1fr auto; }
.glo-guide__messages {
  min-height:0; overflow:auto; overscroll-behavior:contain;
  padding:18px 17px 12px; display:flex; flex-direction:column; gap:12px;
  scrollbar-width:thin; scrollbar-color:rgba(243,192,24,.45) transparent;
}
.glo-guide__messages::-webkit-scrollbar{width:5px}.glo-guide__messages::-webkit-scrollbar-track{background:transparent}.glo-guide__messages::-webkit-scrollbar-thumb{background:rgba(243,192,24,.38);border-radius:99px}
.glo-guide__message { max-width:91%; display:grid; gap:9px; animation:gloGuideMessage .24s ease both; }
.glo-guide__message--assistant { align-self:flex-start; }
.glo-guide__message--user { align-self:flex-end; }
.glo-guide__message-content {
  padding:11px 13px; border-radius:17px; font-size:13px; line-height:1.75; letter-spacing:0; white-space:pre-wrap;
}
.glo-guide__message--assistant .glo-guide__message-content { color:rgba(251,250,243,.90); background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.07); border-start-start-radius:7px; }
.glo-guide__message--user .glo-guide__message-content { color:#fff8df; background:linear-gradient(135deg,rgba(243,192,24,.18),rgba(190,134,9,.10)); border:1px solid rgba(243,192,24,.20); border-end-end-radius:7px; }
.glo-guide__message.is-pending .glo-guide__message-content { color:rgba(255,255,255,.45); }

.glo-guide__actions { display:flex; flex-wrap:wrap; gap:7px; }
.glo-guide__action {
  min-height:34px; display:inline-flex; align-items:center; gap:8px; padding:7px 10px; border-radius:999px;
  color:#f6dda0; background:rgba(243,192,24,.06); border:1px solid rgba(243,192,24,.16); text-decoration:none!important;
  font-size:10.5px; font-weight:650; transition:.2s ease;
}
.glo-guide__action:hover { color:#fff1bd; background:rgba(243,192,24,.11); border-color:rgba(243,192,24,.30); transform:translateY(-1px); }
.glo-guide__action svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round; }
.glo-guide[dir="rtl"] .glo-guide__action svg { transform:scaleX(-1); }

.glo-guide__quick { padding:5px 17px 14px; display:flex; flex-wrap:wrap; gap:7px; }
.glo-guide__quick button { min-height:31px;padding:6px 10px;border-radius:999px;cursor:pointer;border:1px solid rgba(255,255,255,.075);background:rgba(255,255,255,.035);color:rgba(239,241,235,.68);font-size:10.5px;transition:.2s ease; }
.glo-guide__quick button:hover { color:#fff5d5;border-color:rgba(243,192,24,.24);background:rgba(243,192,24,.055); }

.glo-guide__composer-wrap { padding:12px 14px 13px;border-top:1px solid rgba(255,255,255,.075);background:rgba(3,7,9,.20); }
.glo-guide__composer { display:grid; grid-template-columns:1fr auto; align-items:end; gap:8px; padding:7px 7px 7px 13px; border:1px solid rgba(255,255,255,.10);border-radius:18px;background:rgba(255,255,255,.045);box-shadow:inset 0 1px 0 rgba(255,255,255,.025); }
.glo-guide[dir="rtl"] .glo-guide__composer { padding:7px 13px 7px 7px; }
.glo-guide__composer textarea { width:100%;max-height:90px;min-height:38px;padding:8px 0 5px;resize:none;border:0;outline:0;background:transparent;color:#fff;font:500 12.5px/1.65 inherit;caret-color:var(--glo-guide-gold); }
.glo-guide__composer textarea::placeholder { color:rgba(237,239,234,.35); opacity:1; }
.glo-guide__send { width:38px;height:38px;border-radius:13px;display:grid;place-items:center;cursor:pointer;border:1px solid rgba(243,192,24,.22);background:linear-gradient(145deg,#f5cb35,#c9960c);color:#17130a;box-shadow:0 6px 18px rgba(243,192,24,.12);transition:.2s ease; }
.glo-guide__send:hover { transform:translateY(-1px);filter:brightness(1.05); }
.glo-guide__send:disabled { opacity:.45;cursor:default;transform:none; }
.glo-guide__send svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.glo-guide[dir="rtl"] .glo-guide__send svg { transform:scaleX(-1); }
.glo-guide__meta { display:flex;justify-content:space-between;gap:12px;padding:7px 4px 0;color:rgba(237,239,234,.38);font-size:9.5px; }
.glo-guide.is-limit .glo-guide__hint,.glo-guide.is-limit .glo-guide__counter { color:#f3c018; }

@keyframes gloGuideAttention {
  0%, 70%, 100% { transform: translateY(0) scale(1); box-shadow: 0 18px 52px rgba(0,0,0,.34), 0 0 0 0 rgba(243,192,24,0); }
  76% { transform: translateY(-2px) scale(1.025); box-shadow: 0 22px 62px rgba(0,0,0,.40), 0 0 0 7px rgba(243,192,24,.055), 0 0 24px rgba(243,192,24,.10); }
  83% { transform: translateY(0) scale(1); box-shadow: 0 18px 52px rgba(0,0,0,.34), 0 0 0 0 rgba(243,192,24,0); }
}
@keyframes gloGuideShimmer {
  0%, 67% { transform: translateX(-72%) rotate(2deg); opacity:0; }
  72% { opacity:1; }
  84% { transform: translateX(72%) rotate(2deg); opacity:.9; }
  88%, 100% { transform: translateX(72%) rotate(2deg); opacity:0; }
}

@keyframes gloGuideIn { from{opacity:0;transform:translateY(12px) scale(.975)} to{opacity:1;transform:none} }
@keyframes gloGuideMessage { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }

@media (max-width: 640px) {
  .glo-guide { inset-inline:8px; bottom:8px; }
  .glo-guide__launcher { margin-inline-start:auto; display:flex; }
  .glo-guide__panel { position:fixed; inset-inline:8px; bottom:8px; width:auto; height:min(72svh,640px); min-height:460px; border-radius:24px; }
  .glo-guide.is-open .glo-guide__launcher { opacity:0;pointer-events:none; }
  .glo-guide__message { max-width:94%; }
}

@media (prefers-reduced-motion: reduce) {
  .glo-guide *, .glo-guide *::before, .glo-guide *::after { animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important; }
}
