body[data-page="trade-ai"] {
  background: #f7f8fb;
}
.ai-page {
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(ellipse at 50% 35%, #ed1c2b05, transparent 55%), radial-gradient(#10275414 0.7px, transparent 0.7px);
  background-size: auto, 24px 24px;
}
.ai-page [hidden] {
  display: none;
}
.ai-toolbar {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ai-page-label,
.ai-composer-actions,
.ai-assistant-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.ai-history {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(400px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  padding: 24px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: -12px 0 40px #071a4620;
  overflow-y: auto;
}
.ai-history::backdrop { background: #071a4666; }
.ai-history-head { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; }
.ai-history-head h2 { margin: 0 0 8px; color: var(--navy); font-size: 21px; }
.ai-history-head p, .ai-history-feedback { color: var(--muted); font-size: 13px; line-height: 1.5; }
.ai-history-head p { margin: 0; }
.ai-history-head button { flex-shrink: 0; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--navy); cursor: pointer; }
.ai-history-list { display: grid; gap: 10px; margin: 20px 0; }
.ai-history-item { width: 100%; text-align: left; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; color: var(--text); font: inherit; cursor: pointer; }
.ai-history-item strong { display: block; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-history-item small { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }
.ai-history-item:hover, .ai-history-item[aria-current="true"] { background: #edf1f8; border-color: var(--navy-2); }
.ai-history-item:disabled { opacity: 0.6; }
.ai-older-messages { margin-bottom: 24px; }
.ai-page-label strong {
  color: var(--navy);
  font-size: 17px;
}
.ai-small-mark {
  color: var(--red);
  background: #fdebed;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.ai-ze-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.ai-preview-badge {
  color: #69748a;
  background: #edf0f5;
  border: 1px solid #dfe4ed;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}
.ai-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #ffffffb3;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ai-new-chat:hover {
  background: #fff;
  border-color: #a7b3c9;
}
.ai-workspace {
  width: min(800px, calc(100% - 40px));
  flex: 1;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.ai-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px 0 64px;
}
.ai-mascot {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 36px;
  color: var(--red);
}
.ai-mascot::before {
  content: "";
  position: absolute;
  inset: -45px;
  background: radial-gradient(circle, #ed1c2b12, transparent 68%);
  pointer-events: none;
}
.ai-mascot img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px #ed1c2b12);
  animation: ai-float 5s ease-in-out infinite;
}
.ai-eyebrow {
  color: #7a8396;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-bottom: 12px;
}
.ai-welcome h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 4.5vw, 42px);
  letter-spacing: -0.035em;
  font-weight: 600;
  line-height: 1.15;
}
.ai-welcome h1 span,
.ai-conversation h1 span {
  color: var(--red);
  font-weight: 700;
}
.ai-intro {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 17px 0 28px;
}
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  max-width: 660px;
}
.ai-suggestions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #dce1e9;
  border-radius: 999px;
  background: #ffffffc9;
  color: #4e5b72;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ai-suggestions i {
  color: var(--red);
  font-size: 12px;
}
.ai-suggestions button:hover {
  border-color: #ed1c2b55;
  background: #fff5f5;
  color: var(--navy);
  transform: translateY(-2px);
}
.ai-composer-area {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  padding: 12px 0 20px;
  background: linear-gradient(transparent, #f7f8fb 22%);
}
.ai-composer {
  padding: 16px;
  border: 1px solid #d5dce7;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 28px #071a4608, 0 1px 3px #071a4605;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.ai-composer:focus-within {
  border-color: #8797b7;
  box-shadow: 0 0 0 3px #10275408, 0 5px 28px #071a4608;
}
.ai-composer textarea {
  display: block;
  width: 100%;
  min-height: 62px;
  max-height: 180px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.5;
  padding: 4px 2px 12px;
  outline: none;
}
.ai-composer textarea::placeholder {
  color: #8590a3;
}
.ai-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.ai-assistant-label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
}
.ai-assistant-label > .ai-ze-icon {
  width: 24px;
  height: 24px;
}
.ai-assistant-divider {
  width: 1px;
  height: 13px;
  background: var(--border);
  margin: 0 3px;
}
.ai-text-mode,
.ai-counter {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.ai-mode {
  color: #59657b;
  font-size: 11px;
  background: #f3f5f8;
  border-radius: 6px;
  padding: 7px 9px;
}
.ai-mode i {
  margin-right: 4px;
}
.ai-send {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--red);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}
.ai-send:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
}
.ai-send:disabled {
  background: #edf0f5;
  color: #9aa5b8;
  cursor: not-allowed;
}
.ai-keyboard-hint,
.ai-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #737e91;
  margin: 10px 0 0;
  line-height: 1.5;
}
.ai-keyboard-hint kbd {
  font: inherit;
  font-weight: 500;
}
.ai-keyboard-hint > span {
  padding: 0 6px;
}
.ai-disclaimer {
  color: #7b8495;
  margin-top: 5px;
}
.ai-disclaimer i {
  margin-right: 4px;
}
.ai-feedback {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}
.ai-feedback:empty {
  display: none;
}
.ai-conversation {
  padding: 30px 0 36px;
  flex: 1;
}
.ai-conversation h1 {
  color: var(--navy);
  font-size: 25px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.ai-conversation-caption {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 32px;
}
.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ai-message {
  max-width: 90%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  scroll-margin: 90px 0 260px;
}
.ai-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ai-message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fdebed;
  color: var(--red);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}
.ai-message-user .ai-message-avatar {
  background: #e6ebf5;
  color: var(--navy);
}
.ai-message-content {
  min-width: 0;
}
.ai-message-content strong {
  display: block;
  color: var(--navy);
  font-size: 12px;
  margin: 7px 0 9px;
}
.ai-message-user strong {
  text-align: right;
}
.ai-message-content p {
  margin: 0;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 0 13px 13px;
  background: #fff;
  color: #4e5b72;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.ai-message-user p {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  border-radius: 13px 0 13px 13px;
}
.ai-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 0 13px 13px;
  background: #fff;
}
.ai-typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5b7;
  animation: ai-typing 1.2s infinite ease-in-out;
}
.ai-typing-bubble span:nth-child(2) {
  animation-delay: 0.15s;
}
.ai-typing-bubble span:nth-child(3) {
  animation-delay: 0.3s;
}
.ai-message-sources {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.ai-action-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
}
.ai-action-card h2 { margin: 0 0 16px; font-size: 17px; color: var(--navy); }
.ai-action-card h3 { margin: 18px 0 10px; font-size: 14px; }
.ai-action-card dl { margin: 0; }
.ai-action-card dt { margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ai-action-card dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-action-clients { max-height: 280px; overflow-y: auto; padding-left: 26px; margin: 0; }
.ai-action-clients li { padding: 4px 0; overflow-wrap: anywhere; }
.ai-action-card .ai-action-status { margin: 16px 0 12px; font-size: 12px; color: var(--muted); }
.ai-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.ai-action-buttons button { padding: 11px 16px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; }
.ai-action-buttons .ai-action-confirm { background: var(--navy); color: #fff; border-color: var(--navy); }
.ai-action-buttons button:disabled { opacity: 0.5; }
.ai-action-link { display: inline-block; margin-top: 12px; color: var(--navy); font-weight: 600; }
.ai-page button:disabled {
  cursor: not-allowed;
}
.ai-composer[aria-busy="true"] {
  opacity: 0.75;
}
.ai-page button:focus-visible {
  outline: 2px solid var(--navy-2);
  outline-offset: 4px;
}
.ai-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@keyframes ai-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-7px) rotate(3deg); }
}
@keyframes ai-typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}
@media (min-height: 850px) {
  .ai-welcome { padding-bottom: 90px; }
  .ai-mascot { width: 224px; height: 224px; margin-bottom: 42px; }
}
@media (max-width: 600px) {
  .ai-toolbar { flex-wrap: wrap; }
  .ai-toolbar-actions { gap: 7px; }
  .ai-toolbar { width: calc(100% - 28px); padding: 18px 0; }
  .ai-workspace { width: calc(100% - 28px); }
  .ai-page-label { gap: 7px; }
  .ai-new-chat { padding: 9px; font-size: 11px; }
  .ai-welcome { padding: 28px 0 38px; }
  .ai-mascot { width: 160px; height: 160px; margin-bottom: 27px; }
  .ai-eyebrow { font-size: 8px; letter-spacing: 0.12em; }
  .ai-intro { font-size: 14px; margin-bottom: 24px; }
  .ai-suggestions { gap: 8px; }
  .ai-suggestions button { font-size: 11px; padding: 10px 12px; min-height: 40px; }
  .ai-composer { border-radius: 13px; padding: 12px; }
  .ai-composer textarea { font-size: 16px; }
  .ai-send { width: 42px; height: 42px; }
  .ai-text-mode, .ai-assistant-divider, .ai-mode { display: none; }
  .ai-composer-area { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .ai-message { max-width: 100%; }
  .ai-conversation { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-mascot img { animation: none; }
  .ai-typing-bubble span { animation: none; }
  .ai-page *, .ai-page *::before { transition: none; }
}
