:root {
  color-scheme: light;
  --ink: #20242a;
  --muted: #69717d;
  --line: #d9dee5;
  --panel: #ffffff;
  --wash: #f4f7f6;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #a16207;
  --bad: #b42318;
  --good: #067647;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}

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

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 22px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions input {
  width: min(220px, 34vw);
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

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

p,
label,
.muted {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.main-panel {
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-title {
  margin-bottom: 0;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-button {
  min-height: 28px;
  padding: 0 8px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.filter-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.filter-button span {
  margin-left: 4px;
  color: inherit;
  opacity: 0.72;
}

.form-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.list {
  display: grid;
  gap: 8px;
}

.discovery-list:empty {
  display: none;
}

.item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item-button {
  text-align: left;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.item-button.active {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #fff;
  background: var(--muted);
}

.pill.success,
.pill.pass,
.pill.done,
.pill.merged_dev,
.pill.approved {
  background: var(--good);
}

.pill.failure,
.pill.fail,
.pill.blocked,
.pill.rejected {
  background: var(--bad);
}

.pill.warning,
.pill.queued,
.pill.running,
.pill.pending {
  background: var(--warn);
}

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

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

.meta-grid {
  margin-bottom: 16px;
}

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

.summary-tile {
  min-height: 82px;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-tile span,
.summary-tile small {
  color: var(--muted);
  font-size: 12px;
}

.summary-tile strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.meta {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.artifact-content {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .layout,
  .meta-grid,
  .activity-grid,
  .content-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 14px 16px;
  }
}
