:root {
  --bg: #000;
  --panel: #0f1419;
  --panel-soft: #16181c;
  --line: #2f3336;
  --text: #e7e9ea;
  --muted: #71767b;
  --oppose: #f04438;
  --defend: #2f80ed;
  --abstain: #f2f4f7;
  --accent: #1d9bf0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 720px) 320px;
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px 72px;
}
.sidebar, .rightbar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
}
.brand {
  display: block;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.tagline { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  color: var(--text);
}
.nav-link:hover { background: var(--panel-soft); }
.main {
  min-height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(0,0,0,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.title { font-size: 20px; font-weight: 850; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.btn.secondary { background: var(--panel-soft); color: var(--text); border: 1px solid var(--line); }
.btn.oppose { background: var(--oppose); }
.btn.defend { background: var(--defend); }
.btn.abstain { background: var(--abstain); color: #101828; }
.feed-card, .panel {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.feed-card:hover { background: #080808; }
.meta { color: var(--muted); font-size: 13px; }
.debate-title { font-size: 21px; font-weight: 900; margin: 8px 0; line-height: 1.18; }
.context { color: #c7cbd1; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  background: var(--panel);
  color: var(--text);
}
.chip.oppose { color: #ffb4ad; border-color: rgba(240,68,56,.45); background: rgba(240,68,56,.11); }
.chip.defend { color: #b8d8ff; border-color: rgba(47,128,237,.5); background: rgba(47,128,237,.12); }
.chip.abstain { color: #f2f4f7; border-color: rgba(242,244,247,.38); background: rgba(242,244,247,.08); }
.meter {
  display: grid;
  grid-template-columns: var(--oppose-pct, 33fr) var(--defend-pct, 33fr) var(--abstain-pct, 34fr);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  margin: 14px 0 8px;
  background: var(--panel-soft);
}
.meter span:nth-child(1) { background: var(--oppose); }
.meter span:nth-child(2) { background: var(--defend); }
.meter span:nth-child(3) { background: var(--abstain); }
.form-stack { display: grid; gap: 12px; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: var(--panel);
}
.field textarea { min-height: 96px; resize: vertical; }
.error { color: #ffb4ad; font-size: 14px; margin-top: 4px; }
.notice { margin: 12px 18px; padding: 12px; background: rgba(18,183,106,.14); color: #75e0a7; border: 1px solid rgba(18,183,106,.25); border-radius: 8px; }
.comment {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.comment-body { margin: 6px 0 10px; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rank {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 900;
}
.right-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
.admin-grid, .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.debate-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
.side-column { padding: 16px; min-width: 0; }
.side-column.oppose { border-right: 1px solid rgba(240,68,56,.32); }
.side-column.defend { border-left: 1px solid rgba(47,128,237,.28); }
.side-column.abstain {
  border-top: 1px solid var(--line);
  padding: 16px;
}
.side-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  margin-bottom: 8px;
}
.profile-banner {
  height: 150px;
  background: linear-gradient(135deg, rgba(240,68,56,.55), rgba(47,128,237,.5) 55%, rgba(242,244,247,.2));
  border-bottom: 1px solid var(--line);
}
.profile-head {
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 4px solid var(--bg);
  background: var(--panel-soft);
  margin-top: -46px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
}
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(0,0,0,.94);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, 1fr);
}
.mobile-nav a { padding: 11px 4px; text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .rightbar { display: none; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); padding: 0 0 72px; }
  .sidebar { display: none; }
  .main { border-left: 0; border-right: 0; }
  .mobile-nav { display: grid; }
  .debate-columns { grid-template-columns: 1fr; }
  .side-column.oppose, .side-column.defend { border-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
}
