.sg-ai-panel {
  margin: 18px 0;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.sg-ai-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.sg-ai-panel__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.sg-ai-panel__hint {
  margin: 0;
  color: #555;
  font-size: 13px;
}

.sg-ai-panel__badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0a4b78;
  font-size: 12px;
  font-weight: 700;
}

.sg-ai-wallet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.sg-ai-wallet__item {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 12px;
}

.sg-ai-wallet__item strong {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sg-ai-wallet__item span {
  color: #0a4b78;
  font-weight: 700;
}

.sg-ai-panel__messages {
  max-height: 380px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.sg-ai-msg {
  margin-bottom: 12px;
}

.sg-ai-msg__label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.sg-ai-msg__bubble {
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.sg-ai-msg--assistant .sg-ai-msg__bubble {
  background: #ffffff;
  border: 1px solid #dbe4f0;
}

.sg-ai-msg--user .sg-ai-msg__bubble {
  background: #0a4b78;
  color: #ffffff;
}

.sg-ai-panel__status {
  min-height: 20px;
  margin: 10px 0;
  color: #b42318;
  font-size: 13px;
}

.sg-ai-panel__estimate-note {
  min-height: 18px;
  margin: -4px 0 10px;
  color: #64748b;
  font-size: 12px;
}

.sg-ai-panel__estimate-note.is-error {
  color: #b42318;
}

.sg-ai-panel__composer {
  margin-top: 10px;
}

.sg-ai-panel__input {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  resize: vertical;
  box-sizing: border-box;
}

.sg-ai-panel__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.sg-ai-panel__history {
  margin-top: 16px;
}

.sg-ai-panel__history h4 {
  margin: 0 0 8px;
}

.sg-ai-history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sg-ai-history__item,
.sg-ai-history__empty {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 8px;
}

.sg-ai-history__item small {
  color: #64748b;
}

.sg-ai-confirm {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  background: #fff8eb;
}

.sg-ai-confirm__title {
  font-weight: 700;
  margin-bottom: 8px;
}

.sg-ai-confirm__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  font-size: 13px;
}

.sg-ai-confirm__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

@media (max-width: 768px) {
  .sg-ai-panel__header {
    flex-direction: column;
  }

  .sg-ai-confirm__body {
    grid-template-columns: 1fr;
  }
}
