:root {
  --cream: #ead6c6;
  --cream-deep: #e2cbb8;
  --sand: #d7b7a3;
  --sand-hover: #c9a38d;
  --ink: #2b2b2b;
  --muted: #676767;
  --line: #eadfd6;
  --paper: #fffaf6;
  --white: #ffffff;
  --danger: #9b3b2e;
  --font: "Open Sans", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

a { color: var(--ink); }
a:hover { color: #8a6a55; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 40px;
  background: var(--cream);
}
.brand img { height: 28px; display: block; }
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 500;
}
.nav a { text-decoration: none; }
.account { color: var(--muted); font-size: 13px; }
.nav form { margin: 0; }

.wrap {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
  flex: 1;
}

.hero {
  margin-bottom: 36px;
}
.kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  color: #8a6a55;
  margin: 0 0 8px;
}
.hero h1, .page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 12px;
}
.lede {
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 0;
  border-radius: 200px;
  background: var(--sand);
  color: var(--white);
  text-decoration: none;
  font: 600 14px var(--font);
  cursor: pointer;
}
.btn:hover { background: var(--sand-hover); color: var(--white); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #c9b09c;
}
.btn-ghost:hover { background: rgba(255,255,255,0.45); color: var(--ink); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--sand);
}
.btn-outline:hover { background: var(--cream); color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0 28px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px 24px;
}
.stat span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat strong {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  display: block;
}
.stat em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
}
.band-fail { color: #2a8a4a; }
.band-pass { color: #d27a2c; }
.band-high { color: #c43328; }
.band-none { color: var(--muted); }
.stat strong.band-fail,
.stat strong.band-pass,
.stat strong.band-high { color: inherit; }
.stat strong.band-fail { color: #2a8a4a; }
.stat strong.band-pass { color: #d27a2c; }
.stat strong.band-high { color: #c43328; }

.pill.band-fail { background: #e6f5ea; }
.pill.band-fail strong, .pill.band-fail em { color: #2a8a4a; }
.pill.band-pass { background: #fdebd6; }
.pill.band-pass strong, .pill.band-pass em { color: #d27a2c; }
.pill.band-high { background: #f8e0dc; }
.pill.band-high strong, .pill.band-high em { color: #c43328; }

.color-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 28px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.color-key .swatch { font-weight: 700; }
.color-key .hint { flex-basis: 100%; font-size: 12px; }
.guide .color-key { margin: 0 0 20px; padding: 0; border: 0; background: transparent; }

.guide {
  margin-top: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 28px 32px;
}
.guide h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 8px;
}
.guide > p { color: var(--muted); line-height: 1.6; margin: 0 0 20px; max-width: none; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.guide h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.guide ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.chip {
  display: inline-block;
  min-width: 64px;
  font-weight: 600;
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.job {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.warn { color: var(--danger); }

.posts { display: grid; gap: 16px; }
.post-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 24px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px 28px;
}
.post-card h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 8px;
  line-height: 1.2;
}
.post-card h2 a { text-decoration: none; }
.post-meta { color: var(--muted); font-size: 13px; margin: 0; }
.score-pills { display: flex; gap: 10px; }
.pill {
  min-width: 88px;
  text-align: center;
  background: var(--cream);
  padding: 10px 14px;
}
.pill span { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pill strong { font-family: var(--serif); font-size: 26px; font-weight: 500; display: block; }
.pill em { display: block; font-style: normal; font-size: 12px; font-weight: 600; margin-top: 2px; }
.post-actions { display: flex; gap: 10px; grid-column: 1 / -1; }

.empty {
  background: var(--white);
  border: 1px dashed var(--sand);
  padding: 36px;
  text-align: center;
  color: var(--muted);
}

.login-panel {
  max-width: 420px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 36px 32px 40px;
}
.login-panel h1 { font-family: var(--serif); font-size: 36px; font-weight: 500; margin: 0 0 8px; }
.login-panel p { color: var(--muted); margin: 0 0 24px; }
label { display: block; margin: 0 0 16px; font-size: 13px; font-weight: 600; }
input[type="email"], input[type="password"] {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  font: 16px var(--font);
}
.error { color: var(--danger); font-size: 14px; }

.detail-head { margin-bottom: 28px; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.detail-actions { display: flex; gap: 12px; margin: 20px 0 0; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px;
}
.panel h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 16px;
}
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.rows span { color: var(--muted); }
.audit { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }

.wrap.wide { width: min(1280px, calc(100% - 32px)); }
.panel h2 .count {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 8px;
}
.panel h3.subhead {
  margin: 20px 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rows strong .pts {
  display: inline;
  margin-left: 8px;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}
.url-cell {
  word-break: break-all;
  font-weight: 500;
  text-align: right;
}
.data-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--white);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--paper); }
.raw-json {
  margin: 0;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
  overflow: auto;
  max-height: 420px;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-footer {
  background: #1c1c1c;
  color: #cfcfcf;
  text-align: center;
  padding: 28px 16px;
  font-size: 13px;
}
.site-footer p { margin: 0; }

@media (max-width: 760px) {
  .site-header { padding: 14px 18px; flex-wrap: wrap; }
  .stats, .detail-grid, .post-card, .guide-grid { grid-template-columns: 1fr; }
  .account { display: none; }
}
