/* Copyright © 2026 BSBSoft. All rights reserved. Unauthorized copying prohibited. */
/* ==========================================================================
   BSBSoft — core stylesheet
   Tailwind (CDN) handles layout/utility classes.
   This file handles: theme tokens, typography, custom components, animation.
   ========================================================================== */

:root {
  --bg: #070b14;
  --bg-alt: #0b111f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e8edf7;
  --text-muted: #93a0b8;
  --text-faint: #5c6a85;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-3: #a855f7;
  --success: #34d399;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  --shadow-glow: 0 0 60px -15px rgba(99, 102, 241, 0.45);
}

* { box-sizing: border-box; }

/* Content protection: deter selection/copying and image dragging site-wide. */
html, body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

::selection { background: var(--accent-2); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* ---------- Background texture ---------- */
.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.blob-cyan { background: var(--accent); animation: float-a 14s ease-in-out infinite; }
.blob-indigo { background: var(--accent-2); animation: float-b 18s ease-in-out infinite; }
.blob-purple { background: var(--accent-3); animation: float-a 16s ease-in-out infinite reverse; }

@keyframes float-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 25px) scale(0.95); }
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: var(--accent);
  color: #04070d;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.6rem;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* ---------- Text utilities ---------- */
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  background-size: 160% 160%;
  color: #04070d;
  box-shadow: 0 8px 30px -8px rgba(99, 102, 241, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 12px 34px -6px rgba(34, 211, 238, 0.55); }

.nav-cta { animation: cta-pulse-glow 2.4s ease-in-out infinite; }
.nav-cta:hover { animation-play-state: paused; }
@keyframes cta-pulse-glow {
  0%, 100% { box-shadow: 0 8px 30px -8px rgba(99, 102, 241, 0.6); }
  50% { box-shadow: 0 8px 34px -2px rgba(34, 211, 238, 0.85); }
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(6px);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Navbar ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
#site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(7, 11, 20, 0.85);
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: #04070d;
  font-size: 1.05rem;
  box-shadow: 0 6px 20px -6px rgba(99, 102, 241, 0.7);
  flex-shrink: 0;
}
@media (max-width: 639px) {
  .logo-mark.hidden { display: none; }
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--gradient);
  transition: width 0.25s ease;
  border-radius: 2px;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--text); }
.nav-link.active::after { width: 100%; }

#mobile-menu { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
#mobile-menu.open { max-height: 640px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--surface-strong);
  box-shadow: var(--shadow-glow);
}

.icon-tile {
  width: 52px;
  height: 52px;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(99,102,241,0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent);
  transition: background 0.3s ease, border-color 0.3s ease;
  animation: icon-bob 3s ease-in-out infinite;
}
.card:hover .icon-tile {
  animation-duration: 1.2s;
  background: linear-gradient(135deg, rgba(34,211,238,0.3), rgba(99,102,241,0.3));
  border-color: rgba(99, 102, 241, 0.6);
}

@keyframes icon-bob {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(-4px) scale(1.06) rotate(-4deg); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.badge .dot-error { background: #f87171; box-shadow: 0 0 8px #f87171; }
.tech-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
}
.tech-icon svg { width: 100%; height: 100%; display: block; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ---------- Typing code block ---------- */
.code-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 1px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: code-blink 0.85s steps(1) infinite;
}
@keyframes code-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- Marquee ---------- */
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Section heading ---------- */
.section-eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

/* ---------- Timeline ---------- */
.timeline-step { position: relative; }
.timeline-step .num {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Testimonial slider ---------- */
.slide { display: none; }
.slide.active { display: block; animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }
.dot-btn { width: 9px; height: 9px; border-radius: 50%; background: var(--border); transition: all .25s ease; }
.dot-btn.active { background: var(--gradient); width: 26px; border-radius: 6px; }

/* ---------- Portfolio filter ---------- */
.filter-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
}
.filter-btn.active, .filter-btn:hover {
  color: #04070d;
  background: var(--gradient);
  border-color: transparent;
}
.filter-item { transition: opacity .35s ease, transform .35s ease; }
.filter-item.hidden-item { display: none; }

/* ---------- Portfolio filter: mobile horizontal scroll ---------- */
@media (max-width: 640px) {
  .filter-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  }
  .filter-scroll::-webkit-scrollbar { display: none; }
  .filter-scroll .filter-btn {
    scroll-snap-align: start;
    white-space: nowrap;
  }
}

/* ---------- Forms ---------- */
.form-input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.form-input::placeholder { color: var(--text-faint); }
.text-faint { color: var(--text-faint); }
.form-input.input-error { border-color: #f87171; }
.form-input.input-error:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15); }
.field-error {
  display: none;
  color: #f87171;
  font-size: 0.78rem;
  margin-top: 0.4rem;
}
.field-error.show { display: block; }

/* ---------- Newsletter toast (subscribe/unsubscribe feedback) ---------- */
.newsletter-toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translate(-50%, 1rem);
  z-index: 80;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0.7rem;
  padding: 0.85rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 2rem);
}
.newsletter-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.newsletter-toast[data-variant="warning"] { border-left-color: #fbbf24; }
.newsletter-toast[data-variant="success"] { border-left-color: var(--success); }

/* ---------- File upload (careers apply form) ---------- */
.file-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.file-input-wrap:hover { border-color: var(--accent); }
.file-input-wrap.input-error { border-color: #f87171; }
.file-input-btn {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}
.file-input-name {
  color: var(--text-faint);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-input-name.has-file { color: var(--text); }

/* ---------- Custom select (native <select> popups can't be styled/scrolled) ---------- */
.custom-select { position: relative; }
.custom-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}
.custom-select-arrow {
  width: 1rem;
  height: 1rem;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.custom-select.open .custom-select-toggle { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }
.custom-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  max-height: 13rem;
  overflow-y: auto;
  margin: 0;
  list-style: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.4rem;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.custom-select.open .custom-select-list { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-select-option {
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
}
.custom-select-option:hover,
.custom-select-option:focus { background: var(--surface-strong); outline: none; }
.custom-select-option.selected { color: var(--accent); }

/* ---------- Quote modal ---------- */
body.modal-locked { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-panel {
  width: 100%;
  max-width: 30rem;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 2rem;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal-panel { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 6.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gradient);
  color: #04070d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(99,102,241,0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 90;
}
#back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Offer popup trigger ---------- */
#offer-trigger {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #04070d;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px -8px rgba(99,102,241,0.6);
  z-index: 90;
  transition: transform .2s ease, box-shadow .2s ease;
}
#offer-trigger:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -6px rgba(34,211,238,0.55); }

/* ---------- Stat counters ---------- */
.stat-num { font-family: 'Space Grotesk', sans-serif; }

/* ---------- Misc ---------- */
.divider-fade { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); }

.avatar-ring {
  border-radius: 50%;
  padding: 3px;
  background: var(--gradient);
}

/* ---------- CTA panel ---------- */
.cta-panel {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(99, 102, 241, 0.14), rgba(168, 85, 247, 0.12));
  border: 1px solid var(--border);
}

/* ---------- Featured card ---------- */
.card-featured { border-color: rgba(99, 102, 241, 0.5); }

/* ---------- Icon tile color variants ---------- */
.icon-tile-danger { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); color: #f87171; }
.icon-tile-success { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.4); color: var(--success); }

/* ---------- Contact visual panel ---------- */
.contact-visual-panel { background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(99, 102, 241, 0.15)); }

/* ---------- Portfolio thumbnail gradients ---------- */
.thumb-grad-1 { background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(99, 102, 241, 0.25)); }
.thumb-grad-2 { background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25)); }
.thumb-grad-3 { background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(34, 211, 238, 0.25)); }
.thumb-grad-4 { background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(168, 85, 247, 0.25)); }
.thumb-grad-5 { background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(34, 211, 238, 0.25)); }
.thumb-grad-6 { background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25)); }

/* ---------- FAQ accordion ---------- */
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .chevron { transition: transform 0.3s ease; flex-shrink: 0; color: var(--accent); }
.faq-item[open] .chevron { transform: rotate(180deg); }
.faq-item[open] summary { color: #fff; }
.faq-item .faq-answer {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---------- Star rating ---------- */
.star-row svg { color: #fbbf24; }

/* ---------- Legal page table of contents ---------- */
.toc-link {
  display: block;
  padding: 0.45rem 0 0.45rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-left: 2px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-link:hover { color: var(--text); border-color: var(--accent); }

.legal-section h2 { scroll-margin-top: 100px; }
.legal-section { scroll-margin-top: 100px; }

/* ---------- Invoice / payment page ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.status-pill.unpaid { background: rgba(251, 146, 60, 0.15); color: #fdba74; border: 1px solid rgba(251, 146, 60, 0.35); }
.status-pill.paid { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.35); }

.pdf-frame {
  width: 100%;
  height: 560px;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: #fff;
}

.sample-chip {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.sample-chip:hover { border-color: var(--accent); background: var(--surface-strong); }

#invoice-modal { background: rgba(4, 7, 13, 0.75); backdrop-filter: blur(6px); }

/* ---------- Chat assistant widget ---------- */
#chat-launcher {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gradient);
  color: #04070d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.6);
  z-index: 110;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -6px rgba(34, 211, 238, 0.55); }

#chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.75rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(600px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  z-index: 105;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}
#chat-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
@media (max-width: 639px) {
  #chat-panel {
    left: 1rem;
    right: 1rem;
    bottom: 5.5rem;
    width: auto;
    height: min(60vh, 460px);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}
#chat-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}
#chat-close:hover { color: var(--text); border-color: var(--accent); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.chat-msg-row { display: flex; }
.chat-msg-row.user { justify-content: flex-end; }
.chat-msg-row.bot { justify-content: flex-start; }
.chat-bubble {
  max-width: 84%;
  padding: 0.65rem 0.9rem;
  border-radius: 0.9rem;
  font-size: 0.87rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.bot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 0.25rem;
}
.chat-bubble.user {
  background: var(--gradient);
  color: #04070d;
  font-weight: 500;
  border-bottom-right-radius: 0.25rem;
}
.chat-typing { display: flex; gap: 4px; padding: 0.85rem 1rem; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  animation: chat-typing-bounce 1.1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chat-quick-reply {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chat-quick-reply:hover { border-color: var(--accent); background: var(--surface-strong); }

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  font-size: 0.87rem;
}
.chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.chat-input::placeholder { color: var(--text-faint); }
.chat-send {
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  border-radius: 0.7rem;
  background: var(--gradient);
  color: #04070d;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.chat-send:hover { transform: translateY(-1px); }

@media (max-width: 480px) {
  #chat-panel { right: 0.75rem; bottom: 5.5rem; }
  #chat-launcher { right: 1rem; bottom: 1rem; }
}
