:root {
  --bg: #12100f;
  --panel: #1b1715;
  --panel-alt: #231d1a;
  --ink: #f5efe7;
  --muted: #bdaea2;
  --accent: #d66a2a;
  --accent-soft: #f3c5a8;
  --line: #3c3028;
  --shadow: 0 18px 50px rgba(0,0,0,0.25);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Georgia, "Times New Roman", serif; background: radial-gradient(circle at top left, rgba(214,106,42,0.18), transparent 30%), linear-gradient(180deg, #151210 0%, #0f0d0c 100%); color: var(--ink); }
a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 300px 1fr; }
.sidebar { padding: 28px; border-right: 1px solid var(--line); background: rgba(20, 16, 15, 0.9); position: sticky; top: 0; height: 100vh; }
.content { padding: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-soft); font-size: 0.72rem; }
.lede { color: var(--muted); max-width: 60ch; }
.nav { display: grid; gap: 10px; margin: 28px 0; }
.nav a, button, input, textarea, select { font: inherit; }
.nav a, button, .pill-link { border-radius: 10px; }
.nav a { padding: 10px 12px; background: var(--panel); border: 1px solid transparent; }
.nav a:hover { background: var(--panel-alt); border-color: var(--line); }
.hero, .panel { background: rgba(27, 23, 21, 0.92); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.toolbar, .grid-form, .stack, .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.grid-form input, .grid-form button, .toolbar input, .toolbar select, .toolbar button, .stack input, .stack textarea, .stack button, .stack label, .stack select { width: 100%; }
input, textarea, select { background: #100d0c; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
button, .pill-link { background: var(--accent); color: white; border: 0; padding: 12px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
button.secondary { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.table { display: grid; }
.table-row, .row, .snapshot, .history-item, .candidate { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.table-row { grid-template-columns: 60px 1.5fr 1fr 140px; align-items: center; }
.row { grid-template-columns: repeat(3, minmax(0, auto)); align-items: center; }
.rank { font-size: 1.4rem; color: var(--accent-soft); }
.note, .presence-card { background: var(--panel-alt); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 12px; }
.badge { padding: 2px 8px; background: rgba(214,106,42,0.15); border: 1px solid rgba(214,106,42,0.35); border-radius: 999px; }
.login-shell { display: grid; min-height: 100vh; place-items: center; }
.login-card { width: min(520px, calc(100vw - 32px)); padding: 32px; background: rgba(27, 23, 21, 0.94); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.error { color: #ffb0b0; }
pre { white-space: pre-wrap; word-break: break-word; background: #100d0c; padding: 12px; border-radius: 10px; border: 1px solid var(--line); }
.autocomplete-bar { display: flex; gap: 12px; align-items: center; width: 100%; }
.lookup-status { color: var(--muted); font-size: 0.92rem; }
.lookup-results { display: grid; gap: 10px; width: 100%; }
.lookup-choice { text-align: left; background: var(--panel-alt); border: 1px solid var(--line); color: var(--ink); }
.lookup-choice:hover { border-color: var(--accent); }

.public-body {
  background:
    radial-gradient(circle at 10% 0%, rgba(214,106,42,0.23), transparent 25%),
    radial-gradient(circle at 100% 20%, rgba(243,197,168,0.12), transparent 22%),
    linear-gradient(180deg, #15110f 0%, #0d0b0a 100%);
}
.public-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(13, 11, 10, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 10;
}
.brand-lockup {
  display: inline-grid;
  gap: 4px;
  color: var(--ink);
}
.brand-lockup strong {
  font-size: 1.1rem;
}
.public-shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}
.public-hero {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}
.public-copy,
.public-sidecard,
.public-list-panel {
  background: rgba(27, 23, 21, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.public-copy {
  padding: 30px;
}
.public-copy h1 {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.96;
  margin: 0 0 18px;
  max-width: 9ch;
}
.public-sidecard {
  padding: 24px;
  color: var(--muted);
}
.public-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.stat-chip {
  min-width: 120px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(243,197,168,0.08);
  border: 1px solid rgba(243,197,168,0.16);
}
.stat-chip strong {
  display: block;
  font-size: 1.5rem;
  color: var(--ink);
}
.stat-chip span {
  color: var(--muted);
  font-size: 0.9rem;
}
.public-list-panel {
  padding: 26px;
}
.public-list-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}
.public-small {
  color: var(--muted);
  margin: 0;
}
.public-list {
  display: grid;
}
.public-row {
  display: grid;
  grid-template-columns: 70px 1fr 140px;
  gap: 18px;
  align-items: center;
  padding: 16px 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.public-rank {
  font-size: 2rem;
  color: var(--accent-soft);
}
.public-song-meta h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.public-song-meta p,
.public-band {
  margin: 0;
  color: var(--muted);
}
.public-band {
  text-align: right;
}

@media (max-width: 980px) {
  .shell, .grid.two, .public-hero {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: static;
  }
  .table-row, .row, .public-row {
    grid-template-columns: 1fr;
  }
  .public-topbar,
  .public-list-head {
    align-items: start;
    flex-direction: column;
  }
  .public-band {
    text-align: left;
  }
}
