:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --line: #d8dee8;
  --text: #172033;
  --muted: #607089;
  --blue: #2563eb;
  --green: #0f9f6e;
  --red: #d64545;
  --amber: #b7791f;
  --ink: #0f172a;
  --shadow: 0 10px 24px rgba(18, 31, 56, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  width: 100%;
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  padding: 0 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px;
}

textarea {
  resize: vertical;
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 700;
}

h2 {
  font-size: 22px;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.status-pill,
.tag {
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.status-pill.pending {
  border-color: #9db7f8;
  color: var(--blue);
}

.status-pill.success {
  border-color: #9bd8bd;
  color: var(--green);
}

.status-pill.error {
  border-color: #f0a8a8;
  color: var(--red);
}

.status-pill.blocked {
  border-color: #e3bd75;
  color: var(--amber);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-card {
  min-height: 78px;
  padding: 12px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

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

.main-column,
.side-column {
  min-width: 0;
}

.panel {
  margin-bottom: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.report-header,
.section-head {
  justify-content: space-between;
  gap: 12px;
}

.report-header p,
.guardrail p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric,
.timeline-item,
.report-section {
  border-radius: 6px;
  background: #f3f6fa;
  padding: 10px;
}

.metric span,
.timeline-item span,
.report-section span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong,
.timeline-item strong,
.report-section strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.report-section p {
  margin-top: 6px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.section-list,
.timeline {
  display: grid;
  gap: 8px;
}

.side-column .panel > * + * {
  margin-top: 8px;
}

.result-box {
  min-height: 120px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #e2e8f0;
  padding: 12px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .summary-grid,
  .workspace,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
