:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #67736d;
  --line: #d9e1dd;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --accent: #1b6b52;
  --accent-2: #b93d2e;
  --soft: #e7eee9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: #145740;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.94);
  backdrop-filter: blur(12px);
}

.topbar div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar span,
.title-block p,
.kpi-row span,
.summary-grid span,
.scenario-button span,
.logs p {
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  gap: 28px;
  padding: 32px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: end;
  min-height: 220px;
  padding: 34px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(27, 107, 82, 0.12), transparent 55%),
    repeating-linear-gradient(90deg, rgba(23, 33, 27, 0.06) 0 1px, transparent 1px 42px),
    var(--surface);
}

.title-block h1 {
  max-width: 780px;
  margin: 6px 0 0;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.summary-grid div,
.kpi-row div {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
}

.summary-grid strong,
.kpi-row strong {
  font-size: 22px;
}

.surface {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.scenario-list {
  border-right: 1px solid var(--line);
  background: var(--soft);
}

.scenario-button {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 18px;
}

.scenario-button:hover,
.scenario-button.active {
  background: var(--surface);
  color: var(--ink);
  transform: none;
}

.detail {
  min-width: 0;
  padding: 26px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 22px;
}

.detail-head p {
  color: var(--accent-2);
  font-weight: 800;
  margin: 0 0 4px;
}

.detail-head h2,
.logs h2 {
  margin: 0;
  font-size: 28px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 22px;
  background: var(--line);
  border: 1px solid var(--line);
}

h3 {
  margin: 24px 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0;
}

pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: #101713;
  color: #eaf2ed;
  padding: 18px;
  border-radius: 6px;
  line-height: 1.5;
}

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

.trace-item {
  border-left: 4px solid var(--accent);
  background: var(--soft);
  padding: 12px 14px;
}

.logs {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

#log-output {
  max-height: 560px;
}

@media (max-width: 820px) {
  .topbar,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 16px;
  }

  .overview,
  .surface,
  .logs {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .scenario-list {
    border-right: 0;
  }
}
