:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #66706c;
  --line: #d9dfdc;
  --surface: #ffffff;
  --band: #f5f7f3;
  --accent: #19645f;
  --accent-strong: #0f4a46;
  --warn: #9a5b00;
  --bad: #9d2f35;
  --good: #1d6b3a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--band);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.title-group {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.stage-label {
  display: inline-flex;
  margin: 12px 0 6px;
  border: 1px solid #b9cac4;
  border-radius: 999px;
  background: #edf4ef;
  color: var(--accent-strong);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-guide {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.demo-banner {
  max-width: 360px;
  border: 1px solid #f0d391;
  border-radius: 8px;
  background: #fff8e8;
  color: #5f4206;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

main {
  padding: 24px 34px 34px;
}

.summary-grid,
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.outcome-card,
.publication-summary,
.artifacts,
.detail-panel,
.row-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric,
.outcome-card {
  padding: 14px 16px;
}

.metric span,
.outcome-card span,
.facts span,
.artifact-card span,
.stage-badges span,
.note-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong,
.outcome-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.publication-summary,
.artifacts {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
}

.summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.summary-generated {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.outcome-card.ready {
  background: #eef8f0;
}

.outcome-card.held {
  background: #fff8e8;
}

.outcome-card.archived,
.outcome-card.duplicate {
  background: #fbeced;
}

.table-wrap {
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--band);
  text-align: left;
}

th button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

td {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}

td strong {
  display: block;
  line-height: 1.25;
}

td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.artifact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.artifact-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--band);
}

code {
  overflow-wrap: anywhere;
  color: var(--accent-strong);
  font-size: 12px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.controls input,
.controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
  gap: 16px;
  align-items: start;
}

.row-list {
  overflow: hidden;
}

.list-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.row-item {
  display: grid;
  width: 100%;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.row-item:hover,
.row-item.selected {
  background: #eef6f2;
}

.row-item strong {
  line-height: 1.25;
}

.row-item span {
  color: var(--muted);
  font-size: 13px;
}

.detail-panel {
  min-height: 360px;
  padding: 26px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.row-id {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.stage-badges,
.facts,
.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.stage-badges {
  margin: 16px 0;
}

.stage-badges section,
.facts div,
.note-grid div {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.facts strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 900;
}

.badge.approved {
  background: #ddf3e4;
  color: #0c6b36;
}

.badge.deferred {
  background: #ffedc8;
  color: #7a4d00;
}

.badge.rejected {
  background: #f8d9dc;
  color: #8e2029;
}

.review-summary {
  margin-top: 20px;
  border: 1px solid #c9d8d1;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfdfa;
}

.note-grid p {
  margin: 6px 0 0;
}

section {
  margin-top: 18px;
}

.suggestions {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 900px) {
  .topbar,
  .summary-heading {
    display: grid;
  }

  .demo-banner {
    max-width: none;
  }

  .summary-grid,
  .outcome-grid,
  .controls,
  .workspace,
  .artifact-list {
    grid-template-columns: 1fr;
  }

  .stage-badges,
  .facts,
  .note-grid {
    grid-template-columns: 1fr;
  }

  main,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
}
