:root {
  --bg: #f4f1ea;
  --panel: #fffdf7;
  --ink: #191919;
  --muted: #666057;
  --line: #d7d0c4;
  --red: #b62b32;
  --green: #1f6f4a;
  --blue: #315b72;
}

* { box-sizing: border-box; }

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

a { color: inherit; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 0 24px;
  border-bottom: 2px solid var(--ink);
}

.brand {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--ink);
}

.button.danger,
button.danger {
  background: var(--red);
  border-color: var(--red);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.danger-zone {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 14px;
  margin: 24px 0;
  align-items: start;
}

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

.critical {
  border-color: var(--red);
}

.metric {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.number {
  display: block;
  margin-top: 8px;
  font-family: Georgia, serif;
  font-size: 38px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item {
  display: grid;
  gap: 8px;
  border-left: 5px solid var(--line);
}

.item.approved_by_ai,
.item.approved_by_human { border-left-color: var(--green); }
.item.rejected_by_ai,
.item.rejected_by_human { border-left-color: var(--red); }
.item.curation_failed { border-left-color: #9b6b18; }

.meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.error {
  color: var(--red);
  font-weight: 700;
}

.success {
  color: var(--green);
  font-weight: 700;
}

.notice {
  margin: 10px 0;
}

.inline-form {
  margin-top: 10px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

td code {
  white-space: pre-wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

pre,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

textarea { min-height: 360px; }

.prompt-editor {
  min-height: 540px;
}

.login {
  max-width: 420px;
  margin: 12vh auto 0;
}

label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

@media (max-width: 820px) {
  .shell { padding: 16px; }
  .topbar,
  .settings-grid,
  .detail-grid { display: block; }
  .nav { margin-top: 12px; }
}
