:root {
  --bg: #050508;
  --bg-elevated: #0a0a0f;
  --surface: #0f0f14;
  --surface2: #16161f;
  --surface-hover: #1e1e2a;
  --border: #2a2a3a;
  --border-subtle: #1a1a26;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-muted: rgba(139, 92, 246, 0.18);
  --accent-glow: rgba(139, 92, 246, 0.4);
  --accent-secondary: #06b6d4;
  --success: #22c55e;
  --danger: #f43f5e;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100vh;
}

/* Login / Add account */
#login-view,
#add-account-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-muted), transparent),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.logo {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 0 24px var(--accent-glow);
}

.login-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

.login-card label {
  display: block;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.login-card input[type='password'],
.login-card input[type='text'],
.inline-form input,
.message-form input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus,
.inline-form input:focus,
.message-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.login-card button[type='submit'],
.inline-form button,
.message-form button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.login-card button:hover,
.inline-form button:hover,
.message-form button:hover {
  background: var(--accent-hover);
}

.login-card button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: left;
}

/* Dashboard shell */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
}

.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.content {
  padding: 20px 24px 32px;
  max-width: 1440px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card h2,
.card h3 {
  margin-bottom: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-row {
  margin-bottom: 16px;
}

.panel-row:not(.servers-toolbar) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.dm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.toggle-row code {
  font-size: 0.85em;
  color: var(--muted);
}

.brand-mark {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.brand-mark.sm {
  font-size: 1.75rem;
  margin-bottom: 0;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-inline h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.ghost-card {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-muted);
}

.ghost-card h1 {
  font-family: var(--font-display);
}

.accounts-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.accounts-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--surface) 0%, transparent 100%);
}

.tabs {
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  gap: 4px;
}

.tab {
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 500;
}

.tab.active {
  color: var(--accent-hover);
  border-bottom: 2px solid var(--accent);
  background: var(--accent-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-hover);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 14px 0 6px;
}

.voice-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 16px;
  min-height: calc(100vh - 200px);
}

.voice-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.voice-join-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.voice-status {
  margin-top: 12px;
  font-size: 0.82rem;
}

.voice-player-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.voice-player-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.voice-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.voice-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.voice-queue {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.voice-queue-item.playing {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.voice-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.voice-transport {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voice-volume input[type='range'] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}

@media (max-width: 900px) {
  .voice-layout {
    grid-template-columns: 1fr;
  }
}

.inline-form {
  display: flex;
  gap: 10px;
}

.inline-form input {
  flex: 1;
}

.inline-form button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
  padding: 12px 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.badge {
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: 6px;
}

.user-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.user-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  transition: border-color 0.12s;
}

.user-list li:hover {
  border-color: var(--border);
}

.user-list img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-list .name {
  flex: 1;
  font-size: 0.88rem;
}

.user-list button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.user-list button:hover {
  background: var(--accent-hover);
}

.user-list .empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px;
  border: none;
  background: transparent;
}

/* Chat */
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  height: calc(100vh - 168px);
  min-height: 480px;
}

.channel-list {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.channel-list ul {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.channel-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.88rem;
}

.channel-list li:hover,
.channel-list li.active {
  background: var(--accent-muted);
  color: var(--text);
}

.channel-list li.active {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

.channel-list img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.95rem;
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 75%;
}

.msg.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.msg-bubble {
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  line-height: 1.45;
}

.msg.me .msg-bubble {
  background: linear-gradient(135deg, #be123c, var(--accent));
  border-color: transparent;
  color: #fff;
}

.msg-meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 4px;
}

.message-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.message-form input {
  flex: 1;
}

.message-form button {
  width: auto;
  margin-top: 0;
  padding: 12px 20px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal p {
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions .hidden-btn {
  display: none;
}

/* Loading */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 36px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: 90vw;
}

.loading-status {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.4;
}

.loading-cancel {
  min-width: 140px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Accounts */
.accounts-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.accounts-header {
  margin-bottom: 32px;
}

.accounts-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.account-grid {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.account-card:hover {
  border-color: var(--border);
}

.account-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.account-avatar.placeholder {
  background: var(--surface2);
}

.account-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account-info strong {
  font-size: 1rem;
  font-weight: 600;
}

.account-id {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.status-dot {
  font-size: 0.72rem;
  margin-top: 2px;
}

.status-dot.online {
  color: var(--success);
}

.status-dot.offline {
  color: var(--muted);
}

.account-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.header-nav-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.mass-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--accent-muted);
  border-radius: var(--radius-lg);
}

.mass-toolbar #mass-selected-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: auto;
}

.account-card.account-selected {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.06);
}

.account-select-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 4px;
  cursor: pointer;
}

.account-select-wrap input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.access-user-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.access-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.access-user-card strong {
  font-size: 1rem;
}

.access-user-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.access-create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.access-create-form .btn-primary {
  margin-top: 6px;
  align-self: flex-start;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-actions .btn-danger {
  background: var(--accent);
  border: none;
  color: #fff;
}

.modal-actions .btn-danger:hover {
  background: var(--accent-hover);
}

.accounts-actions {
  text-align: center;
}

.full-width {
  width: 100%;
  margin-top: 10px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

/* Servers */
.servers-toolbar {
  grid-template-columns: 1fr 1fr;
}

.guild-actions-card .guild-toolbar {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.guild-search {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.guild-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.guild-stats {
  margin-top: 10px;
  font-size: 0.8rem;
}

#btn-leave-all {
  white-space: nowrap;
  flex-shrink: 0;
}

.servers-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 200px 1fr;
  gap: 14px;
  height: calc(100vh - 220px);
  min-height: 420px;
}

.guild-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px !important;
}

.guild-section {
  margin-bottom: 14px;
}

.guild-section:last-of-type {
  margin-bottom: 0;
}

.guild-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 4px;
}

.guild-cards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: calc(50vh - 80px);
}

.guild-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 8px;
}

.guild-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.guild-card:hover {
  border-color: var(--border);
}

.guild-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
}

.guild-card-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  min-width: 0;
}

.guild-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}

.guild-card-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface2), var(--accent-muted));
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

.guild-card-body {
  flex: 1;
  min-width: 0;
}

.guild-card-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-card-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.guild-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.guild-badge {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border-subtle);
}

.guild-badge-owner {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border-color: rgba(234, 179, 8, 0.35);
}

.guild-badge-admin {
  background: var(--accent-muted);
  color: var(--accent-hover);
  border-color: rgba(225, 29, 72, 0.35);
}

.guild-badge-channels {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.guild-badge-roles {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.guild-badge-manage_guild,
.guild-badge-messages,
.guild-badge-mod {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.guild-badge-none {
  opacity: 0.7;
}

.guild-card-leave {
  width: 36px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.guild-card-leave:hover {
  background: var(--accent-muted);
  color: var(--accent);
}

.guild-channel-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.guild-channel-list li:not(.channel-category) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.86rem;
  transition: background 0.12s;
}

.guild-channel-list li:not(.channel-category):hover,
.guild-channel-list li:not(.channel-category).active {
  background: var(--accent-muted);
}

.guild-channel-list li:not(.channel-category).active {
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

.guild-channels {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.guild-channel-list {
  overflow-y: auto;
  flex: 1;
}

.channel-category {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 10px 4px;
  cursor: default;
}

#add-account-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.context-menu {
  position: fixed;
  z-index: 250;
  list-style: none;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow);
}

.context-menu li {
  padding: 10px 14px;
  font-size: 0.86rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.context-menu li:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.context-menu li.danger {
  color: var(--accent);
}

.context-menu li.danger:hover {
  background: var(--accent-muted);
  color: var(--accent-hover);
}

.hint-inline {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.panel-hint {
  margin: 0 0 12px;
}

.config-modal {
  max-width: 480px;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-field input,
.config-field select,
.config-field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.config-field input:focus,
.config-field select:focus,
.config-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.config-field textarea {
  resize: vertical;
  min-height: 88px;
}

#btn-spam-all-dms {
  margin-top: 8px;
}

.jobs-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: min(360px, calc(100vw - 40px));
  max-height: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.jobs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
}

.jobs-count {
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
}

.jobs-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 8px;
}

.job-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  margin-bottom: 6px;
}

.job-item:last-child {
  margin-bottom: 0;
}

.job-info {
  flex: 1;
  min-width: 0;
}

.job-info strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.job-detail {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-item.job-error .job-detail {
  color: var(--danger);
}

.job-item.job-cancelled .job-detail {
  color: var(--muted);
}

.btn-sm {
  padding: 6px 10px !important;
  font-size: 0.75rem !important;
}

@media (max-width: 768px) {
  .chat-layout,
  .servers-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .servers-toolbar {
    grid-template-columns: 1fr;
  }

  .channel-list {
    max-height: 200px;
  }

  .guild-cards {
    max-height: 200px;
  }

  .account-card {
    flex-wrap: wrap;
  }

  .account-buttons {
    width: 100%;
    justify-content: flex-end;
  }

  .jobs-panel {
    left: 20px;
    right: 20px;
    width: auto;
  }
}

/* User Manager */
.user-manager-bulk {
  margin-bottom: 1.5rem;
}

.user-manager-bulk h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.bulk-tokens-input {
  width: 100%;
  margin: 0.75rem 0;
  padding: 12px;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
}

.bulk-tokens-input:focus {
  outline: none;
  border-color: var(--accent);
}

.bulk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-result {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bulk-result strong {
  color: var(--text);
}

.user-manager-list-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
