/* =========================================================
   Support widget — FAQ + live chat with the team (support.js)
   ========================================================= */
.sw, .sw * { box-sizing: border-box; }
.sw { --sw-gold: #f5aa03; --sw-gold-1: #ffd24d; --sw-bg: #0c0c0d; --sw-card: #161618; --sw-line: rgba(255,255,255,.08); --sw-mut: #8d8d92;
  font-family: "Rubik", system-ui, sans-serif; direction: rtl; color: #ececee; }

.sw-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 2147483000;
  width: 58px; height: 58px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #0b0b0b;
  background: linear-gradient(180deg, var(--sw-gold-1), var(--sw-gold));
  box-shadow: 0 10px 28px -6px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.sw-launch:hover { transform: scale(1.06); }
.sw-launch svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sw-launch .sw-x { display: none; }
.sw.is-open .sw-launch .sw-x { display: block; }
.sw.is-open .sw-launch .sw-bubble { display: none; }
.sw-badge { position: absolute; top: -2px; left: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  font: 700 11px/1 "Rubik", sans-serif; color: #fff; background: #e5383b; border: 2px solid #0b0b0b; }
.sw-badge[hidden] { display: none; }

.sw-panel {
  position: fixed; right: 18px; bottom: 88px; z-index: 2147483000;
  width: 380px; height: min(640px, calc(100vh - 110px)); max-height: calc(100dvh - 110px);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; background: var(--sw-bg); border: 1px solid var(--sw-line);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.85);
  opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none; visibility: hidden;
  transition: opacity .2s, transform .25s cubic-bezier(.16,1,.3,1), visibility 0s .25s;
}
.sw.is-open .sw-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .2s, transform .25s cubic-bezier(.16,1,.3,1); }

.sw-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sw [hidden] { display: none !important; }

/* home */
.sw-hero { padding: 22px 22px 54px; background: radial-gradient(90% 120% at 100% 0%, rgba(245,170,3,.28), transparent 60%), linear-gradient(180deg, #050505, #0c0c0d); }
.sw-top { display: flex; align-items: center; justify-content: space-between; }
.sw-brand { display: flex; align-items: center; gap: 8px; font: 700 14px "Rubik", sans-serif; color: var(--sw-gold-1); letter-spacing: .02em; direction: ltr; }
.sw-brand img { width: 26px; height: auto; }
.sw-close { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; display: grid; place-items: center; }
.sw-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.sw-hello { margin: 26px 0 0; font-size: 25px; font-weight: 700; line-height: 1.45; color: #fff; }
.sw-hello span { display: block; color: var(--sw-gold-1); }

.sw-cards { padding: 0 14px 14px; margin-top: -38px; display: grid; gap: 10px; }
.sw-card { border-radius: 16px; background: var(--sw-card); border: 1px solid var(--sw-line); overflow: hidden; }
.sw-start { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border: 0; background: none; color: #fff; text-align: right; cursor: pointer; font: inherit; }
.sw-start b { display: block; font-size: 15px; }
.sw-start small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--sw-mut); }
.sw-start svg, .sw-row svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sw-start .sw-go { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #0b0b0b; background: linear-gradient(180deg, var(--sw-gold-1), var(--sw-gold)); }
.sw-start:hover { background: rgba(255,255,255,.02); }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; color: #e3e3e6; text-decoration: none; font-size: 14px; }
.sw-row + .sw-row { border-top: 1px solid var(--sw-line); }
.sw-row:hover { background: rgba(255,255,255,.025); color: #fff; }
.sw-row svg { color: var(--sw-mut); }

.sw-faq-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; font-size: 14px; font-weight: 700; color: #fff; }
.sw-search { margin: 6px 12px 8px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border-radius: 12px; background: #0f0f10; border: 1px solid var(--sw-line); }
.sw-search svg { width: 16px; height: 16px; stroke: var(--sw-mut); fill: none; stroke-width: 2; }
.sw-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: inherit; font-size: 14px; }
.sw-faq details { border-top: 1px solid var(--sw-line); }
.sw-faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; font-size: 14px; color: #e9e9ea; }
.sw-faq summary::-webkit-details-marker { display: none; }
.sw-faq summary::after { content: "+"; font-size: 18px; color: var(--sw-gold-1); line-height: 1; }
.sw-faq details[open] summary::after { content: "–"; }
.sw-faq details p { margin: 0; padding: 0 16px 14px; font-size: 13.5px; line-height: 1.9; color: #b5b5ba; white-space: pre-line; }
.sw-faq-empty { padding: 10px 16px 16px; font-size: 13px; color: var(--sw-mut); }

/* chat */
.sw-chathead { display: flex; align-items: center; gap: 10px; padding: 14px 14px; border-bottom: 1px solid var(--sw-line); background: #0a0a0b; }
.sw-back { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; display: grid; place-items: center; }
.sw-back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sw-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #1b1b1e; border: 1px solid rgba(245,170,3,.4); }
.sw-avatar img { width: 22px; }
.sw-chathead b { display: block; font-size: 14.5px; color: #fff; }
.sw-chathead small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sw-mut); }
.sw-chathead small i { width: 7px; height: 7px; border-radius: 50%; background: #2bd576; }

.sw-intro { padding: 18px 16px; display: grid; gap: 10px; }
.sw-intro p { margin: 0 0 4px; font-size: 13.5px; line-height: 1.9; color: #b5b5ba; }
.sw-intro label { display: grid; gap: 5px; font-size: 12.5px; color: #cfcfd2; }
.sw-intro input, .sw-intro textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: #111113; color: #fff;
  font: inherit; font-size: 16px; outline: none; resize: none;
}
.sw-intro input:focus, .sw-intro textarea:focus, .sw-compose textarea:focus { border-color: var(--sw-gold); box-shadow: 0 0 0 3px rgba(245,170,3,.16); }
.sw-intro em { font-style: normal; font-size: 12px; color: #ff6b6b; }
.sw-intro em:empty { display: none; }
.sw-btn { height: 46px; border: 0; border-radius: 12px; cursor: pointer; font: 700 15px "Rubik", sans-serif; color: #0b0b0b; background: linear-gradient(180deg, var(--sw-gold-1), var(--sw-gold)); }
.sw-btn[disabled] { opacity: .6; cursor: progress; }
.sw-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.sw-thread { padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.sw-msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-wrap: break-word; }
.sw-msg time { display: block; margin-top: 2px; font-size: 10.5px; opacity: .6; direction: ltr; text-align: left; }
.sw-msg--visitor { align-self: flex-end; background: linear-gradient(180deg, #ffd24d, #f5aa03); color: #111; border-end-end-radius: 5px; }
.sw-msg--team { align-self: flex-start; background: #1c1c1f; color: #ececee; border: 1px solid var(--sw-line); border-end-start-radius: 5px; }
.sw-msg--team .sw-who { display: block; font-size: 11.5px; color: var(--sw-gold-1); margin-bottom: 1px; }
.sw-msg--system { align-self: center; max-width: 92%; background: transparent; color: var(--sw-mut); font-size: 12.5px; text-align: center; }
.sw-note { align-self: center; font-size: 12px; color: var(--sw-mut); text-align: center; padding: 4px 10px; }

.sw-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--sw-line); background: #0a0a0b; }
.sw-compose textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: #111113; color: #fff; font: inherit; font-size: 16px; resize: none; outline: none; line-height: 1.5; }
.sw-send { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 14px; cursor: pointer; display: grid; place-items: center; color: #0b0b0b; background: linear-gradient(180deg, var(--sw-gold-1), var(--sw-gold)); }
.sw-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }

/* bottom tabs */
.sw-tabs { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--sw-line); background: #0a0a0b; }
.sw-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 12px; border: 0; background: none; color: var(--sw-mut); font: 500 12.5px "Rubik", sans-serif; cursor: pointer; }
.sw-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sw-tab.is-on { color: #fff; }
.sw-tab.is-on svg { stroke: var(--sw-gold-1); }
.sw-tab .sw-badge { top: 4px; left: calc(50% - 22px); border-color: #0a0a0b; }

@media (max-width: 560px) {
  .sw-launch { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .sw-panel { right: 0; left: 0; bottom: 0; top: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .sw.is-open .sw-launch { display: none; }
  html.sw-lock, html.sw-lock body { overflow: hidden !important; }
}
@media (prefers-reduced-motion: reduce) { .sw-panel, .sw-launch { transition: none; } }

/* compact home: chat first, short FAQ, social icons — fits without scrolling */
.sw-hero { padding: 16px 18px 46px; }
.sw-hello { margin: 14px 0 0; font-size: 20px; line-height: 1.5; }
.sw-cards { margin-top: -34px; gap: 8px; }
.sw-faq-h { padding: 12px 16px 4px; }
.sw-faq summary { padding: 11px 16px; font-size: 13.5px; }
.sw-more { display: block; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--sw-line); background: none; color: var(--sw-gold-1); font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.sw-more:hover { background: rgba(255,255,255,.025); }
.sw-social { display: flex; justify-content: center; gap: 8px; padding: 4px 0 2px; }
.sw-social a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #d6d6da; background: var(--sw-card); border: 1px solid var(--sw-line); transition: color .15s, border-color .15s; }
.sw-social a:hover { color: var(--sw-gold-1); border-color: rgba(245,170,3,.45); }
.sw-social svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* message-first chat */
.sw-welcome { display: flex; align-items: flex-start; gap: 10px; padding: 16px 14px 0; }
.sw-welcome .sw-avatar { flex-shrink: 0; }
.sw-welcome p { margin: 0; padding: 10px 13px; border-radius: 4px 15px 15px 15px; background: var(--sw-card); border: 1px solid var(--sw-line); font-size: 14px; line-height: 1.8; color: #e9e9ea; }
.sw-contact { display: grid; gap: 9px; margin-top: 4px; padding: 14px; border-radius: 16px; background: var(--sw-card); border: 1px solid rgba(245,170,3,.35); }
.sw-contact p { margin: 0; font-size: 13.5px; line-height: 1.8; color: #d6d6da; }
.sw-contact label { display: grid; gap: 4px; font-size: 12.5px; color: #cfcfd2; }
.sw-contact input { height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid rgba(255,255,255,.12); background: #0f0f10; color: #fff; font: inherit; font-size: 16px; outline: none; }
.sw-contact input:focus { border-color: var(--sw-gold); box-shadow: 0 0 0 3px rgba(245,170,3,.16); }
.sw-contact em { font-style: normal; font-size: 12px; color: #ff6b6b; }
.sw-contact em:empty { display: none; }
.sw-contact .sw-btn { height: 42px; font-size: 14px; }
