.log-detail-page {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.detail-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding-bottom: 6px;
}

.detail-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 0 0;
  border-top: 1px solid #e5eaf0;
  background: transparent;
}

.detail-actions button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.back-action {
  min-width: 104px;
  border: 1px solid #d7e0ea;
  background: #fff;
  color: #475569;
}

.back-action:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.detail-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
}

.detail-state i {
  color: var(--theme-primary);
  font-size: 28px;
}

.detail-state strong {
  color: #0f172a;
  font-size: 16px;
}

.detail-state p {
  color: #64748b;
}

.detail-state.error i {
  color: #ef4444;
}

.detail-state button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 750;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.hero-copy {
  min-width: 0;
}

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

.hero-copy h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
}

.hero-copy p {
  margin: 8px 0 0;
  color: #64748b;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.refresh-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
}

.detail-card.wide {
  grid-column: 1 / -1;
}

.card-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.card-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.info-grid,
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-grid div,
.feedback-grid div {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f8fafc;
}

.info-grid span,
.feedback-grid span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.info-grid strong,
.feedback-grid strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.trace-steps {
  display: grid;
  gap: 10px;
}

.trace-step {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #e5edf5;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.trace-step.active {
  border-color: rgba(var(--theme-primary-rgb), 0.32);
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.08);
}

.step-index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfeff;
  color: var(--theme-primary-active);
  font-size: 12px;
  font-weight: 800;
}

.step-copy {
  display: grid;
  gap: 4px;
}

.step-copy strong {
  color: #0f172a;
  font-size: 13px;
}

.step-copy span {
  color: #64748b;
  font-size: 12px;
}

.payload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payload-grid h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 13px;
}

.code-block {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-block.large {
  max-height: 360px;
}

.status-pill,
.level-pill {
  min-width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success-active);
}

.status-pill.warning,
.level-pill.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.status-pill.danger,
.level-pill.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.status-pill.muted,
.level-pill.muted {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
}

.level-pill.info {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.inline-empty {
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}

@media (max-width: 980px) {
  .detail-hero {
    flex-direction: column;
  }

  .detail-grid,
  .info-grid,
  .feedback-grid,
  .payload-grid {
    grid-template-columns: 1fr;
  }

  .detail-card.wide {
    grid-column: auto;
  }
}
