/* Vanilla / Workshop 03. Restrained frosted surfaces inspired by FreeFrontend's
   Frosted Glass Parallax Button. Original layout; no neon, parallax or glow. */
:root {
  --accent: #c6c7cb;
  --accent-strong: #e5e5e7;
  --accent-2: #b5b7bd;
  --accent-3: #96999f;
  --accent-gradient: linear-gradient(#dedee1, #c4c5c9);
  --glow: transparent;
  --glow-soft: transparent;
  --cyan-glow: transparent;
  --shadow-glow: none;
  --radius: 12px;
  --radius-sm: 7px;
  --sidebar-w: 294px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --ease-spring: cubic-bezier(0.2, 0.7, 0.3, 1);
}
[data-theme="dark"] {
  --bg: #101113;
  --bg-elevated: rgba(25, 26, 29, 0.83);
  --bg-solid: #191a1d;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --bg-input: #141518;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6e6e9;
  --text-dim: #91939b;
  --bubble-in: #202125;
  --bubble-out: #303237;
  --bubble-out-text: #eeeef1;
  --danger: #df8e91;
  --success: #94b5a3;
  --warning: #c9b694;
  --glass-blur: 18px;
}
[data-theme="light"] {
  --bg: #eeefef;
  --bg-elevated: rgba(249, 249, 248, 0.85);
  --bg-solid: #fff;
  --bg-input: #f0f0ef;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #232528;
  --text-dim: #6f7379;
  --bubble-in: #fff;
  --bubble-out: #dfe1e3;
  --bubble-out-text: #222428;
  --accent: #646a73;
  --accent-gradient: linear-gradient(#34373c, #292c30);
}
body {
  background: var(--bg);
  letter-spacing: -0.15px;
  -webkit-font-smoothing: antialiased;
}
.bg-fx,
.brand-logo-ring {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  letter-spacing: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--text-dim);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
[hidden] {
  display: none !important;
}
/* Strip the previous visual theme, including hardcoded colored pseudo-elements. */
.auth-card::before,
.auth-card::after,
.brand-logo::before,
.brand-logo::after,
.btn-glow::before,
.btn-glow::after,
.conv-item::before,
.chat-placeholder::before,
.profile-banner::before,
.profile-banner::after,
.modal::before,
.sidebar::before,
.chat-header::after {
  display: none !important;
}
.auth-card,
.modal,
.drawer,
.mini-popover,
.context-menu,
.call-card {
  box-shadow: 0 18px 60px #0005;
  animation-duration: 0.16s;
}
.btn,
.icon-btn,
.auth-tab,
.call-btn,
.conv-item,
.bubble,
.avatar,
.brand-logo-box {
  box-shadow: none !important;
  text-shadow: none !important;
}
.btn.primary,
.icon-btn.send {
  background: #d5d6da;
  color: #16171a;
  border: 1px solid #ffffff35;
  box-shadow: inset 0 1px 0 #fff6 !important;
}
.btn.primary:hover,
.icon-btn.send:hover {
  background: #eeeef0;
  filter: none;
  transform: translateY(-1px);
}
.btn.primary:active,
.icon-btn.send:active {
  transform: translateY(1px);
}
.btn {
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 16px;
  min-height: 40px;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover,
.btn.ghost.active {
  background: var(--bg-hover);
  border-color: var(--text-dim);
}
.btn.danger {
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger);
}
.icon-btn {
  border-radius: 7px;
  color: var(--text-dim);
  background: transparent;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
  transform: none;
}
.icon-btn:active {
  transform: scale(0.94);
}
input,
textarea,
select,
.field-control {
  border-radius: 7px !important;
  background: var(--bg-input);
  border-color: var(--border-strong);
  box-shadow: none !important;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--text-dim);
  outline: none;
}
input[type="checkbox"] {
  accent-color: #8e959f;
  width: 17px;
  height: 17px;
}
input[type="range"] {
  accent-color: #b1b5bc;
}
input[type="color"] {
  width: 52px;
  height: 35px;
  padding: 3px;
}
.section-eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
/* Three-part workbench */
.main-view {
  grid-template-columns: 70px var(--sidebar-w) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  height: 100dvh;
  background: var(--bg);
}
.workspace-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 10px 16px;
  background: #0b0c0e;
  border-right: 1px solid var(--border);
  min-height: 0;
  z-index: 2;
}
.rail-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
}
.server-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff13;
  background: #18191c;
  color: #96989f;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.server-mark:hover {
  background: #282a2f;
  color: #fff;
  transform: translateY(-1px);
}
.server-mark.active {
  background: #34363c;
  color: #f3f3f4;
  border-color: #ffffff30;
}
.server-mark.active::before {
  content: "";
  position: absolute;
  left: -14px;
  width: 3px;
  height: 20px;
  background: #dedee2;
  border-radius: 0 3px 3px 0;
}
.server-mark.rail-add {
  background: transparent;
  border-style: dashed;
}
.rail-divider {
  height: 1px;
  width: 26px;
  background: #ffffff12;
  margin: 1px 0;
}
.rail-spacer {
  flex: 1;
}
#server-rail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
}
.sidebar {
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  min-height: 0;
  position: relative;
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 22px 12px;
  flex-shrink: 0;
}
.edition-tag {
  font:
    10px ui-monospace,
    monospace;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 3px 5px;
  border-radius: 3px;
}
.sidebar-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.sidebar-header {
  padding: 10px 16px 20px;
  gap: 8px;
  min-height: 64px;
}
.sidebar-header h2 {
  font-size: 23px;
  letter-spacing: -0.9px;
  font-weight: 650;
  background: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heading-dot {
  width: 5px;
  height: 5px;
  background: var(--text-dim);
  border-radius: 50%;
}
#btn-menu {
  display: none;
}
.search-box {
  padding: 0 16px 16px;
}
.search-box input {
  font-size: 12px;
  min-height: 36px;
  padding-top: 9px;
  padding-bottom: 9px;
}
.search-box::before {
  left: 28px;
  top: 40%;
}
.directory-button {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  padding: 12px 22px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.directory-button .svg-icon:last-child {
  margin-left: auto;
}
.directory-button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.list-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin: 0;
  padding: 15px 22px 10px;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  font-weight: 650;
}
.list-caption > span {
  font:
    8px ui-monospace,
    monospace;
  opacity: 0.55;
}
.conversation-list {
  padding: 0 10px;
  flex: 1;
  overflow-y: auto;
}
.conv-item {
  padding: 13px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  gap: 11px;
  min-height: 74px;
  background: transparent;
  transform: none !important;
}
.conv-item.active {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.conv-name {
  font-size: 13px;
  font-weight: 600;
}
.conv-last {
  font-size: 11px;
  color: var(--text-dim);
}
.conv-time {
  font-size: 9px;
}
.conv-top {
  gap: 7px;
}
.avatar {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #303238;
  color: #d9dbe0;
  font-size: 12px;
}
.avatar.placeholder {
  background: #303238;
  color: #dadbe0;
  box-shadow: none;
}
.status-dot {
  background: var(--success);
  box-shadow: none !important;
  border: 2px solid var(--bg-solid);
}
.badge {
  background: #c2c5cb;
  color: #17181b;
  font-size: 9px;
  box-shadow: none;
}
.account-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  background: var(--bg-input);
  flex-shrink: 0;
}
.account-strip > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.account-strip strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-strip small {
  font-size: 10px;
  color: var(--text-dim);
}
.account-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-left: auto;
  flex-shrink: 0;
}
.chat-panel {
  background: var(--bg);
  min-height: 0;
  overflow: hidden;
}
/* Quiet editorial home */
.chat-placeholder {
  padding: 28px 42px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  text-align: left;
  height: 100%;
  background: radial-gradient(ellipse at 100% 0%, #ffffff03, transparent 60%);
  gap: 35px;
}
.welcome-top,
.welcome-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.welcome-live {
  display: flex;
  align-items: center;
  gap: 7px;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.welcome-live i {
  width: 5px;
  height: 5px;
  background: var(--success);
  border-radius: 50%;
}
.welcome-main {
  max-width: 800px;
  margin: auto 0;
  padding: 30px 0;
  width: 100%;
}
.welcome-kicker {
  font:
    10px ui-monospace,
    monospace;
  color: var(--text-dim);
  letter-spacing: 2px;
}
.chat-placeholder h2 {
  font-size: clamp(36px, 4.6vw, 66px);
  line-height: 1.08;
  letter-spacing: -2.6px;
  font-weight: 550;
  margin: 25px 0 22px;
  background: none;
  color: var(--text);
}
.chat-placeholder h2 span {
  color: var(--text-dim);
}
.welcome-main > p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-dim);
  margin: 0;
  max-width: 540px;
}
.welcome-actions {
  display: flex;
  gap: 12px;
  margin: 28px 0 45px;
}
.welcome-actions .btn {
  display: flex;
  align-items: center;
  gap: 18px;
}
.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  max-width: 610px;
}
.welcome-index {
  font:
    9px ui-monospace,
    monospace;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.welcome-grid h3 {
  font-size: 14px;
  font-weight: 550;
  margin: 16px 0 9px;
}
.welcome-grid p {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.8;
  margin: 0;
}
.welcome-bottom {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font:
    9px ui-monospace,
    monospace;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.welcome-bottom kbd {
  border: 1px solid var(--border-strong);
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 9px;
}
.welcome-bottom kbd span {
  opacity: 0.5;
  margin-left: 10px;
}
/* Conversation surface */
.chat-header {
  min-height: 79px;
  padding: 16px 28px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(18px);
}
.peer-meta strong {
  font-size: 14px;
  font-weight: 600;
}
.peer-meta span {
  font-size: 10px;
}
.chat-actions {
  gap: 8px;
}
.messages-scroll {
  padding: 28px clamp(20px, 4vw, 65px) 16px;
}
.bubble {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bubble-in);
  padding: 11px 15px;
  max-width: min(560px, 85%);
  font-size: 13px;
  line-height: 1.65;
  backdrop-filter: none;
  transition: background 0.15s;
}
.msg-row.out .bubble {
  background: var(--bubble-out);
  color: var(--bubble-out-text);
  border: 1px solid var(--border-strong);
  border-bottom-right-radius: 4px;
}
.msg-row.in .bubble {
  border-bottom-left-radius: 4px;
}
.bubble .meta {
  color: var(--text-dim);
  font-size: 9px;
  margin-top: 4px;
}
.bubble .ticks {
  color: var(--text-dim);
}
.date-sep {
  margin: 18px 0 25px;
}
.date-sep span {
  background: transparent;
  color: var(--text-dim);
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
  border: 0;
  box-shadow: none;
}
.message-author {
  display: block;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.channel-view .msg-row.out,
.channel-view .msg-row.in {
  justify-content: flex-start;
}
.channel-view .bubble {
  max-width: 90%;
  border-radius: 5px;
  background: transparent;
  border-color: transparent;
  padding: 8px 12px;
}
.channel-view .bubble:hover {
  background: var(--bg-hover);
}
.channel-view .msg-row.out .bubble {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.channel-view .message-author {
  color: var(--text);
  font-size: 12px;
}
.composer {
  margin: 0 26px 22px;
  padding: 10px 12px;
  background: var(--bg-solid);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  box-shadow: 0 4px 16px #0001;
  backdrop-filter: blur(18px);
}
.composer-row {
  gap: 5px;
}
.composer textarea {
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 13px;
  padding: 10px 8px;
}
.composer .send {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}
.typing-indicator {
  margin: 0 28px;
  font-size: 10px;
  color: var(--text-dim);
}
.reaction-chip {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.reaction-chip.mine {
  background: var(--bg-hover);
  border-color: var(--text-dim);
  box-shadow: none;
}
.unread-divider {
  color: var(--text-dim);
}
.unread-divider::before,
.unread-divider::after {
  background: var(--border-strong);
}
/* Forms / overlays */
.modal {
  background: var(--bg-elevated);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  max-height: 88dvh;
}
.modal > header,
.drawer > header {
  border-bottom: 1px solid var(--border);
  padding: 17px 22px;
}
.modal > header h3,
.drawer > header h3 {
  font-size: 14px;
  font-weight: 550;
}
#modal-body {
  padding: 24px;
}
.backdrop {
  background: #0008;
  backdrop-filter: blur(4px);
}
.drawer {
  background: var(--bg-solid);
  border-left: 1px solid var(--border-strong);
}
.setting-row {
  border-color: var(--border);
  padding: 15px 0;
}
.setting-label {
  font-size: 12px;
}
.setting-row .small {
  font-size: 10px;
}
.settings-tab.active {
  background: var(--bg-hover);
  color: var(--text);
  box-shadow: none;
  border-color: var(--border-strong);
}
.switch .slider {
  background: #484c54;
  box-shadow: none !important;
}
.switch input:checked + .slider {
  background: #828b97;
  box-shadow: none !important;
}
.profile-banner {
  background: linear-gradient(125deg, #42464e, #23262c) !important;
  border-bottom: 1px solid var(--border);
}
.profile-hero {
  background: var(--bg-solid);
}
.profile-avatar-wrap {
  box-shadow: none !important;
}
.profile-name {
  background: none;
  color: var(--text);
}
.settings-save-bar {
  background: var(--bg-solid);
}
/* Welcome back */
.auth-view {
  background: var(--bg);
  padding: 35px 20px;
  position: relative;
}
.auth-view::before {
  content: "PRIVATE BY DESIGN / VANILLA";
  position: absolute;
  top: 30px;
  left: 35px;
  font:
    10px ui-monospace,
    monospace;
  color: var(--text-dim);
  letter-spacing: 2px;
}
.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  max-width: 440px;
  padding: 34px 36px;
  backdrop-filter: blur(18px);
}
.brand {
  text-align: left;
  margin-bottom: 26px;
}
.auth-edition {
  display: block;
  margin-bottom: 28px;
  font-size: 9px;
}
.brand-logo-box {
  display: block;
  width: 38px;
  height: 38px;
  margin: 0 0 20px;
  padding: 0;
  background: none;
  border: 0;
}
.brand-logo {
  width: 38px;
  height: 38px;
  filter: none;
  animation: none;
  box-shadow: none;
  transform: none !important;
}
.brand h1 {
  font-size: 36px;
  letter-spacing: -1.5px;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: var(--text);
  margin: 0 0 9px;
  text-shadow: none;
  animation: none;
}
.brand .tagline {
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-dim);
}
.auth-tabs {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px;
  margin-bottom: 25px;
  gap: 3px;
}
.auth-tab {
  font-size: 11px;
  border-radius: 4px;
  color: var(--text-dim);
  padding: 9px 6px;
}
.auth-tab.active {
  background: var(--bg-solid);
  color: var(--text);
  box-shadow: 0 1px 3px #0002 !important;
}
.auth-card .field-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0;
  font-weight: 500;
}
.auth-card .field {
  margin: 0 0 18px;
}
.auth-card .field-control {
  min-height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
}
.auth-card input {
  background: transparent;
  border: 0 !important;
  font-size: 12px;
  min-height: 43px;
}
.auth-card .btn.primary {
  margin-top: 8px;
  border-radius: 7px;
  min-height: 45px;
}
/* Community tools */
.server-description {
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0 22px 12px;
  overflow-wrap: anywhere;
}
#channel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding: 0 12px;
  flex: 1;
  min-height: 0;
}
.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}
.channel-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.channel-item.active {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text);
}
.channel-item > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-hash {
  font:
    20px ui-monospace,
    monospace;
  opacity: 0.55;
}
.server-member-count {
  padding: 12px 22px;
  font-size: 10px;
  color: var(--text-dim);
}
.create-menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.create-option {
  position: relative;
  padding: 18px 40px 18px 17px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-hover);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.create-option:hover {
  background: var(--bg-input);
  border-color: var(--border-strong);
}
.create-option strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
}
.create-option > span {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 7px;
}
.create-option > .svg-icon {
  position: absolute;
  right: 16px;
  top: 25px;
  color: var(--text-dim);
}
.community-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.community-form .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.community-form input {
  width: 100%;
  padding: 11px 12px;
}
.community-form .field-label {
  font-size: 12px;
  color: var(--text-dim);
}
.community-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.community-tabs .btn {
  padding: 8px 12px;
  font-size: 11px;
  min-height: 32px;
}
.community-settings-body h2 {
  font-size: 22px;
  letter-spacing: -0.7px;
  font-weight: 550;
  margin: 12px 0;
}
.community-settings-body > .btn {
  margin: 20px 10px 0 0;
}
.permission-matrix {
  display: flex;
  flex-direction: column;
}
.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
  font-size: 12px;
}
.permission-row select {
  font-size: 11px;
  padding: 7px 10px;
  min-width: 95px;
}
.role-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.role-list-row strong {
  font-size: 12px;
  flex: 1;
}
.role-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.member-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.member-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 95px;
}
.member-copy strong {
  font-size: 12px;
  width: 100%;
}
.member-copy small {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  width: 100%;
}
.role-tag {
  display: inline-block;
  border: 1px solid var(--border-strong);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
}
.community-form > .btn {
  align-self: flex-start;
}
@media (min-width: 1500px) {
  .chat-placeholder {
    padding: 34px 65px;
  }
  .welcome-main {
    margin: auto;
  }
}
@media (max-width: 1050px) {
  :root {
    --sidebar-w: 260px;
  }
  .chat-placeholder {
    padding: 25px;
  }
  .welcome-live {
    display: none;
  }
  .chat-placeholder h2 {
    font-size: 42px;
  }
  .welcome-grid {
    gap: 18px;
  }
  .welcome-actions {
    margin-bottom: 30px;
  }
  .chat-header {
    padding: 15px 20px;
  }
}
@media (max-width: 760px) {
  .main-view {
    grid-template-columns: 58px minmax(0, 1fr);
    padding-top: var(--safe-top);
  }
  .workspace-rail {
    padding: 16px 6px 12px;
    gap: 10px;
  }
  .server-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .server-mark.active::before {
    left: -10px;
  }
  .rail-brand {
    margin-bottom: 12px;
    width: 38px;
  }
  .sidebar {
    width: auto;
    max-width: none;
  }
  .workspace-heading {
    padding-top: 20px;
  }
  .sidebar-header {
    padding-top: 12px;
  }
  .sidebar-header h2 {
    font-size: 25px;
  }
  .chat-panel {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    background: var(--bg);
    z-index: 10;
  }
  .chat-panel.open {
    display: flex;
    transform: none !important;
  }
  .chat-header {
    padding: 12px 10px;
    padding-top: calc(12px + var(--safe-top));
    min-height: 72px;
    gap: 6px;
  }
  .peer-meta strong {
    font-size: 13px;
  }
  .chat-actions {
    gap: 1px;
  }
  .chat-actions .icon-btn {
    width: 32px;
    height: 34px;
  }
  .peer-avatar-slot .avatar {
    width: 32px;
    height: 32px;
  }
  .peer-meta {
    min-width: 0;
  }
  .peer-meta strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 135px;
  }
  .messages-scroll {
    padding: 18px 12px;
  }
  .bubble {
    max-width: 90%;
    font-size: 13px;
    padding: 9px 12px;
  }
  .channel-view .bubble {
    max-width: 100%;
  }
  .composer {
    margin: 0 8px calc(8px + var(--safe-bottom));
    padding: 7px 6px;
    border-radius: 9px;
  }
  .composer .icon-btn {
    width: 30px;
    height: 34px;
    flex-shrink: 0;
  }
  .composer-row {
    gap: 1px;
  }
  .composer textarea {
    font-size: 16px;
    padding: 8px 4px;
  }
  .composer .send {
    width: 34px;
  }
  .modal {
    width: calc(100% - 20px);
    max-width: 640px;
    max-height: 90dvh;
    border-radius: 12px;
  }
  .modal > header {
    padding: 14px 16px;
  }
  #modal-body {
    padding: 18px;
  }
  .community-tabs {
    gap: 4px;
  }
  .community-tabs .btn {
    padding: 7px 10px;
  }
  .auth-view::before {
    top: 20px;
    left: 20px;
    font-size: 8px;
  }
  .auth-card {
    padding: 28px 24px;
  }
  .auth-view {
    padding: 55px 15px 25px;
  }
  .account-strip {
    padding-bottom: calc(14px + var(--safe-bottom));
  }
  .drawer {
    width: min(100%, 430px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.voice-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  backdrop-filter: blur(22px);
  box-shadow: 0 10px 30px #0004;
  padding: 15px;
  min-width: 260px;
  color: var(--text);
}
.voice-dock-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-dock-title i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.voice-dock-title > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.voice-dock-title strong {
  font-size: 12px;
}
.voice-dock-title small {
  font-size: 10px;
  color: var(--text-dim);
}
.voice-dock-actions {
  display: flex;
  gap: 9px;
  margin: 12px 0 -4px;
}
.voice-dock-actions .off {
  color: var(--danger);
  background: var(--bg-hover);
}
@media (max-width: 760px) {
  .voice-dock {
    right: 8px;
    bottom: calc(82px + var(--safe-bottom));
    min-width: 225px;
    padding: 12px;
  }
  .voice-dock-actions {
    margin-top: 7px;
  }
}
.auth-card .field-control {
  display: block;
  width: 100%;
  height: 45px;
  min-height: 45px;
}
.auth-card .field-control input {
  display: block;
  width: 100%;
  height: 43px;
  min-height: 43px;
}
.chat-placeholder {
  margin: 0;
  width: 100%;
  max-width: none;
}
.btn.primary {
  animation: none;
}
.bubble {
  position: relative;
}
.message-more {
  position: absolute;
  right: -27px;
  top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--border);
  background: var(--bg-solid);
  color: var(--text-dim);
  border-radius: 5px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.12s;
}
.msg-row.out .message-more {
  right: auto;
  left: -27px;
}
.channel-view .msg-row.out .message-more {
  left: auto;
  right: -27px;
}
.bubble:hover .message-more,
.bubble:focus-within .message-more {
  opacity: 1;
}
.message-more:focus-visible {
  opacity: 1;
}
.pinned-message {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 15px;
}
.pinned-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.7;
}
.pinned-message .btn {
  margin-top: 10px;
}
.pinned-message img {
  max-width: 100%;
  max-height: 220px;
}
.search-message-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
  font-size: 13px;
}
@media (hover: none) {
  .message-more {
    position: static;
    opacity: 0.6;
    float: right;
    margin: 4px -5px -3px 10px;
  }
}
/* Override legacy modal label specificity, keeping permission rows horizontal. */
#modal-body .permission-row{display:flex;align-items:center;justify-content:space-between;margin:0;padding:12px 0;font-size:12px;gap:18px}
#modal-body .permission-row input[type=checkbox]{width:17px;height:17px;min-width:17px;padding:0;margin:0;flex:0 0 17px}
#modal-body .community-form>.field{display:flex;flex-direction:column;gap:8px;margin:0}
#modal-body .community-form input[type=color]{width:55px;height:34px;padding:3px}
.channel-header-icon{display:flex;align-items:center;justify-content:center;width:33px;height:33px;border:1px solid var(--border-strong);border-radius:8px;color:var(--text-dim);font:21px ui-monospace,monospace}
.community-form > p:empty{display:none}
