/* ============================================================
   CommHub — Graphite components
   v2 screens: friends, members rail, message actions, roles,
   settings, voice rooms.
   ============================================================ */

/* ---------- layout: members rail ---------- */

.main-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  grid-template-rows: 76px minmax(0, 1fr) auto;
}

.topbar { grid-column: 1 / -1; grid-row: 1; }
.content { grid-column: 1; grid-row: 2; }
.composer { grid-column: 1; grid-row: 3; }

.main-panel.members-open { grid-template-columns: minmax(0, 1fr) 248px; }

.members-panel {
  grid-column: 2;
  grid-row: 2 / 4;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(13, 15, 18, .72);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(18px);
  padding: 4px 8px 16px;
  min-width: 0;
}

.members-panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #8b9198;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(13, 15, 18, .96) 70%, transparent);
  backdrop-filter: blur(8px);
}

.members-panel-head span { color: #6f757d; }

.members-group-label {
  padding: 14px 8px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #767c84;
  text-transform: uppercase;
}

.member-line {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: left;
  background: transparent;
}

.member-line:hover { background: rgba(255, 255, 255, .05); }

.member-line .avatar { width: 30px; height: 30px; border-radius: 10px; font-size: 10px; }

.member-avatar-wrap { position: relative; flex: none; display: grid; }

.presence-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #121417;
  background: #667079;
}
.presence-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(87, 201, 139, .7); }
.presence-dot.idle { background: var(--yellow); }
.presence-dot.dnd { background: var(--red); }
.presence-dot.offline { background: #5c646d; }

.member-text { min-width: 0; display: grid; gap: 2px; }
.member-name { font-size: 12px; font-weight: 650; color: #d7dbe0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-sub { font-size: 9.5px; color: #7c828a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-line.is-offline .member-name { color: #8b9199; }
.member-line.is-offline .avatar { filter: grayscale(1); opacity: .6; }

.role-chip {
  margin-left: auto;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #cfd3d8;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 5px;
  padding: 2px 5px;
  flex: none;
}

/* ---------- friends screen ---------- */

.friends-screen { display: flex; flex-direction: column; min-height: 100%; margin: -28px -32px -24px; }

.friends-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 17, 20, .5);
  backdrop-filter: blur(14px);
  position: sticky;
  top: -28px;
  z-index: 3;
}

.friends-title { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.friends-glyph {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #dfe2e6;
  font-size: 12px;
}

.friends-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

@media (max-width: 1250px) {
  .friends-header { flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .friends-tabs { order: 3; flex-basis: 100%; }
  .friends-search { order: 2; flex: 1; min-width: 160px; width: auto; }
}

.tab-button {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #9aa0a8;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-button:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.tab-button.active { color: #fff; background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.tab-button.tab-add { background: linear-gradient(135deg, #eef0f3, #b9c0c9); color: #141517; margin-left: 2px; }
.tab-button.tab-add:hover { filter: brightness(1.05); }
.tab-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.friends-search { margin-left: auto; width: min(260px, 30vw); }
.friends-search input { padding: 8px 12px; font-size: 11.5px; border-radius: 9px; }

.friends-body { padding: 18px 26px 30px; flex: 1; }

.friends-section {
  margin: 6px 0 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: #7d838b;
}

.friend-list { display: grid; gap: 2px; }

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  animation: rise .3s cubic-bezier(.2, .8, .25, 1) both;
}
.friend-row:hover { background: rgba(255, 255, 255, .04); }

.friend-row .avatar { width: 38px; height: 38px; border-radius: 12px; }

.friend-info { min-width: 0; flex: 1; display: grid; gap: 2px; }
.friend-name { font-size: 13px; font-weight: 700; color: #eef0f3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-sub { font-size: 11px; color: #8b9199; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-sub.is-online { color: #a9b0b8; }

.friend-actions { display: flex; gap: 6px; flex: none; }

.round-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .06);
  color: #b9bec4;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.round-action:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.round-action.primary-round { background: linear-gradient(135deg, #eef0f3, #b9c0c9); color: #141517; border-color: transparent; }

.add-friend-panel {
  max-width: 720px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(22, 24, 28, .6);
  padding: 18px;
}
.add-friend-panel h3 { margin: 0 0 4px; font-size: 15px; font-family: var(--font-display); }
.add-friend-panel p { margin: 0 0 14px; font-size: 11.5px; color: var(--muted); }
.add-friend-input-row { display: flex; gap: 8px; }
.add-friend-input-row input { flex: 1; }
.add-friend-input-row input:focus-visible { outline: none; }
.add-friend-results { display: grid; gap: 6px; margin-top: 14px; }

/* ---------- dm entries ---------- */

.dm-entry { width: calc(100% - 16px); }
.dm-entry > span { display: grid; min-width: 0; }
.dm-entry .dm-kind {
  font-size: 8px;
  letter-spacing: .8px;
  color: #767c84;
  margin-top: 2px;
}

/* ---------- channel list ---------- */

.channel-category { margin-top: 10px; }
.channel-category > span {
  display: block;
  padding: 8px 19px 5px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #7d838b;
  text-transform: uppercase;
}

.channel-row { display: flex; align-items: center; position: relative; }
.channel-row .channel-entry { flex: 1; min-width: 0; }
.channel-entry span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.channel-manage-button {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #7d838b;
  background: transparent;
  font-size: 12px;
  opacity: 0;
  flex: none;
  margin-right: 8px;
}
.channel-row:hover .channel-manage-button { opacity: 1; }
.channel-manage-button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.private-mark { font-size: 9px; opacity: .55; margin-left: auto; }

/* ---------- messages ---------- */

.message-search-row {
  position: sticky;
  top: -28px;
  z-index: 2;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0 8px;
  background: linear-gradient(rgba(15, 17, 20, .96), rgba(15, 17, 20, .88) 70%, transparent);
}
.message-search-row input {
  max-width: 260px;
  padding: 7px 11px;
  font-size: 11px;
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .06);
  border-radius: 8px;
}
.message-search-row .small-action {
  padding: 6px 9px;
  font-size: 10px;
  background: transparent;
  border-color: transparent;
  color: #8b9198;
}
.message-search-row .small-action:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.composer input:focus-visible { outline: none; }

.chat-message { padding-right: 12px; }
.chat-message .message-actions {
  position: absolute;
  right: 12px;
  top: -12px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(28, 31, 36, .98);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .9);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity .15s, transform .15s;
  z-index: 3;
}

.chat-message:hover .message-actions { opacity: 1; pointer-events: auto; transform: translateY(0); }

.message-actions button {
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b9bec4;
  font-size: 11px;
  white-space: nowrap;
  background: transparent;
}
.message-actions button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.reply-preview {
  font-size: 10.5px;
  color: #9aa0a8;
  border-left: 2px solid rgba(255, 255, 255, .22);
  padding-left: 8px;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-label {
  font-size: 7.5px;
  letter-spacing: .8px;
  font-weight: 800;
  color: #d7dbe0;
  background: rgba(255, 255, 255, .09);
  border-radius: 4px;
  padding: 2px 5px;
}

.read-receipt { font-size: 9px; color: #767c84; margin-top: 4px; }

.message-reactions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  font-size: 11px;
  color: #cdd2d8;
}
.reaction-chip:hover { background: rgba(255, 255, 255, .09); }
.reaction-chip.active { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; }

.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment-image img {
  max-width: min(320px, 100%);
  max-height: 240px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  display: block;
}
.attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  font-size: 10.5px;
  color: #dfe2e6;
  text-decoration: none;
}
.attachment-file:hover { background: rgba(255, 255, 255, .08); }

.own-message .avatar { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 4px 14px rgba(0, 0, 0, .4); }

/* ---------- roles / settings / moderation ---------- */

.role-list { display: grid; gap: 6px; }
.role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .05);
}
.role-row .grow { min-width: 0; }
.role-row strong { font-size: 12px; display: block; }
.role-row small { font-size: 9px; color: #7d838b; }
.role-color { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 10px -2px currentColor; }

.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #aab0b8;
}
.inline-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  padding: 0;
  accent-color: #cfd4da;
  border-radius: 4px;
  flex: none;
}

.permission-setting-list { display: grid; gap: 8px; }
.modal-form .permission-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #b9bec4;
}
.permission-setting-row select { width: 210px; padding: 8px 10px; font-size: 11px; }

.app-modal h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 18px 0 8px;
  color: #dfe3e8;
}

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.panel-card h3 { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 1px; margin: 0 0 12px; color: #ccd1d7; }
.panel-card p { font-size: 11px; line-height: 1.6; }

.settings-action-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.section-divider { height: 1px; background: rgba(255, 255, 255, .07); margin: 16px 0; }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 115, 131, .28);
  background: rgba(224, 115, 131, .06);
}
.danger-zone strong { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: #e9a3ad; }

.danger-button {
  background: linear-gradient(135deg, #b8485a, #8d3342);
  color: #fff;
  border-radius: 9px;
  padding: 9px 13px;
  font-weight: 700;
  font-size: 11px;
}
.danger-button:hover { filter: brightness(1.08); }

.audit-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.audit-row {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}
.audit-row strong { font-size: 10.5px; letter-spacing: .4px; text-transform: capitalize; }
.audit-row span { font-size: 10px; color: #9aa0a8; }
.audit-row time { font-size: 9px; color: #6f757d; }

.selected-users { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); }

.server-card { display: flex; flex-direction: column; gap: 10px; }
.server-card-top { display: flex; align-items: center; gap: 10px; }
.server-card-top .grow { min-width: 0; }
.server-card-top strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-card-top span { font-size: 10px; color: var(--muted); }
.server-card p { margin: 0; font-size: 11px; line-height: 1.6; color: #a9b0b8; flex: 1; }

/* ---------- voice ---------- */

.voice-room { max-width: 1080px; margin: 0 auto; }
.voice-room-header h1 { font-family: var(--font-display); font-size: 24px; letter-spacing: -.7px; margin: 6px 0; }
.voice-room-header p { font-size: 11.5px; margin: 0 0 16px; }

.voice-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  min-height: 220px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(16, 18, 21, .6);
}

.voice-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 11px;
  overflow: hidden;
  background: #14161a;
  border: 1px solid rgba(255, 255, 255, .08);
}
.voice-tile video { width: 100%; height: 100%; object-fit: cover; background: #0e1013; }
.voice-tile-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .65);
  font-size: 10px;
  color: #e6e9ed;
}

.voice-placeholder {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  color: var(--muted);
  padding: 30px;
}
.voice-placeholder strong { color: var(--text); font-family: var(--font-display); font-size: 17px; }
.voice-placeholder p { font-size: 11px; }

.voice-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }

.forgot-link { display: block; margin: 12px auto 0; font-size: 11px; color: var(--muted); }
.forgot-link:hover { color: #fff; }

/* ---------- small screens ---------- */

@media (max-width: 1180px) {
  .main-panel.members-open { grid-template-columns: minmax(0, 1fr) 210px; }
}

@media (max-width: 950px) {
  .members-panel { display: none; }
  .main-panel.members-open { grid-template-columns: minmax(0, 1fr) 0; }
}

@media (max-width: 650px) {
  .friends-screen { margin: -19px -15px; }
  .friends-header { padding: 10px 15px; gap: 10px; flex-wrap: wrap; top: -19px; }
  .friends-tabs { gap: 4px; }
  .tab-button { padding: 6px 8px; font-size: 11px; }
  .friends-search { width: 100%; margin-left: 0; }
  .friends-body { padding: 14px 15px 24px; }
  .friend-row { padding: 8px 6px; }
  .main-panel { grid-template-rows: 62px minmax(0, 1fr) auto; }
}

/* ---------- home ---------- */

.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  margin: -28px -32px -24px;
  min-height: calc(100% + 52px);
}

.home-main { padding: 26px 26px 34px 32px; min-width: 0; }

.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.home-hero h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.9px; margin: 4px 0 6px; }
.home-hero p { margin: 0; font-size: 12px; color: var(--muted); max-width: 520px; line-height: 1.6; }
.home-hero-actions { display: flex; gap: 8px; flex: none; }

.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.home-stat {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(22, 24, 28, .6);
  display: grid;
  gap: 2px;
}
.home-stat-value { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.home-stat span:last-child { font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; color: #8b9198; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.home-card {
  background:
    linear-gradient(150deg, rgba(29, 31, 35, .92), rgba(19, 21, 24, .92)) padding-box,
    linear-gradient(140deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02) 45%, rgba(255, 255, 255, .07)) border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 16px;
  min-width: 0;
}
.home-card-wide { grid-column: 1 / -1; }

.home-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.home-card-head h3 { margin: 0; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: #c9ced4; font-family: var(--font-display); }
.home-card-count {
  font-size: 9.5px;
  font-weight: 800;
  color: #cfd4da;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  padding: 2px 7px;
}

.home-card-link {
  margin-top: 10px;
  background: none;
  color: #9aa0a8;
  font-size: 10.5px;
  padding: 0;
  text-align: left;
}
.home-card-link:hover { color: #fff; }

.home-empty { font-size: 11px; color: #7d838b; margin: 4px 0; line-height: 1.6; }

.home-profile-card { padding: 0; overflow: hidden; }
.home-profile-banner {
  height: 78px;
  background:
    radial-gradient(400px 140px at 20% -30%, rgba(255, 255, 255, .1), transparent 65%),
    linear-gradient(120deg, #2b2d31, #1a1c1f);
  background-size: cover;
  background-position: center;
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}
.home-profile-body { display: flex; align-items: flex-end; gap: 10px; padding: 0 16px; margin-top: -26px; position: relative; }
.home-profile-avatar { position: relative; flex: none; }
.home-profile-avatar .avatar { width: 58px; height: 58px; border-radius: 19px; border: 3px solid #1b1d21; font-size: 18px; }
.home-profile-avatar .presence-dot { width: 13px; height: 13px; right: 1px; bottom: 1px; border-width: 2.5px; }
.home-profile-ident { min-width: 0; flex: 1; padding-bottom: 4px; }
.home-profile-ident strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-profile-ident span { font-size: 10.5px; color: #8b9198; }
.home-profile-body .status-pill { margin-bottom: 6px; flex: none; }
.home-profile-status { margin: 10px 16px 0; font-size: 11px; color: #b9bec4; }
.home-profile-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 16px; }
.home-profile-actions .primary, .home-profile-actions .secondary { padding: 8px 11px; font-size: 11px; }

.home-request-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.home-request-row:last-of-type { border-bottom: 0; }
.home-request-row .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 11px; }
.home-request-info { min-width: 0; flex: 1; display: grid; }
.home-request-info strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-request-info span { font-size: 10px; color: #8b9198; }

.home-chat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  border-radius: 10px;
  text-align: left;
  background: transparent;
}
.home-chat-row:hover { background: rgba(255, 255, 255, .04); }
.home-chat-row .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 11px; }
.home-chat-info { min-width: 0; flex: 1; display: grid; gap: 2px; }
.home-chat-name { font-size: 12px; font-weight: 650; color: #e6e9ed; }
.home-chat-last { font-size: 10.5px; color: #8b9198; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-chat-time { font-size: 9.5px; color: #6f757d; flex: none; }

/* active now rail */

.active-rail {
  border-left: 1px solid var(--line);
  padding: 22px 14px 30px;
  background: rgba(13, 15, 18, .55);
  min-width: 0;
}

.active-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #cfd4da;
  padding: 0 6px 12px;
  text-transform: uppercase;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  letter-spacing: 1px;
  color: #d7dbe0;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  padding: 3px 7px;
}
.live-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(87, 201, 139, .9);
  animation: dot-pulse 2s ease-in-out infinite;
}

.active-list { display: grid; gap: 2px; }

.active-person {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px;
  border-radius: 9px;
  text-align: left;
  background: transparent;
}
.active-person:hover { background: rgba(255, 255, 255, .05); }

.active-avatar { position: relative; flex: none; display: grid; }
.active-avatar .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 11px; }
.active-avatar .presence-dot { width: 11px; height: 11px; right: -2px; bottom: -2px; }

.active-info { min-width: 0; flex: 1; display: grid; gap: 1px; }
.active-name { font-size: 12px; font-weight: 650; color: #e2e5ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-sub { font-size: 9.5px; color: #8b9198; }

.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(87, 201, 139, .8); flex: none; }

.active-empty {
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(22, 24, 28, .55);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.active-empty strong { display: block; font-size: 12px; font-family: var(--font-display); }
.active-empty p { margin: 6px 0 0; font-size: 10.5px; line-height: 1.55; color: #8b9198; }

/* ---------- profile popout ---------- */

.profile-popout {
  width: min(430px, calc(100% - 24px));
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.popout-cover {
  height: 118px;
  background:
    radial-gradient(500px 160px at 25% -40%, rgba(255, 255, 255, .14), transparent 65%),
    linear-gradient(120deg, #2c2e33, #191b1e);
  background-size: cover;
  background-position: center;
  position: relative;
}
.popout-cover-mark { position: absolute; right: 16px; bottom: 10px; font-size: 8px; letter-spacing: 1.6px; color: rgba(255, 255, 255, .55); }

.popout-body { padding: 0 18px 18px; position: relative; }
.popout-avatar-wrap {
  width: 86px;
  height: 86px;
  margin-top: -44px;
  border-radius: 26px;
  padding: 3px;
  background: linear-gradient(140deg, #f0f2f4, #9aa1a9);
  position: relative;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .55);
}
.popout-avatar-wrap .avatar { width: 100%; height: 100%; border-radius: 23px; font-size: 24px; }
.popout-avatar-wrap .presence-dot { width: 16px; height: 16px; right: 2px; bottom: 2px; border-width: 3px; }

.popout-name { font-family: var(--font-display); font-size: 22px; letter-spacing: -.6px; margin: 10px 0 2px; }
.popout-handle { font-size: 11px; color: #9aa0a8; }
.popout-status-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; flex-wrap: wrap; }
.popout-custom { font-size: 10px; color: #b9bec4; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); padding: 4px 8px; border-radius: 8px; }

.popout-actions { display: flex; gap: 6px; margin: 12px 0 2px; flex-wrap: wrap; }
.popout-actions .primary, .popout-actions .secondary { padding: 8px 12px; font-size: 11px; }

.popout-section { margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 10px; }
.popout-section h4 { font-size: 9px; letter-spacing: 1.3px; color: #8b9198; margin: 0 0 6px; text-transform: uppercase; }
.popout-section p { font-size: 11.5px; line-height: 1.65; margin: 0; color: #c6cbd2; }
.popout-empty { font-size: 10.5px !important; color: #7d838b !important; }

.popout-people { display: flex; flex-direction: column; gap: 5px; }
.popout-person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .05);
  font-size: 10.5px;
  color: #d4d8dd;
  text-align: left;
  width: 100%;
}
.popout-person:hover { background: rgba(255, 255, 255, .07); }
.popout-person .avatar { width: 24px; height: 24px; border-radius: 8px; font-size: 9px; }

.popout-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  font-size: 10.5px;
  color: #dfe2e6;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  overflow: hidden;
}
.popout-link:last-child { border-bottom: 0; }
.popout-link span:last-child { color: #8b9198; font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popout-link:hover { color: #fff; }

/* ---------- status menu ---------- */

.status-list { display: grid; gap: 4px; margin-top: 16px; }
.status-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 10px;
  text-align: left;
  background: rgba(255, 255, 255, .03);
  border: 1px solid transparent;
  width: 100%;
}
.status-row:hover { background: rgba(255, 255, 255, .07); }
.status-row.active { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); }
.status-row .status-dot { width: 12px; height: 12px; flex: none; }
.status-row-text { display: grid; gap: 2px; flex: 1; }
.status-row-text strong { font-size: 12px; font-weight: 650; }
.status-row-text small { font-size: 9.5px; color: #8b9198; }
.status-check { color: #cfd4da; font-weight: 800; font-size: 12px; }
.status-dot.invisible { background: #667079; box-shadow: 0 0 0 2px rgba(102, 112, 121, .16); }

@media (max-width: 1180px) {
  .home-screen { grid-template-columns: minmax(0, 1fr) 262px; }
}

@media (max-width: 1040px) {
  .home-screen { grid-template-columns: minmax(0, 1fr); }
  .active-rail { border-left: 0; border-top: 1px solid var(--line); padding: 18px 24px 26px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-card-wide { grid-column: auto; }
  .home-hero { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 650px) {
  .home-screen { margin: -19px -15px; }
  .home-main { padding: 18px 15px 26px; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .home-hero h1 { font-size: 22px; }
}

.friend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  color: #d7dbe0;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}

/* ---------- create server wizard ---------- */

.server-create-modal { width: min(460px, calc(100% - 24px)); }
.server-create-modal h2 { text-align: center; }
.server-create-modal > p.muted { text-align: center; margin: 0 0 16px; }

.server-start-list { display: grid; gap: 6px; }

.server-start-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .035);
  text-align: left;
}
.server-start-row:hover { background: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .14); }

.server-start-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 15px;
  color: #e3e6ea;
  background: linear-gradient(145deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .1);
}

.server-start-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.server-start-text strong { font-size: 12.5px; font-weight: 650; color: #eef0f3; }
.server-start-text small { font-size: 10px; color: #8b9198; }

.server-start-arrow { color: #7d838b; font-size: 16px; flex: none; }

.server-start-label {
  margin: 16px 0 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #8b9198;
}

.server-join-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: grid;
  gap: 8px;
  text-align: center;
}
.server-join-block strong { font-size: 12px; }

.server-start-links { display: flex; justify-content: space-between; margin-top: 16px; }

.server-icon-upload { display: grid; justify-items: center; gap: 7px; padding: 4px 0 8px; }
.server-upload-circle {
  width: 86px;
  height: 86px;
  border-radius: 26px;
  border: 1.5px dashed rgba(255, 255, 255, .22);
  display: grid;
  place-items: center;
  cursor: pointer;
  background-color: rgba(255, 255, 255, .03);
  background-size: cover;
  background-position: center;
  color: #b9bec4;
  font-size: 10.5px;
  font-weight: 700;
  transition: border-color .2s, background-color .2s;
}
.server-upload-circle:hover { border-color: rgba(255, 255, 255, .4); }
.server-upload-circle.has-image { border-style: solid; border-color: rgba(255, 255, 255, .25); color: transparent; }
.server-upload-circle.has-image span { opacity: 0; }

/* ---------- server menu ---------- */

.server-menu {
  position: fixed;
  z-index: 80;
  width: 232px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(30, 33, 38, .98);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .75);
  backdrop-filter: blur(16px);
  animation: modal-in .18s cubic-bezier(.2, .8, .25, 1) both;
}

.server-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .4px;
  color: #dfe2e6;
}
.server-menu-head span { font-size: 7.5px; letter-spacing: 1px; color: #8b9198; }

.server-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #cdd2d8;
  text-align: left;
  background: transparent;
}
.server-menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.server-menu-item small { font-size: 9px; color: #8b9198; font-weight: 500; }
.server-menu-item.danger { color: #e9a3ad; }
.server-menu-item.danger:hover { background: rgba(224, 115, 131, .12); color: #ffc2ca; }

.server-menu-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: 5px 2px; }

.owner-crown { margin-left: 5px; font-size: 9px; color: #e5c07b; }

.modal-form input:focus-visible,
.modal-form textarea:focus-visible,
.modal-form select:focus-visible { outline: none; }

input[type="file"] {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  color: #9aa0a8;
  font-size: 10.5px;
  padding: 7px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, .1);
  color: #e6e9ed;
  font: inherit;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: rgba(255, 255, 255, .18); }

/* ---------- server settings shell ---------- */

.server-settings-modal {
  width: min(1000px, calc(100% - 24px));
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.server-settings-modal .modal-close-row {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 5;
  margin: 0;
}

.ss-shell {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  height: min(760px, 88vh);
  background: rgba(20, 22, 26, .98);
}

.ss-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 10px 16px;
  border-right: 1px solid rgba(255, 255, 255, .07);
  background: rgba(15, 17, 20, .9);
  overflow-y: auto;
}

.ss-nav-head {
  padding: 0 10px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #eff1f4;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ss-nav-item {
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #aeb4bc;
  background: transparent;
  width: 100%;
}
.ss-nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.ss-nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.ss-nav-item.danger { color: #e9a3ad; margin-top: 4px; }
.ss-nav-item.danger:hover { background: rgba(224, 115, 131, .12); }
.ss-nav-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: 8px 6px; }

.ss-main { padding: 26px 26px 30px; overflow-y: auto; min-width: 0; }

.ss-head { margin-bottom: 18px; }
.ss-head h2 { font-family: var(--font-display); font-size: 21px; letter-spacing: -.6px; margin: 0 0 5px; }
.ss-head p { margin: 0; font-size: 11.5px; color: #8b9198; line-height: 1.6; max-width: 620px; }

.ss-form { display: grid; gap: 12px; }
.ss-form label { display: grid; gap: 6px; font-size: 10.5px; font-weight: 700; color: #aab0b8; }
.ss-form input, .ss-form textarea, .ss-form select { font-size: 12px; }
.ss-form .upload-field small { font-size: 9px; color: #7d838b; }
.ss-label { font-size: 10.5px; font-weight: 700; color: #aab0b8; }
.ss-field { display: grid; gap: 7px; }
.ss-hint { font-size: 9.5px; color: #7d838b; }

.ss-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.success-button {
  background: linear-gradient(135deg, #43d17d, #2aa35f);
  color: #06210f;
  border-radius: 9px;
  padding: 10px 15px;
  font-weight: 800;
  font-size: 11.5px;
  box-shadow: 0 8px 20px -10px rgba(67, 209, 125, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.success-button:hover { filter: brightness(1.07); transform: translateY(-1px); }

.ghost-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .12);
  color: #c9ced4;
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 11px;
}
.ghost-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.danger-ghost {
  background: transparent;
  border: 1px solid rgba(224, 115, 131, .3);
  color: #e9a3ad;
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 11px;
}
.danger-ghost:hover { background: rgba(224, 115, 131, .1); }

.color-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--swatch);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  position: relative;
}
.color-swatch.active { outline: 2px solid #fff; outline-offset: 2px; }
.color-swatch:hover { transform: translateY(-1px); }

.ss-profile-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 20px; }
.ss-preview { display: grid; gap: 8px; align-content: start; }
.ss-preview-card { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); background: #14161a; }
.ss-preview-banner { height: 92px; background: #101114; background-size: cover; background-position: center; }
.ss-preview-body { padding: 0 14px 14px; }
.ss-preview-icon {
  width: 62px; height: 62px; margin-top: -31px;
  border-radius: 19px; border: 3px solid #14161a;
  background: linear-gradient(145deg, #6f767f, #2c3035);
  display: grid; place-items: center; font-weight: 900; font-size: 20px; overflow: hidden;
}
.ss-preview-icon img { width: 100%; height: 100%; object-fit: cover; }
.ss-preview-name { font-family: var(--font-display); font-size: 16px; font-weight: 800; margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ss-preview-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 10px; color: #9aa0a8; }
.ss-preview-meta i { width: 8px; height: 8px; }

.server-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .8px;
  color: #0d0f12;
  background: var(--tag-color, #c9cdd4);
  vertical-align: middle;
}

.ss-tag-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: end; }
.tag-input { text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }
.ss-tag-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  font-size: 15px;
}
.ss-note { font-size: 10px; color: #7d838b; margin: 2px 0 0; line-height: 1.6; }

/* stickers */

.ss-inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.ss-inline-form label { display: grid; gap: 6px; font-size: 10.5px; font-weight: 700; color: #aab0b8; }
.ss-inline-form label:first-child { flex: 1; min-width: 220px; }
.ss-sticker-upload { margin-bottom: 18px; }
.ss-sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ss-sticker { border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 10px; background: rgba(255, 255, 255, .03); display: grid; gap: 6px; }
.ss-sticker img { width: 100%; height: 92px; object-fit: contain; }
.ss-sticker-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 9.5px; color: #aeb4bc; }
.ss-sticker-delete { width: 20px; height: 20px; border-radius: 6px; color: #8b9198; font-size: 10px; }
.ss-sticker-delete:hover { background: rgba(224, 115, 131, .16); color: #ffc2ca; }

/* members / roles */

.ss-member-list { display: grid; gap: 6px; }
.ss-member-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); }
.ss-member-row .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 11px; }
.ss-member-info { min-width: 0; flex: 1; display: grid; gap: 1px; }
.ss-member-info strong { font-size: 12px; }
.ss-member-info span { font-size: 9.5px; color: #8b9198; }
.ss-member-roles { display: flex; gap: 4px; flex-wrap: wrap; max-width: 40%; }
.ss-member-roles .profile-chip { padding: 4px 7px; font-size: 8.5px; }

.ss-roles-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.ss-role-list { display: grid; gap: 6px; }
.ss-role-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); }
.ss-role-info { min-width: 0; flex: 1; display: grid; gap: 1px; }
.ss-role-info strong { font-size: 12px; }
.ss-role-info span { font-size: 9.5px; color: #8b9198; }
.role-dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--role-color, #9aa4b5);
  display: grid; place-items: center; overflow: hidden;
  color: #101114; font-weight: 900; font-size: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.role-dot img { width: 100%; height: 100%; object-fit: cover; }
.ss-role-icon-row { display: flex; align-items: end; gap: 12px; }
.ss-role-icon-row .upload-field { flex: 1; }

.ss-invite-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.ss-invite-card p { margin: 3px 0 0; }

/* permission rows (roles + channel editor) */

.perm-scroll { max-height: 380px; overflow-y: auto; padding-right: 6px; border-top: 1px solid rgba(255, 255, 255, .06); margin-top: 4px; }
.perm-group { padding: 12px 0 4px; }
.perm-group h4 { font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #cfd4da; margin: 0 0 8px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.perm-row:last-child { border-bottom: 0; }
.perm-text { display: grid; gap: 2px; }
.perm-text strong { font-size: 11.5px; font-weight: 650; color: #e2e5ea; }
.perm-text small { font-size: 9.5px; color: #7d838b; line-height: 1.45; }
.perm-row input[type="checkbox"] { width: 17px; height: 17px; padding: 0; accent-color: #cfd4da; flex: none; }

.tri { display: inline-flex; gap: 4px; flex: none; }
.tri-btn {
  width: 28px; height: 26px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  color: #6f757d; font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}
.tri-btn:hover { background: rgba(255, 255, 255, .08); color: #c9ced4; }
.tri-btn.deny.active { background: rgba(224, 115, 131, .22); border-color: rgba(224, 115, 131, .5); color: #ffb3bd; }
.tri-btn.allow.active { background: rgba(67, 209, 125, .2); border-color: rgba(67, 209, 125, .5); color: #9ef0bd; }
.tri-btn.inherit.active { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #e6e9ed; }
.tri-row { padding: 8px 0; }

/* channel settings shell */

.channel-settings-modal { width: min(940px, calc(100% - 24px)); padding: 0; overflow: hidden; border-radius: 18px; }
.channel-settings-modal .modal-close-row { position: absolute; right: 10px; top: 10px; z-index: 5; margin: 0; }
.cs-shell { display: flex; flex-direction: column; height: min(700px, 86vh); background: rgba(20, 22, 26, .98); }
.cs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 20px 24px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.cs-eyebrow { font-size: 9px; letter-spacing: 1.4px; color: #8b9198; font-weight: 800; }
.cs-head h2 { font-family: var(--font-display); font-size: 20px; margin: 5px 0 12px; letter-spacing: -.6px; }
.cs-tabs { display: flex; gap: 4px; }
.cs-tabs .ss-nav-item { width: auto; padding: 8px 12px; border-radius: 8px 8px 0 0; }
.cs-body { padding: 20px 24px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.cs-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; }
.cs-perm-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
.cs-roles { display: grid; align-content: start; gap: 4px; }
.cs-role { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border-radius: 8px; text-align: left; font-size: 11.5px; color: #b9bec4; }
.cs-role:hover { background: rgba(255, 255, 255, .05); }
.cs-role.active { background: rgba(255, 255, 255, .1); color: #fff; }
.cs-role .role-dot { width: 16px; height: 16px; border-radius: 5px; font-size: 0; }
.cs-perms { display: flex; flex-direction: column; min-height: 0; }
.cs-perm-toolbar { margin-bottom: 10px; }
.cs-perm-toolbar input { max-width: 320px; }
.cs-perms .perm-scroll { max-height: none; flex: 1; }

/* composer stickers */

.sticker-picker {
  margin: 0 28px 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(28, 31, 36, .98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  max-height: 260px;
  overflow-y: auto;
}
.sticker-picker-head { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: 1.2px; color: #8b9198; font-weight: 800; padding: 2px 4px 8px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.sticker-item { display: grid; gap: 3px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06); }
.sticker-item:hover { background: rgba(255, 255, 255, .09); }
.sticker-item img { width: 100%; height: 58px; object-fit: contain; }
.sticker-item span { font-size: 8.5px; color: #9aa0a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-sticker { max-width: 160px; max-height: 160px; display: block; margin-top: 6px; }

.cs-perms .perm-scroll { max-height: 44vh; overflow-y: auto; }
.cs-perms { min-height: 0; }

.modal-form .perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; }
.modal-form .perm-row input[type="checkbox"] { width: 17px; height: 17px; padding: 0; flex: none; }

/* ---------- access ---------- */

.access-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.access-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  padding: 18px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}
.access-card:hover { background: rgba(255, 255, 255, .06); }
.access-card.active { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.access-icon { font-size: 18px; color: #dfe2e6; margin-bottom: 2px; }
.access-card strong { font-size: 12px; }
.access-card small { font-size: 9.5px; color: #8b9198; line-height: 1.4; max-width: 150px; }

.ss-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 12px; }
.ss-toggle > span:first-child { display: grid; gap: 3px; }
.ss-toggle strong { font-size: 12px; }
.ss-toggle small { font-size: 10px; color: #8b9198; line-height: 1.5; }
.ss-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: #cfd4da; flex: none; }
.ss-toggle.static { border-bottom: 1px solid rgba(255, 255, 255, .06); margin-top: 6px; }

.ss-rules { margin: 12px 0 4px; display: grid; gap: 8px; }
.ss-rules-list { display: grid; gap: 6px; }
.ss-rule-row { display: flex; align-items: center; gap: 8px; }
.ss-rule-row > span { width: 18px; text-align: right; font-size: 10px; color: #7d838b; flex: none; }
.ss-rule-row input { flex: 1; font-size: 11.5px; }
.ss-rule-remove { width: 24px; height: 24px; border-radius: 6px; color: #7d838b; font-size: 10px; flex: none; }
.ss-rule-remove:hover { background: rgba(224, 115, 131, .14); color: #ffc2ca; }
.ss-rule-examples { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.example-chip { padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); font-size: 9.5px; color: #aeb4bc; }
.example-chip:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- audit ---------- */

.audit-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.audit-filters label { display: grid; gap: 5px; font-size: 9.5px; font-weight: 700; color: #8b9198; }
.audit-filters select { font-size: 11.5px; }
.audit-cards { display: grid; gap: 8px; }
.audit-card { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .025); }
.audit-card:hover { background: rgba(255, 255, 255, .05); }
.audit-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: #cfd4da; font-size: 13px; flex: none; }
.audit-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.audit-copy strong { font-size: 11.5px; font-weight: 650; color: #e2e5ea; }
.audit-copy small { font-size: 9.5px; color: #7d838b; }
.audit-chevron { color: #6f757d; font-size: 15px; }

/* ---------- bans ---------- */

.ban-search { display: flex; gap: 8px; margin-bottom: 14px; }
.ban-search input { flex: 1; }
.ban-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 48px 24px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .02); }
.ban-empty-art { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; color: #6f757d; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.09), rgba(255,255,255,.02)); border: 1px solid rgba(255, 255, 255, .08); }
.ban-empty strong { font-family: var(--font-display); font-size: 15px; margin-top: 6px; }
.ban-empty p { margin: 0; font-size: 11px; color: #8b9198; max-width: 340px; line-height: 1.6; }

/* ---------- automod ---------- */

.automod-list { display: grid; gap: 10px; }
.automod-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .03); }
.automod-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); font-size: 14px; color: #cfd4da; flex: none; }
.automod-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.automod-info strong { font-size: 12px; }
.automod-info small { font-size: 10px; color: #8b9198; line-height: 1.5; }
.automod-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.automod-chips span { font-size: 8.5px; color: #9aa0a8; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); border-radius: 999px; padding: 2px 7px; }

.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { width: 38px; height: 21px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .12); transition: background .2s; position: relative; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #cfd4da; transition: transform .2s; }
.switch input:checked + span { background: #43d17d; border-color: transparent; }
.switch input:checked + span::after { transform: translateX(17px); background: #06210f; }

.ss-form-block { display: grid; gap: 6px; margin: 14px 0; font-size: 10.5px; font-weight: 700; color: #aab0b8; }
.ss-form-block input { font-size: 12px; font-weight: 400; }

.ss-rules > .ghost-button { justify-self: start; }

/* ---------- user settings ---------- */

.user-settings-modal { width: min(1120px, calc(100% - 24px)); padding: 0; overflow: hidden; border-radius: 18px; }
.user-settings-modal .modal-close-row { position: absolute; right: 10px; top: 10px; z-index: 6; margin: 0; }

.us-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: min(800px, 90vh); background: rgba(19, 21, 25, .99); }
.us-nav { display: flex; flex-direction: column; gap: 4px; padding: 20px 12px 16px; background: rgba(14, 16, 19, .95); border-right: 1px solid rgba(255, 255, 255, .07); overflow-y: auto; }
.us-user { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; }
.us-user .avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 14px; }
.us-user strong { display: block; font-size: 13px; }
.us-edit-link { background: none; padding: 0; font-size: 10px; color: #9aa0a8; text-align: left; }
.us-edit-link:hover { color: #fff; text-decoration: underline; }
.us-search { padding: 0 4px 10px; }
.us-search input { padding: 8px 11px; font-size: 11px; border-radius: 9px; }
.us-nav-item { width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: #aeb4bc; }
.us-nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.us-nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.us-nav-item.danger { color: #e9a3ad; }
.us-nav-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: 8px 6px; }
.us-main { padding: 28px 32px 34px; overflow-y: auto; min-width: 0; }
.us-head { margin-bottom: 20px; }
.us-head h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.6px; margin: 0 0 6px; }
.us-head p { margin: 0; font-size: 11.5px; color: #8b9198; line-height: 1.6; max-width: 620px; }
.us-profile-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); margin-bottom: 18px; }
.us-profile-card .avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 14px; }
.us-profile-info { flex: 1; display: grid; gap: 2px; min-width: 0; }
.us-profile-info strong { font-size: 13px; }
.us-profile-info span { font-size: 10.5px; color: #8b9198; }
.us-section-title { font-size: 9.5px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; color: #8b9198; margin: 20px 0 8px; }
.us-info-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.us-info-row > div { display: grid; gap: 3px; }
.us-info-row span { font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; color: #8b9198; }
.us-info-row strong { font-size: 12.5px; font-weight: 650; }
.us-info-row small { font-size: 10px; color: #7d838b; line-height: 1.5; max-width: 420px; }
.us-inline-form { display: grid; gap: 10px; padding: 12px; margin: 8px 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .025); }
.us-inline-form label { display: grid; gap: 5px; font-size: 10px; font-weight: 700; color: #aab0b8; }
.us-inline-actions { display: flex; justify-content: flex-end; gap: 8px; }
.us-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.us-note { font-size: 10px; color: #7d838b; line-height: 1.6; }
.us-code { padding: 12px 14px; margin: 8px 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .35); font-family: ui-monospace, Consolas, monospace; font-size: 12px; letter-spacing: 1px; color: #e6e9ed; }

.us-toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.us-toggle > span:first-child { display: grid; gap: 3px; }
.us-toggle strong { font-size: 12px; }
.us-toggle small { font-size: 10px; color: #8b9198; line-height: 1.5; max-width: 480px; }

.us-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.us-grid-2 label, .us-main > label { display: grid; gap: 6px; font-size: 10px; font-weight: 700; color: #aab0b8; }
.us-slider-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.us-slider-row > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.us-slider-row strong { font-size: 12px; }
.us-slider-row small { font-size: 10px; color: #8b9198; }
.us-slider-row input[type="range"], .us-main input[type="range"] { accent-color: #cfd4da; height: 4px; padding: 0; background: transparent; border: 0; box-shadow: none; }

.us-choice-row { display: grid; gap: 8px; padding: 4px 0 8px; }
.us-radio { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #c9ced4; }
.us-radio input { width: 15px; height: 15px; padding: 0; accent-color: #cfd4da; }

.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.theme-card { display: grid; gap: 7px; padding: 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.theme-card:hover { background: rgba(255, 255, 255, .06); }
.theme-card.active { border-color: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.theme-swatch { height: 46px; border-radius: 8px; background: linear-gradient(135deg, var(--a), var(--b)); border: 1px solid rgba(255, 255, 255, .12); }
.theme-card strong { font-size: 10.5px; text-align: left; }

.us-preview-card { margin-top: 20px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .02); position: relative; }
.us-preview-label { position: absolute; top: -7px; left: 12px; font-size: 8px; letter-spacing: 1.2px; color: #8b9198; background: #17191d; padding: 0 5px; }
.us-preview-message { display: flex; gap: 10px; align-items: flex-start; }
.us-preview-message .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 10px; }
.us-preview-message strong { font-size: calc(var(--chat-font-size, 16px) * .8); }
.us-preview-message time { font-size: 8.5px; color: #7d838b; }
.us-preview-message p { margin: 3px 0 0; font-size: var(--chat-font-size, 16px); color: #d6d9dd; line-height: 1.5; }
.us-preview-time { font-size: 12px; color: #c9ced4; }

.us-mic-test { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.us-meter { flex: 1; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.us-meter span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #43d17d, #a3e6bd); transition: width .08s linear; }
.us-camera-preview { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .09); background: #0d0f12; min-height: 210px; display: grid; place-items: center; }
.us-camera-preview video { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.us-camera-preview .secondary { position: absolute; bottom: 12px; }

/* live application of settings */

html[data-theme="midnight"] { --bg:#040405; --bg-2:#08090b; --panel:rgba(13,14,16,.78); --text:#e9eaec; --muted:#8b9099; --muted-2:#61666e; --accent:#8f959f; --accent-2:#c9cdd4; --line:rgba(255,255,255,.05); }
html[data-theme="ash"] { --bg:#18191b; --bg-2:#1e2023; --panel:rgba(36,38,42,.8); --text:#f1f2f4; --muted:#a6acb3; --muted-2:#7c828a; --accent:#d5d9de; --accent-2:#eceef1; }
html[data-theme="frost"] { --bg:#0a0e13; --bg-2:#0e131a; --panel:rgba(19,25,33,.78); --text:#e9f0f7; --muted:#93a1b0; --muted-2:#6b7885; --accent:#a8bccf; --accent-2:#d6e3ef; }

.message-text { font-size: var(--chat-font-size, 16px) !important; }
.composer input { font-size: calc(var(--chat-font-size, 16px) * .82) !important; }

body.density-compact .chat-message { padding-top: 6px; padding-bottom: 6px; }
body.density-compact .nav-item { padding-top: 8px; padding-bottom: 8px; }
body.density-compact .member-line { padding-top: 4px; padding-bottom: 4px; }
body.density-compact .friend-row { padding-top: 6px; padding-bottom: 6px; }
body.density-spacious .chat-message { padding-top: 16px; padding-bottom: 16px; }
body.density-spacious .nav-item { padding-top: 13px; padding-bottom: 13px; }

body.compact-messages .chat-message { padding-top: 3px; padding-bottom: 3px; }
body.compact-messages .message-text { line-height: 1.45; }
body.hide-avatars .chat-message > .avatar { display: none; }

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

body.high-contrast { --line: rgba(255, 255, 255, .16); --muted: #c3c8cf; }
body.high-contrast .chat-message .message-text { color: #f4f5f7; }
body.high-contrast .user-card, body.high-contrast .home-card, body.high-contrast .panel-card { border-color: rgba(255, 255, 255, .25); }

body.underline-links a, body.underline-links .profile-link { text-decoration: underline; text-underline-offset: 2px; }

body.ui-desaturated .app, body.ui-desaturated .auth-screen, body.ui-desaturated .app-modal, body.ui-desaturated .toast {
  filter: saturate(var(--ui-saturation, 1));
}

@media (max-width: 760px) {
  .us-shell { grid-template-columns: 1fr; height: 88vh; }
  .us-nav { flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .us-user, .us-search, .us-nav-sep { display: none; }
  .us-nav-item { width: auto; }
  .us-main { padding: 18px; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- brand mark ---------- */

.brand-plate {
  display: grid;
  place-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7f8fa, #b9c0c9);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .95);
}
.brand-plate img { height: 26px; width: auto; display: block; }
.brand-lockup span { font-size: 17px; }

.home-button { overflow: hidden; }
.home-button .rail-logo { width: 84%; height: 84%; object-fit: contain; display: block; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .4)); }
.orbit-core { overflow: hidden; }
.orbit-core img { width: 78%; height: 78%; object-fit: contain; display: block; }

.auth-hero-logo { margin: 0 0 18px; }
.auth-hero-logo img {
  height: 92px;
  width: auto;
  display: block;
  filter: invert(1) brightness(1.05) drop-shadow(0 14px 38px rgba(255, 255, 255, .14));
  opacity: .96;
}
.brand-plate img { height: 30px; }

/* ---------- composer picker ---------- */

.composer { position: relative; }
.composer-picker {
  position: absolute;
  right: 26px;
  bottom: 66px;
  width: 390px;
  max-width: calc(100% - 40px);
  max-height: 430px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(26, 28, 33, .99);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .7);
  z-index: 30;
}
.picker-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.picker-tab { padding: 7px 11px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #aeb4bc; background: transparent; }
.picker-tab:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.picker-tab.active { background: rgba(255, 255, 255, .12); color: #fff; }
.picker-search { display: flex; gap: 6px; margin-bottom: 8px; }
.picker-search input { flex: 1; padding: 8px 10px; font-size: 11px; border-radius: 8px; }
.picker-search .small-action { padding: 7px 9px; font-size: 10px; }
.picker-body { overflow-y: auto; min-height: 120px; }
.picker-foot { padding: 8px 2px 2px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.picker-manage { font-size: 9.5px; }

.emoji-group h5 { margin: 8px 2px 5px; font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; color: #8b9198; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.emoji-item { font-size: 20px; line-height: 1; padding: 5px 0; border-radius: 7px; background: transparent; }
.emoji-item:hover { background: rgba(255, 255, 255, .1); }

.gif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gif-item { display: grid; gap: 3px; padding: 4px; border-radius: 9px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); }
.gif-item:hover { background: rgba(255, 255, 255, .08); }
.gif-item img { width: 100%; height: 92px; object-fit: cover; border-radius: 6px; }
.gif-item span { font-size: 8.5px; color: #9aa0a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

.message-gif { max-width: 260px; max-height: 220px; border-radius: 10px; display: block; margin-top: 6px; border: 1px solid rgba(255, 255, 255, .08); }

/* ---------- gifts ---------- */

.gift-button { font-size: 15px; }

.gift-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  color: #eef0f3;
  text-align: left;
}
.gift-card:hover { background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)); }
.gift-emoji { font-size: 24px; line-height: 1; }
.gift-card-text { display: grid; gap: 1px; }
.gift-card-text strong { font-size: 12px; }
.gift-card-text small { font-size: 9.5px; color: #9aa0a8; }

.gift-opened {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  max-width: 360px;
}
.gift-opened-body { display: grid; gap: 4px; min-width: 0; }
.gift-opened-body strong { font-size: 12px; }
.gift-opened-body p { margin: 0; font-size: 11.5px; color: #d6d9dd; line-height: 1.5; }
.gift-opened-body img { max-width: 260px; max-height: 220px; border-radius: 9px; display: block; margin-top: 4px; }

@media (max-width: 650px) {
  .composer-picker { right: 10px; bottom: 60px; width: calc(100% - 20px); max-height: 60vh; }
}

/* ---------- server banner ---------- */

.server-banner {
  position: relative;
  height: 128px;
  flex: none;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.server-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 11, .05) 30%, rgba(10, 11, 14, .82));
  pointer-events: none;
}
.server-banner-content {
  position: absolute;
  left: 14px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}
.server-banner-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f0f1f4, #8f959d);
  color: #141517;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .7);
  flex: none;
}
.server-banner-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-banner-text { min-width: 0; flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.server-banner-text strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -.4px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.server-banner-menu {
  background: rgba(20, 22, 26, .6) !important;
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
  flex: none;
}

/* ---------- channel categories ---------- */

.category-label {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px 18px 5px;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #8b9198;
  text-transform: uppercase;
  text-align: left;
}
.category-label:hover { color: #d7dbe0; }
.category-arrow { font-size: 9px; transition: transform .18s ease; display: inline-block; }
.channel-category.collapsed .category-arrow { transform: rotate(-90deg); }
.channel-category.collapsed .category-channels { display: none; }

/* ---------- grouped messages ---------- */

.chat-message.grouped { padding-top: 2px; padding-bottom: 2px; }
.chat-message.grouped .avatar { display: none; }
.chat-message.grouped .message-head { display: none; }
.chat-message.grouped .message-text { margin-top: 0; }
.chat-message.grouped { padding-left: 60px; }

/* ---------- reply UI ---------- */

.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 28px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .04);
  font-size: 10.5px;
  color: #b9bec4;
}
.reply-bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar-text strong { color: #e6e9ed; }
.reply-bar-text span { color: #8b9198; }
.reply-bar-cancel { width: 22px; height: 22px; border-radius: 6px; color: #8b9198; font-size: 10px; flex: none; }
.reply-bar-cancel:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.chat-message .reply-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 4px 9px;
  border-left: 2px solid rgba(255, 255, 255, .28);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, .035);
  color: #9aa0a8;
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-banner.no-image {
  height: 96px;
  background-image:
    radial-gradient(420px 180px at 15% -40%, rgba(255, 255, 255, .1), transparent 65%),
    linear-gradient(135deg, rgba(255, 255, 255, .05) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .05) 50%, rgba(255, 255, 255, .05) 75%, transparent 75%);
  background-size: auto, 36px 36px;
  background-color: #1c1e22;
}
.server-banner.no-image::before {
  content: attr(data-initial);
  position: absolute;
  right: 18px;
  top: -14px;
  font-family: var(--font-display);
  font-size: 92px;
  font-weight: 800;
  color: rgba(255, 255, 255, .05);
  letter-spacing: -4px;
}

/* ---------- friends layout with active rail ---------- */

.friends-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: calc(100% - 62px); }
.friends-body { min-width: 0; }
.friends-rail { border-left: 1px solid var(--line); padding: 18px 14px; background: rgba(13, 15, 18, .5); }
.friends-rail .active-head { padding: 0 6px 10px; }

@media (max-width: 1100px) {
  .friends-layout { grid-template-columns: minmax(0, 1fr); }
  .friends-rail { display: none; }
}

/* ---------- DM profile panel ---------- */

.main-panel.dm-profile-open { grid-template-columns: minmax(0, 1fr) 300px; }

.dm-profile {
  grid-column: 2;
  grid-row: 2 / 4;
  overflow-y: auto;
  background: rgba(15, 17, 20, .85);
  border-left: 1px solid var(--line);
  min-width: 0;
}
.dm-profile-loading { padding: 24px 16px; font-size: 11px; color: #8b9198; }
.dm-profile-banner { height: 92px; background-size: cover; background-position: center; background-color: #17191d; }
.dm-profile-body { padding: 0 16px 18px; }
.dm-profile-avatar-wrap { width: 66px; height: 66px; margin-top: -33px; border-radius: 20px; padding: 3px; background: linear-gradient(140deg, #f0f2f4, #9aa1a9); position: relative; }
.dm-profile-avatar-wrap .avatar { width: 100%; height: 100%; border-radius: 17px; font-size: 18px; }
.dm-profile-avatar-wrap .presence-dot { width: 13px; height: 13px; right: 1px; bottom: 1px; border-width: 2.5px; }
.dm-profile-name { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-top: 10px; letter-spacing: -.5px; }
.dm-profile-handle { font-size: 10.5px; color: #8b9198; margin-top: 1px; }
.dm-profile-mutuals { margin-top: 14px; display: grid; gap: 6px; }
.dm-profile-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .06); display: grid; gap: 5px; }
.dm-profile-section p { margin: 0; font-size: 11px; line-height: 1.6; color: #c6cbd2; }
.dm-profile .profile-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.dm-profile .profile-chip { font-size: 8.5px; padding: 4px 7px; }
.dm-profile #dm-view-profile { margin-top: 16px; font-size: 11px; }

/* ---------- sidebar DM search ---------- */

.dm-search-wrap { padding: 0 11px 8px; }
.dm-search-wrap input { padding: 8px 10px; font-size: 10.5px; border-radius: 8px; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .06); }

/* ---------- voice icons ---------- */

.voice-icon { font-size: 13px; }
.voice-icon.muted { color: #ff9aa5; background: rgba(224, 115, 131, .14); }
.voice-icon.muted::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 1.5px; background: #ff9aa5; transform: rotate(-40deg); border-radius: 2px; }

/* ---------- add friend extras ---------- */

.add-friend-other { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.add-friend-other h3 { font-family: var(--font-display); font-size: 14px; margin: 0 0 4px; }
.add-friend-other p { margin: 0 0 12px; font-size: 11px; color: #8b9198; line-height: 1.6; max-width: 520px; }

@media (max-width: 950px) {
  .main-panel.dm-profile-open { grid-template-columns: minmax(0, 1fr) 0; }
  .dm-profile { display: none; }
}

/* user panel compaction */

.user-panel { padding: 9px 8px; gap: 5px; }
.user-panel .avatar.small { width: 32px; height: 32px; border-radius: 10px; font-size: 11px; }
.user-panel .user-meta strong { font-size: 11px; }
.user-panel .user-meta span { font-size: 9px; }
.user-panel .status-dot { width: 8px; height: 8px; flex: none; margin-right: 2px; }
.user-panel .icon-button { width: 23px; height: 23px; font-size: 11px; flex: none; border-radius: 7px; }
.user-panel .voice-icon { font-size: 11px; }
.user-panel .logout-button { font-size: 12px; }

/* ---------- display name styles ---------- */

.display-name { font-weight: 800; letter-spacing: -.3px; }
.dn-solid { color: var(--dn-color, #eef0f3); }
.dn-gradient { background: linear-gradient(90deg, var(--dn-color, #c9cdd4), #ffffff 55%, var(--dn-color, #c9cdd4)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dn-neon { color: var(--dn-color, #c9cdd4); text-shadow: 0 0 6px var(--dn-color, #c9cdd4), 0 0 18px var(--dn-color, #c9cdd4); }
.dn-toon { color: var(--dn-color, #c9cdd4); -webkit-text-stroke: 1.2px rgba(0, 0, 0, .75); paint-order: stroke fill; }
.dn-pop { color: var(--dn-color, #c9cdd4); text-shadow: 2px 2px 0 rgba(0, 0, 0, .7); }
.dn-gummy { color: #fff; text-shadow: 0 2px 0 var(--dn-color, #c9cdd4), 0 3px 6px rgba(0, 0, 0, .4); }
.dn-prism { background: linear-gradient(90deg, #ff6ec7, #ffd166, #4ade80, #38bdf8, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }

.dn-font-display { font-family: var(--font-display); }
.dn-font-serif { font-family: Georgia, "Times New Roman", serif; }
.dn-font-mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: -1px; }
.dn-font-wide { letter-spacing: 1.5px; font-stretch: expanded; }

/* nameplates */

.nameplate-graphite, .nameplate-ash, .nameplate-ember, .nameplate-frost {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
}
.nameplate-graphite { background: linear-gradient(135deg, rgba(60, 64, 70, .9), rgba(28, 30, 34, .9)); }
.nameplate-ash { background: linear-gradient(135deg, rgba(150, 155, 162, .95), rgba(70, 74, 80, .95)); color: #14161a; }
.nameplate-ash .display-name { color: #14161a; }
.nameplate-ember { background: linear-gradient(135deg, rgba(120, 40, 32, .9), rgba(48, 22, 20, .95)); border-color: rgba(255, 120, 90, .25); }
.nameplate-frost { background: linear-gradient(135deg, rgba(30, 64, 84, .9), rgba(16, 30, 42, .95)); border-color: rgba(120, 210, 255, .2); }

/* avatar decorations */

.deco-ring::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid rgba(255, 255, 255, .65); pointer-events: none; }
.deco-glow::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; box-shadow: 0 0 22px rgba(255, 255, 255, .55); pointer-events: none; }
.deco-star::after { content: "?"; position: absolute; right: -5px; top: -7px; font-size: 13px; color: #eef0f3; text-shadow: 0 0 8px rgba(255, 255, 255, .7); }
.deco-laurel::after { content: "?"; position: absolute; right: -6px; bottom: -6px; font-size: 15px; color: #a8e6b0; transform: rotate(20deg); }
.profile-avatar-wrap, .popout-avatar-wrap, .dm-profile-avatar-wrap { position: relative; }

/* note */

.popout-note {
  width: 100%;
  min-height: 54px;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .07);
  resize: vertical;
}
.popout-note-section h4 span { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- profile customizer ---------- */

.profile-customizer-modal { width: min(1040px, calc(100% - 20px)); padding: 0; overflow: hidden; border-radius: 18px; }
.profile-customizer-modal .modal-close-row { position: absolute; right: 12px; top: 10px; z-index: 5; margin: 0; }
.pc-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  height: min(780px, 90vh);
  background: rgba(20, 22, 26, .99);
}
.pc-side { overflow-y: auto; padding: 18px 16px 22px; border-right: 1px solid rgba(255, 255, 255, .07); background: rgba(15, 17, 20, .92); }
.pc-side-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.pc-side-chevron { color: #8b9198; }
.pc-block { display: grid; gap: 7px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.pc-block input, .pc-block textarea { font-size: 11.5px; }
.pc-block textarea { min-height: 70px; }
.pc-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-chip { padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .03); font-size: 10px; color: #b9bec4; }
.pc-chip:hover { background: rgba(255, 255, 255, .08); }
.pc-chip.active { border-color: rgba(255, 255, 255, .4); color: #fff; background: rgba(255, 255, 255, .1); }
.pc-font-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pc-font { padding: 9px 4px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); font-size: 10px; color: #cfd4da; }
.pc-font.active { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .09); }
.pc-effect-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.pc-effect { padding: 9px 4px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); font-size: 10px; font-weight: 800; }
.pc-effect.active { border-color: rgba(255, 255, 255, .42); background: rgba(255, 255, 255, .08); }
.pc-upload-row { display: flex; align-items: center; gap: 10px; }
.pc-upload-tile { position: relative; width: 64px; height: 64px; border-radius: 18px; border: 1px dashed rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .04); display: grid; place-items: center; overflow: hidden; cursor: pointer; font-size: 9px; color: #9aa0a8; flex: none; }
.pc-upload-tile img { width: 100%; height: 100%; object-fit: cover; }
.pc-upload-tile:hover { border-color: rgba(255, 255, 255, .4); }
.pc-upload-plus { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #14161a; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.pc-upload-banner { width: 100%; height: 68px; border-radius: 10px; }
.pc-banner-row { display: grid; gap: 8px; }
.pc-main { padding: 26px 26px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.pc-preview-label { font-size: 9px; letter-spacing: 1.4px; color: #8b9198; font-weight: 800; }
.pc-preview-card { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); background: #14161a; }
.pc-preview-banner { height: 108px; background-size: cover; background-position: center; position: relative; }
.pc-preview-avatar { position: absolute; left: 18px; bottom: -34px; width: 74px; height: 74px; border-radius: 24px; padding: 3px; background: linear-gradient(140deg, #f0f2f4, #9aa1a9); }
.pc-preview-avatar .avatar, .pc-preview-avatar img { width: 100%; height: 100%; border-radius: 21px; object-fit: cover; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #14161a; }
.pc-preview-avatar .presence-dot { right: 3px; bottom: 3px; }
.pc-preview-body { padding: 44px 18px 18px; display: grid; gap: 5px; }
.pc-preview-name { font-size: 20px; font-family: var(--font-display); }
.pc-preview-handle { font-size: 10.5px; color: #8b9198; }
.pc-preview-bio { margin-top: 8px; font-size: 11px; line-height: 1.6; color: #c6cbd2; }
.pc-preview-meta { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 9.5px; color: #7d838b; }
.pc-hint { font-size: 10px; color: #7d838b; line-height: 1.6; margin: 0; }
.pc-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(14, 16, 19, .98); }
.pc-footer-actions { display: flex; gap: 8px; }

@media (max-width: 1050px) {
  .pc-shell { grid-template-columns: 1fr; }
  .pc-side { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
  .pc-main { display: none; }
}

.pc-preview-avatar { display: grid; place-items: center; color: #14161a; font-weight: 800; font-size: 20px; font-family: var(--font-display); }
.pc-effect {
  -webkit-text-fill-color: #cfd4da !important;
  color: #cfd4da !important;
  background: rgba(255, 255, 255, .03) !important;
  text-shadow: none !important;
}
.pc-effect.active { background: rgba(255, 255, 255, .1) !important; }

.friend-identity { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: transparent; text-align: left; padding: 0; border-radius: 8px; }
.friend-identity:hover .friend-name { color: #fff; }

/* ---------- colourful themes ---------- */

html[data-theme="nebula"] { --bg:#0b0616; --bg-2:#120a22; --panel:rgba(27,17,46,.8); --panel-2:rgba(33,21,56,.72); --text:#f3efff; --muted:#a99cc6; --muted-2:#7a6c99; --accent:#a855f7; --accent-2:#22d3ee; --line:rgba(168,85,247,.14); }
html[data-theme="ember"] { --bg:#140908; --bg-2:#1d0d0b; --panel:rgba(38,20,18,.8); --panel-2:rgba(46,24,21,.72); --text:#fff1ea; --muted:#c7a396; --muted-2:#946e60; --accent:#f97316; --accent-2:#f43f5e; --line:rgba(249,115,22,.14); }
html[data-theme="forest"] { --bg:#06120c; --bg-2:#0a1a12; --panel:rgba(16,36,26,.8); --panel-2:rgba(20,44,32,.72); --text:#eafff2; --muted:#9dc4ae; --muted-2:#6c8f7b; --accent:#22c55e; --accent-2:#84cc16; --line:rgba(34,197,94,.14); }
html[data-theme="ocean"] { --bg:#06121a; --bg-2:#081a25; --panel:rgba(14,34,46,.8); --panel-2:rgba(18,42,56,.72); --text:#e8f7ff; --muted:#93b8c9; --muted-2:#668a9b; --accent:#0ea5e9; --accent-2:#22d3ee; --line:rgba(14,165,233,.16); }
html[data-theme="rose"] { --bg:#160810; --bg-2:#200b17; --panel:rgba(41,17,31,.8); --panel-2:rgba(50,21,38,.72); --text:#ffeaf4; --muted:#c99ab4; --muted-2:#966b83; --accent:#f43f5e; --accent-2:#e879f9; --line:rgba(244,63,94,.16); }
html[data-theme="violet"] { --bg:#0d0818; --bg-2:#140d24; --panel:rgba(28,18,48,.8); --panel-2:rgba(34,22,58,.72); --text:#f1ecff; --muted:#ab9fc9; --muted-2:#7c6f9b; --accent:#8b5cf6; --accent-2:#d946ef; --line:rgba(139,92,246,.16); }

/* accent-reactive details */

::selection { background: color-mix(in srgb, var(--accent), transparent 55%); }
.nav-item.selected::before { background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px color-mix(in srgb, var(--accent), transparent 25%); }
.nav-item.selected { background: linear-gradient(90deg, color-mix(in srgb, var(--accent), transparent 80%), transparent 72%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 82%); }
.nav-item.selected .nav-glyph { color: var(--accent-2); }
.chat-message::before { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.main-panel::before { background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); }
.channel-entry.selected { background: linear-gradient(90deg, color-mix(in srgb, var(--accent), transparent 86%), color-mix(in srgb, var(--accent-2), transparent 90%)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 80%); }
.channel-entry.selected .hash { color: var(--accent-2); }
.friend-identity:hover .friend-name { color: var(--accent-2); }
.link-button, .home-card-link:hover { color: var(--accent-2); }
.primary:hover { box-shadow: 0 14px 34px -10px rgba(0,0,0,.95), 0 0 30px -8px color-mix(in srgb, var(--accent), transparent 25%), inset 0 1px 0 rgba(255,255,255,.95); }
input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--accent), white 25%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 82%), 0 0 26px -8px color-mix(in srgb, var(--accent), transparent 35%); }
.profile-avatar-wrap { background: linear-gradient(140deg, var(--accent-2, #f0f2f4), var(--accent, #6c737c)); }
.rail-add:hover { box-shadow: 0 0 22px -6px color-mix(in srgb, var(--accent), transparent 35%); }

/* accent picker */

.accent-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 10px; }
.accent-row input[type="color"] { width: 44px; height: 34px; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); cursor: pointer; }
.accent-swatches { flex: 1; }

/* theme-reactive surfaces */

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 760px at 10% -12%, color-mix(in srgb, var(--accent), transparent 86%), transparent 62%),
    radial-gradient(1000px 720px at 105% -5%, color-mix(in srgb, var(--accent-2), transparent 90%), transparent 55%),
    radial-gradient(900px 900px at 55% 118%, color-mix(in srgb, var(--accent), transparent 93%), transparent 62%);
}
.app { background: color-mix(in srgb, var(--bg), transparent 42%); }
.servers-rail { background: linear-gradient(180deg, color-mix(in srgb, var(--bg), white 4%), color-mix(in srgb, var(--bg), black 10%)); }
.sidebar { background: linear-gradient(180deg, color-mix(in srgb, var(--bg), white 7%), color-mix(in srgb, var(--bg), black 6%)); }
.main-panel {
  background:
    radial-gradient(ellipse at 92% 0%, color-mix(in srgb, var(--accent), transparent 92%), transparent 38%),
    radial-gradient(ellipse at 0% 100%, color-mix(in srgb, var(--accent-2), transparent 95%), transparent 42%),
    color-mix(in srgb, var(--bg), transparent 52%);
}
.topbar { background: color-mix(in srgb, var(--bg), transparent 55%); }
.user-panel { background: linear-gradient(90deg, color-mix(in srgb, var(--bg), black 4%), color-mix(in srgb, var(--bg), white 3%)); }

.server-banner:not(.hidden) + .server-context { display: none !important; }

.channel-tools { display: flex; align-items: center; gap: 2px; }
.channel-tools .mini-add { width: 20px; height: 20px; display: grid; place-items: center; font-size: 14px; padding: 0; border-radius: 6px; }
.invite-button { padding: 8px 10px; font-size: 11px; }

/* self profile popout */

.self-menu {
  position: fixed;
  width: 282px;
  z-index: 95;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(28, 30, 35, .99);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .75);
  animation: modal-in .18s cubic-bezier(.2, .8, .25, 1) both;
}
.self-menu-banner { height: 84px; background-size: cover; background-position: center; }
.self-menu-body { padding: 0 12px 10px; }
.self-menu-avatar { width: 58px; height: 58px; margin-top: -29px; border-radius: 18px; padding: 3px; background: linear-gradient(140deg, var(--accent-2, #f0f2f4), var(--accent, #9aa1a9)); position: relative; }
.self-menu-avatar .avatar { width: 100%; height: 100%; border-radius: 15px; font-size: 15px; }
.self-menu-avatar .presence-dot { width: 13px; height: 13px; right: 1px; bottom: 1px; border-width: 2.5px; }
.self-menu-name { margin-top: 8px; font-size: 17px; width: fit-content; }
.self-menu-name.nameplate-ash, .self-menu-name.nameplate-ember, .self-menu-name.nameplate-frost, .self-menu-name.nameplate-graphite { padding: 3px 8px; }
.self-menu-handle { font-size: 10px; color: #8b9198; margin-top: 2px; }
.self-menu-actions { display: grid; gap: 1px; margin-top: 10px; }
.self-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border-radius: 8px; font-size: 11.5px; color: #cfd4da; text-align: left; background: transparent; }
.self-menu-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.self-menu-item span { width: 16px; text-align: center; color: #9aa0a8; font-size: 12px; }
.self-menu-item em { margin-left: auto; font-style: normal; font-size: 9.5px; color: #8b9198; }
.self-menu-item b { margin-left: auto; font-weight: 400; color: #6f757d; }
.self-menu-item em + b { margin-left: 6px; }
.self-menu-item.danger { color: #e9a3ad; }
.self-menu-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: 5px 2px; }
.user-meta { cursor: pointer; }

/* icon system */

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-glyph { display: grid; place-items: center; }
.nav-glyph .icon { width: 16px; height: 16px; }
.composer-plus .icon { width: 15px; height: 15px; }
.send-button .icon { width: 16px; height: 16px; }
.user-panel .icon-button .icon { width: 14px; height: 14px; }
.voice-icon .icon { width: 13px; height: 13px; }
.primary, .secondary { min-height: 34px; }
button .icon { pointer-events: none; }

/* date dividers + grouped hover time */

.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 8px 12px;
  color: #7d838b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.date-divider::before, .date-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, .06);
}
.chat-message { position: relative; }
.grouped-time {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8.5px;
  color: #6f757d;
  opacity: 0;
  transition: opacity .15s ease;
}
.chat-message.grouped:hover .grouped-time { opacity: 1; }

/* emoji picker polish */

.emoji-grid { grid-template-columns: repeat(10, 1fr); }
.emoji-item { font-size: 21px; padding: 6px 0; transition: transform .12s ease, background .12s ease; }
.emoji-item:hover { transform: scale(1.18); background: rgba(255, 255, 255, .12); }
.emoji-group h5 {
  position: sticky;
  top: -10px;
  z-index: 1;
  margin: 10px 2px 6px;
  padding: 4px 2px;
  background: rgba(26, 28, 33, .98);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.picker-tabs { padding-bottom: 2px; border-bottom: 1px solid rgba(255, 255, 255, .06); margin-bottom: 8px; }
.picker-tab { border-radius: 8px 8px 0 0; }

/* profile templates */

.pc-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pc-template { display: grid; gap: 5px; padding: 6px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.pc-template span { height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--t1), var(--t2)); border: 1px solid rgba(255, 255, 255, .12); }
.pc-template strong { font-size: 8.5px; font-weight: 700; color: #b9bec4; text-align: left; }
.pc-template:hover { background: rgba(255, 255, 255, .07); }
.pc-template.active { border-color: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }

/* profile themes */

.ptheme-nebula { background: radial-gradient(500px 240px at 15% 0%, rgba(168,85,247,.22), transparent 60%), linear-gradient(160deg, #160c26, #0a0612) !important; }
.ptheme-ember { background: radial-gradient(500px 240px at 15% 0%, rgba(249,115,22,.22), transparent 60%), linear-gradient(160deg, #26100d, #120706) !important; }
.ptheme-forest { background: radial-gradient(500px 240px at 15% 0%, rgba(34,197,94,.2), transparent 60%), linear-gradient(160deg, #0b2216, #06120c) !important; }
.ptheme-ocean { background: radial-gradient(500px 240px at 15% 0%, rgba(14,165,233,.22), transparent 60%), linear-gradient(160deg, #0a2230, #06121a) !important; }
.ptheme-rose { background: radial-gradient(500px 240px at 15% 0%, rgba(244,63,94,.2), transparent 60%), linear-gradient(160deg, #260d1a, #160810) !important; }
.ptheme-violet { background: radial-gradient(500px 240px at 15% 0%, rgba(139,92,246,.24), transparent 60%), linear-gradient(160deg, #1a1030, #0d0818) !important; }

/* profile effects */

.peffect-glow { box-shadow: 0 0 46px -10px color-mix(in srgb, var(--accent), transparent 20%), inset 0 1px 0 rgba(255, 255, 255, .06) !important; }
.peffect-border { border-color: transparent !important; background-image: linear-gradient(160deg, rgba(18,22,30,.96), rgba(12,15,21,.98)), linear-gradient(135deg, var(--accent), var(--accent-2)) !important; background-origin: border-box !important; background-clip: padding-box, border-box !important; }
.peffect-sparkle { position: relative; }
.peffect-sparkle::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .1;
  mask-image: linear-gradient(200deg, #000, transparent 65%);
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 65%);
}

/* topbar subtitle */

.topbar-text { display: grid; gap: 1px; min-width: 0; }
.topbar-sub { font-size: 9.5px; color: #8b9198; font-weight: 500; max-width: 460px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* jump to present */

.jump-bottom {
  position: absolute;
  right: 28px;
  bottom: 104px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(30, 33, 38, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #dfe2e6;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6);
  z-index: 6;
  font-size: 15px;
}
.jump-bottom:hover { background: rgba(48, 52, 58, .98); transform: translateY(-1px); }

/* pinned messages */

.pinned-row { display: grid; gap: 3px; padding: 10px 12px; margin-top: 8px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .03); }
.pinned-row-head { display: flex; align-items: baseline; gap: 8px; }
.pinned-row-head strong { font-size: 11.5px; }
.pinned-row-head time { font-size: 9px; color: #7d838b; }
.pinned-row-text { font-size: 11.5px; color: #c9ced4; white-space: pre-wrap; overflow-wrap: anywhere; }

/* quick switcher */

.quick-switch-results { display: grid; gap: 3px; margin-top: 12px; max-height: 46vh; overflow-y: auto; }
.quick-switch-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); text-align: left; }
.quick-switch-item:hover { background: rgba(255, 255, 255, .08); }
.quick-switch-kind { font-size: 8px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #9aa0a8; background: rgba(255, 255, 255, .06); border-radius: 5px; padding: 3px 6px; flex: none; }
.quick-switch-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.quick-switch-text strong { font-size: 11.5px; color: #e6e9ed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-switch-text small { font-size: 9.5px; color: #7d838b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-switch-item > span:last-child { color: #6f757d; }

/* typing + reply flash */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 30px 4px;
  height: 15px;
  font-size: 10px;
  color: #8b9198;
}
.typing-indicator span { line-height: 1; }
.typing-indicator i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #9aa0a8;
  animation: typing-bounce 1.1s infinite ease-in-out;
}
.typing-indicator i:nth-child(2) { animation-delay: .15s; }
.typing-indicator i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }

.chat-message.flash {
  background: color-mix(in srgb, var(--accent), transparent 84%);
  transition: background .25s ease;
}
.pc-preview-name { width: fit-content; }
.profile-identity h1 { width: fit-content; max-width: 100%; }
.topbar-title { max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* member role groups */

.members-group { margin-bottom: 4px; }
.members-group-label { gap: 6px; }
.members-group-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; box-shadow: 0 0 8px rgba(255, 255, 255, .25); }
.role-chip.has-icon { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; }
.role-chip img { width: 10px; height: 10px; border-radius: 3px; object-fit: cover; }
.member-line .role-chip { color: color-mix(in srgb, var(--role-color, #c9cdd4), white 55%); border-color: color-mix(in srgb, var(--role-color, #c9cdd4), transparent 65%); background: color-mix(in srgb, var(--role-color, #c9cdd4), transparent 88%); }
.member-line:hover .role-chip { background: color-mix(in srgb, var(--role-color, #c9cdd4), transparent 80%); }

/* responsive profile fixes */

@media (max-width: 900px) {
  .content { padding: 20px 18px 22px; }
  .profile-cover { height: 160px; }
  .profile-head { gap: 10px; margin-top: -40px; min-height: 122px; }
  .profile-avatar-wrap { width: 86px; height: 86px; border-radius: 24px; padding: 3px; }
  .profile-avatar-wrap .avatar { border-radius: 20px; font-size: 22px; }
  .profile-identity h1 { font-size: 19px; }
  .profile-identity { padding-bottom: 6px; }
  .profile-actions button { padding: 8px 10px; font-size: 10px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-section { padding: 13px; }
  .profile-edit-grid { grid-template-columns: 1fr; }
  .pc-remove-image { margin-left: 6px; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 58px minmax(0, 1fr); }
  .sidebar { display: none; }
  .main-panel { grid-column: 2; }
}

/* community chat bubbles */

.chat-message.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 5px 12px;
  border-radius: 12px;
  background: transparent;
}
.chat-message.bubble-row:hover { background: rgba(255, 255, 255, .02); }
.chat-message.bubble-row::before { display: none; }
.bubble-row .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 11px; }
.bubble-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: min(600px, 74%); min-width: 0; }
.bubble-row.own { justify-content: flex-end; }
.bubble-row.own .bubble-stack { align-items: flex-end; }
.bubble-meta { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 9.5px; color: #8b9198; }
.bubble-name { background: none; border: 0; padding: 0; color: var(--accent-2, #cfd4da); font-size: 11px; font-weight: 750; }
.bubble-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.bubble-row.own .bubble-name { color: #eef0f3; }
.bubble-role { font-size: 7px; letter-spacing: .6px; font-weight: 800; text-transform: uppercase; color: #b9bec4; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); border-radius: 4px; padding: 1.5px 4px; }
.bubble { max-width: 100%; padding: 9px 12px; border-radius: 13px; border-bottom-left-radius: 5px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07); color: #e9ecf1; font-size: var(--chat-font-size, 14px); line-height: 1.55; overflow-wrap: anywhere; }
.bubble-row.own .bubble { background: color-mix(in srgb, var(--accent, #8b7bff), transparent 86%); border-color: color-mix(in srgb, var(--accent, #8b7bff), transparent 76%); border-bottom-left-radius: 13px; border-bottom-right-radius: 5px; }
.chat-message.grouped.bubble-row { padding-top: 1px; padding-bottom: 1px; }
.chat-message.grouped.bubble-row .bubble { border-radius: 13px; }
.bubble .message-attachments { margin-top: 6px; }
.bubble .attachment-image img { max-width: 280px; max-height: 220px; border-radius: 9px; }
.bubble .message-gif { max-width: 240px; max-height: 200px; border-radius: 9px; }
.bubble .message-sticker { max-width: 120px; max-height: 120px; }
.bubble-row .reply-preview { margin: 0 0 2px; max-width: 100%; }
.bubble-row .message-reactions { margin-top: 2px; }
.bubble-row .message-actions { top: -12px; right: 14px; }
.bubble-row.own .message-actions { right: auto; left: 14px; }
.bubble-row.own .bubble-meta { justify-content: flex-end; }
.bubble-row .read-receipt { font-size: 8.5px; }
.bubble-row .grouped-time { display: none; }

/* community side panel */

.main-panel.members-open { grid-template-columns: minmax(0, 1fr) 292px; }
.members-panel { padding: 16px 12px 18px; background: rgba(19, 21, 26, .72); }
.cp-head { padding: 0 6px 12px; }
.cp-head .eyebrow { color: #8b9198; }
.cp-head h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: -.5px; margin: 3px 0 0; }
.cp-search { padding: 0 2px 12px; }
.cp-search input { padding: 9px 11px; font-size: 11px; border-radius: 9px; background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .07); }
.cp-channel { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 11px; border-radius: 9px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #eef0f3; font-size: 11.5px; font-weight: 650; text-align: left; }
.cp-channel:hover { background: rgba(255, 255, 255, .09); }
.cp-hash { color: #8b9198; font-weight: 800; }
.cp-live { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(61, 220, 151, .8); flex: none; }
.cp-label { display: flex; justify-content: space-between; padding: 18px 6px 8px; font-size: 8.5px; font-weight: 800; letter-spacing: 1.1px; color: #8b9198; }
.cp-member { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border-radius: 8px; background: transparent; text-align: left; }
.cp-member:hover { background: rgba(255, 255, 255, .06); }
.cp-member-avatar { position: relative; display: grid; flex: none; }
.cp-member .avatar { width: 27px; height: 27px; border-radius: 50%; font-size: 9px; }
.cp-member-avatar .presence-dot { width: 9px; height: 9px; right: -1px; bottom: -1px; border-width: 2px; }
.cp-member-name { flex: 1; min-width: 0; font-size: 11.5px; color: #e2e5ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-member-role { font-size: 6.8px; font-weight: 800; letter-spacing: .55px; color: #b9bec4; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); border-radius: 4px; padding: 1.5px 4px; flex: none; }
.cp-member.is-offline { opacity: .55; }
.cp-members { display: grid; gap: 1px; }

/* topbar pills */

.topbar-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); font-size: 9.5px; color: #c9ced4; font-weight: 650; }
.topbar-pill:hover { background: rgba(255, 255, 255, .08); }
#channel-online { pointer-events: none; }

/* composer input must shrink inside flex */
.composer input { width: auto; flex: 1; min-width: 0; }

/* keep community panel visible on mid widths */
@media (max-width: 950px) and (min-width: 761px) {
  .members-panel { display: block; padding: 12px 8px; }
  .main-panel.members-open { grid-template-columns: minmax(0, 1fr) 220px; }
  .cp-head h3 { font-size: 16px; }
  .cp-search input { padding: 7px 9px; }
  .cp-member-role { display: none; }
  .cp-channel { padding: 7px 9px; font-size: 10.5px; }
}

.bubble-meta time { white-space: nowrap; }

@media (max-width: 950px) and (min-width: 761px) {
  .cp-member-role { display: inline-flex; font-size: 6.2px; padding: 1px 3px; letter-spacing: .3px; }
  .cp-member { gap: 6px; padding: 5px 4px; }
  .cp-member .avatar { width: 24px; height: 24px; }
  .bubble-stack { max-width: 82%; }
  .gift-button { display: none; }
  .composer { padding: 10px 14px 12px; }
  .composer form { gap: 6px; padding: 6px 6px 6px 9px; }
  .composer-plus { width: 26px; height: 26px; }
  .send-button { width: 34px; height: 32px; }
}

/* voice presence under channels */

.voice-members { display: grid; gap: 3px; padding: 0 0 6px 40px; }
.voice-member { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: #9aa0a8; }
.voice-member i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(61, 220, 151, .7); flex: none; }
.voice-member:hover { color: #e6e9ed; }

/* ---------- responsive navigation and connection feedback ---------- */
.mobile-menu-button { display: none; flex: none; }
.mobile-sidebar-backdrop { display: none; }
.connection-dot.is-connected { background: #42d392; box-shadow: 0 0 12px rgba(66, 211, 146, .72); }
.connection-dot.is-connecting { background: #e6b65c; box-shadow: 0 0 10px rgba(230, 182, 92, .55); animation: dot-pulse 1s ease-in-out infinite; }
.connection-dot.is-disconnected { background: #e56c78; box-shadow: 0 0 10px rgba(229, 108, 120, .5); animation: none; }

@media (max-width: 760px) {
  .app { grid-template-columns: 58px minmax(0, 1fr); overflow: hidden; }
  .mobile-menu-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
  .topbar { min-height: 64px; height: 64px; padding: 0 12px; gap: 8px; }
  .topbar-title-wrap { min-width: 0; gap: 7px; }
  .topbar-text { min-width: 0; }
  .topbar-text > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 4px; flex: none; }
  .topbar-actions .icon-button { width: 32px; height: 32px; }
  .sidebar {
    display: flex !important;
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 58px;
    width: min(320px, calc(100vw - 70px));
    height: 100%;
    min-height: 0;
    grid-column: auto;
    transform: translateX(calc(-100% - 12px));
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.2,.75,.2,1), visibility .22s;
    box-shadow: 18px 0 48px rgba(0,0,0,.42);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .mobile-sidebar-backdrop {
    display: block;
    position: absolute;
    z-index: 39;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: rgba(3, 5, 8, .62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
    backdrop-filter: blur(2px);
  }
  .mobile-sidebar-backdrop.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .main-panel { grid-column: 2; min-width: 0; }
  body.mobile-nav-open { overflow: hidden; }
}

@media (max-width: 440px) {
  .topbar-actions { gap: 2px; }
  #connection-status { display: none; }
  .topbar-actions .icon-button#quick-switch-button { display: none; }
  .topbar { padding-inline: 8px; }
  .content { padding-inline: 12px; }
  .composer { padding-inline: 8px; }
}

@media (max-width: 1050px) {
  .pc-shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.25fr) minmax(150px, .8fr) auto; height: min(88vh, 900px); overflow: hidden; }
  .pc-side { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); max-height: none; min-height: 0; overflow-y: auto; }
  .pc-main { display: flex; min-height: 0; max-height: none; overflow-y: auto; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
  .pc-preview-card { max-width: 520px; }
}


/* Server rules / age gate */
.server-rules-list { max-height: min(42vh, 360px); overflow: auto; margin: 18px 0; padding: 14px 18px 14px 40px; border: 1px solid var(--line, rgba(255,255,255,.09)); border-radius: 14px; background: rgba(255,255,255,.025); color: var(--text, #e7e9ee); }
.server-rules-list li { padding: 5px 0 5px 4px; line-height: 1.5; }
.server-rules-confirm, .server-age-confirm { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; color: var(--text, #e7e9ee); }
.server-rules-confirm input, .server-age-confirm input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--accent, #8172f4); }
#server-rules-accept:disabled { opacity: .45; cursor: not-allowed; }

/* Message actions and reply navigation */
.reply-preview{display:block;max-width:100%;width:max-content;border:0;background:transparent;color:var(--muted,#a1a1aa);padding:2px 0 6px;text-align:left;font:inherit;font-size:12px;cursor:pointer;}
.reply-preview:hover{color:var(--text,#fff);text-decoration:underline;}
.message-highlight{animation:message-focus-pulse 1.5s ease-out;border-radius:12px;}
@keyframes message-focus-pulse{0%,35%{background:rgba(124,105,245,.22);box-shadow:0 0 0 2px rgba(124,105,245,.55);}100%{background:transparent;box-shadow:0 0 0 0 transparent;}}
.permission-empty{min-height:260px;}

.quick-action-list{display:grid;gap:8px;margin-top:16px;}
.quick-action-row{display:flex;align-items:center;gap:14px;width:100%;padding:13px 14px;border:1px solid var(--border,rgba(255,255,255,.08));border-radius:12px;background:rgba(255,255,255,.025);color:var(--text,#f4f4f5);text-align:left;cursor:pointer;font-size:18px;transition:background .15s,border-color .15s,transform .15s;}
.quick-action-row:hover{background:rgba(255,255,255,.07);border-color:var(--accent);transform:translateY(-1px);}
.quick-action-row span{display:grid;gap:3px;}
.quick-action-row strong{font-size:14px;font-weight:650;}
.quick-action-row small{font-size:12px;color:var(--muted,#9898a3);}

.message-action-items{display:flex;align-items:center;gap:2px;}
.message-actions-toggle{display:none;}
@media (max-width:760px){
  .chat-message .message-actions{opacity:1;pointer-events:auto;transform:none;top:2px;right:8px;background:transparent;border:0;box-shadow:none;padding:0;z-index:5;}
  .bubble-row.own .message-actions{right:8px;left:auto;}
  .message-actions-toggle{display:inline-flex;align-items:center;justify-content:center;width:30px;height:28px;padding:0;border:1px solid rgba(255,255,255,.11);border-radius:9px;background:rgba(25,27,32,.96);color:#e6e7eb;font-weight:800;letter-spacing:1px;}
  .message-action-items{display:none;position:absolute;right:0;top:32px;max-width:min(88vw,330px);flex-wrap:wrap;justify-content:flex-end;padding:5px;border:1px solid rgba(255,255,255,.13);border-radius:11px;background:rgba(24,26,31,.98);box-shadow:0 12px 34px rgba(0,0,0,.45);}
  .message-actions.is-open .message-action-items{display:flex;}
  .message-actions button{min-width:30px;height:30px;font-size:12px;}
}

/* flat discord message layout */

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  background: transparent;
}
.chat-message:hover { background: rgba(255, 255, 255, .025); }
.chat-message::before { display: none; }
.chat-message .avatar { width: 36px; height: 36px; border-radius: 50%; font-size: 12px; flex: none; margin-top: 2px; }
.chat-message .message-body { flex: 1; min-width: 0; }

.chat-message.grouped { padding-top: 1px; padding-bottom: 1px; padding-left: 12px; }
.chat-message.grouped .avatar { visibility: hidden; }
.chat-message.grouped .message-head { display: none; }

.message-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 1px; }
.message-author { font-size: 13px; font-weight: 750; cursor: pointer; }
.message-author:hover { text-decoration: underline; text-underline-offset: 2px; }
.message-role { font-size: 7px; letter-spacing: .5px; font-weight: 800; text-transform: uppercase; color: #b9bec4; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); border-radius: 4px; padding: 1px 4px; }
.message-head time { font-size: 9px; color: #7d838b; }
.message-text { margin-top: 1px; font-size: var(--chat-font-size, 14px); line-height: 1.55; color: #dfe3e8; }
.message-text .message-sticker { max-width: 140px; max-height: 140px; }
.message-text .message-gif { max-width: 260px; max-height: 220px; }
.message-attachments { margin-top: 6px; }

.chat-message .message-actions { top: -10px; right: 12px; }
.chat-message .reply-preview { margin-top: 4px; }

/* composer icons right, input left */

.composer form #message-input { order: 1; }
.composer form .composer-plus { order: 2; }
.composer form .send-button { order: 3; }
.composer form #message-files { display: none !important; }

/* richer DM rows */

.dm-entry { padding: 7px 9px; gap: 9px; }
.dm-entry .avatar.tiny-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; }
.dm-entry > span { font-size: 12px; }
.dm-entry .dm-kind { font-size: 7.5px; letter-spacing: .7px; }

/* custom emojis */

.custom-emoji { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; margin: 0 1px; }
.custom-emoji-item { padding: 4px 0; }
.custom-emoji-item img { width: 26px; height: 26px; object-fit: contain; display: block; margin: 0 auto; }
.custom-emoji-grid { grid-template-columns: repeat(10, 1fr); }
.reaction-chip .custom-emoji { width: 14px; height: 14px; vertical-align: -2px; margin: 0; }
.reaction-chip span { font-size: 10px; color: #cfd4da; }

/* profile header clean-up */

.profile-head { align-items: center; margin-top: -36px; min-height: 118px; }
.profile-avatar-wrap { width: 92px; height: 92px; border-radius: 27px; padding: 3px; }
.profile-avatar-wrap .avatar { border-radius: 23px; font-size: 26px; }
.profile-identity { padding-bottom: 0; }
.profile-actions { padding-bottom: 0; }
.profile-cover { height: 200px; }

/* keep profile identity below the banner */

.profile-head { align-items: flex-end; margin-top: -30px; min-height: 112px; }
.profile-identity { padding-bottom: 4px; }
.profile-actions { padding-bottom: 4px; }
.profile-avatar-wrap { margin-top: auto; }
.profile-cover { position: relative; z-index: 0; }
.profile-main { position: relative; z-index: 2; }

.profile-head { margin-top: -18px; }

/* accent propagation across the whole UI */

.primary {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2, #f4f5f7), white 15%), var(--accent, #c9cdd4)) !important;
  color: #101114 !important;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent, #c9cdd4), transparent 40%), inset 0 1px 0 rgba(255, 255, 255, .5) !important;
}
.primary:hover { box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--accent, #c9cdd4), transparent 15%), inset 0 1px 0 rgba(255, 255, 255, .6) !important; }
.send-button {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2, #f1f2f4), white 10%), var(--accent, #b3bac3)) !important;
  color: #101114 !important;
}
.composer form {
  background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 95%);
  border-color: color-mix(in srgb, var(--accent, #c9cdd4), transparent 78%);
}
.composer-plus {
  background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 90%);
  color: color-mix(in srgb, var(--accent-2, #c9cdd4), white 10%);
  border: 1px solid color-mix(in srgb, var(--accent, #c9cdd4), transparent 82%);
}
.composer-plus:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 78%); }
.topbar-pill { border-color: color-mix(in srgb, var(--accent, #c9cdd4), transparent 75%); background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 92%); color: color-mix(in srgb, var(--accent-2, #c9cdd4), white 20%); }
.topbar-pill:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 85%); }
.members-panel, .dm-profile { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 96%); }
.cp-channel { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 90%); border-color: color-mix(in srgb, var(--accent, #c9cdd4), transparent 78%); }
.cp-channel:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 82%); }
.user-panel { background: linear-gradient(90deg, color-mix(in srgb, var(--accent, #c9cdd4), transparent 96%), color-mix(in srgb, var(--accent, #c9cdd4), transparent 92%)); }
.server-icon.active { background: linear-gradient(145deg, color-mix(in srgb, var(--accent, #c9cdd4), white 20%), color-mix(in srgb, var(--accent, #c9cdd4), black 25%)) !important; color: #101114 !important; }
.home-button { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-2, #f0f1f3), white 10%), var(--accent, #9ba1a9)) !important; color: #101114 !important; }
.tab-button.active { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 86%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #c9cdd4), transparent 70%); }
.tab-button.tab-add { background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2, #eef0f3), white 10%), var(--accent, #b9c0c9)) !important; color: #101114 !important; }
.small-action { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 90%); border-color: color-mix(in srgb, var(--accent, #c9cdd4), transparent 80%); color: #e6e9ed; }
.small-action:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 80%); }
.chat-message:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 97%); }
.friend-row:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 96%); }
.member-line:hover, .cp-member:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 92%); }
.icon-button:hover { background: color-mix(in srgb, var(--accent, #c9cdd4), transparent 88%); }
.app-modal { background: linear-gradient(160deg, color-mix(in srgb, var(--accent, #c9cdd4), transparent 94%), rgba(20, 25, 35, .98)) padding-box, linear-gradient(135deg, color-mix(in srgb, var(--accent, #c9cdd4), transparent 55%), rgba(255,255,255,.06)) border-box !important; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #c9cdd4), transparent 45%), color-mix(in srgb, var(--accent-2, #c9cdd4), transparent 65%)) !important; }

/* custom emoji upload during server creation */

.server-emoji-draft { display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.emoji-draft-list { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-draft-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); font-size: 9px; color: #c9ced4; }
.emoji-draft-chip img { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; }
.emoji-draft-chip button { width: 14px; height: 14px; border-radius: 4px; font-size: 8px; color: #8b9198; }
.emoji-draft-chip button:hover { background: rgba(224, 115, 131, .18); color: #ffc2ca; }
.emoji-draft-row { display: flex; align-items: center; gap: 6px; }
.emoji-draft-row #server-emoji-name { flex: 1; min-width: 0; font-size: 10.5px; padding: 7px 9px; }
.emoji-draft-row #server-emoji-file { flex: 1; min-width: 0; font-size: 8.5px; padding: 5px; }
.emoji-draft-row .small-action { flex: none; }

/* live banners: stills, GIF and video all render inside the cover */

.profile-cover,
.popout-cover,
.dm-profile-banner,
.pc-preview-banner,
.ss-preview-banner,
.self-menu-banner,
#server-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cover-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  pointer-events: none;
}
.has-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 9, 11, .1), rgba(10, 11, 14, .62));
}
.profile-cover > :not(.cover-media),
.popout-cover > :not(.cover-media),
.dm-profile-banner > :not(.cover-media),
.pc-preview-banner > :not(.cover-media),
.ss-preview-banner > :not(.cover-media),
#server-banner > :not(.cover-media) {
  position: relative;
  z-index: 2;
}
.pc-upload-tile.pc-upload-banner { position: relative; overflow: hidden; }
.pc-upload-tile.pc-upload-banner .cover-media { border-radius: inherit; }
.pc-upload-banner.is-live::after {
  content: "LIVE";
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 3;
  font-size: 7px;
  letter-spacing: .8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(8, 9, 11, .72);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #e8ebee;
}

.self-menu-banner { position: relative; overflow: hidden; isolation: isolate; }
.self-menu-banner .cover-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.self-menu-banner.has-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,9,11,.1), rgba(10,11,14,.65)); }

/* profile popout: solid card, real scrolling, no wash */

#modal.profile-popout {
  background: #16181d !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, .09) !important;
  border-radius: 18px !important;
  padding: 0 !important;
  max-height: 88vh !important;
  overflow: hidden !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .72) !important;
}
#modal.profile-popout .popout {
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: inherit;
  background: #16181d;
}
#modal.profile-popout .popout-cover {
  background-image:
    radial-gradient(460px 150px at 22% -45%, rgba(255, 255, 255, .10), transparent 62%),
    linear-gradient(120deg, #24272c, #14161a) !important;
  background-size: cover !important;
  background-position: center !important;
}
#modal.profile-popout .popout-cover.has-media { background-image: none !important; }
#modal.profile-popout .popout-cover.has-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 11, .05), rgba(12, 13, 16, .72));
}
#modal.profile-popout .popout-body { background: #16181d; }
#modal.profile-popout .popout-name { color: #f2f4f6; }
#modal.profile-popout.close, #modal.profile-popout .modal-close { z-index: 5; }
#modal.profile-popout .popout::-webkit-scrollbar { width: 8px; }

/* cover labels keep their own anchoring - the media-layer rule must not drag them */

.popout-cover > .popout-cover-mark {
  position: absolute !important;
  right: 14px !important;
  bottom: 10px !important;
  top: auto !important;
  left: auto !important;
  z-index: 3;
}
.profile-cover > .profile-cover-label {
  position: absolute !important;
  z-index: 3;
}

/* server sidebar member rows */

#server-members .member-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
}
#server-members .member-entry .member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #dfe3e8;
}
#server-members .member-entry:hover .member-name { color: #fff; }
#server-members .member-entry .member-tag {
  flex: none;
  font-size: 7px;
  letter-spacing: .6px;
  font-weight: 800;
  text-transform: uppercase;
  color: #b9bec4;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .05);
  border-radius: 4px;
  padding: 1px 4px;
}

/* member list: vertical scroll only, no horizontal bar */

.member-list { overflow-x: hidden !important; overflow-y: auto !important; }
.member-list::-webkit-scrollbar { width: 6px; height: 0; }
.member-list .member-entry { max-width: 100%; }

/* direct message history intro */

.dm-intro {
  padding: 34px 12px 10px;
  margin-top: 6px;
}
.dm-intro-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
}
.dm-intro-avatar .avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 26px;
}
.dm-intro-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.8px;
  color: #f2f4f6;
  line-height: 1.1;
}
.dm-intro-copy {
  margin: 0 0 12px;
  font-size: 13px;
  color: #b7bdc5;
}
.dm-intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-intro-btn {
  padding: 7px 13px;
  font-size: 11.5px;
  font-weight: 650;
  border-radius: 8px;
  color: #e6e9ed;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}
.dm-intro-btn:hover { background: rgba(255, 255, 255, .13); }
.dm-intro + .date-divider { margin-top: 14px; }

/* profile popout polish */

#modal.profile-popout { width: min(400px, calc(100% - 32px)) !important; }
#modal.profile-popout .popout-cover {
  height: 132px !important;
  border-radius: 18px 18px 0 0;
  background:
    radial-gradient(420px 150px at 18% -55%, rgba(255, 255, 255, .085), transparent 64%),
    linear-gradient(150deg, #23262b 0%, #17191d 62%, #14161a 100%) !important;
}
#modal.profile-popout .popout-body { padding: 0 20px 20px; }
#modal.profile-popout .popout-avatar-wrap {
  width: 88px;
  height: 88px;
  margin-top: -46px;
  border-radius: 50%;
  padding: 3px;
  background: #16181d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6);
}
#modal.profile-popout .popout-avatar-wrap .avatar { border-radius: 50%; }
#modal.profile-popout .popout-avatar-wrap.deco-ring { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 12px 30px rgba(0, 0, 0, .6); }
#modal.profile-popout .popout-name {
  margin: 12px 0 3px;
  font-size: 21px;
  letter-spacing: -.4px;
}
#modal.profile-popout .popout-name .display-name { background: none !important; padding: 0 !important; }
#modal.profile-popout .popout-handle { font-size: 11.5px; color: #98a0a8; }
#modal.profile-popout .popout-status-line { margin: 10px 0 0; }
#modal.profile-popout .popout-actions { margin: 14px 0 4px; gap: 7px; }
#modal.profile-popout .popout-actions .primary,
#modal.profile-popout .popout-actions .secondary { padding: 8px 14px; font-size: 11.5px; border-radius: 8px; }
#modal.profile-popout .popout-section { margin-top: 18px; }
#modal.profile-popout .popout-section h4 { font-size: 9px; letter-spacing: 1.1px; color: #8f969e; margin-bottom: 7px; }
#modal.profile-popout .popout-section p { font-size: 12px; line-height: 1.6; color: #c3c9d0; }
#modal.profile-popout .popout-cover-mark { font-size: 7.5px; letter-spacing: 1.4px; color: rgba(255, 255, 255, .42); }

/* dm avatars + presence in list, avatar in topbar */

.dm-entry { position: relative; }
.dm-entry .presence-dot {
  position: absolute;
  left: 36px;
  bottom: 9px;
  width: 9px;
  height: 9px;
  border-width: 2px;
  pointer-events: none;
}
.dm-entry .avatar.tiny-avatar { overflow: hidden; }
.dm-entry .avatar.tiny-avatar img.avatar-image,
.dm-entry .avatar.tiny-avatar .avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.topbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 9px;
  flex: none;
  display: inline-flex;
}
.topbar-avatar.hidden { display: none; }
.topbar-avatar .avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 10px;
}
.topbar-avatar .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* zero animation: instant UI, no transitions, no keyframes, no delays */

*, *::before, *::after {
  transition: none !important;
  animation: none !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
html, body { scroll-behavior: auto !important; }
#cursor-glow, .cursor-glow, .grain-overlay, .aurora, .aurora-layer { display: none !important; }
.fx-ripple { display: none !important; }
#cursor-glow { display: none !important; }

/* polls */

.poll-card {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .035);
  max-width: 480px;
}
.poll-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.poll-head strong { font-size: 13.5px; color: #f0f3f5; }
.poll-meta { font-size: 9.5px; color: #8b929a; white-space: nowrap; }
.poll-options { display: grid; gap: 6px; }
.poll-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
  text-align: left;
  width: 100%;
}
.poll-option:hover { background: rgba(255, 255, 255, .07); }
.poll-option.is-mine { border-color: rgba(255, 255, 255, .34); }
.poll-fill { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, .1); z-index: 0; }
.poll-option.is-mine .poll-fill { background: rgba(120, 200, 255, .22); }
.poll-label, .poll-count { position: relative; z-index: 1; font-size: 12px; color: #e2e6ea; }
.poll-count { font-size: 10px; color: #a7aeb6; }
.poll-loading { font-size: 11px; color: #8b929a; }

/* forward modal */

.forward-list { display: grid; gap: 12px; max-height: 52vh; overflow-y: auto; margin: 12px 0; }
.forward-server strong { display: block; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #9aa1a9; margin-bottom: 6px; }
.forward-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.forward-target {
  padding: 6px 11px;
  font-size: 11.5px;
  border-radius: 7px;
  color: #e6e9ed;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}
.forward-target:hover { background: rgba(255, 255, 255, .13); }

/* threads */

.thread-shell { display: grid; gap: 12px; }
.thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.thread-head h2 { margin: 2px 0 0; }
.thread-archived { font-size: 8px; letter-spacing: .8px; font-weight: 800; color: #b9bec4; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; padding: 2px 6px; }
.thread-list { max-height: 48vh; overflow-y: auto; display: grid; gap: 10px; padding-right: 4px; }
.thread-message { border-left: 2px solid rgba(255,255,255,.1); padding-left: 10px; }
.thread-author { font-size: 11.5px; font-weight: 700; color: #cfd5dc; }
.thread-time { font-size: 9px; color: #7d838b; margin-left: 6px; }
.thread-text { font-size: 13px; color: #dfe3e8; line-height: 1.55; margin-top: 1px; }
.thread-reply { display: flex; gap: 8px; }
.thread-reply input { flex: 1; min-width: 0; }

/* events */

.event-list { display: grid; gap: 8px; margin-top: 14px; }
.event-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
.event-row strong { display: block; font-size: 12.5px; color: #eef1f4; }
.event-time { display: block; font-size: 10px; color: #8f969e; margin-top: 2px; }
.event-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.event-going { font-size: 10px; color: #9aa1a9; }

/* webhooks */

.webhook-list { display: grid; gap: 8px; margin-top: 14px; }
.webhook-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
.webhook-token { display: flex; align-items: center; gap: 6px; }
.webhook-token code { font-size: 9.5px; color: #9aa1a9; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* forum */

.forum-view { padding: 18px 14px; }
.forum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.forum-head h2 { margin: 2px 0 0; }
.forum-list { display: grid; gap: 8px; }
.forum-post { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 13px 15px; border-radius: 11px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
.forum-post:hover { background: rgba(255,255,255,.07); }
.forum-post-main strong { display: block; font-size: 13px; color: #eef1f4; }
.forum-post-main span { display: block; margin-top: 3px; }
.forum-post-meta { font-size: 9px; letter-spacing: .6px; text-transform: uppercase; color: #8f969e; flex: none; }
