.stock-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(98, 124, 165, 0.22);
  background: rgba(14, 21, 34, 0.94);
  color: #dce7fb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.stock-ai-btn:hover {
  border-color: rgba(127, 255, 184, 0.34);
  background: rgba(127, 255, 184, 0.10);
  color: #fff;
}

.stock-news-assess-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.block-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-chat-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2200;
}

.stock-chat-modal.is-open {
  display: flex;
}

.stock-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.stock-chat-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(120, 148, 191, 0.28);
  background: linear-gradient(180deg, rgba(14, 21, 34, 0.98), rgba(8, 13, 22, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.stock-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stock-chat-title {
  margin: 0;
  font: 800 1.1rem/1.15 "Oxanium", sans-serif;
  letter-spacing: -0.03em;
  color: #eef4ff;
}

.stock-chat-title-stock {
  font-weight: 900;
  color: #ffffff;
}

.stock-chat-copy {
  margin: 4px 0 0;
  color: #8fa8d0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.stock-chat-close {
  width: 34px;
  min-width: 34px;
}

.stock-chat-context {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(98, 124, 165, 0.18);
  background: rgba(11, 18, 30, 0.78);
  color: #9db0d3;
  font-size: 0.8rem;
  line-height: 1.4;
}

.stock-chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(48vh, 480px);
  overflow: auto;
  padding-right: 4px;
}

.stock-chat-msg {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(98, 124, 165, 0.18);
  line-height: 1.45;
  white-space: pre-wrap;
}

.stock-chat-msg--user {
  align-self: flex-end;
  background: rgba(69, 216, 255, 0.10);
  border-color: rgba(69, 216, 255, 0.24);
}

.stock-chat-msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.03);
}

.stock-chat-msg--system {
  align-self: stretch;
  background: rgba(127, 255, 184, 0.07);
  border-color: rgba(127, 255, 184, 0.14);
  color: #cfeedd;
  font-size: 0.82rem;
}

.stock-chat-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.stock-chat-mode-label {
  color: #8fa8d0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "Oxanium", sans-serif;
}

.stock-chat-mode-select {
  flex: 1 1 auto;
  min-width: 220px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(98, 124, 165, 0.20);
  background: rgba(14, 21, 34, 0.92);
  color: #eef4ff;
  font: inherit;
  outline: none;
}

.stock-chat-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.stock-chat-compose.is-compact {
  align-items: center;
}

.stock-chat-input {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(98, 124, 165, 0.20);
  background: rgba(14, 21, 34, 0.92);
  color: #eef4ff;
  font: inherit;
  outline: none;
  resize: vertical;
}

.stock-chat-input.is-hidden {
  display: none;
}

.stock-chat-send {
  width: 42px;
  min-width: 42px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.stock-chat-hint {
  min-height: 18px;
  color: #8fa8d0;
  font-size: 0.78rem;
}

.stock-chat-hint.is-error {
  color: #ff98aa;
}

.stock-chat-msg--assistant {
  white-space: normal;
}

.stock-chat-msg--assistant p {
  margin: 0 0 8px;
}

.stock-chat-msg--assistant p:last-child {
  margin-bottom: 0;
}

.stock-chat-msg--assistant strong {
  color: #eef4ff;
}

.stock-chat-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(98, 124, 165, 0.18);
  border-radius: 14px;
}

.stock-chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.stock-chat-table th,
.stock-chat-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(98, 124, 165, 0.14);
  text-align: left;
  vertical-align: top;
}

.stock-chat-table th {
  color: #cfe1ff;
  background: rgba(69, 216, 255, 0.08);
  font-weight: 700;
}

.stock-chat-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 700px) {
  .stock-chat-send {
    width: 42px;
  }
}
