/* ── Discord color tokens ───────────────────────────────────────────────────── */
:root {
  --bg-primary:       #313338;
  --bg-secondary:     #2b2d31;
  --bg-tertiary:      #1e1f22;
  --bg-accent:        #404249;
  --bg-hover:         rgba(79,84,92,.16);
  --bg-active:        rgba(79,84,92,.32);
  --bg-floating:      #111214;
  --bg-input:         #1e1f22;
  --bg-textarea:      #383a40;

  --text-normal:      #dbdee1;
  --text-muted:       #80848e;
  --header-primary:   #f2f3f5;
  --header-secondary: #b5bac1;
  --interactive-normal:  #b5bac1;
  --interactive-hover:   #dbdee1;
  --interactive-active:  #ffffff;
  --channel-default: #80848e;

  --brand:        #5865f2;
  --brand-hover:  #4752c4;
  --green:        #23a559;
  --green-glow:   rgba(35,165,89,.2);
  --red:          #da373c;
  --red-bg:       rgba(218,55,60,.15);
  --yellow:       #faa61a;

  --server-bar-w: 72px;
  --sidebar-w:    240px;
  --memberlist-w: 240px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-normal);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.375;
}

button { cursor: pointer; background: none; border: none; outline: none; }
input  { outline: none; }
svg    { flex-shrink: 0; }
.hidden { display: none !important; }

/* ── Scrollbars ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.07); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }

/* ── Login Modal ────────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: #000c;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.login-box {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 32px;
  width: 440px;
  max-width: 95vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.login-logo { margin-bottom: 20px; }
.login-title {
  font-size: 24px; font-weight: 700;
  color: var(--header-primary);
  margin-bottom: 8px;
}
.login-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 16px; }
.login-form-group { text-align: left; margin-bottom: 20px; }
.login-label {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  color: var(--header-secondary); margin-bottom: 8px;
  text-transform: uppercase;
}
.login-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(0,0,0,.3);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text-normal);
  transition: border-color .15s;
}
.login-input:focus { border-color: var(--brand); }
.login-btn {
  width: 100%;
  background: var(--brand);
  color: #fff;
  font-size: 16px; font-weight: 600;
  border-radius: 4px;
  padding: 12px;
  transition: background .15s;
  margin-bottom: 8px;
}
.login-btn:hover { background: var(--brand-hover); }
.login-error { color: var(--red); font-size: 12px; min-height: 16px; }

/* ── Discord layout ─────────────────────────────────────────────────────────── */
.discord-ui {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Server bar ─────────────────────────────────────────────────────────────── */
.server-bar {
  width: var(--server-bar-w);
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  overflow-y: auto;
  flex-shrink: 0;
}
.srv-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--interactive-normal);
  cursor: pointer;
  transition: border-radius .15s, background .15s, color .15s;
  position: relative;
  flex-shrink: 0;
  user-select: none;
}
.srv-icon:hover { border-radius: 30%; background: var(--brand); color: #fff; }
.srv-active { border-radius: 30%; background: var(--brand) !important; color: #fff !important; }
.srv-active::before {
  content: '';
  position: absolute;
  left: -16px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 40px;
  background: #fff;
  border-radius: 0 4px 4px 0;
}
.srv-bar-sep {
  width: 32px; height: 2px;
  background: var(--bg-accent);
  border-radius: 1px;
  flex-shrink: 0;
}
.srv-add { color: var(--green); }
.srv-add:hover { background: var(--green) !important; color: #fff !important; }

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.server-header {
  height: 48px;
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 15px;
  color: var(--header-primary);
  border-bottom: 1px solid var(--bg-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.server-header:hover { background: var(--bg-hover); }
.server-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 8px;
}

/* Voice Connected Banner */
.vcb {
  background: #232428;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
}
.vcb-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.vcb-status { font-size: 12px; font-weight: 600; color: var(--green); flex: 1; }
.vcb-disc-btn {
  width: 28px; height: 28px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background .1s, color .1s;
}
.vcb-disc-btn:hover { background: var(--red-bg); color: var(--red); }
.vcb-channel-row { display: flex; flex-direction: column; }
.vcb-ch-name { font-size: 13px; font-weight: 600; color: var(--header-primary); }
.vcb-server  { font-size: 11px; color: var(--text-muted); }

/* Channel list */
.ch-list { padding-top: 8px; }
.ch-category {
  display: flex; align-items: center; gap: 2px;
  padding: 0 4px;
  margin-bottom: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  color: var(--channel-default);
  text-transform: uppercase;
  cursor: pointer;
  height: 28px;
  user-select: none;
}
.ch-category:hover { color: var(--interactive-hover); }
.cat-arrow { flex-shrink: 0; }
.ch-category > span { flex: 1; }

.channel { border-radius: 4px; cursor: pointer; margin-bottom: 1px; }
.ch-row {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--channel-default);
  transition: background .1s, color .1s;
  position: relative;
  user-select: none;
}
.channel:hover .ch-row { background: var(--bg-hover); color: var(--interactive-hover); }
.channel.active .ch-row { background: var(--bg-active); color: var(--interactive-active); }
.channel.voice-connected .ch-row { color: var(--green); }

.ch-icon-voice { flex-shrink: 0; }
.ch-hash {
  font-size: 20px; font-weight: 400;
  color: inherit;
  width: 20px; text-align: center;
  flex-shrink: 0; line-height: 1;
}
.ch-name {
  flex: 1;
  font-size: 15px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-actions { margin-left: auto; }
.ch-join-hint {
  display: none;
  font-size: 11px; font-weight: 600;
  background: var(--brand);
  color: #fff;
  border-radius: 3px;
  padding: 2px 6px;
}
.channel:hover .ch-join-hint { display: inline; }

.unread-pip {
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  margin-left: auto;
}

/* Voice participants in sidebar */
.vpc-list { padding: 2px 0 4px 28px; }
.vpc-entry {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--interactive-normal);
  cursor: pointer;
  transition: background .1s;
  user-select: none;
}
.vpc-entry:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.vpc-entry.speaking { color: var(--green); }
.vpc-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.vpc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpc-icons { display: flex; gap: 2px; }
.vpc-icons svg { width: 12px; height: 12px; color: var(--text-muted); }
.vpc-icons .icon-red { color: var(--red); }

/* User panel */
.user-panel {
  height: 52px;
  background: #232428;
  border-top: 1px solid var(--bg-tertiary);
  display: flex; align-items: center;
  padding: 0 8px; gap: 4px;
  flex-shrink: 0;
}
.up-user {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px;
  transition: background .1s;
}
.up-user:hover { background: var(--bg-hover); }
.up-avatar-wrap { position: relative; flex-shrink: 0; }
.up-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.up-status-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #232428;
}
.up-info { min-width: 0; }
.up-name {
  font-size: 13px; font-weight: 600;
  color: var(--header-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-tag { font-size: 11px; color: var(--text-muted); }
.up-controls { display: flex; gap: 2px; flex-shrink: 0; }
.up-btn {
  width: 32px; height: 32px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--interactive-normal);
  transition: background .1s, color .1s;
}
.up-btn:hover  { background: var(--bg-hover); color: var(--interactive-hover); }
.up-btn.muted  { color: var(--red); }
.up-btn.deafened { color: var(--red); }

/* ── Main Content ───────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  min-width: 0;
}

/* Content header */
.content-header {
  height: 48px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(4,4,5,.2);
}
.hdr-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600;
  color: var(--header-primary);
  min-width: 0;
}
.hdr-hash { font-size: 24px; font-weight: 400; color: var(--text-muted); flex-shrink: 0; }
.hdr-voice-icon { color: var(--text-muted); flex-shrink: 0; }
.hdr-divider { width: 1px; height: 20px; background: var(--bg-accent); margin: 0 4px; flex-shrink: 0; }
.hdr-topic { font-size: 13px; font-weight: 400; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-right { display: flex; gap: 4px; flex-shrink: 0; }
.hdr-btn {
  width: 32px; height: 32px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--interactive-normal);
  transition: color .1s, background .1s;
}
.hdr-btn:hover { color: var(--interactive-hover); background: var(--bg-hover); }

/* ── Voice view ─────────────────────────────────────────────────────────────── */
.voice-view {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.voice-tiles {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  padding: 16px;
  align-content: center;
  overflow-y: auto;
}

/* Voice tile */
.voice-tile {
  background: #2b2d31;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  aspect-ratio: 16/9;
  border: 2px solid transparent;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  padding: 16px;
  min-height: 140px;
}
.voice-tile.speaking {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.tile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.tile-name {
  font-size: 14px; font-weight: 600;
  color: var(--header-primary);
  text-align: center;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-badge { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tile-icons {
  position: absolute;
  bottom: 8px; right: 8px;
  display: flex; gap: 4px;
}
.tile-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6);
}
.tile-icon svg { width: 12px; height: 12px; }
.tile-icon.ti-muted  { background: var(--red); }
.tile-icon.ti-deaf   { background: var(--red); }
.tile-quality {
  position: absolute;
  top: 8px; right: 8px;
  display: flex; gap: 2px; align-items: flex-end;
}
.tile-quality span { width: 3px; border-radius: 1px; background: var(--bg-accent); }
.tile-quality span:nth-child(1) { height: 5px; }
.tile-quality span:nth-child(2) { height: 8px; }
.tile-quality span:nth-child(3) { height: 11px; }
.tile-quality[data-q="good"] span { background: var(--green); }
.tile-quality[data-q="fair"] span:nth-child(1),
.tile-quality[data-q="fair"] span:nth-child(2) { background: var(--yellow); }
.tile-quality[data-q="poor"] span:nth-child(1) { background: var(--red); }

/* Speaking banner */
.speaking-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(35,165,89,.1);
  border-top: 1px solid rgba(35,165,89,.3);
  padding: 8px 16px;
  font-size: 13px; color: var(--green);
  flex-shrink: 0;
}
.spk-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: spk-pulse 1.2s ease-in-out infinite;
}
@keyframes spk-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%     { opacity:.5; transform:scale(.8); }
}
.spk-label { color: var(--text-muted); }

/* ── Text view ──────────────────────────────────────────────────────────────── */
.text-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 8px;
}

/* Message layout */
.msg-group {
  padding: 2px 48px 2px 72px;
  position: relative;
  transition: background .05s;
}
.msg-group:hover { background: rgba(0,0,0,.06); }

.msg-avatar-anchor {
  position: absolute;
  left: 16px; top: 4px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.msg-header-line {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 2px;
}
.msg-username {
  font-size: 15px; font-weight: 600;
  color: var(--header-primary);
  cursor: pointer;
}
.msg-username:hover { text-decoration: underline; }
.msg-timestamp { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.msg-text { font-size: 15px; color: var(--text-normal); word-break: break-word; line-height: 1.375; }

.msg-compact {
  padding: 1px 48px 1px 72px;
  position: relative;
  transition: background .05s;
}
.msg-compact:hover { background: rgba(0,0,0,.06); }
.msg-hover-ts {
  position: absolute;
  left: 16px; top: 50%; transform: translateY(-50%);
  width: 46px;
  font-size: 10px; color: var(--text-muted);
  text-align: center;
  opacity: 0;
  white-space: nowrap;
}
.msg-compact:hover .msg-hover-ts { opacity: 1; }

.chat-welcome { padding: 16px 16px 0; }
.chat-welcome-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff;
  margin-bottom: 16px;
}
.chat-welcome h2 { font-size: 32px; font-weight: 700; color: var(--header-primary); margin-bottom: 8px; }
.chat-welcome p  { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }
.chat-divider {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 16px 8px;
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
}
.chat-divider::before, .chat-divider::after { content:''; flex:1; height:1px; background:var(--bg-accent); }

/* Chat input */
.chat-input-area { padding: 0 16px 24px; flex-shrink: 0; }
.chat-input-box {
  background: var(--bg-textarea);
  border-radius: 8px;
  display: flex; align-items: center;
  padding: 0 8px;
  gap: 4px;
}
.chat-plus-btn {
  width: 36px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--interactive-normal);
  border-radius: 4px;
  transition: color .1s;
  flex-shrink: 0;
}
.chat-plus-btn:hover { color: var(--interactive-hover); }
.chat-input {
  flex: 1;
  background: none; border: none;
  color: var(--text-normal);
  font-size: 15px;
  padding: 11px 0;
  caret-color: #fff;
  font-family: inherit;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:disabled { cursor: not-allowed; opacity: .5; }
.chat-emoji-hint {
  padding: 0 8px;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
  opacity: .7;
  transition: opacity .1s;
}
.chat-emoji-hint:hover { opacity: 1; }

/* ── Member list ────────────────────────────────────────────────────────────── */
.member-list {
  width: var(--memberlist-w);
  background: var(--bg-secondary);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 8px;
  transition: width .15s, padding .15s;
}
.member-list.collapsed { width: 0; padding: 0; overflow: hidden; }
.member-category {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  color: var(--channel-default);
  text-transform: uppercase;
  padding: 16px 8px 4px;
  white-space: nowrap;
}
.member-category:first-child { padding-top: 4px; }
.member-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s;
}
.member-entry:hover { background: var(--bg-hover); }
.member-avatar-wrap { position: relative; flex-shrink: 0; }
.member-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.member-status {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  background: var(--green);
}
.member-status.st-muted   { background: var(--text-muted); }
.member-status.st-offline { background: #747f8d; }
.member-info { flex: 1; min-width: 0; }
.member-name {
  font-size: 14px; font-weight: 500;
  color: var(--interactive-normal);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-entry:hover .member-name { color: var(--interactive-hover); }
.member-sub { font-size: 11px; color: var(--text-muted); }
.member-icons { display: flex; gap: 4px; flex-shrink: 0; }
.member-icons svg { width: 14px; height: 14px; color: var(--text-muted); }
.member-icons .icon-red { color: var(--red); }

/* ── Context menu ───────────────────────────────────────────────────────────── */
.ctx-menu {
  position: fixed;
  background: var(--bg-floating);
  border-radius: 6px;
  min-width: 220px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  z-index: 500;
}
.ctx-header { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 4px; }
.ctx-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.ctx-name { font-size: 15px; font-weight: 700; color: var(--header-primary); }
.ctx-divider { height: 1px; background: rgba(79,84,92,.3); margin: 4px 0; }
.ctx-item { padding: 8px; border-radius: 4px; }
.ctx-vol-item { cursor: default; }
.ctx-vol-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 8px;
}
.ctx-vol-label span:nth-child(2) { flex: 1; }
.ctx-vol-number { color: var(--text-normal); }
.ctx-vol-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--bg-accent);
  cursor: pointer;
}
.ctx-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%; background: #fff;
  cursor: pointer;
}

/* ── Settings overlay ───────────────────────────────────────────────────────── */
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
}
.settings-modal {
  display: flex; width: 100%; height: 100%;
  overflow: hidden; position: relative;
}
.settings-nav {
  width: 218px;
  background: #2b2d31;
  padding: 60px 8px 16px;
  overflow-y: auto; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
  margin-left: auto;
}
.settings-nav-cat {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  color: var(--text-muted); text-transform: uppercase;
  padding: 6px 8px;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 4px;
  font-size: 15px; font-weight: 500;
  color: var(--interactive-normal);
  cursor: pointer;
  transition: background .1s, color .1s;
  user-select: none;
}
.settings-nav-item:hover { background: var(--bg-hover); color: var(--interactive-hover); }
.settings-nav-item.active { background: var(--bg-active); color: var(--interactive-active); }
.settings-nav-sep { height: 1px; background: var(--bg-accent); margin: 8px 0; }
.settings-nav-danger { color: var(--red) !important; }
.settings-nav-danger:hover { background: var(--red-bg) !important; }

.settings-body {
  flex: 1;
  padding: 60px 40px 40px;
  overflow-y: auto;
  background: var(--bg-primary);
  max-width: 740px;
}
.settings-page.hidden { display: none; }
.sp-title { font-size: 20px; font-weight: 700; color: var(--header-primary); margin-bottom: 24px; }
.sp-section { margin-bottom: 32px; }
.sp-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--header-secondary);
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-accent);
}
.sp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; gap: 16px;
  border-bottom: 1px solid rgba(79,84,92,.2);
}
.sp-row:last-child { border-bottom: none; }
.sp-row-info { flex: 1; }
.sp-row-title { font-size: 15px; font-weight: 600; color: var(--header-primary); margin-bottom: 4px; }
.sp-row-desc  { font-size: 13px; color: var(--text-muted); }
.sp-row-ctrl  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vol-row { min-width: 200px; }
.sp-range {
  flex: 1; min-width: 140px;
  -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--bg-accent); cursor: pointer;
}
.sp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%; background: var(--brand);
  cursor: pointer;
}
.sp-range-val { font-size: 14px; color: var(--text-normal); min-width: 40px; text-align: right; }
.sp-note { font-size: 14px; color: var(--text-muted); }

/* Toggle */
.toggle-switch {
  width: 40px; height: 24px;
  border-radius: 12px;
  background: var(--bg-accent);
  position: relative; cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  user-select: none;
}
.toggle-switch.on { background: var(--green); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%; background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.toggle-switch.on .toggle-thumb { transform: translateX(16px); }

.settings-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--interactive-normal);
  font-size: 10px; gap: 2px;
  transition: background .1s, color .1s; z-index: 10;
}
.settings-close:hover { background: var(--bg-floating); color: var(--interactive-hover); }
.settings-close-esc { font-size: 9px; font-weight: 700; letter-spacing: .5px; }

/* ── PTT overlay ────────────────────────────────────────────────────────────── */
.ptt-overlay {
  position: fixed;
  bottom: 60px; left: 50%; transform: translateX(-50%);
  z-index: 400; pointer-events: none;
}
.ptt-inner {
  display: flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  padding: 8px 16px; border-radius: 24px;
  box-shadow: 0 4px 16px rgba(35,165,89,.5);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .member-list { display: none; }
}
@media (max-width: 600px) {
  :root { --server-bar-w: 52px; }
  .srv-icon { width: 40px; height: 40px; }
}
