/* ---- 柴郡 AI 聊天扩展组件 ---- */
#ai-chat-launcher {
  position: fixed;
  bottom: calc(clamp(14px, 2.6vh, 26px) + 88px);
  right: clamp(16px, 2.6vw, 28px);
  width: 64px;
  height: 73px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.ai-launcher-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  transition: filter 0.25s ease;
  pointer-events: none;
}

#ai-chat-launcher:hover {
  transform: scale(1.12) translateY(-4px);
}

#ai-chat-launcher:hover .ai-launcher-img {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

#ai-chat-launcher:active {
  transform: scale(0.95);
}

#ai-chat-modal {
  display: none;
  position: fixed;
  bottom: calc(clamp(14px, 2.6vh, 26px) + 84px);
  right: calc(clamp(16px, 2.6vw, 28px) + 76px);
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(165deg, rgba(20, 24, 33, 0.86) 0%, rgba(12, 14, 20, 0.94) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 8px 32px rgba(56, 189, 248, 0.08);
  flex-direction: column;
  z-index: 100000;
  color: #fafafa;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: aiModalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#ai-chat-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.8), rgba(255, 117, 160, 0.7), transparent);
  z-index: 101;
  pointer-events: none;
}

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

.ai-top-bar {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 18, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  gap: 8px;
  cursor: move;
  user-select: none;
  touch-action: none;
  position: relative;
  z-index: 2;
}

.ai-top-bar-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}

.ai-brand-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  user-select: none;
}

.ai-top-cheshire-avatar {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.ai-top-cheshire-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #7dd3fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #71717a;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.25s, box-shadow 0.25s;
}

.ai-select {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 150px;
  outline: none;
  cursor: pointer;
}

/* AI 模型选择器及下拉搜索检索组件 */
.ai-model-picker-wrap {
  position: relative;
  display: inline-block;
  flex: 1 1 auto;
  min-width: 110px;
  max-width: 170px;
}

.ai-model-trigger {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 500;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.ai-model-trigger:hover,
.ai-model-trigger.open {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.ai-model-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  flex: 1 1 auto;
}

.ai-model-arrow {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.ai-model-trigger.open .ai-model-arrow {
  transform: rotate(180deg);
  color: #38bdf8;
}

.ai-model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(18, 22, 30, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  z-index: 100;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: aiSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.ai-model-category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 1px 1px 3px 1px;
  scrollbar-width: none;
}

.ai-model-category-tabs::-webkit-scrollbar {
  display: none;
}

.ai-cat-tab {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 2.5px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  user-select: none;
}

.ai-cat-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.ai-cat-tab.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(37, 99, 235, 0.35));
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  font-weight: 600;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.ai-model-group-title {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  padding: 5px 8px 2px 8px;
  letter-spacing: 0.02em;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-model-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 6px 4px 10px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-model-search-box:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  background: rgba(0, 0, 0, 0.45);
}

.ai-model-search-box svg {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex: 0 0 auto;
}

.ai-model-search-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12.5px;
  line-height: 18px;
  outline: none;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

.ai-model-search-input::placeholder {
  color: #64748b;
}

.ai-model-search-test-btn {
  flex: 0 0 auto;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 16px;
  height: 24px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.ai-model-search-test-btn:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.ai-model-options {
  max-height: 230px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 3px;
}

.ai-model-options::-webkit-scrollbar {
  width: 5px;
}

.ai-model-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.ai-model-options::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.ai-model-opt {
  flex-shrink: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 18px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  box-sizing: border-box;
}

.ai-model-opt:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.ai-model-opt.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

.ai-opt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-right: 7px;
  display: inline-block;
}

.ai-opt-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.ai-opt-dot.fail {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.ai-opt-dot.untested {
  background: #71717a;
  box-shadow: none;
}

.ai-opt-name {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-opt-latency {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 1.5px 6px;
  border-radius: 6px;
  margin-left: 6px;
  flex: 0 0 auto;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.ai-opt-latency:hover {
  transform: scale(1.06);
  filter: brightness(1.2);
}

/* 正常连通均为绿色 (高低不再区分颜色) */
.ai-opt-latency.ok {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* 不可用红色标注 */
.ai-opt-latency.fail {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

/* 未测试灰色显示 */
.ai-opt-latency.unknown {
  background: rgba(255, 255, 255, 0.05);
  color: #71717a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-opt-latency.testing {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  animation: aiPulse 0.9s infinite alternate;
}

@keyframes aiPulse {
  0% { opacity: 0.5; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1.03); }
}

.ai-model-opt.active .ai-opt-latency {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.ai-model-search-test-btn.testing {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
}

.ai-model-empty {
  padding: 18px 8px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.ai-btn-sm {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.ai-btn-sm:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.ai-btn-sm:active {
  transform: scale(0.96);
}

.ai-clear-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.ai-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  padding: 0;
  outline: none;
}

.ai-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  transform: scale(1.08);
}

.ai-close-btn:active {
  transform: scale(0.92);
}

.ai-key-panel {
  background: rgba(15, 19, 27, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: aiSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 10;
}

@keyframes aiSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}

.ai-key-header span:first-child {
  font-weight: 600;
  color: #e2e8f0;
}

.ai-key-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ai-key-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.ai-key-input {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  padding: 0 30px 0 10px;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: all 0.2s ease;
}

.ai-key-input:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.ai-key-eye-btn {
  position: absolute;
  right: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s;
}

.ai-key-eye-btn:hover {
  color: #fff;
}

.ai-key-save-btn {
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  height: 32px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.ai-key-save-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.ai-key-save-btn:active {
  transform: scale(0.96);
}

.ai-key-clear-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ai-key-clear-btn:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
}

.ai-key-msg {
  font-size: 11px;
  line-height: 1.3;
  display: none;
}

#ai-chat-messages {
  position: relative;
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  background: radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.06) 0%, transparent 60%),
              radial-gradient(circle at 15% 85%, rgba(255, 117, 160, 0.04) 0%, transparent 50%);
}

#ai-chat-messages::after {
  content: "";
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 135px;
  height: 155px;
  opacity: 0.045;
  pointer-events: none;
  background-image: url("../images/cheshire-chibi2.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom right;
  z-index: 0;
}

#ai-chat-messages::-webkit-scrollbar {
  width: 5px;
}

#ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

#ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.ai-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 88%;
  flex-shrink: 0;
  animation: aiMsgFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

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

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-assistant {
  align-self: flex-start;
}

.ai-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  object-fit: contain;
  padding: 2px;
  flex-shrink: 0;
  user-select: none;
}

.ai-msg-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
}

.ai-msg-sender {
  font-size: 10.5px;
  color: #7dd3fc;
  font-weight: 600;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}

.ai-msg-bubble {
  padding: 9px 13px;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
  transition: all 0.2s ease;
}

.ai-bubble-assistant {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px 16px 16px 16px;
  color: #f1f5f9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.ai-bubble-user {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.28), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-bubble-thinking {
  color: #94a3b8;
  font-style: italic;
  animation: aiPulse 1.4s infinite ease-in-out;
}

@keyframes aiPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.ai-bubble-error {
  background: rgba(127, 29, 29, 0.32) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fecaca !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.18) !important;
}

.ai-system-notice {
  align-self: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 6px auto;
  padding: 5px 16px;
  min-height: 28px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 14px;
  text-align: center;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: aiSlideDown 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.ai-input-box {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 17, 24, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.ai-textarea {
  flex: 1;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f8fafc;
  padding: 9px 12px;
  resize: none;
  outline: none;
  font-size: 13px;
  line-height: 20px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

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

.ai-textarea:focus {
  background: rgba(10, 12, 18, 0.6);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

.ai-send-btn {
  height: 40px;
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  padding: 0 15px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.ai-send-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ai-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
  filter: brightness(1.08);
}

.ai-send-btn:hover svg {
  transform: translateX(1px) translateY(-1px);
}

.ai-send-btn:active {
  transform: scale(0.96);
}

@media (max-width: 600px) {
  #ai-chat-launcher {
    bottom: calc(clamp(10px, 2.5vh, 16px) + 98px);
    right: 16px;
    width: 52px;
    height: 60px;
  }

  #ai-chat-modal {
    bottom: calc(clamp(10px, 2.5vh, 16px) + 98px);
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
    height: 520px;
  }

  .ai-top-cheshire-title {
    display: none;
  }

  .ai-model-picker-wrap {
    max-width: 140px;
  }
}


