/* ===== SERVER RAIL (far left) ===== */
.server-rail {
  width: 60px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  flex-shrink: 0;
  overflow-y: auto;
}
.server-rail::-webkit-scrollbar { width: 0; }

.srv-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--sidebar-hover-bg);
  border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px; font-weight: 800;
  color: var(--sidebar-text);
  transition: all 0.18s;
  flex-shrink: 0;
  position: relative;
  font-family: 'DM Serif Display', serif;
  letter-spacing: -0.02em;
  overflow: hidden;
}
.srv-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.srv-icon:hover {
  border-radius: 14px;
  color: var(--sidebar-active);
  border-color: var(--accent2);
  background: var(--sidebar-active-bg);
}
.srv-icon.active {
  border-radius: 14px;
  border-color: var(--accent2);
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
}
/* Active pip */
.srv-icon.active::before {
  content: '';
  position: absolute;
  left: -9px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 60%;
  background: var(--accent2);
  border-radius: 0 3px 3px 0;
}
.srv-notif {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--sidebar-bg);
}
.srv-divider {
  width: 28px; height: 1.5px;
  background: var(--sidebar-border);
  border-radius: 1px;
  flex-shrink: 0;
  margin: 3px 0;
}
.srv-add {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: none;
  border: 2px dashed var(--sidebar-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--sidebar-text);
  font-size: 20px; line-height: 1;
  transition: all 0.18s; flex-shrink: 0;
}
.srv-add:hover { border-color: var(--green); color: var(--green); border-radius: 14px; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-top {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.wordmark {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.02em;
  line-height: 1;
}
.wordmark span {
  color: var(--accent2);
  font-style: italic;
}

.workspace-name {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  font-family: 'DM Mono', monospace;
  margin-top: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Channels list */
.channels-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  min-height: 0;
}
.channels-scroll::-webkit-scrollbar { width: 0; }

.ch-section-label {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  padding: 10px 16px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ch-section-label button {
  background: none; border: none;
  color: rgba(255,255,255,0.22);
  font-size: 16px; cursor: pointer;
  line-height: 1; transition: color 0.15s;
  padding: 0 2px;
}
.ch-section-label button:hover { color: var(--accent2); }

.ch-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 16px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.ch-item:hover { color: var(--sidebar-active); background: var(--sidebar-hover-bg); }
.ch-item.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  border-left-color: var(--accent2);
  font-weight: 500;
}
.ch-item .ch-hash {
  font-family: 'DM Mono', monospace;
  font-size: 12px; opacity: 0.6;
  flex-shrink: 0; width: 14px; text-align: center;
}
.ch-item .ch-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--amber-light); flex-shrink: 0; }
.ch-live {
  font-size: 9px; font-family: 'DM Mono', monospace;
  background: var(--green); color: white;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ===== VOICE CONTROLS PANEL (above user strip) ===== */
.voice-controls-panel {
  border-top: 1px solid var(--sidebar-border);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* Status bar: shown when in voice, shows channel name + leave */
.vc-status-bar {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(58,158,106,0.12);
  border: 1px solid rgba(58,158,106,0.3);
  border-radius: 7px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--green);
}
.vc-status-bar.visible { display: flex; }
.vc-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: vcpulse 1.8s ease infinite;
  flex-shrink: 0;
}
@keyframes vcpulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.vc-status-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-leave-btn {
  background: none; border: none;
  color: var(--red); cursor: pointer;
  font-size: 14px; padding: 2px 4px;
  border-radius: 4px; line-height: 1;
  transition: all 0.15s;
}
.vc-leave-btn:hover { background: rgba(217,79,61,0.15); }

/* Icon button row */
.vc-btn-row {
  display: flex;
  gap: 5px;
  align-items: center;
}
.vc-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 7px 4px 5px;
  background: var(--sidebar-hover-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: all 0.17s;
  font-family: 'DM Sans', sans-serif;
}
.vc-btn:hover { background: var(--sidebar-active-bg); color: var(--sidebar-active); border-color: rgba(255,255,255,0.15); }
.vc-btn .vci { font-size: 16px; line-height: 1; }
.vc-btn .vcl { font-size: 9px; font-family: 'DM Mono', monospace; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }

/* Active states */
.vc-btn.vc-active-voice { background: rgba(58,158,106,0.15); border-color: rgba(58,158,106,0.4); color: var(--green); }
.vc-btn.vc-active-cam   { background: rgba(74,128,196,0.15); border-color: rgba(74,128,196,0.4); color: var(--blue); }
.vc-btn.vc-active-screen{ background: rgba(212,116,42,0.15); border-color: rgba(212,116,42,0.4); color: var(--amber); }
.vc-btn.vc-muted        { background: rgba(217,79,61,0.12);  border-color: rgba(217,79,61,0.35);  color: var(--red); }
.vc-btn.vc-deafened     { background: rgba(217,79,61,0.12);  border-color: rgba(217,79,61,0.35);  color: var(--red); }

/* Bottom user strip */
.sidebar-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.my-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.my-name { color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500; line-height: 1.2; }
.my-status { color: rgba(255,255,255,0.28); font-size: 10px; font-family: 'DM Mono', monospace; }
.foot-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.28);
  font-size: 15px; cursor: pointer;
  padding: 4px; border-radius: 4px;
  transition: all 0.15s; line-height: 1;
}
.foot-btn:hover { color: rgba(255,255,255,0.9); background: var(--sidebar-hover-bg); }

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

/* Channel bar at top — the key UI */
.channel-bar {
  background: var(--paper);
  border-bottom: 1.5px solid var(--rule);
  flex-shrink: 0;
}

.channel-bar-top {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--rule);
}

.channel-title-area {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.channel-sigil {
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  color: var(--ink3);
  flex-shrink: 0;
}

.channel-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-topic {
  font-size: 12px;
  color: var(--ink3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid var(--rule);
  margin-left: 2px;
}


/* Live people row — shown when someone is in voice */
.live-row {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 20px 10px;
  flex-wrap: wrap;
}
.live-row.visible { display: flex; }
.live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 5px;
  border-radius: 20px;
  background: var(--paper2);
  border: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink2);
  font-weight: 500;
}
.live-pill .pill-av {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.live-pill.speaking {
  border-color: var(--green);
  background: rgba(58,158,106,0.1);
}
.live-indicator {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--green);
  font-weight: 500;
  letter-spacing: 0.04em;
  animation: blink 1.8s ease infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

