/* ============================================================
   Skairova AI Assistant — chatbot bubble + insight banner
   ============================================================ */

/* ── Base font override — match app's Plus Jakarta Sans ── */
.ai-insight-banner,
.ai-chat-bubble-wrap,
.ai-filter-group {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ================================================================
   AI INSIGHT BANNER — dark-mode default, slim card
   ================================================================ */
@keyframes ai-banner-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.8); }
}

/* ── Outer wrapper — controls show/hide, holds badge outside overflow ── */
.ai-insight-outer {
  display: none;
  position: relative;
  margin: 0 0 30px;
}
.ai-insight-outer.is-visible { display: block; }

/* ── Base (dark mode — app default) ── */
.ai-insight-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #14112e;
  border: 1px solid rgba(99,102,241,0.22);
  border-radius: 20px;
  padding: 16px 18px 20px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  animation: ai-banner-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-insight-banner::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #7c3aed 40%, #6366f1 60%, transparent 100%);
  pointer-events: none;
}

/* ── Decorative boarding-pass illustration ── */
.ai-insight-deco {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 160px;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.ai-insight-deco svg { display: block; }

/* ── Avatar circle ── */
.ai-insight-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(109,40,217,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.ai-insight-avatar svg { width: 26px; height: 26px; fill: #a78bfa; }

/* ── Content body ── */
.ai-insight-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  padding-right: 155px;
}

.ai-insight-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ai-insight-label-star {
  color: #a5b4fc;
  flex-shrink: 0;
  animation: ai-pulse 2.4s ease-in-out infinite;
}

.ai-insight-text {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
  margin: 0;
  letter-spacing: -0.01em;
}
.ai-insight-text.is-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.38);
  font-size: 13.5px;
  font-weight: 400;
}
.ai-insight-headline {
  display: block;
  font-size: 16.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  line-height: 1.4;
  margin-bottom: 5px;
  letter-spacing: -0.015em;
}
.ai-insight-detail {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,0.48);
  line-height: 1.55;
}

.ai-insight-price { color: #a5b4fc; font-weight: 700; }

.ai-insight-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(139,92,246,0.25);
  border-top-color: #a5b4fc;
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Close button ── */
.ai-insight-dismiss {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ai-insight-dismiss:hover {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
}

/* ── Bottom sparkle badge — child of outer wrapper, sits below banner ── */
.ai-insight-badge {
  position: absolute;
  bottom: -14px; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.5);
  z-index: 2;
}

/* ── SVG notch circles — must match card background per theme ── */
.ai-insight-notch { fill: #14112e; }
html[data-theme="light"] .ai-insight-notch { fill: #ffffff; }

/* ── Light mode overrides ── */
html[data-theme="light"] .ai-insight-banner {
  background: #ffffff;
  border-color: rgba(99,102,241,0.12);
  box-shadow: 0 4px 24px rgba(99,102,241,0.1), 0 1px 4px rgba(0,0,0,0.06);
}
html[data-theme="light"] .ai-insight-avatar { background: #ede9fe; }
html[data-theme="light"] .ai-insight-avatar svg { fill: #6d28d9; }
html[data-theme="light"] .ai-insight-label { color: #6366f1; }
html[data-theme="light"] .ai-insight-label-star { color: #6366f1; }
html[data-theme="light"] .ai-insight-text { color: #0f172a; }
html[data-theme="light"] .ai-insight-text.is-loading { color: #94a3b8; }
html[data-theme="light"] .ai-insight-headline { color: #0f172a; }
html[data-theme="light"] .ai-insight-detail { color: #64748b; }
html[data-theme="light"] .ai-insight-price { color: #6366f1; }
html[data-theme="light"] .ai-insight-spinner {
  border-color: #e0e7ff;
  border-top-color: #6366f1;
}
html[data-theme="light"] .ai-insight-dismiss {
  background: #f1f5f9;
  color: #64748b;
}
html[data-theme="light"] .ai-insight-dismiss:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Responsive: hide illustration on narrow screens ── */
@media (max-width: 540px) {
  .ai-insight-deco { display: none; }
  .ai-insight-body { padding-right: 0; }
  .ai-insight-banner { padding: 14px 14px 18px 14px; }
}

/* ── AI Natural Language Filter — pill bar ── */
.ai-filter-group {
  max-width: 88%;
  margin: 14px auto 14px;
}
.ai-filter-pill-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  background: color-mix(in srgb, var(--color-accent, #6366f1) 6%, var(--color-surface, #1a1830));
  border: 1.5px solid color-mix(in srgb, var(--color-accent, #6366f1) 28%, transparent);
  border-radius: 999px;
  padding: 0 5px 0 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-filter-pill-bar:focus-within {
  border-color: var(--color-accent, #6366f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, #6366f1) 14%, transparent);
}
.ai-filter-pill-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--color-accent, #6366f1);
}
.ai-filter-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--color-text, #fff);
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1;
}
.ai-filter-input:focus,
.ai-filter-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}
.ai-filter-input::placeholder {
  color: var(--color-muted, #777);
}
.ai-filter-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent, #6366f1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  margin: 0;
  padding: 0;
}
.ai-filter-btn:hover  { background: color-mix(in srgb, var(--color-accent, #6366f1) 82%, #000); }
.ai-filter-btn:active { transform: scale(0.88); }
.ai-filter-btn svg    { width: 13px; height: 13px; display: block; }
.ai-filter-btn.is-loading { opacity: 0.7; cursor: wait; }
.ai-filter-status {
  font-size: 11px;
  color: var(--color-muted, #888);
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}
.ai-filter-status:empty { display: none; }
.ai-filter-status.is-success { color: #16a34a; }
.ai-filter-status.is-error   { color: #dc2626; }
.ai-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.ai-filter-chip {
  padding: 4px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--color-accent, #6366f1) 11%, transparent);
  color: var(--color-accent, #6366f1);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--color-accent, #6366f1) 24%, transparent);
  transition: background 0.15s;
  line-height: 1.4;
}
.ai-filter-chip:hover {
  background: color-mix(in srgb, var(--color-accent, #6366f1) 20%, transparent);
}

/* ================================================================
   AI CHATBOT BUBBLE
   ================================================================
   One consolidated definition (this used to be three stacked,
   contradictory redesigns — the last of which hid the greeting
   and quick-replies via display:none and force-rendered dark even
   though theme_init.html always sets data-theme="light" sitewide).
   Base rules below match that dark styling (kept only because dark
   mode is flagged in theme_init.html as "temporarily disabled,
   restore later", same convention every other component follows);
   the html[data-theme="light"] block is what actually renders today
   and must stay visually complete on its own.
   ================================================================ */
.ai-chat-bubble-wrap,
.ai-chat-bubble-wrap * {
  box-sizing: border-box;
}
.ai-chat-bubble-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Floating trigger button */
.ai-chat-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45), 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(.22, 1, .36, 1), box-shadow 0.18s ease;
  position: relative;
}
@media (hover: hover) and (pointer: fine) {
  .ai-chat-trigger:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55), 0 3px 12px rgba(0,0,0,0.2);
  }
}
.ai-chat-trigger:active { transform: scale(0.96); }
.ai-chat-trigger svg { width: 24px; height: 24px; }
.ai-chat-trigger-icon-chat,
.ai-chat-trigger-icon-close { transition: opacity 0.2s, transform 0.2s; }
.ai-chat-trigger-icon-close { position: absolute; opacity: 0; transform: rotate(-90deg) scale(0.7); }
.ai-chat-is-open .ai-chat-trigger-icon-chat  { opacity: 0; transform: rotate(90deg) scale(0.7); }
.ai-chat-is-open .ai-chat-trigger-icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

/* Unread badge */
.ai-chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ai-badge-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes ai-badge-in {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* Chat panel — CLOSED by default, opened via .is-open.
   `height` (not just max-height) so the window keeps a consistent,
   roomy presence regardless of how many messages are in it. */
.ai-chat-panel {
  display: none; /* hidden by default — JS sets display:flex on open */
  width: min(400px, calc(100vw - 32px));
  height: min(608px, calc(100dvh - 112px));
  background: #0f0f1c;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 6px 20px rgba(0,0,0,0.1);
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
}
/* Override the HTML hidden attribute — CSS wins, so we must be explicit */
.ai-chat-panel[hidden] {
  display: none !important;
}
.ai-chat-panel.is-open {
  display: flex;
  animation: ai-panel-open 0.22s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes ai-panel-open {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ai-chat-panel.is-closing {
  display: flex;
  animation: ai-panel-close 0.16s ease-in both;
}
@keyframes ai-panel-close {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.92) translateY(8px); }
}

/* Panel header */
.ai-chat-header {
  padding: 14px 14px 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  background: linear-gradient(135deg, rgba(99,102,241,0.14) 0%, #0f0f1c 100%);
  flex-shrink: 0;
}
.ai-chat-header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
  flex-shrink: 0;
}
.ai-chat-header-avatar svg { width: 18px; height: 18px; fill: #fff; }
.ai-chat-header-info { flex: 1; min-width: 0; }
.ai-chat-header-name {
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  line-height: 1.25;
  font-family: inherit;
}
.ai-chat-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ai-chat-header-model {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  font-family: inherit;
}
.ai-chat-header-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,0.35);
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
  .ai-chat-header-close:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
  }
}
.ai-chat-header-close svg { width: 16px; height: 16px; }

/* ── Focus bar — shows which flight is being discussed ── */
.ai-chat-focus-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(139,92,246,0.08));
  border-bottom: 1px solid rgba(99,102,241,0.2);
  font-size: 11.5px;
  font-family: inherit;
  flex-shrink: 0;
  min-height: 36px;
}
.ai-chat-focus-bar.is-selected {
  background: linear-gradient(90deg, rgba(22,163,74,0.15), rgba(22,163,74,0.06));
  border-bottom-color: rgba(22,163,74,0.22);
}
.ai-chat-focus-label {
  flex: 1;
  font-weight: 600;
  color: #a5b4fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}
.ai-chat-focus-bar.is-selected .ai-chat-focus-label { color: #4ade80; }
.ai-chat-focus-clear {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  border-radius: 5px;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}
.ai-chat-focus-clear:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08);
}

/* Messages area */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #0f0f1c;
}
.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* System / context messages */
.ai-system-msg {
  font-size: 11px;
  font-family: inherit;
  color: #a5b4fc;
  text-align: center;
  padding: 4px 12px;
  background: rgba(99,102,241,0.12);
  border-radius: 20px;
  align-self: center;
  font-weight: 600;
  letter-spacing: 0.01em;
  animation: ai-msg-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Message bubbles */
.ai-msg {
  display: flex;
  gap: 8px;
  max-width: 100%;
  animation: ai-msg-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ai-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-msg--user { flex-direction: row-reverse; }
.ai-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
}
.ai-msg-avatar svg { width: 13px; height: 13px; fill: none; stroke: #bab8ff; stroke-width: 1.8; }
.ai-msg-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  word-break: break-word;
}
.ai-msg--ai .ai-msg-bubble {
  width: fit-content;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  border-bottom-left-radius: 4px;
}
.ai-msg--user .ai-msg-bubble {
  width: fit-content;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

/* Typing indicator */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  animation: ai-typing 1.2s ease-in-out infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-typing {
  0%, 80%, 100% { transform: scale(1); opacity: 0.5; }
  40%            { transform: scale(1.25); opacity: 1; }
}

/* Quick reply chips */
.ai-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.ai-quick-reply {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.1);
  color: #a5b4fc;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .ai-quick-reply:hover {
    background: rgba(99,102,241,0.2);
    transform: translateY(-1px);
  }
}

/* Footer / composer */
.ai-chat-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px 14px 12px;
  flex-shrink: 0;
  background: #0f0f1c;
}
.ai-chat-composer-shell {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-chat-composer-shell:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
  background: rgba(255,255,255,0.07);
}
.ai-chat-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 6px 6px 12px;
}
.ai-chat-input-wrap { flex: 1; min-width: 0; position: relative; }
.ai-chat-input {
  width: 100%;
  resize: none;
  border: none;
  padding: 8px 26px 8px 0;
  font-size: 13px;
  font-family: inherit;
  color: rgba(255,255,255,0.88);
  background: transparent;
  outline: none;
  line-height: 1.45;
  max-height: 90px;
  min-height: 36px;
  overflow-y: auto;
  display: block;
}
.ai-chat-input::placeholder { color: rgba(255,255,255,0.3); }
.ai-chat-char-count {
  position: absolute;
  bottom: 2px;
  right: 0;
  font-size: 9px;
  font-family: inherit;
  color: rgba(255,255,255,0.2);
  pointer-events: none;
  transition: color 0.15s;
}
.ai-chat-char-count.is-near-limit { color: #f59e0b; }
.ai-chat-char-count.is-at-limit   { color: #ef4444; }
.ai-chat-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
@media (hover: hover) and (pointer: fine) {
  .ai-chat-send:hover  { transform: scale(1.08); box-shadow: 0 3px 12px rgba(99,102,241,0.4); }
}
.ai-chat-send:active { transform: scale(0.95); }
.ai-chat-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.ai-chat-send svg { width: 15px; height: 15px; }

.ai-chat-composer-controls {
  display: flex;
  align-items: center;
  padding: 0 6px 6px 12px;
}
.ai-chat-model-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 5px;
  color: rgba(255,255,255,0.55);
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .ai-chat-model-trigger:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
}
.ai-chat-model-mark { display: inline-flex; color: #a5b4fc; }
.ai-chat-model-mark svg { width: 13px; height: 13px; }
.ai-chat-model-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat-chevron { width: 12px; height: 12px; color: rgba(255,255,255,0.35); transition: transform 0.18s ease; }
.ai-chat-model-trigger[aria-expanded="true"] .ai-chat-chevron { transform: rotate(180deg); }

.ai-chat-footer-note {
  padding: 8px 4px 0;
  font-size: 9.5px;
  font-family: inherit;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

/* Reasoning-style menu (Brief / Balanced / Detailed) */
.ai-chat-model-menu {
  position: absolute;
  z-index: 3;
  right: 0;
  left: auto;
  bottom: calc(100% + 10px);
  width: min(280px, calc(100vw - 48px));
  padding: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: #171a28;
  box-shadow: 0 20px 52px rgba(1, 3, 12, 0.5), 0 4px 12px rgba(1, 3, 12, 0.26);
  overflow: hidden;
}
.ai-chat-model-menu[hidden] { display: none !important; }
.ai-chat-model-detail { padding: 14px; }
.ai-chat-model-detail-title { color: rgba(255,255,255,0.92); font-size: 12.5px; font-weight: 750; margin-bottom: 8px; }
.ai-chat-model-detail p { margin: 8px 0; color: rgba(255,255,255,0.6); font-size: 10.5px; line-height: 1.55; }
.ai-chat-detail-row { display: flex; justify-content: space-between; padding: 2px 0; color: rgba(255,255,255,0.45); font-size: 10px; }
.ai-chat-detail-row strong { color: rgba(255,255,255,0.85); font-weight: 700; }
.ai-chat-reasoning-head { display: flex; justify-content: space-between; margin: 12px 0 7px; color: rgba(255,255,255,0.45); font-size: 9px; font-weight: 750; letter-spacing: .07em; }
.ai-chat-reasoning-head strong { color: rgba(255,255,255,0.85); font-size: 9px; letter-spacing: 0; }
.ai-chat-reasoning-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ai-chat-reasoning-meter i { height: 5px; border-radius: 4px; background: rgba(255,255,255,0.12); }
.ai-chat-reasoning-meter i:nth-child(-n+3) { background: #a5b4fc; }
.ai-chat-reasoning { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; margin-top: 9px; border-radius: 9px; background: rgba(255,255,255,0.05); }
.ai-chat-reasoning-option { padding: 6px 2px; border: 0; border-radius: 6px; color: rgba(255,255,255,0.45); background: transparent; cursor: pointer; font: 700 9.5px inherit; }
.ai-chat-reasoning-option.is-selected { color: #fff; background: rgba(255,255,255,0.12); }
.ai-chat-reasoning-copy { margin: 9px 0 0; color: rgba(255,255,255,0.4); font-size: 10px; line-height: 1.5; }

/* ================================================================
   LIGHT MODE — html[data-theme="light"] (always active today; see
   theme_init.html, which force-sets this attribute site-wide).
   ================================================================ */
html[data-theme="light"] .ai-chat-panel {
  background: #ffffff;
  border-color: #e5e7eb;
}
html[data-theme="light"] .ai-chat-header {
  background: linear-gradient(135deg, #f7f7ff 0%, #ffffff 100%);
  border-bottom-color: #f0f0f0;
}
html[data-theme="light"] .ai-chat-header-name { color: #17233a; }
html[data-theme="light"] .ai-chat-header-model { color: #8a93a8; }
html[data-theme="light"] .ai-chat-header-close { color: #98a2b3; }
html[data-theme="light"] .ai-chat-header-close:hover { color: #17233a; background: #eef1f7; }

html[data-theme="light"] .ai-chat-focus-bar {
  background: linear-gradient(90deg, #f4f3ff, #faf9ff);
  border-bottom-color: #dedbff;
}
html[data-theme="light"] .ai-chat-focus-bar.is-selected {
  background: linear-gradient(90deg, rgba(22,163,74,0.08), rgba(22,163,74,0.03));
  border-bottom-color: rgba(22,163,74,0.18);
}
html[data-theme="light"] .ai-chat-focus-label { color: #5147d8; }
html[data-theme="light"] .ai-chat-focus-clear { color: #5b50db; }
html[data-theme="light"] .ai-chat-focus-clear:hover { color: #4036c8; background: #e8e6ff; }

html[data-theme="light"] .ai-chat-messages { background: #ffffff; }
html[data-theme="light"] .ai-chat-messages::-webkit-scrollbar-thumb { background: #d7dce7; }

html[data-theme="light"] .ai-system-msg { color: #574ad8; background: #f2f1ff; }

html[data-theme="light"] .ai-msg-avatar { background: #f2f4f8; }
html[data-theme="light"] .ai-msg-avatar svg { stroke: #5b50df; }
html[data-theme="light"] .ai-msg--ai .ai-msg-bubble { background: #f2f4f8; color: #26334a; }

html[data-theme="light"] .ai-typing-indicator { background: #f2f4f8; }
html[data-theme="light"] .ai-typing-dot { background: #9aa3b5; }

html[data-theme="light"] .ai-quick-reply {
  border-color: #dddffc;
  background: #fafaff;
  color: #5148c8;
}
html[data-theme="light"] .ai-quick-reply:hover { background: #f1f0ff; border-color: #cfcaff; }

html[data-theme="light"] .ai-chat-footer { background: #ffffff; border-top-color: #edf0f5; }
html[data-theme="light"] .ai-chat-composer-shell { border-color: #d6dce7; background: #fafbfd; }
html[data-theme="light"] .ai-chat-composer-shell:focus-within {
  border-color: #d6dce7;
  box-shadow: none;
  background: #ffffff;
}
/* The chat composer is a single surface.  Sitewide field focus rules must
   not create a second purple rectangle around the textarea inside it. */
html[data-theme="light"] textarea.ai-chat-input,
html[data-theme="light"] textarea.ai-chat-input:focus,
html[data-theme="light"] textarea.ai-chat-input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
html[data-theme="light"] .ai-chat-input { color: #1d2a40; }
html[data-theme="light"] .ai-chat-input::placeholder { color: #909bae; }
html[data-theme="light"] .ai-chat-char-count { color: #9da7b7; }
html[data-theme="light"] .ai-chat-model-trigger { color: #63718a; }
html[data-theme="light"] .ai-chat-model-trigger:hover { background: #f3f4fb; color: #17233a; }
html[data-theme="light"] .ai-chat-model-mark { color: #5b50df; }
html[data-theme="light"] .ai-chat-chevron { color: #97a1b3; }
html[data-theme="light"] .ai-chat-footer-note { color: #b0b7c4; }

html[data-theme="light"] .ai-chat-model-menu {
  background: #ffffff;
  border-color: #dbe1eb;
  box-shadow: 0 19px 46px rgba(15,23,42,0.17), 0 4px 12px rgba(15,23,42,0.08);
}
html[data-theme="light"] .ai-chat-model-detail-title { color: #17233a; }
html[data-theme="light"] .ai-chat-model-detail p { color: #63718a; }
html[data-theme="light"] .ai-chat-detail-row { color: #7d889a; }
html[data-theme="light"] .ai-chat-detail-row strong { color: #39465d; }
html[data-theme="light"] .ai-chat-reasoning-head { color: #7d889a; }
html[data-theme="light"] .ai-chat-reasoning-head strong { color: #17233a; }
html[data-theme="light"] .ai-chat-reasoning-meter i { background: #edf0f6; }
html[data-theme="light"] .ai-chat-reasoning-meter i:nth-child(-n+3) { background: #6366f1; }
html[data-theme="light"] .ai-chat-reasoning { background: #edf0f6; }
html[data-theme="light"] .ai-chat-reasoning-option { color: #718097; }
html[data-theme="light"] .ai-chat-reasoning-option.is-selected { color: #4238c5; background: #ffffff; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
html[data-theme="light"] .ai-chat-reasoning-copy { color: #78849a; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .ai-chat-bubble-wrap { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .ai-chat-panel {
    width: calc(100vw - 28px);
    height: min(608px, calc(100dvh - 92px));
    border-radius: 20px;
  }
  .ai-chat-header { padding: 12px 12px 11px 14px; }
  .ai-chat-messages { padding: 14px; }
  .ai-quick-replies { padding: 0 14px 11px; }
  .ai-chat-footer { padding: 8px 10px 10px; }
  .ai-chat-model-menu { width: min(280px, calc(100vw - 28px)); }
  .ai-chat-header-close { width:44px; height:44px; margin:-8px -8px -8px 0; }
  .ai-chat-send { width:44px; height:44px; }
  .ai-chat-model-trigger { min-height:36px; padding-inline:9px; }
  .ai-quick-reply { min-height:36px; padding-inline:13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-chat-trigger,
  .ai-chat-panel,
  .ai-chat-trigger-icon-chat,
  .ai-chat-trigger-icon-close,
  .ai-chat-badge {
    animation: none !important;
    transition: none !important;
  }
}
