/* Tasi3a Maths · « اسألني » 1.0.0 — the contact bubble (all pages of the site). Everything is scoped under #tc-bubble. */
#tc-bubble {
  --tc-blue: #1170d1; --tc-navy: #0b3a8c; --tc-gold: #f6c344; --tc-ink: #0f2547; --tc-muted: #5b6b84; --tc-line: #dbe6f3; --tc-soft: #eef4fb;
  position: fixed; z-index: 1080; bottom: 18px; right: 18px;
  font-family: "Tajawal", "RlTajawal", "Segoe UI", Tahoma, sans-serif; color: var(--tc-ink); line-height: 1.6; font-size: 16px;
}
#tc-bubble.is-left { right: auto; left: 18px; }
#tc-bubble *, #tc-bubble *::before, #tc-bubble *::after { box-sizing: border-box; }
#tc-bubble button, #tc-bubble input, #tc-bubble textarea { font-family: inherit; }

/* launcher */
#tc-bubble .tc-launch {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 18px 6px 6px; border: 0; border-radius: 999px;
  background: linear-gradient(100deg, var(--tc-blue), var(--tc-navy)); color: #fff; cursor: pointer; font-weight: 900; font-size: 16px;
  box-shadow: 0 10px 26px -8px rgb(11 58 140 / .65), 0 0 0 3px #fff; transition: translate .2s, box-shadow .2s;
}
#tc-bubble.is-left .tc-launch { flex-direction: row-reverse; padding: 6px 6px 6px 18px; }
#tc-bubble .tc-launch:hover { translate: 0 -2px; box-shadow: 0 14px 30px -8px rgb(11 58 140 / .7), 0 0 0 3px var(--tc-gold); }
#tc-bubble .tc-launch:focus-visible { outline: 3px solid var(--tc-gold); outline-offset: 3px; }
#tc-bubble .tc-launch img { width: 48px; height: 48px; border-radius: 50%; background: #dfeaf8; box-shadow: 0 0 0 2px var(--tc-gold); }
#tc-bubble .tc-launch-badge { position: absolute; top: -4px; left: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #d6283a; color: #fff; font-size: 13px; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px #fff; }
#tc-bubble.is-open .tc-launch-label { display: none; }
#tc-bubble.is-open .tc-launch { padding: 6px; }

/* panel */
#tc-bubble .tc-panel {
  position: absolute; bottom: 74px; right: 0; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: #fff;
  box-shadow: 0 24px 60px -18px rgb(4 20 60 / .55), 0 0 0 1px var(--tc-line);
}
#tc-bubble.is-left .tc-panel { right: auto; left: 0; }
#tc-bubble .tc-panel[hidden] { display: none; }
#tc-bubble .tc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: linear-gradient(100deg, var(--tc-blue), var(--tc-navy)); }
#tc-bubble .tc-head img { width: 44px; height: 44px; border-radius: 50%; background: #dfeaf8; box-shadow: 0 0 0 2px var(--tc-gold); }
#tc-bubble .tc-head-tx { flex: 1; display: grid; line-height: 1.3; }
#tc-bubble .tc-head-tx strong { font-size: 17px; font-weight: 900; }
#tc-bubble .tc-head-tx small { font-size: 12.5px; opacity: .85; }
#tc-bubble .tc-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .16); color: #fff; font-size: 16px; cursor: pointer; }
#tc-bubble .tc-close:hover { background: rgb(255 255 255 / .28); }
#tc-bubble .tc-body { flex: 1; overflow-y: auto; padding: 14px; background: #f5f8fd; overscroll-behavior: contain; }
#tc-bubble .tc-log { display: flex; flex-direction: column; gap: 10px; }

#tc-bubble .tc-msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 15px; overflow-wrap: anywhere; }
#tc-bubble .tc-msg.is-bot { align-self: flex-start; background: #fff; border: 1px solid var(--tc-line); border-start-start-radius: 4px; }
#tc-bubble .tc-msg.is-me { align-self: flex-end; background: var(--tc-blue); color: #fff; border-start-end-radius: 4px; }
#tc-bubble .tc-link { display: inline-flex; margin-top: 8px; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--tc-gold); color: #3a2a00 !important; font-weight: 800; font-size: 14px; text-decoration: none !important; cursor: pointer; }

#tc-bubble .tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#tc-bubble .tc-chip { padding: 6px 12px; border: 1.5px solid var(--tc-blue); border-radius: 999px; background: #fff; color: var(--tc-navy); font-size: 14px; font-weight: 700; cursor: pointer; text-align: start; }
#tc-bubble .tc-chip:hover, #tc-bubble .tc-chip:focus-visible { background: var(--tc-soft); outline: none; }
#tc-bubble .tc-chip.is-ghost { border-style: dashed; color: var(--tc-muted); border-color: var(--tc-muted); }
#tc-bubble .tc-more { display: flex; flex-wrap: wrap; gap: 6px; }
#tc-bubble .tc-ask { width: 100%; padding: 10px 14px; border: 0; border-radius: 14px; background: linear-gradient(100deg, var(--tc-gold), #ffad1f); color: #3a2a00; font-size: 15px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #c98a06; }
#tc-bubble .tc-ask:active { translate: 0 3px; box-shadow: 0 1px 0 #c98a06; }
#tc-bubble .tc-mine { align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: #e3f6ea; color: #146c3c !important; font-weight: 800; font-size: 14px; text-decoration: none !important; }

#tc-bubble .tc-form { display: grid; gap: 4px; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--tc-line); }
#tc-bubble .tc-lbl { font-size: 13px; font-weight: 800; color: var(--tc-muted); }
#tc-bubble .tc-form input, #tc-bubble .tc-form textarea { width: 100%; padding: 8px 10px; border: 2px solid var(--tc-line); border-radius: 12px; background: #fff; color: var(--tc-ink); font-size: 15px; }
#tc-bubble .tc-form textarea { resize: vertical; min-height: 90px; }
#tc-bubble .tc-form input:focus, #tc-bubble .tc-form textarea:focus { outline: 0; border-color: var(--tc-blue); }
#tc-bubble .tc-send { margin-top: 6px; padding: 10px; border: 0; border-radius: 12px; background: linear-gradient(100deg, var(--tc-blue), var(--tc-navy)); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
#tc-bubble .tc-send:disabled { opacity: .7; cursor: wait; }
#tc-bubble .tc-err { margin: 0; min-height: 0; color: #b02a37; font-size: 13.5px; font-weight: 700; }
#tc-bubble .tc-err:empty { display: none; }
#tc-bubble .tc-small { font-size: 12.5px; color: var(--tc-muted) !important; }
#tc-bubble .tc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 575px) {
  #tc-bubble { bottom: 12px; right: 12px; }
  #tc-bubble.is-left { left: 12px; }
  #tc-bubble .tc-launch-label { display: none; }
  #tc-bubble .tc-launch { padding: 5px; }
  #tc-bubble .tc-launch img { width: 52px; height: 52px; }
  #tc-bubble .tc-panel { position: fixed; inset: auto 8px 78px 8px; width: auto; height: min(70vh, calc(100vh - 100px)); }
}
@media (prefers-reduced-motion: reduce) { #tc-bubble * { transition: none !important; } }
@media print { #tc-bubble { display: none !important; } }
