@font-face { font-family: "gg sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/gg-sans-400.woff2") format("woff2"); }
@font-face { font-family: "gg sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/static/fonts/gg-sans-400italic.woff2") format("woff2"); }
@font-face { font-family: "gg sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/gg-sans-500.woff2") format("woff2"); }
@font-face { font-family: "gg sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/gg-sans-600.woff2") format("woff2"); }
@font-face { font-family: "gg sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/gg-sans-700.woff2") format("woff2"); }
@font-face { font-family: "gg sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/gg-sans-800.woff2") format("woff2"); }

/* ==========================================================================
   1:1 Discord Desktop Dark ("Ash") Single-Server Channel View
   ========================================================================== */

:root {
  --font: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bg-primary: #313338;
  --bg-secondary: #2b2d31;
  --bg-secondary-alt: #232428;
  --bg-tertiary: #1e1f22;
  --bg-composer: #383a40;
  --bg-message-hover: #2e3035;
  --bg-mod-hover: #35373c;
  --bg-mod-selected: #404249;
  --text-normal: #dbdee1;
  --header-primary: #f2f3f5;
  --text-muted: #949ba4;
  --interactive-normal: #b5bac1;
  --interactive-hover: #dbdee1;
  --interactive-active: #f2f3f5;
  --brand: #5865f2;
  --brand-hover: #4752c4;
  --status-online: #23a55a;
  --status-idle: #f0b232;
  --status-dnd: #f23f43;
  --status-offline: #80848e;
  --elevation-low: 0 1px 0 rgba(4, 4, 5, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(4, 4, 5, 0.05);
  --elevation-high: 0 8px 16px rgba(0, 0, 0, 0.24);
  --rail: #1e1f22;
  --sidebar: #2b2d31;
  --main: #313338;
  --deep: #232428;
  --surface: #383a40;
  --active: #404249;
  --line: rgba(78, 80, 88, 0.36);
  --line2: rgba(78, 80, 88, 0.6);
  --text: #f2f3f5;
  --soft: #dbdee1;
  --muted: #b5bac1;
  --dim: #949ba4;
  --accent: #5865f2;
  --accent2: #949cf7;
  --green: #23a55a;
  --yellow: #f0b232;
  --red: #f23f43;
  --head-h: 48px;
  --side-w: 240px;
  --members-w: 240px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html,
body {
  background: var(--bg-primary);
  color: var(--text-normal);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.375;
}

#app-shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--members-w);
  grid-template-rows: var(--head-h) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-normal);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.375;
}

#app-shell :is(button, input, textarea, select),
:is(.member-profile, .forum-composer, .private-account-dialog, .account-folder-dialog, .sender-folder-dialog, .admin-panel-dialog, .proxy-manager-dialog) :is(button, input, textarea, select) {
  font-family: inherit;
}

:is(.member-profile, .forum-composer, .private-account-dialog, .account-folder-dialog, .sender-folder-dialog, .admin-panel-dialog, .proxy-manager-dialog) {
  font-family: var(--font);
  color: var(--text-normal);
}

/* Desktop Member List collapse & Saved Dialogues right pane */
@media (min-width: 1120px) {
  #app-shell.is-members-collapsed:not(.has-dialogues) {
    grid-template-columns: var(--side-w) minmax(0, 1fr);
  }
  #app-shell.is-members-collapsed:not(.has-dialogues) > #member-sidebar {
    display: none;
  }
}

@media (min-width: 1201px) {
  #app-shell.has-dialogues {
    grid-template-columns: var(--side-w) minmax(320px, 1fr) minmax(400px, 440px);
  }
  #app-shell.has-dialogues > #member-sidebar {
    display: none;
  }
}

/* ==========================================================================
   Left 240px Channel Sidebar + 48px Server Header + 52px Bottom User Panel
   ========================================================================== */

#channel-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--head-h) auto minmax(0, 1fr) 52px;
  width: var(--side-w);
  max-width: var(--side-w);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 0;
}

.server-header {
  height: var(--head-h);
  min-width: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 0;
  box-shadow: var(--elevation-low);
  z-index: 4;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.server-header:hover {
  background: var(--bg-mod-hover);
}

.server-header-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.server-header-icon {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
}

.server-header-icon svg {
  width: 14px;
  height: 14px;
}

#guild-title {
  overflow: hidden;
  color: var(--header-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-header-chevron {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--interactive-normal);
  stroke-width: 2.1;
}

.server-header:hover .server-header-chevron {
  color: var(--header-primary);
}

/* Keep #server-live visually hidden unless disconnected/reconnecting */
.server-live:not(.is-loading):not(.is-error):not(.is-limited) {
  display: none !important;
}

.server-live {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.server-live i {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

/* Compact #1e1f22 Channel Search */
.channel-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 28px;
  margin: 10px 8px 4px;
}

.channel-search-wrap svg {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.channel-search-wrap input {
  width: 100%;
  height: 28px;
  padding: 0 46px 0 26px;
  border: 0;
  border-radius: 4px;
  outline: 0;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font-size: 13px;
  font-weight: 500;
}

.channel-search-wrap input::placeholder {
  color: var(--text-muted);
}

.channel-search-wrap input::-webkit-search-cancel-button {
  display: none;
}

.channel-search-wrap kbd {
  position: absolute;
  right: 6px;
  padding: 1px 4px;
  border: 0;
  border-radius: 3px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  pointer-events: none;
}

/* Authentic 32px Discord Channels & 12px Uppercase Categories */
#channel-list {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 8px 12px;
  border: 0;
  scrollbar-color: #1a1b1e transparent;
  scrollbar-width: thin;
}

.channel-category {
  margin: 0;
  padding-top: 16px;
}

.channel-category:first-child {
  padding-top: 10px;
}

.category-label {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  padding: 0 4px 2px 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-label:hover {
  color: var(--interactive-hover);
}

.category-chevron {
  display: grid;
  place-items: center;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-right: 2px;
  color: inherit;
  transition: transform 0.12s ease;
}

.category-chevron svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.channel-category.is-collapsed .category-chevron {
  transform: rotate(-90deg);
}

.category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  min-height: 32px;
  margin: 1px 0;
  padding: 0 8px;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}

.channel-button:hover {
  background: var(--bg-mod-hover);
  color: var(--interactive-hover);
}

.channel-button.is-active {
  background: var(--bg-mod-selected);
  color: var(--header-primary);
}

.channel-button__icon {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #80848e;
}

.channel-button:hover .channel-button__icon,
.channel-button.is-active .channel-button__icon,
.channel-button.has-unread .channel-button__icon {
  color: var(--interactive-hover);
}

.channel-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.85;
}

.channel-button__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-button.has-unread .channel-button__name {
  color: var(--header-primary);
  font-weight: 600;
}

.channel-button__unread {
  position: absolute;
  left: -8px;
  top: 50%;
  width: 4px;
  height: 8px;
  margin: -4px 0 0;
  border-radius: 0 4px 4px 0;
  background: var(--header-primary);
  box-shadow: none;
}

.channel-button__type {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.channel-button.is-disabled {
  opacity: 0.55;
}

.channel-button.is-disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

.forum-thread-list {
  margin: 0 0 2px 18px;
  padding-left: 10px;
}

.forum-thread-list:before,
.forum-thread-link__branch {
  border-color: #4e5058;
  background-color: transparent;
}

.forum-thread-list:before {
  background: #4e5058;
}

.forum-thread-link.channel-button {
  height: 30px;
  min-height: 30px;
  font-size: 14px;
  color: var(--text-muted);
}

.forum-thread-link.channel-button:hover {
  background: var(--bg-mod-hover);
  color: var(--interactive-hover);
}

.forum-thread-link.channel-button.is-active {
  background: var(--bg-mod-selected);
  color: var(--header-primary);
}

/* Voice Channel Participants */
.voice-participants {
  display: grid;
  gap: 1px;
  margin: 0 0 4px 24px;
}

.voice-participant {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.voice-participant:hover {
  background: var(--bg-mod-hover);
  color: var(--interactive-hover);
}

.voice-participant-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
  font-weight: 600;
  background: var(--brand);
}

.voice-participant-avatar .presence-dot {
  border-color: var(--bg-secondary);
}

.voice-participant:hover .voice-participant-avatar .presence-dot {
  border-color: var(--bg-mod-hover);
}

.voice-participant-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: inherit;
}

.voice-participant-state {
  display: flex;
  align-items: center;
  gap: 4px;
}

.voice-state-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.voice-state-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.voice-state-icon.is-streaming {
  color: var(--status-online);
}

.voice-state-icon.is-live {
  color: var(--status-dnd);
}

/* 52px Bottom-Left Discord User Panel */
#discord-user-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 8px;
  overflow: hidden;
  border: 0;
  background: var(--bg-secondary-alt);
  color: var(--text-normal);
}

.user-panel-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  height: 38px;
  padding: 3px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.user-panel-trigger:hover,
.user-panel-trigger[aria-expanded="true"] {
  background: var(--bg-mod-hover);
}

.user-panel-avatar-wrap {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.user-panel-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.user-panel-avatar > img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-panel-avatar > .avatar-decoration {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  max-width: none;
  pointer-events: none;
}

.user-panel-status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--bg-secondary-alt);
  border-radius: 50%;
  background: var(--status-offline);
}

.user-panel-trigger:hover .user-panel-status-dot,
.user-panel-trigger[aria-expanded="true"] .user-panel-status-dot {
  border-color: var(--bg-mod-hover);
}

.user-panel-status-dot.is-online { background: var(--status-online); }
.user-panel-status-dot.is-idle { background: var(--status-idle); }
.user-panel-status-dot.is-dnd { background: var(--status-dnd); }
.user-panel-status-dot.is-unavailable,
.user-panel-status-dot.is-offline,
.user-panel-status-dot.is-invisible,
.user-panel-status-dot.is-unknown { background: var(--status-offline); }

.user-panel-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0;
}

#user-panel-name {
  overflow: hidden;
  color: var(--header-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-panel-subtext {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-panel-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}

.user-panel-action {
  display: grid;
  place-items: center;
  width: 28px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
}

.user-panel-action:hover {
  background: var(--bg-mod-hover);
  color: var(--interactive-hover);
}

.user-panel-action svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

/* ==========================================================================
   Top 48px Spanning Channel Header & Toolbar
   ========================================================================== */

.chat-header {
  grid-column: 2 / -1;
  grid-row: 1;
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--head-h);
  min-width: 0;
  padding: 0 16px;
  border: 0;
  background: var(--bg-primary);
  box-shadow: var(--elevation-low);
}

.channel-symbol {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-right: 0;
  place-items: center;
  color: #80848e;
}

.channel-symbol .channel-icon {
  width: 24px;
  height: 24px;
}

.channel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

#channel-title {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--header-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#channel-topic {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding-left: 12px;
  border-left: 1px solid #3f4147;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex: 0 0 auto;
}

.sync-status:not(.is-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.sync-status.is-error {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(242, 63, 67, 0.14);
  color: #fa777c;
  font-size: 11px;
  font-weight: 600;
}

.chat-header .icon-button,
.chat-header .dialogue-toggle,
.chat-header .header-admin-button,
.chat-header .member-panel-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
}

.chat-header :is(.icon-button, .dialogue-toggle, .header-admin-button, .member-panel-toggle):hover:not(:disabled) {
  background: var(--bg-mod-hover);
  color: var(--interactive-hover);
}

.chat-header :is(.icon-button, .dialogue-toggle, .header-admin-button, .member-panel-toggle) svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.85;
}

.chat-header .member-panel-toggle.is-active,
.chat-header .member-panel-toggle[aria-expanded="true"],
.chat-header .dialogue-toggle[aria-expanded="true"] {
  color: var(--header-primary);
}

.dialogue-toggle__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--bg-primary);
}

/* Compact Discord Message Search Input (144px -> 220px on focus) */
.header-message-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 144px;
  height: 24px;
  margin: 0 2px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  transition: width 0.16s ease;
}

.header-message-search:focus-within,
.header-message-search.has-value {
  width: 220px;
}

.header-message-search input {
  width: 100%;
  height: 24px;
  padding: 0 26px 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-normal);
  font-size: 13px;
  line-height: 24px;
}

.header-message-search input::placeholder {
  color: var(--text-muted);
}

.header-message-search input::-webkit-search-cancel-button {
  display: none;
}

.header-message-search__icon {
  position: absolute;
  right: 6px;
  width: 15px !important;
  height: 15px !important;
  color: var(--text-muted);
  pointer-events: none;
}

.header-message-search.has-value .header-message-search__icon {
  display: none;
}

.header-message-search__clear {
  position: absolute;
  right: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 14px;
  line-height: 1;
}

.header-message-search__clear:hover {
  color: var(--header-primary);
}

/* ==========================================================================
   Main Chat Stream (#messages)
   ========================================================================== */

.chat-panel {
  grid-column: 2;
  grid-row: 2;
  isolation: auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
}

body.sender-picker-open .chat-panel {
  z-index: 180;
}

.chat-panel.is-forum-view {
  grid-template-rows: minmax(0, 1fr);
}

#messages {
  padding: 0 0 20px;
  background: var(--bg-primary);
  scrollbar-color: #1a1b1e #2b2d31;
  scrollbar-width: thin;
}

#messages::-webkit-scrollbar {
  width: 16px;
}

#messages::-webkit-scrollbar-thumb {
  border: 4px solid var(--bg-primary);
  border-radius: 8px;
  background: #1a1b1e;
}

#messages::-webkit-scrollbar-track {
  border: 4px solid var(--bg-primary);
  border-radius: 8px;
  background: #2b2d31;
}

.messages.is-forum-index {
  background: var(--bg-primary);
}

/* Discord #channel-intro: 68px #41434a circle + 32px bold greeting */
.channel-intro {
  padding: 40px 16px 16px;
}

.channel-intro__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #41434a;
  color: var(--header-primary);
  font-size: 40px;
  font-weight: 500;
}

.channel-intro h2 {
  margin: 0 0 8px;
  color: var(--header-primary);
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: -0.01em;
}

.channel-intro p {
  margin: 0;
  color: var(--interactive-normal);
  font-size: 16px;
  line-height: 20px;
}

.history-loader {
  border: 0;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--interactive-normal);
  font-size: 12px;
  font-weight: 600;
}

.history-loader:hover:not(:disabled) {
  background: var(--bg-mod-hover);
  color: var(--header-primary);
}

/* Date dividers */
.date-divider {
  margin: 24px 16px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 13px;
}

.date-divider:before {
  background: #3f4147;
}

.date-divider span {
  padding: 0 8px;
  background: var(--bg-primary);
}

/* Authentic 40px Avatar Message Groups (padding: 2px 48px 2px 72px) */
.message-group {
  position: relative;
  display: block;
  min-height: 44px;
  margin-top: 17px;
  padding: 2px 48px 2px 72px;
  border-radius: 0;
}

.message-group:hover {
  background: var(--bg-message-hover);
}

.message-group.is-compact {
  min-height: 22px;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.date-divider + .message-group,
.channel-intro + .message-group,
.history-loader + .message-group {
  margin-top: 0;
}

.message-group > .message-avatar,
.message-group > .message-avatar:is(button, div) {
  position: absolute;
  top: 4px;
  left: 16px;
  width: 40px;
  height: 40px;
  margin: 0;
  background: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.message-group.has-reply > .message-avatar,
.message-group.has-reply > .message-avatar:is(button, div) {
  top: 24px;
  margin-top: 0;
}

.message-group.is-compact > .message-avatar,
.message-group.is-compact > .message-avatar:is(button, div) {
  position: absolute;
  top: 0;
  left: 0;
  width: 72px;
  height: 22px;
  margin: 0;
  overflow: visible;
  background: transparent !important;
  color: transparent;
}

.compact-time {
  display: none;
  position: absolute;
  top: 3px;
  left: 0;
  right: auto;
  width: 72px;
  padding-right: 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  text-align: right;
}

.message-group.is-compact:hover .compact-time {
  display: block;
}

.message-body {
  min-width: 0;
  padding: 0;
}

/* Authentic Curved Reply Spine (33px x 12px) */
.message-reply {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 18px;
  margin-bottom: 2px;
  color: var(--interactive-normal);
  font-size: 14px;
  line-height: 18px;
}

.message-reply-jump {
  position: absolute;
  top: 0;
  left: -36px;
  width: 33px;
  height: 18px;
  padding: 0;
  background: transparent;
  color: #4e5058;
}

.message-reply-jump:before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 33px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 6px 0 0 0;
}

.message-reply:hover .message-reply-jump,
.message-reply-jump:hover {
  color: var(--interactive-normal);
}

.message-reply-author {
  color: var(--reply-author-color, var(--interactive-normal));
  font-size: 14px;
  font-weight: 500;
}

.message-reply-content {
  color: var(--interactive-normal);
  font-size: 14px;
}

.message-reply-content:hover {
  color: var(--header-primary);
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-height: 22px;
  line-height: 22px;
}

.message-author {
  color: var(--message-author-color, var(--header-primary));
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

.message-meta time {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

.message-content {
  color: var(--text-normal);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
}

.message-primary-guild {
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-normal);
  font-weight: 600;
}

/* Embeds, Polls & Reactions on #2b2d31 surface */
.rich-embed,
.message-poll,
.file-card,
.message-audio {
  background-color: var(--bg-secondary);
  border-top-color: rgba(78, 80, 88, 0.3);
  border-right-color: rgba(78, 80, 88, 0.3);
  border-bottom-color: rgba(78, 80, 88, 0.3);
}

.message-reaction {
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--interactive-normal);
  font-size: 14px;
}

.message-reaction:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--bg-mod-hover);
}

.message-reaction.is-mine {
  border-color: var(--brand);
  background: rgba(88, 101, 242, 0.16);
  color: #dee0fc;
}

/* Floating Discord Message Hover Toolbar (top: -16px; right: 16px) */
.message-actions {
  position: absolute;
  top: -16px;
  right: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0;
  height: 32px;
  padding: 0 2px;
  border: 1px solid #232428;
  border-radius: 4px;
  background: var(--bg-primary);
  box-shadow: 0 0 0 1px rgba(4, 4, 5, 0.12), 0 4px 8px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease, box-shadow 0.12s ease;
}

.message-group:hover .message-actions,
.message-group:focus-within .message-actions,
.message-actions:has(.message-reaction-picker:not(.is-hidden)) {
  opacity: 1;
  pointer-events: auto;
}

.message-actions__sep {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: #3f4147;
}

.message-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 16px;
  line-height: 1;
}

.message-action:hover:not(:disabled) {
  background: var(--bg-mod-hover);
  color: var(--header-primary);
}

.message-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.message-action.is-quick-emoji {
  font-size: 16px;
}

.message-action.is-quick-emoji:hover {
  transform: scale(1.12);
}

.message-reaction-action {
  position: relative;
  display: flex;
  align-items: center;
}

.message-reaction-picker {
  position: fixed;
  z-index: 260;
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid #1e1f22;
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: var(--elevation-high);
}

.message-reaction-section {
  display: grid;
  gap: 5px;
}

.message-reaction-section__title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.message-reaction-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.message-reaction-option {
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 4px;
  background: transparent;
  font-size: 19px;
}

.message-reaction-option:hover:not(:disabled) {
  background: var(--bg-mod-selected);
}

/* Inline Message Edit Form */
.message-edit-form {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.message-edit-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: var(--bg-composer);
  color: var(--text-normal);
  font-size: 15px;
  line-height: 21px;
  resize: vertical;
}

.message-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.message-edit-actions small {
  margin-right: auto;
}

.message-edit-cancel,
.message-edit-save {
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.message-edit-cancel {
  background: transparent;
  color: #00a8fc;
}

.message-edit-cancel:hover {
  text-decoration: underline;
}

.message-edit-save {
  background: var(--brand);
  color: #fff;
}

.message-edit-save:hover {
  background: var(--brand-hover);
}

/* ==========================================================================
   Discord Composer (#383a40 pill, 24px + circle, Active Sender Avatar Pill)
   ========================================================================== */

#composer-wrap {
  position: relative;
  padding: 0 16px 24px;
  background: var(--bg-primary);
}

#composer-wrap.is-disabled {
  opacity: 1;
}

#composer-reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 12px 6px 16px;
  border: 0;
  border-bottom: 1px solid rgba(30, 31, 34, 0.6);
  border-radius: 8px 8px 0 0;
  background: var(--bg-secondary);
  color: var(--interactive-normal);
  font-size: 14px;
}

.composer-reply__copy {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.composer-reply__copy strong {
  color: var(--header-primary);
  font-weight: 600;
}

.composer-reply__copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 13px;
  text-overflow: ellipsis;
}

#composer-reply-cancel {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--interactive-normal);
}

#composer-reply-cancel:hover {
  color: var(--header-primary);
}

#composer-reply-cancel svg {
  width: 18px;
  height: 18px;
}

#attachment-strip {
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(78, 80, 88, 0.48);
  border-radius: 8px 8px 0 0;
  background: var(--bg-composer);
}

#composer-reply:not(.is-hidden) + #attachment-strip {
  border-radius: 0;
}

.attachment-chip {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.08);
}

.composer {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 44px;
  padding: 0 6px 0 0;
  border: 0;
  border-radius: 8px;
  background: var(--bg-composer);
  box-shadow: none;
}

.composer:focus-within {
  border: 0;
  box-shadow: none;
}

#composer-reply:not(.is-hidden) ~ .composer,
#attachment-strip:not(.is-hidden) ~ .composer {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Signature 24px filled-circle + button */
.composer-attach-button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0;
  background: transparent !important;
}

.composer-attach-circle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--interactive-normal);
  color: var(--bg-composer);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.composer-attach-button:hover:not(:disabled) .composer-attach-circle {
  background: var(--header-primary);
}

.composer-attach-circle svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

/* Compact Active Sender Avatar Pill tucked inside composer left edge */
.composer > .account-switcher {
  display: flex;
  align-items: center;
  height: 44px;
  margin-right: 4px;
  flex: 0 0 auto;
}

.composer .sender-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  min-height: 28px;
  min-width: 0;
  max-width: 168px;
  padding: 2px 7px 2px 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: var(--bg-secondary);
  color: var(--text-normal);
}

.composer .sender-trigger:hover:not(:disabled),
.composer .sender-trigger[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--bg-secondary-alt);
  color: var(--header-primary);
  box-shadow: none;
}

.composer .sender-avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.composer .sender-trigger__copy strong {
  max-width: 100px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: inherit;
}

.sender-presence,
.sender-row__presence {
  display: block !important;
}

.composer .sender-presence {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.composer .sender-trigger__chevron {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.composer textarea {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 220px;
  padding: 11px 8px;
  color: var(--text-normal);
  font-size: 16px;
  line-height: 22px;
}

.composer textarea::placeholder {
  color: #6d6f78;
}

.composer textarea:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  margin: 0;
}

.composer-tools .composer-icon-button {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  color: var(--interactive-normal);
}

.composer-tools .composer-icon-button:hover:not(:disabled) {
  background: transparent;
  color: var(--header-primary);
}

.gif-button b {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--interactive-normal);
  color: var(--bg-composer);
  font-size: 10px;
  font-weight: 800;
  line-height: 12px;
}

.gif-button:hover:not(:disabled) b {
  background: var(--header-primary);
}

.character-count {
  min-width: auto;
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.send-button {
  width: 32px;
  height: 32px;
  margin-left: 2px;
  border-radius: 4px;
  background: transparent;
  color: var(--brand);
}

.send-button:hover:not(:disabled) {
  background: rgba(88, 101, 242, 0.16);
  color: #7983f5;
}

.send-button:disabled {
  background: transparent;
  color: #6d6f78;
  opacity: 0.45;
}

/* Account Switcher Popover (Anchored cleanly above User Panel or Composer) */
.account-switcher-scrim {
  position: fixed;
  z-index: 245;
  inset: 0;
  pointer-events: auto;
  background: transparent;
}

.account-switcher-popover {
  --picker-bg: #232428;
  --picker-raised: #2b2d31;
  --picker-hover: #35373c;
  --picker-selected: #404249;
  --picker-border: #1e1f22;
  position: fixed;
  z-index: 250;
  left: 8px;
  bottom: 58px;
  width: min(460px, calc(100vw - 16px));
  height: min(600px, calc(100dvh - 116px));
  max-height: min(600px, calc(100dvh - 116px));
  border: 1px solid #1e1f22;
  border-radius: 8px;
  background: #232428;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.46);
}

.account-search > input {
  background: var(--bg-tertiary);
  border-color: transparent;
}

/* ==========================================================================
   Right 240px Member Sidebar (Directly underneath .chat-header)
   ========================================================================== */

#member-sidebar {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: var(--members-w);
  max-width: var(--members-w);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: var(--bg-secondary);
}

@media (min-width: 761px) {
  #member-sidebar > .member-header,
  #member-sidebar > .member-footer {
    display: none !important;
  }
}

.member-search-wrap {
  height: 28px;
  margin: 12px 8px 2px;
}

.member-search-wrap svg {
  left: 8px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.member-search-wrap input {
  height: 28px;
  padding: 0 8px 0 26px;
  border: 0;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font-size: 12px;
}

.member-search-wrap input::placeholder {
  color: var(--text-muted);
}

.member-search-wrap input::-webkit-search-cancel-button {
  display: none;
}

#member-list {
  padding: 4px 8px 16px;
  scrollbar-color: #1a1b1e transparent;
  scrollbar-width: thin;
}

.member-group {
  margin-top: 20px;
}

.member-group:first-child {
  margin-top: 10px;
}

.member-group-title {
  min-height: 20px;
  padding: 0 8px 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.member-group-title b {
  font-size: 12px;
  font-weight: 700;
}

.member-group.is-role-group .member-group-label {
  color: var(--text-muted);
}

.member-item {
  min-height: 42px;
  height: 42px;
  gap: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.member-item:hover {
  background: var(--bg-mod-hover);
}

.member-name {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.member-activity {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 15px;
}

.presence-dot {
  border-color: var(--bg-secondary);
}

.member-item:hover .presence-dot {
  border-color: var(--bg-mod-hover);
}

.member-item.is-offline {
  opacity: 0.3;
}

.member-item.is-offline:hover {
  opacity: 1;
}

/* ==========================================================================
   Saved Dialogues Right Panel Harmonized to Discord Ash
   ========================================================================== */

#dialogue-panel {
  grid-column: 3;
  grid-row: 2;
  background: var(--bg-secondary);
  border-left: 1px solid rgba(30, 31, 34, 0.6);
  color: var(--text-normal);
}

.dialogue-header,
.dialogue-tabs,
.dialogue-form,
.dialogue-footer {
  border-color: rgba(78, 80, 88, 0.36);
}

.dialogue-footer {
  background: var(--bg-secondary-alt);
  color: var(--text-muted);
}

.dialogue-sender-dock,
.dialogue-card {
  background: var(--bg-secondary-alt);
  border-color: rgba(78, 80, 88, 0.42);
}

.dialogue-panel :is(select, textarea, input) {
  background: var(--bg-tertiary);
  color: var(--text-normal);
  border-color: rgba(78, 80, 88, 0.45);
}

/* ==========================================================================
   Member Profile, Forum View & Native Modals in Discord Ash
   ========================================================================== */

.member-profile {
  --profile-surface: #232428;
  border: 1px solid #1e1f22;
  border-radius: 8px;
  background: var(--profile-surface);
}

.member-profile-card,
.member-profile-header,
.member-profile-identity {
  background: var(--profile-surface);
}

.member-profile-avatar,
.member-profile-avatar .presence-dot {
  border-color: var(--profile-surface);
}

.member-profile-badges {
  background: #111214;
}

.member-profile-activity,
.member-profile-role {
  background: var(--bg-secondary);
}

.forum-view {
  background: var(--bg-primary);
}

.forum-toolbar {
  background: var(--bg-tertiary);
  border-color: transparent;
}

.forum-post-card {
  background: var(--bg-secondary);
  border-color: rgba(78, 80, 88, 0.36);
}

.forum-post-card:hover {
  background: var(--bg-mod-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   Proxy & Account Health Manager Modal (Authentic Discord Settings Style)
   ========================================================================== */

.proxy-manager-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  height: min(680px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #1e1f22;
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-normal);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.proxy-manager-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.proxy-manager-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.proxy-manager-nav {
  display: flex;
  flex-direction: column;
  padding: 28px 8px 20px 16px;
  background: var(--bg-secondary);
  overflow-y: auto;
}

.proxy-manager-nav__inner {
  display: grid;
  gap: 2px;
}

.proxy-manager-nav__eyebrow {
  padding: 0 10px 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.proxy-manager-nav__sep {
  height: 1px;
  margin: 8px 10px;
  background: rgba(78, 80, 88, 0.48);
}

.proxy-manager-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--interactive-normal);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.proxy-manager-nav__item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.proxy-manager-nav__item:hover {
  background: var(--bg-mod-hover);
  color: var(--interactive-hover);
}

.proxy-manager-nav__item.is-active {
  background: var(--bg-mod-selected);
  color: var(--header-primary);
}

.proxy-manager-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  min-height: 0;
  padding: 28px 32px 32px;
  overflow-y: auto;
  background: var(--bg-primary);
  scrollbar-color: #1a1b1e transparent;
  scrollbar-width: thin;
}

.proxy-manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.proxy-manager-header__copy h2 {
  margin: 0 0 4px;
  color: var(--header-primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

.proxy-manager-header__copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 18px;
}

.proxy-manager-header__actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 0 0 auto;
}

.pm-secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: #4e5058;
  color: var(--header-primary);
  font-size: 13px;
  font-weight: 600;
}

.pm-secondary-button:hover:not(:disabled) {
  background: #6d6f78;
}

.pm-secondary-button svg {
  width: 15px;
  height: 15px;
}

.pm-close-wrap {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.pm-close-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--interactive-normal);
  border-radius: 50%;
  background: transparent;
  color: var(--interactive-normal);
}

.pm-close-button:hover {
  border-color: var(--header-primary);
  background: rgba(255, 255, 255, 0.06);
  color: var(--header-primary);
}

.pm-close-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.pm-close-wrap > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.proxy-manager-alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.proxy-manager-alert.is-error {
  border: 1px solid rgba(242, 63, 67, 0.45);
  background: rgba(242, 63, 67, 0.12);
  color: #ffa6a9;
}

.pm-section {
  display: grid;
  gap: 16px;
}

.pm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pm-metric-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
}

.pm-metric-card__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pm-metric-card__value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-metric-card strong {
  color: var(--header-primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

.pm-metric-card small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-offline);
}

.pm-status-dot.is-online { background: var(--status-online); }
.pm-status-dot.is-warning { background: var(--status-idle); }

.pm-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
}

.pm-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pm-card__header h3 {
  margin: 0 0 3px;
  color: var(--header-primary);
  font-size: 16px;
  font-weight: 600;
}

.pm-card__header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 18px;
}

.pm-updated-at {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
}

.pm-proxy-list {
  display: grid;
  gap: 8px;
}

.pm-proxy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-secondary-alt);
}

.pm-proxy-row__main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pm-proxy-country {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(35, 165, 90, 0.16);
  color: #5cd688;
  font-size: 11px;
  font-weight: 700;
}

.pm-proxy-country.is-dead {
  background: rgba(242, 63, 67, 0.16);
  color: #fa777c;
}

.pm-proxy-endpoint {
  overflow: hidden;
  color: var(--header-primary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-proxy-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--interactive-normal);
}

.pm-proxy-badge {
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(35, 165, 90, 0.15);
  color: #5cd688;
  font-size: 11px;
  font-weight: 700;
}

.pm-proxy-badge.is-dead {
  background: rgba(242, 63, 67, 0.16);
  color: #fa777c;
}

.pm-empty {
  padding: 18px;
  border-radius: 6px;
  background: var(--bg-secondary-alt);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.pm-import-form {
  display: grid;
  gap: 12px;
}

.pm-field {
  display: grid;
  gap: 6px;
}

.pm-field > span {
  color: var(--interactive-normal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pm-field select,
.pm-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  outline: 0;
  background: var(--bg-tertiary);
  color: var(--header-primary);
  font-size: 14px;
}

.pm-field select {
  max-width: 260px;
  height: 38px;
  padding: 0 10px;
}

.pm-field textarea {
  min-height: 96px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 19px;
  resize: vertical;
}

.pm-field select:focus,
.pm-field textarea:focus {
  border-color: var(--brand);
}

.pm-import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-import-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.pm-import-hint code {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-normal);
}

.pm-primary-button {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.pm-primary-button:hover:not(:disabled) {
  background: var(--brand-hover);
}

.pm-primary-button:disabled {
  opacity: 0.55;
}

.pm-import-status {
  margin: 0;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(88, 101, 242, 0.14);
  color: #dee0fc;
  font-size: 13px;
}

.pm-import-status.is-error {
  background: rgba(242, 63, 67, 0.14);
  color: #ffa6a9;
}

.pm-import-status.is-success {
  background: rgba(35, 165, 90, 0.14);
  color: #7ee2a0;
}

.pm-import-results {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.pm-probe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--bg-secondary-alt);
  font-size: 12px;
}

.pm-probe-row.is-ok .pm-probe-status { color: #5cd688; font-weight: 700; }
.pm-probe-row.is-rejected .pm-probe-status { color: #fa777c; font-weight: 700; }

/* ==========================================================================
   Responsive Breakpoints (< 1120px Drawer Member List, <= 760px Mobile)
   ========================================================================== */

@media (min-width: 761px) {
  .chat-header .mobile-only {
    display: none !important;
  }
}

@media (max-width: 1119px) {
  #app-shell {
    grid-template-columns: var(--side-w) minmax(0, 1fr);
  }
  .chat-header {
    grid-column: 2;
  }
  #member-sidebar {
    position: fixed;
    z-index: 42;
    top: var(--head-h);
    right: 0;
    bottom: 0;
    grid-column: auto;
    grid-row: auto;
    width: var(--members-w);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.38);
    transform: translateX(105%);
    transition: transform 0.16s ease;
  }
  #member-sidebar.is-open {
    transform: none;
  }
}

@media (max-width: 760px) {
  :root {
    --head-h: 52px;
    --side-w: 280px;
    --members-w: 268px;
  }
  #app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(var(--head-h) + env(safe-area-inset-top)) minmax(0, 1fr);
  }
  .chat-header {
    grid-column: 1;
    height: calc(var(--head-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0;
  }
  .chat-panel {
    grid-column: 1;
  }
  .header-message-search {
    width: 108px;
  }
  .header-message-search:focus-within {
    width: 152px;
  }
  #channel-sidebar {
    position: fixed;
    z-index: 45;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--side-w), calc(100vw - 24px));
    box-shadow: 16px 0 36px rgba(0, 0, 0, 0.48);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }
  #channel-sidebar.is-open {
    transform: none;
  }
  #member-sidebar {
    top: 0;
    grid-template-rows: calc(var(--head-h) + env(safe-area-inset-top)) auto minmax(0, 1fr) auto;
    z-index: 45;
  }
  .message-group {
    padding: 4px 12px 4px 60px;
  }
  .message-group > .message-avatar,
  .message-group > .message-avatar:is(button, div) {
    left: 10px;
    width: 38px;
    height: 38px;
  }
  .message-group.is-compact > .message-avatar,
  .message-group.is-compact > .message-avatar:is(button, div),
  .compact-time {
    left: 0;
    width: 60px;
  }
  .message-reply-jump {
    left: -31px;
    width: 28px;
  }
  .message-reply-jump:before {
    width: 28px;
  }
  #composer-wrap {
    padding: 0 8px max(10px, env(safe-area-inset-bottom));
  }
  .composer .sender-trigger__copy {
    display: none;
  }
  .account-switcher-popover {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100%;
    border-radius: 12px 12px 0 0;
  }
  .proxy-manager-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .proxy-manager-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .proxy-manager-nav {
    padding: 12px;
  }
  .proxy-manager-nav__inner {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }
  .proxy-manager-nav__eyebrow,
  .proxy-manager-nav__sep {
    display: none;
  }
  .pm-metrics-grid {
    grid-template-columns: 1fr;
  }
}
