/* AI chat — unified glass workspace */
#aiChatOverlay {
  padding: 22px;
  background:
    radial-gradient(circle at 13% 16%, rgba(139, 92, 246, .24), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(34, 211, 238, .18), transparent 34%),
    rgba(3, 8, 24, .50);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}

#aiChatBox {
  position: relative;
  width: min(1180px, 96vw);
  height: min(820px, 92vh);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 28px;
  color: #f6f8ff;
  background:
    radial-gradient(circle at 98% 1%, rgba(34, 211, 238, .11), transparent 33%),
    radial-gradient(circle at 56% 100%, rgba(124, 58, 237, .10), transparent 38%),
    linear-gradient(145deg, rgba(28, 35, 67, .88), rgba(10, 20, 43, .84));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .44), inset 0 1px 0 rgba(255, 255, 255, .11);
  isolation: isolate;
}

#aiChatBox::before,
#aiChatBox::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(10px);
}

#aiChatBox::before {
  width: 360px;
  height: 360px;
  top: -210px;
  left: 22%;
  background: rgba(139, 92, 246, .16);
}

#aiChatBox::after {
  width: 320px;
  height: 320px;
  right: -160px;
  bottom: -190px;
  background: rgba(6, 182, 212, .14);
}

.ai-shell {
  min-width: 0;
  min-height: 0;
}

.ai-sidebar {
  width: 264px;
  padding: 24px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  border-right: 1px solid rgba(255, 255, 255, .10);
  min-height: 0;
}

.ai-brand {
  gap: 11px;
  margin: 0 5px 23px;
}

.ai-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #7c6df2, #28bad3);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 11px 24px rgba(84, 81, 210, .26), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ai-brand-mark svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.ai-brand-copy,
.ai-head-text {
  min-width: 0;
}

.ai-brand-title {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.ai-brand-sub {
  margin-top: 4px;
  color: rgba(214, 228, 255, .48);
  font-size: 10px;
  white-space: nowrap;
}

.ai-sidebar-btn {
  position: relative;
  height: 48px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(178, 165, 255, .26);
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, rgba(105, 92, 232, .82), rgba(133, 76, 210, .72));
  box-shadow: 0 13px 28px rgba(43, 39, 125, .23), inset 0 1px 0 rgba(255, 255, 255, .17);
}

.ai-sidebar-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .13), transparent 72%);
  transform: translateX(-100%);
  transition: transform .45s ease;
}

.ai-sidebar-btn:hover {
  border-color: rgba(205, 197, 255, .40);
  background: linear-gradient(135deg, rgba(119, 103, 244, .94), rgba(151, 82, 222, .84));
  box-shadow: 0 15px 32px rgba(43, 39, 125, .30), inset 0 1px 0 rgba(255, 255, 255, .20);
}

.ai-sidebar-btn:hover::before {
  transform: translateX(100%);
}

.ai-sidebar-btn > svg {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ai-sidebar-label {
  margin: 0;
  padding: 0 4px;
  color: rgba(218, 228, 250, .55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
}

.ai-sidebar-card {
  margin-top: 10px;
  padding: 13px;
  border-radius: 16px;
  color: rgba(214, 228, 255, .60);
  background: linear-gradient(135deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.ai-sidebar-card .ai-head-avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.ai-sidebar-card-title {
  font-size: 13px;
}

.ai-sidebar-card-sub {
  margin-top: 3px;
  color: rgba(214, 228, 255, .44);
  font-size: 10px;
}

.ai-sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
}

.ai-sidebar-count {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  color: rgba(222, 232, 255, .58);
  background: rgba(255, 255, 255, .055);
  font-size: 9px;
  line-height: 16px;
  text-align: center;
}

#aiConversationList {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
  padding: 1px 3px 8px 1px;
  scrollbar-gutter: stable;
}

#aiConversationList::-webkit-scrollbar {
  width: 4px;
}

#aiConversationList::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
}

.ai-conv-item {
  position: relative;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.ai-conv-item::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #a78bfa, #67e8f9);
  transform: translateY(-50%);
  transition: height .18s ease;
}

.ai-conv-item:hover {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .075);
  transform: translateX(1px);
}

.ai-conv-item.active {
  background: linear-gradient(100deg, rgba(124, 109, 242, .18), rgba(255, 255, 255, .055));
  border-color: rgba(174, 160, 255, .17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.ai-conv-item.active::before {
  height: 24px;
}

.ai-conv-open {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ai-conv-open:focus-visible {
  outline: 2px solid rgba(103, 232, 249, .72);
  outline-offset: 3px;
}

.ai-conv-icon {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  border-color: rgba(255, 255, 255, .10);
  color: #d8d2ff;
  background: rgba(255, 255, 255, .07);
  box-shadow: none;
}

.ai-conv-title {
  display: block;
  font-size: 11px;
  line-height: 1.3;
}

.ai-conv-sub {
  display: block;
  margin-top: 3px;
  color: rgba(214, 228, 255, .42);
  font-size: 9px;
}

.ai-conv-del {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  opacity: 0;
  color: rgba(214, 228, 255, .43);
  transition: opacity .18s ease, color .18s ease, background .18s ease;
}

.ai-conv-item:hover .ai-conv-del,
.ai-conv-item:focus-within .ai-conv-del,
.ai-conv-item.active .ai-conv-del {
  opacity: 1;
}

.ai-conv-del:hover {
  color: #fecaca;
  background: rgba(248, 113, 113, .10);
  border-color: rgba(248, 113, 113, .14);
}

.ai-conv-del svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-conv-empty {
  display: grid;
  min-height: 132px;
  place-items: center;
  align-content: center;
  padding: 18px 12px;
  border: 1px dashed rgba(255, 255, 255, .10);
  border-radius: 15px;
  color: rgba(214, 228, 255, .55);
  text-align: center;
}

.ai-conv-empty svg {
  width: 20px;
  height: 20px;
  margin-bottom: 10px;
  color: rgba(196, 181, 253, .72);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-conv-empty span {
  font-size: 11px;
  font-weight: 700;
}

.ai-conv-empty small {
  margin-top: 4px;
  color: rgba(214, 228, 255, .35);
  font-size: 9px;
}

.ai-main {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: rgba(5, 13, 31, .08);
}

.ai-head {
  z-index: 5;
  flex: 0 0 auto;
  min-height: 88px;
  margin: 0;
  padding: 17px 24px 16px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  background: linear-gradient(180deg, rgba(18, 29, 57, .54), rgba(18, 29, 57, .20));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.ai-head-main {
  gap: 12px;
}

.ai-head-avatar,
.ai-avatar {
  border: 1px solid rgba(191, 182, 255, .18);
  color: #d7d0ff;
  background: linear-gradient(145deg, rgba(139, 92, 246, .17), rgba(34, 211, 238, .10));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 9px 22px rgba(0, 0, 0, .12);
}

.ai-head .ai-head-avatar {
  position: relative;
  width: 46px;
  height: 46px;
}

.ai-head .ai-head-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #24304d;
  border-radius: 50%;
  background: #42ddb1;
  box-shadow: 0 0 10px rgba(66, 221, 177, .62);
}

#aiChatTitle {
  max-width: min(52vw, 540px);
  color: #f8faff;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.ai-head-sub {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: min(50vw, 520px);
  margin-top: 4px;
  padding-left: 11px;
  overflow: hidden;
  color: rgba(214, 228, 255, .56);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-head-sub::before {
  content: "";
  position: absolute;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #55dcb2;
  box-shadow: 0 0 8px rgba(85, 220, 178, .58);
}

.ai-head .ai-quota-inline {
  gap: 5px;
  margin-top: 6px;
}

.ai-head .ai-quota-chip {
  height: 18px;
  padding: 0 7px;
  border-color: rgba(196, 181, 253, .12);
  color: rgba(224, 231, 255, .55);
  background: rgba(196, 181, 253, .055);
  font-size: 8px;
}

.ai-head-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 13px;
  color: rgba(229, 237, 255, .62);
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.ai-head-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.ai-head-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .16);
}

#aiChatMsgs {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  gap: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 26px max(28px, 4.2vw) 34px;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

#aiChatMsgs::before {
  content: "";
  position: fixed;
  pointer-events: none;
}

#aiChatMsgs::-webkit-scrollbar {
  width: 5px;
}

#aiChatMsgs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.ai-empty-state {
  display: flex;
  width: min(720px, 100%);
  min-height: 100%;
  align-self: center;
  align-items: center;
  justify-content: center;
  flex: 1 0 auto;
  flex-direction: column;
  margin: auto;
  padding: 18px 0 8px;
  text-align: center;
}

.ai-empty-orbit {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  margin-bottom: 15px;
  place-items: center;
}

.ai-empty-orbit::before,
.ai-empty-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.ai-empty-orbit::before {
  inset: 0;
  border: 1px solid rgba(178, 165, 255, .16);
  background: radial-gradient(circle, rgba(124, 109, 242, .17), transparent 66%);
  box-shadow: 0 0 42px rgba(124, 109, 242, .13);
}

.ai-empty-orbit::after {
  inset: 9px;
  border: 1px dashed rgba(103, 232, 249, .20);
  animation: aiEmptyOrbit 15s linear infinite;
}

.ai-empty-orbit > span {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 12px rgba(103, 232, 249, .8);
}

.ai-empty-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 109, 242, .86), rgba(31, 188, 211, .74));
  box-shadow: 0 13px 30px rgba(63, 64, 184, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
  font-size: 15px;
  font-weight: 800;
}

.ai-empty-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-empty-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: rgba(201, 212, 242, .61);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.ai-empty-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #55dcb2;
  box-shadow: 0 0 9px rgba(85, 220, 178, .75);
}

.ai-empty-state h2 {
  margin: 0;
  color: #f8faff;
  font-size: clamp(23px, 2.3vw, 31px);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.ai-empty-state > p {
  max-width: 520px;
  margin: 11px auto 22px;
  color: rgba(214, 228, 255, .54);
  font-size: 12px;
  line-height: 1.7;
}

.ai-starter-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-starter-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px;
  color: #edf3ff;
  background: linear-gradient(135deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.ai-starter-card > i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(196, 181, 253, .14);
  border-radius: 12px;
  color: #c9c1ff;
  background: linear-gradient(145deg, rgba(139, 92, 246, .13), rgba(34, 211, 238, .07));
  font-size: 13px;
}

.ai-starter-card > i svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-starter-card span {
  min-width: 0;
}

.ai-starter-card strong {
  display: block;
  overflow: hidden;
  color: #f5f7ff;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-starter-card small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: rgba(214, 228, 255, .42);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-starter-card b {
  color: rgba(151, 226, 243, .45);
  font-size: 12px;
  font-weight: 400;
  transition: transform .18s ease, color .18s ease;
}

.ai-starter-card:hover {
  border-color: rgba(178, 165, 255, .24);
  background: linear-gradient(135deg, rgba(124, 109, 242, .13), rgba(34, 211, 238, .065));
  box-shadow: 0 13px 28px rgba(0, 0, 0, .10), inset 0 1px 0 rgba(255, 255, 255, .07);
  transform: translateY(-2px);
}

.ai-starter-card:hover b {
  color: #8cecff;
  transform: translate(2px, -2px);
}

.ai-empty-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  color: rgba(214, 228, 255, .35);
  font-size: 9px;
}

.ai-empty-note svg {
  width: 12px;
  height: 12px;
  color: rgba(110, 231, 183, .60);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes aiEmptyOrbit {
  to { transform: rotate(360deg); }
}

.ai-msg-row {
  gap: 12px;
  max-width: 86%;
}

.ai-msg-row.user {
  max-width: 74%;
  gap: 6px;
}

.ai-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 11px;
}

.ai-msg-body {
  max-width: 100%;
}

.ai-bubble {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  color: #edf4ff;
  background: rgba(255, 255, 255, .055);
  font-size: 13px;
  line-height: 1.75;
}

.ai-bubble h1,
.ai-bubble h2,
.ai-bubble h3,
.ai-bubble h4,
.ai-bubble strong {
  color: #f8faff !important;
}

.ai-bubble h1,
.ai-bubble h2,
.ai-bubble h3,
.ai-bubble h4 {
  margin: 16px 0 9px;
  line-height: 1.35;
}

.ai-bubble h1:first-child,
.ai-bubble h2:first-child,
.ai-bubble h3:first-child,
.ai-bubble h4:first-child {
  margin-top: 0;
}

.ai-bubble h1 { font-size: 19px; }
.ai-bubble h2 { font-size: 16px; }
.ai-bubble h3,
.ai-bubble h4 { font-size: 14px; }

.ai-bubble ul,
.ai-bubble ol {
  margin: 9px 0;
  padding-left: 20px;
}

.ai-bubble li {
  margin: 4px 0;
}

.ai-msg-row.bot .ai-bubble {
  border-radius: 6px 18px 18px 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .045));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .10), inset 0 1px 0 rgba(255, 255, 255, .045);
}

.ai-msg-row.user .ai-bubble {
  border-color: rgba(190, 177, 255, .20);
  border-radius: 18px 18px 6px 18px;
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 91, 226, .72), rgba(143, 74, 203, .60));
  box-shadow: 0 12px 30px rgba(53, 41, 145, .18), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.ai-bubble pre {
  margin: 13px 0;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  background: rgba(3, 9, 23, .52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.ai-bubble code,
.ai-bubble pre code {
  color: #d9f7ff;
}

.ai-copy-btn {
  border-color: rgba(255, 255, 255, .10);
  color: rgba(225, 235, 255, .57);
  background: rgba(255, 255, 255, .075);
  box-shadow: none;
}

.ai-reply-actions {
  gap: 11px;
  margin-top: 8px;
  padding-left: 3px;
}

.ai-time,
.ai-reply-copy {
  color: rgba(214, 228, 255, .35);
  font-size: 9px;
}

.ai-reply-copy:hover {
  color: #d8d1ff;
}

.ai-quick-actions {
  gap: 6px;
  margin-top: 9px;
}

.ai-quick-action {
  padding: 5px 8px;
  border-color: rgba(125, 211, 252, .13);
  color: rgba(224, 238, 255, .52);
  background: rgba(255, 255, 255, .035);
  font-size: 9px;
}

.ai-table-wrap {
  max-width: 100%;
  border-color: rgba(255, 255, 255, .10);
  background: rgba(3, 9, 23, .35);
}

.ai-source-panel {
  border-top-color: rgba(255, 255, 255, .075);
}

.ai-source-card {
  background: rgba(3, 9, 23, .22);
}

.ai-typing-wrap {
  max-width: 86%;
}

.ai-typing {
  border-color: rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .10), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.ai-foot {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  margin: 0;
  padding: 9px max(28px, 4.2vw) 12px;
  border-top: 1px solid rgba(255, 255, 255, .055);
  background: linear-gradient(180deg, rgba(11, 21, 44, .10), rgba(11, 21, 44, .64) 28%, rgba(11, 21, 44, .78));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.ai-input-shell {
  min-height: 60px;
  align-items: flex-end;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .045));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .065);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.ai-input-shell:focus-within {
  border-color: rgba(175, 161, 255, .30);
  background: linear-gradient(145deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .055));
  box-shadow: 0 18px 42px rgba(0, 0, 0, .20), 0 0 0 3px rgba(124, 109, 242, .055), inset 0 1px 0 rgba(255, 255, 255, .08);
}

#aiChatInput,
#aiChatInput:focus {
  min-height: 58px;
  max-height: 144px;
  padding: 17px 112px 12px 20px;
  border: 0;
  border-radius: 22px;
  color: #f6f8ff;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.55;
}

#aiChatInput.ai-has-model {
  padding-right: 250px;
}

#aiChatInput::placeholder {
  color: rgba(214, 228, 255, .37);
}

.ai-input-actions {
  right: 12px;
  top: auto;
  bottom: 9px;
  gap: 8px;
  transform: none;
}

.ai-model-switcher {
  height: 30px;
  max-width: 132px;
  padding: 0 9px 0 8px;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 10px;
  color: rgba(235, 241, 255, .57);
  background: rgba(255, 255, 255, .045);
  font-size: 9px;
}

.ai-model-switcher:hover {
  color: #fff;
  background: rgba(255, 255, 255, .085);
}

.ai-model-dropdown {
  bottom: calc(100% + 12px);
  min-width: 180px;
  padding: 7px;
  border-color: rgba(255, 255, 255, .13);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(39, 47, 77, .97), rgba(19, 27, 51, .98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.ai-model-option {
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 10px;
}

.ai-upload-btn {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(218, 229, 251, .48);
}

.ai-upload-btn:hover {
  border-color: rgba(255, 255, 255, .08);
  color: #fff;
  background: rgba(255, 255, 255, .055);
}

.ai-upload-btn svg {
  width: 16px;
  height: 16px;
}

.ai-send-btn {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(135deg, #7568ed, #9a55dc 64%, #2bb8d1);
  box-shadow: 0 10px 24px rgba(84, 61, 205, .32), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.ai-send-btn:hover {
  box-shadow: 0 13px 29px rgba(95, 66, 224, .42), 0 0 18px rgba(139, 92, 246, .18), inset 0 1px 0 rgba(255, 255, 255, .26);
}

.ai-send-btn svg {
  width: 15px;
  height: 15px;
}

.ai-upload-preview {
  margin-bottom: 9px;
  padding: 0 4px;
}

.ai-upload-chip {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .14);
}

.ai-foot-meta {
  display: flex;
  min-height: 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 5px 0;
}

.ai-composer-hint {
  color: rgba(214, 228, 255, .28);
  font-size: 8px;
}

#aiThinkLabel {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: rgba(209, 201, 255, .66);
  font-size: 8px;
}

#aiThinkLabel i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(167, 139, 250, .70);
}

@media (max-width: 900px) {
  #aiChatOverlay {
    padding: 14px;
  }

  #aiChatBox {
    width: min(760px, 100%);
    height: min(920px, calc(100dvh - 28px));
  }

  .ai-main {
    padding: 0;
  }

  .ai-head {
    min-height: 80px;
    padding: 14px 18px;
  }

  #aiChatMsgs {
    padding: 22px 22px 30px;
  }

  .ai-foot {
    padding: 9px 22px 12px;
  }

  .ai-msg-row.bot {
    max-width: 92%;
  }

  .ai-msg-row.user {
    max-width: 80%;
  }
}

@media (max-width: 640px) {
  #aiChatOverlay {
    align-items: stretch;
    padding: 0;
    background: rgba(3, 8, 24, .76);
  }

  #aiChatBox {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-width: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 95% 4%, rgba(34, 211, 238, .10), transparent 32%),
      linear-gradient(160deg, rgba(26, 33, 65, .98), rgba(8, 17, 37, .98));
  }

  .ai-head {
    min-height: 72px;
    padding: max(11px, env(safe-area-inset-top)) 14px 11px;
  }

  .ai-head-main {
    gap: 10px;
  }

  .ai-head .ai-head-avatar {
    width: 39px;
    height: 39px;
  }

  #aiChatTitle {
    max-width: calc(100vw - 120px);
    font-size: 14px;
  }

  .ai-head-sub {
    max-width: calc(100vw - 130px);
    font-size: 9px;
  }

  .ai-head .ai-quota-inline {
    display: none;
  }

  .ai-head-close {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 12px;
  }

  #aiChatMsgs {
    gap: 18px;
    padding: 18px 14px 24px;
  }

  .ai-empty-state {
    justify-content: flex-start;
    padding-top: 18px;
  }

  .ai-empty-orbit {
    width: 70px;
    height: 70px;
    margin-bottom: 10px;
  }

  .ai-empty-avatar {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    font-size: 13px;
  }

  .ai-empty-state h2 {
    font-size: 22px;
  }

  .ai-empty-state > p {
    margin: 8px auto 16px;
    font-size: 10px;
  }

  .ai-starter-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .ai-starter-card {
    grid-template-columns: 32px minmax(0, 1fr) 14px;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 13px;
  }

  .ai-starter-card > i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 11px;
  }

  .ai-empty-note {
    margin-top: 11px;
  }

  .ai-msg-row.bot,
  .ai-msg-row.user,
  .ai-typing-wrap {
    max-width: 100%;
  }

  .ai-msg-row {
    gap: 9px;
  }

  .ai-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .ai-bubble {
    padding: 13px 14px;
    font-size: 12px;
  }

  .ai-foot {
    padding: 9px 12px max(10px, env(safe-area-inset-bottom));
  }

  .ai-input-shell {
    min-height: 66px;
    border-radius: 19px;
  }

  #aiChatInput,
  #aiChatInput:focus {
    min-height: 64px;
    padding: 17px 94px 15px 16px;
    border-radius: 19px;
    font-size: 12px;
  }

  #aiChatInput.ai-has-model {
    padding-right: 94px;
    padding-bottom: 48px;
  }

  .ai-input-actions {
    right: 9px;
    bottom: 8px;
    gap: 5px;
  }

  .ai-model-switcher.visible {
    position: absolute;
    right: 70px;
    bottom: 0;
    max-width: 108px;
  }

  .ai-model-label {
    max-width: 64px;
  }

  .ai-upload-btn {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .ai-send-btn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .ai-composer-hint {
    display: none;
  }

  .ai-foot-meta {
    min-height: 5px;
    justify-content: flex-end;
    padding-top: 3px;
  }
}

@media (max-height: 700px) and (min-width: 641px) {
  .ai-head {
    min-height: 76px;
    padding-top: 12px;
    padding-bottom: 11px;
  }

  #aiChatMsgs {
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .ai-empty-orbit {
    width: 66px;
    height: 66px;
    margin-bottom: 8px;
  }

  .ai-empty-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .ai-empty-state > p {
    margin: 7px auto 13px;
  }

  .ai-starter-card {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .ai-empty-note {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-empty-orbit::after {
    animation: none;
  }

  .ai-starter-card,
  .ai-sidebar-btn,
  .ai-conv-item {
    transition: none;
  }
}
