/* ── Reset & base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #f1f5f9;
  background: #0a0c14;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── Shell layout ───────────────────────────────── */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */
.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: #0a0c14;
  position: sticky;
  top: 0;
  z-index: 10;
}
.shell-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.shell-logo { width: 26px; height: 26px; }
.shell-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.shell-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.shell-user-name {
  font-size: 0.875rem;
  color: #64748b;
}
.shell-signout {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 120ms, border-color 120ms;
}
.shell-signout:hover {
  color: #f1f5f9;
  border-color: rgba(255,255,255,0.25);
}

/* ── Main area ──────────────────────────────────── */
.shell-main {
  flex: 1;
  padding: 2.5rem 1.5rem;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* ── Notice banner ──────────────────────────────── */
.app-notice {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #a5b4fc;
}

/* ── Workspaces page ────────────────────────────── */
.workspaces-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.workspaces-title {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #f1f5f9;
}
.workspaces-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

/* ── Workspace list ─────────────────────────────── */
.workspace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.workspace-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.workspace-card:hover {
  border-color: rgba(99,102,241,0.4);
  background: #131b2e;
}
.workspace-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}
.workspace-card-body {
  flex: 1;
  min-width: 0;
}
.workspace-card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-card-desc {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-card-role {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
}

/* ── Empty state ────────────────────────────────── */
.workspaces-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #475569;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* ── New workspace page ─────────────────────────── */
.new-workspace-page {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}
.new-workspace-page .auth-card { max-width: 480px; width: 100%; }
.new-workspace-page .auth-card__title { font-size: 1.5rem; }

/* ── Shared auth bits (reused) ───────────────────── */
.auth-card__header { text-align: center; margin-bottom: 2rem; }
.auth-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #f1f5f9;
}
.auth-card__sub { margin: 0; font-size: 0.95rem; color: #64748b; }

.auth-alert {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: #fca5a5;
}
.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 0.25rem; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 2rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.83rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.01em; }
.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #f1f5f9;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  -webkit-appearance: none;
}
.form-input::placeholder { color: #334155; }
.form-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.form-input--error { border-color: rgba(239,68,68,0.6); }
.form-textarea { resize: vertical; min-height: 80px; }

.btn-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: #6366f1;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
  transition: background 140ms, transform 120ms, box-shadow 140ms;
}
.btn-submit:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}
.btn-submit:active { transform: translateY(0); }

/* ── Primary button (link style) ─────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: #6366f1;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
  transition: background 140ms, transform 120ms;
  white-space: nowrap;
}
.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* ── Workspace interior shell ────────────────────── */
.ws-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #0a0c14;
}

/* ── Sidebar ─────────────────────────────────────── */
.ws-sidebar {
  width: 252px;
  flex-shrink: 0;
  background: #0d1117;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-sidebar-top {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ws-back-link {
  display: inline-block;
  font-size: 0.72rem;
  color: #475569;
  margin-bottom: 0.75rem;
  transition: color 120ms;
}
.ws-back-link:hover { color: #94a3b8; }

.ws-identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ws-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.ws-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Channel nav ─────────────────────────────────── */
.ws-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.ws-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0 1rem;
  margin-bottom: 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
}

.ws-add-channel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: #475569;
  transition: color 120ms, background 120ms;
}
.ws-add-channel:hover {
  color: #94a3b8;
  background: rgba(255,255,255,0.05);
}

.ws-channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ws-channel-item {
  display: flex;
  align-items: center;
  margin: 0 0.375rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: background 120ms, color 120ms;
}
.ws-channel-item:hover {
  background: rgba(255,255,255,0.06);
  color: #f1f5f9;
}
.ws-channel-item--active {
  background: rgba(99,102,241,0.15);
  color: #f1f5f9;
}
.ws-channel-item--active:hover {
  background: rgba(99,102,241,0.2);
}
.ws-channel-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  flex: 1;
  min-width: 0;
  color: inherit;
}

.ws-hash {
  color: #475569;
  font-size: 1rem;
  line-height: 1;
}

.ws-channel-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-no-channels {
  margin: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.6;
}

.ws-create-link {
  color: #6366f1;
  font-size: 0.8rem;
  transition: color 120ms;
}
.ws-create-link:hover { color: #818cf8; }

.ws-section-label--browse { margin-top: 1rem; }

.ws-channel-item--browse { color: #475569; }
.ws-channel-item--browse:hover {
  background: rgba(255,255,255,0.04);
  color: #94a3b8;
}

.ws-join-btn {
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #6366f1;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.ws-join-btn:hover {
  background: rgba(99,102,241,0.12);
  border-color: #6366f1;
}

/* ── Sidebar footer ──────────────────────────────── */
.ws-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  gap: 0.75rem;
}

.ws-user-name {
  font-size: 0.8rem;
  color: #64748b;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-signout {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 120ms, border-color 120ms;
}
.ws-signout:hover {
  color: #f1f5f9;
  border-color: rgba(255,255,255,0.2);
}

/* ── Main content area ───────────────────────────── */
.ws-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.ws-notice {
  background: rgba(99,102,241,0.12);
  border-bottom: 1px solid rgba(99,102,241,0.2);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: #a5b4fc;
}

.ws-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.ws-placeholder-inner {
  text-align: center;
  max-width: 360px;
}

.ws-placeholder-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.ws-placeholder-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

.ws-inline-link {
  color: #6366f1;
  transition: color 120ms;
}
.ws-inline-link:hover { color: #818cf8; }

/* ── Channel form extras ─────────────────────────── */
.auth-card__workspace-label {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
}

.form-input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-prefix {
  position: absolute;
  left: 0.9rem;
  color: #64748b;
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
}

.form-input--prefixed {
  padding-left: 1.9rem;
}

.form-hint {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #475569;
}

/* ── Secondary button ───────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255,255,255,0.05);
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms, color 140ms, border-color 140ms;
  white-space: nowrap;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.09);
  color: #f1f5f9;
  border-color: rgba(255,255,255,0.18);
}

/* ── Alert banner ───────────────────────────────── */
.app-alert {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #fca5a5;
}

/* ── Join button ────────────────────────────────── */
.btn-join {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 140ms;
}
.btn-join:hover { background: #4f46e5; }
.workspace-card--discover { cursor: default; }
.workspace-card--discover:hover { border-color: rgba(255,255,255,0.08); background: #111827; }

/* ── Visibility toggle (new workspace form) ─────── */
.visibility-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.visibility-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 140ms;
}
.visibility-option:has(.visibility-radio:checked) {
  border-color: #6366f1;
  background: rgba(99,102,241,0.08);
}
.visibility-radio { margin-top: 0.2rem; accent-color: #6366f1; }
.visibility-option-content { display: flex; flex-direction: column; gap: 0.1rem; }
.visibility-option-title { font-size: 0.9rem; font-weight: 600; color: #f1f5f9; }
.visibility-option-desc { font-size: 0.78rem; color: #64748b; }

/* ── Workspace visibility settings (sidebar) ────── */
.ws-settings {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ws-settings-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
  margin-bottom: 0.5rem;
}
.ws-visibility-form { margin: 0; }
.ws-visibility-options {
  display: flex;
  gap: 0.4rem;
}
.ws-vis-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.ws-vis-option input[type="radio"] { display: none; }
.ws-vis-option--active {
  border-color: #6366f1;
  color: #a5b4fc;
  background: rgba(99,102,241,0.1);
}

/* ── Chat layout ─────────────────────────────────── */
.ws-main--chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 52px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: #0a0c14;
}
.chat-header-hash {
  font-size: 1.1rem;
  color: #475569;
  line-height: 1;
}
.chat-header-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}
.chat-header-sep {
  color: #1e293b;
  font-size: 0.9rem;
}
.chat-header-desc {
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Messages list ───────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.5rem 1rem;
}
.chat-empty-title {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: #f1f5f9;
}
.chat-empty-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.chat-message {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 1.25rem;
  transition: background 80ms;
}
.chat-message:hover {
  background: rgba(255,255,255,0.03);
}
.chat-message-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.1rem;
}
.chat-message-body {
  flex: 1;
  min-width: 0;
}
.chat-message-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.chat-message-author {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
}
.chat-message-time {
  font-size: 0.72rem;
  color: #475569;
}
.chat-message-content {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Composer ────────────────────────────────────── */
.chat-composer {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem 1rem;
}
.chat-form {
  display: flex;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  transition: border-color 140ms, box-shadow 140ms;
}
.chat-form:focus-within {
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.925rem;
  font-family: inherit;
  color: #f1f5f9;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
}
.chat-input::placeholder { color: #334155; }

/* ── Chat header back button (mobile only, hidden on desktop) ── */
.chat-header-back {
  display: none;
  align-items: center;
  color: #475569;
  font-size: 1.2rem;
  padding: 0.2rem 0.35rem;
  margin-right: 0.1rem;
  border-radius: 6px;
  transition: color 120ms, background 120ms;
  flex-shrink: 0;
}
.chat-header-back:hover { color: #94a3b8; background: rgba(255,255,255,0.05); }

/* ── Chat header actions ─────────────────────────── */
.chat-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-header-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: #475569;
  transition: color 120ms, background 120ms;
}
.chat-header-settings:hover {
  color: #94a3b8;
  background: rgba(255,255,255,0.06);
}

/* ── Channel settings page ───────────────────────── */
.ws-main--settings {
  overflow-y: auto;
}

.ch-settings-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.ch-settings-back {
  font-size: 0.82rem;
  color: #475569;
  transition: color 120ms;
  white-space: nowrap;
}
.ch-settings-back:hover { color: #94a3b8; }

.ch-settings-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.ch-settings-body {
  padding: 2rem;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.ch-settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ch-settings-section-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
}

/* ── Members list ────────────────────────────────── */
.ch-members-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}

.ch-member-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ch-member-item:last-child { border-bottom: none; }

.ch-member-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

.ch-member-name {
  flex: 1;
  font-size: 0.9rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-member-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #818cf8;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  .shell-main { padding: 1.5rem 1rem; }
  .workspaces-header { flex-direction: column; }
  .workspace-card-role { display: none; }

  /* Mobile: one panel fills the full screen at a time */
  .ws-sidebar {
    width: 100%;
    border-right: none;
  }

  /* Workspace page (no channel) — hide the empty main area */
  .ws-shell .ws-main:not(.ws-main--chat):not(.ws-main--settings) { display: none; }

  /* Channel page — hide sidebar, chat fills the screen */
  .ws-shell:has(.ws-main--chat) .ws-sidebar { display: none; }
  .ws-main--chat { width: 100%; }

  /* Settings page — hide sidebar, settings fills the screen */
  .ws-shell:has(.ws-main--settings) .ws-sidebar { display: none; }
  .ws-main--settings { width: 100%; }
  .ch-settings-header { padding: 0.875rem 1rem; }
  .ch-settings-body { padding: 1.25rem 1rem; }
  .ws-main--settings .auth-form { padding: 1.25rem 1rem; }

  /* Show the back arrow in the chat header */
  .chat-header-back { display: flex; }

  .chat-header { padding: 0 1rem; gap: 0.35rem; }
  .chat-header-desc { display: none; }
  .chat-header-sep { display: none; }

  .chat-composer { padding: 0.5rem 0.75rem 0.75rem; }
}
