:root{
  --bg: #0b0d10;
  --panel: #11151b;
  --border: #263040;
  --text: #e7edf5;
  --muted: #a9b4c3;
  --button: #1f6feb;
  --buttonText: #ffffff;
  --danger: #ff6b6b;
}

*{ box-sizing: border-box; }
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

.header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.authControls{
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.status{
  color: var(--text);
  margin-bottom: 12px;
  min-height: 20px;
  white-space: pre-line;
}

.statusError{ color: var(--danger); }

:root{
  --warn: #f1c40f;
}

.statusLoading{
  color: var(--warn);
  font-weight: 800;
  font-size: 20px;
}

.statusWarn{
  color: var(--warn);
  font-weight: 700;
}

.view.hidden{ display:none; }

.row{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.widgets{
  display: flex;
  gap: 12px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}

.widgetCard{
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--border);
  background: #0e1116;
  border-radius: 10px;
  padding: 12px;
}

.widgetLabel{
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.widgetValue{
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.widgetCardChatters{
  text-align: center;
}

.widgetCardChatters .widgetLabel{
  width: 100%;
}

.widgetCardChatters .widgetValue{
  width: 100%;
  font-size: 36px;
  line-height: 1.1;
}

.widgetChannelRow{
  display: flex;
  gap: 10px;
  align-items: center;
}

.widgetChannelText{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widgetChannelLink{
  color: var(--text);
  text-decoration: none;
}

.widgetChannelLink:hover{
  text-decoration: underline;
}

.widgetMeta{
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

#widgetFollows{
  white-space: pre-line;
}

.widgetAvatar{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0b0d10;
}

.controls{
  display: flex;
  gap: 10px;
  align-items: center;
}

.autoRefreshToggle{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}

.autoRefreshCountdown{
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.autoRefreshToggle input{
  width: 16px;
  height: 16px;
}

.indicator{
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--border);
  background: #0e1116;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.indicatorBad{
  color: var(--danger);
  border-color: var(--danger);
}

.label{ color: var(--muted); font-size: 14px; }
.select{
  background: #0e1116;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.button{
  display: inline-block;
  background: var(--button);
  color: var(--buttonText);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}

.buttonSecondary{
  background: #0e1116;
  color: var(--text);
  border: 1px solid var(--border);
}

.input{
  background: #0e1116;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.categoryCounts{
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 12px;
}

.countsRow{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
}

.countsButtons{
  display: flex;
  gap: 10px;
  align-items: center;
}

.countsRow .categoryCounts{
  margin: 0;
}

.link{
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
}

.tableWrap{
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.table th, .table td{
  border-bottom: 1px solid var(--border);
  padding: 10px 10px;
  text-align: left;
  vertical-align: middle;
}

.table th{ color: var(--muted); font-weight: 600; font-size: 13px; }

.sortTh{
  cursor: pointer;
  user-select: none;
}

.sortTh[data-sort-dir="asc"]::after{ content: " ▲"; }
.sortTh[data-sort-dir="desc"]::after{ content: " ▼"; }

/* Hide subscription column when not permitted */
.hideSubs .subCol{
  display: none;
}

.colAvatar{ width: 60px; }
.avatarHover{
  position: relative;
  display: inline-block;
}

.avatar{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0e1116;
}

.avatarPreview{
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0e1116;
  display: none;
  z-index: 50;
}

.avatarHover:hover .avatarPreview{
  display: block;
}

.nameLink{
  color: var(--text);
  text-decoration: none;
}

.nameLink:hover{
  text-decoration: underline;
}

.groupRow td{
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: #0e1116;
}

.badges{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badgePill{
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: #0e1116;
  padding: 3px 8px;
  border-radius: 999px;
}

.badgeImg{
  width: 18px;
  height: 18px;
  image-rendering: auto;
}

.smallBtn{
  background: #0e1116;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}

.newPill{
  margin-left: 8px;
  font-size: 11px;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 2px 6px;
  border-radius: 999px;
  vertical-align: middle;
}
