:root,
[data-theme="graphite"] {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --chat-font-size: 15px;
  --bg-rail: #101114;
  --bg-sidebar: #16181d;
  --bg-stage: #1c1f26;
  --bg-panel: #181a20;
  --bg-elevated: #232730;
  --bg-hover: rgba(255, 255, 255, 0.056);
  --bg-active: rgba(255, 255, 255, 0.098);
  --bg-input: #13151a;
  --bg-code: #121418;
  --border-subtle: rgba(255, 255, 255, 0.082);
  --border-strong: rgba(255, 255, 255, 0.155);
  --text-primary: #f5f6f8;
  --text-secondary: #bec5d2;
  --text-muted: #8e96a8;
  --accent: #e09145;
  --accent-hover: #ea9e54;
  --accent-soft: rgba(224, 145, 69, 0.16);
  --accent-ink: #13110e;
  --online: #3eb480;
  --idle: #e2aa3b;
  --dnd: #df5864;
  --offline: #737b8c;
  --danger: #df5864;
  --danger-soft: rgba(223, 88, 100, 0.16);
  --mention-bg: rgba(224, 145, 69, 0.1);
  --shadow-lg: 0 22px 54px rgba(0, 0, 0, 0.52);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.38);
}

[data-theme="obsidian"] {
  --bg-rail: #08090b;
  --bg-sidebar: #0d0f13;
  --bg-stage: #12151b;
  --bg-panel: #0f1217;
  --bg-elevated: #191d25;
  --bg-hover: rgba(255, 255, 255, 0.058);
  --bg-active: rgba(255, 255, 255, 0.1);
  --bg-input: #0b0d11;
  --bg-code: #0a0c0f;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.155);
  --text-primary: #f4f7fb;
  --text-secondary: #b8c2d1;
  --text-muted: #8793a6;
  --accent: #38b29a;
  --accent-hover: #46c4ab;
  --accent-soft: rgba(56, 178, 154, 0.16);
  --accent-ink: #071310;
  --mention-bg: rgba(56, 178, 154, 0.1);
}

[data-theme="slate"] {
  --bg-rail: #11151d;
  --bg-sidebar: #161c26;
  --bg-stage: #1c2330;
  --bg-panel: #181f2a;
  --bg-elevated: #242d3d;
  --bg-hover: rgba(255, 255, 255, 0.058);
  --bg-active: rgba(255, 255, 255, 0.1);
  --bg-input: #121720;
  --bg-code: #10151d;
  --border-subtle: rgba(255, 255, 255, 0.086);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f3f6fc;
  --text-secondary: #b9c5d8;
  --text-muted: #8a98b0;
  --accent: #5b9bd5;
  --accent-hover: #6ea9df;
  --accent-soft: rgba(91, 155, 213, 0.16);
  --accent-ink: #0b121a;
  --mention-bg: rgba(91, 155, 213, 0.11);
}

[data-theme="paper"] {
  --bg-rail: #e3dfd8;
  --bg-sidebar: #efece6;
  --bg-stage: #f9f7f3;
  --bg-panel: #f2efe9;
  --bg-elevated: #ffffff;
  --bg-hover: rgba(24, 22, 19, 0.055);
  --bg-active: rgba(24, 22, 19, 0.095);
  --bg-input: #ebe7e0;
  --bg-code: #ebe8e1;
  --border-subtle: rgba(24, 22, 19, 0.11);
  --border-strong: rgba(24, 22, 19, 0.19);
  --text-primary: #161513;
  --text-secondary: #46423c;
  --text-muted: #6e685f;
  --accent: #c46824;
  --accent-hover: #b15b1c;
  --accent-soft: rgba(196, 104, 36, 0.14);
  --accent-ink: #ffffff;
  --mention-bg: rgba(196, 104, 36, 0.1);
  --shadow-lg: 0 22px 48px rgba(24, 20, 15, 0.16);
  --shadow-md: 0 10px 24px rgba(24, 20, 15, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background: var(--bg-stage);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button svg,
.channel-glyph svg,
.stage-title svg,
.rail-action-glyph svg,
.side-nav-btn svg,
.empty-state-glyph svg,
.msg-pin-tag svg {
  display: block;
  flex-shrink: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(135, 142, 156, 0.24);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(135, 142, 156, 0.42);
}

/* =========================================================
   AUTH SCREEN
   ========================================================= */
.auth-screen {
  position: fixed;
  inset: 0;
  height: 100dvh;
  display: flex;
  align-items: safe center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: var(--bg-rail);
  padding:
    max(64px, calc(env(safe-area-inset-top) + 52px))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  z-index: 100;
}

.auth-shell {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-invite-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.auth-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.auth-wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.auth-tab {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.16s ease, color 0.16s ease;
}

.auth-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.auth-form,
.register-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-group label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  line-height: 1.3;
}

.field-group input:not([type="checkbox"]):not([type="color"]):not([type="range"]),
.field-group select {
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--accent);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  width: 100%;
  padding-right: 40px !important;
}

.password-wrap .icon-ghost-btn {
  position: absolute;
  right: 4px;
}

.form-error {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  border: 1px solid rgba(217, 83, 95, 0.28);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

/* Buttons */
.btn-primary {
  min-height: 38px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  padding: 0 15px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), background 0.14s ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:active {
  transform: scale(0.985);
}
.btn-primary:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn-subtle {
  min-height: 38px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  padding: 0 13px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn-subtle:hover {
  background: var(--bg-active);
  border-color: var(--border-strong);
}
.btn-subtle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-danger {
  min-height: 38px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(217, 83, 95, 0.3);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  padding: 0 13px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-sm {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

.icon-ghost-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.14s ease, color 0.14s ease;
}
.icon-ghost-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* =========================================================
   MAIN WORKSPACE SHELL
   ========================================================= */
.app-shell {
  --rail-w: 72px;
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background: var(--bg-stage);
}

/* Column 1: Server Rail */
.server-rail {
  width: 72px;
  flex-shrink: 0;
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  z-index: 30;
  user-select: none;
}

.rail-top,
.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.rail-scroll {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.rail-scroll::-webkit-scrollbar {
  width: 0;
}

.rail-divider {
  width: 32px;
  height: 1px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.rail-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  transition: border-radius 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.16s ease, color 0.16s ease;
  flex-shrink: 0;
}

.rail-item:hover,
.rail-item.active {
  border-radius: 11px;
}

.rail-item.active {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.rail-action-glyph {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.rail-action-glyph svg {
  width: 20px;
  height: 20px;
}

.rail-home-icon {
  width: 44px;
  height: 44px;
  border-radius: inherit;
  display: block;
}

.rail-server-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.rail-pill {
  position: absolute;
  left: -14px;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--text-primary);
  transition: height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.rail-item.has-unread .rail-pill {
  height: 9px;
}
.rail-item:hover .rail-pill {
  height: 20px;
}
.rail-item.active .rail-pill {
  height: 34px;
  background: var(--accent);
}

.rail-badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-rail);
}

.rail-voice-dot {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--bg-rail);
}

.rail-action {
  color: var(--online);
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
}
.rail-action:hover {
  background: var(--online);
  color: #0b1611;
  border-color: var(--online);
}

/* Column 2: Sidebar */
.nav-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 25;
  user-select: none;
}

.sidebar-header {
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.srv-header-btn {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
}
.srv-header-btn:hover {
  background: var(--bg-hover);
}

.quick-switch-trigger {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quick-switch-trigger:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.kbd-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav-btn {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.14s ease, color 0.14s ease;
}
.side-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.side-nav-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

.side-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin-top: 8px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.side-section-head .icon-ghost-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin-top: 8px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  cursor: pointer;
}
.cat-header:hover {
  color: var(--text-secondary);
}
.cat-header .icon-ghost-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.cat-chevron {
  transition: transform 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cat-header.collapsed .cat-chevron {
  transform: rotate(-90deg);
}

.channel-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}
.channel-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.channel-row.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.channel-row.unread {
  color: var(--text-primary);
  font-weight: 700;
}
.channel-row.unread::before {
  content: '';
  position: absolute;
  left: -5px;
  width: 4px;
  height: 8px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.channel-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.channel-glyph {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.channel-row.active .channel-glyph {
  color: var(--accent);
}
.channel-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13.5px;
  line-height: 1.25;
}

.channel-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.channel-actions .icon-ghost-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}
.channel-row:hover .channel-actions {
  display: inline-flex;
}

.pill-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Voice Nested Tree */
.voice-tree-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 4px 24px;
}
.voice-tree-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.voice-tree-user:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.voice-tree-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.voice-tree-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 0.1s ease;
}
.voice-tree-user.speaking .voice-tree-avatar {
  box-shadow: 0 0 0 2px var(--online);
}
.voice-tree-user.speaking .voice-tree-name {
  color: var(--text-primary);
  font-weight: 600;
}
.voice-tree-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}
.live-pill {
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
}

/* DM Item in Sidebar */
.dm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.13s ease, color 0.13s ease;
}
.dm-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.dm-row.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.dm-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dm-row-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-row-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dm-close-btn {
  opacity: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dm-row:hover .dm-close-btn {
  opacity: 1;
}
.dm-close-btn:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

/* Persistent Voice Mini Bar */
.voice-mini-panel {
  background: var(--bg-rail);
  border-top: 1px solid var(--border-subtle);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.voice-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.voice-mini-status {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}
.voice-signal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--online);
  flex-shrink: 0;
}
.voice-mini-state {
  font-size: 12px;
  font-weight: 700;
  color: var(--online);
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-ping {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.voice-mini-channel {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-hangup-mini {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--danger);
  background: var(--danger-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.voice-hangup-mini:hover {
  background: var(--danger);
  color: #fff;
}
.voice-mini-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.voice-chip-btn {
  height: 29px;
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
}
.voice-chip-btn:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}
.voice-chip-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* User Pod */
.user-pod {
  height: 56px;
  padding: 0 8px;
  background: var(--bg-rail);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
}
.user-pod-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 8px;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.user-pod-identity:hover {
  background: var(--bg-hover);
}
.user-pod-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.user-pod-name {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.user-pod-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.user-pod-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.pod-ctrl-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pod-ctrl-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.pod-ctrl-btn.muted-state {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Avatars & Status Dots */
.avatar-wrap {
  position: relative;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  user-select: none;
}
.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-sidebar);
  background: var(--offline);
}
.status-dot.online { background: var(--online); }
.status-dot.idle { background: var(--idle); }
.status-dot.dnd { background: var(--dnd); }
.status-dot.offline,
.status-dot.invisible { background: var(--offline); }

/* =========================================================
   COLUMN 3: MAIN STAGE
   ========================================================= */
.main-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-stage);
  position: relative;
}

.stage-header {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.stage-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
}

.stage-title {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}

.stage-topic {
  font-size: 12.5px;
  color: var(--text-muted);
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-header-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-tool-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
}
.header-tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.header-tool-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.stage-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Friends Hub */
.friends-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.friends-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-chip {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.tab-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tab-chip.active {
  background: var(--bg-active);
  color: var(--text-primary);
}

.add-friend-bar {
  display: flex;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 8px 10px 8px 14px;
  align-items: center;
}
.add-friend-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
}

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border-top: 1px solid var(--border-subtle);
  transition: background 0.14s ease;
}
.friend-item:hover {
  background: var(--bg-hover);
}
.friend-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}
.friend-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.round-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.round-action-btn:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

/* Discovery Grid */
.discover-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.discover-search {
  max-width: 440px;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
}
.discover-search:focus {
  border-color: var(--accent);
}
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.discover-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
}
.discover-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.discover-banner {
  height: 68px;
  position: relative;
}
.discover-icon-holder {
  position: absolute;
  left: 16px;
  bottom: -20px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 4px solid var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  overflow: hidden;
}
.discover-card-body {
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.discover-card-title {
  font-weight: 700;
  font-size: 15.5px;
}
.discover-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}
.discover-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   VOICE, VIDEO & SCREEN-SHARE STAGE
   ========================================================= */
.voice-stage-view {
  background: #0c0d10;
  color: #f2f0ec;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px 16px;
  gap: 12px;
  overflow: hidden;
}

.embedded-call-stage {
  background: #0c0d10;
  color: #f2f0ec;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  height: clamp(236px, 41vh, 388px);
  max-height: 45vh;
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  overflow: hidden;
}

.voice-stage-view:fullscreen,
.embedded-call-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  padding: 18px 22px 20px;
  background: #08090c;
}

.stage-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.stage-top-left,
.stage-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.stage-pill-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #d7dce5;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.stage-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}
.stage-pill-btn.active {
  background: color-mix(in srgb, var(--accent) 22%, #181b22);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: #ffffff;
}
.stage-pill-btn.is-live {
  background: rgba(217, 83, 95, 0.18);
  border-color: rgba(217, 83, 95, 0.48);
  color: #ff9aa3;
}

.stage-canvas-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.stage-tiles-grid {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  overflow-y: auto;
}

.embedded-call-stage .stage-tiles-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.stage-spotlight-wrap {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-spotlight-main {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #12141a;
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.stage-spotlight-main .voice-tile {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
}
.stage-spotlight-strip {
  height: 98px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  flex-shrink: 0;
}
.embedded-call-stage .stage-spotlight-strip {
  height: 76px;
}
.stage-spotlight-strip .voice-tile {
  width: 164px;
  min-height: 0;
  height: 100%;
  flex-shrink: 0;
}

.voice-tile {
  position: relative;
  border-radius: 14px;
  background: #161920;
  border: 2px solid rgba(255, 255, 255, 0.06);
  min-height: 150px;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.16s ease;
}
.embedded-call-stage .voice-tile {
  min-height: 104px;
}
.voice-tile:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.voice-tile.speaking {
  border-color: var(--online);
  box-shadow: inset 0 0 0 1px var(--online);
}
.voice-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #07080b;
  display: block;
  pointer-events: none;
}
.voice-tile.is-cam:not(.is-screen) video {
  object-fit: cover;
}
.stage-spotlight-main .voice-tile.is-cam video {
  object-fit: contain;
}
.voice-tile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.12s ease;
}
.embedded-call-stage .voice-tile-avatar {
  width: 54px;
  height: 54px;
  font-size: 19px;
}
.voice-tile.speaking .voice-tile-avatar {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(59, 165, 116, 0.45);
}
.voice-tile-footer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.voice-tile-tag {
  background: rgba(10, 12, 16, 0.84);
  backdrop-filter: blur(8px);
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.voice-tile-top {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.voice-tile-top-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}
.tile-ctrl-pill {
  background: rgba(12, 14, 18, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f2f0ec;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.tile-ctrl-pill:hover {
  background: rgba(34, 39, 49, 0.96);
  border-color: rgba(255, 255, 255, 0.22);
}
.tile-ctrl-pill.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.stage-dock-wrap {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 12;
  pointer-events: auto;
}

.stage-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: #151820;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.dock-sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
  flex-shrink: 0;
}
.dock-btn {
  min-width: 44px;
  height: 42px;
  padding: 0 11px;
  border-radius: 11px;
  background: #222631;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #f2f0ec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.11s var(--ease-out-quart);
}
.dock-btn:hover:not(:disabled) {
  background: #2d3342;
  border-color: rgba(255, 255, 255, 0.14);
}
.dock-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.dock-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.dock-btn.is-streaming {
  background: #259e6d;
  color: #ffffff;
  border-color: transparent;
}
.dock-btn.muted {
  background: rgba(217, 83, 95, 0.22);
  border-color: rgba(217, 83, 95, 0.36);
  color: #ff7a85;
}
.dock-btn.hangup {
  min-width: 54px;
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}
.dock-btn.hangup:hover {
  filter: brightness(1.08);
  background: var(--danger);
}

/* =========================================================
   CHAT STREAM & COMPOSER
   ========================================================= */
.messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 0 10px;
  display: flex;
  flex-direction: column;
}

.load-older-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 14px;
}

.channel-hero {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0 18px 12px;
}
.channel-hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.channel-hero-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.date-divider {
  display: flex;
  align-items: center;
  margin: 14px 20px 8px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}
.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.date-divider span {
  padding: 0 10px;
}

.messages-list {
  display: flex;
  flex-direction: column;
}

.msg-row {
  position: relative;
  padding: 3px 20px 3px 72px;
  min-height: 28px;
  transition: background 0.1s ease;
}
.msg-row.msg-head {
  margin-top: 11px;
  padding-top: 5px;
  min-height: 46px;
}
.msg-row:hover {
  background: var(--bg-hover);
}
.msg-row.mentioned {
  background: var(--mention-bg);
  border-left: 3px solid var(--accent);
  padding-left: 69px;
}
.msg-row.flash-highlight {
  background: var(--accent-soft);
}

.msg-avatar {
  position: absolute;
  left: 20px;
  top: 6px;
  cursor: pointer;
}

.msg-compact-time {
  position: absolute;
  left: 14px;
  top: 6px;
  width: 48px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  user-select: none;
}
.msg-row:hover .msg-compact-time {
  opacity: 1;
}

.msg-reply-spine {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 3px;
  cursor: pointer;
}
.msg-reply-spine:hover {
  color: var(--text-primary);
}
.msg-reply-spine::before {
  content: '';
  width: 22px;
  height: 10px;
  margin-left: -32px;
  border-left: 2px solid var(--border-strong);
  border-top: 2px solid var(--border-strong);
  border-top-left-radius: 6px;
}
.msg-reply-author {
  font-weight: 700;
  color: var(--text-secondary);
}
.msg-reply-snippet {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.msg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
  line-height: 1.25;
}
.msg-author {
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.msg-author:hover {
  text-decoration: underline;
}
.msg-role-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.msg-time {
  font-size: 11px;
  color: var(--text-muted);
}
.msg-pin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.msg-pin-tag svg {
  width: 12px;
  height: 12px;
}

.msg-body {
  font-size: var(--chat-font-size, 14.5px);
  line-height: 1.48;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg-body.jumbo-emoji {
  font-size: 32px;
  line-height: 1.2;
}
.msg-edited {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-left: 5px;
}

/* Markdown Elements */
.md-inline-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
}
.md-codeblock {
  margin: 6px 0;
  border-radius: 9px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  white-space: normal;
}
.md-codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.md-codeblock pre {
  margin: 0;
  padding: 11px 13px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre;
}
.md-quote {
  border-left: 3px solid var(--border-strong);
  padding-left: 10px;
  color: var(--text-secondary);
  margin: 3px 0;
}
.md-spoiler {
  background: #2b2f3a;
  color: transparent;
  border-radius: 4px;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.md-spoiler.revealed {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  user-select: text;
}
.md-mention {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  padding: 0 4px;
  border-radius: 4px;
}
.custom-emoji {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  object-fit: contain;
}
.msg-body.jumbo-emoji .custom-emoji {
  width: 42px;
  height: 42px;
}

/* Attachments */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.att-image {
  max-width: min(420px, 100%);
  max-height: 310px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
  display: block;
}
.att-video {
  max-width: min(460px, 100%);
  max-height: 320px;
  border-radius: 10px;
  background: #000;
}
.att-audio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  width: min(380px, 100%);
}
.att-audio-card audio {
  flex: 1;
  height: 32px;
}
.speed-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--accent);
}
.att-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  width: min(360px, 100%);
}
.att-file-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-file-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* Poll Card */
.poll-card {
  margin-top: 8px;
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poll-question {
  font-weight: 700;
  font-size: 14.5px;
}
.poll-option-btn {
  position: relative;
  overflow: hidden;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  text-align: left;
}
.poll-option-btn.voted {
  border-color: var(--accent);
}
.poll-option-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent-soft);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.poll-option-label,
.poll-option-stat {
  position: relative;
  z-index: 1;
}
.poll-option-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.poll-foot {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Reactions & Thread Chip */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.react-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 7px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.react-chip:hover {
  border-color: var(--border-strong);
}
.react-chip.me {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-primary);
}
.thread-open-chip {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.thread-open-chip:hover {
  background: var(--bg-elevated);
}

/* Hover Message Toolbar */
.msg-toolbar {
  position: absolute;
  right: 18px;
  top: -14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 2px;
  display: none;
  align-items: center;
  gap: 1px;
  box-shadow: var(--shadow-md);
  z-index: 5;
}
.msg-row.touch-active {
  background: var(--bg-hover);
}
.msg-row:hover .msg-toolbar,
.msg-row.touch-active .msg-toolbar {
  display: inline-flex;
}
.msg-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.msg-tool-btn:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

/* Composer */
.composer-zone {
  padding: 0 18px 16px;
  flex-shrink: 0;
}
.typing-bar {
  height: 18px;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 0 6px 2px;
}
.composer-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.upload-shelf {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}
.shelf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}
.shelf-thumb {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
}

.voice-memo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--danger);
  border-radius: 11px;
  margin-bottom: 6px;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulseDot 1.1s infinite ease-in-out;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}
.rec-timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
}
.rec-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 18px;
}
.rec-wave span {
  width: 3px;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: waveBar 0.9s infinite ease-in-out;
}
.rec-wave span:nth-child(even) { animation-delay: 0.25s; height: 55%; }
@keyframes waveBar {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.composer-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.composer-box:focus-within {
  border-color: var(--accent);
}
.composer-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  min-height: 34px;
  max-height: 180px;
  padding: 7px 6px;
  line-height: 20px;
}
.composer-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.composer-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.composer-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.composer-send-btn:hover {
  background: var(--accent-hover);
}

.autocomplete-popup {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
}
.ac-item {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.ac-item:hover,
.ac-item.selected {
  background: var(--bg-active);
}

/* =========================================================
   COLUMN 4: RIGHT PANEL (MEMBERS / THREAD / PINS / SEARCH)
   ========================================================= */
.right-panel {
  width: 276px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.right-panel.wide-drawer {
  width: 360px;
}

.panel-head {
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  flex-shrink: 0;
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.member-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted);
  padding: 10px 8px 4px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.member-row:hover {
  background: var(--bg-hover);
}
.member-row.offline {
  opacity: 0.52;
}
.member-row.offline:hover {
  opacity: 0.88;
}
.member-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   POPOVERS, CONTEXT MENU, MODALS & CALL CARD
   ========================================================= */
.floating-popover,
.context-menu,
.profile-popover {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
}

.context-menu {
  min-width: 196px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ctx-item {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  text-align: left;
}
.ctx-item:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.ctx-item.danger {
  color: var(--danger);
}
.ctx-item.danger:hover {
  background: var(--danger);
  color: #fff;
}
.ctx-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}
.ctx-slider-box {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ctx-slider-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* User Profile Popover */
.profile-popover {
  width: 310px;
  overflow: hidden;
}
.profile-banner {
  height: 76px;
  background-size: cover;
  background-position: center;
}
.profile-avatar-holder {
  margin-top: -36px;
  margin-left: 16px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid var(--bg-elevated);
  position: relative;
}
.profile-body {
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-display {
  font-size: 17px;
  font-weight: 800;
}
.profile-handle {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.profile-bio {
  font-size: 13px;
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  white-space: pre-wrap;
}

/* Emoji Picker & Soundboard */
.emoji-picker-box {
  width: 320px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-height: 230px;
  overflow-y: auto;
}
.emoji-cell {
  height: 36px;
  border-radius: 7px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-cell:hover {
  background: var(--bg-active);
}

/* Modal System */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 150;
}
.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-card.modal-xl {
  max-width: 840px;
  height: 600px;
  flex-direction: row;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 16px;
}
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Split Settings Modal */
.settings-nav {
  width: 210px;
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.settings-nav-btn {
  padding: 8px 11px;
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.settings-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.settings-nav-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.settings-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
}
.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.08);
}

.perm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

/* Incoming Call Card */
.incoming-call-card {
  position: fixed;
  right: 22px;
  top: 22px;
  width: 300px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 15px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

/* Drop Overlay & Lightbox */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 210;
  pointer-events: none;
}
.drop-card {
  padding: 34px 48px;
  border-radius: 18px;
  background: var(--bg-elevated);
  border: 2px dashed var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 9, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 220;
  cursor: zoom-out;
}
.lightbox-backdrop img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 250;
}
.toast-item {
  padding: 10px 15px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
}
.toast-item.error {
  border-color: var(--danger);
  color: var(--danger);
}

/* =========================================================
   PLATFORM BADGES, SYSTEM BANNER & ADMIN CENTRAL
   ========================================================= */
.rail-admin {
  color: #f0b654;
  background: rgba(240, 182, 84, 0.1);
  border: 1px solid rgba(240, 182, 84, 0.28);
}
.rail-admin:hover {
  background: #f0b654;
  color: #16120b;
  border-color: #f0b654;
}

.system-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  vertical-align: middle;
  flex-shrink: 0;
}
.platform-badge svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.platform-badge.compact {
  padding: 2px 4px;
}
.pbadge-owner {
  color: #f4be59;
  background: rgba(244, 190, 89, 0.14);
  border: 1px solid rgba(244, 190, 89, 0.34);
}
.pbadge-admin {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(224, 145, 69, 0.32);
}
.pbadge-mod {
  color: var(--online);
  background: rgba(59, 165, 116, 0.14);
  border: 1px solid rgba(59, 165, 116, 0.32);
}
.pbadge-verified {
  color: #6ea8eb;
  background: rgba(110, 168, 235, 0.13);
  border: 1px solid rgba(110, 168, 235, 0.28);
}
.pbadge-system {
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.modal-card.modal-admin {
  max-width: 980px;
  height: 660px;
  flex-direction: row;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}
.admin-kpi-card {
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-kpi-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.admin-kpi-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-toolbar input[type="search"] {
  flex: 1;
  min-width: 190px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}
.admin-toolbar input[type="search"]:focus {
  border-color: var(--accent);
}
.admin-chip {
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.admin-chip.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-card-row {
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-card-row.is-suspended {
  border-color: rgba(217, 83, 95, 0.4);
  background: rgba(217, 83, 95, 0.05);
}
.admin-row-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
  flex: 1;
}
.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-role-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}
.admin-suspended-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-report-card {
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.admin-report-quote {
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--bg-sidebar);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* =========================================================
   VAELUX STUDIO POLISH: RAIL TOOLTIP, ACTIVE NOW, EMBEDS
   ========================================================= */
.auth-wordmark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.rail-tooltip {
  position: fixed;
  left: 78px;
  transform: translateY(-50%);
  background: #0b0c0f;
  color: #f4f1eb;
  border: 1px solid var(--border-strong);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 320;
  box-shadow: var(--shadow-md);
}
.rail-tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #0b0c0f;
  border-left: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.friends-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7px 12px;
  margin-bottom: 12px;
}
.friends-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13.5px;
}
.friends-section-count {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 4px 6px 8px;
}

.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
}
.empty-state-glyph {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empty-state-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-state-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.handle-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  margin-top: 12px;
}
.handle-share-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.active-now-card {
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 8px;
}
.active-now-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.active-now-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.jump-present-bar {
  margin: 0 18px 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  z-index: 8;
}

.invite-embed-card {
  margin-top: 7px;
  max-width: 410px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.invite-embed-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.invite-embed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.invite-embed-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.invite-embed-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.profile-modal-banner {
  height: 112px;
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  flex-shrink: 0;
}
.profile-modal-head,
.profile-modal-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 22px;
  margin-top: -38px;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.profile-modal-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 5px solid var(--bg-sidebar);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-modal-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  margin-top: 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.profile-modal-tab {
  position: relative;
  padding: 9px 2px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.profile-modal-tab:hover {
  color: var(--text-primary);
}
.profile-modal-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.ui-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--offline);
  flex-shrink: 0;
}
.ui-status-dot.online {
  background: var(--online);
}
.ui-status-dot.idle {
  background: var(--idle);
}
.ui-status-dot.dnd {
  background: var(--dnd);
}
.ui-status-dot.invisible,
.ui-status-dot.offline {
  background: var(--offline);
}

.ctx-item-status {
  justify-content: flex-start;
  gap: 9px;
}

.soundboard-popover {
  padding: 10px;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.soundboard-popover-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 2px;
}
.soundboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.soundboard-cue-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.soundboard-cue-btn:hover {
  background: var(--bg-active);
  border-color: var(--border-strong);
}
.soundboard-cue-btn svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* =========================================================
   MULTI-DEVICE, MOBILE, TABLET, TOUCH & SAFE-AREA SYSTEM
   ========================================================= */
.messages-scroll,
.sidebar-content,
.panel-scroll,
.modal-body,
.friends-body,
.discover-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-btn {
  position: relative;
  flex-shrink: 0;
}

.mobile-menu-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-stage);
}

.mobile-voice-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: #12151b;
  border-bottom: 1px solid rgba(59, 165, 116, 0.35);
  color: #f2f0ec;
  flex-shrink: 0;
}
.mobile-voice-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}
.mobile-voice-bar-title {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-voice-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.panel-close-mobile {
  display: none;
}

/* Tablet Landscape & Compact Desktops */
@media (max-width: 1180px) {
  .nav-sidebar {
    width: 228px;
  }
  .right-panel {
    width: 252px;
  }
  .right-panel.wide-drawer {
    width: 320px;
  }
}

/* Tablet Portrait, Foldables & Smartphones */
@media (max-width: 960px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .mobile-menu-btn {
    display: inline-flex;
    width: 36px;
    height: 36px;
  }

  .mobile-voice-bar:not(.hidden) {
    display: flex;
  }

  .panel-close-mobile {
    display: inline-flex;
  }

  .server-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--rail-w, 72px);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left);
    z-index: 41;
    transform: translateX(-110%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-sidebar {
    position: fixed;
    left: calc(var(--rail-w, 72px) + env(safe-area-inset-left));
    top: 0;
    bottom: 0;
    width: min(264px, calc(100vw - var(--rail-w, 72px) - env(safe-area-inset-left) - 34px));
    padding-top: env(safe-area-inset-top);
    z-index: 40;
    transform: translateX(calc(-100% - var(--rail-w, 72px) - 24px));
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }

  .user-pod {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    height: auto;
    min-height: 56px;
  }

  .app-shell.mobile-nav-open .server-rail,
  .app-shell.mobile-nav-open .nav-sidebar {
    transform: translateX(0);
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 9, 0.64);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 36;
  }

  .right-panel,
  .right-panel.wide-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(352px, calc(100vw - 28px));
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 42;
    box-shadow: var(--shadow-lg);
  }

  .stage-header {
    min-height: 52px;
    height: auto;
    padding:
      max(6px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      6px
      max(12px, env(safe-area-inset-left));
    flex-wrap: wrap;
    gap: 8px;
  }

  .stage-topic {
    display: none;
  }

  .stage-header-tools:has(.friends-toolbar) {
    width: 100%;
    order: 3;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .stage-header-tools:has(.friends-toolbar)::-webkit-scrollbar {
    display: none;
  }
  .friends-toolbar {
    flex-wrap: nowrap;
    width: max-content;
    gap: 6px;
  }
  .tab-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .composer-zone {
    padding:
      0
      max(12px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .floating-popover,
  .context-menu,
  .profile-popover {
    max-width: calc(100vw - 16px);
    max-height: calc(var(--app-height, 100dvh) - 24px);
    overflow-y: auto;
  }

  .emoji-picker-box {
    width: min(320px, calc(100vw - 20px));
  }

  .profile-popover {
    width: min(320px, calc(100vw - 20px));
  }

  .ctx-item {
    padding: 10px 12px;
    font-size: 14px;
  }

  .modal-backdrop {
    padding:
      max(10px, env(safe-area-inset-top))
      10px
      max(10px, env(safe-area-inset-bottom))
      10px;
  }

  .modal-card,
  .modal-card.modal-xl,
  .modal-card.modal-admin {
    flex-direction: column;
    width: 100%;
    max-height: calc(var(--app-height, 100dvh) - 20px);
    height: auto;
  }

  .modal-card.modal-xl,
  .modal-card.modal-admin {
    height: min(680px, calc(var(--app-height, 100dvh) - 20px));
  }

  .settings-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
  }
  .settings-pane {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
}

/* Smartphones & Narrow Screens */
@media (max-width: 600px) {
  .app-shell {
    --rail-w: 62px;
  }

  .rail-item {
    width: 42px;
    height: 42px;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .friends-body,
  .discover-body {
    padding: 14px 12px;
  }

  .add-friend-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
  .add-friend-bar .btn-primary {
    width: 100%;
  }

  .handle-share-bar {
    flex-wrap: wrap;
  }

  .discover-grid {
    grid-template-columns: 1fr;
  }

  .channel-hero {
    padding: 14px 14px 12px;
    margin: 0 10px 10px;
  }
  .channel-hero-title {
    font-size: 19px;
  }

  .date-divider {
    margin: 12px 12px 6px;
  }

  .msg-row {
    padding: 3px 12px 3px 56px;
  }
  .msg-row.msg-head {
    margin-top: 10px;
    padding-top: 4px;
  }
  .msg-avatar {
    left: 12px;
  }
  .msg-avatar .avatar-md {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .msg-compact-time {
    width: 40px;
    font-size: 9.5px;
  }
  .msg-toolbar {
    right: 8px;
    top: -16px;
    max-width: calc(100vw - 16px);
    overflow-x: auto;
  }
  .msg-tool-btn {
    width: 32px;
    height: 32px;
  }

  .jump-present-bar {
    margin: 0 10px 6px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .composer-box {
    padding: 6px 7px;
    gap: 4px;
  }
  .composer-icon-btn,
  .composer-send-btn {
    width: 36px;
    height: 36px;
  }

  .voice-memo-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 11px;
  }

  .voice-stage-view {
    padding: 10px 10px max(12px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .embedded-call-stage {
    height: clamp(210px, 38vh, 310px);
    padding: 8px 10px 10px;
    gap: 8px;
  }
  .stage-tiles-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    overflow-y: auto;
    align-content: start;
  }
  .embedded-call-stage .stage-tiles-grid {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 8px;
  }
  .voice-tile {
    min-height: 140px;
  }
  .embedded-call-stage .voice-tile {
    min-height: 88px;
  }
  .stage-spotlight-strip {
    height: 84px;
  }
  .stage-spotlight-strip .voice-tile {
    width: 132px;
    min-height: 76px;
  }
  .stage-dock-wrap {
    width: 100%;
  }
  .stage-dock {
    width: 100%;
    max-width: 100%;
    justify-content: space-evenly;
    gap: 5px;
    padding: 7px 9px;
    overflow-x: auto;
  }
  .dock-btn {
    min-width: 42px;
    height: 40px;
    padding: 0 9px;
    flex-shrink: 0;
  }
  .dock-btn.hangup {
    min-width: 48px;
  }

  .invite-embed-row {
    flex-wrap: wrap;
  }
  .invite-embed-row > button {
    width: 100%;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card,
  .modal-card.modal-xl,
  .modal-card.modal-admin {
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    max-height: calc(var(--app-height, 100dvh) - max(8px, env(safe-area-inset-top)));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-card.modal-xl,
  .modal-card.modal-admin {
    height: calc(var(--app-height, 100dvh) - max(12px, env(safe-area-inset-top)));
  }
  .modal-head {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 14px 16px;
  }

  .profile-modal-top {
    padding: 0 14px;
  }
  .profile-modal-tabs {
    padding: 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .profile-modal-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-row-left {
    min-width: 0;
    width: 100%;
  }
  .admin-row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .incoming-call-card {
    left: 12px;
    right: 12px;
    top: max(12px, env(safe-area-inset-top));
    width: auto;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .toast-item {
    text-align: center;
  }
}

/* Touch Devices (Phones, iPads, Android Tablets, Touch Laptops) */
@media (hover: none), (pointer: coarse) {
  .rail-tooltip {
    display: none !important;
  }
  .channel-row.active .channel-actions,
  .dm-row.active .dm-close-btn {
    display: inline-flex;
    opacity: 1;
  }
  .cat-header,
  .channel-row,
  .dm-row,
  .side-nav-btn,
  .member-row {
    min-height: 38px;
  }
}

/* Landscape Mobile (Watching Streams / Split Keyboard) */
@media (max-height: 520px) and (orientation: landscape) {
  .stage-header {
    min-height: 44px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .voice-stage-view {
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .stage-spotlight-wrap {
    flex-direction: row;
  }
  .stage-spotlight-strip {
    width: 136px;
    height: auto;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .stage-spotlight-strip .voice-tile {
    width: 100%;
    min-height: 76px;
  }
  .stage-dock {
    padding: 6px 12px;
  }
  .dock-btn {
    width: 40px;
    height: 36px;
  }
}


/* =========================================================
   VAELUX V3: ICON EMBLEM BADGES, BLANK SERVER CANVAS,
   AUDIO/CHANNEL CONTROLS, CUSTOM PROFILES & ADMIN STUDIO
   ========================================================= */

:root {
  --chat-font-size: 14.5px;
}

.msg-text {
  font-size: var(--chat-font-size, 14.5px);
}

html[data-density="compact"] .msg-row {
  padding-top: 1px;
  padding-bottom: 1px;
}
html[data-density="compact"] .msg-row.msg-head {
  margin-top: 6px;
  padding-top: 2px;
}
html[data-density="compact"] .channel-row {
  height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}

html[data-reduced-motion="1"] *,
html[data-reduced-motion="1"] *::before,
html[data-reduced-motion="1"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

/* Floating Micro-Tooltip for Icon Badges */
.ui-micro-tooltip {
  position: fixed;
  transform: translate(-50%, calc(-100% - 9px));
  background: #090a0d;
  color: #f5f2ec;
  border: 1px solid var(--border-strong);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 420;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}
.ui-micro-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 7px;
  height: 7px;
  background: #090a0d;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

/* Jewel-like Vector Icon Emblem Badges */
.vbadge-cluster {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}

.vbadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background 0.16s ease, border-color 0.16s ease;
  cursor: default;
  border: 1px solid transparent;
}
.vbadge svg {
  width: 13px;
  height: 13px;
  display: block;
}
.vbadge:hover {
  transform: translateY(-1px) scale(1.08);
}
.vbadge.is-interactive {
  cursor: pointer;
}

.vbadge-owner {
  color: #f5c156;
  background: rgba(245, 193, 86, 0.14);
  border-color: rgba(245, 193, 86, 0.34);
}
.vbadge-admin,
.vbadge-staff {
  color: #eb9d47;
  background: rgba(235, 157, 71, 0.14);
  border-color: rgba(235, 157, 71, 0.34);
}
.vbadge-mod {
  color: #43bf88;
  background: rgba(67, 191, 136, 0.14);
  border-color: rgba(67, 191, 136, 0.32);
}
.vbadge-partner {
  color: #63a8ef;
  background: rgba(99, 168, 239, 0.14);
  border-color: rgba(99, 168, 239, 0.32);
}
.vbadge-verified {
  color: #53b9ea;
  background: rgba(83, 185, 234, 0.14);
  border-color: rgba(83, 185, 234, 0.32);
}
.vbadge-pioneer {
  color: #e4835d;
  background: rgba(228, 131, 93, 0.14);
  border-color: rgba(228, 131, 93, 0.32);
}
.vbadge-bug_hunter {
  color: #5fc98c;
  background: rgba(95, 201, 140, 0.14);
  border-color: rgba(95, 201, 140, 0.32);
}
.vbadge-supporter {
  color: #e06a7c;
  background: rgba(224, 106, 124, 0.14);
  border-color: rgba(224, 106, 124, 0.32);
}

/* Profile Card Badge Tray (Popover & Full Modal) */
.profile-badge-tray {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
}
.profile-badge-tray .vbadge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.profile-badge-tray .vbadge svg {
  width: 15px;
  height: 15px;
}

/* System Banner Levels */
.system-banner.warn {
  background: rgba(226, 165, 59, 0.16);
  border-bottom-color: #e2a53b;
}
.system-banner.critical {
  background: rgba(217, 83, 95, 0.18);
  border-bottom-color: var(--danger);
}

/* Two-Tone Custom Profile Surfaces & Links */
.profile-popover.has-custom-accent,
.profile-modal-themed {
  border: 1.5px solid color-mix(in srgb, var(--p-accent, var(--border-strong)) 55%, var(--border-strong));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--p-primary, #181a20) 14%, var(--bg-elevated)) 0%,
      color-mix(in srgb, var(--p-accent, #181a20) 11%, var(--bg-sidebar)) 100%
    );
}

.profile-pronouns {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
}

.profile-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.profile-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  max-width: 100%;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.profile-link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.profile-link-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.settings-profile-preview {
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-sidebar);
  margin-bottom: 14px;
}

/* Server Sidebar Banner & Blank Server Canvas */
.sidebar-server-banner {
  width: 100%;
  height: 96px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-empty-server {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-empty-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.sidebar-empty-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-hover);
}
.sidebar-empty-btn svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.empty-server-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow-y: auto;
}
.empty-server-shell {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.empty-server-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.empty-server-mark {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.empty-server-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.empty-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}
.empty-server-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease, background 0.16s ease;
}
.empty-server-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.empty-server-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.empty-server-card-icon svg {
  width: 18px;
  height: 18px;
}

/* Channel Bitrate / Limit / Flag Pills */
.ch-meta-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.ch-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  line-height: 1.3;
}
.ch-pill.is-full {
  color: var(--danger);
  border-color: rgba(217, 83, 95, 0.35);
}
.ch-pill.is-nsfw {
  color: #e06a7c;
  border-color: rgba(224, 106, 124, 0.35);
}

/* Range Sliders, Preset Chips & Live Mic Meter */
.range-control {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
}
.range-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}
input[type="range"].studio-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  outline: none;
  cursor: pointer;
}
input[type="range"].studio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
input[type="range"].studio-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.preset-chip {
  padding: 4px 9px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.preset-chip:hover,
.preset-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.mic-meter-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 99px;
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3ba574 0%, #e8a248 78%, #d9535f 100%);
  transition: width 0.06s linear;
}
.mic-vad-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  pointer-events: none;
}

/* Upgraded Admin Studio */
.modal-card.modal-admin {
  max-width: 1080px;
  height: 710px;
}

.admin-chart-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-chart-svg {
  width: 100%;
  height: 132px;
  display: block;
}

.admin-badge-toggles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.admin-badge-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.42;
  border: 1px solid transparent;
  transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
}
.admin-badge-btn svg {
  width: 14px;
  height: 14px;
}
.admin-badge-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.admin-badge-btn.active {
  opacity: 1;
  background: var(--accent-soft);
  border-color: rgba(232, 162, 72, 0.4);
  color: var(--accent);
}

.admin-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 10px;
}
.admin-upload-card {
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-upload-thumb {
  height: 108px;
  background: var(--bg-stage);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.admin-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-upload-meta {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
}

.link-editor-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 7px;
  align-items: center;
}

.channel-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 600px) {
  .link-editor-row {
    grid-template-columns: 1fr;
  }
  .empty-server-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PRECISION STUDIO SETTINGS LAYER & HARDWARE CONTROL SYSTEM
   ========================================================= */
@keyframes studioLayerIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card {
  max-width: 520px;
  border-radius: 12px;
  animation: modalPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-head {
  min-height: 52px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  flex-shrink: 0;
}

/* Full-Canvas Seamless Studio Layer (User Settings, Server Settings, Admin Central) */
.modal-backdrop.is-studio-layer {
  padding: 0;
  background: var(--bg-stage);
  align-items: stretch;
  justify-content: stretch;
}

.modal-backdrop.is-studio-layer .modal-card.modal-xl,
.modal-backdrop.is-studio-layer .modal-card.modal-admin {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: var(--bg-stage);
  animation: studioLayerIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 328px = 72px Server Rail + 256px Nav Sidebar -> exact workspace seam alignment */
.modal-backdrop.is-studio-layer .settings-nav {
  width: 328px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.settings-nav-head {
  height: 52px;
  padding: 0 18px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  flex-shrink: 0;
}
.settings-nav-head-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted);
  padding: 14px 10px 4px;
}
.settings-nav-section:first-child {
  padding-top: 2px;
}

.settings-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.14s ease, color 0.14s ease;
}
.settings-nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.78;
}
.settings-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.settings-nav-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.settings-nav-btn.active svg {
  color: var(--accent);
  opacity: 1;
}
.settings-nav-btn.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.modal-backdrop.is-studio-layer .settings-pane {
  background: var(--bg-stage);
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

/* Full-bleed 52px top horizon + centered content column + right-edge scrollbar */
.modal-backdrop.is-studio-layer .modal-head {
  height: 52px;
  min-height: 52px;
  width: 100%;
  max-width: none;
  padding: 0 max(28px, calc((100% - 780px) / 2));
  border-bottom: 1px solid var(--border-subtle);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.modal-backdrop.is-studio-layer .modal-card.modal-admin .modal-head {
  padding: 0 max(28px, calc((100% - 980px) / 2));
}

.modal-backdrop.is-studio-layer .modal-body {
  width: 100%;
  max-width: none;
  padding: 24px max(28px, calc((100% - 780px) / 2)) 56px;
  gap: 16px;
}
.modal-backdrop.is-studio-layer .modal-card.modal-admin .modal-body {
  padding: 24px max(28px, calc((100% - 980px) / 2)) 56px;
}

@media (max-width: 1180px) {
  .modal-backdrop.is-studio-layer .settings-nav {
    width: 300px;
  }
}

.studio-esc-btn {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 8px;
  border-radius: 7px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.studio-esc-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.studio-esc-glyph {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  line-height: 1;
}

/* Studio Surface Sections & Grids */
.studio-section {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.studio-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.studio-action-bar.between {
  justify-content: space-between;
}

/* Precision Hardware Pill Switches */
.modal-card input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--bg-rail);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  outline: none;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
}
.modal-card input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease;
}
.modal-card input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.modal-card input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}
[data-theme="paper"] .modal-card input[type="checkbox"]:checked::after {
  background: #ffffff;
}

.perm-toggle-row,
.studio-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  font-size: 13.5px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
label.perm-toggle-row:hover,
label.studio-switch-row:hover {
  border-color: var(--border-strong);
}

/* Custom Select Dropdowns (Exact 38px standard / 30px compact admin) */
.modal-card select,
.field-group select,
.admin-role-select {
  -webkit-appearance: none;
  appearance: none;
  height: 38px;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.modal-card select:hover,
.field-group select:hover,
.admin-role-select:hover {
  border-color: var(--border-strong);
}
.modal-card select:focus,
.field-group select:focus,
.admin-role-select:focus {
  border-color: var(--accent);
}
.modal-card select.admin-role-select,
select.admin-role-select {
  height: 30px;
  padding: 0 28px 0 10px;
  background-position: right 8px center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  background-color: var(--bg-elevated);
}

/* Tactile Segmented Controls (Exact 38px height to match inputs & selects) */
.seg-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  min-height: 38px;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.seg-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.seg-btn:hover {
  color: var(--text-primary);
}
.seg-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.seg-btn.active svg {
  color: var(--accent);
}

/* Precision Range Controls */
.range-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.range-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.range-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.range-value-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
input[type="range"].studio-range {
  height: 6px;
  border: none;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) var(--val-pct, 50%),
    var(--bg-rail) var(--val-pct, 50%),
    var(--bg-rail) 100%
  );
}
input[type="range"].studio-range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-primary);
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}
input[type="range"].studio-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}
.range-scale-marks {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Interactive Identity Banner & Avatar Dropzones + Color Studio */
.settings-profile-preview {
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background: var(--bg-sidebar);
  margin-bottom: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.identity-banner-zone {
  position: relative;
  height: 112px;
  width: 100%;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
}
.identity-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.identity-banner-zone:hover .identity-banner-overlay {
  opacity: 1;
}
.identity-clear-chip {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(12, 14, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.identity-clear-chip:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.identity-avatar-zone {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin-top: -38px;
  border: 4px solid var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.identity-avatar-zone.is-server-squircle {
  border-radius: 18px;
}
.identity-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.identity-avatar-zone:hover .identity-avatar-overlay {
  opacity: 1;
}

.color-studio-well {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.color-studio-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.color-picker-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 9px 0 5px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color 0.14s ease;
}
.color-picker-pill:hover {
  border-color: var(--border-strong);
}
.color-picker-dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.color-picker-pill input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: none;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1.5px solid transparent;
  transition: transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.14s ease;
}
.color-swatch:hover {
  transform: scale(1.08);
}
.color-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1.5px var(--bg-input);
}

/* Visual Theme Studio Cards & Live Chat Preview */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.theme-preview-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-preview-card:hover {
  border-color: var(--border-strong);
}
.theme-preview-card.active {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.theme-mini-window {
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 14px 36px 1fr;
  border: 1px solid rgba(128, 128, 128, 0.22);
}
.theme-mini-stage {
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.theme-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  padding: 0 2px;
}

.appearance-live-chat {
  border-radius: 9px;
  background: var(--bg-stage);
  border: 1px solid var(--border-subtle);
  padding: 6px 0 12px;
  overflow: hidden;
}
.appearance-live-chat .msg-row.msg-head {
  margin-top: 4px;
}

/* Master-Detail Role Studio & Tactile Permission Tiles */
.roles-studio-split {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.roles-list-rail {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.role-rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.role-rail-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.role-rail-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.role-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.perm-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.perm-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.perm-tile:hover {
  border-color: var(--border-strong);
}

/* Quick Switcher */
.qs-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.qs-item-left svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .modal-backdrop.is-studio-layer .settings-nav {
    width: 100%;
    padding: max(6px, env(safe-area-inset-top)) 0 0;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .settings-nav-head,
  .settings-nav-section,
  .settings-nav .ctx-sep {
    display: none !important;
  }
  .settings-nav-body {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
    gap: 6px;
    scrollbar-width: none;
  }
  .settings-nav-body::-webkit-scrollbar {
    display: none;
  }
  .settings-nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 34px;
    padding: 0 11px;
  }
  .settings-nav-btn.active::before {
    display: none;
  }
  .settings-nav-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .modal-backdrop.is-studio-layer .modal-head,
  .modal-backdrop.is-studio-layer .modal-card.modal-admin .modal-head {
    padding: 0 16px;
    font-size: 15.5px;
  }
  .modal-backdrop.is-studio-layer .modal-body,
  .modal-backdrop.is-studio-layer .modal-card.modal-admin .modal-body {
    padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  }
  .theme-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .roles-studio-split {
    grid-template-columns: 1fr;
  }
  .roles-list-rail {
    flex-direction: row;
    overflow-x: auto;
  }
  .role-rail-item {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .settings-grid-2,
  .settings-grid-3,
  .perm-tiles-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   V3.4 EDITORIAL TYPOGRAPHY, FRIENDS HUB & ANALYTICS DECK
   ========================================================= */
.auth-title,
.stage-title,
.modal-head,
.srv-header-btn,
.channel-hero-title,
.empty-state-title {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.rail-action.rail-action-admin {
  color: var(--accent);
  background: var(--bg-sidebar);
  border-color: var(--border-strong);
}
.rail-action.rail-action-admin:hover,
.rail-action.rail-action-admin.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Improved Message & Sidebar Legibility */
.msg-author {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.008em;
}
.msg-body {
  font-size: var(--chat-font-size, 15px);
  line-height: 1.54;
  letter-spacing: -0.003em;
  color: var(--text-primary);
}
.msg-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.channel-name {
  font-size: 14px;
  font-weight: 500;
}
.channel-row.active .channel-name,
.channel-row.unread .channel-name {
  font-weight: 600;
}
.dm-row-name {
  font-size: 14px;
  font-weight: 600;
}
.dm-row-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.side-section-head,
.cat-header {
  font-size: 11px;
  letter-spacing: 0.055em;
  color: var(--text-muted);
}

/* Friends Hub Header & Integrated Tabs */
.friends-header-sep {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  margin: 0 4px;
  flex-shrink: 0;
}

.friends-tabs-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.friends-tabs-bar::-webkit-scrollbar {
  display: none;
}

.tab-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.tab-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tab-chip.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.tab-chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.tab-chip.active .tab-chip-count {
  background: var(--bg-stage);
  color: var(--text-primary);
}
.tab-chip-count.is-alert {
  background: var(--danger);
  color: #ffffff;
}
.tab-chip-add {
  background: var(--online);
  color: #08150f;
  font-weight: 700;
}
.tab-chip-add:hover {
  filter: brightness(1.06);
  background: var(--online);
  color: #08150f;
}
.tab-chip-add.active {
  background: transparent;
  color: var(--online);
  box-shadow: inset 0 0 0 1.5px var(--online);
}

/* Friends Body, Search & Rows */
.friends-body {
  padding: 18px 24px 28px;
  gap: 14px;
}

.friends-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.14s ease;
}
.friends-search-bar:focus-within {
  border-color: var(--accent);
}
.friends-search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.friends-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}
.friends-search-bar input::placeholder {
  color: var(--text-muted);
}

.friends-section-count {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted);
  padding: 4px 4px 2px;
}

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 9px 12px;
  border-radius: 10px;
  border-top: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease;
}
.friend-item:hover {
  background: var(--bg-hover);
  border-top-color: transparent;
}
.friend-item:hover + .friend-item {
  border-top-color: transparent;
}

.friend-item-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex: 1;
}

.friend-identity-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.friend-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  line-height: 1.25;
}
.friend-display-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.friend-handle-tag {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.friend-item:hover .friend-handle-tag {
  color: var(--text-secondary);
}

.friend-subline {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(62, 180, 128, 0.14);
  color: var(--online);
  font-size: 11.5px;
  font-weight: 600;
}

.round-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.13s ease, color 0.13s ease, transform 0.13s ease;
}
.round-action-btn svg {
  width: 17px;
  height: 17px;
}
.round-action-btn:hover {
  background: var(--bg-panel);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.round-action-btn.is-accept {
  color: var(--online);
}
.round-action-btn.is-accept:hover {
  background: var(--online);
  color: #07140e;
  border-color: var(--online);
}
.round-action-btn.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(223, 88, 100, 0.4);
}

/* Add Friend Card & Suggestions */
.friends-add-card {
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.friends-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.friends-add-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}
.handle-copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.handle-copy-pill code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.friends-suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.friend-suggest-card {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.friend-suggest-card:hover {
  border-color: var(--border-strong);
}

/* Sidebar Quick Friends Strip (when DM list is short/empty) */
.sidebar-empty-hint {
  margin: 8px 6px;
  padding: 12px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Studio Sound Preview Grid in Voice Settings */
.sound-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.sound-preview-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.13s ease, color 0.13s ease, border-color 0.13s ease;
}
.sound-preview-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.sound-preview-btn:active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* =========================================================
   UNSTRETCHED, COMPREHENSIVE PLATFORM-ZENTRALE ANALYTICS
   ========================================================= */
.adm-overview-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-kpi-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-kpi-card {
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-kpi-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.admin-kpi-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(62, 180, 128, 0.14);
  color: var(--online);
}
.admin-kpi-delta.is-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.admin-kpi-delta.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Unstretched Proportional 7d / 14d Activity Deck */
.adm-activity-card {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adm-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.adm-activity-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.adm-activity-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.adm-legend-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.adm-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 5px;
}

.adm-activity-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.adm-sum-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-sum-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.adm-sum-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.adm-bars-grid {
  display: grid;
  grid-template-columns: repeat(var(--adm-cols, 7), minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding: 6px 2px 2px;
}

.adm-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.adm-bar-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1;
}
.adm-bar-col:hover .adm-bar-val {
  color: var(--text-primary);
}

.adm-bar-well {
  width: 100%;
  height: 124px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 6px 6px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.adm-bar-col:hover .adm-bar-well {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.adm-bar-fill {
  flex: 1;
  max-width: 22px;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
  transition: height 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.adm-bar-fill.is-zero {
  background: var(--border-strong);
  opacity: 0.45;
}
.adm-bar-fill-secondary {
  width: 7px;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--online);
}

.adm-bar-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.adm-bar-day {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.adm-bar-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.adm-daily-table-wrap {
  overflow-x: auto;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

.adm-daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.adm-daily-table th,
.adm-daily-table td {
  padding: 7px 11px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.adm-daily-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}
.adm-daily-table tr:last-child td {
  border-bottom: none;
}
.adm-daily-table td.num,
.adm-daily-table th.num {
  text-align: right;
  font-family: var(--font-mono);
}

/* Two-Column Operational Cards in Overview */
.adm-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.adm-panel-card {
  padding: 15px 17px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.adm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.adm-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.adm-meter-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.adm-meter-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.adm-meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.adm-meter-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.adm-meter-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--bg-input);
  overflow: hidden;
}
.adm-meter-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

.adm-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

@media (max-width: 1100px) {
  .admin-kpi-grid-8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .adm-dual-grid {
    grid-template-columns: 1fr;
  }
  .adm-activity-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .adm-bars-grid {
    gap: 4px;
  }
  .adm-bar-well {
    padding: 4px 3px 0;
    height: 98px;
  }
  .adm-activity-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   V4.0 — ARCHITECTURAL MOTION, STARTSEITE, UNCROPPED PROFILES,
   BRANDED CONNECTIONS, FRIEND INVITES & LINK EMBEDS
   ========================================================= */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* 1. Tactile Micro-Interactions & Smooth Transitions */
@keyframes vxStageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vxModalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vxModalCardIn {
  from {
    opacity: 0;
    transform: scale(0.965) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes vxPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes vxMsgGlide {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vxReactPop {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

html:not([data-reduced-motion="1"]) .stage-view:not(.hidden),
html:not([data-reduced-motion="1"]) .vx-pane-anim {
  animation: vxStageIn 0.15s var(--ease-out-quart);
}

html:not([data-reduced-motion="1"]) .modal-backdrop:not(.hidden) {
  animation: vxModalBackdropIn 0.14s ease-out;
}

html:not([data-reduced-motion="1"]) .modal-backdrop:not(.hidden) .modal-card {
  animation: vxModalCardIn 0.17s var(--ease-out-expo);
}

.modal-backdrop.is-closing {
  opacity: 0;
  transition: opacity 0.11s ease-in;
  pointer-events: none;
}
.modal-backdrop.is-closing .modal-card {
  transform: scale(0.97) translateY(4px);
  opacity: 0;
  transition: transform 0.11s ease-in, opacity 0.11s ease-in;
}

html:not([data-reduced-motion="1"]) .floating-popover:not(.hidden),
html:not([data-reduced-motion="1"]) .context-menu:not(.hidden),
html:not([data-reduced-motion="1"]) .profile-popover:not(.hidden) {
  animation: vxPopIn 0.14s var(--ease-out-expo);
}

.floating-popover.is-closing,
.context-menu.is-closing,
.profile-popover.is-closing {
  opacity: 0;
  transform: scale(0.97) translateY(3px);
  transition: opacity 0.1s ease-in, transform 0.1s ease-in;
  pointer-events: none;
}

html:not([data-reduced-motion="1"]) .msg-row.msg-just-arrived {
  animation: vxMsgGlide 0.15s var(--ease-out-quart);
}

html:not([data-reduced-motion="1"]) .react-chip.me {
  animation: vxReactPop 0.2s var(--ease-spring);
}

/* Server Rail Squircle Morph & Press Haptics */
.rail-item {
  border-radius: 22px;
  transition:
    border-radius 0.22s var(--ease-out-quart),
    background 0.16s ease,
    color 0.16s ease,
    transform 0.12s var(--ease-out-quart);
}
.rail-item:hover,
.rail-item.active {
  border-radius: 14px;
}
.rail-item:active {
  transform: translateY(1px) scale(0.94);
}
.rail-pill {
  transition: height 0.22s var(--ease-spring), background 0.16s ease;
}

.btn-primary,
.btn-subtle,
.btn-danger,
.pod-ctrl-btn,
.dock-btn,
.composer-icon-btn,
.composer-send-btn,
.settings-nav-btn,
.friends-htab,
.seg-btn {
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.11s var(--ease-out-quart),
    box-shadow 0.15s ease;
}

.btn-primary:active:not(:disabled),
.btn-subtle:active:not(:disabled),
.btn-danger:active:not(:disabled),
.pod-ctrl-btn:active,
.dock-btn:active,
.composer-icon-btn:active,
.composer-send-btn:active {
  transform: scale(0.965);
}

.channel-row,
.dm-row,
.member-row {
  transition: background 0.13s ease, color 0.13s ease, transform 0.12s var(--ease-out-quart);
}
.channel-row:active,
.dm-row:active {
  transform: scale(0.99);
}

/* 2. Critical Flexbox & Avatar Clipping Fixes */
.modal-body > * {
  flex-shrink: 0;
}

.settings-profile-preview {
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background: var(--bg-sidebar);
  margin-bottom: 4px;
}

.identity-banner-zone {
  position: relative;
  z-index: 1;
  height: 118px;
  width: 100%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.identity-avatar-row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.identity-avatar-zone {
  position: relative;
  z-index: 3;
  width: 82px;
  height: 82px;
  margin-top: -41px;
  border-radius: 50%;
  border: 5px solid var(--bg-sidebar);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent);
}

.identity-avatar-zone .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.identity-avatar-zone.is-server-squircle {
  border-radius: 20px;
}

/* Uncropped Profile Popover & Full Profile Modal */
.profile-popover {
  width: 340px;
  border-radius: 15px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.56);
}

.profile-banner {
  position: relative;
  z-index: 1;
  height: 92px;
  width: 100%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.profile-avatar-row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 16px;
  gap: 10px;
}

.profile-avatar-holder {
  position: relative;
  z-index: 3;
  margin-top: -40px;
  margin-left: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 5px solid var(--bg-elevated);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
  flex-shrink: 0;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.16s var(--ease-out-quart);
}
.profile-avatar-holder:hover {
  transform: scale(1.03);
}

.profile-avatar-clip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
}
.profile-avatar-clip .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-avatar-holder .status-dot,
.profile-modal-avatar .status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  border-width: 3.5px;
  border-style: solid;
  border-color: var(--bg-elevated);
  z-index: 4;
}

.profile-modal-banner {
  height: 124px;
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background-size: cover;
  background-position: center;
}

.profile-modal-top {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  margin-top: -42px;
  padding: 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.profile-modal-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 5px solid var(--bg-sidebar);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}
.profile-modal-avatar .status-dot {
  border-color: var(--bg-sidebar);
}

/* Self-Profile Card Interactive Controls & Badges Showcase */
.profile-card-surface {
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
html[data-theme="paper"] .profile-card-surface {
  background: rgba(255, 255, 255, 0.65);
}

.profile-copy-handle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.profile-copy-handle:hover {
  color: var(--text-primary);
}

.self-status-accordion {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.self-status-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.self-status-trigger:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.self-status-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding-top: 4px;
}
.self-status-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.self-status-opt:hover,
.self-status-opt.active {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.badges-showcase-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge-showcase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.badge-showcase-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 3. Branded Connections Studio ("Verknüpfungen") */
.conn-catalog-panel {
  padding: 12px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conn-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 7px;
}

.conn-service-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.conn-service-tile:hover {
  border-color: var(--svc-color, var(--accent));
  background: var(--bg-hover);
  transform: translateY(-1px);
}
.conn-service-emblem {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--svc-color, var(--accent)) 18%, transparent);
  color: var(--svc-color, var(--text-primary));
  flex-shrink: 0;
}
.conn-service-emblem svg {
  width: 15px;
  height: 15px;
}

.conn-composer-box {
  padding: 13px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conn-prefix-field {
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}
.conn-prefix-tag {
  padding: 0 10px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.conn-prefix-field input {
  border: none !important;
  background: transparent !important;
  height: 36px;
  flex: 1;
  min-width: 0;
  padding: 0 11px;
}

.conn-cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.conn-account-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  min-width: 0;
}
.conn-account-card:hover {
  border-color: var(--border-strong);
}
.conn-account-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.conn-account-handle {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conn-account-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-conn-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.profile-conn-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s var(--ease-out-quart);
}
.profile-conn-item:hover {
  border-color: var(--svc-color, var(--accent));
  background: var(--bg-hover);
  transform: translateX(2px);
}

/* 4. Direct Friend Invite Modal & Rich Chat Link Embeds */
.inv-friends-box {
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.inv-friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
}
.inv-friend-row:hover {
  background: var(--bg-hover);
}
.inv-friend-sent {
  background: rgba(59, 165, 116, 0.16) !important;
  color: var(--online) !important;
  border-color: rgba(59, 165, 116, 0.35) !important;
}

.md-channel-jump,
.md-internal-invite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.md-channel-jump:hover,
.md-internal-invite:hover {
  background: var(--accent);
  color: #fff;
}

.invite-embed-card {
  margin-top: 7px;
  max-width: 430px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.invite-embed-banner {
  height: 52px;
  background-size: cover;
  background-position: center;
}
.invite-embed-inner {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.link-embed-mount {
  display: block;
}
.link-embed-card {
  margin-top: 7px;
  max-width: 460px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-left: 3.5px solid var(--embed-accent, var(--accent));
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.link-embed-site {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.link-embed-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-embed-title:hover {
  text-decoration: underline;
}
.link-embed-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-embed-img {
  margin-top: 5px;
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
  display: block;
}

/* 5. Public Startseite & Multi-Platform Download Hub */
.landing-screen {
  position: fixed;
  inset: 0;
  height: 100dvh;
  width: 100%;
  background-color: var(--bg-rail);
  background-image:
    radial-gradient(ellipse 75% 48% at 50% -8%, var(--accent-soft), transparent 70%);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scroll-behavior: smooth;
  z-index: 90;
}

.lp-header {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-rail) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.lp-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding:
    max(14px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    14px
    max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.lp-brand:hover {
  text-decoration: none;
}
.lp-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.lp-brand-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.025em;
}
.lp-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.lp-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}
.lp-nav-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}
.lp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lp-mobile-dl-jump {
  display: none;
  text-decoration: none;
}
.lp-mobile-dl-jump:hover {
  text-decoration: none;
}

.lp-main {
  flex: 1 0 auto;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.lp-hero {
  display: grid;
  grid-template-columns: 1.02fr 1.08fr;
  gap: 44px;
  align-items: center;
  scroll-margin-top: 84px;
}
.lp-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lp-kicker {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lp-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 54px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin: 0;
}
.lp-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.lp-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease;
}
.lp-btn-download:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.lp-btn-download svg {
  width: 18px;
  height: 18px;
}
.lp-btn-webapp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 22px;
  border-radius: 11px;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease, background 0.15s ease;
}
.lp-btn-webapp:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.lp-os-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.lp-os-chip {
  padding: 5px 11px;
  border-radius: 7px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.lp-os-chip:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  text-decoration: none;
}

/* Direct Access & Capability Deck on Startseite */
.lp-access-deck {
  display: flex;
  flex-direction: column;
}
.lp-deck-card {
  border-radius: 18px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lp-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.lp-deck-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.lp-deck-title img {
  border-radius: 7px;
}
.lp-theme-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.lp-theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.14s ease;
}
.lp-theme-dot:hover {
  transform: scale(1.15);
}
.lp-theme-dot.active {
  box-shadow: 0 0 0 2px var(--text-primary);
}

.lp-deck-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.lp-deck-action-btn {
  height: 46px;
  border-radius: 11px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}
.lp-deck-action-btn:hover {
  background: var(--bg-active);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.lp-deck-action-btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}
.lp-deck-action-btn.primary:hover {
  background: var(--accent-hover);
}

.lp-invite-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.lp-invite-box label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lp-invite-row {
  display: flex;
  gap: 8px;
}
.lp-invite-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}
.lp-invite-row input:focus {
  border-color: var(--accent);
}

.lp-capability-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.lp-cap-pill {
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.lp-cap-pill:hover {
  background: var(--bg-active);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.lp-cap-pill span:first-child {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
}

/* Downloads Matrix */
.lp-downloads-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-margin-top: 84px;
}
.lp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.lp-section-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
}
.lp-release-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
}
.lp-dl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.lp-dl-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.16s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
}
.lp-dl-card:hover,
.lp-dl-card.detected-os {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  transform: translateY(-2px);
}
.lp-dl-card.flash-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.lp-dl-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}
.lp-dl-icon svg {
  width: 21px;
  height: 21px;
}
.lp-dl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lp-dl-info h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.lp-dl-info span {
  font-size: 12px;
  color: var(--text-muted);
}
.lp-dl-btn-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.lp-dl-action {
  text-decoration: none;
  flex-shrink: 0;
}
.lp-dl-action:hover {
  text-decoration: none;
}

.lp-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  padding:
    24px
    max(24px, env(safe-area-inset-right))
    max(24px, calc(env(safe-area-inset-bottom) + 12px))
    max(24px, env(safe-area-inset-left));
  background: var(--bg-panel);
}
.lp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lp-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-muted);
}
.lp-footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.lp-foot-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.lp-foot-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Auth Top Back Bar & Legal Bar */
.auth-top-bar {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 105;
}
.auth-legal-bar {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.auth-legal-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.auth-legal-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Legal Document Modal & DSGVO Privacy Zone */
.legal-doc-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.legal-doc-content {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.legal-doc-content h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
}
.legal-doc-content ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.legal-address-card {
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.danger-zone-card {
  border-color: rgba(217, 83, 95, 0.38) !important;
  background: color-mix(in srgb, var(--danger) 5%, var(--bg-sidebar)) !important;
}

@media (max-width: 980px) {
  .lp-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .lp-dl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lp-nav {
    display: none;
  }
  .lp-mobile-dl-jump {
    display: inline-flex;
  }
  .lp-main {
    padding: 36px 18px 56px;
    gap: 52px;
  }
}

@media (max-width: 640px) {
  .lp-dl-grid,
  .lp-deck-actions,
  .lp-capability-strip {
    grid-template-columns: 1fr;
  }
  .lp-header-inner {
    padding:
      max(12px, env(safe-area-inset-top))
      14px
      12px
      14px;
    gap: 8px;
  }
  .lp-brand-wordmark {
    font-size: 17px;
  }
}

/* =========================================================
   IMAGE CROP STUDIO & UPLOAD SHELF OPTIMIZATION
   ========================================================= */
.identity-crop-chip {
  position: absolute;
  top: 9px;
  right: 41px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(12, 14, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.identity-crop-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.upload-shelf {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.shelf-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.shelf-count-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}
.shelf-compress-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.shelf-compress-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.shelf-compress-chip input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}
.shelf-items-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.shelf-item-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 190px;
}
.shelf-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-item-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}
.shelf-crop-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.shelf-crop-btn:hover {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.crop-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 215;
  background: rgba(5, 7, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.crop-modal-backdrop.hidden {
  display: none !important;
}
.crop-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cropCardIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cropCardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.crop-modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  font-size: 15.5px;
  color: var(--text-primary);
}
.crop-stage {
  position: relative;
  width: 100%;
  height: 340px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    #0a0c10;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.crop-stage.is-dragging {
  cursor: grabbing;
}
.crop-source-img {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  max-width: none !important;
  max-height: none !important;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.crop-aperture {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(6, 8, 12, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.88);
  transition: border-radius 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-aperture.is-circle {
  border-radius: 50%;
}
.crop-aperture.is-squircle {
  border-radius: 28%;
}
.crop-aperture.is-rounded {
  border-radius: 14px;
}
.crop-aperture.is-rect {
  border-radius: 10px;
}
.crop-aperture-grid {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.16s ease;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: 33.333% 33.333%;
}
.crop-stage.is-dragging .crop-aperture-grid {
  opacity: 1;
}

.crop-controls {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
}
.crop-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.crop-aspect-pills {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg-rail);
  border: 1px solid var(--border-subtle);
}
.crop-aspect-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.crop-aspect-btn:hover {
  color: var(--text-primary);
}
.crop-aspect-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
}
.crop-tool-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crop-zoom-icon {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.crop-zoom-pct {
  min-width: 46px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.crop-modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-rail);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.crop-compress-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.crop-compress-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}
.crop-foot-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .crop-modal-backdrop {
    padding: 10px;
  }
  .crop-stage {
    height: 265px;
  }
  .crop-modal-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .crop-foot-btns {
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* =========================================================
   STUDIO CONTEXT MENU IDENTITY & CHANGELOG ("NEUERUNGEN")
   ========================================================= */
.rail-changelog-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-rail);
  pointer-events: none;
}

.settings-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-left: auto;
}

.settings-version-foot {
  margin-top: auto;
  padding: 10px 10px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.settings-version-btn {
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.settings-version-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.context-menu {
  min-width: 218px;
  max-width: 280px;
}

.ctx-user-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 3px;
}

.ctx-user-meta,
.ctx-user-head-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ctx-user-name,
.ctx-user-head-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-user-handle,
.ctx-user-head-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-item:disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.ctx-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ctx-item-left svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.ctx-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.65;
  margin-left: 12px;
  flex-shrink: 0;
}

.ctx-item:hover .ctx-kbd {
  opacity: 0.92;
}

.stage-title.is-interactive-user {
  cursor: pointer;
  padding: 3px 7px;
  margin-left: -7px;
  border-radius: 8px;
  transition: background 0.14s ease;
}

.stage-title.is-interactive-user:hover {
  background: var(--bg-hover);
}

/* Editorial Changelog Modal */
.modal-card.modal-changelog {
  max-width: 780px;
  width: 100%;
  height: min(640px, 86vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.changelog-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.changelog-ver-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.changelog-shell {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.changelog-rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.changelog-ver-btn {
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease;
}

.changelog-ver-btn:hover {
  background: var(--bg-hover);
}

.changelog-ver-btn.active {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.changelog-ver-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.changelog-ver-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.changelog-ver-btn.active .changelog-ver-tag {
  color: var(--accent);
}

.changelog-latest-pill {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.changelog-ver-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changelog-ver-date {
  font-size: 11px;
  color: var(--text-muted);
}

.changelog-stage {
  padding: 20px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.changelog-release-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.changelog-release-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.changelog-release-date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.changelog-cat-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changelog-cat-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.changelog-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.changelog-cat-badge.is-voice {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.changelog-cat-badge.is-ux {
  background: rgba(59, 165, 116, 0.14);
  border-color: rgba(59, 165, 116, 0.42);
  color: #4cc38a;
}

html[data-theme="paper"] .changelog-cat-badge.is-ux {
  color: #1f7a4f;
}

.changelog-entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.changelog-entry {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.changelog-entry-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.changelog-entry-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

@media (max-width: 700px) {
  .modal-card.modal-changelog {
    height: min(88vh, 720px);
  }
  .changelog-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .changelog-rail {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
  }
  .changelog-ver-btn {
    min-width: 148px;
    flex-shrink: 0;
  }
  .changelog-stage {
    padding: 16px;
  }
}
