/* ══════════════════════════════════════
   SETTINGS — SHARED LAYOUT
   Used by both user settings and server settings
══════════════════════════════════════ */

/* Full-screen two-column layout */
.settings-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Left nav column */
.settings-nav {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: var(--bg-well);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  overflow-y: auto;
  height: 100vh;
  box-sizing: border-box;
}

/* Right content column */
.settings-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-main);
  position: relative;
}

/* Pages with live preview: form + preview side by side */
.settings-page-with-preview {
  display: none;
  height: 100%;
}
.settings-page-with-preview.active {
  display: flex !important;
  flex-direction: row;
  height: 100%;
  padding: 0 !important;
  max-width: none !important;
}
.settings-page-form {
  flex: 1;
  overflow-y: auto;
  padding: 40px 40px 40px 48px;
  max-width: 520px;
}
.settings-page-preview {
  width: 300px;
  min-width: 300px;
  background: var(--bg-well);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  overflow-y: auto;
  flex-shrink: 0;
}
.settings-preview-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Preview card */
.preview-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.preview-card-banner {
  height: 72px;
  background: linear-gradient(135deg, #7b68ee44, #f5c40022);
  background-size: cover;
  background-position: center;
}
.preview-card-body {
  padding: 36px 16px 16px;
  position: relative;
}
.preview-card-avatar {
  position: absolute;
  top: -28px;
  left: 16px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(30,32,36,0.6);
  border: 3px solid var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.preview-card-avatar img { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%; }
.preview-card-avatar-sq {
  border-radius: var(--radius-md) !important;
}
.preview-card-name  { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.preview-card-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.preview-card-about { font-size: 13px; color: var(--text-secondary); line-height: 1.5; word-break: break-word; }

/* Close button top-right */
.settings-close-btn {
  position: fixed;
  top: 16px;
  right: 24px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 10;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.settings-close-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ============================================================
   FORGE — forge_app_settings.css
   User settings overlay panel
   ============================================================ */

/* ── Settings overlay ── */
#page-settings {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  background: var(--bg-deepest);
}
#page-settings.active { display: flex; }



/* ── Nav sections ── */
.settings-nav-section {
  padding: 16px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  margin: 1px 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
  user-select: none;
}
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.settings-nav-item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.settings-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 20px;
}
.settings-nav-version {
  padding: 8px 20px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.settings-nav-danger {
  color: var(--red) !important;
}
.settings-nav-danger:hover { background: var(--red-dim) !important; }

/* Close button */
.settings-close-wrap {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.settings-close-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  width: 100%;
  transition: all var(--transition-base);
}
.settings-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ── Settings content ── */
.settings-page { display: none; }
.settings-page.active { display: block; }

.settings-page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.settings-page-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.settings-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Section card */
.settings-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
}

.settings-card-header {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.settings-card-body { padding: 10px 14px; width: 100%; }

/* Setting row */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; padding-bottom: 0; }

/* Notification timeout: 3 to 15 seconds */
.notif-timeout { flex-shrink: 0; width: 170px; cursor: pointer; }
@media (max-width: 600px) { .notif-timeout { width: 140px; } }
.settings-row:first-child { padding-top: 0; }

.settings-row-info { flex: 1; }
.settings-row-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
}
.settings-row-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Toggle switch */
.toggle {
  width: 44px; height: 24px;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
  flex-shrink: 0;
}
.toggle.on {
  background: var(--gold);
  border-color: var(--gold-dim);
}
.toggle-thumb {
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on .toggle-thumb { transform: translateX(20px); }

/* Profile avatar editor */
.profile-avatar-editor {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar-large {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
  background: var(--yellow);
  color: #1a1b1e;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
  font-size: 20px;
}
.profile-avatar-large:hover .profile-avatar-overlay { opacity: 1; }

.profile-avatar-actions { display: flex; flex-direction: column; gap: 8px; }

/* Color scheme picker */
.color-swatch-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.color-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.color-swatch:hover  { transform: scale(1.12); }
.color-swatch.active { border-color: var(--text-primary); }

/* Danger zone */
.danger-zone {
  background: rgba(224,82,82,0.06);
  border: 1px solid rgba(224,82,82,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 32px;
}
.danger-zone-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 16px;
}
.danger-zone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(224,82,82,0.1);
}
.danger-zone-row:last-child { border-bottom: none; padding-bottom: 0; }
.danger-zone-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.danger-zone-info p  { font-size: 12px; color: var(--text-muted); }

/* Notification preferences table */
.notif-table {
  width: 100%;
  border-collapse: collapse;
}
.notif-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.notif-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.notif-table tr:last-child td { border-bottom: none; }
.notif-table td:not(:first-child) { text-align: center; }

/* ══════════════════════════════════════
   SERVER SETTINGS
══════════════════════════════════════ */

.ss-server-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.ss-server-avatar:hover { border-color: var(--yellow); }
.ss-server-avatar img   { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit; }

.ss-banner-editor {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #7b68ee44, #f5c40022);
  border: 2px dashed var(--border-strong);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.ss-banner-editor:hover { border-color: var(--yellow); }
.ss-banner-editor:hover .ss-banner-overlay { opacity: 1; }

.ss-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.settings-nav-item.danger       { color: var(--red); }
.settings-nav-item.danger:hover { background: rgba(224,82,82,0.1); color: var(--red); }

/* ── Settings pages inside content area ── */
.settings-content .settings-page {
  display: none;
  padding: 40px 48px;
  max-width: 740px;
}
.settings-content .settings-page.active { display: block; }

.settings-page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.settings-page-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Nav section labels ── */
.settings-nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 16px 8px 4px;
}

/* Extra gap before User Management */
.settings-nav-section-label + .settings-nav-item ~ .settings-nav-section-label {
  margin-top: 8px;
}

/* ══════════════════════════════════════
   ROLES EDITOR
══════════════════════════════════════ */

/* Override settings-page for roles — needs full height two-col */
#ss-roles.active {
  display: flex !important;
  flex-direction: row;
  height: 100%;
  padding: 0 !important;
  max-width: none !important;
}

.roles-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Left panel — role list */
.roles-list-panel {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-well-2);
  overflow: hidden;
}

.roles-list-header {
  padding: 16px 12px 8px;
  flex-shrink: 0;
}

.roles-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  font-family: var(--font-body);
}
.roles-add-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.roles-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.roles-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 16px 16px;
  line-height: 1.4;
}

.roles-name-input { margin-bottom: 6px; }

.roles-name-preview {
  font-size: 18px;
  font-weight: 700;
  padding: 4px 0;
  min-height: 26px;
}

/* Role row in list */
.role-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
  margin-bottom: 2px;
  user-select: none;
}
.role-list-item:hover  { background: var(--bg-hover); }
.role-list-item.active { background: var(--bg-active); }
.role-list-item.dragging {
  opacity: 0.4;
  background: var(--bg-active);
}

.role-list-drag {
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='4' cy='3' r='1.5' fill='%23666'/%3E%3Ccircle cx='10' cy='3' r='1.5' fill='%23666'/%3E%3Ccircle cx='4' cy='7' r='1.5' fill='%23666'/%3E%3Ccircle cx='10' cy='7' r='1.5' fill='%23666'/%3E%3Ccircle cx='4' cy='11' r='1.5' fill='%23666'/%3E%3Ccircle cx='10' cy='11' r='1.5' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}
.role-list-item:not(.role-founder):hover .role-list-drag { opacity: 1; }
.role-list-item.role-founder .role-list-drag { cursor: default; opacity: 0.15; }
.role-list-drag:active { cursor: grabbing; }

.role-list-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.role-list-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-list-default-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Right panel — role editor */
.roles-editor-panel {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  position: relative;
}

.roles-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.roles-editor-form {
  padding: 32px 40px;
  max-width: 600px;
}

.roles-editor-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.roles-editor-section:last-child { border-bottom: none; }

.roles-name-input {
  font-size: 16px;
  padding: 10px 12px;
}

/* Color swatches */
.roles-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.roles-color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}
.roles-color-swatch:hover    { transform: scale(1.15); }
.roles-color-swatch.selected { border-color: white; transform: scale(1.15); }

.roles-color-custom {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}
.roles-color-custom:hover { border-color: var(--text-secondary); }

/* Permission rows */
.roles-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.roles-perm-row:last-child { border-bottom: none; }

.roles-perm-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.roles-perm-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.perm-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 0 6px;
}

/* ── Role color tabs ── */
.roles-color-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}
.roles-color-tab {
  padding: 5px 16px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.roles-color-tab.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Gradient swatches ── */
.roles-gradient-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.roles-gradient-swatch {
  width: 48px; height: 24px;
  border-radius: 12px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.roles-gradient-swatch:hover    { transform: scale(1.1); }
.roles-gradient-swatch.selected { border-color: white; }

/* ── Role icon preview ── */
.roles-icon-preview {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}
.roles-icon-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Greyed-out Role Settings for default roles (name/color/icon/perms still editable) ── */
.roles-editor-form.is-default #role-color-section,
.roles-editor-form.is-default #role-icon-section {
  opacity: 0.45;
  pointer-events: none;
}
.roles-editor-form.is-default .roles-name-input { opacity: 0.45; cursor: not-allowed; }
.roles-editor-form.is-default #role-settings-section {
  opacity: 0.45;
  pointer-events: none;
  position: relative;
}
.roles-editor-form.is-default #role-settings-section::after {
  content: 'These settings are fixed for the everyone role';
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ── Gradient builder ── */
.roles-gradient-builder {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.roles-gradient-pill {
  width: 100px;
  height: 40px;
  border-radius: 20px;
  border: 3px solid var(--yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  flex-shrink: 0;
  position: relative;
}

.roles-gradient-pill-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  color: white;
  position: relative;
  overflow: hidden;
  transition: background var(--transition-fast);
}
.roles-gradient-pill-btn:hover { background: rgba(0,0,0,0.5); }

.roles-gradient-presets {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 6px;
}

/* Override swatch size for gradient presets */
.roles-gradient-presets .roles-gradient-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.roles-remove-icon-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  transition: color var(--transition-fast);
}
.roles-remove-icon-link:hover { color: var(--text-primary); }
/* ── Desktop app updates ── */
.update-dot {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}
.update-dot-corner {
  position: absolute;
  top: 3px;
  right: 3px;
  margin: 0;
}
#sf-settings-btn { position: relative; }
.update-error { color: var(--red, #e05252); margin-top: 4px; }
.update-progress {
  height: 6px;
  margin-top: 12px;
  border-radius: 3px;
  background: var(--bg-hover);
  overflow: hidden;
}
.update-progress-bar {
  height: 100%;
  width: 0;
  background: var(--yellow);
  transition: width var(--transition-fast);
}
.update-notes { margin-top: 14px; }
.update-notes-version {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.update-notes-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

#settings-updates .settings-row { border-bottom: none; padding-bottom: 0; }

/* ── Betas ── */
.update-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.update-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
}
.update-tab:hover  { color: var(--text-secondary); }
.update-tab.active { color: var(--text-primary); border-bottom-color: var(--yellow); }
.beta-intro { margin-bottom: 14px; }
.beta-list { display: flex; flex-direction: column; gap: 10px; }
.beta-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: inherit;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.beta-option:hover { border-color: var(--border-strong); }
.beta-option.selected { border-color: var(--yellow); background: var(--bg-hover); }
.beta-option:disabled { cursor: default; opacity: 0.6; }
.beta-radio {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
}
.beta-option.selected .beta-radio { border-color: var(--yellow); box-shadow: inset 0 0 0 3px var(--bg-hover); background: var(--yellow); }
.beta-option-main { flex: 1; min-width: 0; }
.beta-option-main > span { display: block; }
.beta-option-main > .beta-option-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.beta-option-id { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.beta-option-desc { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.beta-option-changes { margin: 8px 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); list-style: disc; }
.beta-badge {
  padding: 1px 8px;
  border-radius: 100px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.beta-badge-on { background: var(--yellow); color: #1a1b1e; }

/* ── Transfer ownership ── */
.ss-transfer-select { width: 200px; flex-shrink: 0; margin-right: 8px; cursor: pointer; }

/* ── Permissions this member can't change ── */
.toggle.locked { opacity: 0.45; cursor: not-allowed; }

/* ── Theme picker ── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.theme-card {
  background: var(--bg-main);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  text-align: left;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.theme-card:hover { border-color: var(--text-muted); }
.theme-card.active { border-color: var(--yellow); }
.theme-card-preview { display: flex; height: 52px; }
.theme-card-rail    { width: 16%; background: var(--bg-rail); }
.theme-card-side    { width: 30%; background: var(--bg-sidebar); }
.theme-card-body    { flex: 1; background: var(--bg-main); padding: 10px; }
.theme-card-accent  { width: 34px; height: 12px; border-radius: 6px; background: var(--yellow); }
.theme-card-name {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-sidebar);
}

/* ── Sub permissions and the fields under Self-assignable ── */
.roles-perm-subs {
  margin-left: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.roles-perm-subs .roles-perm-row { padding: 8px 0; }
.role-self-fields { padding: 12px 0; border-bottom: 1px solid var(--border); }

/* ── Self-assignable Roles section ── */
.self-role-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.self-role-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}
.self-role-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.self-role-info { flex: 1; min-width: 0; }
.self-role-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.self-role-name  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.self-role-desc  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Members only get the channel buttons they can use ── */
#sidebar-body.no-channel-create .ch-category-add,
#sidebar-body.no-channel-settings .ch-category-gear,
#sidebar-body.no-channel-settings .ch-item-actions { display: none; }

/* People credited in a change log */
.update-credits { margin-top: 10px; }
.update-credits-title {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.update-credit { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.update-credit-by { color: var(--yellow); }
