.ai-detail-back {
  display: inline-block;
  margin-bottom: 14px;
  color: #8b7dbe;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.ai-detail-back:hover {
  text-decoration: underline;
}

.ai-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ai-detail-header h1 {
  margin: 0 0 4px;
}

.ai-detail-header__meta {
  margin: 0;
  color: #8b7dbe;
  font-size: 13px;
  font-weight: 600;
}

.ai-detail-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.ai-detail-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #6b7280;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ai-detail-tab--active {
  background: #8b7dbe;
  border-color: #8b7dbe;
  color: #ffffff;
}

.ai-detail-section {
  margin-bottom: 24px;
}

.ai-detail-section__title {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
}

.ai-detail-meta {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.ai-detail-meta__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
}

.ai-detail-meta__row:first-child {
  border-top: none;
}

.ai-detail-meta__label {
  color: #6b7280;
  font-size: 13px;
}

.ai-detail-meta__value {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.ai-detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.ai-detail-metrics .ai-trading-metric {
  flex: none;
}

.ai-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.ai-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ai-detail-table th {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.ai-detail-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  white-space: nowrap;
}

.ai-detail-table tbody tr:last-child td {
  border-bottom: none;
}

.ai-detail-table__num {
  font-variant-numeric: tabular-nums;
}

.ai-detail-table__num--up {
  color: #16a34a;
  font-weight: 700;
}

.ai-detail-table__num--down {
  color: #dc2626;
  font-weight: 700;
}

.ai-decision {
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.ai-decision__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-decision__action {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ai-decision__action--buy {
  background: #dcfce7;
  color: #166534;
}

.ai-decision__action--sell {
  background: #fee2e2;
  color: #991b1b;
}

.ai-decision__action--close,
.ai-decision__action--hold {
  background: #f3f0fa;
  color: #8b7dbe;
}

.ai-decision__time {
  color: #9ca3af;
  font-size: 12px;
}

.ai-decision__reason {
  margin: 0 0 10px;
  color: #374151;
  font-size: 13px;
  line-height: 1.5;
}

.ai-decision__confidence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ai-decision__confidence-bar {
  flex: 1;
  max-width: 220px;
  height: 6px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.ai-decision__confidence-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #8b7dbe;
}

.ai-decision__confidence-text {
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}

.ai-decision__snapshot {
  margin: 0;
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .ai-detail-header {
    flex-direction: column;
  }
}
