:root {
  --axc-primary: #dd2b1c;
  --axc-primary-dark: #c12418;
  --axc-bg: #1a1b1c;
  --axc-bg-2: #232425;
  --axc-bg-3: #2a2b2c;
  --axc-border: rgba(255,255,255,0.08);
  --axc-border-hover: rgba(255,255,255,0.18);
  --axc-text: #f2f2f2;
  --axc-text-secondary: rgba(255,255,255,0.7);
  --axc-text-muted: rgba(255,255,255,0.45);
}

/* ====== Launcher ====== */
.axc-launcher {
  position: fixed !important;
  bottom: 95px !important; /* above scroll-to-top button */
  right: 24px !important;
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  background: var(--axc-primary) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(221,43,28,0.4) !important;
  z-index: 99998 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s !important;
  font-family: 'Barlow', -apple-system, sans-serif !important;
  padding: 0 !important;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 1 !important;
}
.axc-launcher:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(221,43,28,0.5); }
.axc-launcher.axc-hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* ====== Panel ====== */
.axc-panel {
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: var(--axc-bg);
  border: 1px solid var(--axc-border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Barlow', -apple-system, sans-serif;
  color: var(--axc-text);
}
.axc-panel.open { display: flex; animation: axcFadeIn 0.2s ease; }

@keyframes axcFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== Header ====== */
.axc-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--axc-primary) 0%, var(--axc-primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.axc-header-title { font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; font-size: 0.92rem; }
.axc-header-sub { font-size: 0.72rem; opacity: 0.85; margin-top: 2px; }
.axc-close {
  background: none; border: none; color: #fff;
  font-size: 24px; cursor: pointer; line-height: 1;
  padding: 4px 10px; border-radius: 4px; transition: background 0.15s;
}
.axc-close:hover { background: rgba(255,255,255,0.12); }

/* ====== Messages ====== */
.axc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--axc-bg);
}
.axc-messages::-webkit-scrollbar { width: 6px; }
.axc-messages::-webkit-scrollbar-thumb { background: var(--axc-border-hover); border-radius: 3px; }

.axc-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.axc-msg-user {
  align-self: flex-end;
  background: var(--axc-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.axc-msg-assistant {
  align-self: flex-start;
  background: var(--axc-bg-2);
  color: var(--axc-text);
  border: 1px solid var(--axc-border);
  border-bottom-left-radius: 4px;
}
.axc-msg a { color: #ff8577; text-decoration: underline; font-weight: 500; }
.axc-msg-user a { color: #fff; }
.axc-msg p { margin: 0 0 6px; }
.axc-msg p:last-child { margin-bottom: 0; }
.axc-msg ul, .axc-msg ol { margin: 6px 0; padding-left: 20px; }
.axc-msg strong { font-weight: 700; }

.axc-msg-cta {
  display: block;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--axc-primary);
  color: #fff !important;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none !important;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}
.axc-msg-cta:hover { background: var(--axc-primary-dark); }

/* ====== Typing indicator ====== */
.axc-typing { display: flex; gap: 4px; padding: 2px 2px; }
.axc-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--axc-text-muted);
  animation: axcBounce 1.2s infinite ease-in-out;
}
.axc-typing span:nth-child(2) { animation-delay: 0.15s; }
.axc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes axcBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* ====== Quick buttons (category tabs) ====== */
.axc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--axc-bg-2);
  border-top: 1px solid var(--axc-border);
  max-height: 160px;
  overflow-y: auto;
  flex-shrink: 0;
}
.axc-quick::-webkit-scrollbar { width: 4px; }
.axc-quick::-webkit-scrollbar-thumb { background: var(--axc-border-hover); border-radius: 2px; }

.axc-quick-btn {
  font-family: inherit;
  background: var(--axc-bg-3);
  border: 1px solid var(--axc-border);
  color: var(--axc-text);
  border-radius: 18px;
  padding: 7px 13px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.axc-quick-btn:hover {
  border-color: var(--axc-primary);
  background: rgba(221,43,28,0.12);
}
.axc-quick-sub {
  background: var(--axc-bg);
  font-size: 0.75rem;
  padding: 6px 12px;
}
.axc-quick-back {
  background: transparent;
  color: var(--axc-text-muted);
  font-style: italic;
}
.axc-quick-back:hover {
  color: var(--axc-text);
  border-color: var(--axc-border-hover);
  background: transparent;
}

/* ====== Input row ====== */
.axc-input-row {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-top: 1px solid var(--axc-border);
  background: var(--axc-bg-2);
  flex-shrink: 0;
}
.axc-panel .axc-input {
  flex: 1 !important;
  background: var(--axc-bg) !important;
  border: 1px solid var(--axc-border) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  color: var(--axc-text) !important;
  font-size: 0.88rem !important;
  outline: none !important;
  font-family: inherit !important;
  resize: none !important;
  max-height: 100px !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.axc-panel .axc-input:focus { border-color: var(--axc-primary) !important; }
.axc-panel .axc-input::placeholder { color: var(--axc-text-muted) !important; opacity: 1 !important; }

.axc-panel .axc-send {
  background: var(--axc-primary) !important;
  border: none !important;
  color: #000 !important;
  width: 40px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  transition: background 0.15s !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
.axc-panel .axc-send:hover:not(:disabled) { background: var(--axc-primary-dark) !important; }
.axc-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ====== Footer (powered by) ====== */
.axc-footer {
  padding: 6px 12px;
  background: var(--axc-bg-2);
  border-top: 1px solid var(--axc-border);
  text-align: center;
  font-size: 0.68rem;
  color: var(--axc-text-muted);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.axc-footer a {
  color: var(--axc-primary);
  text-decoration: none;
  font-weight: 600;
}
.axc-footer a:hover { text-decoration: underline; }

/* ====== Mobile ====== */
@media (max-width: 500px) {
  .axc-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .axc-launcher { bottom: 16px; right: 16px; width: 52px; height: 52px; font-size: 22px; }
}
