:root {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #f0ebe1;
  --ink: #1d1a16;
  --ink-2: #5d564c;
  --line: #e2dacb;
  --accent: #e8553a;
  --accent-ink: #fff;
  --human: #2f8f6b;
  --assisted: #d79a1f;
  --ai: #d2412d;
  --human-bg: rgba(47, 143, 107, 0.14);
  --assisted-bg: rgba(215, 154, 31, 0.18);
  --ai-bg: rgba(210, 65, 45, 0.16);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 26, 22, 0.05), 0 8px 24px rgba(29, 26, 22, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --surface: #1e1b17;
    --surface-2: #2a2620;
    --ink: #f3ede2;
    --ink-2: #a89f91;
    --line: #353028;
    --human-bg: rgba(47, 143, 107, 0.25);
    --assisted-bg: rgba(215, 154, 31, 0.25);
    --ai-bg: rgba(210, 65, 45, 0.28);
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: Fraunces, Georgia, serif; margin: 0; }
button, input { font: inherit; color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.masthead { padding: 32px 24px 8px; max-width: 1400px; margin: 0 auto; }
.brand { display: flex; gap: 16px; align-items: center; color: inherit; text-decoration: none; }
.mark {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  font-size: 28px; font-family: Georgia, serif;
}
.brand h1 { font-size: 34px; letter-spacing: -0.02em; }
.brand p { margin: 2px 0 0; color: var(--ink-2); }

.board {
  max-width: 1400px; margin: 0 auto; padding: 24px;
  display: grid; gap: 16px;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1.2fr) minmax(360px, 2fr);
  align-items: start;
}

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.panel h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); font: 600 12px Inter, sans-serif; color: var(--ink-2);
}

.search input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--surface); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px;
  max-height: 62vh; overflow-y: auto; }
.list li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 8px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
}
.list li button:hover { background: var(--surface-2); }
.list li button[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.list img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.list .artist-img { border-radius: 50%; }
.list .meta { min-width: 0; display: flex; flex-direction: column; }
.list .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .hint { padding: 16px 8px; color: var(--ink-2); font-size: 14px; }

.chip {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: 3px 10px; font-size: 13px; cursor: pointer; max-width: 60%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip:hover { border-color: var(--accent); }

.now-playing { display: flex; gap: 14px; align-items: center; }
.now-playing img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.now-playing .t { font-family: Fraunces, Georgia, serif; font-size: 22px; font-weight: 700; line-height: 1.2; }

.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.links a, .foot a, .prose a { color: var(--accent); text-decoration: none; }
.links a:hover, .foot a:hover, .prose a:hover { text-decoration: underline; }
#verdict-empty { margin: 0; }
.primary {
  border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }

.verdict { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.verdict .label { font-family: Fraunces, Georgia, serif; font-size: 26px; font-weight: 700; line-height: 1.1; }
.verdict.human .label { color: var(--human); }
.verdict.assisted .label { color: var(--assisted); }
.verdict.ai .label { color: var(--ai); }
.verdict.error { border-color: var(--ai); color: var(--ai); }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.verdict a { color: var(--accent); font-size: 13px; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block; vertical-align: -3px;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ad-slot { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

.recent { max-width: 1400px; margin: 0 auto; padding: 16px 24px 24px; }
.recent h2 { font-size: 22px; margin-bottom: 12px; }
.recent-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.recent-grid button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.recent-grid button:hover { border-color: var(--accent); }
.recent-grid img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.recent-grid .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.recent-grid .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-grid .sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { flex: none; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pill.human { background: var(--human-bg); color: var(--human); }
.pill.assisted { background: var(--assisted-bg); color: var(--assisted); }
.pill.ai { background: var(--ai-bg); color: var(--ai); }

.prose { max-width: 720px; margin: 0 auto; padding: 16px 24px 32px; line-height: 1.7; }
.prose h2 { font-size: 22px; margin: 28px 0 8px; }

.foot { text-align: center; padding: 8px 16px 32px; }
.foot p { margin: 4px 0; }

@media (max-width: 1080px) {
  .board { grid-template-columns: 1fr 1fr; }
  .panel-wide { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .masthead { padding: 20px 16px 0; }
  .brand h1 { font-size: 28px; }
  .board { grid-template-columns: 1fr; padding: 16px; }
  .recent, .ad-slot, .prose { padding-left: 16px; padding-right: 16px; }
  .list { max-height: 40vh; }
}
