
/* ===== responsive shell ===== */
:root {
  --cleanup-main: #101218;
  --cleanup-side: #17191f;
  --cleanup-rail: #0c0d11;
  --cleanup-hover: #252830;
  --cleanup-active: #2d3038;
  --cleanup-border: #292c34;
  --cleanup-text: #f2f3f5;
  --cleanup-muted: #a7adb7;
  --cleanup-brand: #5865f2;
}

*, *::before, *::after { box-sizing: border-box; }
button, input, textarea, select { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #8ea1ff !important;
  outline-offset: 2px;
}

html, body { max-width: 100%; overscroll-behavior: none; }
.app-shell.app-shell.hidden { display: none !important; }
.app-shell,
.app-shell.r021-no-members,
.app-shell.parity-dm-profile,
.app-shell.members-collapsed {
  grid-template-columns: 72px 248px minmax(0, 1fr) 300px !important;
  grid-template-rows: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
  grid-auto-rows: auto !important;
  min-width: 0 !important;
  background: var(--cleanup-main) !important;
}
.app-shell.r021-no-members,
.app-shell.members-collapsed:not(.parity-dm-profile) {
  grid-template-columns: 72px 248px minmax(0, 1fr) !important;
}
.server-rail { grid-column: 1 !important; grid-row: 1 !important; background: var(--cleanup-rail) !important; }
.channel-panel { grid-column: 2 !important; grid-row: 1 !important; background: var(--cleanup-side) !important; }
.content-panel { grid-column: 3 !important; grid-row: 1 !important; grid-template-rows: 52px minmax(0, 1fr) !important; min-width: 0 !important; contain: none !important; background: var(--cleanup-main) !important; }
.member-panel { grid-column: 4 !important; grid-row: 1 !important; background: var(--cleanup-side) !important; }
.app-shell.parity-dm-profile .member-panel { display: block !important; overflow: hidden !important; }
.ui0211-discover-view { inset: 52px 0 0 !important; }

.server-header {
  cursor: pointer;
  transition: background-color .14s ease !important;
}
.server-header:hover,
.server-header.server-menu-open { background: #20232a !important; }
.server-header #server-menu-button svg { transition: transform .16s ease; }
.server-header.server-menu-open #server-menu-button svg { transform: rotate(180deg); }
.parity-server-menu {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px) scale(.985);
  transform-origin: top left;
  transition: opacity .14s ease, transform .14s cubic-bezier(.2, .8, .2, 1);
  will-change: opacity, transform;
}
.parity-server-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.parity-server-menu.closing {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px) scale(.985);
}

/* One owner per decoration: legacy overlays and duplicate action clusters stay retired. */
#parity-route-curtain,
#ui0211-route-curtain,
#ui0212-route-mask,
.parity-channel-actions,
.ui0211-channel-actions,
.parity-server-badge,
.ui0213-voice-state-icons,
.ui0211-member-vstate,
[data-r22-dm-message] { display: none !important; }

.channel-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
  align-items: start !important;
  min-width: 0 !important;
}
.channel-row > .channel-item {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  grid-template-columns: 22px minmax(0, 1fr) auto !important;
  align-items: center !important;
  padding-right: 48px !important;
}
.channel-row > .channel-manage {
  display: grid !important;
  width: 30px !important;
  height: 30px !important;
  top: 5px !important;
  transform: none !important;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--cleanup-muted);
  opacity: 0;
  cursor: pointer;
}
.channel-row:hover > .channel-manage,
.channel-row:focus-within > .channel-manage { opacity: 1; }
.channel-row > .channel-manage:hover { color: #fff; background: var(--cleanup-hover); }
.channel-row > .voice-member-list {
  grid-column: 1 !important;
  grid-row: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 2px 0 3px 14px !important;
}
.channel-row > .voice-member-list > .voice-member-row {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 32px !important;
  min-height: 32px !important;
  grid-template-columns: 24px minmax(0, 1fr) auto !important;
  gap: 7px !important;
  padding: 2px 8px 2px 6px !important;
}
.channel-row > .voice-member-list > .voice-member-row > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-item, .dm-item, .home-nav-item { min-height: 40px !important; font-size: 14px !important; }
.channel-name, .dm-item-copy, .member-copy { min-width: 0; }
.dm-item-copy strong, .member-copy strong { font-size: 14px !important; }
.dm-item-copy span, .member-copy > span { font-size: 12px !important; }

.content-header { min-width: 0 !important; height: 52px !important; padding: 0 12px !important; background: var(--cleanup-main) !important; }
.channel-heading { min-width: 0; overflow: hidden; }
.channel-heading > div { min-width: 0; overflow: hidden; }
.channel-heading strong { color: var(--cleanup-text); font-size: 15px !important; overflow: hidden; text-overflow: ellipsis; }
.channel-heading #channel-topic { color: var(--cleanup-muted); font-size: 12px !important; overflow: hidden; text-overflow: ellipsis; }
.header-actions { flex: 0 0 auto; }

.ui0213-dm-head-avatar {
  position: relative !important;
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 32px;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700;
  overflow: visible !important;
}
.ui0213-dm-head-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ui0213-head-presence,
.dm-presence-dot,
.self-presence-dot {
  width: 12px !important;
  height: 12px !important;
  box-sizing: border-box !important;
  border: 3px solid var(--cleanup-side) !important;
  border-radius: 50%;
  background: var(--cleanup-side) !important;
  box-shadow: inset 0 0 0 2px #80848e !important;
  transform: none !important;
}
.ui0213-head-presence {
  position: absolute !important;
  left: auto !important;
  top: auto !important;
  right: -2px !important;
  bottom: -2px !important;
}
.ui0213-head-presence.online,
.dm-presence-dot.online,
.dm-presence-dot.presence-online {
  background: #23a55a !important;
  box-shadow: none !important;
}
.ui0213-head-presence.idle,
.dm-presence-dot.idle,
.dm-presence-dot.presence-idle {
  background: #f0b232 !important;
  box-shadow: none !important;
}
.ui0213-head-presence.dnd,
.dm-presence-dot.dnd,
.dm-presence-dot.presence-dnd {
  background: #f23f43 !important;
  box-shadow: none !important;
}
.ui0213-head-presence.offline,
.dm-presence-dot.offline,
.dm-presence-dot.presence-offline,
.dm-presence-dot.presence-invisible {
  background: var(--cleanup-side) !important;
  box-shadow: inset 0 0 0 2px #80848e !important;
}
.member-item .member-avatar-wrap {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
}
.social-row .member-avatar-wrap {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px !important;
}
.member-avatar-wrap > .presence-dot,
.dm-avatar-wrap > .dm-presence-dot {
  position: absolute !important;
  left: auto !important;
  top: auto !important;
  right: -2px !important;
  bottom: -2px !important;
  width: 12px !important;
  height: 12px !important;
  box-sizing: border-box !important;
  border: 3px solid var(--cleanup-side) !important;
  transform: none !important;
  --status-cutout: var(--cleanup-side);
}
.member-avatar-wrap > .presence-dot.presence-online,
.member-avatar-wrap > .presence-dot.online {
  background: #23a55a !important;
  box-shadow: none !important;
}
.member-avatar-wrap > .presence-dot.presence-idle {
  background: #f0b232 !important;
  box-shadow: none !important;
}
.member-avatar-wrap > .presence-dot.presence-dnd {
  background: #f23f43 !important;
  box-shadow: none !important;
}
.member-avatar-wrap > .presence-dot.presence-offline,
.member-avatar-wrap > .presence-dot.presence-invisible,
.member-item.offline .member-avatar-wrap > .presence-dot:not(.presence-online) {
  background: var(--cleanup-side) !important;
  box-shadow: inset 0 0 0 2px #80848e !important;
}
.dm-avatar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}
.dm-avatar-wrap .avatar { border-radius: 50% !important; }
.current-user-panel { position: relative !important; }
.current-user-panel > .self-presence-dot {
  position: absolute !important;
  left: 32px !important;
  right: auto !important;
  bottom: 9px !important;
  top: auto !important;
  z-index: 4;
  border-color: #0b0d10 !important;
  --status-cutout: #0b0d10;
  transform: none !important;
}
.current-user-panel > .self-presence-dot.presence-online {
  background: #23a55a !important;
  box-shadow: none !important;
}
.current-user-panel > .self-presence-dot.presence-idle {
  background: #f0b232 !important;
  box-shadow: none !important;
}
.current-user-panel > .self-presence-dot.presence-dnd {
  background: #f23f43 !important;
  box-shadow: none !important;
}
.current-user-panel > .self-presence-dot.presence-offline,
.current-user-panel > .self-presence-dot.presence-invisible {
  background: #0b0d10 !important;
  box-shadow: inset 0 0 0 2px #80848e !important;
}

.message { padding: 6px 18px !important; }
.message-author { font-size: 14px !important; }
.message-time { font-size: 11px !important; }
.message-text { font-size: 15px !important; line-height: 1.45 !important; }
.message-list { overflow-x: hidden !important; scroll-behavior: auto !important; }
.composer { min-width: 0 !important; border-radius: 8px !important; }
.composer textarea { min-width: 0 !important; font-size: 15px !important; }
.ui0212-composer-tools button { width: 34px !important; height: 34px !important; }
.ui0212-composer-tools [data-r22-tool="Translator"] svg { width: 21px !important; height: 21px !important; }
.typing-bar { font-size: 12px !important; }

/* Profile editor: useful fields and preview, without a wall of placeholders. */
.r021-profile-intro { margin: -10px 0 24px; max-width: 650px; color: var(--cleanup-muted); font-size: 14px; line-height: 1.5; }
.r021-profile-settings-grid {
  width: min(760px, 100%) !important;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 360px) !important;
  gap: 28px !important;
}
.r021-profile-controls { gap: 18px !important; }
.r021-control-block > label { font-size: 13px !important; }
.r021-control-box { min-height: 54px !important; padding: 8px !important; }
.r021-control-box input, .r021-control-box textarea { font-size: 14px !important; }
.r021-widget-board, .r021-disabled-tile { display: none !important; }
.r021-profile-preview { align-self: start; position: sticky; top: 0; }
.r021-preview-name { font-size: 22px !important; }
.r021-preview-user, .r021-preview-bio, .r021-preview-meta { font-size: 12px !important; }
.ui0212-dm-profile { width: 100% !important; max-width: none !important; }
.ui0212-dm-body { padding-left: 18px !important; padding-right: 18px !important; }
.ui0212-dm-body h2 { font-size: 21px !important; }
.ui0212-dm-section h4 { font-size: 11px !important; }
.ui0212-dm-section p, .ui0212-dm-note { font-size: 13px !important; }

/* Discord-style invite sheet. */
.modal.rift-invite-modal { width: min(500px, calc(100vw - 32px)) !important; border-radius: 10px !important; background: #111214 !important; }
.invite-modal-head { padding: 22px 24px 14px !important; }
.invite-modal-head h3 { font-size: 18px !important; }
.invite-modal-head p { margin: 5px 0 0; color: var(--cleanup-muted); font-size: 13px; }
.invite-search {
  height: 42px;
  margin: 0 24px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #30333a;
  border-radius: 7px;
  background: #0b0c0f;
  padding: 0 11px;
  color: var(--cleanup-muted);
}
.invite-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--cleanup-text); font-size: 14px; }
.invite-recipient-list { max-height: min(370px, 45vh); overflow-y: auto; padding: 0 16px 10px 24px; }
.invite-recipient { min-height: 52px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 8px 5px 0; }
.invite-recipient .avatar { width: 38px; height: 38px; border-radius: 50%; }
.invite-recipient-copy { min-width: 0; }
.invite-recipient-copy strong, .invite-recipient-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-recipient-copy strong { font-size: 14px; }
.invite-recipient-copy small { margin-top: 2px; color: #808791; font-size: 12px; }
.invite-recipient > button { min-width: 62px; height: 34px; border: 1px solid #3ba55c; border-radius: 5px; background: transparent; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.invite-recipient > button:hover:not(:disabled) { background: #2d7d46; border-color: #2d7d46; }
.invite-recipient > button.sent { background: transparent; border-color: transparent; color: #23a55a; }
.invite-empty { padding: 24px 8px; color: var(--cleanup-muted); font-size: 13px; text-align: center; }
.invite-link-section { border-top: 1px solid var(--cleanup-border); padding: 18px 24px 20px; background: #0d0e11; }
.invite-link-section > strong { display: block; margin-bottom: 9px; font-size: 13px; }
.invite-link-section > small { color: #7f8792; font-size: 11px; }
.invite-link-section .invite-code { margin: 0 0 8px; gap: 4px; }
.invite-code input { min-width: 0; height: 42px; border: 1px solid #30333a; border-radius: 6px; background: #08090b; color: #d7d9dd; padding: 0 10px; outline: 0; }
.invite-code button { min-width: 76px; border-radius: 5px; background: var(--cleanup-brand); }
.invite-preview { position: relative; padding: 30px 24px 22px; text-align: center; }
.invite-preview-close { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: var(--cleanup-muted); font-size: 24px; cursor: pointer; }
.invite-preview-kicker { color: var(--cleanup-muted); font-size: 13px; }
.invite-preview-icon { width: 72px; height: 72px; margin: 18px auto 12px; border-radius: 22px; display: grid; place-items: center; background: var(--cleanup-brand); color: #fff; font-size: 22px; font-weight: 750; }
.invite-preview h3 { margin: 0; font-size: 22px; }
.invite-preview > p:not(.form-error) { color: var(--cleanup-muted); }

.mobile-scrim { display: none; position: fixed; inset: 0; z-index: 180; border: 0; padding: 0; background: rgba(0, 0, 0, .62); opacity: 0; }
.mobile-scrim.show { display: block; opacity: 1; }

@media (min-width: 1181px) {
  .app-shell.parity-dm-profile #member-toggle { display: none !important; }
  .ui0212-channel-settings {
    grid-template-columns: minmax(220px, 1fr) minmax(560px, 760px) minmax(220px, 1fr) !important;
  }
}

@media (max-width: 1100px) {
  .r021-profile-settings-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .r021-profile-preview { position: static !important; order: -1; }
}

@media (min-width: 801px) and (max-width: 1180px) {
  .app-shell,
  .app-shell.r021-no-members,
  .app-shell.parity-dm-profile,
  .app-shell.members-collapsed {
    grid-template-columns: 68px 244px minmax(0, 1fr) !important;
  }
  .server-rail { width: 68px !important; }
  .member-panel,
  .member-panel.closed,
  .app-shell.parity-dm-profile .member-panel {
    display: grid !important;
    position: fixed !important;
    z-index: 200 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(320px, 88vw) !important;
    height: auto !important;
    transform: translateX(105%) !important;
    transition: transform .18s ease !important;
    box-shadow: -18px 0 48px rgba(0, 0, 0, .45) !important;
  }
  .app-shell.mobile-members-open .member-panel { transform: translateX(0) !important; }
}

@media (max-width: 800px) {
  html, body { width: 100%; height: 100%; overflow: hidden !important; }
  .app-shell,
  .app-shell.r021-no-members,
  .app-shell.parity-dm-profile,
  .app-shell.members-collapsed {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }
  body.desktop-runtime .app-shell,
  body.desktop-runtime .app-shell.r021-no-members,
  body.desktop-runtime .app-shell.parity-dm-profile,
  body.desktop-runtime .app-shell.members-collapsed { height: auto !important; }
  .content-panel {
    display: grid !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    transform: none !important;
    grid-template-rows: 54px minmax(0, 1fr) !important;
  }
  .server-rail,
  .channel-panel {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    z-index: 210 !important;
    transition: transform .18s ease !important;
    box-shadow: none !important;
    backface-visibility: visible !important;
  }
  .server-rail {
    left: 0 !important;
    width: 72px !important;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    transform: translateX(-100%) !important;
  }
  .channel-panel,
  .app-shell.parity-dm-profile .channel-panel {
    left: 72px !important;
    width: min(300px, calc(100vw - 96px)) !important;
    max-width: calc(100vw - 96px) !important;
    height: auto !important;
    flex-direction: initial !important;
    display: grid !important;
    transform: translateX(calc(-100% - 72px)) !important;
    box-shadow: 20px 0 45px rgba(0, 0, 0, .45) !important;
  }
  .app-shell.mobile-nav-open .server-rail,
  .app-shell.mobile-nav-open .channel-panel { transform: translateX(0) !important; }
  .member-panel,
  .member-panel.closed,
  .app-shell.parity-dm-profile .member-panel {
    display: grid !important;
    position: fixed !important;
    z-index: 220 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(330px, calc(100vw - 44px)) !important;
    height: auto !important;
    transform: translateX(105%) !important;
    transition: transform .18s ease !important;
    box-shadow: -18px 0 48px rgba(0, 0, 0, .5) !important;
  }
  .app-shell.mobile-members-open .member-panel { transform: translateX(0) !important; }
  .mobile-only { display: grid !important; }
  #mobile-nav-close { width: 44px !important; height: 44px !important; flex: 0 0 44px; color: var(--cleanup-muted); font-size: 28px; }
  .content-header { height: 54px !important; padding: 0 8px !important; gap: 4px; }
  #mobile-nav-button, #member-toggle, #invite-button { width: 44px !important; height: 44px !important; flex: 0 0 44px; }
  .channel-heading { flex: 1 1 auto; gap: 8px !important; }
  .channel-heading > div { display: block !important; }
  .channel-heading #channel-topic { display: none !important; }
  #r021-header-extras { display: none !important; }
  .r021-home-tabs { min-width: 0; overflow-x: auto !important; scrollbar-width: none; }
  .r021-home-title { display: none !important; }
  .r021-home-tab { min-height: 38px; }
  .channel-item, .dm-item, .home-nav-item { min-height: 44px !important; }
  .home-view { width: 100% !important; padding: 18px 14px !important; }
  .r021-friends-shell {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  .r021-friends-main { padding: 12px 12px 24px !important; }
  .r021-friends-side { display: none !important; }
  .r021-friend-search { height: 42px !important; font-size: 16px !important; }
  .social-row { min-height: 58px !important; }
  .message { grid-template-columns: 36px minmax(0, 1fr) !important; gap: 10px !important; padding: 6px 10px !important; }
  .message > .avatar { width: 36px !important; height: 36px !important; border-radius: 50% !important; }
  .channel-intro { padding: 34px 14px 18px !important; }
  .channel-intro h2 { font-size: 22px !important; }
  .composer {
    grid-template-columns: 36px minmax(0, 1fr) auto !important;
    width: auto !important;
    margin: 0 8px max(8px, env(safe-area-inset-bottom)) !important;
    padding: 5px !important;
  }
  .composer textarea { padding-left: 5px !important; }
  .ui0212-composer-tools { min-width: 0 !important; }
  .composer-action, .ui0212-composer-tools button { width: 44px !important; height: 44px !important; }
  .ui0212-composer-tools button[data-r22-tool="GIF"],
  .ui0212-composer-tools button[data-r22-tool="Sticker"],
  .ui0212-composer-tools button[data-r22-tool="Activity"],
  .ui0212-composer-tools button[data-r22-tool="Timestamp"] { display: none !important; }
  .ui0212-composer-tools button[data-r22-tool="Translator"],
  .ui0212-composer-tools button[data-r22-tool="Emoji"] { display: grid !important; }
  .typing-bar { padding: 0 12px !important; }
  .ui0212-dm-profile { overflow-y: auto !important; }
  .ui0212-dm-body { padding-bottom: max(22px, env(safe-area-inset-bottom)) !important; }

  .ui0212-voice-page { width: 100% !important; min-width: 0 !important; }
  .ui0212-voice-page.joined { grid-template-rows: 44px minmax(0, 1fr) auto minmax(68px, calc(54px + env(safe-area-inset-bottom))) !important; }
  .ui0212-voice-grid { width: 100% !important; height: auto !important; min-height: 0 !important; align-self: stretch !important; grid-template-columns: 1fr !important; grid-auto-rows: minmax(150px, 1fr) !important; padding: 10px !important; }
  .ui0212-voice-tile { min-height: 150px !important; }
  .ui0212-activity-strip { display: none !important; }
  .ui0212-callbar { width: auto !important; padding-bottom: max(7px, env(safe-area-inset-bottom)) !important; justify-content: center !important; gap: 14px !important; }
  .ui0212-callbar > * { display: none !important; }
  .ui0212-callbar > .ui0212-call-group:first-child,
  .ui0212-callbar > .ui0212-call-btn.leave { display: flex !important; }
  .ui0212-callbar > .ui0212-call-group:first-child > button:nth-child(n+2) { display: none !important; }
  #ui0212-join-voice { min-width: 150px; min-height: 46px; }

  .r021-settings {
    display: flex !important;
    flex-direction: column !important;
    inset: 0 !important;
    overflow: hidden !important;
  }
  .r021-settings-nav-wrap { flex: 0 0 auto; display: block !important; overflow-x: auto !important; overflow-y: hidden !important; }
  .r021-settings-nav { width: max-content !important; min-width: 100%; padding: max(48px, env(safe-area-inset-top)) 52px 10px 10px !important; display: flex; gap: 4px; }
  .r021-settings-group { display: contents; }
  .r021-settings-label { display: none; }
  .r021-settings-nav button { width: auto !important; min-width: max-content; height: 38px; padding: 0 12px !important; }
  .r021-settings-main { flex: 1 1 auto; padding: 24px 16px max(32px, env(safe-area-inset-bottom)) !important; }
  .r021-settings-close { position: fixed; top: max(8px, env(safe-area-inset-top)); right: 10px; z-index: 2; padding: 0 !important; }
  .r021-settings-close small { display: none !important; }
  .r021-profile-settings-grid { width: 100% !important; grid-template-columns: minmax(0, 1fr) !important; gap: 22px !important; }
  .r021-profile-preview { position: static; order: -1; }
  .r021-account-card { min-width: 0 !important; }

  .ui0212-channel-settings {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }
  .ui0212-channel-settings aside {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: block !important;
    padding: max(48px, env(safe-area-inset-top)) 54px 8px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
  .ui0212-channel-settings aside > div {
    display: flex !important;
    width: max-content !important;
    min-width: 100%;
    gap: 4px;
  }
  .ui0212-channel-settings aside h4,
  .ui0212-channel-settings aside button:disabled,
  .ui0212-channel-settings .close span { display: none !important; }
  .ui0212-channel-settings aside button {
    width: auto !important;
    min-width: max-content;
    min-height: 40px !important;
    padding: 0 12px !important;
  }
  .ui0212-channel-settings aside button.danger { margin-top: 0 !important; }
  .ui0212-channel-settings main {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0 !important;
    padding: 24px 16px max(32px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .ui0212-channel-settings textarea { min-height: 120px !important; }
  .ui0212-channel-settings .close {
    position: fixed;
    top: max(7px, env(safe-area-inset-top));
    right: 9px;
    z-index: 3;
    padding: 0 !important;
  }

  .parity-settings {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }
  .parity-settings-nav {
    flex: 0 0 auto;
    display: flex !important;
    gap: 4px;
    padding: max(48px, env(safe-area-inset-top)) 54px 8px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
  .parity-settings-nav h4,
  .parity-settings-group-label,
  .parity-settings-nav button:disabled,
  .parity-settings-close span { display: none !important; }
  .parity-settings-nav button {
    flex: 0 0 auto;
    width: auto !important;
    min-width: max-content;
    min-height: 40px;
    padding: 0 12px !important;
  }
  .parity-settings-nav button.danger { margin-top: 0 !important; }
  .parity-settings-content {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0 !important;
    padding: 24px 16px max(32px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .parity-settings-close {
    position: fixed;
    top: max(7px, env(safe-area-inset-top));
    right: 9px;
    z-index: 3;
    padding: 0 !important;
  }

  .ui0212-self-card, .r021-profile-card { width: min(330px, calc(100vw - 16px)) !important; max-width: calc(100vw - 16px) !important; left: 8px !important; right: 8px !important; }
  .modal-backdrop { padding: 8px !important; align-items: center; }
  .modal { max-height: calc(100dvh - 16px); overflow-y: auto; }
  #toast-region.toast-region { top: max(10px, env(safe-area-inset-top)) !important; bottom: auto !important; left: 10px !important; right: 10px !important; width: auto !important; transform: none !important; }
  .toast { font-size: 13px; }
  .ui0211-discover-view { inset: 54px 0 0 !important; }
}

@media (max-width: 480px) {
  .invite-recipient-list { max-height: 38vh; }
  .invite-recipient > button, .invite-code button { min-height: 44px; }
  .invite-modal-head, .invite-link-section { padding-left: 16px !important; padding-right: 16px !important; }
  .invite-search { margin-left: 16px; margin-right: 16px; }
  .invite-recipient-list { padding-left: 16px; padding-right: 8px; }
  .modal.rift-invite-modal { width: calc(100vw - 16px) !important; }
  .channel-heading strong { max-width: 42vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Authentication/log-out must always win over responsive shell display rules. */
.app-shell.app-shell.app-shell.hidden { display: none !important; }
.modal-backdrop {
  z-index: 300 !important;
}


/* ===== mobile navigation ===== */
/* Mobile shell ownership. These final rules prevent old desktop grid selectors from leaking into phones. */
@media (max-width: 800px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  #app.app-shell,
  #app.app-shell.r021-no-members,
  #app.app-shell.parity-dm-profile,
  #app.app-shell.members-collapsed,
  #app.app-shell:has(.member-panel.closed) {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    grid-auto-rows: auto !important;
    overflow: hidden !important;
    transform: none !important;
  }

  body.desktop-runtime #app.app-shell,
  body.desktop-runtime #app.app-shell.r021-no-members,
  body.desktop-runtime #app.app-shell.parity-dm-profile,
  body.desktop-runtime #app.app-shell.members-collapsed,
  body.desktop-runtime #app.app-shell:has(.member-panel.closed) {
    position: fixed !important;
    inset: 32px 0 0 !important;
    height: auto !important;
  }

  #app.app-shell > .content-panel {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    display: grid !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    transform: none !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 54px minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  #app.app-shell > .server-rail,
  #app.app-shell > .channel-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1) !important;
    will-change: transform !important;
  }

  #app.app-shell > .server-rail {
    left: 0 !important;
    z-index: 212 !important;
    width: 64px !important;
    min-width: 64px !important;
    transform: translate3d(-64px, 0, 0) !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  #app.app-shell > .channel-panel,
  #app.app-shell.parity-dm-profile > .channel-panel {
    left: 64px !important;
    right: auto !important;
    z-index: 211 !important;
    width: min(300px, calc(100vw - 76px)) !important;
    max-width: calc(100vw - 76px) !important;
    min-width: 0 !important;
    display: grid !important;
    transform: translate3d(calc(-100% - 64px), 0, 0) !important;
    box-shadow: 18px 0 42px rgba(0, 0, 0, .48) !important;
    pointer-events: none !important;
  }

  #app.app-shell.mobile-nav-open > .server-rail,
  #app.app-shell.mobile-nav-open > .channel-panel {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }

  #app.app-shell > .member-panel,
  #app.app-shell > .member-panel.closed,
  #app.app-shell.parity-dm-profile > .member-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    z-index: 222 !important;
    display: grid !important;
    width: min(330px, calc(100vw - 36px)) !important;
    max-width: calc(100vw - 36px) !important;
    height: 100dvh !important;
    transform: translate3d(105%, 0, 0) !important;
    box-shadow: -18px 0 44px rgba(0, 0, 0, .5) !important;
    pointer-events: none !important;
  }

  #app.app-shell.mobile-members-open > .member-panel {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }

  #app.app-shell .mobile-scrim {
    position: fixed !important;
    inset: 0 !important;
    z-index: 205 !important;
  }

  #app.app-shell .content-header {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  #app.app-shell #mobile-nav-button {
    display: grid !important;
    flex: 0 0 44px !important;
  }

  #app.app-shell .channel-heading {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  #app.app-shell .header-actions {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  #app.app-shell .home-view,
  #app.app-shell .chat-view,
  #app.app-shell .voice-view,
  #app.app-shell .ui0211-discover-view {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #app.app-shell .home-view {
    overflow-x: hidden !important;
  }

  #app.app-shell .r021-friends-shell,
  #app.app-shell .r021-friends-main,
  #app.app-shell #home-server-grid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #app.app-shell .message-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #app.app-shell .composer {
    max-width: calc(100% - 16px) !important;
  }
}


/* ===== brand and voice presentation ===== */
/* Rift visual identity layer: seams, a stronger top bar, restrained brand red, and stable layout ownership. */
:root {
  --rift-brand-red: #d84b4b;
  --rift-brand-red-bright: #ed5a5d;
  --rift-brand-red-soft: rgba(216, 75, 75, .13);
  --rift-brand-red-faint: rgba(216, 75, 75, .07);
  --rift-seam: #2d3139;
  --rift-seam-soft: #242830;
  --rift-voice-green: #23a55a;
}

.rail-divider {
  height: 1px !important;
  background: linear-gradient(90deg, #30343c 0 42%, transparent 42% 58%, #30343c 58% 100%) !important;
  transform: skewX(-14deg);
  opacity: .95;
}

.server-header,
.content-header {
  position: relative !important;
  border-bottom: 0 !important;
  overflow: visible !important;
}

.server-header::before,
.content-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--rift-seam) 0 58%, transparent 58% 61%, var(--rift-seam-soft) 61% 100%);
  z-index: 3;
}

.server-header::after,
.content-header::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: 10px;
  bottom: -1px;
  width: 24px;
  height: 2px;
  pointer-events: none;
  background: var(--rift-brand-red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 4px 100%);
  opacity: .9;
  z-index: 4;
}

.channel-category:not(:first-child) {
  position: relative;
  border-top: 0 !important;
}
.channel-category:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 8px;
  top: -7px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, #2b2f36 0 72%, transparent 72% 76%, #242830 76% 100%);
  transform: skewX(-12deg);
  opacity: .72;
}

.content-header {
  background: linear-gradient(100deg, rgba(255,255,255,.018) 0, rgba(255,255,255,0) 44%), #111319 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12) !important;
}
.server-header {
  background: linear-gradient(112deg, rgba(216,75,75,.035) 0, rgba(216,75,75,0) 42%), #17191f !important;
}
.server-header:hover,
.server-header.server-menu-open {
  background: linear-gradient(112deg, rgba(216,75,75,.055) 0, rgba(216,75,75,0) 44%), #1d2026 !important;
}
.server-header-kicker { color: #a7adb7 !important; letter-spacing: .14em !important; font-size: 9px !important; }
#server-title { letter-spacing: -.01em; }
.channel-heading { gap: 10px !important; }
.channel-heading:not(.ui0213-dm-heading) > .channel-symbol {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid #292d35 !important;
  border-radius: 9px !important;
  background: #171a20 !important;
  color: #c9cdd4 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.012) !important;
}
.content-header .channel-heading strong { font-weight: 700 !important; letter-spacing: -.012em !important; }
.content-header .header-actions .icon-button {
  border-radius: 8px !important;
  transition: background-color .13s ease, color .13s ease, transform .1s ease !important;
}
.content-header .header-actions .icon-button:hover { background: #1d2027 !important; color: #f3f4f5 !important; }
.content-header .header-actions .icon-button:active { background: var(--rift-brand-red-soft) !important; color: #ffd9da !important; transform: translateY(1px); }

.server-button::after {
  width: 3px !important;
  background: #7a808a !important;
  clip-path: polygon(0 0, 100% 4px, 100% calc(100% - 4px), 0 100%);
}
.server-button:hover::after { background: #aeb3bb !important; }
.server-button.active::after { background: var(--rift-brand-red) !important; box-shadow: 0 0 10px rgba(216,75,75,.18); }
.channel-item,.dm-item,.home-nav-item { position: relative !important; }
.channel-item.active,.dm-item.active,.home-nav-item.active {
  background: linear-gradient(90deg, rgba(216,75,75,.055), #292c34 14%, #292c34 100%) !important;
  color: #fff !important;
}
.channel-item.active::after,.dm-item.active::after,.home-nav-item.active::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  background: var(--rift-brand-red);
  opacity: .92;
}
.composer:focus-within { border-color: rgba(216,75,75,.42) !important; box-shadow: 0 0 0 1px rgba(216,75,75,.06) !important; }

.channel-item.rift-voice-connected { padding-right: 58px !important; }
.channel-item.rift-voice-connected .channel-symbol-small,
.channel-item.rift-voice-connected .channel-symbol-small svg { color: var(--rift-voice-green) !important; stroke: currentColor !important; }
.channel-item.rift-voice-connected .channel-name { color: #f2f3f5 !important; font-weight: 750 !important; }
.rift-voice-duration {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 40px;
  color: var(--rift-voice-green);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  pointer-events: none;
  transition: opacity .12s ease;
}
.channel-row.rift-voice-connected-row:hover .rift-voice-duration,
.channel-row.rift-voice-connected-row:focus-within .rift-voice-duration { opacity: 0; }

.home-navigation .section-heading,
.r021-friends-main .home-section-title,
.member-panel-heading { position: relative; }
.home-navigation .section-heading::after,
.r021-friends-main .home-section-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, #292d34 0 64%, transparent 64% 69%, #24272e 69% 100%);
}

/* Consolidated former polish rules. These are current layout rules, not another patch script. */
.server-rail { border-right: 1px solid #20232a !important; }
.channel-panel { border-right: 1px solid #272a31 !important; }
.member-panel { border-left: 1px solid #272a31 !important; }
.current-user-panel { border-top: 1px solid #272a31 !important; }
.member-panel-heading { border-bottom: 1px solid #272a31 !important; }
.r021-server-utilities { border-bottom: 1px solid #24272e !important; padding-bottom: 10px !important; margin-bottom: 8px !important; }
.r021-friends-main .home-section-title { border-bottom: 1px solid #292c33 !important; padding-bottom: 9px !important; margin-bottom: 0 !important; }
.r021-friends-main #home-server-grid > .social-row { border-bottom: 1px solid #23262d !important; border-radius: 0 !important; }
.r021-friends-main #home-server-grid > .social-row:last-child { border-bottom-color: transparent !important; }
.composer { border: 1px solid #2b2e36 !important; background: #1a1d23 !important; }
.channel-item,.dm-item,.home-nav-item,.member-item,.social-row { transition: background-color .12s ease,color .12s ease !important; }
.channel-item:hover,.dm-item:hover,.home-nav-item:hover,.member-item:hover,.social-row:hover { background-color: #20232a !important; }
#v2-dm-list { overflow: visible !important; max-height: none !important; }
.dm-list::-webkit-scrollbar { display: none !important; }

.social-actions { gap: 8px !important; }
.social-actions button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 0 !important;
  font-size: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #202329 !important;
  color: #b5bac1 !important;
  transition: background-color .14s ease,color .14s ease,transform .1s ease !important;
}
.social-actions button::before,.social-actions button::after { content: none !important; display: none !important; }
.social-actions button:hover { background: #2a2e36 !important; color: #f2f3f5 !important; }
.social-actions button > svg { position: static !important; display: block !important; width: 18px !important; height: 18px !important; margin: 0 !important; transform: none !important; stroke-width: 2 !important; }
.social-actions button:active { transform: scale(.92); }

#home-button.home-button {
  padding: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border-radius: 50% !important;
  transition: border-radius .18s ease,transform .14s ease !important;
}
#home-button.home-button > .rift-mark { display: none !important; }
#home-button.home-button > .rift-home-logo { display: block !important; width: 100% !important; height: 100% !important; border-radius: inherit !important; transition: transform .18s ease,filter .18s ease !important; }
#home-button.home-button > .rift-home-logo rect { fill: #d84b4b !important; transition: fill .18s ease !important; }
#home-button.home-button:hover,#home-button.home-button.active { background: transparent !important; border-radius: 16px !important; }
#home-button.home-button:hover > .rift-home-logo { transform: scale(1.04) !important; filter: brightness(1.06) !important; }
#home-button.home-button:hover > .rift-home-logo rect { fill: #ef5a5e !important; }
#home-button.home-button:active { transform: scale(.95) !important; }
#home-button.home-button.active > .rift-home-logo rect { fill: #e15356 !important; }

/* Category collapse has one final owner; later flex/grid rules cannot resurrect hidden rows. */
.channel-category.collapsed > .channel-row { display: none !important; }
.channel-category.collapsed .r021-category-label i { transform: rotate(-90deg) !important; }
.r021-category-label { user-select: none !important; cursor: pointer !important; }

/* General settings stay centred; the dedicated profile overlay has its own viewport rules. */
.r021-settings:not(.rift-profile-overlay) { grid-template-columns: minmax(236px,1fr) minmax(600px,760px) minmax(236px,1fr) !important; }
.r021-settings:not(.rift-profile-overlay) .r021-settings-main { width: 100% !important; max-width: 760px !important; justify-self: center !important; }
.r021-settings:not(.rift-profile-overlay) .r021-settings-close { justify-self: start !important; }

@media (max-width:1180px) {
  .r021-settings:not(.rift-profile-overlay) { grid-template-columns: 236px minmax(0,1fr) 84px !important; }
}
@media (max-width:800px) {
  .server-header::after,.content-header::after { left: 8px; width: 20px; }
  .channel-heading:not(.ui0213-dm-heading) > .channel-symbol { width: 28px !important; height: 28px !important; min-width: 28px !important; border-radius: 8px !important; }
  .channel-item.active::after,.dm-item.active::after,.home-nav-item.active::after { top: 6px; bottom: 6px; }
  .channel-item.rift-voice-connected { padding-right: 54px !important; }
  .rift-voice-duration { right: 8px; font-size: 9px; }
  .server-rail { border-right-color: #24272e !important; }
  .channel-panel { border-right-color: #2b2e35 !important; }
}


/* ===== direct messages ===== */
/* Direct-message picker and DM-list polish. */
.rift-new-dm-modal {
  width: min(480px, calc(100vw - 32px)) !important;
  max-width: 480px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #2c3037 !important;
  border-radius: 10px !important;
  background: #111317 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48) !important;
}

.rift-new-dm {
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
  max-height: min(720px, calc(100dvh - 70px));
  color: #f2f3f5;
}

.rift-new-dm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 14px;
}

.rift-new-dm-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.rift-new-dm-head p {
  margin: 5px 0 0;
  color: #949aa4;
  font-size: 13px;
}

.rift-new-dm-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #959ba5;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.rift-new-dm-close:hover { background: #202329; color: #f3f4f5; }

.rift-new-dm-search {
  height: 42px;
  margin: 8px 20px 5px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 1px solid #30343b;
  border-radius: 7px;
  background: #0c0e12;
  padding: 0 10px;
  color: #8c929c;
}

.rift-new-dm-search:focus-within { border-color: #454b55; }
.rift-new-dm-search input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #f2f3f5;
  font-size: 14px;
}
.rift-new-dm-search input::placeholder { color: #777e88; }

.rift-new-dm-hint {
  padding: 0 20px 7px;
  color: #858c97;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.rift-new-dm-list {
  min-height: 180px;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.rift-new-dm-row {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d7d9de;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.rift-new-dm-row:hover,
.rift-new-dm-row.selected { background: #202329; }

.rift-new-dm-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.rift-new-dm-avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border: 3px solid #111317;
  border-radius: 50%;
  background: #80848e;
}
.rift-new-dm-row:hover .rift-new-dm-avatar i,
.rift-new-dm-row.selected .rift-new-dm-avatar i { border-color: #202329; }
.rift-new-dm-avatar i.online,
.rift-new-dm-avatar i.presence-online { background: #23a55a; }
.rift-new-dm-avatar i.idle,
.rift-new-dm-avatar i.presence-idle { background: #f0b232; }
.rift-new-dm-avatar i.dnd,
.rift-new-dm-avatar i.presence-dnd { background: #f23f43; }

.rift-new-dm-copy { min-width: 0; }
.rift-new-dm-copy strong,
.rift-new-dm-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rift-new-dm-copy strong { font-size: 14px; font-weight: 650; }
.rift-new-dm-copy small { margin-top: 2px; color: #7f8792; font-size: 11px; }

.rift-new-dm-check {
  width: 20px;
  height: 20px;
  border: 1px solid #626973;
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.rift-new-dm-row.selected .rift-new-dm-check {
  border-color: #d84b4b;
  background: #d84b4b;
}
.rift-new-dm-row.selected .rift-new-dm-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}

.rift-new-dm-empty {
  padding: 38px 14px;
  color: #8b929d;
  text-align: center;
  font-size: 13px;
}

.rift-new-dm-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  border-top: 1px solid #292d34;
  padding: 14px 20px 18px;
  background: #0e1014;
}
.rift-new-dm-footer button { min-height: 40px; }
.rift-new-dm-footer .primary-button:disabled { opacity: .45; cursor: not-allowed; }

/* Hover-only close affordance for recent DMs. */
#v2-dm-list .dm-item { position: relative !important; padding-right: 34px !important; }
#v2-dm-list .rift-dm-close {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #89909a;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, background-color .12s ease, color .12s ease;
}
#v2-dm-list .dm-item:hover .rift-dm-close,
#v2-dm-list .dm-item:focus-within .rift-dm-close {
  opacity: 1;
  pointer-events: auto;
}
#v2-dm-list .rift-dm-close:hover,
#v2-dm-list .rift-dm-close:focus-visible {
  background: #30343c;
  color: #fff;
  outline: none;
}
#v2-dm-list .dm-item > .unread-dot { right: 29px !important; }
.rift-dm-empty-hidden { padding: 10px 8px !important; }

/* The composer owns its focus treatment; never show the browser's blue textarea outline. */
#message-input:focus,
#message-input:focus-visible,
.composer textarea:focus,
.composer textarea:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

@media (max-width: 800px) {
  .rift-new-dm-modal {
    width: calc(100vw - 16px) !important;
    max-width: none !important;
  }
  .rift-new-dm { max-height: calc(100dvh - 24px); }
  .rift-new-dm-head { padding: 18px 16px 12px; }
  .rift-new-dm-search { margin-left: 16px; margin-right: 16px; }
  .rift-new-dm-hint { padding-left: 16px; padding-right: 16px; }
  .rift-new-dm-footer { padding-left: 16px; padding-right: 16px; }
}


/* ===== navigation view modes ===== */
/* High-level Rift views: stable member profiles, profile editing, Add Friend and modal alignment. */

/* Create Channel is always viewport-centred instead of inheriting a stale desktop offset. */
#modal-backdrop.rift-create-channel-backdrop:not(.hidden) {
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
}
#modal.rift-create-channel-modal {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  margin: 0 !important;
  width: min(440px, calc(100vw - 32px)) !important;
  max-width: 440px !important;
  max-height: calc(100dvh - 40px) !important;
  overflow: auto !important;
}
#modal.rift-create-channel-modal .ui0212-create-channel { width: 100% !important; }

/* Stable profile presentation. This styles the base renderer directly; there is no decorator observer. */
#r021-ref-profile.r021-profile-card.rift-stable-profile {
  width: 340px !important;
  max-width: calc(100vw - 20px) !important;
  border: 1px solid #262930 !important;
  border-radius: 12px !important;
  background: #111318 !important;
  box-shadow: 0 20px 54px rgba(0,0,0,.58) !important;
  overflow: hidden !important;
}
#r021-ref-profile.rift-stable-profile .r021-profile-banner { height: 104px !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-body {
  position: relative !important;
  padding: 54px 14px 15px !important;
  background: #111318 !important;
}
#r021-ref-profile.rift-stable-profile .r021-profile-avatar {
  left: 14px !important;
  top: -49px !important;
  width: 86px !important;
  height: 86px !important;
  border: 6px solid #111318 !important;
  font-size: 22px !important;
}
#r021-ref-profile.rift-stable-profile .r021-profile-presence {
  right: -1px !important;
  bottom: 1px !important;
  width: 21px !important;
  height: 21px !important;
  border: 5px solid #111318 !important;
}
#r021-ref-profile.rift-stable-profile .r021-profile-name { font-size: 20px !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-user { margin-top: 3px !important; font-size: 12px !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-custom {
  margin: 13px 0 2px !important;
  padding: 9px 10px !important;
  border: 1px solid #2c3037 !important;
  border-radius: 9px !important;
  background: #191c21 !important;
  font-size: 12px !important;
}
#r021-ref-profile.rift-stable-profile .r021-profile-section { margin-top: 14px !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-section h4 {
  margin-bottom: 6px !important;
  color: #abb1ba !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  text-transform: uppercase !important;
}
#r021-ref-profile.rift-stable-profile .r021-profile-section p { font-size: 12px !important; line-height: 1.45 !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-role { min-height: 24px !important; border-radius: 6px !important; font-size: 10px !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-actions { gap: 7px !important; }
#r021-ref-profile.rift-stable-profile .r021-profile-actions button svg { width: 18px !important; height: 18px !important; }
#r021-ref-profile.rift-stable-profile:has([data-profile-message]) .r021-profile-actions {
  position: absolute !important;
  top: -91px !important;
  right: 0 !important;
  margin: 0 !important;
}
#r021-ref-profile.rift-stable-profile:has([data-profile-message]) .r021-profile-actions button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid #292c32 !important;
  border-radius: 50% !important;
  background: #111318 !important;
  color: #d9dce0 !important;
  font-size: 0 !important;
}
#r021-ref-profile.rift-stable-profile:has([data-profile-message]) .r021-profile-actions button:hover {
  background: #202329 !important;
  color: #fff !important;
}
#r021-ref-profile.rift-stable-profile [data-profile-edit] {
  width: 100% !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border-radius: 7px !important;
  background: #4f5ce7 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

/* Edit Profile becomes a dedicated profile workspace instead of another cramped settings page. */
.r021-settings.rift-profile-editor-mode {
  grid-template-columns: 242px minmax(0, 1fr) 56px !important;
  background: #090b0f !important;
}
.rift-profile-editor-mode .r021-settings-nav-wrap {
  justify-content: stretch !important;
  background: #0d0f13 !important;
  border-right: 1px solid #262930 !important;
}
.rift-profile-editor-mode .r021-settings-nav {
  width: 100% !important;
  padding: 0 10px 22px !important;
  overflow-y: auto;
}
.rift-profile-editor-nav-head {
  height: 48px;
  margin: 0 -10px 14px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #262930;
  color: #e8eaed;
  font-size: 14px;
}
.rift-profile-editor-block { margin: 0 8px 16px; }
.rift-profile-editor-block > label,
.rift-profile-editor-mode .r021-control-block > label {
  display: block;
  margin-bottom: 7px !important;
  color: #c8ccd2 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.rift-profile-editor-placeholder {
  min-height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid #2c3037;
  border-radius: 8px;
  background: #171a20;
  color: #7e8691;
  text-align: center;
  font-size: 10px;
}
.rift-profile-editor-placeholder small { display: block; margin-top: 2px; color: #626a75; }
.rift-profile-editor-avatar-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rift-profile-editor-avatar-tools > * {
  height: 88px;
  border: 1px solid #2c3037;
  border-radius: 8px;
  background: #171a20;
}
.rift-profile-editor-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 750;
}
.rift-profile-editor-avatar-tools button {
  display: grid;
  place-items: center;
  color: #8c939d;
  background: #171a20 !important;
}
.rift-profile-editor-avatar-tools svg { width: 24px; height: 24px; }
.rift-profile-editor-effects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rift-profile-editor-effects span {
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid #2c3037;
  border-radius: 8px;
  background: #171a20;
  color: #707883;
  font-size: 10px;
}
.rift-profile-editor-mode .r021-profile-controls { gap: 14px !important; margin: 0 8px; }
.rift-profile-editor-mode .r021-control-box { min-height: 52px !important; background: #171a20 !important; }
.rift-profile-editor-mode #r021-save-profile { width: 100%; min-height: 40px; margin-bottom: 10px; }
.rift-profile-editor-mode .r021-settings-main {
  padding: 46px 30px 60px !important;
  overflow: auto !important;
}
.rift-profile-editor-mode .r021-profile-settings-grid,
.rift-profile-editor-mode .rift-profile-editor-grid {
  width: min(900px, 100%) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(320px, 400px) minmax(360px, 1fr) !important;
  gap: 30px !important;
  align-items: start !important;
}
.rift-profile-editor-mode .r021-profile-preview {
  display: block !important;
  position: sticky !important;
  top: 0 !important;
  align-self: start !important;
  min-width: 0 !important;
}
.rift-profile-editor-mode .r021-widget-board {
  display: block !important;
  min-height: 560px !important;
  border-left: 1px solid #262930 !important;
  padding-left: 30px !important;
}
.rift-profile-editor-mode .r021-widget-board h3 { margin-top: 75px !important; font-size: 15px !important; }
.rift-profile-editor-mode .r021-widget-board > p { font-size: 12px !important; max-width: 330px !important; }
.rift-profile-editor-mode .r021-widget-grid { gap: 12px !important; }
.rift-profile-editor-mode .r021-widget { height: 96px !important; border-radius: 8px !important; font-size: 11px !important; }
.rift-profile-editor-mode .r021-settings-close { padding-top: 8px !important; }
.rift-profile-editor-mode .r021-settings-close button {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid #353942 !important;
  border-radius: 8px !important;
  background: #15181d !important;
}
.rift-profile-editor-mode .r021-settings-close small { display: none !important; }

/* Add Friend is a full Friends-page view rather than a modal. */
.r021-friends-shell.rift-add-friend-mode { grid-template-columns: minmax(0, 1fr) !important; }
.r021-friends-shell.rift-add-friend-mode .r021-friends-side { display: none !important; }
.r021-friends-shell.rift-add-friend-mode .r021-friends-main { padding: 18px 28px 40px !important; }
.r021-friends-shell.rift-add-friend-mode #home-server-grid { display: block !important; width: 100% !important; }
.rift-add-friend-view { width: min(900px, 100%); color: #e8eaed; }
.rift-add-friend-view > header h2 { margin: 0 0 5px; font-size: 20px; }
.rift-add-friend-view > header p,
.rift-add-friend-discover p { margin: 0; color: #a6acb5; font-size: 13px; line-height: 1.45; }
.rift-add-friend-form { margin-top: 18px; }
.rift-add-friend-request {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #30343b;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #0d0f13;
}
.rift-add-friend-request input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #f2f3f5;
  font-size: 14px;
}
.rift-add-friend-request button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: #4f5ce7;
  color: #fff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
}
.rift-add-friend-request button:disabled { opacity: .45; cursor: not-allowed; }
.rift-add-friend-note-wrap {
  position: relative;
  min-height: 88px;
  border: 1px solid #30343b;
  border-radius: 0 0 10px 10px;
  background: #0d0f13;
}
.rift-add-friend-note-wrap textarea {
  width: 100%;
  min-height: 86px;
  resize: none;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #e4e7ea;
  padding: 12px 44px 12px 12px;
  font-size: 13px;
}
.rift-add-friend-count { position: absolute; right: 12px; bottom: 10px; color: #868d97; font-size: 11px; }
.rift-add-friend-note-copy { display: block; margin-top: 8px; color: #7f8792; font-size: 11px; }
.rift-add-friend-feedback { min-height: 18px; margin: 8px 0 0; color: #9aa1aa; font-size: 12px; }
.rift-add-friend-discover {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #292d34;
}
.rift-add-friend-discover h3 { margin: 0 0 5px; font-size: 17px; }
.rift-add-friend-discover button {
  width: min(430px, 100%);
  min-height: 48px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #30343b;
  border-radius: 8px;
  background: #0d0f13;
  color: #d8dce1;
  padding: 0 12px;
  text-align: left;
}
.rift-add-friend-discover button:hover { background: #171a20; border-color: #3a3f48; }
.rift-add-friend-discover button svg { width: 22px; height: 22px; color: #36b778; }
.rift-add-friend-discover button b { color: #8c939d; font-size: 22px; }

@media (max-width: 900px) {
  .rift-profile-editor-mode .r021-profile-settings-grid,
  .rift-profile-editor-mode .rift-profile-editor-grid { grid-template-columns: 1fr !important; }
  .rift-profile-editor-mode .r021-widget-board { border-left: 0 !important; border-top: 1px solid #262930 !important; padding: 24px 0 0 !important; }
}
@media (max-width: 800px) {
  #modal-backdrop.rift-create-channel-backdrop:not(.hidden) { padding: 12px !important; }
  #modal.rift-create-channel-modal { width: min(440px, calc(100vw - 24px)) !important; max-height: calc(100dvh - 24px) !important; }
  #r021-ref-profile.r021-profile-card.rift-stable-profile {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
  }
  .r021-settings.rift-profile-editor-mode { grid-template-columns: 1fr !important; overflow-y: auto !important; }
  .rift-profile-editor-mode .r021-settings-nav-wrap { position: static !important; min-height: auto !important; }
  .rift-profile-editor-mode .r021-settings-main { padding: 26px 16px 80px !important; overflow: visible !important; }
  .rift-profile-editor-mode .r021-settings-close { position: fixed !important; right: 10px !important; top: 10px !important; z-index: 2; }
  .r021-friends-shell.rift-add-friend-mode .r021-friends-main { padding: 16px 14px 30px !important; }
  .rift-add-friend-request { grid-template-columns: 1fr; }
  .rift-add-friend-request button { width: 100%; }
}


/* ===== profile popouts ===== */
/* Stable Rift profile popout layout. Pure CSS: no observers or DOM rebuild loops. */
/*
 * The live server profile renderer creates #r021-ref-profile.r021-profile-card.
 * Do not gate this layout behind a runtime decoration class: the popout must be
 * correct on its first paint, before any later UI layer has a chance to sync it.
 */
#r021-ref-profile.r021-profile-card {
  width: 340px !important;
  max-width: calc(100vw - 20px) !important;
  border: 1px solid #24262b !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #111214 !important;
  box-shadow: 0 18px 46px rgba(0,0,0,.58) !important;
  color: #f2f3f5 !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-banner {
  height: 104px !important;
  min-height: 104px !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-body {
  position: relative !important;
  padding: 52px 14px 14px !important;
  background: #111214 !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-avatar {
  position: absolute !important;
  left: 14px !important;
  top: -49px !important;
  width: 86px !important;
  height: 86px !important;
  border: 6px solid #111214 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  overflow: visible !important;
  color: #fff !important;
  font-size: 22px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-avatar > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}

/*
 * This is the only positioning rule for the compact server-profile status.
 * Explicitly reset every inset/flow property so generic presence state rules
 * (notably the legacy offline position:relative rule) cannot pull it into the
 * avatar's grid centre.
 */
#r021-ref-profile.r021-profile-card .r021-profile-avatar > .r021-profile-presence,
#r021-ref-profile.r021-profile-card .r021-profile-avatar > .rift-server-profile-presence {
  --rift-presence-size: 16px !important;
  --rift-presence-border: 3px !important;
  --rift-presence-cutout: #111214 !important;
  position: absolute !important;
  left: auto !important;
  top: auto !important;
  right: -1px !important;
  bottom: 2px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  flex: none !important;
  border: 3px solid #111214 !important;
  border-radius: 50% !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
  transform: none !important;
  margin: 0 !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-name {
  margin: 0 !important;
  color: #f2f3f5 !important;
  font-size: 20px !important;
  line-height: 1.15 !important;
  font-weight: 760 !important;
  letter-spacing: -.015em !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-user {
  margin-top: 3px !important;
  color: #b5bac1 !important;
  font-size: 12px !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-custom {
  position: relative !important;
  margin: 14px 0 2px !important;
  padding: 10px 11px !important;
  border: 1px solid #2d3036 !important;
  border-radius: 10px !important;
  background: #191b1f !important;
  color: #b5bac1 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-section {
  margin-top: 14px !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-section h4 {
  margin: 0 0 6px !important;
  color: #b5bac1 !important;
  font-size: 10px !important;
  font-weight: 760 !important;
  letter-spacing: .02em !important;
  text-transform: uppercase !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-section p {
  margin: 0 !important;
  color: #dbdee1 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-roles {
  display: flex !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-role {
  min-height: 24px !important;
  padding: 3px 7px !important;
  border-radius: 6px !important;
  background: #1e2025 !important;
  color: #d7d9dc !important;
  font-size: 10px !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-role i {
  width: 8px !important;
  height: 8px !important;
}

/* Member actions sit in the banner corner instead of consuming body layout space. */
#r021-ref-profile.r021-profile-card:has([data-profile-message]) .r021-profile-actions {
  position: absolute !important;
  top: -91px !important;
  right: 0 !important;
  z-index: 3 !important;
  display: flex !important;
  gap: 7px !important;
  margin: 0 !important;
}

#r021-ref-profile.r021-profile-card:has([data-profile-message]) .r021-profile-actions button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid #24262b !important;
  border-radius: 50% !important;
  background: #111214 !important;
  color: #dbdee1 !important;
  font-size: 0 !important;
  cursor: pointer !important;
}

#r021-ref-profile.r021-profile-card:has([data-profile-message]) .r021-profile-actions button:hover:not(:disabled) {
  background: #1e2025 !important;
  color: #fff !important;
}

#r021-ref-profile.r021-profile-card .r021-profile-actions svg {
  width: 18px !important;
  height: 18px !important;
}

/* Own profile keeps its edit action in the normal body flow. */
#r021-ref-profile.r021-profile-card [data-profile-edit] {
  width: 100% !important;
  min-height: 40px !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: #4f5ce7 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

@media (max-width: 800px) {
  #r021-ref-profile.r021-profile-card {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }
}


/* ===== presence indicators ===== */
/* Rift 0.2.1 final micro-polish layer. Loaded last on purpose. */
:root{--r23-bg:#0f1115;--r23-panel:#111318;--r23-hover:#23262d;--r23-line:#2a2d34;--r23-text:#f2f3f5;--r23-muted:#949ba4;--r23-red:#f23f43;--r23-green:#23a55a}

/* Keep toast notifications away from the top-right app chrome. */
#toast-region.toast-region{position:fixed!important;left:50%!important;right:auto!important;top:auto!important;bottom:24px!important;transform:translateX(-50%)!important;width:min(420px,calc(100vw - 32px))!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:8px!important;z-index:4000!important;pointer-events:none!important}
#toast-region .toast{max-width:100%!important;margin:0!important;box-shadow:0 12px 36px rgba(0,0,0,.48)!important}

/* Channel rows: selected highlight fills the usable row and actions float over it. */
.channel-category,.channel-row{width:100%!important;box-sizing:border-box!important}.channel-row{position:relative!important;padding:0 8px!important;display:flex!important;align-items:center!important;min-width:0!important}.channel-row>.channel-item{width:100%!important;max-width:none!important;flex:1 1 auto!important;margin:0!important;padding-right:58px!important;box-sizing:border-box!important}.channel-row>.channel-manage,.channel-row>.ui0211-channel-actions{position:absolute!important;right:11px!important;top:50%!important;transform:translateY(-50%)!important;z-index:3!important}.voice-member-row .channel-manage,.voice-member-row .ui0211-channel-actions,.voice-member-row [data-ui0211-invite],.voice-member-row [data-ui0211-edit]{display:none!important}
.voice-member-row{padding-left:34px!important;padding-right:12px!important;min-height:32px!important}.voice-member-row .avatar{width:24px!important;height:24px!important;font-size:10px!important}.voice-member-row .ui0212-voice-state-icons{margin-left:auto!important}

/* Legacy presence declarations retained for compatibility; canonical geometry is at the end of this file. */
.member-avatar-wrap{position:relative!important}.presence-dot{display:block!important;position:absolute!important;right:-1px!important;bottom:-1px!important;width:12px!important;height:12px!important;border:3px solid var(--r23-panel)!important;border-radius:50%!important;background:var(--r23-panel)!important;box-shadow:inset 0 0 0 2px #80848e!important;box-sizing:border-box!important}.presence-dot.online{background:var(--r23-green)!important;box-shadow:none!important}.dm-item .presence-dot{right:0!important;bottom:0!important}.social-row .presence-dot{right:0!important;bottom:0!important}.ui0212-presence{width:14px!important;height:14px!important}.ui0212-dm-avatar .ui0212-presence{width:18px!important;height:18px!important;right:-1px!important;bottom:4px!important;border:4px solid var(--r23-panel)!important}.ui0212-dm-avatar .ui0212-invisible,.ui0212-dm-avatar .ui0212-offline{background:var(--r23-panel)!important}

/* DM header now uses the person's avatar instead of the generic user glyph. */
.channel-heading.ui0213-dm-heading{display:flex!important;align-items:center!important;gap:9px!important}.ui0213-dm-head-avatar{position:relative;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;overflow:visible;flex:0 0 auto;color:#fff;font-size:11px;font-weight:750}.ui0213-dm-head-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}.ui0213-dm-head-avatar .ui0213-head-presence{position:absolute;right:-2px;bottom:-2px;width:10px;height:10px;border-radius:50%;border:3px solid #0f1115;background:#0f1115;box-shadow:inset 0 0 0 2px #80848e;box-sizing:border-box}.ui0213-dm-head-avatar .ui0213-head-presence.online{background:var(--r23-green);box-shadow:none}.channel-heading.ui0213-dm-heading>div{display:flex;flex-direction:column;min-width:0}.channel-heading.ui0213-dm-heading strong{font-size:13px!important}.channel-heading.ui0213-dm-heading span{font-size:9px!important;color:#8f96a0!important}

/* DM profile is a touch wider and denser, closer to the reference proportions. */
.app-shell.parity-dm-profile{grid-template-columns:72px 248px minmax(420px,1fr) 340px!important}.ui0212-dm-profile{width:340px!important;max-width:340px!important}.ui0212-dm-banner{height:106px!important}.ui0212-dm-body{padding:59px 18px 22px!important}.ui0212-dm-avatar{width:94px!important;height:94px!important;top:-52px!important;left:18px!important}.ui0212-dm-body h2{font-size:22px!important}.ui0212-dm-section{margin-top:18px!important;padding-top:15px!important}.ui0212-dm-section h4{font-size:10px!important}.ui0212-dm-section p,.ui0212-dm-note{font-size:11px!important}

/* Voice Connected: compact top row, actions remain alongside the connection label. */
.voice-connection-panel.ui0212-voicebar{min-height:0!important;padding:7px 8px 8px!important;background:#0c0e12!important}.ui0212-vc-top{display:grid!important;grid-template-columns:30px minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;width:100%!important}.ui0212-vc-quality{grid-column:1!important;grid-row:1!important}.ui0212-vc-copy{grid-column:2!important;grid-row:1!important;align-items:flex-start!important;text-align:left!important}.ui0212-vc-top-actions{grid-column:3!important;grid-row:1!important;margin-left:0!important;align-self:center!important}.ui0212-vc-shortcuts{margin-top:6px!important;gap:5px!important}.ui0212-vc-shortcuts button{height:28px!important}.ui0212-vc-copy strong{font-size:12px!important}.ui0212-vc-copy span{font-size:9px!important}

/* Voice page: stop a single participant tile from swallowing the entire content area. */
.ui0212-voice-page.joined{grid-template-rows:44px minmax(0,1fr) auto 68px!important}.ui0212-voice-grid{width:min(900px,calc(100% - 52px))!important;height:min(52vh,470px)!important;min-height:260px!important;justify-self:center!important;align-self:center!important;padding:8px!important;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important;grid-auto-rows:minmax(220px,1fr)!important;align-content:stretch!important;overflow:auto!important}.ui0212-voice-tile{min-height:220px!important;max-height:470px!important}.ui0212-voice-avatar{width:72px!important;height:72px!important}.ui0212-activity-strip{padding:8px 24px 10px!important}.ui0212-activity-cards{gap:7px!important}.ui0212-activity-card{height:52px!important;width:145px!important}.ui0212-callbar{padding:7px 10px!important}.ui0212-call-btn{height:40px!important;width:44px!important}

/* Muted + deafened icons can coexist. */
.ui0213-voice-state-icons{margin-left:auto;display:flex;align-items:center;gap:5px;color:#ff6b70}.ui0213-voice-state-icons span{position:relative;width:17px;height:17px;display:grid;place-items:center}.ui0213-voice-state-icons svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.ui0213-voice-state-icons i{position:absolute;width:19px;height:2px;background:#ff6b70;border-radius:2px;transform:rotate(-45deg)}

/* Message hover toolbar. */
[data-message-id]{position:relative!important}.message-actions{display:none!important}.ui0213-message-toolbar{position:absolute;right:12px;top:-18px;height:34px;display:flex;align-items:center;padding:3px;border:1px solid #2b2f36;border-radius:8px;background:#111318;box-shadow:0 6px 18px rgba(0,0,0,.38);opacity:0;visibility:hidden;transform:translateY(3px);transition:opacity .1s ease,transform .1s ease,visibility .1s;z-index:20}.message:hover>.ui0213-message-toolbar,[data-message-id]:hover>.ui0213-message-toolbar,.ui0213-message-toolbar:focus-within{opacity:1;visibility:visible;transform:none}.ui0213-message-toolbar button{width:30px;height:28px;border:0;border-radius:5px;background:transparent;color:#aeb4bc;display:grid;place-items:center;cursor:pointer;font-size:15px;padding:0}.ui0213-message-toolbar button:hover{background:#24272e;color:#fff}.ui0213-message-toolbar button.emoji{font-size:16px}.ui0213-message-toolbar svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.ui0213-message-toolbar .divider{width:1px;height:20px;background:#2b2f36;margin:0 2px}

/* More-message menu. */
.ui0213-message-menu{position:fixed;z-index:2600;width:230px;padding:7px;border:1px solid #2a2e35;border-radius:8px;background:#111318;box-shadow:0 18px 46px rgba(0,0,0,.58)}.ui0213-message-menu .quick{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-bottom:6px}.ui0213-message-menu .quick button{height:38px;font-size:19px;justify-content:center;padding:0}.ui0213-message-menu .divider{height:1px;background:#2a2e35;margin:6px 0}.ui0213-message-menu>button{width:100%;min-height:34px;border:0;border-radius:4px;background:transparent;color:#d3d6da;display:flex;align-items:center;gap:9px;text-align:left;padding:0 9px;font-size:12px;cursor:pointer}.ui0213-message-menu>button:hover:not(:disabled){background:#5865f2;color:#fff}.ui0213-message-menu>button:disabled{color:#6d747e;cursor:not-allowed}.ui0213-message-menu>button.danger{color:#ff6b70}.ui0213-message-menu>button.danger:hover{background:#da373c;color:#fff}.ui0213-message-menu svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* Server unread / mention affordances. */
.ui0212-server-pip,.parity-server-pip{position:absolute!important;left:-7px!important;top:50%!important;transform:translateY(-50%)!important;width:4px!important;height:8px!important;border-radius:0 4px 4px 0!important;background:#f2f3f5!important}.ui0212-server-badge,.parity-server-badge{position:absolute!important;right:-3px!important;bottom:-3px!important;min-width:18px!important;height:18px!important;padding:0 4px!important;border:3px solid #0b0c0f!important;border-radius:11px!important;background:#f23f43!important;color:#fff!important;font-size:10px!important;font-weight:750!important;display:grid!important;place-items:center!important;box-sizing:content-box!important}.ui0212-server-badge.hidden,.parity-server-badge.hidden{display:none!important}#ui0212-mention-label{height:26px!important;padding:0 9px!important;border-radius:13px!important;background:#f23f43!important;color:#fff!important;display:flex!important;align-items:center!important;font-size:10px!important;font-weight:800!important;box-shadow:0 6px 16px rgba(0,0,0,.35)!important;white-space:nowrap!important}

@media(max-width:1150px){.app-shell.parity-dm-profile{grid-template-columns:72px 240px minmax(360px,1fr) 310px!important}.ui0212-dm-profile{width:310px!important;max-width:310px!important}.ui0212-voice-grid{width:calc(100% - 32px)!important}}

/* --------------------------------------------------------------------------
   Canonical Rift presence system
   --------------------------------------------------------------------------
   Every legacy status element is normalised here. Older files may still create
   these nodes, but this block is the single visual authority for their shape,
   colour and size. Only context-specific size/cutout values vary.
*/
:root{
  --rift-presence-online:#23a55a;
  --rift-presence-idle:#f0b232;
  --rift-presence-dnd:#f23f43;
  --rift-presence-offline:#80848e;
}

html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
){
  --rift-presence-size:12px;
  --rift-presence-border:3px;
  --rift-presence-cutout:#111318;
  display:block!important;
  width:var(--rift-presence-size)!important;
  height:var(--rift-presence-size)!important;
  min-width:var(--rift-presence-size)!important;
  min-height:var(--rift-presence-size)!important;
  flex:0 0 var(--rift-presence-size)!important;
  box-sizing:border-box!important;
  border:var(--rift-presence-border) solid var(--rift-presence-cutout)!important;
  border-radius:50%!important;
  background:var(--rift-presence-cutout)!important;
  box-shadow:inset 0 0 0 2px var(--rift-presence-offline)!important;
  overflow:hidden!important;
  transform:none!important;
  opacity:1!important;
}

html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
)::before,
html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
)::after{
  content:none!important;
}

html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
):is(.online,.presence-online,.parity-online,.ui0212-online,.ui0211-online){
  background:var(--rift-presence-online)!important;
  box-shadow:none!important;
}

html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
):is(.idle,.presence-idle,.parity-idle,.ui0212-idle,.ui0211-idle){
  background:var(--rift-presence-idle)!important;
  box-shadow:none!important;
}
html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
):is(.idle,.presence-idle,.parity-idle,.ui0212-idle,.ui0211-idle)::after{
  content:""!important;
  position:absolute!important;
  width:66%!important;
  height:66%!important;
  right:-10%!important;
  top:-10%!important;
  border-radius:50%!important;
  background:var(--rift-presence-cutout)!important;
}

html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
):is(.dnd,.presence-dnd,.parity-dnd,.ui0212-dnd,.ui0211-dnd){
  background:var(--rift-presence-dnd)!important;
  box-shadow:none!important;
}
html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
):is(.dnd,.presence-dnd,.parity-dnd,.ui0212-dnd,.ui0211-dnd)::after{
  content:""!important;
  position:absolute!important;
  left:18%!important;
  right:18%!important;
  top:50%!important;
  height:2px!important;
  border-radius:2px!important;
  transform:translateY(-50%)!important;
  background:var(--rift-presence-cutout)!important;
}

html body :is(
  .presence-dot,
  .dm-presence-dot,
  .self-presence-dot,
  .ui0213-head-presence,
  .ui0212-presence,
  .ui0211-presence,
  .parity-presence,
  .r021-profile-presence,
  .rift-full-profile-presence,
  .rift-server-profile-presence,
  .r021-status-option>i,
  .r021-profile-custom>i
):is(.offline,.invisible,.presence-offline,.presence-invisible,.parity-offline,.parity-invisible,.ui0212-offline,.ui0212-invisible,.ui0211-offline,.ui0211-invisible){
  background:var(--rift-presence-cutout)!important;
  box-shadow:inset 0 0 0 2px var(--rift-presence-offline)!important;
}

/* Lists and headers: one compact size everywhere. */
html body .member-avatar-wrap>.presence-dot,
html body .social-row .member-avatar-wrap>.presence-dot,
html body .dm-avatar-wrap>.dm-presence-dot,
html body .ui0213-dm-head-avatar>.ui0213-head-presence{
  --rift-presence-size:13px;
  --rift-presence-border:3px;
  --rift-presence-cutout:#17191f;
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:-2px!important;
  bottom:-2px!important;
}
html body .ui0213-dm-head-avatar>.ui0213-head-presence{
  --rift-presence-cutout:#101218;
}

/* Current user dock. */
html body .current-user-panel>.self-presence-dot{
  --rift-presence-size:13px;
  --rift-presence-border:3px;
  --rift-presence-cutout:#0b0d10;
  position:absolute!important;
  left:32px!important;
  right:auto!important;
  top:auto!important;
  bottom:9px!important;
}

/* DM/self profile avatars. */
html body .ui0212-dm-avatar>.ui0212-presence,
html body .parity-dm-avatar>.parity-presence,
html body .parity-self-avatar>.parity-presence,
html body .ui0212-self-avatar>.ui0212-presence{
  --rift-presence-size:18px;
  --rift-presence-border:4px;
  --rift-presence-cutout:#111318;
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:0!important;
  bottom:3px!important;
}

/* Compact server profile: deliberately smaller than the old target-like ring. */
html body #r021-ref-profile.rift-stable-profile .r021-profile-avatar>.r021-profile-presence,
html body #r021-ref-profile.rift-stable-profile .r021-profile-avatar>.rift-server-profile-presence{
  --rift-presence-size:16px;
  --rift-presence-border:3px;
  --rift-presence-cutout:#111214;
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:-1px!important;
  bottom:2px!important;
  z-index:3!important;
}

/* Full profile overlay. */
html body .rift-full-profile .rift-full-profile-avatar>.rift-full-profile-presence{
  --rift-presence-size:20px;
  --rift-presence-border:4px;
  --rift-presence-cutout:#0e1014;
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:1px!important;
  bottom:4px!important;
  z-index:3!important;
}

/* Status menus / inline custom status markers don't need an avatar cutout border. */
html body .r021-status-option>i,
html body .r021-profile-custom>i,
html body .parity-status-item>.parity-presence{
  --rift-presence-size:12px;
  --rift-presence-border:0px;
  --rift-presence-cutout:#111318;
  position:relative!important;
  inset:auto!important;
}


/* ===== profile and contextual surfaces ===== */
/* Rift profile overlays, full profiles, DM relationship controls and server context surfaces. */

.r021-friends-shell.rift-add-friend-mode,
.r021-friends-shell.rift-add-friend-mode .r021-friends-main,
.r021-friends-shell.rift-add-friend-mode #home-server-grid,
.rift-add-friend-view,
.rift-add-friend-form,
.rift-add-friend-discover{width:100%!important;max-width:none!important}
.r021-friends-shell.rift-add-friend-mode .r021-friends-main{padding:22px 30px 42px!important}
.rift-add-friend-view{min-height:100%!important}.rift-add-friend-discover button{width:100%!important;max-width:none!important}

#r021-settings.rift-profile-overlay{position:fixed!important;inset:0!important;z-index:26000!important;width:100vw!important;max-width:none!important;height:100dvh!important;margin:0!important;padding:0!important;display:block!important;overflow:hidden!important;transform:none!important;background:rgba(3,4,6,.78)!important;backdrop-filter:blur(2px)}
#r021-settings.rift-profile-overlay>.rift-profile-overlay-card{position:fixed!important;left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important;width:min(1120px,calc(100vw - 72px))!important;max-width:1120px!important;height:min(760px,calc(100dvh - 72px))!important;max-height:760px!important;min-height:540px!important;margin:0!important;display:grid!important;grid-template-columns:242px minmax(0,1fr) 56px!important;overflow:hidden!important;box-sizing:border-box!important;border:1px solid #2c3037!important;border-radius:14px!important;background:#090b0f!important;box-shadow:0 30px 90px rgba(0,0,0,.72)!important}
.rift-profile-overlay .r021-settings-nav-wrap{min-width:0!important;justify-content:stretch!important;border-right:1px solid #252930!important}.rift-profile-overlay .r021-settings-main{width:100%!important;max-width:none!important;min-width:0!important;padding:34px 28px 56px!important}.rift-profile-overlay .r021-settings-close-wrap,.rift-profile-overlay .r021-settings-close{position:relative!important;z-index:2!important}

#r021-ref-profile.rift-stable-profile .r021-profile-avatar{cursor:pointer!important}#r021-ref-profile.rift-stable-profile .r021-profile-avatar:hover{filter:brightness(1.06)}
#r021-ref-profile.rift-stable-profile .r021-profile-presence.rift-server-profile-presence{position:absolute!important;right:0!important;bottom:3px!important;width:15px!important;height:15px!important;border:3px solid #111214!important;border-radius:50%!important;box-sizing:border-box!important;overflow:hidden!important;background:#80848e!important;box-shadow:none!important}
#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-online{background:#23a55a!important;box-shadow:none!important}#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-idle{background:#f0b232!important}#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-dnd{background:#f23f43!important}#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-offline,#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-invisible{background:#111214!important;box-shadow:inset 0 0 0 2px #80848e!important}
#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-idle::after{width:9px!important;height:9px!important;right:-2px!important;top:-2px!important;background:#111214!important}#r021-ref-profile.rift-stable-profile .rift-server-profile-presence.presence-dnd::after{left:2px!important;right:2px!important;top:50%!important;height:2px!important;background:#111214!important}

.parity-dm-side.rift-dm-enhanced{position:relative!important}.parity-dm-side.rift-dm-enhanced .parity-dm-side-body{position:relative!important}.parity-dm-side.rift-dm-enhanced [data-dm-profile-message]{display:none!important}.rift-dm-profile-top-actions{position:absolute!important;top:16px!important;right:14px!important;z-index:8!important;display:flex!important;align-items:center!important;gap:7px!important}.rift-dm-profile-top-actions button{width:36px!important;height:36px!important;min-width:36px!important;margin:0!important;padding:0!important;display:grid!important;place-items:center!important;border:1px solid #2a2e35!important;border-radius:50%!important;background:#171a20!important;color:#d5d9df!important;cursor:pointer!important}.rift-dm-profile-top-actions button:hover:not(:disabled){background:#24282f!important;color:#fff!important}.rift-dm-profile-top-actions button:disabled{cursor:default!important;opacity:.88!important}.rift-dm-profile-top-actions button.incoming{color:#48c77b!important}.rift-dm-profile-top-actions button.pending{color:#d8a842!important}.rift-dm-profile-top-actions button.friend{color:#b7bdc6!important}.rift-dm-profile-top-actions svg{width:18px!important;height:18px!important}
.rift-dm-request-card{margin-top:14px;padding:11px;border:1px solid #2c3037;border-radius:8px;background:#181b20;color:#cfd3d9;font-size:11px;line-height:1.4}.rift-dm-request-card>span{display:block}.rift-dm-request-card>div{display:flex;gap:7px;margin-top:9px}.rift-dm-request-card button{height:31px!important;margin:0!important;padding:0 11px!important;border-radius:5px!important;background:#5865f2!important;color:#fff!important}.rift-dm-request-card button:last-child{background:#24272d!important;color:#d7d9dd!important}
.parity-dm-side .rift-dm-profile-body{display:flex!important;flex-direction:column!important;min-height:calc(100% - 106px)!important;box-sizing:border-box!important}.parity-dm-side .rift-dm-view-full{width:100%!important;height:40px!important;flex:0 0 40px!important;margin:auto 0 0!important;display:flex!important;align-items:center!important;justify-content:center!important;border:1px solid #343840!important;border-radius:7px!important;background:#1b1e24!important;color:#e1e4e8!important;font-size:12px!important;font-weight:650!important;cursor:pointer!important}.parity-dm-side .rift-dm-view-full:hover{background:#24282f!important;border-color:#454a54!important}

.rift-full-profile-backdrop{position:fixed;inset:0;z-index:27000;display:grid;place-items:center;padding:24px;background:rgba(2,3,5,.79);backdrop-filter:blur(2px)}.rift-full-profile{position:relative;width:min(960px,calc(100vw - 48px));height:min(640px,calc(100dvh - 48px));min-height:500px;display:grid;grid-template-columns:360px minmax(0,1fr);overflow:hidden;border:1px solid #2b2f36;border-radius:14px;background:#0b0d11;box-shadow:0 30px 90px rgba(0,0,0,.72);color:#f2f3f5}.rift-full-profile-close{position:absolute;top:10px;right:10px;z-index:5;width:34px;height:34px;display:grid;place-items:center;border:1px solid #353942;border-radius:8px;background:#15181d;color:#b5bac1;cursor:pointer}.rift-full-profile-close:hover{background:#20242b;color:#fff}.rift-full-profile-close svg{width:18px;height:18px}.rift-full-profile-summary{min-width:0;overflow-y:auto;border-right:1px solid #252930;background:#0e1014}.rift-full-profile-banner{height:118px}.rift-full-profile-summary-body{position:relative;padding:62px 30px 34px}.rift-full-profile-avatar{position:absolute;top:-63px;left:30px;width:106px;height:106px;display:grid;place-items:center;border:7px solid #0e1014;border-radius:50%;color:#fff;font-size:26px;font-weight:750}.rift-full-profile-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.rift-full-profile-presence{position:absolute;right:1px;bottom:4px;width:19px;height:19px;border:4px solid #0e1014;border-radius:50%;box-sizing:border-box;background:#80848e;box-shadow:none}.rift-full-profile-presence.presence-online{background:#23a55a}.rift-full-profile-presence.presence-idle{background:#f0b232}.rift-full-profile-presence.presence-dnd{background:#f23f43}.rift-full-profile-presence.presence-offline,.rift-full-profile-presence.presence-invisible{background:#0e1014;box-shadow:inset 0 0 0 2px #80848e}.rift-full-profile-summary h2{margin:0;font-size:21px;line-height:1.15}.rift-full-profile-username{margin-top:4px;color:#b5bac1;font-size:12px}.rift-full-profile-actions{display:flex;gap:7px;margin-top:18px}.rift-full-profile-actions button{height:36px;border:0;border-radius:6px;font-weight:700}.rift-full-profile-actions .primary{padding:0 13px;display:flex;align-items:center;gap:7px;background:#5865f2;color:#fff}.rift-full-profile-actions .primary.pending{opacity:.66}.rift-full-profile-actions .icon{width:36px;display:grid;place-items:center;background:#1c1f24;color:#aeb4bd}.rift-full-profile-actions svg{width:17px;height:17px}.rift-full-profile-request{margin-top:16px;padding:11px;border-radius:8px;background:#181b20;color:#cfd3d9;font-size:11px}.rift-full-profile-request>div{display:flex;gap:7px;margin-top:9px}.rift-full-profile-request button{height:30px;padding:0 10px;border:0;border-radius:5px;background:#5865f2;color:#fff}.rift-full-profile-request button:last-child{background:#24272d}.rift-full-profile-summary section{margin-top:22px}.rift-full-profile-summary section h4{margin:0 0 7px;color:#9ca3ad;font-size:10px;font-weight:760;text-transform:uppercase}.rift-full-profile-summary section h4 small{color:#707782;font-size:9px;font-weight:500;text-transform:none}.rift-full-profile-summary section p{margin:3px 0;color:#d8dbe0;font-size:12px;line-height:1.45}.rift-full-profile-roles{display:flex;flex-wrap:wrap;gap:6px}.rift-full-profile-roles span{min-height:25px;padding:3px 8px;display:inline-flex;align-items:center;gap:6px;border:1px solid #30343b;border-radius:6px;background:#181b20;color:#d6d9de;font-size:10px}.rift-full-profile-roles i{width:8px;height:8px;border-radius:50%;background:#8f97a2}.rift-full-profile-note button{border:0;background:transparent;color:#777f8a;padding:0;font-size:11px}.rift-full-profile-detail{min-width:0;display:grid;grid-template-rows:56px minmax(0,1fr);background:#090b0f}.rift-full-profile-tabs{height:56px;display:flex;align-items:end;gap:22px;padding:0 28px;border-bottom:1px solid #272b32;overflow-x:auto}.rift-full-profile-tabs button{height:42px;border:0;border-bottom:2px solid transparent;background:transparent;color:#9299a3;font-size:12px;white-space:nowrap}.rift-full-profile-tabs button.active{border-bottom-color:#f2f3f5;color:#f2f3f5;font-weight:700}.rift-full-profile-tabs button:disabled{opacity:.65}.rift-full-profile-empty{min-width:0;display:grid;place-content:center;justify-items:center;gap:8px;padding:40px;text-align:center}.rift-full-profile-empty strong{max-width:420px;font-size:15px;line-height:1.35}.rift-full-profile-empty>span{color:#9aa1ab;font-size:11px}.rift-full-profile-empty button{height:34px;margin-top:8px;padding:0 12px;display:inline-flex;align-items:center;gap:7px;border:1px solid #30343b;border-radius:6px;background:#171a20;color:#e0e3e7}.rift-full-profile-empty button:hover{background:#20242b}.rift-full-profile-empty button svg{width:16px;height:16px}
.rift-server-space-menu{z-index:24500!important}

/* Give DM identity content enough breathing room in the top bar. */
.channel-heading.ui0213-dm-heading{gap:12px!important;min-width:180px!important}
.channel-heading.ui0213-dm-heading>.ui0213-dm-head-avatar{width:36px!important;height:36px!important;flex:0 0 36px!important;font-size:12px!important}
.channel-heading.ui0213-dm-heading>div{gap:2px!important;justify-content:center!important}
.channel-heading.ui0213-dm-heading strong{font-size:15px!important;line-height:1.15!important}
.channel-heading.ui0213-dm-heading #channel-topic{font-size:11px!important;line-height:1.15!important}
.ui0213-message-menu{max-height:calc(100dvh - 16px)!important;overflow-y:auto!important}
.ui0213-message-menu .quick button{border:0!important;border-radius:6px!important;background:#2b2e35!important;color:#fff!important;box-shadow:none!important;appearance:none!important}.ui0213-message-menu .quick button:hover{background:#353942!important}
.r021-category-label{gap:0!important;align-items:center!important}.r021-category-label i{display:block!important;width:8px!important;height:8px!important;flex:0 0 8px!important;margin:0 7px 2px 1px!important;border-right:1.5px solid currentColor!important;border-bottom:1.5px solid currentColor!important;font-size:0!important;line-height:0!important;transform:rotate(45deg)!important;transform-origin:center!important}.channel-category.collapsed .r021-category-label i{transform:rotate(-45deg)!important;margin-bottom:0!important}

@media(max-width:900px){#r021-settings.rift-profile-overlay>.rift-profile-overlay-card{left:10px!important;top:10px!important;transform:none!important;width:calc(100vw - 20px)!important;max-width:none!important;height:calc(100dvh - 20px)!important;max-height:none!important;min-height:0!important;display:block!important;overflow-y:auto!important}.rift-profile-overlay .r021-settings-nav-wrap,.rift-profile-overlay .r021-settings-main{width:100%!important;max-width:none!important}.rift-profile-overlay .r021-settings-close-wrap,.rift-profile-overlay .r021-settings-close{position:absolute!important;top:8px!important;right:8px!important}.rift-full-profile-backdrop{padding:10px}.rift-full-profile{width:calc(100vw - 20px);height:calc(100dvh - 20px);min-height:0;grid-template-columns:1fr;grid-template-rows:auto minmax(260px,1fr);overflow-y:auto}.rift-full-profile-summary{overflow:visible;border-right:0;border-bottom:1px solid #252930}.rift-full-profile-detail{min-height:320px}}
@media(max-width:800px){.r021-friends-shell.rift-add-friend-mode .r021-friends-main{padding:16px 14px 30px!important}.rift-add-friend-request{grid-template-columns:1fr!important}.rift-add-friend-request button{width:100%!important}}

/* Profile placement invariants. These load after the shared presence system so a
   status state can never move its indicator into the centre of an avatar. */
html body #r021-ref-profile.r021-profile-card .r021-profile-avatar{
  position:absolute!important;
  overflow:visible!important;
  cursor:pointer!important;
}
html body #r021-ref-profile.r021-profile-card .r021-profile-avatar>.r021-profile-presence,
html body #r021-ref-profile.r021-profile-card .r021-profile-avatar>.rift-server-profile-presence{
  --rift-presence-size:16px!important;
  --rift-presence-border:3px!important;
  --rift-presence-cutout:#111214!important;
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:-1px!important;
  bottom:2px!important;
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  min-height:16px!important;
  margin:0!important;
  flex:none!important;
  transform:none!important;
  z-index:6!important;
}
html body .ui0212-self-card .ui0212-self-avatar{
  position:absolute!important;
  overflow:visible!important;
}
html body .ui0212-self-card .ui0212-self-avatar>.ui0212-presence{
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:0!important;
  bottom:3px!important;
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  min-height:18px!important;
  margin:0!important;
  flex:none!important;
  transform:none!important;
  z-index:6!important;
}
html body .ui0212-dm-profile .ui0212-dm-avatar{
  position:absolute!important;
  overflow:visible!important;
}
html body .ui0212-dm-profile .ui0212-dm-avatar>.ui0212-presence{
  position:absolute!important;
  left:auto!important;
  top:auto!important;
  right:0!important;
  bottom:4px!important;
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  min-height:18px!important;
  margin:0!important;
  flex:none!important;
  transform:none!important;
  z-index:6!important;
}

/* ===== shared responsive corrections ===== */
.r021-friends-main { width: 100% !important; max-width: none !important; }
.r021-friends-main #home-server-grid { display: block !important; width: 100% !important; max-width: none !important; grid-template-columns: none !important; }
.r021-friends-main #home-server-grid > .social-row,
.r021-friends-main #home-server-grid > .home-section-title,
.r021-friends-main #home-server-grid > .empty-state { width: 100% !important; max-width: none !important; }
.content-header .r021-home-tabs.active { display: flex !important; flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; gap: 4px !important; overflow-x: auto !important; scrollbar-width: none; }
.content-header .r021-home-tabs.active .r021-home-title { flex: 0 0 auto !important; }
.content-header .r021-home-tabs.active .r021-home-tab { flex: 0 0 auto !important; min-width: max-content !important; justify-content: initial !important; text-align: left !important; }
.current-user-panel { position: relative !important; }
.current-user-panel > #r021-self-dot.self-presence-dot { position: absolute !important; left: 31px !important; right: auto !important; top: auto !important; bottom: 8px !important; margin: 0 !important; z-index: 6 !important; grid-column: auto !important; grid-row: auto !important; transform: none !important; }
@media (max-width: 800px) {
  .content-header .r021-home-tabs.active { overflow-x: auto !important; overflow-y: hidden !important; }
  .content-header .r021-home-tabs.active .r021-home-tab { padding-left: 10px !important; padding-right: 10px !important; }
  .parity-server-menu[data-anchor="header"] { position: fixed !important; left: 80px !important; right: 12px !important; top: 58px !important; width: auto !important; max-width: none !important; max-height: calc(100dvh - 70px) !important; overflow: auto !important; z-index: 280 !important; }
  #v2-dm-list, .dm-list { width: 100% !important; min-width: 0 !important; overflow-x: hidden !important; }
  .dm-item { width: 100% !important; min-width: 0 !important; grid-template-columns: 38px minmax(0, 1fr) auto !important; }
  .dm-item-copy { display: flex !important; flex-direction: column !important; min-width: 0 !important; }
  .dm-item-copy strong, .dm-item-copy span { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
  .app-shell.parity-dm-profile #member-toggle { display: grid !important; }
}

/* Touch parity for actions that are hover-only on desktop. */
.rift-message-profile-trigger { cursor: pointer !important; transition: filter .12s ease, transform .12s ease; }
.rift-message-profile-trigger:hover { filter: brightness(1.1); }
.rift-message-profile-trigger:active { transform: scale(.96); }
.rift-message-profile-trigger:focus-visible { outline: 2px solid #5865f2; outline-offset: 2px; }
.rift-category-more { display: none; margin-left: auto; }
@media (hover: none), (pointer: coarse), (max-width: 800px) {
  .rift-category-more {
    display: grid !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #aeb4bd;
    letter-spacing: 1px;
  }
  .channel-row > .channel-manage { opacity: 1 !important; min-width: 36px !important; min-height: 36px !important; }
  [data-message-id] { padding-right: 48px !important; }
  .ui0213-message-toolbar {
    top: 4px !important;
    right: 5px !important;
    height: 36px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .ui0213-message-toolbar > button:not([data-r23-more]),
  .ui0213-message-toolbar > .divider { display: none !important; }
  .ui0213-message-toolbar [data-r23-more] { width: 36px !important; height: 32px !important; }
}

/* ===== account settings overlay ===== */
body.rift-settings-open { overflow: hidden !important; }
#r021-settings.rift-settings-overlay,
#r021-settings.rift-settings-overlay.rift-profile-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 26000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 5px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  place-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background: rgba(2, 3, 5, .76) !important;
  backdrop-filter: blur(3px);
  animation: rift-settings-backdrop-in .14s ease-out;
}
@keyframes rift-settings-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
#r021-settings.rift-settings-overlay > .rift-settings-card,
#r021-settings.rift-settings-overlay > .rift-settings-card.rift-profile-overlay-card {
  --rift-settings-sidebar: 268px;
  --rift-settings-gutter: clamp(28px, 5vw, 96px);
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  width: min(1280px, calc(100vw - 48px)) !important;
  max-width: 1280px !important;
  height: min(820px, calc(100dvh - 48px)) !important;
  max-height: 820px !important;
  min-height: 520px !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: var(--rift-settings-sidebar) minmax(0, 1fr) !important;
  grid-template-rows: 50px minmax(0, 1fr) !important;
  grid-template-areas: "title title" "nav main" !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  border: 1px solid #292d34 !important;
  border-radius: 10px !important;
  background: var(--bg-0) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72) !important;
  animation: rift-settings-card-in .16s ease-out;
}
@keyframes rift-settings-card-in { from { opacity: .55; transform: scale(.992) translateY(3px); } to { opacity: 1; transform: none; } }
.rift-settings-titlebar {
  grid-area: title;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--rift-settings-sidebar) minmax(0, 1fr) 52px;
  align-items: center;
  border-bottom: 1px solid #22252b;
  background: var(--bg-0);
}
.rift-settings-titlebar > strong {
  grid-column: 2;
  position: relative;
  width: min(780px, calc(100% - 56px));
  justify-self: center;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
}
.rift-settings-titlebar > strong::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(216, 75, 75, .55);
}
.rift-settings-titlebar .r021-settings-close {
  grid-column: 3;
  position: static !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #9299a3 !important;
  cursor: pointer;
}
.rift-settings-titlebar .r021-settings-close:hover { background: var(--accent-soft) !important; color: var(--accent-hover) !important; }
.rift-settings-titlebar .r021-settings-close svg { width: 20px; height: 20px; }
.rift-settings-overlay .r021-settings-nav-wrap {
  grid-area: nav;
  min-width: 0;
  display: block !important;
  overflow: hidden auto !important;
  border-right: 1px solid #22252b !important;
  background: var(--bg-1) !important;
}
.rift-settings-overlay .r021-settings-nav {
  width: 100% !important;
  min-width: 0 !important;
  padding: 16px 14px 28px !important;
  display: block !important;
  box-sizing: border-box;
}
.rift-settings-profile {
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 4px 14px;
}
.rift-settings-profile-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 0 0 3px var(--bg-1), 0 0 0 4px rgba(216, 75, 75, .32);
}
.rift-settings-profile strong { display: block; overflow: hidden; color: #eff1f3; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.rift-settings-profile button { width: auto !important; min-height: 22px !important; padding: 0 !important; color: #8e95a0 !important; font-size: 11px !important; }
.rift-settings-profile button:hover { background: transparent !important; color: #cbd0d6 !important; }
.rift-settings-search {
  height: 40px;
  margin-bottom: 12px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #30343b;
  border-radius: 7px;
  background: var(--bg-0);
  color: #a0a7b1;
}
.rift-settings-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rift-settings-search svg { width: 17px; height: 17px; }
.rift-settings-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #e5e7ea; font-size: 13px; }
.rift-settings-search input::placeholder { color: #7e858f; }
.rift-settings-overlay .r021-settings-group { margin: 0 0 12px !important; }
.rift-settings-overlay .r021-settings-label { padding: 11px 9px 6px !important; color: #6f7681 !important; font-size: 10px !important; }
.rift-settings-overlay .r021-settings-nav button[data-settings-tab],
.rift-settings-overlay .r021-settings-nav button[data-settings-logout] {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 0 9px !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  border-radius: 6px !important;
  color: #979ea8 !important;
  font-size: 13px !important;
}
.rift-settings-overlay .r021-settings-nav button[data-settings-tab] svg,
.rift-settings-overlay .r021-settings-nav button[data-settings-logout] svg { width: 18px; height: 18px; flex: 0 0 18px; }
.rift-settings-overlay .r021-settings-nav button[data-settings-tab]:hover { background: var(--bg-3) !important; color: var(--text) !important; }
.rift-settings-overlay .r021-settings-nav button[data-settings-tab].active { background: var(--accent-soft) !important; color: var(--text) !important; font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.rift-settings-overlay .r021-settings-nav button[data-settings-tab].active svg { color: var(--accent-hover); }
.rift-settings-overlay .r021-settings-nav button[data-settings-logout] { color: #ef6a70 !important; }
.rift-settings-subnav { margin: 2px 0 5px 18px; padding-left: 15px; border-left: 2px solid rgba(216, 75, 75, .35); }
.rift-settings-subnav button { width: 100% !important; min-height: 35px !important; padding: 0 8px !important; border: 0; background: transparent; color: #858c96; text-align: left; font-size: 12px; cursor: pointer; }
.rift-settings-subnav button:first-child { color: var(--accent-hover); }
.rift-settings-subnav button:hover { color: #fff; }
.rift-settings-overlay .r021-settings-main {
  grid-area: main;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 54px var(--rift-settings-gutter) 80px !important;
  justify-self: stretch !important;
  overflow: hidden auto !important;
  box-sizing: border-box;
  background: var(--bg-0);
  scrollbar-color: #585b63 transparent;
}
.rift-settings-overlay .r021-settings-main > * { width: min(780px, 100%); margin-left: auto; margin-right: auto; }
.rift-account-page { width: min(780px, 100%); margin: 0 auto; }
.rift-account-section { scroll-margin-top: 30px; padding: 0 0 34px; margin: 0 0 34px; border-bottom: 1px solid #272a30; }
.rift-account-section:last-child { margin-bottom: 0; }
.rift-account-section h1,
.rift-account-section h2 { margin: 0 0 24px !important; color: #dadde1; font-size: 23px !important; line-height: 1.2; font-weight: 500; }
.rift-account-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(180px, 1fr) 100px;
  align-items: center;
  gap: 18px;
}
.rift-account-row > span { color: #d0d3d8; font-size: 14px; }
.rift-account-row > strong { overflow: hidden; color: #c5c9cf; font-size: 14px; font-weight: 500; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.rift-account-row > button {
  width: 100px;
  height: 40px;
  border: 1px solid #34373d;
  border-radius: 8px;
  background: #151619;
  color: #d8dbe0;
  font-size: 14px;
  cursor: pointer;
}
.rift-account-row > button:not(:disabled) { border-color: rgba(216, 75, 75, .42); }
.rift-account-row > button:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.rift-account-row > button:disabled { opacity: .78; cursor: default; }
.rift-account-link,
.rift-standing-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 13px;
}
.rift-account-link > div strong,
.rift-standing-row > div strong { display: block; color: #d8dbe0; font-size: 14px; font-weight: 500; }
.rift-account-link > div span,
.rift-standing-row > div span { display: block; margin-top: 4px; color: #848b95; font-size: 12px; line-height: 1.4; }
.rift-account-link > b { color: #cbd0d6; font-size: 13px; font-weight: 500; white-space: nowrap; }
.rift-account-link > svg,
.rift-standing-row > svg { width: 20px; height: 20px; color: #9299a3; }
.rift-standing-row { grid-template-columns: 44px minmax(0, 1fr) 22px; }
.rift-standing-row > i { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #062117; color: #43c982; font-size: 22px; font-style: normal; }

@media (max-width: 760px) {
  #r021-settings.rift-settings-overlay,
  #r021-settings.rift-settings-overlay.rift-profile-overlay { padding: 0 !important; }
  #r021-settings.rift-settings-overlay > .rift-settings-card,
  #r021-settings.rift-settings-overlay > .rift-settings-card.rift-profile-overlay-card {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 50px auto minmax(0, 1fr) !important;
    grid-template-areas: "title" "nav" "main" !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  .rift-settings-titlebar { grid-template-columns: minmax(0, 1fr) 50px; }
  .rift-settings-titlebar > strong { grid-column: 1; padding-left: 16px; }
  .rift-settings-titlebar .r021-settings-close { grid-column: 2; }
  .rift-settings-overlay .r021-settings-nav-wrap { overflow: hidden !important; border-right: 0 !important; border-bottom: 1px solid #24272d !important; }
  .rift-settings-overlay .r021-settings-nav {
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px !important;
    display: flex !important;
    gap: 5px;
    overflow-x: auto;
  }
  .rift-settings-profile,
  .rift-settings-overlay .r021-settings-label,
  .rift-settings-subnav { display: none !important; }
  .rift-settings-search { min-width: 150px; width: 150px; flex: 0 0 150px; margin: 0; }
  .rift-settings-overlay .r021-settings-group { display: contents !important; }
  .rift-settings-overlay .r021-settings-nav button[data-settings-tab],
  .rift-settings-overlay .r021-settings-nav button[data-settings-logout] { width: auto !important; min-width: max-content !important; padding: 0 11px !important; }
  .rift-settings-overlay .r021-settings-main { padding: 28px 16px max(42px, env(safe-area-inset-bottom)) !important; }
  .rift-account-row { min-height: 82px; grid-template-columns: minmax(0, 1fr) 74px; gap: 8px 12px; }
  .rift-account-row > span { grid-column: 1; align-self: end; font-size: 13px; }
  .rift-account-row > strong { grid-column: 1; align-self: start; text-align: left; font-size: 13px; }
  .rift-account-row > button { grid-column: 2; grid-row: 1 / 3; width: 74px; }
  .rift-account-link { grid-template-columns: minmax(0, 1fr) 20px; }
  .rift-account-link > b { display: none; }
  .rift-account-section h1,
  .rift-account-section h2 { font-size: 21px !important; }
}

/* ===== empty text channels ===== */
.message-list > .rift-empty-channel {
  width: 100%;
  min-height: 100%;
  padding: 42px 22px 26px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  box-sizing: border-box;
}
.rift-empty-channel-icon {
  width: 66px;
  height: 66px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-soft);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
}
.rift-empty-channel h2 { margin: 0 0 7px !important; color: var(--text); font-size: 28px !important; line-height: 1.15; letter-spacing: -.025em; }
.rift-empty-channel > p { margin: 0 !important; color: var(--text-soft) !important; font-size: 14px !important; }
.rift-empty-channel > p strong { color: var(--text); font-weight: 650; }
.rift-empty-channel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rift-empty-channel-actions button {
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--bg-3);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.rift-empty-channel-actions button:hover { border-color: rgba(216,75,75,.42); background: var(--accent-soft); color: var(--text); }
.rift-empty-channel-actions svg { width: 17px; height: 17px; }
.rift-empty-channel-access { min-height: 32px; margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rift-empty-channel-avatar { width: 28px; height: 28px; margin-right: 2px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 750; }
.rift-empty-role { height: 26px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 7px; background: rgba(9,10,13,.75); color: var(--text-soft); font-size: 11px; }
.rift-empty-role i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }

/* Friends pages keep their activity rail on desktop, including Add Friend. */
@media (min-width: 901px) {
  #app .r021-friends-shell,
  #app .r021-friends-shell.rift-add-friend-mode { display: grid !important; grid-template-columns: minmax(0, 1fr) 310px !important; }
  #app .r021-friends-shell .r021-friends-side,
  #app .r021-friends-shell.rift-add-friend-mode .r021-friends-side { display: block !important; }
}
@media (max-width: 900px) {
  #app .r021-friends-shell { grid-template-columns: minmax(0, 1fr) !important; }
  #app .r021-friends-side { display: none !important; }
}
@media (max-width: 620px) {
  .message-list > .rift-empty-channel { padding: 30px 14px 20px !important; }
  .rift-empty-channel-icon { width: 56px; height: 56px; font-size: 34px; }
  .rift-empty-channel h2 { font-size: 23px !important; }
  .rift-empty-channel-actions button { min-height: 38px; height: auto; }
}

/* Holding Shift swaps the hovered message toolbar for its full action strip. */
.ui0213-message-toolbar .rift-toolbar-shift { display: none !important; }
html.rift-message-shift .message:hover > .ui0213-message-toolbar .rift-toolbar-standard,
[data-message-id].rift-message-shift-active > .ui0213-message-toolbar .rift-toolbar-standard { display: none !important; }
html.rift-message-shift .message:hover > .ui0213-message-toolbar .rift-toolbar-shift,
[data-message-id].rift-message-shift-active > .ui0213-message-toolbar .rift-toolbar-shift { display: grid !important; }
.ui0213-message-toolbar button:disabled { opacity: .42; cursor: default; }
.ui0213-message-toolbar button:disabled:hover { background: transparent; color: #aeb4bc; }
.ui0213-message-toolbar button.danger { color: #ef5b62; }
.ui0213-message-toolbar button.danger:hover { background: rgba(216,75,75,.15); color: #ff6b72; }
