
:root {
  --bg-main: #070b16;
  --bg-panel: rgba(15, 23, 42, 0.88);
  --bg-card: rgba(30, 41, 59, 0.78);
  --border: rgba(148, 163, 184, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-2: #06b6d4;
  --success: #22c55e;
  --danger: #ef4444;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, Arial, sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.35), transparent 34%),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.18), transparent 32%),
    var(--bg-main);
}

button,
textarea,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.sidebar {
  width: 320px;
  padding: 22px;
  border-right: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.62);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 8px;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.35);
}

.brand h2 {
  font-size: 19px;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand p,
.sidebar-note,
.history-date {
  color: var(--text-muted);
}

.brand p {
  margin-top: 3px;
  font-size: 12px;
}

.status-card,
.sidebar-note {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.85);
  flex-shrink: 0;
}

.new-chat-btn,
.quick-btn,
.history-delete,
.clear-history-btn,
.copy-btn {
  border: none;
  transition: 0.2s ease;
}

.new-chat-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.22);
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.32);
}

.sidebar-section h3 {
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quick-btn {
  width: 100%;
  text-align: left;
  background: rgba(15, 23, 42, 0.82);
  color: #e5e7eb;
  padding: 12px 13px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border);
}

.quick-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(96, 165, 250, 0.45);
  transform: translateX(2px);
}

.sidebar-note {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.6;
  background: rgba(15, 23, 42, 0.5);
  box-shadow: none;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  transition: 0.2s ease;
}

.history-item:hover,
.history-item.active {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 41, 59, 0.95);
}

.history-title {
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.history-date {
  font-size: 11px;
  margin-top: 4px;
}

.history-delete {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
}

.history-delete:hover {
  background: rgba(239, 68, 68, 0.13);
  color: #fecaca;
}

.clear-history-btn,
.copy-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
}

.clear-history-btn:hover,
.copy-btn:hover {
  color: #bfdbfe;
}

/* =====================================================
   Chat Layout
===================================================== */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(circle at right, rgba(6, 182, 212, 0.07), transparent 38%);
}

.topbar {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(16px);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1 {
  font-size: 25px;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.topbar p {
  color: var(--text-muted);
  font-size: 14px;
}

.theme-toggle,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.theme-toggle {
  padding: 10px 14px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transition: 0.22s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 182, 212, 0.55);
  background: rgba(30, 41, 59, 0.95);
}

.badge {
  padding: 9px 12px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.13);
  border: 1px solid rgba(96, 165, 250, 0.24);
  font-size: 12px;
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scroll-behavior: smooth;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.chat-box::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  width: 7px;
}

.chat-box::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.hidden,
.meta-area,
.message-meta {
  display: none;
}

/* =====================================================
   Welcome + Suggestions
===================================================== */

.welcome-card,
.premium-welcome {
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.13), rgba(6, 182, 212, 0.07)),
    rgba(15, 23, 42, 0.76);
  box-shadow: var(--shadow);
}

.welcome-card {
  max-width: 760px;
  padding: 22px;
  border-radius: 24px;
}

.premium-welcome {
  max-width: 720px;
  margin: 34px auto 0;
  text-align: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(6, 182, 212, 0.07)),
    rgba(15, 23, 42, 0.78);
}

.premium-welcome::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.20), transparent 38%),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.16), transparent 38%);
  pointer-events: none;
}

.premium-welcome > * {
  position: relative;
  z-index: 1;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.welcome-card h2,
.premium-welcome h2 {
  color: #f8fafc;
  letter-spacing: -0.035em;
}

.welcome-card h2 {
  font-size: 21px;
  margin-bottom: 8px;
}

.premium-welcome h2 {
  font-size: 30px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.welcome-card p,
.premium-welcome p {
  color: #cbd5e1;
  line-height: 1.7;
}

.welcome-card p {
  font-size: 14px;
  margin-bottom: 16px;
}

.premium-welcome p {
  max-width: 560px;
  margin: 0 auto 22px;
  font-size: 15px;
}

.suggestions,
.premium-suggestions {
  display: grid;
  gap: 12px;
}

.suggestions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.premium-suggestions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.suggestion-chip,
.recommendation-chip {
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.42);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}

.suggestion-chip {
  padding: 11px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
}

.premium-suggestions .suggestion-chip {
  text-align: left;
  padding: 14px 15px;
  font-size: 14px;
}

.suggestion-chip:hover,
.recommendation-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.60);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

/* =====================================================
   Messages
===================================================== */

.message {
  display: flex;
  width: 100%;
  margin-bottom: 2px;
  animation: messageFadeUp 0.28s ease;
}

.message.user { justify-content: flex-end; }
.message.bot { justify-content: flex-start; }

.message-inner {
  display: flex;
  gap: 12px;
  max-width: min(860px, 88%);
  align-items: flex-start;
}

.message.user .message-inner {
  flex-direction: row-reverse;
}

.avatar,
.message.bot .avatar {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.message.user .avatar {
  display: none;
}

.bubble-wrap {
  min-width: 0;
}

.bubble,
.bubble p,
.bubble li,
.message.bot .bubble,
.message.user .bubble {
  font-size: 15px;
  line-height: 1.65;
}

.bubble {
  padding: 15px 18px;
  border-radius: 19px;
  white-space: normal;
  word-break: break-word;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.message.bot .bubble {
  max-width: 650px;
  background: rgba(15, 23, 42, 0.86);
  color: #e5e7eb;
  border-bottom-left-radius: 7px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.message.user .bubble {
  max-width: 540px;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  border-bottom-right-radius: 7px;
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.26);
}

.bubble p { margin-bottom: 10px; }
.bubble p:last-child { margin-bottom: 0; }

.bubble h1,
.bubble h2,
.bubble h3 {
  color: #f8fafc;
  font-size: 16px;
  line-height: 1.45;
  margin: 8px 0 6px;
  font-weight: 800;
}

.bubble strong {
  color: #f8fafc;
  font-weight: 800;
}

.bubble ul {
  padding-left: 20px;
  margin: 8px 0 10px;
}

.bubble li {
  margin-bottom: 5px;
}

.message.bot .bubble a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 700;
}

.message.bot .bubble a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #38bdf8;
  border-radius: 999px;
  display: inline-block;
  animation: pulse 1s infinite ease-in-out;
}

.typing-dot:nth-child(2),
.typing-dot:nth-of-type(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3),
.typing-dot:nth-of-type(3) { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

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

/* =====================================================
   Panels, Sources, Cards
===================================================== */

.panel,
.recommendation-box,
.lead-cta-box,
.lead-form-box,
.plans-box,
.payment-card,
.assistant-builder-box,
.assistant-result-box {
  max-width: 680px;
  margin-left: 46px;
  margin-top: -8px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.06)),
    rgba(15, 23, 42, 0.88);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  animation: fadeUp 0.25s ease;
}

.panel {
  max-width: 720px;
  margin-top: 0;
  padding: 12px 15px;
}

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

.panel h4,
.bubble .source-title {
  color: #dbeafe;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 800;
}

.panel ul { list-style: none; padding-left: 0; }

.panel li {
  margin-bottom: 7px;
  font-size: 12px;
  line-height: 1.5;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.28);
}

.panel a,
.bubble .source-link {
  color: #60a5fa;
  text-decoration: none;
  word-break: break-all;
}

.panel a:hover,
.bubble .source-link:hover {
  text-decoration: underline;
}

.bubble .source-list {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.bubble .source-link {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.28);
}

.recommendation-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
}

.recommendation-title {
  width: 100%;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.recommendation-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  border-color: rgba(96, 165, 250, 0.35);
}

/* =====================================================
   Forms, CTAs, Payments, Plans
===================================================== */

.lead-cta-title,
.lead-form-title,
.plans-title,
.payment-title {
  color: #f8fafc;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.lead-cta-text,
.plans-text,
.payment-text {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.lead-cta-actions,
.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lead-form-box,
.assistant-builder-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-form-box input,
.lead-form-box textarea,
.assistant-builder-box input,
.assistant-builder-box textarea,
.assistant-builder-box select,
.assistant-result-box textarea {
  width: 100%;
  margin-top: 0;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.38);
  color: #f8fafc;
  font-size: 13px;
  outline: none;
}

.assistant-builder-box input,
.assistant-builder-box textarea,
.assistant-builder-box select,
.assistant-result-box textarea {
  margin-top: 9px;
}

.lead-form-box textarea,
.assistant-builder-box textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.5;
}

.lead-form-box input::placeholder,
.lead-form-box textarea::placeholder,
.assistant-builder-box input::placeholder,
.assistant-builder-box textarea::placeholder {
  color: #94a3b8;
}

.lead-form-box input:focus,
.lead-form-box textarea:focus,
.assistant-builder-box input:focus,
.assistant-builder-box textarea:focus,
.assistant-builder-box select:focus {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.lead-primary-btn,
.lead-secondary-btn,
#submitLeadBtn,
.payment-primary-btn,
.payment-secondary-btn,
.plan-select-btn,
.assistant-builder-box button,
.assistant-result-box button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.lead-primary-btn,
#submitLeadBtn,
.payment-primary-btn,
.plan-select-btn,
.assistant-builder-box button,
.assistant-result-box button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.26);
}

.lead-primary-btn:hover,
#submitLeadBtn:hover,
.payment-primary-btn:hover,
.plan-select-btn:hover,
.assistant-builder-box button:hover,
.assistant-result-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.36);
}

.lead-secondary-btn,
.payment-secondary-btn {
  background: rgba(2, 6, 23, 0.45);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.lead-secondary-btn:hover,
.payment-secondary-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
}

.plan-select-btn:disabled,
.lead-primary-btn:disabled,
.lead-secondary-btn:disabled,
.payment-primary-btn:disabled,
.payment-secondary-btn:disabled,
#submitLeadBtn:disabled,
.chat-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lead-primary-btn:focus,
.lead-secondary-btn:focus,
.plan-select-btn:focus,
.payment-primary-btn:focus,
.payment-secondary-btn:focus,
#submitLeadBtn:focus {
  outline: 2px solid rgba(96, 165, 250, 0.6);
  outline-offset: 2px;
}

.plans-box { max-width: 720px; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-card {
  position: relative;
  padding: 15px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.38);
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.plan-card:hover,
.plan-card.featured {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(15, 23, 42, 0.72);
}

.plan-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}

.plan-name {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 900;
}

.plan-price {
  margin: 8px 0;
  color: #93c5fd;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.plan-desc {
  min-height: 58px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}

.plan-select-btn {
  width: 100%;
  margin-top: 12px;
  border-radius: 13px;
  white-space: nowrap;
}

.payment-card {
  border-color: rgba(34, 197, 94, 0.28);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(6, 182, 212, 0.05)),
    rgba(15, 23, 42, 0.88);
}

.payment-amount {
  margin: 4px 0 14px;
  color: var(--success);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.payment-methods label {
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
}

.stripe-pay-btn {
  background: #635bff !important;
  color: #fff !important;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.28) !important;
}

.assistant-result-box textarea {
  min-height: 90px;
  color: var(--success);
  font-size: 12px;
}

/* API key section + custom toggle */
.api-key-card {
  margin: 10px 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.4);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.custom-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
}

.custom-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  transition: 0.25s;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 2.5px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.custom-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.custom-toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.api-input {
  display: flex;
  gap: 6px;
}

.api-input input { flex: 1; }
.api-input button { min-width: 58px; }

.note {
  margin-top: 6px;
  font-size: 12px;
  color: #a7f3d0;
}


.chat-form-wrap {
  padding: 18px 28px 24px;
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(16px);
}

.chat-form {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 840px;
  margin: 0 auto;
  padding: 10px 12px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28), 0 0 0 4px rgba(255, 255, 255, 0.08);
  transition: 0.22s ease;
}

.chat-form:focus-within {
  border-color: rgba(14, 165, 233, 0.75);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.34), 0 0 0 5px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

.chat-form textarea {
  flex: 1;
  min-height: 42px;
  max-height: 130px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 4px;
  box-shadow: none;
  overflow-y: auto;
}

.chat-form textarea::placeholder {
  color: #64748b;
}

.chat-form button {
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
  min-width: 46px;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
  transition: 0.2s ease;
}

.chat-form button:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 16px 42px rgba(37, 99, 235, 0.38);
}

.form-hint {
  max-width: 980px;
  margin: 10px auto 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}


body[data-theme="light"] {
  --bg-main: #f4f7fb;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-card: rgba(255, 255, 255, 0.9);
  --border: rgba(15, 23, 42, 0.12);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.12), transparent 32%),
    var(--bg-main);
}

body[data-theme="light"] .sidebar,
body[data-theme="light"] .topbar,
body[data-theme="light"] .chat-form-wrap {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(15, 23, 42, 0.10);
}

body[data-theme="light"] .chat-area {
  background: radial-gradient(circle at right, rgba(37, 99, 235, 0.08), transparent 38%);
}

body[data-theme="light"] .brand h2,
body[data-theme="light"] .topbar h1,
body[data-theme="light"] .premium-welcome h2,
body[data-theme="light"] .lead-cta-title,
body[data-theme="light"] .lead-form-title,
body[data-theme="light"] .plans-title,
body[data-theme="light"] .payment-title,
body[data-theme="light"] .plan-name,
body[data-theme="light"] .bubble h1,
body[data-theme="light"] .bubble h2,
body[data-theme="light"] .bubble h3,
body[data-theme="light"] .message.bot .bubble strong {
  color: #0f172a;
}

body[data-theme="light"] .brand p,
body[data-theme="light"] .topbar p,
body[data-theme="light"] .premium-welcome p,
body[data-theme="light"] .form-hint,
body[data-theme="light"] .history-date,
body[data-theme="light"] .lead-cta-text,
body[data-theme="light"] .plans-text,
body[data-theme="light"] .payment-text,
body[data-theme="light"] .plan-desc,
body[data-theme="light"] .payment-methods label {
  color: #475569;
}

body[data-theme="light"] .sidebar-section h3,
body[data-theme="light"] .recommendation-title {
  color: #64748b;
}

body[data-theme="light"] .quick-btn,
body[data-theme="light"] .history-item,
body[data-theme="light"] .suggestion-chip,
body[data-theme="light"] .recommendation-chip,
body[data-theme="light"] .plan-card,
body[data-theme="light"] .lead-secondary-btn,
body[data-theme="light"] .payment-secondary-btn,
body[data-theme="light"] .theme-toggle {
  background: #fff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .quick-btn:hover,
body[data-theme="light"] .history-item:hover,
body[data-theme="light"] .history-item.active,
body[data-theme="light"] .suggestion-chip:hover,
body[data-theme="light"] .recommendation-chip:hover,
body[data-theme="light"] .plan-card:hover,
body[data-theme="light"] .plan-card.featured {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.36);
}

body[data-theme="light"] .history-title {
  color: #0f172a;
}

body[data-theme="light"] .premium-welcome,
body[data-theme="light"] .welcome-card,
body[data-theme="light"] .message.bot .bubble,
body[data-theme="light"] .panel,
body[data-theme="light"] .recommendation-box,
body[data-theme="light"] .lead-cta-box,
body[data-theme="light"] .lead-form-box,
body[data-theme="light"] .plans-box,
body[data-theme="light"] .payment-card,
body[data-theme="light"] .assistant-builder-box,
body[data-theme="light"] .assistant-result-box {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.04)),
    rgba(255, 255, 255, 0.96);
  color: #1e293b;
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .welcome-badge {
  background: #0f172a;
  color: #fff;
  border-color: rgba(15, 23, 42, 0.22);
}

body[data-theme="light"] .lead-form-box input,
body[data-theme="light"] .lead-form-box textarea,
body[data-theme="light"] .assistant-builder-box input,
body[data-theme="light"] .assistant-builder-box textarea,
body[data-theme="light"] .assistant-builder-box select,
body[data-theme="light"] .assistant-result-box textarea {
  background: #fff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.14);
}

body[data-theme="light"] .chat-form {
  background: #050816;
  border-color: rgba(37, 99, 235, 0.35);
}

body[data-theme="light"] .chat-form textarea {
  color: #fff;
}

body[data-theme="light"] .chat-form textarea::placeholder {
  color: #94a3b8;
}

body[data-theme="light"] .typing {
  color: #334155;
}


@media (max-width: 900px) {
  body { overflow: hidden; }

  .sidebar { display: none; }

  .topbar { padding: 18px 16px; }

  .topbar-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .badge,
  #themeText { display: none; }

  .topbar h1 { font-size: 21px; }

  .chat-box {
    max-width: 100%;
    padding: 16px;
    gap: 16px;
  }

  .message-inner { max-width: 92%; }

  .message.bot .bubble,
  .message.user .bubble { max-width: 100%; }

  .premium-welcome {
    margin-top: 18px;
    padding: 24px;
  }

  .premium-welcome h2 { font-size: 26px; }

  .suggestions,
  .premium-suggestions,
  .plans-grid { grid-template-columns: 1fr; }

  .recommendation-box,
  .lead-cta-box,
  .lead-form-box,
  .plans-box,
  .payment-card,
  .assistant-builder-box,
  .assistant-result-box {
    margin-left: 46px;
    max-width: calc(100% - 46px);
  }

  .payment-actions,
  .lead-cta-actions { flex-direction: column; }

  .payment-primary-btn,
  .payment-secondary-btn,
  .lead-primary-btn,
  .lead-secondary-btn,
  #submitLeadBtn { width: 100%; }

  .chat-form-wrap { padding: 14px 16px 16px; }

  .chat-form {
    padding: 8px;
    gap: 7px;
    border-radius: 24px;
  }

  .chat-form textarea {
    min-height: 40px;
    padding: 9px 2px;
  }

  .chat-form button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .topbar { padding: 16px 14px; }
  .topbar h1 { font-size: 20px; }

  .chat-box { padding: 14px; }
  .message-inner { max-width: 100%; }
  .message.bot .avatar { display: none; }

  .recommendation-box,
  .lead-cta-box,
  .lead-form-box,
  .plans-box,
  .payment-card,
  .assistant-builder-box,
  .assistant-result-box {
    margin-left: 0;
    max-width: 100%;
  }

  .premium-welcome {
    margin-top: 10px;
    padding: 18px;
  }

  .premium-welcome h2 { font-size: 21px; }
  .suggestion-chip { padding: 12px; }
}
.assistant-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.assistant-result-actions button {
  flex: 1;
}

@media (max-width: 600px) {
  .assistant-result-actions {
    flex-direction: column;
  }
}
.model-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.model-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(2,6,23,.38);
  cursor: pointer;
  transition: 0.2s ease;
}

.model-card input {
  display: none;
}

.model-card strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
  margin-bottom: 4px;
}

.model-card span {
  color: #94a3b8;
  font-size: 12px;
}

.model-card:has(input:checked),
.model-card:hover {
  border-color: rgba(96,165,250,.65);
  background: rgba(37,99,235,.18);
}

.build-progress {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(2,6,23,.35);
  border: 1px solid rgba(148,163,184,.16);
}

.progress-step {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 7px;
}

.progress-step.active {
  color: #93c5fd;
  font-weight: 800;
}

.progress-step.done {
  color: #22c55e;
}

.progress-step.done::before {
  content: "✓ ";
}

.assistant-info-card {
  margin: 10px 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(2,6,23,.35);
  border: 1px solid rgba(148,163,184,.16);
}

.assistant-info-card span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 4px;
}

.assistant-info-card strong,
.assistant-info-card a {
  color: #bfdbfe;
  font-size: 13px;
  word-break: break-all;
  text-decoration: none;
}

.widget-code-box {
  width: 100%;
  min-height: 96px;
  margin-top: 10px;
}

.assistant-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.assistant-result-actions button {
  flex: 1;
}

@media (max-width: 600px) {
  .model-card-grid {
    grid-template-columns: 1fr;
  }

  .assistant-result-actions {
    flex-direction: column;
  }
}

body[data-theme="light"] .model-card strong {
  color: #0f172a;
}

body[data-theme="light"] .model-card span {
  color: #64748b;
}

body[data-theme="light"] .build-progress,
body[data-theme="light"] .assistant-info-card,
body[data-theme="light"] .api-key-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 23, 42, 0.12);
}
@media (max-width: 480px) {
  .api-input {
    flex-direction: column;
  }

  .api-input button {
    width: 100%;
    padding: 10px;
  }
}