:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-strong: rgba(255, 255, 255, 0.18);
  --text-primary: #ffffff;
  --text-secondary: rgba(245, 245, 245, 0.7);
  --border: rgba(255, 255, 255, 0.22);
  --highlight: rgba(255, 255, 255, 0.85);
  --shadow: 0 0 0 1px rgba(255,255,255,0.08);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top, rgba(255,255,255,0.04), transparent 16%),
              linear-gradient(180deg, #090b10 0%, #07080d 100%);
  color: var(--text-primary);
  font-family: var(--font-family);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 14%),
              radial-gradient(circle at 80% 20%, rgba(100, 160, 245, 0.07), transparent 16%);
  opacity: 0.22;
  pointer-events: none;
}

.page-shell {
  padding: 80px 36px 40px;
  display: grid;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
}

.top-bar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(10, 10, 10, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  justify-content: flex-end;
}

.social-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.social-bar span {
  color: rgba(255,255,255,0.72);
}

.social-bar a {
  color: #9bb7ff;
  text-decoration: none;
  font-weight: 700;
}

.social-bar a:hover,
.social-bar a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.line-chart text {
  font-family: var(--font-family);
  pointer-events: none;
}

.social-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.social-bar a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.social-bar a:hover,
.social-bar a:focus-visible {
  color: #ffffff;
  border-color: rgba(255,255,255,0.35);
}

.axis-label {
  font-family: var(--font-family);
  fill: rgba(255,255,255,0.68);
}

.vote-status {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 220px;
  text-align: right;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-secondary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 2.2vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.intro {
  margin: 20px 0 0;
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.action-pill {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 160px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.action-pill:hover,
.action-pill:focus-visible {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}

.action-pill.disabled,
.action-pill:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.glass-card {
  position: relative;
  grid-column: span 12;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 16, 24, 0.95);
  border-radius: 28px;
  box-shadow: 0 20px 90px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px);
  overflow: hidden;
  padding: 32px;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255,255,255,0.06), transparent 52%);
}

.card-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.main-bar-card {
  grid-column: span 12;
  min-height: auto;
  padding: 40px;
}

.main-bar-container {
  position: relative;
  margin-bottom: 60px;
}

.bar-wrapper {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
}

.bar-background {
  flex: 1;
  height: 120px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #6dcff6 0%, #4a99ce 70%);
  border-radius: 24px;
  transition: width 0.8s ease;
  width: 82%;
}

.bar-label-container {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 140px;
}

.bar-value {
  font-size: 4.2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.bar-unit {
  font-size: 2rem;
  font-weight: 700;
  opacity: 0.8;
}

.bar-status {
  position: absolute;
  bottom: -40px;
  left: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ban-wave-section {
  margin-top: 70px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ban-wave-header {
  margin-bottom: 24px;
}

.ban-wave-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ban-wave-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}

.ban-wave-background {
  flex: 1;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.ban-wave-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #6dcff6 0%, #4a99ce 100%);
  border-radius: 16px;
  transition: width 0.6s ease-out;
  width: 45%;
}

.ban-wave-value {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 80px;
  text-align: right;
  color: var(--text-primary);
}

/* Line chart styles */
.line-graph-wrapper {
  width: 100%;
}

.line-graph-head {
  margin-bottom: 12px;
}

.chart-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.chart-controls select {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.visually-hidden { position: absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }

.line-graph-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.legend-swatch {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-swatch.bans { background: linear-gradient(90deg,#7bd5ff,#4090c5); }
.legend-swatch.reports { background: linear-gradient(90deg,#c7e4ff,#8ab7dc); }

.line-chart {
  width: 100%;
  height: 220px;
  overflow: visible;
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
}

.grid line { stroke: rgba(255,255,255,0.08); stroke-width: 1; }

/* Y axis labels */
.y-axis {
  position: absolute;
  left: -56px;
  top: 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.line-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.line-bans { stroke: url(#bansGradient); stroke-width: 5; }
.line-reports { stroke: url(#reportsGradient); stroke-dasharray: 6 6; stroke-width: 3; opacity: 0.95; }

.point-bans { fill: #fff; stroke: rgba(255,80,80,0.95); stroke-width: 2; }
.point-reports { fill: #fff; stroke: rgba(80,120,255,0.95); stroke-width: 2; }

.line-graph-stats { display: flex; gap: 36px; margin-top: 12px; }
.stat { display: flex; flex-direction: column; color: var(--text-secondary); }
.stat-label { font-size: 0.9rem; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }

.detection-list .feed-item p { color: var(--text-secondary); margin: 6px 0 0; }
.detection-list .feed-icon { width: 48px; height: 48px; display:grid; place-items:center; font-size:1.1rem; flex-shrink:0; stroke:var(--text-primary); }

.backend-status { display:inline-block; vertical-align:middle; }

.y-axis-label { position: absolute; left: 12px; top: 0; color: var(--text-secondary); font-size:0.9rem; }

.feed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.feed-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 22px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.feed-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  font-size: 1.3rem;
}

.feed-item strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.feed-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .main-bar-card {
    grid-column: span 1;
  }
  .bar-background {
    height: 100px;
  }
  .bar-value {
    font-size: 3.2rem;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 24px;
  }
  .hero-panel {
    grid-template-columns: 1fr;
  }
  .action-pill {
    width: 100%;
  }
  .main-bar-card {
    padding: 28px;
  }
  .bar-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .bar-background {
    width: 100%;
    height: 80px;
  }
  .bar-label-container {
    min-width: auto;
  }
  .bar-value {
    font-size: 2.8rem;
  }
  .ban-wave-bar-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  .ban-wave-background {
    width: 100%;
  }
  .ban-wave-value {
    align-self: flex-start;
  }
}
