:root {
  --ink: #241910;
  --ink-soft: #5c4a38;
  --paper: #f4ead7;
  --paper-2: #efe2c8;
  --rail: #2a2118;
  --rail-text: #f3e6cf;
  --brass: #a67c3d;
  --brass-deep: #7c5a28;
  --seal: #8d2f2a;
  --good: #2d6a4f;
  --line: #ddcfb6;
  --shadow: 0 16px 40px rgba(36, 25, 16, 0.12);
  color: var(--ink);
  font-family: "Segoe UI", Candara, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(166, 124, 61, 0.18), transparent 50%),
    linear-gradient(180deg, #e7dcc6 0%, #d9cbb0 100%);
  min-height: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif; font-weight: 600; margin: 0; }
a { color: var(--brass-deep); }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--brass);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--seal);
  font-family: Palatino, Georgia, serif;
  font-weight: 700;
}
.lede { color: var(--ink-soft); line-height: 1.45; }
label { display: block; font-size: 0.85rem; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbbfa8;
  background: #fffaf1;
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; }
.btn {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 10px 16px;
  margin-top: 16px;
}
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid #cbbfa8; }
.btn.danger { background: var(--seal); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.error { color: var(--seal); margin-top: 10px; }
.ok { color: var(--good); }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.rail {
  background: var(--rail);
  color: var(--rail-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail h1 { font-size: 1.45rem; }
.rail p { margin: 0 0 12px; color: #cbbba6; font-size: 0.85rem; }
.rail button {
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
}
.rail button.active, .rail button:hover { background: rgba(243, 230, 207, 0.1); }
.rail .spacer { flex: 1; }
.main { padding: 28px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 14px 0; }
.toolbar label { margin: 0; flex: 1; min-width: 160px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item, .source {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf1;
}
.source .meta, .muted { color: var(--ink-soft); font-size: 0.86rem; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: #efe4cf;
  font-size: 0.75rem;
  margin-right: 6px;
}
.pill.bad { background: #f3d2cf; color: var(--seal); }
.pill.good { background: #d7ecdf; color: var(--good); }
.group { margin-top: 18px; }
.group h3 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.flag {
  border-left: 4px solid var(--seal);
  background: #f8e8e4;
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 6px;
}
pre.detail {
  white-space: pre-wrap;
  font-family: Palatino, Georgia, serif;
  line-height: 1.45;
  background: #fffaf1;
  border-radius: 12px;
  padding: 14px;
}
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sections { display: grid; gap: 16px; }
.switcher { display: flex; gap: 8px; margin-bottom: 16px; }
.switcher button.active { background: var(--ink); color: var(--paper); }
.checkline { display: flex; gap: 10px; align-items: flex-start; }
.checkline input { width: auto; margin-top: 4px; }
details.group { background: #fffaf1; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
details.group summary { cursor: pointer; font-family: Palatino, Georgia, serif; font-size: 1.15rem; }
.campaign { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat { background: #fffaf1; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 120px; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rail .spacer { display: none; }
}
