:root {
  --bg: #0e1017;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --text: #f7f8fa;
  --muted: #a9b3c1;
  --accent: #22c55e;
  --accent-2: #7dd3fc;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.12), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(125, 211, 252, 0.2), transparent 32%),
              linear-gradient(135deg, #0b1220, #0e1017 50%, #0a0c12);
  color: var(--text);
}
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #34d399, #22c55e);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0c100f;
  box-shadow: 0 14px 40px rgba(52, 211, 153, 0.35);
}
h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: var(--card-shadow);
}
.settings-wrap {
  position: relative;
}
.settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  box-shadow: var(--card-shadow);
}
.settings-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}
.settings-btn .rpc-header-dot {
  margin-left: 0;
}
.settings-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 320px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #141923;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  flex-direction: column;
  gap: 14px;
}
.settings-popover.open {
  display: flex;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-label {
  font-size: 12px;
  font-weight: 600;
  color: #d1d5db;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.settings-popover select,
.settings-popover input {
  width: 100%;
  padding: 10px 36px 10px 10px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 19, 28, 0.6);
  font-size: 13px;
}
.settings-popover select:focus,
.settings-popover input:focus {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
}
.controls label {
  font-size: 13px;
  color: var(--muted);
}
.rpc-select-wrap {
  position: relative;
}
.rpc-select-wrap select,
.rpc-select-wrap input {
  width: 100%;
}
.rpc-custom-input {
  display: none;
}
.rpc-select-wrap.is-custom select {
  display: none;
}
.rpc-select-wrap.is-custom .rpc-custom-input {
  display: block;
  padding-right: 76px;
}
.rpc-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  width: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  line-height: 1;
}
.rpc-select-wrap.is-custom .rpc-toggle {
  display: inline-flex;
}
.rpc-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.rpc-header-dot {
  margin-left: auto;
  pointer-events: auto;
}
.rpc-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.rpc-dot.loading {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
}
.rpc-dot.error {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}
select, input, button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s, transform 0.1s;
}
.controls.account-controls input {
  background: rgba(15, 19, 28, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.controls.account-controls input:focus {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
}
.controls.account-controls input,
.controls.account-controls button {
  padding: 12px 12px;
  border-radius: 10px;
}
select option {
  background: #0b1220;
  color: var(--text);
}
select:focus, input:focus {
  border-color: var(--accent-2);
}
button {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.35);
}
button:active { transform: translateY(1px); }
.rpc-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 600;
}
.rpc-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}
.rpc-toggle:active {
  transform: translateY(-50%);
}
.input-group {
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
}
.input-group input { flex: 1; }
.rpc-status {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
}
.rpc-status:empty {
  display: none;
}
.rpc-status.error {
  color: #fecaca;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.card {
  background: #0f131c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  min-height: 120px;
  isolation: isolate;
}
.card.no-blur {
  background: #0f131c;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.stat-value {
  font-size: 26px;
  font-weight: 600;
  margin: 4px 0;
}
.stat-sub { color: var(--muted); font-size: 13px; }
.account-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 12px 8px 0;
  min-width: 100px;
  text-align: center;
}
.account-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 4px;
}
.account-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.account-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 120px;
}
.account-info {
  flex: 1;
  min-width: 0;
}
.account-bio {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.vote-info {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.vote-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}
.vote-slider {
  width: 100%;
  padding: 0;
}
.avatar {
  width: 100px;
  height: 100px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #1f2937, #0f172a);
  box-shadow: var(--card-shadow);
}
.inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline.align-baseline {
  align-items: baseline;
}
.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: #bae6fd;
  font-size: 12px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  cursor: default;
}
.pill.green {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
}
.pill.toggle {
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.pill.toggle.active {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.5);
}
.pill.toggle:active {
  transform: translateY(1px);
}
.list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--panel-strong);
  padding: 14px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  min-height: 76px;
}
.analytics-grid .row {
  background: #111725;
  backdrop-filter: none;
  position: relative;
  z-index: 1;
}
.analytics-card {
  background: #0f131c;
}
.row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 70px;
}
.icon-author { color: #22c55e; }
.icon-curation { color: #38bdf8; }
.icon-pending-curation { color: #2dd4bf; }
.icon-pending-author { color: #c084fc; }
.icon-witness { color: #a78bfa; }
.icon-interest { color: #f59e0b; }
.icon-bg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.28;
  width: 56px;
  height: 56px;
  pointer-events: none;
}
.icon-bg svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}
.row .label { color: #dfe4ec; font-size: 13px; font-weight: 600; }
.row .value { font-weight: 600; text-align: right; }
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.charts-container-card {
  background: #0f131c;
}
.chart-box {
  position: relative;
  height: 240px;
}
.stacked {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.collapse-btn {
  cursor: pointer;
  user-select: none;
}
.collapse-body {
  margin-top: 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
th { text-align: left; color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }
.table-wrap { overflow-x: auto; }
.pending-card .table-wrap {
  margin-top: 6px;
}
.pending-card {
  overflow: hidden;
}
.pending-table {
  border-collapse: separate;
  border-spacing: 0;
}
.pending-table th, .pending-table td { white-space: nowrap; }
.pending-table td:nth-child(2) { white-space: normal; }
.pending-table tr:nth-child(odd) { background: rgba(255,255,255,0.02); }
.pending-table tr:hover { background: rgba(255,255,255,0.05); }
.pending-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.pending-table thead th.sortable::after {
  content: '';
  margin-left: 6px;
  opacity: 0.6;
}
.pending-table thead th.sortable.sorted-asc::after {
  content: ' ^';
}
.pending-table thead th.sortable.sorted-desc::after {
  content: ' v';
}
.pending-icon { text-align: center; }
.pending-title a { color: #bfdbfe; text-decoration: none; }
.pending-title a:hover { text-decoration: underline; }
.pending-table th.numeric,
.pending-table td.numeric {
  text-align: right;
}
.pending-scroll {
  max-height: 420px;
  overflow: auto;
  position: relative;
  background: #0f131c;
}
.pending-curation-table {
  width: 100%;
  table-layout: fixed;
}
.pending-curation-table thead th,
.pending-author-table thead th {
  position: sticky;
  top: 0;
  background: #0f131c;
  z-index: 2;
}
.pending-curation-table tfoot td,
.pending-author-table tfoot td {
  position: sticky;
  bottom: -1px;
  border-top: 1px solid var(--border);
  background: #0f131c;
  z-index: 3;
  box-shadow: 0 -1px 0 var(--border), 0 -2px 0 #0f131c;
}
.empty {
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0 0;
}
.error { color: var(--danger); font-weight: 600; }
footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
@media (max-width: 700px) {
  header { flex-direction: column; }
  .controls { width: 100%; }
  .settings-popover {
    min-width: 0;
    width: calc(100vw - 32px);
    right: -8px;
  }
  .rpc-status { text-align: left; }
  .input-group { flex-direction: column; }
  .input-group input { width: 100%; }
  button { width: 100%; }
}

@font-face {
  font-display: swap;
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  src: url('space-grotesk-v22-latin-regular.woff2') format('woff2'),
       url('space-grotesk-v22-latin-regular.ttf') format('truetype');
}
