@import url("/themes.css?v=1780643802811");

:root {
  --bg: #efeae2;
  --bg-soft: #f7f7f7;
  --panel: #ffffff;
  --panel-strong: #f0f2f5;
  --accent: #25d366;
  --accent-2: #128c7e;
  --text: #111b21;
  --muted: #667781;
  --danger: #d94949;
  --border: #d4d8db;
  --body-bg: #e9edef;
  --rail-bg: linear-gradient(180deg, #1f252d 0%, #1a2027 100%);
  --rail-border: #313a45;
  --rail-button-border: #45515f;
  --rail-button-grad-start: #2a323d;
  --rail-button-grad-end: #252d37;
  --rail-button-hover-start: #34404d;
  --rail-button-hover-end: #2f3843;
  --rail-button-text: #dce5ed;
  --rail-label-bg-start: #34dc75;
  --rail-label-bg-end: #22c35f;
  --rail-label-text: #083015;
  --rail-width-collapsed: 76px;
  --rail-width-expanded: 232px;
  --nick-panel-width: 210px;
  --rooms-panel-width: 210px;
  --chat-font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
  --chat-font-size: 14px;
  --chat-avatar-size: 29px;
  --chat-avatar-letter-size: 11px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
}


/* Final compact overlay fallback for iOS/WebKit stacking inconsistencies */
.app-shell.is-compact .nick-panel,
.app-shell.is-compact .rooms-panel {
  z-index: 900 !important;
}

.app-shell.is-compact .presence-menu,
.app-shell.is-compact .friend-menu,
.app-shell.is-compact .composer-popover-panel {
  z-index: 2147483003 !important;
}

.orientation-lock-notice {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 16, 24, 0.9);
}

.orientation-lock-card {
  width: min(320px, 100%);
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(154, 178, 198, 0.35);
  background: #1d2e3d;
  color: #e7f2fb;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

html.orientation-locked,
html.orientation-locked body {
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html.ios-keyboard-open,
body.ios-keyboard-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
html.keyboard-open-lock,
body.keyboard-open-lock {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
html.emoji-scroll-lock,
body.emoji-scroll-lock {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body {
  margin: 0;
  height: 100vh;
  color: var(--text);
  background: var(--body-bg);
  font-family: "Space Grotesk", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

.backdrop {
  display: none;
  pointer-events: none;
}

.backdrop.active {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(7, 17, 25, 0.22);
  z-index: 1190;
  pointer-events: auto;
}

.app-shell {
  position: relative;
  height: 100vh;
  width: 100vw;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: var(--rail-width-collapsed) minmax(460px, 1fr) var(--nick-panel-width) var(--rooms-panel-width);
  overflow: hidden;
  box-shadow: none;
  background: var(--panel);
  transition: grid-template-columns 0.22s ease;
}

.app-shell.hide-nick-panel {
  grid-template-columns: var(--rail-width-collapsed) minmax(460px, 1fr) 0 var(--rooms-panel-width);
}

.app-shell.rail-expanded {
  grid-template-columns: var(--rail-width-expanded) minmax(460px, 1fr) var(--nick-panel-width) var(--rooms-panel-width);
}

.app-shell.rail-expanded.hide-nick-panel {
  grid-template-columns: var(--rail-width-expanded) minmax(460px, 1fr) 0 var(--rooms-panel-width);
}

.action-rail {
  position: relative;
  z-index: 80;
  overflow: visible;
  background: var(--rail-bg);
  color: #b9c6d1;
  border-right: 1px solid var(--rail-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 14px 10px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
  transition: padding 0.2s ease, background-color 0.2s ease;
}

.rail-top,
.rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 0;
}

.rail-bottom {
  margin-top: 14px;
}

.lang-menu {
  position: relative;
  width: 100%;
}

.theme-menu {
  position: relative;
  width: 100%;
}

.lang-toggle {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lang-code {
  display: inline-flex;
  min-width: 1.65em;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.92;
}

.lang-menu-panel {
  position: absolute;
  top: 0;
  left: 56px;
  min-width: 152px;
  padding: 6px;
  border: 1px solid #3f4c59;
  border-radius: 11px;
  background: #1f2730;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
  z-index: 70;
}

.theme-menu-panel {
  position: absolute;
  top: 0;
  left: 56px;
  min-width: 270px;
  padding: 8px;
  border: 1px solid #3f4c59;
  border-radius: 11px;
  background: #1f2730;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
  z-index: 70;
}

.theme-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #3f4f5e;
  border-radius: 9px;
  color: #dce5ed;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
}

.theme-option-row + .theme-option-row {
  margin-top: 6px;
}

.theme-preset-row {
  align-items: center;
}

.theme-preset-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.theme-preset-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: var(--theme-preset-swatch, var(--accent));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}

.theme-preset-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 85px;
  max-width: 85px;
  height: 32px;
  border: 1px solid #5d7891;
  border-radius: 9px;
  background:
    linear-gradient(45deg, transparent 50%, #b8d6ee 50%) calc(100% - 13px) calc(50% - 3px) / 6px 6px no-repeat,
    linear-gradient(135deg, #b8d6ee 50%, transparent 50%) calc(100% - 8px) calc(50% - 3px) / 6px 6px no-repeat,
    linear-gradient(180deg, #2b3f52, #213241);
  color: #b9b9b9;
  font-weight: 700;
  padding: 0 28px 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-preset-select:focus-visible {
  outline: 2px solid #8fd0ff;
  outline-offset: 1px;
}

.theme-option-switch {
  width: 34px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.theme-option-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.theme-option-hint {
  display: block;
  margin-top: 7px;
  padding: 0 2px;
  color: #adbdc9;
  font-size: 0.72rem;
  line-height: 1.25;
}

:root[data-appearance-mode="dark"] body {
  background: #0f141a;
  color: #e4edf5;
}

:root[data-appearance-mode="dark"] .chat-area {
  background: #121a22;
  border-right-color: #283644;
}

:root[data-appearance-mode="dark"] .chat-header {
  background: #16222e;
  border-bottom-color: #2a3845;
}

:root[data-appearance-mode="dark"] .messages {
  background-color: #111923;
  background-image:
    radial-gradient(#ffffff12 1px, transparent 1px),
    repeating-linear-gradient(
      45deg,
      #ffffff06,
      #ffffff06 1px,
      transparent 1px,
      transparent 4px
    );
}

:root[data-appearance-mode="dark"] .topic-bar,
:root[data-appearance-mode="dark"] .composer-tools,
:root[data-appearance-mode="dark"] .message-form {
  background: #17222d;
  border-color: #2a3845;
}

:root[data-appearance-mode="dark"] .message-form #messageInput {
  background: #101821;
  color: #e4edf5;
  border-color: #2f3e4c;
}

:root[data-appearance-mode="dark"] .nick-panel,
:root[data-appearance-mode="dark"] .rooms-panel {
  background: #141d27;
  border-color: #2a3845;
}

.app-shell.rail-expanded:not(.is-compact) .lang-menu-panel {
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 0;
}

.app-shell.rail-expanded:not(.is-compact) .theme-menu-panel {
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 0;
}

.lang-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #dce5ed;
  border-radius: 9px;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.lang-option + .lang-option {
  margin-top: 4px;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: #2f3c49;
  border-color: #4d6070;
  outline: none;
}

.lang-option.active {
  border-color: #4fae84;
  background: #225f4a;
  color: #e8fff2;
}

.rail-btn {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--rail-button-border);
  background: linear-gradient(180deg, var(--rail-button-grad-start), var(--rail-button-grad-end));
  color: var(--rail-button-text);
  cursor: pointer;
  line-height: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

/* Reduce right-side dead strip in collapsed desktop rail */
.app-shell:not(.is-compact):not(.rail-expanded) .action-rail {
  padding-left: 6px;
  padding-right: 6px;
}

.app-shell:not(.is-compact):not(.rail-expanded) .rail-btn {
  width: 100%;
  min-width: 0;
  padding: 0;
}

.rail-text {
  display: none;
  position: static;
  transform: none;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  color: #e4edf5;
  pointer-events: auto;
  cursor: pointer;
}

.app-shell.rail-expanded:not(.is-compact) .rail-btn {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  padding: 0 12px;
  min-height: 46px;
}

.app-shell.rail-expanded:not(.is-compact) .rail-text {
  display: block;
}


.rail-toggle-btn svg {
  transition: transform 0.2s ease;
}

.app-shell.rail-expanded:not(.is-compact) .rail-toggle-btn svg {
  transform: rotate(180deg);
}

.rail-btn:hover {
  background: linear-gradient(180deg, #374453, #313c48);
  border-color: #5b6b7c;
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 4px 12px rgba(8, 14, 20, 0.24);
}

.rail-btn:active {
  transform: translateY(0) scale(1);
  box-shadow: none;
}

.rail-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.rail-btn:focus-visible {
  outline: 2px solid #95e2ba;
  outline-offset: 1px;
}

.rail-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.rail-btn.active {
  border-color: #4fae84;
  color: #e8fff2;
  background: linear-gradient(180deg, #296b52, #235f49);
}

.rail-btn.selected {
  border-color: #6e889d;
  color: #eef6fb;
  background: linear-gradient(180deg, #3a4d5f, #314253);
  box-shadow: inset 0 0 0 1px rgba(147, 191, 223, 0.18), 0 2px 8px rgba(8, 20, 28, 0.2);
}

.rail-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: 58px;
  top: 50%;
  transform: translateY(-50%) translateX(5px) scale(0.98);
  background: rgba(21, 33, 43, 0.97);
  color: #eff5f9;
  border: 1px solid rgba(106, 130, 147, 0.45);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.rail-btn::before {
  display: none;
}

.rail-btn:hover::after,
.rail-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}

.rail-btn:hover::before,
.rail-btn:focus-visible::before {
  display: none;
}

.app-shell.rail-expanded:not(.is-compact) .rail-btn::after,
.app-shell.rail-expanded:not(.is-compact) .rail-btn::before {
  display: none;
}

.chat-area {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #f6f7f9;
  border-right: 1px solid var(--border);
}

/* Compact/mobile layout (forced by runtime width detection) */
@media (min-width: 721px) {
  .mobile-only-setting {
    display: none !important;
  }
}

.app-shell.is-compact {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  height: var(--mobile-vh, 100vh) !important;
  overflow: hidden !important;
  overscroll-behavior: none;
  /* touch-action: pan-y; */
  touch-action: pan-y;
  transform: translateY(0);
  transition: none;
  --compact-admin-icon-shift: 0px;
}

.app-shell.is-compact.keyboard-open {
  transition: none;
  touch-action: pan-y;
  overscroll-behavior: none;
  transform: none;
  will-change: auto;
}

.app-shell.is-compact.keyboard-open .messages,
.app-shell.is-compact.keyboard-open .nick-list,
.app-shell.is-compact.keyboard-open .conversation-list,
.app-shell.is-compact.keyboard-open .mobile-conversation-strip {
  touch-action: pan-y;
  overscroll-behavior: none;
}

.app-shell.is-compact.compact-admin-visible {
  --compact-admin-icon-shift: 36px;
}

.app-shell.is-compact.rail-expanded,
.app-shell.is-compact.hide-nick-panel,
.app-shell.is-compact.rail-expanded.hide-nick-panel {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

.app-shell.is-compact .action-rail {
  border-right: 0;
  border-bottom: 1px solid #2f3b43;
  position: relative;
  display: block;
  padding: calc(0px + var(--safe-area-top)) calc(4px + var(--safe-area-right)) 0px calc(4px + var(--safe-area-left));
  width: 100%;
  min-height: 36px;
  overflow: visible;
  z-index: 1215;
}

.app-shell.is-compact.mobile-main-navbar-hidden .chat-header {
  display: none;
}

.app-shell.is-compact .rail-top,
.app-shell.is-compact .rail-bottom {
  display: block;
  padding-left: 0;
}

.stories-mobile-controls {
  position: absolute;
  top: calc(100% + 4px);
  right: 6px;
  width: min(236px, calc(100vw - 14px));
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #cad6de;
  border-radius: 11px;
  background: #f7fbff;
  box-shadow: 0 10px 20px rgba(15, 28, 38, 0.24);
  z-index: 1305;
}

.stories-mobile-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #d4dfe6;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  color: #183644;
  font-size: 0.76rem;
  font-weight: 700;
}

.stories-mobile-control-row:has(input[type="checkbox"]:checked) {
  border-color: #93d4ac;
  background: linear-gradient(180deg, #f5fff8 0%, #ebf8f0 100%);
}

.stories-mobile-control-row .toggle-control input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.stories-mobile-control-row:has(input[type="checkbox"]:disabled) {
  opacity: 0.62;
}

.app-shell.is-compact .message-form .composer-toggle-btn {
  display: none !important;
}

.app-shell.is-compact .rail-btn {
  width: 36px;
  height: 36px;
  border-radius: 0;
  flex: 0 0 auto;
  min-width: 36px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(178, 198, 209, 0.32);
  background: transparent;
  box-shadow: none;
}

.app-shell.is-compact .rail-btn svg {
  width: 18px;
  height: 18px;
}

.app-shell.is-compact .rail-offcanvas-item {
  display: none !important;
}

.app-shell.is-compact #actionRadio,
.app-shell.is-compact #actionTheme,
.app-shell.is-compact #actionStories,
.app-shell.is-compact #actionSettings,
.app-shell.is-compact #actionRailToggle {
  display: inline-flex !important;
  position: fixed;
  top: calc(0px + var(--safe-area-top));
  transform: none;
  z-index: 1217;
  border-left: 0 !important;
}

.app-shell.is-compact #actionAdminPanel:not(.hidden) {
  display: inline-flex !important;
  position: fixed;
  top: calc(0px + var(--safe-area-top));
  transform: none;
  z-index: 1217;
  border-left: 0 !important;
}

.app-shell.is-compact #actionRailToggle {
  right: calc(4px + var(--safe-area-right));
}

.app-shell.is-compact #actionSettings {
  right: calc(40px + var(--safe-area-right));
}

.app-shell.is-compact #actionAdminPanel {
  right: calc(76px + var(--safe-area-right));
}

.app-shell.is-compact #actionRadio {
  right: calc(76px + var(--compact-admin-icon-shift) + var(--safe-area-right));
}

.app-shell.is-compact #actionTheme {
  right: calc(112px + var(--compact-admin-icon-shift) + var(--safe-area-right));
}

.app-shell.is-compact #actionTheme .theme-rail-swatch {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  margin: 0;
}

.app-shell.is-compact #actionStories {
  right: calc(148px + var(--compact-admin-icon-shift) + var(--safe-area-right));
}

.app-shell.is-compact .theme-menu-panel {
  position: fixed;
  top: calc(46px + var(--safe-area-top));
  right: calc(8px + var(--safe-area-right));
  left: auto;
  min-width: min(232px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}

.app-shell.is-compact #actionAdminPanel:not(.hidden) {
  color: #7fe2bf !important;
}

#actionStories {
  display: none;
}

.app-shell.is-compact .rail-text,
.app-shell.is-compact .rail-btn::after {
  display: none !important;
}

.app-shell.is-compact .rail-btn:hover,
.app-shell.is-compact .rail-btn:focus-visible,
.app-shell.is-compact .rail-btn.active,
.app-shell.is-compact .rail-btn.selected {
  transform: none;
  box-shadow: none;
  background: rgba(64, 88, 101, 0.34);
  border-color: transparent;
}

.app-shell.is-compact.rail-expanded .rail-top {
  position: fixed;
  top: calc(52px + var(--safe-area-top));
  right: calc(8px + var(--safe-area-right));
  width: min(246px, calc(100vw - 16px));
  max-height: calc(100dvh - 72px - var(--safe-area-top));
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--rail-border);
  border-radius: 16px;
  background: var(--rail-bg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1216;
}

.app-shell.is-compact.rail-expanded .rail-offcanvas-item {
  display: block !important;
  width: 100%;
}

.app-shell.is-compact.rail-expanded .rail-offcanvas-item:not(.rail-menu-item) {
  display: none !important;
}

.app-shell.is-compact.rail-expanded .rail-menu-item {
  display: block !important;
  width: 100%;
}

.app-shell.is-compact.rail-expanded .rail-bottom .rail-offcanvas-item {
  display: none !important;
}

.app-shell.is-compact.rail-expanded .lang-menu-panel {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
}

.app-shell.is-compact.rail-expanded .rail-top .rail-menu-item.rail-btn,
.app-shell.is-compact.rail-expanded .rail-top .lang-toggle {
  display: flex !important;
  width: 100%;
  min-width: 100%;
  min-height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: flex-start !important;
  gap: 10px !important;
  line-height: 1.15;
  padding: 0 12px !important;
  border: 1px solid var(--rail-button-border) !important;
  background: linear-gradient(180deg, var(--rail-button-grad-start), var(--rail-button-grad-end)) !important;
  color: var(--rail-button-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-shell.is-compact.rail-expanded .rail-top .lang-toggle {
  position: relative;
}

.app-shell.is-compact.rail-expanded .rail-top .rail-menu-item.rail-btn:hover,
.app-shell.is-compact.rail-expanded .rail-top .lang-toggle:hover,
.app-shell.is-compact.rail-expanded .rail-top .rail-menu-item.rail-btn:focus-visible,
.app-shell.is-compact.rail-expanded .rail-top .lang-toggle:focus-visible {
  border-color: var(--rail-button-border) !important;
  background: linear-gradient(180deg, var(--rail-button-hover-start), var(--rail-button-hover-end)) !important;
  transform: none;
}

.app-shell.is-compact.rail-expanded .rail-top .rail-menu-item.rail-btn svg,
.app-shell.is-compact.rail-expanded .rail-top .lang-toggle svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  margin: 0;
}

.app-shell.is-compact.rail-expanded .rail-top .lang-toggle .lang-code {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #dce8f2;
  font-size: 0.58rem !important;
  font-weight: 800;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.app-shell.is-compact.rail-expanded .rail-top .rail-menu-item .rail-text,
.app-shell.is-compact.rail-expanded .rail-top .lang-toggle .rail-text {
  display: inline-block !important;
  position: static;
  transform: none;
  text-align: left;
  font-size: 0.94rem !important;
  font-weight: 700;
  line-height: 1.15;
  color: #e4edf5;
}

.app-shell.is-compact.rail-expanded #actionTheme {
  display: flex !important;
}

.app-shell.is-compact .chat-area {
  border-right: 0;
  border-bottom: 0;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: auto;
  padding-bottom: 0;
}

.app-shell.is-compact.keyboard-open .chat-area {
  padding-bottom: 0;
}

.app-shell.is-compact .mobile-swipe-hint {
  position: absolute;
  inset: 72px 0 calc(94px + var(--safe-area-bottom)) 0;
  z-index: 1205;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 8px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-shell.is-compact .mobile-swipe-hint.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.app-shell.is-compact .mobile-swipe-hint-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: min(168px, calc(100vw - 20px));
  padding: 4px 9px;
  border: 1px solid rgba(132, 157, 171, 0.55);
  border-radius: 999px;
  background: rgba(25, 46, 58, 0.78);
  color: #e1edf5;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.012em;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 4px 10px rgba(8, 20, 28, 0.2);
}

.app-shell.is-compact .mobile-swipe-hint-item::before {
  content: "←";
  margin-right: 5px;
  font-size: 0.7rem;
  opacity: 0.85;
}

.app-shell.is-compact .nick-panel,
.app-shell.is-compact .rooms-panel,
.app-shell.is-compact .resize-handle {
  display: grid !important;
}

.app-shell.is-compact .nick-panel,
.app-shell.is-compact .rooms-panel {
  position: fixed;
  right: 0;
  left: auto;
  top: calc(86px + var(--safe-area-top));
  bottom: calc(86px + var(--safe-area-bottom));
  width: min(52vw, 260px);
  min-width: 168px;
  max-height: none;
  border: 1px solid #cfd9df;
  border-radius: 12px 0 0 12px;
  box-shadow: 0 16px 40px rgba(12, 24, 34, 0.28);
  background: #ffffff;
  z-index: 1200;
  transform: translateX(108%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}

.app-shell.is-compact .panel-header h3 {
  font-size: 0.88rem;
}

.app-shell.is-compact .panel-header small,
.app-shell.is-compact .rooms-footer {
  font-size: 0.66rem;
}

.app-shell.is-compact .nick-list li.nick {
  padding: 7px 8px;
}

.app-shell.is-compact .nick-list li.nick .label {
  font-size: 0.84rem;
}

.app-shell.is-compact .conversation-list {
  gap: 6px;
}

.app-shell.is-compact .conversation-label {
  font-size: 0.84rem;
}

.app-shell.is-compact .rooms-tools input {
  font-size: 0.82rem;
}

.app-shell.is-compact .rooms-view-btn {
  font-size: 0.72rem;
  padding: 6px 6px;
}

.app-shell.is-compact.mobile-nick-open .nick-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  touch-action: pan-y;
  z-index: 1201;
}

.app-shell.is-compact.mobile-rooms-open .rooms-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  touch-action: pan-y;
  z-index: 1201;
}

.app-shell.is-compact.compact-side-rail-enabled .mobile-swipe-hint {
  display: none !important;
}

.app-shell.is-compact.compact-side-rail-enabled {
  grid-template-columns: 1fr !important;
}

.app-shell.is-compact.compact-side-rail-enabled .chat-area {
  margin-right: 0 !important;
  min-width: 0 !important;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-panel,
.app-shell.is-compact.compact-side-rail-enabled .rooms-panel {
  position: absolute !important;
  right: 0;
  left: auto;
  top: var(--compact-side-top, 220px);
  bottom: var(--compact-side-bottom, 120px);
  width: 30% !important;
  min-width: 0;
  max-width: none;
  height: auto;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  touch-action: pan-y;
  z-index: 1201;
  border-radius: 0;
  border: 0 !important;
  border-left: 1px solid #cfd9df !important;
  box-shadow: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  will-change: transform, opacity;
}

.app-shell.is-compact.compact-side-rail-enabled .messages {
  padding-right: 30%;
  font-size: 0.9rem;
  line-height: 1.42;
  transition: padding-right 0.22s ease;
}

.app-shell.is-compact.compact-side-rail-enabled .msg-time {
  font-size: 0.82rem;
}

.app-shell.is-compact.compact-side-rail-enabled .msg-text {
  font-size: 0.96em;
}

.app-shell.is-compact.compact-side-rail-enabled .resize-handle {
  display: none !important;
}

.app-shell.is-compact.compact-side-rail-enabled.compact-side-pane-collapsed .messages {
  padding-right: 0 !important;
}

.app-shell.is-compact.compact-side-rail-enabled.compact-side-pane-collapsed .nick-panel,
.app-shell.is-compact.compact-side-rail-enabled.compact-side-pane-collapsed .rooms-panel {
  transform: translateX(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Dropdown acik olsa bile kapali side pane otomatik acilmaz. */

.compact-side-pane-toggle {
  display: none;
}

.app-shell.is-compact.compact-side-rail-enabled .compact-side-pane-toggle {
  position: absolute;
  right: 30%;
  top: calc(var(--compact-side-top, 220px) - 32px);
  width: 18px;
  height: 36px;
  border: 1px solid #c6d4de;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, #ffffff 0%, #edf4f9 100%);
  color: #365365;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1204;
  box-shadow: 0 2px 8px rgba(18, 38, 51, 0.12);
  transition: right 0.22s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.app-shell.is-compact.compact-side-rail-enabled .compact-side-pane-toggle .compact-side-pane-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  transform: translateY(-0.5px);
}

.app-shell.is-compact.compact-side-rail-enabled.compact-side-pane-collapsed .compact-side-pane-toggle {
  right: 0;
}

.app-shell.is-compact.compact-side-rail-enabled.compact-side-pane-collapsed .compact-side-pane-toggle .compact-side-pane-toggle-icon {
  transition: transform 0.22s ease;
}

.app-shell.is-compact.compact-side-rail-enabled .compact-side-pane-toggle:hover {
  border-color: #9fb9ca;
  background: linear-gradient(180deg, #f7fbff 0%, #e4eef6 100%);
}

.app-shell.is-compact.compact-side-pane-nick .nick-panel {
  display: grid !important;
}

.app-shell.is-compact.compact-side-pane-nick .rooms-panel {
  display: none !important;
}

.app-shell.is-compact.compact-side-pane-rooms .nick-panel {
  display: none !important;
}

.app-shell.is-compact.compact-side-pane-rooms .rooms-panel {
  display: grid !important;
}

.app-shell.is-compact.compact-side-rail-enabled .panel-header h3,
.app-shell.is-compact.compact-top-tabs-enabled .panel-header h3 {
  font-size: 0.78rem;
}

.app-shell.is-compact.compact-side-rail-enabled .panel-header small,
.app-shell.is-compact.compact-side-rail-enabled .rooms-footer,
.app-shell.is-compact.compact-top-tabs-enabled .panel-header small,
.app-shell.is-compact.compact-top-tabs-enabled .rooms-footer {
  font-size: 0.6rem;
}

.app-shell.is-compact.compact-side-rail-enabled .panel-header,
.app-shell.is-compact.compact-top-tabs-enabled .panel-header {
  height: 32px !important;
  min-height: 32px !important;
  padding: 3px 6px !important;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list {
  gap: 0;
  padding: 0 !important;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list li,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list li {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list li.nick {
  padding: 5px 2px;
  gap: 5px;
  border-bottom: 1px solid #e1e8ee;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick .label,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list li.nick .label {
  font-size: 0.74rem;
  min-width: 0;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick .role-hint,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list li.nick .role-hint {
  display: none;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick .prefix,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list li.nick .prefix {
  width: 15px;
  margin-right: -2px;
  font-size: 0.72rem;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-menu-btn,
.app-shell.is-compact.compact-top-tabs-enabled .nick-menu-btn {
  width: 12px;
  height: 12px;
  opacity: 0.55;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-menu-btn svg,
.app-shell.is-compact.compact-top-tabs-enabled .nick-menu-btn svg {
  width: 10px;
  height: 10px;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick:hover,
.app-shell.is-compact.compact-top-tabs-enabled .nick-list li.nick:hover {
  background: #f4f8fb;
  border-color: #d7e2ea;
  transform: none;
  box-shadow: none;
}

.app-shell.is-compact.compact-side-rail-enabled .nick-panel .profile-avatar-frame.sm,
.app-shell.is-compact.compact-top-tabs-enabled .nick-panel .profile-avatar-frame.sm {
  width: 22px;
  height: 22px;
}

.app-shell.is-compact.compact-side-rail-enabled .rooms-tools {
  padding: 7px 6px 6px;
  min-height: 0;
}

.app-shell.is-compact.compact-side-rail-enabled .rooms-view-toggle {
  gap: 4px;
  margin-bottom: 6px;
}

.app-shell.is-compact.compact-side-rail-enabled .rooms-view-btn {
  font-size: 0.66rem;
  padding: 5px 4px;
  border-radius: 7px;
}

.app-shell.is-compact.compact-side-rail-enabled .rooms-view-badge {
  min-width: 13px;
  height: 13px;
  line-height: 13px;
  font-size: 0.56rem;
  padding: 0 3px;
}

.app-shell.is-compact.compact-side-rail-enabled .rooms-tools input {
  font-size: 0.74rem;
  padding: 6px 7px;
  border-radius: 7px;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list {
  gap: 5px;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list button {
  padding: 6px 3px;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid #e1e8ee;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-label {
  font-size: 0.72rem;
}

.app-shell.is-compact.compact-side-rail-enabled .rooms-footer {
  padding: 6px 7px;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list li {
  margin: 0;
  padding: 0;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list .conversation-section {
  padding: 3px 2px 2px;
  font-size: 0.6rem;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list button.active {
  background: #eaf8ef;
  border-color: #cfe6d8;
  box-shadow: none;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list button.has-unread:not(.active) {
  background: #fff2f2;
}

.app-shell.is-compact.compact-side-rail-enabled .conversation-list button.has-priority:not(.active),
.app-shell.is-compact.compact-side-rail-enabled .conversation-list button.has-unread.has-priority:not(.active) {
  background: #fff6e9;
}

.app-shell.is-compact.compact-side-rail-enabled .conv-main {
  gap: 4px;
}

.app-shell.is-compact.compact-side-rail-enabled .conv-icon {
  width: 10px;
  font-size: 0.68rem;
}

.app-shell.is-compact.compact-side-rail-enabled .conv-avatar {
  width: 16px;
  height: 16px;
  font-size: 0.62rem;
}

.app-shell.is-compact.compact-side-rail-enabled .conv-title {
  font-size: 0.72rem;
}

.app-shell.is-compact .chat-header {
  height: auto;
  min-height: 38px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  gap: 4px 8px;
  padding: 0px 8px 0;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.app-shell.is-compact .topic-bar,
.app-shell.is-compact .private-subheader {
  flex: 0 0 auto;
}

.app-shell.is-compact .topic-bar {
  display: none !important;
}

.mobile-conversation-strip {
  display: none;
}

.app-shell.is-compact.compact-top-tabs-enabled .mobile-conversation-strip {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 39px;
  height: 39px;
  gap: 0;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  position: relative;
  z-index: 26;
  background: #f8fbfd;
  border-bottom: 1px solid #d7e1e8;
}

.app-shell.is-compact.compact-top-tabs-enabled .mobile-conversation-strip.mobile-admin-strip {
  min-height: 36px;
  height: 36px;
  background: #f4f6f7;
  border-bottom: 1px solid #d3dbe1;
}

.app-shell.is-compact.compact-top-tabs-enabled .mobile-conversation-strip.mobile-admin-strip .mobile-conversation-tab {
  min-height: 34px;
  height: 34px;
}

.app-shell.is-compact.compact-top-tabs-enabled .topic-bar,
.app-shell.is-compact.compact-top-tabs-enabled .private-subheader {
  position: relative;
  z-index: 25;
  background: #f7f9fb;
}

.app-shell.is-compact.compact-top-tabs-enabled .mobile-conversation-strip::-webkit-scrollbar {
  height: 4px;
}

.mobile-conversation-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 180px;
  min-height: 38px;
  height: 38px;
  padding: 0 6px;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #526a77 !important;
  box-shadow: none !important;
}

.mobile-conversation-tab.has-actions {
  justify-content: space-between;
  gap: 6px;
  padding-right: 2px;
}

.mobile-conversation-tab.active {
  border-bottom-color: #23bf65 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #17303d !important;
  box-shadow: none !important;
}

.mobile-conversation-tab.has-unread,
.mobile-conversation-tab.has-private-unread {
  color: #d92c2c !important;
}

.mobile-conversation-tab.has-priority {
  color: #23bf65 !important;
}

@keyframes mobile-mention-green-blink {
  0%, 52%, 100% {
    color: #23bf65;
    text-shadow: none;
  }
  58%, 78% {
    color: #8df5bc;
    text-shadow: 0 0 6px rgba(35, 191, 101, 0.38);
  }
}

.mobile-conversation-tab.has-priority .mobile-conversation-tab-title {
  animation: mobile-mention-green-blink 1.35s steps(2, end) infinite;
}

.mobile-conversation-tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
}

.mobile-conversation-tab-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.mobile-conversation-tab-actions .mini-action {
  width: 14px;
  height: 14px;
  opacity: 0.65;
}

.mobile-conversation-tab-actions .mini-action svg {
  width: 13px;
  height: 13px;
}

.app-shell.is-compact.compact-top-tabs-enabled .rooms-panel {
  display: none !important;
}

.app-shell.is-compact.compact-top-tabs-enabled .nick-panel {
  position: absolute !important;
  right: 0;
  left: auto;
  top: var(--compact-side-top, 220px);
  bottom: var(--compact-side-bottom, 120px);
  width: 30% !important;
  min-width: 0;
  max-width: none;
  height: auto;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  touch-action: pan-y;
  z-index: 1201;
  border-radius: 0;
  border: 0 !important;
  border-left: 1px solid #cfd9df !important;
  box-shadow: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  will-change: transform, opacity;
}

.app-shell.is-compact.compact-top-tabs-enabled .messages {
  position: relative;
  z-index: 1;
  padding-top: 14px !important;
  margin-top: 0 !important;
  padding-right: 30%;
  scroll-padding-top: 14px;
  transition: padding-right 0.22s ease;
}

.app-shell.is-compact.compact-top-tabs-enabled .compact-side-pane-toggle {
  position: absolute;
  right: 30%;
  top: calc(var(--compact-side-top, 220px) - 32px);
  width: 18px;
  height: 36px;
  border: 1px solid #c6d4de;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, #ffffff 0%, #edf4f9 100%);
  color: #365365;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1204;
  box-shadow: 0 2px 8px rgba(18, 38, 51, 0.12);
  transition: right 0.22s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.app-shell.is-compact.compact-top-tabs-enabled.compact-side-pane-collapsed .messages,
.app-shell.is-compact.compact-top-tabs-enabled.hide-nick-panel .messages {
  padding-right: 0 !important;
}

.app-shell.is-compact.compact-top-tabs-enabled.compact-side-pane-collapsed .nick-panel,
.app-shell.is-compact.compact-top-tabs-enabled.hide-nick-panel .nick-panel {
  transform: translateX(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.app-shell.is-compact.compact-top-tabs-enabled.compact-side-pane-collapsed .compact-side-pane-toggle {
  right: 0;
}

.app-shell.is-compact.compact-top-tabs-enabled .compact-side-pane-toggle .compact-side-pane-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  transform: translateY(-0.5px);
}

.app-shell.is-compact.compact-top-tabs-enabled.hide-nick-panel .compact-side-pane-toggle {
  display: none !important;
}

.app-shell.is-compact .private-subheader {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.app-shell.is-compact .private-subheader-main {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.app-shell.is-compact .private-subheader-actions {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
  gap: 6px;
  flex-wrap: nowrap;
}

.app-shell.is-compact .private-subheader-actions .header-icon-btn,
.app-shell.is-compact .private-subheader-actions .room-actions-btn {
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
}

.app-shell.is-compact .private-subheader-actions .header-icon-btn:not(.private-call-btn),
.app-shell.is-compact .private-subheader-actions .room-actions-btn {
  width: 30px;
  min-width: 30px;
  padding: 0;
}

.app-shell.is-compact .private-call-btn {
  min-width: 68px;
  height: 30px;
  padding: 0 8px;
  white-space: nowrap;
}

.app-shell.is-compact .chat-header > :first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.app-shell.is-compact .active-header-main {
  display: none !important;
}

.app-shell.is-compact #mainHeaderInfo {
  display: none !important;
}

.app-shell.is-compact .app-title {
  font-size: 0.74rem;
  line-height: 1.02;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell.is-compact #connectionState {
  margin-top: 2px;
  font-size: 0.72rem;
  line-height: 1.05;
}

.app-shell.is-compact .pm-inbox-widget {
  position: fixed;
  top: calc(2px + var(--safe-area-top));
  left: calc(8px + var(--safe-area-left));
  transform: none;
  margin-top: 0;
  display: inline-flex;
  z-index: 1217;
}

.app-shell.is-compact .pm-inbox-toggle {
  height: auto;
  min-height: 32px;
  border-radius: 0;
  padding: 2px 8px;
  font-size: 0.64rem;
  gap: 6px;
}

.app-shell.is-compact .pm-inbox-title {
  font-size: 0.62rem;
}

.app-shell.is-compact .pm-inbox-meta {
  font-size: 0.5rem;
}

.app-shell.is-compact .pm-inbox-menu {
  width: min(210px, calc(100vw - 18px));
  max-height: min(300px, 50vh);
}

.app-shell.is-compact .pm-inbox-item {
  min-height: 34px;
  padding: 3px;
  gap: 3px;
}

.app-shell.is-compact .pm-inbox-open {
  min-height: 26px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.app-shell.is-compact .pm-inbox-close {
  width: 18px;
  height: 18px;
}

.app-shell.is-compact .mode-badges {
  display: none !important;
}

.app-shell.is-compact .header-actions {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 0;
  justify-self: end;
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  overflow: visible;
}

.app-shell.is-compact .compact-drawer-btn {
  display: none !important;
}

.app-shell.is-compact.compact-side-rail-enabled .compact-drawer-btn {
  display: none !important;
}

.app-shell.is-compact .presence-toggle-btn,
.app-shell.is-compact .friend-toggle-btn,
.app-shell.is-compact .summary-toggle-btn {
  min-height: 32px;
  height: 32px;
  border-radius: 8px;
  border-color: #bfd0db;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fa 100%);
  box-shadow: 0 1px 4px rgba(17, 39, 52, 0.1);
  width: auto;
  min-width: 0;
  justify-content: flex-start;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 8px;
}

.app-shell.is-compact .room-actions-btn {
  min-height: 30px;
  height: 30px;
  border-radius: 8px;
  border-color: #bfd0db;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fa 100%);
  box-shadow: 0 1px 4px rgba(17, 39, 52, 0.1);
  width: 30px;
  min-width: 30px;
  justify-content: center;
  gap: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.app-shell.is-compact .presence-toggle-btn,
.app-shell.is-compact .friend-toggle-btn,
.app-shell.is-compact .summary-toggle-btn {
  position: relative;
}

.app-shell.is-compact .presence-label,
.app-shell.is-compact .friend-label {
  display: inline;
  font-size: 0.72rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell.is-compact .presence-copy {
  display: inline-flex !important;
  min-width: 0;
  max-width: 72px;
}

.app-shell.is-compact .presence-caret,
.app-shell.is-compact .friend-caret {
  display: none;
}

.app-shell.is-compact .presence-dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-width: 2px;
  margin: 0;
}

.app-shell.is-compact .presence-toggle-btn::after {
  content: "";
}

.app-shell.is-compact .friend-toggle-btn::before {
  content: none;
}

.app-shell.is-compact .friend-toggle-btn::after {
  content: none;
}

.app-shell.is-compact .summary-toggle-btn {
  display: inline-flex !important;
  width: 32px;
  min-width: 32px;
  padding: 0;
  justify-content: center;
  order: 1;
}

.app-shell.is-compact #presenceWidget {
  order: 2;
}

.app-shell.is-compact #friendWidget {
  order: 3;
}

.app-shell.is-compact .summary-toggle-btn .friend-label {
  display: none !important;
}

.app-shell.is-compact .summary-toggle-icon {
  display: inline-flex;
}

.app-shell.is-compact .room-actions-btn {
  font-size: 0;
}

.app-shell.is-compact .room-actions-btn::before {
  content: "⋯";
  font-size: 1rem;
  line-height: 1;
}

.app-shell.is-compact .room-actions-btn::after {
  content: "";
}

.app-shell.is-compact .friend-pending-badge {
  position: absolute;
  top: -5px;
  right: -5px;
}

.app-shell.is-compact .presence-menu,
.app-shell.is-compact .friend-menu {
  position: fixed;
  left: 8px;
  right: 8px;
  top: auto;
  bottom: calc(72px + var(--safe-area-bottom));
  width: auto;
  max-height: min(62dvh, 460px);
  padding: 10px 10px calc(10px + var(--safe-area-bottom));
  border-radius: 14px 14px 10px 10px;
  border: 1px solid #c7d4de;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
  box-shadow: 0 -10px 28px rgba(10, 24, 34, 0.2);
  display: grid;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 2147483000 !important;
}

.app-shell.is-compact.overlay-presence-open .chat-header,
.app-shell.is-compact.overlay-friend-open .chat-header {
  z-index: 1705;
}

.app-shell.is-compact .messages {
  flex: 1 1 auto;
  padding: 8px 10px 6px;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.app-shell.is-compact .composer-tools {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: 26px 26px 26px 30px 44px 52px 98px;
  padding: 3px 6px;
  gap: 4px;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  align-items: center;
  position: relative;
  z-index: 2147482990 !important;
  isolation: isolate;
}

.app-shell.is-compact .composer-tools::-webkit-scrollbar {
  display: none;
}

.app-shell.is-compact .composer-tools {
  scrollbar-width: none;
}

.app-shell.is-compact .composer-popover-wrap {
  position: relative;
  z-index: 1506;
}

.app-shell.is-compact .composer-popover-panel {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(74px + var(--safe-area-bottom)) !important;
  transform: translateX(-50%) !important;
  width: min(88vw, 320px) !important;
  max-width: min(88vw, 320px) !important;
  z-index: 2147483003 !important;
  pointer-events: auto !important;
}

.app-shell.is-compact .composer-emoji-panel,
.app-shell.is-compact .composer-color-panel {
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
}

.app-shell.is-compact .composer-emoji-scroll {
  width: 100% !important;
  max-width: 100% !important;
  height: min(42svh, 300px) !important;
  max-height: min(42svh, 300px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Keep side pane visible but below overlays (Safari-safe, no :has dependency) */
.app-shell.is-compact.overlay-emoji-open .nick-panel,
.app-shell.is-compact.overlay-emoji-open .rooms-panel,
.app-shell.is-compact.overlay-suggest-open .nick-panel,
.app-shell.is-compact.overlay-suggest-open .rooms-panel,
.app-shell.is-compact.overlay-color-open .nick-panel,
.app-shell.is-compact.overlay-color-open .rooms-panel,
.app-shell.is-compact.overlay-presence-open .nick-panel,
.app-shell.is-compact.overlay-presence-open .rooms-panel,
.app-shell.is-compact.overlay-friend-open .nick-panel,
.app-shell.is-compact.overlay-friend-open .rooms-panel {
  z-index: 1705 !important;
}

.app-shell.is-compact .composer-tools > * {
  min-width: 0;
  width: auto;
}

.app-shell.is-compact #fmtBold,
.app-shell.is-compact #fmtItalic,
.app-shell.is-compact #fmtUnderline {
  width: 26px;
  min-width: 26px;
  padding: 0;
}

.app-shell.is-compact #fmtEmojiWrap {
  width: 30px;
  min-width: 30px;
}

.app-shell.is-compact .chat-font-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  font-size: 0.72rem;
}

.app-shell.is-compact .chat-font-picker span {
  display: none;
}

.app-shell.is-compact .chat-font-picker select {
  min-width: 0;
  width: 100%;
  height: 28px;
  padding: 0 6px;
  font-size: 0.71rem;
  font-weight: 700;
}

.app-shell.is-compact .chat-font-size-picker select {
  min-width: 52px;
  width: 52px;
  max-width: 52px;
}

.app-shell.is-compact #chatFontSelect {
    min-width: 112px;
    width: 112px;
    max-width: 112px;
}

.app-shell.is-compact #fmtColorToggle {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 0.76rem;
}

.app-shell.is-compact .message-form {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
  position: relative;
  z-index: 1704;
  isolation: isolate;
  -webkit-overflow-scrolling: auto;
}

.app-shell.is-compact .composer-tools {
  overscroll-behavior: none;
}

.app-shell.is-compact .message-form #messageInput {
  min-height: 31px;
  height: 31px;
  padding: 4px 10px;
  border-radius: 0;
  font-size: 16px !important;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  max-width: 100%;
  order: 2;
  touch-action: manipulation;
}

.app-shell.is-compact .message-form textarea#messageInput {
  resize: none;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre;
  line-height: 1.2;
}

.app-shell.is-compact .message-form .send-icon-btn {
  width: 30px;
  min-width: 30px;
  height: 31px;
  flex: 0 0 30px;
  border-radius: 0;
  border: none;
  padding: 0;
  order: 3;
}

.app-shell.is-compact .message-form .send-icon-btn svg {
  width: 15px;
  height: 15px;
}

.app-shell.is-compact .message-form .message-tab-btn {
  display: inline-flex;
  width: 30px;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  font-size: 0.72rem;
  border-radius: 0;
  border: none;
  border-right: 1px solid #bac8d2;
  padding: 0;
  order: 1;
}

.app-shell.is-compact .message-form .composer-toggle-btn {
  order: 0;
}

.app-shell.is-compact .message-form .composer-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.app-shell.is-compact .jump-to-latest {
  right: calc(8px + var(--safe-area-right));
  bottom: calc(107px + var(--safe-area-bottom));
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.69rem;
  z-index: 1708;
}

.app-shell.is-compact .tenant-brand-overlay {
  display: none !important;
}

.app-shell.is-compact .messages.has-tenant-brand {
  padding-right: 0 !important;
}

.app-shell.is-compact.compact-side-rail-enabled:not(.compact-side-pane-collapsed):not(.hide-nick-panel) .jump-to-latest,
.app-shell.is-compact.compact-top-tabs-enabled:not(.compact-side-pane-collapsed):not(.hide-nick-panel) .jump-to-latest {
  right: calc(30% + 8px + var(--safe-area-right));
}

@media (min-width: 1025px) {
  .message-form .message-tab-btn {
    display: none !important;
  }

  .pm-inbox-widget {
    display: none !important;
  }
}

.app-shell.is-compact .composer-tools > .fmt-btn,
.app-shell.is-compact .composer-tools > .composer-popover-wrap > .fmt-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border-radius: 0;
  font-size: 0.84rem;
}

.chat-effects-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.chat-effect-item {
  position: absolute;
  font-size: clamp(16px, 2.1vw, 28px);
  line-height: 1;
  opacity: 0;
  transform: translate3d(0, -8%, 0) scale(var(--scale, 1)) rotate(0deg);
  animation-duration: var(--effect-duration, 3.2s);
  animation-timing-function: cubic-bezier(0.22, 0.65, 0.25, 1);
  animation-fill-mode: forwards;
  will-change: transform, opacity;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  filter: saturate(1.06);
}

.chat-effect-item.hearts {
  color: #d6336c;
}

.chat-effect-item.notes {
  color: #2f5fd0;
}

.chat-effect-item.applause {
  color: #f59f00;
}

.chat-effect-item.party {
  color: #fd7e14;
}

.chat-effect-item.fire {
  color: #f76707;
}

.chat-effect-item.stars {
  color: #f59f00;
}

.chat-effect-item.snow {
  color: #66d9e8;
}

.chat-effect-item.rain {
  color: #4c6ef5;
}

.chat-effect-item.flowers {
  color: #e64980;
}

.chat-effect-item.boom {
  color: #f03e3e;
}

.chat-effect-item.money {
  color: #2b8a3e;
}

.chat-effect-item.rockets {
  color: #5f3dc4;
}

.chat-effect-item.motion-fall {
  animation-name: chatEffectFallV2;
}

.chat-effect-item.motion-swirl {
  animation-name: chatEffectSwirlV2;
}

.chat-effect-item.motion-float {
  animation-name: chatEffectFloatV2;
}

.chat-effect-item.motion-burst {
  animation-name: chatEffectBurstV2;
}

.chat-effect-item.motion-lift {
  animation-name: chatEffectLiftV2;
}

@keyframes chatEffectFallV2 {
  0% {
    opacity: 0;
    transform: translate3d(0, -10%, 0) scale(var(--scale, 1)) rotate(0deg);
  }
  8% {
    opacity: 0.92;
  }
  35% {
    opacity: 0.86;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), var(--fall-distance, 110vh), 0) scale(calc(var(--scale, 1) * 0.92)) rotate(var(--rotation, 420deg));
  }
}

@keyframes chatEffectSwirlV2 {
  0% {
    opacity: 0;
    transform: translate3d(0, -6%, 0) scale(var(--scale, 1)) rotate(0deg);
  }
  12% {
    opacity: 0.95;
  }
  50% {
    opacity: 0.88;
    transform: translate3d(calc(var(--drift-x, 0px) * -0.45), calc(var(--fall-distance, 110vh) * 0.45), 0)
      scale(calc(var(--scale, 1) * 1.06)) rotate(calc(var(--rotation, 420deg) * 0.4));
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), var(--fall-distance, 110vh), 0)
      scale(calc(var(--scale, 1) * 0.9)) rotate(var(--rotation, 420deg));
  }
}

@keyframes chatEffectFloatV2 {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(var(--scale, 1)) rotate(0deg);
  }
  15% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), calc(var(--fall-distance, 110vh) * -0.26), 0)
      scale(calc(var(--scale, 1) * 1.04)) rotate(var(--rotation, 280deg));
  }
}

@keyframes chatEffectBurstV2 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(calc(var(--scale, 1) * 0.55)) rotate(0deg);
  }
  14% {
    opacity: 1;
  }
  62% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate3d(
        calc(var(--burst-x, 0px) + (var(--drift-x, 0px) * 0.35)),
        calc(var(--burst-y, 0px) + (var(--drift-y, 0px) * 0.2)),
        0
      )
      scale(calc(var(--scale, 1) * 1.05))
      rotate(var(--rotation, 260deg));
  }
}

@keyframes chatEffectLiftV2 {
  0% {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(var(--scale, 1)) rotate(0deg);
  }
  10% {
    opacity: 0.98;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), calc(var(--fall-distance, 110vh) * -0.86), 0)
      scale(calc(var(--scale, 1) * 1.07)) rotate(var(--rotation, 220deg));
  }
}

.chat-area.has-topic {
  grid-template-rows: auto auto 1fr auto auto;
}

.chat-area.has-stories-rail {
  grid-template-rows: auto auto 1fr auto auto;
}

.chat-area.has-private-subheader {
  grid-template-rows: auto auto 1fr auto auto;
}

.chat-area.has-stories-rail.has-topic,
.chat-area.has-stories-rail.has-private-subheader {
  grid-template-rows: auto auto auto 1fr auto auto;
}

.chat-area.has-private-subheader.has-topic {
  grid-template-rows: auto auto auto 1fr auto auto;
}

.chat-area.has-stories-rail.has-private-subheader.has-topic {
  grid-template-rows: auto auto auto auto 1fr auto auto;
}

.chat-header {
  height: 62px;
  /* padding: 8px 12px; */
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--panel-strong);
  position: relative;
  z-index: 25;
}

.chat-header > :first-child {
  grid-column: 1;
}

.app-title {
  margin: 0;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  line-height: 1;
}

#connectionState {
  margin: 3px 0 0;
  color: var(--muted);
}

#connectionState.ok {
  color: var(--accent-2);
}

#connectionState.bad {
  color: var(--danger);
}

.pm-inbox-widget {
  margin-top: 4px;
  position: relative;
  display: none;
  flex-direction: column;
  gap: 4px;
}

@keyframes pmInboxPulse {
  0% {
    transform: translateZ(0) scale(1);
    filter: brightness(1);
    border-color: #7b3b3b;
    background: linear-gradient(180deg, #6e2d2d, #5d2424);
    box-shadow: 0 2px 8px rgba(75, 20, 20, 0.28);
    color: #ffe9e9;
  }
  35% {
    transform: translateZ(0) scale(1.03);
    filter: brightness(1.08);
    border-color: #bd6666;
    background: linear-gradient(180deg, #934040, #7b3131);
    box-shadow: 0 5px 14px rgba(115, 36, 36, 0.44);
    color: #fff7f7;
  }
  100% {
    transform: translateZ(0) scale(1);
    filter: brightness(1);
    border-color: #7b3b3b;
    background: linear-gradient(180deg, #6e2d2d, #5d2424);
    box-shadow: 0 2px 8px rgba(75, 20, 20, 0.28);
    color: #ffe9e9;
  }
}

.pm-inbox-widget.has-new-message .pm-inbox-toggle {
  animation: pmInboxPulse 0.42s ease-in-out 2;
}

.pm-inbox-widget.has-new-message .pm-inbox-count {
  border-color: #f18b8b;
  background: #f06b6b;
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .pm-inbox-widget.has-new-message .pm-inbox-toggle {
    animation: none;
  }
}

.pm-inbox-toggle {
  min-height: 24px;
  border: 1px solid #7b3b3b;
  border-radius: 11px;
  background: linear-gradient(180deg, #6e2d2d, #5d2424);
  color: #ffe9e9;
  padding: 0 9px;
  font-size: 0.68rem;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(75, 20, 20, 0.28);
}

.pm-inbox-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.pm-inbox-title {
  display: block;
  font-size: 0.66rem;
  line-height: 1;
  white-space: nowrap;
}

.pm-inbox-meta {
  display: block;
  font-size: 0.54rem;
  line-height: 1;
  opacity: 0.82;
  letter-spacing: 0.01em;
  color: inherit;
}

.pm-inbox-toggle.active,
.pm-inbox-toggle:hover {
  border-color: #8f4949;
  background: linear-gradient(180deg, #7a3232, #692a2a);
  color: #fff2f2;
}

.pm-inbox-count {
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 5px;
    border: 1px solid #c65050;
    background: #df5151;
    color: #ffffff;
    font-size: 0.50rem;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.pm-inbox-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: min(240px, 72vw);
  max-height: min(320px, 55vh);
  overflow-y: auto;
  border: 1px solid #d8dee3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(13, 27, 38, 0.2);
  padding: 6px;
  display: grid;
  gap: 0;
  z-index: 60;
}

.pm-inbox-item {
  color: #274355;
  min-height: 36px;
  padding: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}

.pm-inbox-open {
  border: 1px solid #d4dee7 !important;
  border-bottom: 1px solid #d4dee7 !important;
  border-top: 1px solid #d4dee7 !important;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%) !important;
  color: inherit !important;
  min-height: 28px;
  padding: 0 10px;
  font: inherit;
  font-weight: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.pm-inbox-open:hover {
  border-color: #bccddd !important;
  background: linear-gradient(180deg, #ffffff 0%, #eef5fa 100%) !important;
  box-shadow: 0 1px 6px rgba(17, 38, 54, 0.12);
  transform: translateY(-1px);
}

.pm-inbox-open:focus-visible {
  outline: 0;
  border-color: #6c9fd3 !important;
  box-shadow: 0 0 0 2px rgba(62, 136, 196, 0.2);
}

.pm-inbox-close {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 20px;
  height: 20px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: #8b98a3 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  opacity: 1 !important;
  margin: 0;
  box-shadow: none !important;
  transition: color 0.15s ease, transform 0.12s ease;
}

.pm-inbox-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.pm-inbox-close:hover {
  color: #bf566f !important;
  transform: scale(1.06);
}

.pm-inbox-close:focus-visible {
  outline: 0;
  color: #bf566f !important;
  box-shadow: 0 0 0 2px rgba(209, 98, 126, 0.2) !important;
  border-radius: 6px;
}

.pm-inbox-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-inbox-item strong {
  font-size: 0.7rem;
  color: #8a3b3b;
}

.chat-header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.chat-header small {
  color: var(--muted);
  font-size: 0.82rem;
}

.active-header-main {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.active-header-text {
  min-width: 0;
}

.active-header-text h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: relative;
  z-index: 24;
}

.private-subheader-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.private-chat-header-text {
  min-width: 0;
}

.private-chat-header-text h3 {
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#privateActiveTitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#privateActiveTitle .private-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#privateActiveTitle .private-title-team-mark,
#privateActiveTitle .private-title-dj-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#privateActiveTitle .private-title-team-icon,
#privateActiveTitle .private-title-dj-icon {
  width: 13px;
  height: 13px;
  display: block;
}

#privateActiveTitle .private-title-dj-icon {
  animation: dj-icon-pulse 1.2s ease-in-out infinite;
}

.private-chat-header-text small {
  color: var(--muted);
  font-size: 0.82rem;
}

.private-presence-meta {
  display: block;
  max-width: 100%;
  overflow: visible;
  text-overflow: initial;
  white-space: normal;
  word-break: break-word;
}

.private-header-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 999px;
  border: 1px solid #b9c9d3;
  background: linear-gradient(180deg, #f3f8fb, #e8f0f5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5a7180;
  overflow: visible;
  cursor: pointer;
}

.private-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.private-header-avatar.is-clickable {
  cursor: pointer;
}

.private-header-avatar.is-clickable:hover {
  border-color: #8fb3c6;
  box-shadow: 0 0 0 3px rgba(79, 153, 191, 0.15);
}

.mode-badges {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e7f1f8;
  border: 1px solid #c5d7e4;
  color: #345267;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  min-width: 0;
  justify-content: flex-end;
  overflow: visible;
}

.presence-widget {
  position: relative;
}

.presence-toggle-btn {
  min-height: 38px;
  border: 1px solid #c8d4dc;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  color: #2e4554;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(18, 38, 51, 0.08);
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.presence-toggle-btn.active,
.presence-toggle-btn:hover {
  border-color: #aabfcb;
  background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
  box-shadow: 0 4px 10px rgba(18, 38, 51, 0.12);
  transform: translateY(-1px);
}

.presence-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(32, 50, 65, 0.15);
}

.presence-dot.available {
  background: #27c66f;
}

.presence-dot.away {
  background: #f2b537;
}

.presence-dot.brb {
  background: #4ea2ff;
}

.presence-dot.busy {
  background: #ef5b62;
}

.presence-copy {
  display: inline-flex;
  text-align: left;
  line-height: 1;
}

.presence-label {
  font-size: 0.84rem;
  font-weight: 800;
}

.presence-message {
  display: none !important;
}

.presence-caret {
  font-size: 0.96rem;
  color: #3d5c6c;
  line-height: 1;
  font-weight: 800;
}

.presence-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  border: 1px solid #cdd6dc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(13, 27, 38, 0.2);
  padding: 6px;
  display: grid;
  gap: 3px;
  z-index: 260;
}

.presence-menu-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #213b49;
  padding: 8px 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
}

.presence-menu-item:hover,
.presence-menu-item.active {
  border-color: #c9d5dd;
  background: #f4f8fb;
}

.presence-menu-divider {
  height: 1px;
  margin: 4px 2px;
  background: #e3e9ee;
}

.presence-menu-message {
  padding: 6px 8px;
  border: 1px solid #d5e0e7;
  border-radius: 9px;
  background: #f6fafc;
  color: #3b5564;
  font-size: 0.76rem;
  line-height: 1.32;
  white-space: pre-wrap;
  word-break: break-word;
}

.friend-widget {
  position: relative;
}

.friend-toggle-btn {
  min-height: 38px;
  border: 1px solid #c8d4dc;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  color: #2e4554;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(18, 38, 51, 0.08);
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.friend-toggle-btn:hover,
.friend-toggle-btn.active {
  border-color: #aabfcb;
  background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
  box-shadow: 0 4px 10px rgba(18, 38, 51, 0.12);
  transform: translateY(-1px);
}

.friend-label {
  line-height: 1;
}

.friend-pending-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  background: #d94949;
  color: #ffffff;
  border: 1px solid #b13b3b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.friend-caret {
  font-size: 0.96rem;
  color: #3d5c6c;
  line-height: 1;
  font-weight: 800;
}

.friend-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 300px;
  border: 1px solid #cdd6dc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(13, 27, 38, 0.2);
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 260;
}

.friend-menu-section {
  display: grid;
  gap: 8px;
}

.friend-menu-title {
  font-size: 0.78rem;
  color: #385666;
}

.friend-policy-row {
  display: inline-flex;
  gap: 6px;
}

.friend-policy-btn {
  border: 1px solid #c8d6de;
  border-radius: 8px;
  background: #f9fcfe;
  color: #2c4959;
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.friend-policy-btn.active {
  border-color: #8fb5cb;
  background: #eaf4fb;
  color: #1f4254;
}

.friend-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.friend-add-row input {
  border: 1px solid #c9d6de;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

#friendNickInput {
  font-size: 16px;
}

.friend-add-btn {
  border: 1px solid #95bac8;
  border-radius: 8px;
  background: #eef8fc;
  color: #235064;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 700;
}

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  max-height: 350px;
  overflow-y: auto;
}

.friend-item {
  border: 1px solid #dfe3e6;
  border-radius: 10px;
  background: #f7f9fb;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.friend-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.friend-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.friend-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #c4d2dc;
  background: #eef4f8;
}

.friend-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(23, 40, 52, 0.16);
}

.friend-presence-dot.available {
  background: #27c66f;
}

.friend-presence-dot.away {
  background: #f2b537;
}

.friend-presence-dot.brb {
  background: #4ea2ff;
}

.friend-presence-dot.busy {
  background: #ef5b62;
}

.friend-presence-dot.offline {
  background: #98a2b3;
}

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

.friend-item .friend-nick {
  color: #2e4b5a;
  font-size: 0.84rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-item > span {
  color: #2e4b5a;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-presence {
  color: #5f7482;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-presence-available {
  color: #2f7d4c;
}

.friend-presence-away {
  color: #987525;
}

.friend-presence-brb {
  color: #2f67ad;
}

.friend-presence-busy {
  color: #9b3640;
}

.friend-presence-offline {
  color: #667085;
}

.friend-del-btn {
  border: 1px solid #d9c6c6;
  border-radius: 7px;
  background: #fff5f5;
  color: #8f3434;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 34px;
  height: 25px;
}

.friend-actions {
  display: inline-flex;
  gap: 4px;
}

.friend-accept-btn,
.friend-reject-btn {
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}

.friend-accept-btn {
  border: 1px solid #b6d9be;
  background: #f1fbf3;
  color: #2f6a3a;
}

.friend-reject-btn {
  border: 1px solid #e0c4c4;
  background: #fff5f5;
  color: #8f3434;
}

.friend-menu-hint {
  color: #5f7482;
  font-size: 0.72rem;
}

.header-icon-btn {
  cursor: pointer;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid #c9d1d6;
  border-radius: 10px;
  background: #fff;
  color: #425b69;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.header-icon-btn:hover {
  background: #f1f6f9;
}

.header-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.private-call-btn {
  width: auto;
  min-width: 78px;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
}

.private-subheader-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.private-subheader-actions .header-icon-btn:not(.private-call-btn),
.private-subheader-actions .room-actions-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.private-close-btn {
  border-color: #d8c4c4;
  color: #7c3c3c;
  background: linear-gradient(180deg, #fffaf9 0%, #fff2f2 100%);
}

.private-close-btn:hover {
  border-color: #caa2a2;
  background: linear-gradient(180deg, #fff4f4 0%, #ffeaea 100%);
}

.radio-player {
    position: static;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 30px;
    padding: 3.5px 8px;
    border: none;
    border-radius: 0px;
    /* background: #f8fbfd; */
    background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
    color: #334a57;
    margin-right: 0;
}

.app-shell:not(.is-compact) .chat-area > .radio-player.desktop-overlay-player {
  position: absolute;
  top: 174px;
  right: 18px;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto !important;
  max-width: max-content;
  z-index: 9;
}

.summary-toggle-btn {
  min-height: 38px;
}

.summary-toggle-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  line-height: 1;
}

.summary-toggle-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.radio-mini-btn {
  border: 1px solid #bfcbd4;
  background: #ffffff;
  color: #355261;
  width: 21px;
  height: 21px;
  min-width: 21px;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
@media (min-width: 991px) {
  #radioLayoutBtn {
    display: none;
  }
}

.radio-mini-btn:hover {
  filter: none;
  background: #edf3f7;
  border-color: #aebec9;
}

.radio-mini-btn:active {
  transform: scale(0.97);
}

.radio-mini-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#radioToggleBtn svg {
  transform: translateY(0.1px);
}

#radioToggleBtn:not(.is-active) svg {
  transform: translateX(0.45px) translateY(0.1px);
}

#radioToggleBtn svg,
#radioRefreshBtn svg {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}

.radio-mini-btn.is-active {
  color: #0f7b4d;
  border-color: #7bbd9f;
  background: #e8f7ef;
}

.radio-label {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334c5b;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-volume {
  width: 84px;
  height: 4px;
  writing-mode: horizontal-tb;
  -webkit-appearance: auto;
  accent-color: #1fb86a;
  padding: 0;
}

.radio-status {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  font-size: 0.67rem;
  color: #5f7482;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-actions-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #c8d4dc;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  color: #2e4554;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(18, 38, 51, 0.08);
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.room-actions-btn:hover {
  border-color: #aabfcb;
  background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
  box-shadow: 0 4px 10px rgba(18, 38, 51, 0.12);
  transform: translateY(-1px);
}

.compact-drawer-btn {
  display: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1px solid #c8d4dc;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  color: #2e4554;
  padding: 0;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(18, 38, 51, 0.1);
}

.compact-drawer-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-bar {
  min-height: 34px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fb;
  color: #324751;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  position: relative;
  z-index: 23;
}

.topic-bar strong {
  color: #1d2f39;
  font-weight: 700;
}

#topicText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nick-form,
.join-form,
.message-form {
  display: flex;
  gap: 8px;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid #c8cfd3;
  background: #fff;
  color: var(--text);
  border-radius: 0;
  padding: 10px 12px;
}

input:focus,
input:focus-visible {
  outline: none;
  box-shadow: none;
}

button {
  border-top: 0;
  border-bottom: 1px solid #1db954;
  background: linear-gradient(180deg, var(--rail-label-bg-start), var(--rail-label-bg-end));
  color: var(--rail-label-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.theme-rail-btn {
  overflow: hidden;
}

.theme-rail-swatch {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: var(--theme-swatch, var(--accent));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.app-shell.rail-expanded:not(.is-compact) .theme-rail-btn {
  overflow: visible;
}

.app-shell.rail-expanded:not(.is-compact) .theme-rail-btn .rail-text {
  order: 2;
}

.app-shell.rail-expanded:not(.is-compact) .theme-rail-swatch {
  position: static;
  order: 3;
  margin-left: auto;
  width: 12px;
  height: 12px;
}

.messages {
  background-color: #f5f5f5;
  background-image:
    radial-gradient(#00000008 1px, transparent 1px),
    repeating-linear-gradient(
      45deg,
      #00000002,
      #00000002 1px,
      transparent 1px,
      transparent 4px
    );
  background-size: 25px 25px, auto;
  position: relative;
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 1px;
  min-height: 0;
  overscroll-behavior: contain;
  font-family: var(--chat-font-family);
  font-size: var(--chat-font-size);
  font-weight: 600;
  z-index: 1;
}

@media (max-width: 1440px) {
  :root {
    --rail-width-collapsed: 66px;
    --rail-width-expanded: 206px;
    --nick-panel-width: 178px;
    --rooms-panel-width: 186px;
  }

  .app-shell {
    grid-template-columns: var(--rail-width-collapsed) minmax(360px, 1fr) var(--nick-panel-width) var(--rooms-panel-width);
  }

  .app-shell.hide-nick-panel {
    grid-template-columns: var(--rail-width-collapsed) minmax(360px, 1fr) 0 var(--rooms-panel-width);
  }

  .app-shell.rail-expanded {
    grid-template-columns: var(--rail-width-expanded) minmax(360px, 1fr) var(--nick-panel-width) var(--rooms-panel-width);
  }

  .app-shell.rail-expanded.hide-nick-panel {
    grid-template-columns: var(--rail-width-expanded) minmax(360px, 1fr) 0 var(--rooms-panel-width);
  }

  .action-rail {
    padding: 10px 8px;
  }

  .rail-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .chat-header {
    min-height: 56px;
    height: auto;
    padding: 6px 8px;
    gap: 8px;
    grid-template-columns: 130px 1fr auto;
  }

  .app-title {
    font-size: 0.84rem;
  }

  #connectionState {
    margin-top: 1px;
    font-size: 0.76rem;
  }

  .header-actions {
    gap: 6px;
  }

  .presence-toggle-btn,
  .friend-toggle-btn,
  .room-actions-btn {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  .topic-bar {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  .private-subheader {
    min-height: 30px;
    padding: 6px 8px;
    gap: 6px;
  }

  .private-chat-header-text h3 {
    font-size: 0.9rem;
  }

  .private-chat-header-text small {
    font-size: 0.74rem;
  }

  .panel-header {
    height: 44px;
    padding: 6px 8px;
  }

  .panel-header h3 {
    font-size: 0.72rem;
  }

  .panel-header small,
  .rooms-footer {
    font-size: 0.66rem;
  }

  .rooms-tools {
    min-height: 52px;
    padding: 7px 8px 6px;
  }

  .rooms-tools input {
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .conversation-list button {
    min-height: 34px;
    font-size: 0.78rem;
    padding: 6px 8px;
  }

  .nick-list li.nick {
    min-height: 34px;
    padding: 4px 6px;
  }

  .nick-list li.nick .label {
    font-size: 0.78rem;
  }

  .composer-tools {
    padding: 0 8px;
  }

  .message-form {
    padding: 4px 8px;
  }

  .message-form #messageInput {
    height: 38px;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .message-form .send-icon-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }
}

.staff-board-host {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 0;
  z-index: 12;
  pointer-events: none;
}

.staff-board {
  position: absolute;
  top: 8px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(20, 60, 84, 0.26);
  background: linear-gradient(135deg, rgba(17, 46, 66, 0.96), rgba(16, 58, 93, 0.93));
  color: #f6fbff;
  box-shadow: 0 10px 24px rgba(10, 30, 45, 0.35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 260ms ease, transform 320ms ease;
}

.staff-board.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.staff-board.is-leaving {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
}

.staff-board-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d5f4ff;
  background: rgba(255, 255, 255, 0.08);
}

.staff-board-track {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.staff-board-marquee {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  will-change: transform;
  animation: staff-board-marquee var(--staff-board-duration, 12s) linear 1;
}

.staff-board-marquee > span {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.staff-board-style-1 {
  background: linear-gradient(135deg, rgba(17, 46, 66, 0.96), rgba(16, 58, 93, 0.93));
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.staff-board-style-2 {
  background: linear-gradient(135deg, rgba(63, 31, 105, 0.95), rgba(94, 41, 141, 0.92));
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.staff-board-style-3 {
  background: linear-gradient(135deg, rgba(20, 76, 48, 0.95), rgba(30, 113, 72, 0.92));
  font-family: "Merriweather", Georgia, serif;
}

.staff-board-style-4 {
  background: linear-gradient(135deg, rgba(87, 37, 38, 0.95), rgba(137, 51, 49, 0.92));
  font-family: "Lato", "Segoe UI", sans-serif;
}

.staff-board-style-5 {
  background: linear-gradient(135deg, rgba(112, 76, 18, 0.95), rgba(156, 104, 19, 0.92));
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.staff-board-style-6 {
  background: linear-gradient(135deg, rgba(37, 78, 108, 0.95), rgba(22, 123, 151, 0.92));
  font-family: "Rubik", "Segoe UI", sans-serif;
}

@keyframes staff-board-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@media (max-width: 720px) {
  .staff-board {
    left: 8px;
    right: 8px;
    top: 6px;
    min-height: 34px;
    padding: 6px 9px;
    gap: 8px;
    border-radius: 10px;
  }

  .staff-board-chip {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  .staff-board-marquee > span {
    font-size: 0.82rem;
  }
}

.messages.has-tenant-brand {
  padding-right: 276px;
}

.tenant-brand-overlay {
  position: absolute;
  top: 165px;
  right: 15px;
  z-index: 6;
  width: 250px;
  height: 90px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.app-shell:not(.is-compact) .tenant-brand-overlay {
  top: 150px;
}

.tenant-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 2px 8px rgba(9, 25, 37, 0.18));
  opacity: 0.96;
}

.messages::before {
  content: "";
  margin-top: auto;
  flex: 0 0 auto;
}

.messages.has-history-loader::before {
  display: none;
  margin-top: 0;
}

.jump-to-latest {
  position: absolute;
  right: 30px;
  bottom: 125px;
  z-index: 1604;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(20, 55, 74, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fdff 0%, #e9f5fb 100%);
  color: #15374a;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(13, 38, 55, 0.22);
  cursor: pointer;
  white-space: nowrap;
}

.jump-to-latest:hover {
  filter: brightness(1.03);
}

.composer-tools {
  padding: 0px 12px 0px;
  border-top: 1px solid #d6dce2;
  background: #eef2f5;
  display: flex;
  align-items: center;
  gap: 0px;
  position: relative;
}

.app-shell:not(.is-compact) .composer-tools {
  /* Keep the radio player flush-right with a consistent 20px breathing room. */
  padding-right: 12px;
}

.app-shell:not(.is-compact) .composer-tools > .radio-player.desktop-toolbar-player {
  margin-left: auto;
}

.chat-font-picker {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 0;
  border-right: 1px solid #e5e5e5;
  color: #29414f;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-font-picker select {
    height: 30px;
    border: none;
    border-radius: 0;
    /* background: #f8fbfd; */
    background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
    color: #29414f;
    padding: 0 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.chat-font-picker select:focus,
.chat-font-picker select:focus-visible,
.quick-form select:focus,
.quick-form select:focus-visible {
  outline: none;
  box-shadow: none;
}

.composer-tools > .fmt-btn,
.composer-tools > .composer-popover-wrap > .fmt-btn {
    min-width: 34px;
    height: 30px;
    padding: 0;
    border: none;
    border-right: 1px solid #e5e5e5;
    border-radius: 0px;
    /* background: #f8fbfd; */
    background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
    color: #29414f;
    font-weight: 700;
    cursor: pointer;
}
.composer-tools > .fmt-btn:first-child {
    border-left: 1px solid #e5e5e5;
}
.composer-tools > .composer-popover-wrap:last-of-type > .fmt-btn {
    border-right: none !important;
}

#fmtItalic {
  font-style: italic;
}

#fmtUnderline {
  text-decoration: underline;
}

.composer-tools > .fmt-btn:hover,
.composer-tools > .composer-popover-wrap > .fmt-btn:hover {
  filter: none;
  background: #f4f8fb;
}

.composer-tools > .fmt-btn.active,
.composer-tools > .composer-popover-wrap > .fmt-btn.active {
  border-color: #e5e5e5;
  background: #e9f9ef;
  color: #0f5a31;
}

.composer-tools > .fmt-btn:disabled,
.composer-tools > .composer-popover-wrap > .fmt-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  border-color: #c8d2d9;
  background: #f4f7f9;
  color: #8a98a3;
}

.composer-tools > .fmt-btn:disabled:hover,
.composer-tools > .composer-popover-wrap > .fmt-btn:disabled:hover {
  filter: none;
  background: #f4f7f9;
}

.composer-popover-wrap {
  position: relative;
}

.composer-emoji-toggle {
  min-width: 42px;
  font-size: 1.04rem;
  padding: 0;
}

.composer-popover-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 320px;
  max-width: min(92vw, 320px);
  z-index: 360;
  border: 1px solid #c8d2d9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(21, 39, 49, 0.2);
  background: #fff;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.composer-emoji-scroll {
  width: 100%;
  max-height: 300px;
  overflow: auto;
  overflow-x: hidden;
  padding: 8px;
  display: grid;
  gap: 8px;
  touch-action: pan-y;
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.composer-emoji-section {
  display: block;
}

.composer-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 30px);
  grid-auto-rows: 30px;
  justify-content: start;
  gap: 6px;
}

.composer-emoji-item {
  border: 1px solid #c8d2d9 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #111b21 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0 !important;
  box-shadow: none !important;
  line-height: 0;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.composer-emoji-item:hover,
.composer-gif-item:hover {
  background: #f3f7fb !important;
}

.composer-emoji-glyph {
  color: inherit !important;
  font-size: 1.1rem;
  line-height: 1;
}

.composer-gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 30px);
  grid-auto-rows: 30px;
  justify-content: start;
  gap: 6px;
}

.composer-gif-item {
  border: 1px solid #d5dee6 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: transparent !important;
  padding: 0 !important;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: none !important;
  line-height: 0;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.composer-gif-item img {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  object-fit: contain;
  border-radius: 6px;
  background: transparent;
  display: block;
}

.composer-emoji-empty {
  grid-column: 1 / -1;
  border: 1px dashed #c7d2db;
  border-radius: 10px;
  padding: 10px;
  color: #59707f;
  font-size: 0.8rem;
  background: #f9fbfd;
}

@media (max-width: 768px) {
  .composer-emoji-scroll {
    max-height: 300px;
  }

  .composer-emoji-grid,
  .composer-gif-grid {
    grid-template-columns: repeat(auto-fill, 24px);
    grid-auto-rows: 24px;
  }

  .composer-emoji-item,
  .composer-gif-item {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 7px;
  }

  .composer-gif-item img {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 6px;
  }

  .composer-color-grid {
    grid-template-columns: repeat(auto-fill, 24px);
    grid-auto-rows: 24px;
  }

  .composer-color-item,
  .color-clear {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 7px;
  }

  .color-chip {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    border-radius: 5px;
  }
}

.color-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 42px;
  justify-content: center;
}

.color-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid #5f7584;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.color-toggle-caret {
  width: 10px;
  min-width: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.color-toggle-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #667784;
}

.color-toggle.active .color-toggle-caret::before {
  border-top-color: #0f5a31;
}

.composer-color-panel {
  width: 320px;
  max-width: min(92vw, 320px);
  padding: 8px;
  overflow: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.composer-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 32px);
  grid-auto-rows: 32px;
  justify-content: start;
  gap: 6px;
}

.composer-color-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
}

.composer-color-item.active {
  outline: 2px solid #2dbf6a;
  outline-offset: 2px;
}

.color-chip {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 6px;
  border: 1px solid #94a5b0;
  background: var(--sw);
}

.color-clear {
  border-radius: 8px;
  border: 1px solid #aebbc4;
  background: #ffffff;
  color: #7a8891;
  padding: 0;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.color-clear.active {
  border-color: #2dbf6a;
  color: #0f5a31;
  background: #e9f9ef;
}

.history-loader {
  align-self: center;
  border: 1px dashed #c5c7cb;
  background: #f6f7f8;
  color: #4f616c;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.history-loader:hover {
  filter: none;
  background: #eceff1;
}

.msg {
  max-width: 100%;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  animation: none;
  box-shadow: none;
  line-height: 1.52;
  color: rgb(15, 27, 36);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

@keyframes msgEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.msg.msg-enter {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .msg.msg-enter {
    animation: none;
  }
}

.msg.with-avatar {
  align-items: center;
}

.msg.with-avatar .msg-content {
  padding-top: 1px;
}

.messages .msg.with-avatar {
  gap: clamp(5px, calc(var(--chat-font-size) * 0.45), 10px);
}

.msg.own {
  align-self: flex-start;
  color: #0f2f40;
}

.msg.notice,
.msg.system {
  color: #5f6b76;
}

.msg.error {
  color: #b73c3c;
}

.msg.mention {
  color: #c50f0f;
  font-weight: 600;
}

.msg.attention-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 2px 8px;
  border-left: 3px solid #ff8c1a;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 194, 102, 0.28), rgba(255, 194, 102, 0.08));
  color: #7b3e00;
  font-weight: 700;
}

.msg.attention-notice .msg-time {
  color: #8a5a1c;
  font-weight: 700;
}

.msg.story-like-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 2px 8px;
  border-left: 3px solid #ff4f7a;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 126, 157, 0.22), rgba(255, 126, 157, 0.06));
  color: #bf224e;
  font-weight: 700;
}

.msg.story-like-notice .msg-time {
  color: #cd3b64;
  font-weight: 700;
}

.msg.event-line {
  color: #c35e83;
  font-weight: 600;
}

.msg-time {
  color: #7a858f;
}

.msg-from {
  font-weight: 700;
  color: #081a27;
}

.msg-from.msg-from-clickable {
  cursor: pointer;
}

.msg-from.msg-from-clickable:hover {
    text-decoration: none;
    color: #695656;
}

.msg.system .msg-from,
.msg.notice .msg-from:not(.role-founder):not(.role-sop):not(.role-aop):not(.role-halfop):not(.role-voice):not(.role-user) {
  color: #435460;
  font-weight: 600;
}

.msg.event-line .msg-from {
  color: #6e4613;
  font-weight: 700;
}

.msg.event-line .msg-text {
  font-weight: 600;
}

.msg.action .msg-time,
.msg.action .msg-text {
  color: #9c009c;
}

.msg.action .msg-text {
  font-weight: 600;
}

.msg-action-prefix {
  font-weight: 700;
}

.msg.error .msg-from {
  color: #b73c3c;
}

.msg-from.role-founder {
  color: #007568;
}

.msg-from.role-sop {
  color: #ff3b30;
}

.msg-from.role-aop {
  color: #ff7a00;
}

.msg-from.role-halfop {
  color: #c27a00;
}

.msg-from.role-voice {
  color: #00b5ff;
}

.msg-from.role-user {
  color: #081a27;
}

.msg-text {
  word-break: break-word;
  white-space: pre-wrap;
}

.msg.chanlist-entry .msg-text {
  white-space: normal;
}

.msg.chanlist-entry {
  gap: 0;
  padding: 0;
}

.msg.chanlist-header-line {
  gap: 0;
  padding: 0;
}

.chanlist-row {
  display: grid;
  grid-template-columns: minmax(100px, 100px) 100px 100px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 2px 0;
  border-bottom: 1px solid rgba(106, 124, 138, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.chanlist-channel {
  display: inline;
  font-weight: 700;
  color: #0b2d43;
  cursor: pointer;
  user-select: none;
}

.chanlist-channel:hover {
  color: #0a64a0;
  text-decoration: underline;
}

.chanlist-channel:focus-visible {
  outline: 1px dashed #5f7b8f;
  outline-offset: 1px;
}

.chanlist-users {
  color: #4a5e6b;
  font-variant-numeric: tabular-nums;
  justify-self: end;
  min-width: 28px;
  text-align: right;
}

.chanlist-modes {
  color: #3f5564;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chanlist-topic {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chanlist-row-head {
  border-bottom: 1px solid rgba(56, 77, 92, 0.35);
  font-size: 0.8rem;
  font-weight: 800;
  color: #334c5d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-top: 0;
  padding-bottom: 4px;
  cursor: default;
}

.chanlist-row-head > span:nth-child(2) {
  justify-self: end;
}

.msg-link {
  color: #0a64a0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg-link:hover {
  color: #084f80;
}

.msg-nick-link {
  border: 0;
  background: transparent;
  color: #0a64a0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.msg-nick-link:hover {
  color: #084f80;
}

.msg-content {
  min-width: 0;
  flex: 1;
}

.profile-avatar-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(145deg, #f9b25d, #f46f8a 42%, #5b7cff);
  box-shadow: 0 4px 10px rgba(18, 36, 51, 0.18);
}

.profile-avatar-frame.md {
  width: 32px;
  height: 32px;
}

.messages .profile-avatar-frame.md {
  width: var(--chat-avatar-size);
  height: var(--chat-avatar-size);
}

.profile-avatar-frame.sm {
  width: 28px;
  height: 28px;
}

.profile-avatar-core {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6fbff, #e3edf4);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #35506b;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.messages .profile-avatar-frame.md .profile-avatar-core {
  font-size: var(--chat-avatar-letter-size);
}

.profile-avatar-core img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #f7f9fb;
  box-shadow: 0 0 0 1px rgba(21, 43, 58, 0.22);
}

.profile-presence-dot[data-presence-tooltip] {
  cursor: help;
}

.floating-presence-tooltip {
  position: fixed;
  min-width: 84px;
  max-width: 240px;
  padding: 6px 8px;
  border: 1px solid #c8d4dd;
  border-radius: 8px;
  background: #ffffff;
  color: #1f3a49;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(15, 28, 38, 0.2);
  pointer-events: none;
  z-index: 120;
}

.profile-presence-dot.available {
  background: #27c66f;
}

.profile-presence-dot.away {
  background: #f2b537;
}

.profile-presence-dot.brb {
  background: #4ea2ff;
}

.profile-presence-dot.busy {
  background: #ef5b62;
}

.profile-presence-dot.offline {
  background: #98a2b3;
}

#privateHeaderPresenceDot {
  right: -3px;
  bottom: -3px;
}

.messages.private-view {
  /* background:
    radial-gradient(circle at 18% 12%, rgba(179, 214, 197, 0.3), transparent 38%),
    radial-gradient(circle at 82% 88%, rgba(182, 210, 226, 0.22), transparent 44%),
    #e8edf1; */
    background: #f1ebe3;
}

.app-shell.is-compact.compact-side-rail-enabled .messages.private-view {
  padding-right: 30% !important;
}

.app-shell.is-compact.compact-side-rail-enabled.compact-side-pane-collapsed .messages.private-view {
  padding-right: 0 !important;
}

.messages.private-view .msg.pm-bubble {
  max-width: min(74%, 680px);
  width: fit-content;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #d6dee5;
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(13, 28, 39, 0.08);
  line-height: 1.4;
  color: #10202a;
}

.messages.private-view .msg.pm-bubble.pm-own {
  align-self: flex-end;
  margin-left: auto;
}

.messages.private-view .msg.pm-bubble.pm-peer {
  align-self: flex-start;
  margin-right: auto;
}

/* Hard lock for legacy class combinations */
.messages.private-view .msg.pm-bubble.own {
  align-self: flex-end !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}

.messages.private-view .msg.pm-bubble:not(.own) {
  align-self: flex-start !important;
  margin-right: auto !important;
  margin-left: 0 !important;
}

.messages.private-view .msg.pm-bubble.with-avatar {
  max-width: 100%;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.messages.private-view .msg.pm-bubble.with-avatar .msg-content {
  flex: 0 1 auto;
  max-width: min(100%, 680px);
  width: fit-content;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #d6dee5;
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(13, 28, 39, 0.08);
  line-height: 1.4;
  color: #10202a;
}

.messages.private-view .msg.pm-bubble.pm-own:not(.with-avatar) {
  background: #dcf8c6;
  border-color: #c2e3a8;
  color: #102816;
}

.messages.private-view .msg.pm-bubble.with-avatar.pm-own {
  flex-direction: row-reverse;
  background: transparent;
  border-color: transparent;
}

.messages.private-view .msg.pm-bubble.with-avatar.pm-own .msg-content {
  background: #dcf8c6;
  border-color: #c2e3a8;
  color: #102816;
}

.messages.private-view .msg.pm-bubble .msg-time {
  color: #6f7f89;
}

.messages.private-view .msg.pm-bubble .msg-text {
  white-space: pre-wrap;
}

.messages.private-view .msg.system,
.messages.private-view .msg.notice,
.messages.private-view .msg.error,
.messages.private-view .msg.event-line {
  align-self: center;
}

.msg-gif {
  display: inline-block;
  vertical-align: middle;
  margin: 2px 4px 2px 0;
  overflow: hidden;
}

.msg-reaction-gif {
  max-width: 64px;
  max-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msg-gif img {
  display: block;
  max-width: 90px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: cover;
}

.msg-reaction-gif img {
  object-fit: contain;
  max-width: 48px;
  max-height: 48px;
}

.msg-inline-smiley {
  display: inline-block;
  font-size: 1.22em;
  line-height: 1;
  vertical-align: -0.08em;
}

.msg-inline-smiley-image {
  display: inline-block;
  width: 1.45em;
  height: 1.45em;
  object-fit: contain;
  vertical-align: -0.24em;
}

.pm-status {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  vertical-align: middle;
  transform: translateY(0.5px);
  gap: 1px;
}

.pm-status.pm-sent {
  color: #7c8993;
}

.pm-status.pm-delivered {
  color: #637786;
}

.pm-status.pm-read {
  color: #1b9bdb;
}

.pm-tick {
  display: inline-block;
  line-height: 1;
}

.pm-status .pm-tick + .pm-tick {
  margin-left: -2px;
}

.message-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-top: 1px solid #d6dce2;
  background: #eef2f5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.command-hint {
  position: absolute;
  left: 16px;
  bottom: calc(100% + 4px);
  font-size: 0.78rem;
  color: #b14c4c;
  line-height: 1.2;
  pointer-events: none;
}

#messageInput.invalid-command {
  border-color: #d96a6a;
  box-shadow: 0 0 0 2px rgba(217, 106, 106, 0.16);
}

.message-form #messageInput {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 12px 12px;
  background: #fff;
  border: 1px solid #c6ced5;
  border-radius: 0;
  border-color: #c6ced5;
  font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.2;
  text-transform: none;
  resize: none;
  overflow-y: hidden;
  white-space: pre;
  appearance: none;
  -webkit-appearance: none;
}
.message-form #messageInput:focus {
  outline: none;
  box-shadow: none;
}
.message-form .send-icon-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 0;
  border: 1px solid #b7c4cf;
  background: #f9fbfc;
  color: #2e6178;
  box-shadow: 0 1px 2px rgba(16, 33, 43, 0.08);
}

.message-form .message-tab-btn {
  display: none;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #bac8d2;
  background: #f7fbfd;
  color: #355b70;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.message-form .message-tab-btn:hover {
  background: #edf5f9;
}

.message-form .composer-toggle-btn {
  font-size: 0;
  line-height: 0;
}

.message-form .composer-toggle-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.message-form .send-icon-btn:hover {
  filter: none;
  background: #f0f5f8;
  color: #1f5168;
}

.message-form .send-icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.message-form .send-icon-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nick-panel,
.rooms-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  background: #fff;
}

.app-shell.hide-nick-panel .nick-panel {
  min-width: 0;
  width: 0;
  overflow: hidden;
  border-right: 0;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 35;
  cursor: col-resize;
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: background 0.14s ease;
}

.resize-handle:hover::after {
  background: #9bb2bf;
}

.resize-handle-chat-nick {
  left: -5px;
}

.resize-handle-nick-rooms {
  left: -5px;
}

.app-shell.hide-nick-panel .resize-handle-chat-nick {
  display: none;
}

.nick-panel {
  border-right: 1px solid var(--border);
}

.panel-header {
  height: 62px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  margin: 0;
  font-size: 0.98rem;
}

.panel-header small {
  color: var(--muted);
}

.nick-list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  overflow-y: auto;
}
.conversation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.nick-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nick-list li {
  border-bottom: 1px solid #dfe3e6;
  border-radius: 0;
  background: #ffffff;
  padding: 5px 5px;
  font-weight: 600;
  font-size: 15px;
  font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
}

.nick-list li.nick {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nick-list li.nick:hover {
  background: rgba(32, 44, 51, 0.09);
  border-color: #c8d7e4;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(24, 52, 74, 0.08);
}

.nick-list li.nick:hover .nick-menu-btn {
  opacity: 0.9;
}

.nick-list li.nick.is-expanded {
  background: #edf4f9;
  border-color: #cfdce7;
  transform: none;
  box-shadow: none;
}

.nick-list li.nick .prefix {
  width: 18px;
  text-align: center;
  font-weight: 800;
  order: 3;
  margin-right: -3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.nick-list li.nick .team-mark {
  width: 20px;
  height: 20px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nick-list li.nick .team-mark.hidden {
  display: none;
}

.nick-list li.nick .team-mark-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(12, 24, 34, 0.2));
}

.nick-list li.nick .dj-mark {
  width: 18px;
  height: 18px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nick-list li.nick .dj-mark.hidden {
  display: none;
}

.nick-list li.nick .dj-mark-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(40, 16, 0, 0.35));
  animation: dj-icon-pulse 1.2s ease-in-out infinite;
  max-width: 18px;
  max-height: 18px;
  display: block;
}

.app-shell.is-compact .nick-list li.nick .dj-mark {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  overflow: hidden;
}

.app-shell.is-compact .nick-list li.nick .dj-mark-icon {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  object-fit: contain !important;
  display: block;
}

.nick-list li.nick .prefix svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell.is-compact .nick-list li.nick .prefix svg {
  width: 12px;
  height: 12px;
}

.nick-list li.nick .label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  flex: 1;
  order: 3;
}

.nick-list li.nick .label-name {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nick-list li.nick .label.has-custom-color {
  font-weight: 800;
}

.nick-color-preview-label.has-style,
.nick-list li.nick .label.has-custom-color {
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.nick-list li.nick .label.is-live-dj,
#privateActiveTitle.is-live-dj .private-title-text {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  background-image: linear-gradient(90deg, #ffdf4d 0%, #ff7a00 32%, #ff2d55 64%, #7a5cff 100%) !important;
  background-size: 240% 100% !important;
  animation: nick-color-shift 2.2s linear infinite, dj-nick-glow 1.4s ease-in-out infinite !important;
  font-weight: 900 !important;
}

.nick-color-preview-label.nick-color-preset-ruby,
.nick-list li.nick .label.nick-color-preset-ruby {
  background-image: linear-gradient(180deg, #ff8897 0%, #e5485d 100%);
}

.nick-color-preview-label.nick-color-preset-ocean,
.nick-list li.nick .label.nick-color-preset-ocean {
  background-image: linear-gradient(180deg, #56b9ff 0%, #0f8cff 100%);
}

.nick-color-preview-label.nick-color-preset-emerald,
.nick-list li.nick .label.nick-color-preset-emerald {
  background-image: linear-gradient(180deg, #52e494 0%, #19b86a 100%);
}

.nick-color-preview-label.nick-color-preset-sunset,
.nick-list li.nick .label.nick-color-preset-sunset {
  background-image: linear-gradient(180deg, #ffb066 0%, #ff7a18 100%);
}

.nick-color-preview-label.nick-color-preset-violet,
.nick-list li.nick .label.nick-color-preset-violet {
  background-image: linear-gradient(180deg, #b296ff 0%, #7b61ff 100%);
}

.nick-color-preview-label.nick-color-preset-gold,
.nick-list li.nick .label.nick-color-preset-gold {
  background-image: linear-gradient(180deg, #f4d87d 0%, #d8a11d 100%);
}

.nick-color-preview-label.nick-color-preset-rose,
.nick-list li.nick .label.nick-color-preset-rose {
  background-image: linear-gradient(180deg, #ff96ad 0%, #ef476f 100%);
}

.nick-color-preview-label.nick-color-preset-sky,
.nick-list li.nick .label.nick-color-preset-sky {
  background-image: linear-gradient(180deg, #86d1ff 0%, #39a0ed 100%);
}

.nick-color-preview-label.nick-color-preset-mint,
.nick-list li.nick .label.nick-color-preset-mint {
  background-image: linear-gradient(180deg, #7ff3e7 0%, #2ec4b6 100%);
}

.nick-color-preview-label.nick-color-preset-peach,
.nick-list li.nick .label.nick-color-preset-peach {
  background-image: linear-gradient(180deg, #ffc397 0%, #ff9f68 100%);
}

.nick-color-preview-label.nick-color-preset-orchid,
.nick-list li.nick .label.nick-color-preset-orchid {
  background-image: linear-gradient(180deg, #deb0ff 0%, #b565f5 100%);
}

.nick-color-preview-label.nick-color-preset-steel,
.nick-list li.nick .label.nick-color-preset-steel {
  background-image: linear-gradient(180deg, #a7b7c1 0%, #607d8b 100%);
}

.nick-color-preview-label.nick-color-preset-berry,
.nick-list li.nick .label.nick-color-preset-berry {
  background-image: linear-gradient(180deg, #ff9bc6 0%, #b83b7a 100%);
}

.nick-color-preview-label.nick-color-preset-lagoon,
.nick-list li.nick .label.nick-color-preset-lagoon {
  background-image: linear-gradient(180deg, #7ee8ff 0%, #1976d2 100%);
}

.nick-color-preview-label.nick-color-preset-forest,
.nick-list li.nick .label.nick-color-preset-forest {
  background-image: linear-gradient(180deg, #95f58d 0%, #16803c 100%);
}

.nick-color-preview-label.nick-color-preset-copper,
.nick-list li.nick .label.nick-color-preset-copper {
  background-image: linear-gradient(180deg, #ffc486 0%, #c56a1a 100%);
}

.nick-color-preview-label.nick-color-preset-amethyst,
.nick-list li.nick .label.nick-color-preset-amethyst {
  background-image: linear-gradient(180deg, #e1bfff 0%, #7e3ff2 100%);
}

.nick-color-preview-label.nick-color-preset-mono,
.nick-list li.nick .label.nick-color-preset-mono {
  background-image: linear-gradient(180deg, #afb8c3 0%, #263238 100%);
}

.nick-color-preview-label.nick-color-preset-neon,
.nick-list li.nick .label.nick-color-preset-neon {
  background-image: linear-gradient(90deg, #00e5ff 0%, #00ff9c 32%, #ffe600 64%, #ff5c8a 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 3.2s linear infinite;
}

.nick-color-preview-label.nick-color-preset-fire,
.nick-list li.nick .label.nick-color-preset-fire {
  background-image: linear-gradient(90deg, #ff4d4d 0%, #ff8a00 35%, #ffd400 68%, #ff4d4d 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 2.6s linear infinite;
}

.nick-color-preview-label.nick-color-preset-aurora,
.nick-list li.nick .label.nick-color-preset-aurora {
  background-image: linear-gradient(90deg, #4facfe 0%, #00f2fe 30%, #43e97b 60%, #38f9d7 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 3.4s linear infinite;
}

.nick-color-preview-label.nick-color-preset-royal,
.nick-list li.nick .label.nick-color-preset-royal {
  background-image: linear-gradient(90deg, #5b4bff 0%, #9b5cff 36%, #ff6ac1 70%, #5b4bff 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-plasma,
.nick-list li.nick .label.nick-color-preset-plasma {
  background-image: linear-gradient(90deg, #ff4ecd 0%, #7b61ff 32%, #36cfff 68%, #ff4ecd 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-matrix,
.nick-list li.nick .label.nick-color-preset-matrix {
  background-image: linear-gradient(90deg, #b7ff00 0%, #4caf50 35%, #00c853 72%, #b7ff00 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 3.1s linear infinite;
}

.nick-color-preview-label.nick-color-preset-inferno,
.nick-list li.nick .label.nick-color-preset-inferno {
  background-image: linear-gradient(90deg, #ff3d00 0%, #ff9100 32%, #ffd740 65%, #ff1744 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 2.4s linear infinite;
}

.nick-color-preview-label.nick-color-preset-icewave,
.nick-list li.nick .label.nick-color-preset-icewave {
  background-image: linear-gradient(90deg, #f6fdff 0%, #80d8ff 28%, #00b0ff 70%, #f6fdff 100%);
  background-size: 220% 100%;
  animation: nick-color-shift 3.6s linear infinite;
}

@keyframes dj-icon-pulse {
  0% { transform: scale(0.92); opacity: 0.86; }
  50% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.86; }
}

@keyframes dj-nick-glow {
  0% { text-shadow: 0 0 5px rgba(255, 134, 30, 0.35); }
  50% { text-shadow: 0 0 13px rgba(255, 64, 140, 0.72); }
  100% { text-shadow: 0 0 5px rgba(120, 92, 255, 0.42); }
}

.nick-color-preview-label.nick-color-preset-fb-efsane,
.nick-list li.nick .label.nick-color-preset-fb-efsane {
  background-image: linear-gradient(90deg, #001b6e 0%, #ffea00 22%, #001b6e 48%, #ffea00 70%, #001b6e 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.6s linear infinite;
}

.nick-color-preview-label.nick-color-preset-fb-kadikoy,
.nick-list li.nick .label.nick-color-preset-fb-kadikoy {
  background-image: linear-gradient(90deg, #04134f 0%, #1f3ebd 24%, #ffdc2f 54%, #1f3ebd 76%, #04134f 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-fb-goldstorm,
.nick-list li.nick .label.nick-color-preset-fb-goldstorm {
  background-image: linear-gradient(90deg, #0a1f66 0%, #ffd400 20%, #fff2a8 40%, #ffd400 62%, #0a1f66 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-gs-efsane,
.nick-list li.nick .label.nick-color-preset-gs-efsane {
  background-image: linear-gradient(90deg, #a3001b 0%, #ffcc00 30%, #a3001b 62%, #ffcc00 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.4s linear infinite;
}

.nick-color-preview-label.nick-color-preset-gs-aslan,
.nick-list li.nick .label.nick-color-preset-gs-aslan {
  background-image: linear-gradient(90deg, #740012 0%, #c21228 24%, #ffb300 52%, #ffd76a 68%, #740012 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.2s linear infinite;
}

.nick-color-preview-label.nick-color-preset-gs-ates-hatti,
.nick-list li.nick .label.nick-color-preset-gs-ates-hatti {
  background-image: linear-gradient(90deg, #5a000f 0%, #ff4f1f 22%, #ffc107 44%, #ff7a00 68%, #5a000f 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.6s linear infinite;
}

.nick-color-preview-label.nick-color-preset-bjk-efsane,
.nick-list li.nick .label.nick-color-preset-bjk-efsane {
  background-image: linear-gradient(90deg, #ffffff 0%, #0e0e10 26%, #ffffff 52%, #0e0e10 77%, #ffffff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-bjk-inonu,
.nick-list li.nick .label.nick-color-preset-bjk-inonu {
  background-image: linear-gradient(90deg, #fafafa 0%, #1a1a1a 22%, #4a4a4a 46%, #fafafa 72%, #1a1a1a 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.5s linear infinite;
}

.nick-color-preview-label.nick-color-preset-bjk-kara-kartal,
.nick-list li.nick .label.nick-color-preset-bjk-kara-kartal {
  background-image: linear-gradient(90deg, #f1f1f1 0%, #101010 26%, #f1f1f1 56%, #101010 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-ts-efsane,
.nick-list li.nick .label.nick-color-preset-ts-efsane {
  background-image: linear-gradient(90deg, #7a1531 0%, #3a66d8 28%, #7a1531 56%, #3a66d8 84%, #7a1531 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.5s linear infinite;
}

.nick-color-preview-label.nick-color-preset-ts-karadeniz,
.nick-list li.nick .label.nick-color-preset-ts-karadeniz {
  background-image: linear-gradient(90deg, #5e1230 0%, #2f61de 22%, #7a1531 50%, #2f61de 78%, #5e1230 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.2s linear infinite;
}

.nick-color-preview-label.nick-color-preset-ts-firtina-neon,
.nick-list li.nick .label.nick-color-preset-ts-firtina-neon {
  background-image: linear-gradient(90deg, #7a1531 0%, #3f7cff 28%, #9a2246 54%, #67a5ff 80%, #7a1531 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-superlig-neon,
.nick-list li.nick .label.nick-color-preset-superlig-neon {
  background-image: linear-gradient(90deg, #ffdd00 0%, #001b6e 16%, #a3001b 34%, #ffffff 52%, #7a1531 70%, #2f61de 84%, #ffdd00 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.2s linear infinite;
}

.nick-color-preview-label.nick-color-preset-derbi-simsek,
.nick-list li.nick .label.nick-color-preset-derbi-simsek {
  background-image: linear-gradient(90deg, #ffffff 0%, #001b6e 18%, #ffcc00 34%, #a3001b 52%, #7a1531 70%, #2f61de 86%, #ffffff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.7s linear infinite;
}

.nick-color-preview-label.nick-color-preset-ultra-taraftar,
.nick-list li.nick .label.nick-color-preset-ultra-taraftar {
  background-image: linear-gradient(90deg, #15ff9f 0%, #00c2ff 22%, #bc5cff 46%, #ff4f7d 70%, #ffe200 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.6s linear infinite;
}

.nick-color-preview-label.nick-color-preset-dragon-fire,
.nick-list li.nick .label.nick-color-preset-dragon-fire {
  background-image: linear-gradient(90deg, #ff2d00 0%, #ff9100 20%, #ffd740 42%, #ff1744 70%, #ff2d00 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.4s linear infinite;
}

.nick-color-preview-label.nick-color-preset-cyber-ice,
.nick-list li.nick .label.nick-color-preset-cyber-ice {
  background-image: linear-gradient(90deg, #d9fbff 0%, #7ce2ff 24%, #00b0ff 56%, #7ce2ff 84%, #d9fbff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.1s linear infinite;
}

.nick-color-preview-label.nick-color-preset-toxic-rain,
.nick-list li.nick .label.nick-color-preset-toxic-rain {
  background-image: linear-gradient(90deg, #a7ff00 0%, #64dd17 26%, #00c853 58%, #a7ff00 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.9s linear infinite;
}

.nick-color-preview-label.nick-color-preset-candy-pop,
.nick-list li.nick .label.nick-color-preset-candy-pop {
  background-image: linear-gradient(90deg, #ff9ecb 0%, #ff6ea7 24%, #ffc0f1 52%, #9ad8ff 78%, #ff9ecb 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-sunset-miami,
.nick-list li.nick .label.nick-color-preset-sunset-miami {
  background-image: linear-gradient(90deg, #ff5f6d 0%, #ffc371 34%, #ff7eb3 66%, #65d6ff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-midnight-runner,
.nick-list li.nick .label.nick-color-preset-midnight-runner {
  background-image: linear-gradient(90deg, #0d1b52 0%, #2e4fa3 26%, #59c3ff 58%, #0d1b52 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-aurora-x,
.nick-list li.nick .label.nick-color-preset-aurora-x {
  background-image: linear-gradient(90deg, #4facfe 0%, #00f2fe 26%, #43e97b 58%, #38f9d7 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.4s linear infinite;
}

.nick-color-preview-label.nick-color-preset-galaxy-core,
.nick-list li.nick .label.nick-color-preset-galaxy-core {
  background-image: linear-gradient(90deg, #7b61ff 0%, #b86cff 26%, #ff77b7 58%, #7b61ff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-synthwave,
.nick-list li.nick .label.nick-color-preset-synthwave {
  background-image: linear-gradient(90deg, #7b2ff7 0%, #f107a3 34%, #00dbde 68%, #7b2ff7 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-mint-burst,
.nick-list li.nick .label.nick-color-preset-mint-burst {
  background-image: linear-gradient(90deg, #7fffd4 0%, #00e5b0 28%, #00c896 58%, #7fffd4 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.1s linear infinite;
}

.nick-color-preview-label.nick-color-preset-rose-luxe,
.nick-list li.nick .label.nick-color-preset-rose-luxe {
  background-image: linear-gradient(90deg, #ff8fab 0%, #ef476f 34%, #ffb3c6 70%, #ff8fab 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3s linear infinite;
}

.nick-color-preview-label.nick-color-preset-gold-rush,
.nick-list li.nick .label.nick-color-preset-gold-rush {
  background-image: linear-gradient(90deg, #ffec99 0%, #ffd43b 26%, #ffc107 58%, #ffec99 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-polar-light,
.nick-list li.nick .label.nick-color-preset-polar-light {
  background-image: linear-gradient(90deg, #f3fcff 0%, #9be7ff 28%, #53c5ff 60%, #f3fcff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.2s linear infinite;
}

.nick-color-preview-label.nick-color-preset-thunder-purple,
.nick-list li.nick .label.nick-color-preset-thunder-purple {
  background-image: linear-gradient(90deg, #5f27cd 0%, #9b5de5 26%, #c77dff 60%, #5f27cd 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.7s linear infinite;
}

.nick-color-preview-label.nick-color-preset-matrix-x,
.nick-list li.nick .label.nick-color-preset-matrix-x {
  background-image: linear-gradient(90deg, #b7ff00 0%, #4caf50 34%, #00c853 66%, #b7ff00 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.9s linear infinite;
}

.nick-color-preview-label.nick-color-preset-lava-flow,
.nick-list li.nick .label.nick-color-preset-lava-flow {
  background-image: linear-gradient(90deg, #ff3d00 0%, #ff9100 32%, #ffd740 66%, #ff3d00 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.5s linear infinite;
}

.nick-color-preview-label.nick-color-preset-hologram-pro,
.nick-list li.nick .label.nick-color-preset-hologram-pro {
  background-image: linear-gradient(90deg, #7df9ff 0%, #b28dff 26%, #ff8de1 58%, #7df9ff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 2.8s linear infinite;
}

.nick-color-preview-label.nick-color-preset-imza,
.nick-list li.nick .label.nick-color-preset-imza {
  background-image: linear-gradient(90deg, #ffe9b8 0%, #ff9fcc 34%, #8ec5ff 68%, #ffe9b8 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.4s linear infinite, nick-text-bob 1.9s ease-in-out infinite;
  font-family: "Pacifico", "Segoe Script", "Bradley Hand", cursive;
  font-weight: 400;
  letter-spacing: 0;
  display: inline-block;
  text-shadow: 0 0 8px rgba(255, 189, 139, 0.28);
}

.nick-color-preview-label.nick-color-preset-candy-script,
.nick-list li.nick .label.nick-color-preset-candy-script {
  background-image: linear-gradient(90deg, #ffd7ef 0%, #ffb78a 30%, #ffe987 62%, #9bc9ff 100%);
  background-size: 240% 100%;
  animation: nick-color-shift 3.3s linear infinite, nick-text-elastic 1.8s ease-in-out infinite;
  font-family: "Pacifico", "Segoe Script", "Bradley Hand", cursive;
  font-weight: 400;
  letter-spacing: 0;
  display: inline-block;
  text-shadow: 0 0 8px rgba(255, 206, 170, 0.26);
}

.nick-color-preview-label.nick-color-preset-sahip1,
.nick-list li.nick .label.has-custom-color.nick-color-preset-sahip1 {
  color: #ff2f72;
  -webkit-text-fill-color: #ff2f72;
  background-image: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  text-shadow: 0 0 6px rgba(255, 47, 114, 0.45), 0 0 14px rgba(255, 47, 114, 0.2);
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-block;
  animation: nick-owner-breathe-rose 2.4s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-sahip2,
.nick-list li.nick .label.has-custom-color.nick-color-preset-sahip2 {
  color: #00d1ff;
  -webkit-text-fill-color: #00d1ff;
  background-image: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  text-shadow: 0 0 7px rgba(0, 209, 255, 0.5), 0 0 16px rgba(0, 209, 255, 0.24);
  font-weight: 800;
  letter-spacing: 0.015em;
  display: inline-block;
  animation: nick-owner-breathe-cyan 2.8s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-sahip3,
.nick-list li.nick .label.has-custom-color.nick-color-preset-sahip3 {
  color: #ffc247;
  -webkit-text-fill-color: #ffc247;
  background-image: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  text-shadow: 0 0 8px rgba(255, 194, 71, 0.55), 0 0 18px rgba(255, 194, 71, 0.28);
  font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-block;
  animation: nick-owner-breathe-gold 3.1s ease-in-out infinite;
}

@keyframes nick-owner-breathe-rose {
  0% {
    transform: translateY(0) scale(1);
    text-shadow: 0 0 6px rgba(255, 47, 114, 0.45), 0 0 14px rgba(255, 47, 114, 0.2);
  }
  50% {
    transform: translateY(-0.4px) scale(1.03);
    text-shadow: 0 0 10px rgba(255, 47, 114, 0.8), 0 0 26px rgba(255, 47, 114, 0.45);
  }
  100% {
    transform: translateY(0) scale(1);
    text-shadow: 0 0 6px rgba(255, 47, 114, 0.45), 0 0 14px rgba(255, 47, 114, 0.2);
  }
}

@keyframes nick-owner-breathe-cyan {
  0% {
    transform: translateY(0) scale(1);
    text-shadow: 0 0 7px rgba(0, 209, 255, 0.5), 0 0 16px rgba(0, 209, 255, 0.24);
    letter-spacing: 0.015em;
  }
  50% {
    transform: translateY(-0.35px) scale(1.025);
    text-shadow: 0 0 12px rgba(0, 209, 255, 0.86), 0 0 28px rgba(0, 209, 255, 0.5);
    letter-spacing: 0.03em;
  }
  100% {
    transform: translateY(0) scale(1);
    text-shadow: 0 0 7px rgba(0, 209, 255, 0.5), 0 0 16px rgba(0, 209, 255, 0.24);
    letter-spacing: 0.015em;
  }
}

@keyframes nick-owner-breathe-gold {
  0% {
    transform: translateY(0) scale(1);
    text-shadow: 0 0 8px rgba(255, 194, 71, 0.55), 0 0 18px rgba(255, 194, 71, 0.28);
  }
  50% {
    transform: translateY(-0.45px) scale(1.035) rotate(-0.35deg);
    text-shadow: 0 0 13px rgba(255, 194, 71, 0.85), 0 0 30px rgba(255, 194, 71, 0.5);
  }
  100% {
    transform: translateY(0) scale(1);
    text-shadow: 0 0 8px rgba(255, 194, 71, 0.55), 0 0 18px rgba(255, 194, 71, 0.28);
  }
}

@keyframes nick-color-shift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes nick-text-breathe {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 1px rgba(255, 255, 255, 0.15));
  }
  50% {
    filter: brightness(1.16) drop-shadow(0 0 7px rgba(255, 255, 255, 0.24));
  }
}

@keyframes nick-text-shimmer {
  0%, 100% {
    filter: brightness(1) saturate(1) contrast(1);
  }
  50% {
    filter: brightness(1.24) saturate(1.22) contrast(1.08);
  }
}

@keyframes nick-text-flicker {
  0%, 100% { opacity: 1; }
  15% { opacity: 0.86; }
  18% { opacity: 1; }
  43% { opacity: 0.9; }
  46% { opacity: 1; }
  72% { opacity: 0.84; }
  75% { opacity: 1; }
}

@keyframes nick-text-holo {
  from {
    filter: hue-rotate(0deg) drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
  }
  to {
    filter: hue-rotate(18deg) drop-shadow(0 0 8px rgba(255, 255, 255, 0.28));
  }
}

@keyframes nick-text-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes nick-text-sway {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
}

@keyframes nick-text-tilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(0.6deg); }
  75% { transform: rotate(-0.6deg); }
}

@keyframes nick-text-elastic {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.035, 0.985); }
  60% { transform: scale(0.992, 1.02); }
}

/* Animated motion mapping from nick-color-team-preview catalog */
.nick-color-preview-label.nick-color-preset-fb-efsane,
.nick-color-preview-label.nick-color-preset-gs-efsane,
.nick-color-preview-label.nick-color-preset-ts-efsane,
.nick-list li.nick .label.nick-color-preset-fb-efsane,
.nick-list li.nick .label.nick-color-preset-gs-efsane,
.nick-list li.nick .label.nick-color-preset-ts-efsane {
  animation: nick-color-shift 4s linear infinite, nick-text-breathe 2.4s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-fb-kadikoy,
.nick-color-preview-label.nick-color-preset-bjk-kara-kartal,
.nick-color-preview-label.nick-color-preset-midnight-runner,
.nick-color-preview-label.nick-color-preset-gold-rush,
.nick-list li.nick .label.nick-color-preset-fb-kadikoy,
.nick-list li.nick .label.nick-color-preset-bjk-kara-kartal,
.nick-list li.nick .label.nick-color-preset-midnight-runner,
.nick-list li.nick .label.nick-color-preset-gold-rush {
  animation: nick-color-shift 3.2s linear infinite, nick-text-tilt 2s ease-in-out infinite;
  transform-origin: 50% 65%;
}

.nick-color-preview-label.nick-color-preset-fb-goldstorm,
.nick-color-preview-label.nick-color-preset-derbi-simsek,
.nick-color-preview-label.nick-color-preset-candy-pop,
.nick-color-preview-label.nick-color-preset-rose-luxe,
.nick-list li.nick .label.nick-color-preset-fb-goldstorm,
.nick-list li.nick .label.nick-color-preset-derbi-simsek,
.nick-list li.nick .label.nick-color-preset-candy-pop,
.nick-list li.nick .label.nick-color-preset-rose-luxe {
  animation: nick-color-shift 3.8s linear infinite, nick-text-elastic 1.8s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-gs-aslan,
.nick-color-preview-label.nick-color-preset-ts-firtina-neon,
.nick-color-preview-label.nick-color-preset-cyber-ice,
.nick-color-preview-label.nick-color-preset-mint-burst,
.nick-color-preview-label.nick-color-preset-polar-light,
.nick-list li.nick .label.nick-color-preset-gs-aslan,
.nick-list li.nick .label.nick-color-preset-ts-firtina-neon,
.nick-list li.nick .label.nick-color-preset-cyber-ice,
.nick-list li.nick .label.nick-color-preset-mint-burst,
.nick-list li.nick .label.nick-color-preset-polar-light {
  animation: nick-color-shift 4.2s linear infinite, nick-text-bob 1.9s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-bjk-inonu,
.nick-color-preview-label.nick-color-preset-ts-karadeniz,
.nick-color-preview-label.nick-color-preset-sunset-miami,
.nick-color-preview-label.nick-color-preset-synthwave,
.nick-color-preview-label.nick-color-preset-matrix-x,
.nick-color-preview-label.nick-color-preset-hologram-pro,
.nick-list li.nick .label.nick-color-preset-bjk-inonu,
.nick-list li.nick .label.nick-color-preset-ts-karadeniz,
.nick-list li.nick .label.nick-color-preset-sunset-miami,
.nick-list li.nick .label.nick-color-preset-synthwave,
.nick-list li.nick .label.nick-color-preset-matrix-x,
.nick-list li.nick .label.nick-color-preset-hologram-pro {
  animation: nick-color-shift 4s linear infinite, nick-text-sway 1.6s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-gs-ates-hatti,
.nick-color-preview-label.nick-color-preset-ultra-taraftar,
.nick-color-preview-label.nick-color-preset-dragon-fire,
.nick-color-preview-label.nick-color-preset-lava-flow,
.nick-color-preview-label.nick-color-preset-thunder-purple,
.nick-list li.nick .label.nick-color-preset-gs-ates-hatti,
.nick-list li.nick .label.nick-color-preset-ultra-taraftar,
.nick-list li.nick .label.nick-color-preset-dragon-fire,
.nick-list li.nick .label.nick-color-preset-lava-flow,
.nick-list li.nick .label.nick-color-preset-thunder-purple {
  animation: nick-color-shift 2.8s linear infinite, nick-text-flicker 2.1s ease-in-out infinite, nick-text-bob 1.6s ease-in-out infinite, nick-text-sway 2.1s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-bjk-efsane,
.nick-list li.nick .label.nick-color-preset-bjk-efsane {
  animation: nick-color-shift 3.7s linear infinite, nick-text-shimmer 1.9s ease-in-out infinite;
}

.nick-color-preview-label.nick-color-preset-superlig-neon,
.nick-color-preview-label.nick-color-preset-aurora-x,
.nick-color-preview-label.nick-color-preset-galaxy-core,
.nick-list li.nick .label.nick-color-preset-superlig-neon,
.nick-list li.nick .label.nick-color-preset-aurora-x,
.nick-list li.nick .label.nick-color-preset-galaxy-core {
  animation: nick-color-shift 4.6s linear infinite, nick-text-holo 2.9s linear infinite alternate;
}

.nick-color-preview-label.nick-color-preset-toxic-rain,
.nick-list li.nick .label.nick-color-preset-toxic-rain {
  animation: nick-color-shift 3s linear infinite, nick-text-flicker 2.2s ease-in-out infinite;
}

.nick-list li.nick .nick-text {
  min-width: 0;
  flex: 1;
  order: 3;
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.nick-list li.nick .nick-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nick-list li.nick .nick-main .label {
  min-width: 0;
    display: inline-flex;
    flex: 0 1 auto;
    align-items: flex-end;
}

.nick-list li.nick .role-hint {
  display: block;
  margin: 0;
  font-size: 0.64rem;
  font-weight: 700;
  color: color-mix(in oklab, currentColor 68%, #607080);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nick-list li.nick .nick-avatar-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  order: 1;
}

.nick-list li.nick .nick-menu-btn {
  order: 4;
  display: none;
}

.nick-menu-btn {
  border: 0;
  background: transparent;
  color: #8d9aa3;
  padding: 0;
  width: 16px;
  height: 16px;
  opacity: 0.4;
  line-height: 0;
}

.nick-menu-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.nick-menu-btn:hover {
  filter: none;
  opacity: 1;
  color: #52606a;
}

.nick-inline-actions {
    padding: 0 !important;
    background: #f7fafd !important;
    display: block;
}

.nick-inline-actions-wrap {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    flex-direction: column;
}

.nick-inline-action-btn {
    border: none;
    border-bottom: 1px solid #d5dee6;
    background: #ffffff !important;
    color: #3a4a56 !important;
    border-radius: 0;
    padding: 6px 8px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
}
.nick-inline-action-btn:last-child {
    border-bottom: none;
}

.nick-inline-action-btn:hover {
  filter: none;
  background: #eef4fa;
  border-color: #c5d3df;
}

.nick-inline-action-btn.primary {
  background: #eaf5ff;
  border-color: #b9d5f1;
  color: #1f5f96;
}

.nick-list li.nick.role-founder {
  color: #007568;
}

.nick-list li.nick.role-sop {
  color: #ff3b30;
}

.nick-list li.nick.role-aop {
  color: #ff7a00;
}

.nick-list li.nick.role-halfop {
  color: #c27a00;
}

.nick-list li.nick.role-voice {
  color: #00b5ff;
}

.nick-list li.nick.role-user {
  color: #111b21;
}

.rooms-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.rooms-tools {
  padding: 11px 10px 8px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  min-height: 61px;
}

.rooms-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.rooms-view-btn {
  border: 1px solid #c8d1d7;
  background: #fff;
  color: #29414d;
  border-radius: 9px;
  padding: 7px 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.rooms-view-btn.active {
  border-color: #7ac39e;
  background: #eaf8ef;
  color: #1c5c40;
}

.rooms-view-badge {
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #e37c30;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  padding: 0 5px;
}

.rooms-view-badge:empty {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
  line-height: 10px;
}

.rooms-tools input {
  border-radius: 9px;
  padding: 8px 10px;
}

.rooms-nav {
  min-height: 0;
  overflow: hidden;
}

.conversation-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rooms-footer {
  border-top: 1px solid var(--border);
  background: #f7f9fb;
  color: #6a7d89;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 9px 10px;
  line-height: 1.25;
}

.rooms-footer strong {
  color: #2b3f4b;
  font-weight: 400;
}

.conversation-list li {
  display: block;
}

.conversation-list .conversation-section {
  padding: 2px 2px 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8f9b;
}

.conversation-list button {
  width: 100%;
  text-align: left;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  border-right: 0;
  border-left: 0;
  background: #fff;
  color: var(--text);
  border-radius: 0;
  padding: 8px 10px 8px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  position: relative;
}

.conversation-list button.active {
  border-color: #95d5b2;
  background: #e9f8ee;
  box-shadow: inset 0 0 0 1px #c9ebd5;
}

.conversation-list button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.conversation-list button.active::before {
  background: #25b864;
}

.conversation-list button.has-unread:not(.active) {
  border-color: #eab1b1;
  background: #fff2f2;
}

.conversation-list button.has-unread:not(.active)::before {
  background: #ea8f8f;
}

.conversation-list button.has-priority:not(.active) {
  border-color: #efc07a;
  background: #fff6e9;
}

.conversation-list button.has-priority:not(.active)::before {
  background: #efb14d;
}

.conversation-list button.has-unread.has-priority:not(.active) {
  border-color: #efc07a;
  background: #fff6e9;
}

@keyframes convo-mention-pulse {
  0%, 49.9% {
    background-color: #ffffff;
    box-shadow: none;
  }
  50%, 100% {
    background-color: #fff6e9;
    box-shadow: inset 0 0 0 1px rgba(239, 177, 77, 0.24);
  }
}

@keyframes convo-mention-bar-pulse {
  0%, 49.9% { background: #ffffff; }
  50%, 100% { background: #efb14d; }
}

.conversation-list button.has-priority:not(.active),
.conversation-list button.has-unread.has-priority:not(.active),
.conversation-list button.has-private-unread:not(.active) {
  animation: convo-mention-pulse 2.2s steps(2, end) infinite;
}

.conversation-list button.has-priority:not(.active)::before,
.conversation-list button.has-unread.has-priority:not(.active)::before,
.conversation-list button.has-private-unread:not(.active)::before {
  animation: convo-mention-bar-pulse 1.4s steps(2, end) infinite;
}

.conv-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conv-icon {
  width: 14px;
  text-align: center;
  font-weight: 800;
  color: #3f5866;
}

.conv-avatar {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
  background: #efe8ff;
  color: #6a3ec2;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

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

.conv-title {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-private .conv-icon {
  width: 20px;
  color: #6a3ec2;
}

.conversation-channel .conv-icon {
  color: #1f7a57;
}

.conv-side {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 34px;
}

.conv-mode-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conv-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #d3dce2;
  color: #627985;
  background: #f8fafc;
  font-size: 0.64rem;
  font-weight: 800;
}

.conv-mode-badge.more {
  color: #556a76;
  background: #f1f5f8;
}


.conv-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-action {
  color: #97a2aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  opacity: 0.45;
  transition: color 0.14s ease, opacity 0.14s ease, transform 0.14s ease;
}

.mini-action svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.mini-action.pin svg {
  fill: currentColor;
  stroke: none;
}

.mini-action:hover {
  color: #4f5b64;
  opacity: 1;
  transform: scale(1.08);
}

.mini-action.pin.pinned {
  color: #169956;
  opacity: 0.95;
}

.context-menu {
  position: fixed;
  min-width: 180px;
  max-width: 220px;
  background: #fff;
  border: 1px solid #d5dce1;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
  padding: 6px;
  z-index: 60;
}

.context-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #10212b;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.context-menu button:hover {
  filter: none;
  background: #eef4f7;
}

.context-menu button.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.context-menu button:disabled:hover {
  background: transparent;
}

.context-menu .menu-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #6f7f89;
  font-weight: 500;
}

.toast-container {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 70;
}

.toast {
  background: #1f2d35;
  color: #ecf3f7;
  border: 1px solid #32444f;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.85rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgb(9 37 57);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 200;
}

.overlay.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

/* Auto-hide style scrollbars on desktop-like pointers */
@media (hover: hover) and (pointer: fine) {
  .messages,
  .nick-list,
  .conversation-list,
  .rooms-panel,
  #settingsOverlay .settings-form {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }

  .messages:hover,
  .messages:focus-within,
  .nick-list:hover,
  .nick-list:focus-within,
  .conversation-list:hover,
  .conversation-list:focus-within,
  .rooms-panel:hover,
  .rooms-panel:focus-within,
  #settingsOverlay .settings-form:hover,
  #settingsOverlay .settings-form:focus-within {
    scrollbar-color: #9daeb9 transparent;
  }

  .messages::-webkit-scrollbar,
  .nick-list::-webkit-scrollbar,
  .conversation-list::-webkit-scrollbar,
  .rooms-panel::-webkit-scrollbar,
  #settingsOverlay .settings-form::-webkit-scrollbar {
    width: 9px;
    height: 9px;
  }

  .messages::-webkit-scrollbar-track,
  .nick-list::-webkit-scrollbar-track,
  .conversation-list::-webkit-scrollbar-track,
  .rooms-panel::-webkit-scrollbar-track,
  #settingsOverlay .settings-form::-webkit-scrollbar-track {
    background: transparent;
  }

  .messages::-webkit-scrollbar-thumb,
  .nick-list::-webkit-scrollbar-thumb,
  .conversation-list::-webkit-scrollbar-thumb,
  .rooms-panel::-webkit-scrollbar-thumb,
  #settingsOverlay .settings-form::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    background-color: transparent;
    transition: background-color 0.18s ease;
  }

  .messages:hover::-webkit-scrollbar-thumb,
  .messages:focus-within::-webkit-scrollbar-thumb,
  .nick-list:hover::-webkit-scrollbar-thumb,
  .nick-list:focus-within::-webkit-scrollbar-thumb,
  .conversation-list:hover::-webkit-scrollbar-thumb,
  .conversation-list:focus-within::-webkit-scrollbar-thumb,
  .rooms-panel:hover::-webkit-scrollbar-thumb,
  .rooms-panel:focus-within::-webkit-scrollbar-thumb,
  #settingsOverlay .settings-form:hover::-webkit-scrollbar-thumb,
  #settingsOverlay .settings-form:focus-within::-webkit-scrollbar-thumb {
    background-color: #9daeb9;
  }
}


.quick-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 26, 0.45);
  display: grid;
  place-items: center;
  z-index: 150;
  opacity: 1;
  transition: opacity 0.15s ease;
}

#avatarLightboxOverlay {
  background: rgba(7, 14, 20, 0.78);
  z-index: 260;
}

.avatar-lightbox-panel {
    width: auto;
    max-width: 400px;
    max-height: 550px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 231, 240, 0.35);
  border-radius: 16px;
  background: rgba(13, 28, 38, 0.65);
  box-shadow: 0 24px 64px rgba(6, 12, 18, 0.55);
  padding: 18px 18px 14px;
}

.avatar-lightbox-panel img {
      width: auto;
    max-width: 400px;
    max-height: 550px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(221, 233, 241, 0.42);
  background: #101f2b;
}

.avatar-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  background: rgba(12, 24, 32, 0.84);
  color: #ecf4f9;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-lightbox-close:hover {
  background: rgba(18, 34, 44, 0.94);
}

@media (max-width: 480px) {
  .avatar-lightbox-panel {
    width: 218px;
    min-height: 218px;
    padding: 14px 14px 12px;
  }

  .avatar-lightbox-panel img {
    width: 180px;
    height: 180px;
  }
}

.quick-panel {
  width: min(360px, 92vw);
  background: #fff;
  border: 1px solid #d8dde1;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.15s ease;
}

#channelModeOverlay .quick-panel {
  width: min(460px, 94vw);
  border-radius: 10px;
}

#channelModeOverlay .quick-header {
  height: 44px;
  padding: 8px 10px;
  background: #f1f3f5;
}

#channelModeOverlay .quick-header h4 {
  font-size: 1rem;
  font-weight: 700;
}

#channelModeOverlay .quick-header button {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #c9d2d8;
  background: #ffffff;
  color: #4a5b66;
}

#channelModeOverlay .quick-form {
  padding: 8px 10px 10px;
  gap: 5px;
}

#channelModeOverlay .quick-form label {
  font-size: 0.82rem;
  color: #4c5d67;
}

.quick-header {
  height: 56px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e0e5e8;
  background: #f4f6f8;
}

.quick-header h4 {
  margin: 0;
}

.quick-header button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
}

.quick-form {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.quick-form select {
  font: inherit;
  border: 1px solid #c6d0d7;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #11212b;
}

.quick-form textarea {
  font: inherit;
  width: 100%;
  border: 1px solid #c6d0d7;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #11212b;
  resize: vertical;
  min-height: 110px;
}

.quick-form textarea:focus,
.quick-form textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.presence-count {
  color: #577081;
  font-size: 0.76rem;
  text-align: right;
}

.presence-form-actions {
  display: flex;
  justify-content: flex-end;
}

#adminPanelOverlay .quick-panel {
  width: min(460px, 94vw);
}

#adminPanelOverlay .quick-panel {
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 0;
}

.admin-tab-btn {
  border: 1px solid #c8d2d9;
  border-radius: 10px;
  background: #f7fafc;
  color: #2e4654;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 10px;
}

.admin-tab-btn.active {
  border-color: #93c4ac;
  background: #e9f7ef;
  color: #184a33;
}

.admin-tab-panel {
  min-height: 0;
}

#adminPanelOverlay .quick-form {
  overflow-y: auto;
  padding-bottom: 14px;
}

.admin-confirm-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #d8e1e8;
  border-radius: 10px;
  padding: 9px 10px;
  background: #f8fbfd;
}

.admin-confirm-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #26c86e;
}

.admin-confirm-row span {
  color: #37505f;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-command-preview {
  display: block;
  border: 1px dashed #cad4dc;
  border-radius: 10px;
  background: #f9fbfd;
  color: #476171;
  padding: 7px 9px;
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.admin-audit-panel {
  padding: 10px 12px 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  overflow: hidden;
}

.admin-audit-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-audit-actions button {
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.admin-audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.admin-audit-item {
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  background: #f8fbfd;
  padding: 7px 8px;
  display: grid;
  gap: 4px;
}

.admin-audit-item.is-blocked {
  border-color: #e8b5b5;
  background: #fff5f5;
}

.admin-audit-item .audit-meta {
  font-size: 0.72rem;
  color: #5b7481;
  font-weight: 700;
}

.admin-audit-item code {
  display: block;
  font-size: 0.74rem;
  color: #203846;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-audit-empty {
  border: 1px dashed #c8d3db;
  border-radius: 10px;
  background: #f8fbfd;
  color: #5b7481;
  font-size: 0.8rem;
  padding: 10px 12px;
}

#operStateText {
  color: #5a6e7a;
  font-size: 0.82rem;
}

.moderation-panel {
  width: min(420px, 92vw);
}

.mod-preview {
  color: #5c6f7a;
  font-size: 0.78rem;
}

.quick-form label {
  color: var(--muted);
  font-size: 0.9rem;
}

.channel-center-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.channel-center-row input {
  flex: 1 1 auto;
  min-width: 120px;
}

#channelCenterBanList {
  min-height: 84px;
  font-size: 0.8rem;
}

#channelCenterInviteNick + button,
#channelCenterBanMask + button {
  white-space: nowrap;
}

#channelModeOverlay .channel-center-row button,
#channelModeOverlay #channelModeApply {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #c9d2d8;
  background: #f8fafb;
  color: #2f4350;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: none;
}

#channelModeOverlay .channel-center-row button:hover,
#channelModeOverlay #channelModeApply:hover {
  background: #eef3f6;
  border-color: #b8c5ce;
  transform: none;
}

#channelModeOverlay #channelModeApply {
  margin-top: 2px;
}

#channelModeOverlay .mode-grid {
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
}

#channelModeOverlay .mode-row {
  border: 1px solid #d8e0e6;
  border-radius: 7px;
  background: #fafcfd;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

#channelModeOverlay .mode-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

@media (max-width: 520px) {
  #channelModeOverlay .mode-grid {
    grid-template-columns: 1fr;
  }
}

/* Strong scoped overrides for compact mIRC-like Channel Center */
.channel-center-overlay .quick-panel {
  width: min(460px, 94vw) !important;
  border-radius: 10px !important;
}

.channel-center-overlay .quick-header {
  height: 44px !important;
  padding: 8px 10px !important;
  background: #f1f3f5 !important;
}

.channel-center-overlay .quick-header button {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  border: 1px solid #c9d2d8 !important;
  background: #ffffff !important;
  color: #4a5b66 !important;
  box-shadow: none !important;
}

.channel-center-overlay .quick-form {
  padding: 8px 10px 10px !important;
  gap: 5px !important;
}

.channel-center-overlay .quick-form label {
  font-size: 0.82rem !important;
}

.channel-center-overlay .channel-center-row button,
.channel-center-overlay #channelModeApply {
  min-height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid #c9d2d8 !important;
  background: #f8fafb !important;
  color: #2f4350 !important;
  border-radius: 7px !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.channel-center-overlay #channelCenterBanList {
  min-height: 84px !important;
  font-size: 0.8rem !important;
}

.mode-grid {
  display: grid;
  gap: 8px;
}

.mode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d4dee5;
  border-radius: 10px;
  background: #f8fbfd;
  color: #17303d;
  font-size: 0.86rem;
  font-weight: 700;
}

.mode-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #22bf64;
}

.settings-form {
  margin: 0;
  padding: 8px 12px 10px;
  gap: 6px;
  display: flex;
  flex-direction: column;
}

#settingsOverlay .quick-panel {
  width: min(640px, 95vw);
  height: auto;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border-color: #ccd7df;
  background: linear-gradient(180deg, #f7fafd 0%, #eef3f7 100%);
  box-shadow: 0 24px 52px rgba(11, 22, 29, 0.28);
}

#settingsOverlay .settings-form {
  padding: 12px 14px 16px;
  overflow-y: auto;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #b6c4ce transparent;
}

#settingsOverlay .quick-header {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid #d5dfe7;
  min-height: 72px;
  height: auto;
  padding: 12px 14px;
}

#settingsOverlay .quick-header h4 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  color: #0f2430;
}

#settingsOverlay .settings-header-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#settingsOverlay #settingsSubtitle {
  margin: 0;
  color: #5b7280;
  font-size: 0.8rem;
  line-height: 1.25;
}

#settingsOverlay .quick-header button {
  border: 1px solid #93c7a9;
  background: linear-gradient(180deg, #2fda79, #20bf63);
  color: #063019;
}

#settingsOverlay .quick-header button:hover {
  filter: brightness(1.02);
}

.settings-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d2dde6;
  border-radius: 12px;
  background: rgba(246, 250, 253, 0.95);
  backdrop-filter: blur(2px);
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.settings-tab-btn {
  min-height: 38px;
  border: 1px solid #c4d2dd;
  border-radius: 10px;
  background: #ffffff;
  color: #355566;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.settings-tab-btn:hover {
  border-color: #9fb8c8;
  background: #f6fbff;
}

.settings-tab-btn.is-active {
  border-color: #25c86a;
  background: linear-gradient(180deg, #ebfbf2 0%, #e2f7eb 100%);
  color: #124229;
}

.settings-search-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c4d2dd;
  border-radius: 10px;
  background: #ffffff;
  color: #1e3a4a;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0 12px;
}

.settings-search-input:focus {
  outline: 0;
  border-color: #6ca9d0;
  box-shadow: 0 0 0 2px rgba(58, 138, 192, 0.14);
}

.settings-panel {
  display: none;
  gap: 12px;
}

.settings-panel.is-active {
  display: grid;
}

.is-filter-hidden {
  display: none !important;
}

.settings-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d5e0e8;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafd 100%);
}

.settings-section-title {
  margin: 0;
  padding: 0 2px;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #406173;
}

.settings-toggle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.settings-toggle-grid.settings-toggle-grid-compact {
  grid-template-columns: 1fr;
}

.settings-collapsible {
  border: 1px solid #d3dee6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafd 100%);
  overflow: hidden;
}

.settings-collapsible-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  margin: 0;
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #2a495a;
}

.settings-collapsible-summary::-webkit-details-marker {
  display: none;
}

.settings-collapsible-summary::before {
  content: "▸";
  font-size: 0.82rem;
  color: #547082;
  transition: transform 0.15s ease;
}

.settings-collapsible[open] .settings-collapsible-summary::before {
  transform: rotate(90deg);
}

.settings-collapsible[open] .settings-collapsible-summary {
  border-bottom: 1px solid #dce6ed;
  background: #fbfdff;
}

.settings-collapsible > .settings-toggle-grid {
  padding: 10px;
}

#aboutOverlay .quick-panel {
  width: min(460px, 92vw);
  height: auto;
}

#aboutPanel.quick-panel--about {
  border-radius: 18px;
  border: 1px solid #c9d8e2;
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.11), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f3f8fc 100%);
  box-shadow: 0 22px 48px rgba(12, 33, 46, 0.2);
  overflow: hidden;
}

#aboutPanel.quick-panel--about .quick-header {
  padding: 12px 14px;
  border-bottom: 1px solid #d6e1ea;
  background: linear-gradient(180deg, #f8fcff 0%, #eef5fa 100%);
}

#aboutPanel.quick-panel--about .quick-header h4 {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
}

#aboutPanel.quick-panel--about .quick-header button {
  width: 34px;
  height: 34px;
  border: 1px solid #b8cad7;
  border-radius: 10px;
  background: #ffffff;
  color: #1e3949;
}

#aboutPanel.quick-panel--about .quick-header button:hover {
  border-color: #8fb1c5;
  background: #f6fbff;
}

#noxHelpOverlay .quick-panel.nox-help-panel {
  width: min(760px, 92vw);
}

#noxHelpBody {
  padding: 10px 12px 14px;
}

.nox-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nox-help-item {
  margin: 0;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid #d8e2ea;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.nox-help-item strong {
  font-size: 0.86rem;
  color: #18323f;
  line-height: 1.25;
}

.nox-help-item small {
  font-size: 0.77rem;
  color: #4a6370;
  line-height: 1.3;
}

.about-content {
  margin: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #2a3d48;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-y: auto;
  height: 500px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #d3e0e8;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
}

.about-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.about-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #8fdbaf;
  background: rgba(37, 211, 102, 0.12);
  color: #0f7a39;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.about-rights {
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #deebf2;
  background: rgba(255, 255, 255, 0.75);
  color: #2b4250;
}

.about-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.about-meta-card {
  margin: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid #d8e3ec;
  border-radius: 10px;
  background: #ffffff;
}

.about-meta-card span {
  font-size: 0.73rem;
  color: #617884;
  font-weight: 700;
}

.about-meta-card strong {
  font-size: 0.82rem;
  line-height: 1.25;
  color: #183341;
  font-weight: 800;
}

.about-contact {
  margin: 0;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid #cfe1ed;
  background: #f6fbff;
  color: #1b3a4a;
}

.about-features {
  margin: 0;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid #cfe1ed;
  background: #f8fcff;
}

.about-features h5 {
  margin: 0 0 7px;
  font-size: 0.83rem;
  color: #123444;
  letter-spacing: 0.01em;
}

.about-feature-list {
  margin: 0;
  padding: 0 0 0 16px;
  display: grid;
  gap: 3px;
  color: #214252;
  font-size: 0.82rem;
}

.about-content p {
  margin: 0;
}

#aboutName {
  color: #11212b;
}

#aboutVersion {
  color: #5f7480;
}

@media (max-width: 560px) {
  .about-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

.settings-form .toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  line-height: 1.25;
  color: #17303d;
  font-weight: 700;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #d3dde5;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
  position: relative;
}

.settings-form .select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  align-items: center;
  gap: 14px;
  min-height: 52px;
  line-height: 1.25;
  color: #17303d;
  font-weight: 700;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #d3dde5;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.mobile-layout-card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid #c7d4de;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(16, 36, 48, 0.06);
  overflow: hidden;
}

.mobile-layout-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-layout-card > .mobile-layout-card-head > span:first-child {
  font-size: 0.98rem;
  font-weight: 800;
  color: #17303d;
  display: block;
}

.mobile-layout-card-head small {
  color: #647b89;
  font-size: 0.77rem;
  line-height: 1.35;
}

.mobile-layout-grid {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  align-items: stretch;
}

.mobile-layout-option {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  gap: 10px;
  min-height: 68px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c7d4de;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  color: #47606e;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 8px rgba(20, 40, 52, 0.04);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.mobile-layout-option:hover {
  border-color: #9bb3c1;
  box-shadow: 0 6px 14px rgba(16, 36, 48, 0.07);
}

.mobile-layout-option.is-active {
  border-color: #25d366;
  background: linear-gradient(180deg, #f8fff9 0%, #ebf9ef 100%);
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.1);
}

.mobile-layout-option-check {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #ccd8df;
  background: #ffffff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.mobile-layout-option.is-active .mobile-layout-option-check {
  border-color: #25d366;
  background: #25d366;
  color: #ffffff;
}

.mobile-layout-option-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid #d5e1e8;
  background: linear-gradient(180deg, #f8fbfd 0%, #edf4f8 100%);
  color: #5f7380;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Owner nick color presets must override generic transparent gradient rule */
.nick-list li.nick .label.has-custom-color.nick-color-preset-sahip1,
.nick-list li.nick .label.nick-color-preset-sahip1 {
  color: #ff2f72 !important;
  -webkit-text-fill-color: #ff2f72 !important;
  background: none !important;
  background-image: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  text-shadow: 0 0 6px rgba(255, 47, 114, 0.45), 0 0 14px rgba(255, 47, 114, 0.2) !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  display: inline-block !important;
  animation: nick-owner-breathe-rose 2.4s ease-in-out infinite !important;
}

.nick-list li.nick .label.has-custom-color.nick-color-preset-sahip2,
.nick-list li.nick .label.nick-color-preset-sahip2 {
  color: #00d1ff !important;
  -webkit-text-fill-color: #00d1ff !important;
  background: none !important;
  background-image: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  text-shadow: 0 0 7px rgba(0, 209, 255, 0.5), 0 0 16px rgba(0, 209, 255, 0.24) !important;
  font-weight: 800 !important;
  letter-spacing: 0.015em !important;
  display: inline-block !important;
  animation: nick-owner-breathe-cyan 2.8s ease-in-out infinite !important;
}

.nick-list li.nick .label.has-custom-color.nick-color-preset-sahip3,
.nick-list li.nick .label.nick-color-preset-sahip3 {
  color: #ffc247 !important;
  -webkit-text-fill-color: #ffc247 !important;
  background: none !important;
  background-image: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  text-shadow: 0 0 8px rgba(255, 194, 71, 0.55), 0 0 18px rgba(255, 194, 71, 0.28) !important;
  font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive !important;
  font-style: italic !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  display: inline-block !important;
  animation: nick-owner-breathe-gold 3.1s ease-in-out infinite !important;
}

.mobile-layout-option.is-active .mobile-layout-option-icon {
  border-color: #7fdaad;
  background: linear-gradient(180deg, #2bd26f 0%, #1fb860 100%);
  color: #ffffff;
}

.mobile-layout-option-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.mobile-layout-option-title {
  color: #18323f;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.1;
}

.mobile-layout-option-copy {
  color: #6b808d;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
}

.mobile-layout-option.is-active .mobile-layout-option-title {
  color: #102b1d;
}

.mobile-layout-option.is-active .mobile-layout-option-copy {
  color: #416652;
}

.settings-form .select-row > span:first-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-form .select-row select {
  width: 100%;
  max-width: 210px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid #c9d5de;
  background: #ffffff;
  color: #18323f;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 11px;
}

.avatar-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  /* min-height: 76px; */
  margin: 0;
  padding: 12px;
  border: 1px solid #cbd9e3;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.avatar-upload-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.avatar-upload-preview-wrap {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid #c8d5de;
  background: linear-gradient(180deg, #f7fbff, #e5edf4);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(24, 44, 56, 0.15);
}

.avatar-upload-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-upload-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#avatarUploadLabel {
  color: #17303d;
  font-weight: 700;
  font-size: 0.96rem;
}

#avatarUploadLabel.disabled {
  color: #7b8f9a;
}

.avatar-upload-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: end;
}

.avatar-choice-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed #c8d4de;
}

.avatar-choice-head {
  display: grid;
  gap: 3px;
}

#avatarPresetLabel {
  color: #17303d;
  font-weight: 700;
  font-size: 0.9rem;
}

#avatarPresetLabel.disabled {
  color: #7b8f9a;
}

.avatar-choice-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.avatar-preset-picker {
  position: relative;
}

.avatar-preset-trigger {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c6d4dd;
  border-radius: 11px;
  padding: 6px 10px;
  background: #ffffff;
  color: #17303d;
  font: inherit;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.avatar-preset-trigger:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(62, 136, 196, 0.2);
  border-color: #6c9fd3;
}

.avatar-preset-trigger.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f3f6f8;
  color: #8ca0ac;
}

.avatar-preset-trigger-copy {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#avatarPresetPreview {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #c8d5de;
  object-fit: cover;
  flex: 0 0 auto;
}

#avatarPresetTriggerText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-preset-caret {
  color: #5d7484;
  font-size: 0.88rem;
}

.avatar-preset-picker.open .avatar-preset-caret {
  transform: rotate(180deg);
}

.avatar-preset-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1300;
  max-height: 244px;
  overflow: auto;
  border: 1px solid #c6d4dd;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 12px 22px rgba(15, 32, 44, 0.18);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.avatar-preset-option {
  border: 1px solid #cfdae3;
  border-radius: 10px;
  background: #ffffff;
  color: #17303d;
  padding: 7px 6px;
  min-height: 72px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.avatar-preset-option:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(62, 136, 196, 0.2);
  border-color: #6c9fd3;
}

.avatar-preset-option img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #c8d5de;
  object-fit: cover;
}

.avatar-preset-option.active {
  border-color: #79a8cc;
  box-shadow: 0 0 0 2px rgba(89, 156, 211, 0.18);
  background: #f4faff;
}

.avatar-preset-option:hover {
  border-color: #a8c1d4;
  background: #f8fbff;
}

.nick-color-card {
  display: grid;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid #d3dde5;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.nick-color-card-head {
  display: grid;
  gap: 4px;
}

#nickColorLabel {
  color: #17303d;
  font-weight: 700;
  font-size: 0.96rem;
}

.nick-color-hint {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  font-size: 0.78rem;
  border-radius: 8px;
  padding: 3px 8px;
}

.nick-color-hint.tone-info {
  color: #355565;
  background: #eaf3f9;
}

.nick-color-hint.tone-success {
  color: #1d6135;
  background: #e8f8ee;
}

.nick-color-hint.tone-warn {
  color: #7a5a13;
  background: #fff5d9;
}

.nick-color-hint.tone-error {
  color: #7b2f2f;
  background: #feecec;
}

.nick-color-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

#nickColorSelect {
  min-height: 38px;
  border: 1px solid #c6d4dd;
  border-radius: 11px;
  padding: 0 12px;
  background: #ffffff;
  color: #17303d;
  font: inherit;
  font-weight: 700;
}

#nickColorSelect.is-hidden-native {
  display: none !important;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nick-color-picker {
  position: relative;
}

.nick-color-picker-trigger {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c6d4dd;
  border-radius: 11px;
  padding: 6px 10px;
  background: #ffffff;
  color: #17303d;
  font: inherit;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.nick-color-picker-trigger:disabled {
  border-color: #cfd8de;
  background: #f3f6f8;
  color: #8ca0ac;
  cursor: not-allowed;
}

.nick-color-picker-trigger-label {
  min-width: 0;
  flex: 1;
}

.nick-color-picker-caret {
  color: #5d7484;
  font-size: 0.88rem;
}

.nick-color-picker.open .nick-color-picker-caret {
  transform: rotate(180deg);
}

.nick-color-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1300;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #c6d4dd;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(25, 39, 49, 0.22);
  padding: 6px;
}

.nick-color-picker-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.nick-color-picker-item:hover {
  background: rgba(33, 105, 180, 0.08);
}

.nick-color-picker-item.is-selected {
  background: rgba(33, 105, 180, 0.14);
}

.nick-color-preview-label.nick-color-picker-sample {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 0.93rem;
}

.nick-color-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nick-color-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed #ccdae3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.nick-color-preview-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(16, 28, 38, 0.2));
}

.nick-color-preview-label {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #183341;
}

#nickColorPreviewCopy {
  font-size: 0.76rem;
  color: #667b88;
  font-weight: 700;
}

.quick-inline-btn {
  border: 1px solid #b8c7d1;
  background: #ffffff;
  color: #264654;
  border-radius: 10px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.quick-inline-btn:hover {
  background: #f0f6f9;
}

.quick-inline-btn:disabled {
  border-color: #cfd8de;
  background: #f3f6f8;
  color: #8ca0ac;
  cursor: not-allowed;
}

.quick-inline-btn-primary {
  border-color: #2fbb69;
  background: linear-gradient(180deg, #38d978, #2bc766);
  color: #06321b;
}

.quick-inline-btn-primary:hover {
  background: linear-gradient(180deg, #42de80, #31ce6d);
}

.quick-inline-btn-danger {
  border-color: #e0b7b7;
  background: #fff7f7;
  color: #8f3232;
}

.quick-inline-btn-danger:hover {
  background: #ffecec;
}

#avatarUploadHint,
#avatarPresetHint {
  font-size: 0.78rem;
  border-radius: 8px;
  padding: 3px 8px;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

#avatarUploadHint.hint-info,
#avatarPresetHint.hint-info {
  color: #355565;
  background: #eaf3f9;
}

#avatarUploadHint.hint-success,
#avatarPresetHint.hint-success {
  color: #1d6135;
  background: #e8f8ee;
}

#avatarUploadHint.hint-warn,
#avatarPresetHint.hint-warn {
  color: #7a5a13;
  background: #fff5d9;
}

#avatarUploadHint.hint-error,
#avatarPresetHint.hint-error {
  color: #7b2f2f;
  background: #feecec;
}

@media (max-width: 620px) {
  .avatar-upload-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .avatar-upload-actions {
    justify-self: stretch;
    justify-content: flex-end;
  }

  .nick-color-controls {
    grid-template-columns: 1fr;
  }

  .nick-color-actions {
    justify-content: flex-end;
  }

  .nick-color-preview {
    align-items: flex-start;
    flex-direction: column;
  }
}

.settings-form .toggle-row::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #b7c5cf;
  transition: background-color 0.14s ease;
}

.settings-form .toggle-row:hover {
  border-color: #b0c4d2;
  background: #fcfeff;
  transform: translateY(-1px);
}

.settings-form .toggle-row > span:first-child {
  max-width: calc(100% - 74px);
  font-size: 0.96rem;
  padding-left: 14px;
}

.settings-form .toggle-row:has(input[type="checkbox"]:checked) {
  border-color: #90d2ab;
  background: linear-gradient(180deg, #f4fff8 0%, #eefbf4 100%);
}

.settings-form .toggle-row:has(input[type="checkbox"]:checked)::before {
  background: #2fcb72;
}

.toggle-control {
  position: relative;
  width: 48px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.toggle-control input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-slider {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c8d3db;
  border: 1px solid #adbcc7;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transform: translateY(-50%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.14);
  transition: transform 0.14s ease;
}

.toggle-control input[type="checkbox"]:checked + .toggle-slider {
  background: #37ce77;
  border-color: #2ab765;
}

.toggle-control input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translate(20px, -50%);
}

.toggle-control input[type="checkbox"]:focus-visible + .toggle-slider {
  outline: 2px solid #7ed4af;
  outline-offset: 2px;
}

.quick-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.quick-overlay.hidden .quick-panel {
  transform: translateY(8px);
}

.voice-call-bubble {
  box-sizing: border-box;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 125;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 24px));
  border: 1px solid #cdd8de;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(10, 24, 33, 0.24);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.voice-call-main {
  display: grid;
  gap: 3px;
  padding: 2px 2px 0;
  border-radius: 10px;
  background: #f7fafd;
}

.voice-drag-handle {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.voice-drag-handle::after {
  content: "";
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: #d7e1e8;
  justify-self: center;
  margin-top: 2px;
}

.voice-call-bubble.is-dragging .voice-drag-handle {
  cursor: grabbing;
}

.voice-call-main strong {
  font-size: 0.94rem;
  font-weight: 800;
  color: #143241;
}

.voice-call-main small {
  font-size: 0.74rem;
  color: #607582;
  font-weight: 700;
}

.voice-call-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.voice-device-row {
  display: grid;
  gap: 4px;
}

.voice-device-label {
  font-size: 0.72rem;
  color: #5f7380;
  font-weight: 700;
}

.voice-device-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.voice-device-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #bfd0d8;
  border-radius: 9px;
  background: #f6fbfe;
  color: #294a59;
  padding: 6px 8px;
  font-size: 0.74rem;
  font-weight: 700;
}

.voice-device-select:focus-visible {
  outline: 2px solid #9cc6da;
  outline-offset: 1px;
}

.voice-chip-btn {
  box-sizing: border-box;
  border: 1px solid #bfd0d8;
  border-radius: 9px;
  background: #f6fbfe;
  color: #294a59;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.voice-chip-btn:hover {
  filter: none;
  background: #edf5fa;
}

.voice-chip-btn.danger {
  border-color: #efc2c2;
  background: #fff5f5;
  color: #923737;
}

#voiceCallAcceptBtn {
  border-color: #8fd0aa;
  background: #effcf4;
  color: #1f6e45;
}

#voiceCallRejectBtn {
  border-color: #efc2c2;
  background: #fff5f5;
  color: #923737;
}

.voice-incoming-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.login-mascot {
    position: absolute;
    bottom: 130px;
    right: -61%;
    width: 300px;
    height: 300px;
    background-image: url(/assets/nox-ll.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;
    pointer-events: none;
    z-index: -1;
    rotate: 42deg;
}
.login-mascot-hide {
  position: absolute;
    bottom: 30px;
    left: -23%;
    width: 100px;
    height: 100px;
  background-image: url("/assets/nox-gizli.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}
@media (max-width: 1100px) {
  .login-mascot,
  .login-mascot-hide {
    display: none;
  }
}
.login-card {
  width: min(360px, 92vw);
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 12px);
  border: 1px solid #dfe8ed;
  border-radius: 8px;
  padding: clamp(14px, 2.5vw, 20px) clamp(16px, 4.5vw, 28px) clamp(16px, 3vw, 22px);
  background: #ffffff;
  color: #334f5d;
  box-shadow: 0 10px 24px rgba(39, 63, 76, 0.12);
}

.login-header {
  display: grid;
  gap: 3px;
  text-align: center;
  margin-top: 2px;
}

.login-header h3 {
  margin: 0;
  color: #4d6773;
  font-size: clamp(1.45rem, 3.3vw, 2.18rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.login-header p {
  margin: 0;
  color: #8aa0ab;
  font-size: clamp(0.82rem, 2.2vw, 0.99rem);
}

.login-hero {
  display: grid;
  place-items: center;
  padding: 0 0 clamp(6px, 1.6vh, 12px);
  margin-top: -43%;
}

.login-version {
  margin: -2px 0 4px;
  text-align: center;
  color: #9aacb7;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  font-weight: 400;
  user-select: text;
}

.login-hero-svg {
  width: clamp(150px, 53vw, 230px);
  height: 150px;
  max-height: 230px;
  display: block;
  object-fit: contain;
}


.login-access-label {
  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;
  white-space: nowrap !important;
  border: 0 !important;
}

.login-field {
  position: relative;
  border-bottom: 1px solid #d7e2e8;
  min-height: clamp(38px, 5.2vh, 44px);
  display: flex;
  align-items: center;
}

.login-field::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 1;
}

.login-field-user::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%2336c8cf' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.8'/%3E%3Cpath d='M4.7 18.2c1.3-2.8 4.1-4.4 7.3-4.4s6 1.6 7.3 4.4'/%3E%3C/g%3E%3C/svg%3E");
}

.login-field-pass::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%2336c8cf' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10.5' width='15' height='9' rx='2.2'/%3E%3Cpath d='M8 10.5V8.3a4 4 0 1 1 8 0v2.2'/%3E%3C/g%3E%3C/svg%3E");
}

.login-card input {
  border: none;
  border-bottom: none;
  border-radius: 0;
  padding: 4px 0 9px 30px;
  background: transparent;
  color: #3b5563;
  font-size: clamp(0.98rem, 2.8vw, 1.02rem);
  line-height: 1.2;
  width: 100%;
}

.login-card input::placeholder {
  color: #6d8593;
  opacity: 1;
}

.login-card input:focus,
.login-card input:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.login-card button[type="submit"] {
  margin: clamp(8px, 1.8vh, 14px) auto 6px;
  width: clamp(138px, 46%, 156px);
  border-radius: 999px;
  min-height: clamp(40px, 5.4vh, 46px);
  border: 1px solid #2cc0c9;
  background: linear-gradient(180deg, #39cfd6, #31bec6);
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.7vw, 1rem);
  letter-spacing: 0.01em;
}

.login-card button[type="submit"]:hover {
  filter: none;
  background: linear-gradient(180deg, #48d6dd, #37c5cd);
}

.login-oper-toggle {
  width: min(100%, 420px);
  margin: 4px auto 0;
  min-height: 34px;
  border: 1px solid #c8d9e2;
  border-radius: 999px;
  background: #f5fafc;
  color: #3a6173;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.login-oper-toggle:hover {
  border-color: #a9c8d6;
  background: #edf7fb;
}

.login-oper-toggle:focus-visible {
  outline: 2px solid #69ced5;
  outline-offset: 1px;
}

.login-oper-section {
  width: min(100%, 420px);
  margin: 0 auto;
}

.login-card small {
  min-height: 16px;
  color: var(--danger);
  font-size: 0.72rem;
  text-align: center;
}
.login-card small.loginJet {
  min-height: 16px;
  color: var(--theme-graphite-accent);
  font-size: 0.92rem;
  text-align: center;
}

.login-footnote {
  margin: auto 0 2px;
  text-align: center;
  color: #859aa5;
  font-size: 0.78rem;
  line-height: 1.35;
}

.login-signup-link {
  border: none;
  background: transparent;
  color: #37c8cf;
  font-weight: 700;
  padding: 0;
  margin: 0;
  min-height: 0;
  line-height: inherit;
}

.login-signup-link:hover {
  text-decoration: underline;
  filter: none;
  background: transparent;
}

#loginOverlay {
  background: linear-gradient(180deg, #d7e0e6, #eee6f0);
  font-family: var(--chat-font-family);
}

.login-card input,
.login-card button,
.login-card select,
.login-card textarea {
  font-family: inherit;
}

@media (max-width: 640px) {
  #loginOverlay {
    min-height: 100dvh;
    min-height: 100svh;
    padding: 0;
    place-items: stretch;
  }

  .login-card {
    width: 100vw;
    min-height: 100dvh;
    min-height: 100svh;
    justify-content: center;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: none;
    padding:
      max(14px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
    gap: clamp(9px, 2vh, 13px);
  }

  .login-hero {
    width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
  }
  .login-header,
  .login-field,
  .login-oper-toggle,
  .login-oper-section,
  .login-card small {
    width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
  }

  .login-card input {
    padding: 4px 0 8px 26px;
    font-size: 16px !important;
  }
}

@media (max-width: 420px) {
  .login-card {
    width: 100vw;
    border-radius: 0;
  }

  .login-header h3 {
    font-size: 1.1rem;
  }

  .login-header p {
    font-size: 0.74rem;
  }

  .login-hero-svg {
    width: min(180px, 58vw);
  }

  .login-field {
    min-height: 37px;
  }

  .login-card button[type="submit"] {
    width: min(152px, 56%);
  }
}

@media (max-height: 760px) and (min-width: 641px) {
  .overlay {
    place-items: start center;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: 12px;
  }

  .login-card {
    margin-top: 0;
  }
}

@media (max-width: 1400px) and (min-width: 641px) {
  #loginOverlay {
    padding: 10px 12px;
    place-items: center;
    overflow: auto;
  }

  .login-card {
    width: min(350px, 92vw);
    padding: 14px 16px 16px;
    gap: 9px;
  }

  .login-hero {
    margin-top: -30%;
    padding-bottom: 6px;
  }

  .login-hero-svg {
    width: clamp(118px, 28vw, 170px);
    height: 118px;
  }

  .login-header h3 {
    font-size: clamp(1.32rem, 2.4vw, 1.72rem);
  }

  .login-header p {
    font-size: clamp(0.74rem, 1.55vw, 0.88rem);
  }

  .login-card input {
    font-size: 0.92rem;
    padding: 4px 0 8px 28px;
  }
}

@media (max-height: 700px) and (min-width: 641px) {
  #loginOverlay {
    place-items: center;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 8px;
    overflow: auto;
  }

  .login-card {
    margin-top: 0;
  }

  .login-hero {
    margin-top: -20%;
    padding-bottom: 4px;
  }

  .login-hero-svg {
    width: clamp(100px, 24vw, 138px);
    height: 100px;
  }

  .login-header h3 {
    font-size: clamp(1.2rem, 2.1vw, 1.48rem);
  }

  .login-header p {
    font-size: 0.76rem;
  }

  .login-oper-toggle {
    min-height: 31px;
    font-size: 0.86rem;
  }

  .login-card button[type="submit"] {
    min-height: 35px;
    margin-top: 6px;
    margin-bottom: 2px;
  }
}

@media (max-height: 620px) and (min-width: 641px) {
  .login-mascot,
  .login-mascot-hide {
    display: none;
  }

  #loginOverlay {
    place-items: center !important;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 8px;
    overflow: auto;
  }

  .login-card {
    width: min(340px, 92vw);
    padding: 10px 14px 12px;
    gap: 7px;
    box-shadow: 0 6px 16px rgba(39, 63, 76, 0.12);
    margin-top: 0;
    margin-bottom: 0;
  }
}

.nick-identify-overlay .nick-identify-panel {
  width: min(400px, 92vw);
  border-radius: 12px;
  border: 1px solid #cfd8de;
  box-shadow: 0 18px 38px rgba(10, 24, 34, 0.22);
}

/* Keep identify modal above compact composer/input layers on iOS/Android. */
.nick-identify-overlay {
  z-index: 2147483006 !important;
}

.nick-identify-panel .nick-identify-header {
  height: 48px;
  padding: 8px 10px 8px 12px;
  background: linear-gradient(180deg, #f5f8fa, #edf3f6);
  border-bottom: 1px solid #d5dfe6;
}

.nick-identify-panel .nick-identify-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #213947;
}

.nick-identify-panel .nick-identify-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid #c4d3dd;
  background: #ffffff;
  color: #425a68;
}

.nick-identify-panel .nick-identify-close:hover {
  background: #f2f7fa;
  color: #223b49;
}

.nick-identify-panel .nick-identify-desc {
  margin: 0;
  padding: 10px 12px 0;
  color: #4a626f;
  font-size: 0.88rem;
  line-height: 1.4;
}

.nick-identify-panel .nick-identify-label {
  padding: 4px 12px 0;
  color: #334d5b;
  font-size: 0.84rem;
  font-weight: 700;
}

.nick-identify-panel .nick-identify-input {
  margin: 0 12px;
  width: calc(100% - 24px);
  border: 1px solid #c6d3dc;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 0.95rem;
  background: #fcfeff;
  color: #162b37;
}

.nick-identify-panel .nick-identify-input:focus,
.nick-identify-panel .nick-identify-input:focus-visible {
  outline: none;
  border-color: #7ea9bf;
  box-shadow: 0 0 0 3px rgba(102, 163, 190, 0.2);
}

.nick-identify-panel .nick-identify-error {
  display: block;
  padding: 2px 12px 0;
  min-height: 18px;
  color: #a32b2b;
  font-size: 0.8rem;
}

.nick-identify-panel .nick-identify-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 12px 12px;
  gap: 8px;
}

.nick-identify-panel .nick-identify-submit,
.nick-identify-panel .nick-identify-change {
  min-height: 38px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nick-identify-panel .nick-identify-submit {
  border: 1px solid #2f6479;
  background: linear-gradient(180deg, #3b8098, #2f6a81);
  color: #eff8fc;
}

.nick-identify-panel .nick-identify-submit:hover {
  filter: none;
  background: linear-gradient(180deg, #4690aa, #35758d);
}

.nick-identify-panel .nick-identify-change {
  border: 1px solid #b9c8d1;
  background: linear-gradient(180deg, #fbfdfe, #ecf3f7);
  color: #39515f;
}

.nick-identify-panel .nick-identify-change:hover {
  filter: none;
  background: linear-gradient(180deg, #ffffff, #e6eef3);
}

@media (max-width: 640px) {
  .nick-identify-overlay .nick-identify-panel {
    width: min(340px, calc(100vw - 18px));
    border-radius: 10px;
  }

  .nick-identify-panel .nick-identify-header {
    height: 42px;
    padding: 6px 8px 6px 10px;
  }

  .nick-identify-panel .nick-identify-title {
    font-size: 0.92rem;
  }

  .nick-identify-panel .nick-identify-close {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    font-size: 0.92rem;
  }

  .nick-identify-panel .nick-identify-desc {
    padding: 8px 10px 0;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .nick-identify-panel .nick-identify-label {
    padding: 3px 10px 0;
    font-size: 0.79rem;
  }

  .nick-identify-panel .nick-identify-input {
    margin: 0 10px;
    width: calc(100% - 20px);
    padding: 8px 9px;
    font-size: 16px !important;
    border-radius: 8px;
  }

  .nick-identify-panel .nick-identify-error {
    padding: 2px 10px 0;
    min-height: 14px;
    font-size: 0.74rem;
  }

  .nick-identify-panel .nick-identify-actions {
    padding: 0 10px 10px;
    gap: 6px;
  }

  .nick-identify-panel .nick-identify-submit,
  .nick-identify-panel .nick-identify-change {
    min-height: 33px;
    border-radius: 8px;
    font-size: 0.82rem;
  }
}

/* Keep identify popup above the virtual keyboard on compact/mobile layouts. */
@media (max-width: 980px) {
  html.keyboard-open-state .nick-identify-overlay,
  body.keyboard-open-state .nick-identify-overlay {
    place-items: start center;
    padding:
      calc(var(--safe-area-top, 0px) + 10px)
      max(10px, var(--safe-area-right, 0px))
      max(10px, var(--safe-area-bottom, 0px))
      max(10px, var(--safe-area-left, 0px));
  }

  html.keyboard-open-state .nick-identify-overlay .nick-identify-panel,
  body.keyboard-open-state .nick-identify-overlay .nick-identify-panel {
    max-height: min(60dvh, 420px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

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

@media (max-width: 640px) {
  .voice-call-bubble {
    right: 10px;
    bottom: calc(115px + var(--safe-area-bottom));
    min-width: 0;
    width: min(200px, calc(100vw - 24px));
    max-height: min(34dvh, 210px);
    overflow-y: auto;
    padding: 9px;
    gap: 7px;
  }
  .voice-call-main strong {
    font-size: 0.86rem;
  }
  .voice-call-main small {
    font-size: 0.72rem;
  }
  .voice-device-row {
    display: none;
  }
  #voiceCallBackBtn {
    display: none;
  }
  .voice-call-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .voice-incoming-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .voice-chip-btn {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 0.7rem;
  }
}

@media (max-width: 1200px) {
  :root {
    --nick-panel-width: 210px;
    --rooms-panel-width: 210px;
  }

  .app-shell {
    grid-template-columns: 52px 1fr var(--nick-panel-width) var(--rooms-panel-width);
    margin: 0;
    max-width: none;
    height: var(--mobile-vh, 100vh);
  }

  .chat-header {
    grid-template-columns: 140px 1fr auto;
  }

  .app-title {
    font-size: 0.9rem;
  }

  .app-shell.rail-expanded {
    grid-template-columns: 170px 1fr var(--nick-panel-width) var(--rooms-panel-width);
  }
}

/* Responsive hardening: tablet + mobile */
@media (max-width: 1024px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: var(--mobile-vh, 100vh);
  }

  .chat-header {
    height: auto;
    min-height: 62px;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .presence-widget,
  .friend-widget,
  .room-actions-btn {
    flex-shrink: 0;
  }

  .messages {
    padding: 10px 10px 8px;
  }

  .composer-tools {
    gap: 6px;
    padding: 7px 8px 6px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .composer-tools > * {
    flex-shrink: 0;
  }

  .message-form {
    padding: 8px calc(8px + var(--safe-area-right)) calc(8px + var(--safe-area-bottom)) calc(8px + var(--safe-area-left));
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: var(--mobile-vh, 100vh);
    overflow: hidden;
  }

  .app-shell.rail-expanded,
  .app-shell.hide-nick-panel,
  .app-shell.rail-expanded.hide-nick-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .messages.has-tenant-brand {
    padding-right: 174px;
  }

  .tenant-brand-overlay {
    width: 150px;
    height: 50px;
    top: 8px;
    right: 8px;
  }

  .chat-area {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    min-height: 0;
    height: 100%;
    grid-template-rows: auto auto 1fr auto auto;
  }

  .chat-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rooms-nav,
  .nick-panel,
  .rooms-panel {
    min-height: 0;
  }

  .rooms-nav,
  .nick-list,
  .conversation-list {
    -webkit-overflow-scrolling: touch;
  }

  .private-subheader {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
  }

  .private-subheader-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .quick-form input,
  .quick-form select,
  .quick-form textarea,
  .login-form input,
  #friendNickInput {
    font-size: 16px !important;
  }

  .nick-panel,
  .rooms-panel {
    display: none;
  }

  .panel-header {
    height: 50px;
    padding: 6px 10px;
  }

  .app-shell.is-compact.compact-side-rail-enabled .panel-header {
    height: 32px !important;
    min-height: 32px !important;
    padding: 3px 6px !important;
  }

  .nick-list,
  .conversation-list {
    padding: 8px;
  }

  .resize-handle {
    display: none;
  }

  .rooms-tools {
    min-height: 0;
    padding: 8px;
  }

  .app-shell.is-compact.compact-side-rail-enabled .nick-panel .nick-list,
  .app-shell.is-compact.compact-side-rail-enabled .rooms-panel .conversation-list {
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick,
  .app-shell.is-compact.compact-side-rail-enabled .conversation-list li {
    min-height: 30px;
  }

  .msg-gif img {
    max-width: 72px;
    max-height: 72px;
  }

  .msg-reaction-gif {
    width: 56px;
    height: 56px;
  }

  .msg-reaction-gif img {
    width: auto;
    height: auto;
    max-width: 56px;
    max-height: 56px;
  }
}

@media (max-width: 540px) {
  .msg-inline-smiley {
    font-size: 1.16em;
  }

  .msg-inline-smiley-image {
    width: 1.35em;
    height: 1.35em;
  }

  .msg-gif img {
    max-width: 64px;
    max-height: 64px;
  }

  .msg-reaction-gif {
    width: 48px;
    height: 48px;
  }

  .msg-reaction-gif img {
        object-fit: contain;
        max-width: 48px;
        max-height: 48px;
  }
}

@media (max-width: 768px) {
  .chat-header {
    padding: 8px 10px;
    gap: 7px;
  }

  .app-title {
    font-size: 0.88rem;
  }

  #connectionState,
  .chat-header small {
    font-size: 0.78rem;
  }

  .active-header-main {
    width: 100%;
    gap: 8px;
  }

  .active-header-text h2 {
    font-size: 0.96rem;
  }

  .mode-badges {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .presence-menu,
  .friend-menu {
    position: fixed;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(64dvh, 480px);
    overflow-y: auto;
    top: auto;
    z-index: 1608;
  }

  .presence-menu {
    bottom: calc(72px + var(--safe-area-bottom));
  }

  .friend-menu {
    bottom: calc(72px + var(--safe-area-bottom));
  }

  .message-form #messageInput {
    min-height: 42px;
    padding: 10px 11px;
    font-size: 0.95rem;
  }

  .message-form .send-icon-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .quick-panel,
  #channelModeOverlay .quick-panel,
  #adminPanelOverlay .quick-panel,
  #settingsOverlay .quick-panel {
    width: min(96vw, 560px) !important;
    max-height: 88dvh;
  }

  .quick-form {
    max-height: calc(88dvh - 58px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .chat-header {
    padding: 7px 8px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .private-subheader-main {
    min-width: 0;
  }

  .private-chat-header-text h3 {
    font-size: 0.92rem;
  }

  .private-chat-header-text small {
    font-size: 0.75rem;
  }

  .pm-inbox-menu {
    width: min(92vw, 250px);
  }

  .presence-toggle-btn,
  .friend-toggle-btn {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 0.84rem;
  }

  .messages {
    padding: 8px 8px 6px;
    gap: 4px;
  }

  .composer-tools {
    padding: 6px;
    gap: 5px;
  }

  .chat-font-picker select {
    min-width: 0;
    width: 100%;
  }

  .chat-font-size-picker select {
    min-width: 50px;
    width: 50px;
  }

  .presence-menu,
  .friend-menu {
    left: 6px;
    right: 6px;
    bottom: calc(70px + var(--safe-area-bottom));
    max-height: min(66dvh, 500px);
    padding: 9px 9px calc(9px + var(--safe-area-bottom));
    border-radius: 12px 12px 10px 10px;
  }

  .nick-list li.nick,
  .conversation-list li {
    min-height: 28px;
  }

  .app-shell.is-compact.compact-side-rail-enabled .nick-list li.nick,
  .app-shell.is-compact.compact-side-rail-enabled .conversation-list li {
    min-height: 28px !important;
  }

  .quick-panel {
    width: min(94vw, 500px);
    border-radius: 12px;
  }

  #settingsOverlay .quick-panel {
    width: min(88vw, 380px);
    max-height: 66dvh;
    border-radius: 14px;
  }

  #noxHelpOverlay .quick-panel.nox-help-panel {
    width: min(94vw, 560px);
  }

  .nox-help-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  #settingsOverlay .quick-header {
    min-height: 56px;
    padding: 8px 10px;
  }

  #settingsOverlay .quick-header h4 {
    font-size: 0.94rem;
  }

  #settingsOverlay #settingsSubtitle {
    font-size: 0.74rem;
  }

  #settingsOverlay .settings-form {
    padding: 8px 10px 10px;
    gap: 8px;
  }

  #settingsOverlay .settings-toolbar {
    gap: 6px;
    padding: 7px;
    border-radius: 10px;
  }

  #settingsOverlay .settings-tabs {
    gap: 5px;
  }

  #settingsOverlay .settings-tab-btn {
    min-height: 30px;
    border-radius: 9px;
    font-size: 0.74rem;
  }

  #settingsOverlay .settings-search-input {
    min-height: 32px;
    font-size: 0.76rem;
    padding: 0 10px;
  }

  #settingsOverlay .settings-section {
    padding: 8px;
    border-radius: 11px;
    gap: 6px;
  }

  #settingsOverlay .settings-section-title {
    font-size: 0.74rem;
  }

  #settingsOverlay .settings-toggle-grid,
  #settingsOverlay .settings-toggle-grid.settings-toggle-grid-compact {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  #settingsOverlay .settings-collapsible-summary {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 0.78rem;
  }

  #settingsOverlay .settings-collapsible > .settings-toggle-grid {
    padding: 8px;
  }

  
  #settingsOverlay .settings-form .toggle-row {
    min-height: 38px;
    padding: 4.5px 9px;
    font-size: 0.8rem !important;
    border-radius: 11px;
  }
  #settingsOverlay .settings-form .toggle-row > span:first-child {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #settingsOverlay .settings-form .select-row {
    grid-template-columns: minmax(0, 1fr) minmax(128px, 148px);
    min-height: 38px;
    padding: 6px 9px;
    border-radius: 11px;
    gap: 8px;
  }

  #settingsOverlay .settings-form .select-row > span:first-child {
    font-size: 0.82rem;
  }

  #settingsOverlay .settings-form .select-row select {
    font-size: 0.8rem;
    max-width: 148px;
    padding: 7px 9px;
  }

  #settingsOverlay .mobile-layout-card {
    flex: 0 0 auto;
    height: auto;
    padding: 12px;
    gap: 10px;
  }

  #settingsOverlay .mobile-layout-card > .mobile-layout-card-head > span:first-child {
    font-size: 0.84rem;
  }

  #settingsOverlay .mobile-layout-card .mobile-layout-card-head small {
    font-size: 0.72rem;
  }

  #settingsOverlay .mobile-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #settingsOverlay .mobile-layout-option {
    flex: 0 0 auto;
    min-height: 62px;
    padding: 10px;
    gap: 8px;
  }

  #settingsOverlay .mobile-layout-option-check {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
    font-size: 0.64rem;
  }

  #settingsOverlay .mobile-layout-option-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 0.72rem;
  }

  #settingsOverlay .mobile-layout-option-title {
    font-size: 0.77rem;
  }

  #settingsOverlay .mobile-layout-option-copy {
    font-size: 0.62rem;
  }

  #settingsOverlay .avatar-upload-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    /* min-height: 121px; */
    padding: 8px 10px;
    border-radius: 11px;
  }

  #settingsOverlay .avatar-upload-main {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  #settingsOverlay .avatar-upload-preview-wrap {
    display: block;
    width: 46px;
    height: 46px;
  }

  #settingsOverlay .avatar-upload-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  #settingsOverlay #avatarUploadHint,
  #settingsOverlay #avatarPresetHint {
    display: block;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #settingsOverlay .avatar-upload-actions {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    flex-wrap: nowrap;
    width: 100%;
    gap: 8px;
    justify-self: stretch;
  }

  #settingsOverlay .avatar-upload-actions .quick-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  #settingsOverlay .avatar-choice-controls {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  #settingsOverlay .avatar-preset-trigger {
    min-height: 36px;
    padding: 6px 9px;
  }

  #settingsOverlay .avatar-preset-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 216px;
    padding: 7px;
    gap: 7px;
  }

  #settingsOverlay .avatar-preset-option {
    min-height: 66px;
    font-size: 0.68rem;
    padding: 6px 5px;
  }

  .quick-header {
    height: 48px;
    padding: 8px 10px;
  }

  .quick-header h4 {
    font-size: 0.94rem;
    line-height: 1.2;
  }

  .quick-header button {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .quick-form {
    padding: 8px 10px 10px;
    gap: 6px;
  }

  .quick-form label {
    font-size: 0.78rem;
  }

  .quick-form input,
  .quick-form select,
  .quick-form textarea {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 0.86rem;
  }

  .quick-form button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.82rem;
    flex: 1 1 0;
  }

  .presence-menu,
  .friend-menu {
    font-size: 0.84rem;
  }

  .presence-menu-item,
  .friend-policy-btn,
  .friend-add-btn {
    font-size: 0.82rem;
  }
}

/* Canonical compact composer/mobile overlay layout.
   Keep this block at the end so earlier media overrides converge here. */
@media (max-width: 1024px) {
  .app-shell.is-compact {
    --compact-composer-tools-padding: 7px 8px 6px;
    --compact-message-form-padding: 8px calc(8px + var(--safe-area-right)) calc(8px + var(--safe-area-bottom)) calc(8px + var(--safe-area-left));
    --compact-input-min-height: 30px;
    --compact-input-padding: 7px 10px;
  }

  .app-shell.is-compact .composer-tools {
    padding: var(--compact-composer-tools-padding) !important;
    gap: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: 26px 26px 26px 30px minmax(34px, 42px) minmax(40px, 48px) minmax(62px, 1fr) minmax(60px, 68px) !important;
  }

  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player {
    grid-column: 8;
    justify-self: end;
    width: 100%;
    min-height: 30px;
    display: inline-flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
    gap: 0;
    border: none;
    border-left: 1px solid #e5e5e5;
    border-radius: 0;
    background: linear-gradient(180deg, #ffffff 0%, #eef5f9 100%);
    position: static !important;
    inset: auto !important;
    transform: none !important;
    cursor: default;
    touch-action: auto;
  }

  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player .radio-label,
  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player .radio-status,
  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player .radio-volume,
  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player #radioMuteBtn,
  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player #radioLayoutBtn {
    display: none !important;
  }

  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player .radio-mini-btn {
    flex: 1 1 50%;
    width: auto;
    min-width: 30px;
    height: 30px;
    border: none;
    border-right: 1px solid #e5e5e5;
    border-radius: 0;
    background: transparent;
    color: #29414f;
  }

  .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player .radio-mini-btn:last-child {
    border-right: none;
  }

  .app-shell.is-compact .messages {
    --chat-avatar-size: 26px;
    --chat-avatar-letter-size: 10px;
  }

  .app-shell.is-compact .nick-list .profile-presence-dot {
    width: 8px;
    height: 8px;
  }

  .app-shell.is-compact .message-form {
    padding: var(--compact-message-form-padding) !important;
  }

  .app-shell.is-compact .message-form #messageInput {
    min-height: var(--compact-input-min-height) !important;
    padding: var(--compact-input-padding) !important;
    border: none;
  }

  .app-shell.is-compact .presence-menu,
  .app-shell.is-compact .friend-menu,
  .app-shell.is-compact .composer-popover-panel {
    bottom: calc(74px + var(--safe-area-bottom)) !important;
  }
}

@media (max-width: 480px) {
  .app-shell.is-compact {
    --compact-composer-tools-padding: 0;
    --compact-message-form-padding: 0px calc(0px + var(--safe-area-right)) calc(0px + var(--safe-area-bottom)) calc(0px + var(--safe-area-left));
    --compact-input-min-height: 32px;
    --compact-input-padding: 9px 10px;
  }
}

/* Final dark-mode overrides. Keep at the end so earlier hardcoded light styles do not leak. */
:root[data-appearance-mode="dark"] {
  --body-bg: #0b1219;
  --bg: #0f1822;
  --bg-soft: #121e2b;
  --panel: #0f1a26;
  --panel-strong: #142232;
  --text: #d6e3ef;
  --muted: #90a6b8;
  --border: #2b3c4b;
}

:root[data-appearance-mode="dark"] body,
:root[data-appearance-mode="dark"] .app-shell {
  background: var(--body-bg);
  color: var(--text);
}

:root[data-appearance-mode="dark"] .chat-header,
:root[data-appearance-mode="dark"] .private-subheader,
:root[data-appearance-mode="dark"] .topic-bar,
:root[data-appearance-mode="dark"] .panel-header {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--border);
}

:root[data-appearance-mode="dark"] .topic-bar strong,
:root[data-appearance-mode="dark"] #topicText,
:root[data-appearance-mode="dark"] .private-chat-header-text h3,
:root[data-appearance-mode="dark"] .panel-header h3 {
  color: #e3edf6;
}

:root[data-appearance-mode="dark"] .private-chat-header-text small,
:root[data-appearance-mode="dark"] .private-presence-meta,
:root[data-appearance-mode="dark"] .panel-header small,
:root[data-appearance-mode="dark"] #connectionState,
:root[data-appearance-mode="dark"] .topic-bar {
  color: var(--muted);
}

:root[data-appearance-mode="dark"] .presence-toggle-btn,
:root[data-appearance-mode="dark"] .friend-toggle-btn,
:root[data-appearance-mode="dark"] .room-actions-btn,
:root[data-appearance-mode="dark"] .header-icon-btn {
  border-color: #375064;
  background: linear-gradient(180deg, #213345 0%, #1a2a3a 100%);
  color: #d6e5f2;
  box-shadow: 0 2px 10px rgba(3, 10, 16, 0.35);
}

:root[data-appearance-mode="dark"] .presence-toggle-btn:hover,
:root[data-appearance-mode="dark"] .friend-toggle-btn:hover,
:root[data-appearance-mode="dark"] .room-actions-btn:hover,
:root[data-appearance-mode="dark"] .header-icon-btn:hover,
:root[data-appearance-mode="dark"] .presence-toggle-btn.active,
:root[data-appearance-mode="dark"] .friend-toggle-btn.active {
  border-color: #49657b;
  background: linear-gradient(180deg, #2a4054 0%, #223446 100%);
  color: #eef6fd;
}

:root[data-appearance-mode="dark"] .presence-caret,
:root[data-appearance-mode="dark"] .friend-caret {
  color: #a8bfd0;
}

:root[data-appearance-mode="dark"] .presence-menu,
:root[data-appearance-mode="dark"] .friend-menu,
:root[data-appearance-mode="dark"] .context-menu {
  border-color: #334859;
  background: #152434;
  color: #d8e6f1;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

:root[data-appearance-mode="dark"] .presence-menu-item,
:root[data-appearance-mode="dark"] .friend-menu-title,
:root[data-appearance-mode="dark"] .friend-item .friend-nick,
:root[data-appearance-mode="dark"] .friend-item > span {
  color: #d6e3ef;
}

:root[data-appearance-mode="dark"] .presence-menu-item:hover,
:root[data-appearance-mode="dark"] .presence-menu-item.active {
  border-color: #3a5265;
  background: #1d3142;
}

:root[data-appearance-mode="dark"] .presence-menu-divider {
  background: #2b3d4c;
}

:root[data-appearance-mode="dark"] .presence-menu-message,
:root[data-appearance-mode="dark"] .friend-policy-btn,
:root[data-appearance-mode="dark"] .friend-add-row input,
:root[data-appearance-mode="dark"] .friend-add-btn,
:root[data-appearance-mode="dark"] .friend-item,
:root[data-appearance-mode="dark"] .friend-del-btn,
:root[data-appearance-mode="dark"] .friend-accept-btn,
:root[data-appearance-mode="dark"] .friend-reject-btn {
  border-color: #355063;
  background: #1a2c3d;
  color: #d6e3ef;
}

:root[data-appearance-mode="dark"] .friend-policy-btn.active {
  border-color: #477295;
  background: #1f3a4f;
}

:root[data-appearance-mode="dark"] .nick-panel,
:root[data-appearance-mode="dark"] .rooms-panel,
:root[data-appearance-mode="dark"] .nick-list,
:root[data-appearance-mode="dark"] .conversation-list,
:root[data-appearance-mode="dark"] .rooms-nav {
  background: var(--panel);
  border-color: var(--border);
}

:root[data-appearance-mode="dark"] .nick-list li,
:root[data-appearance-mode="dark"] .conversation-list button {
  background: #132232;
  border-color: #24394a;
  color: #d4e2ed;
}

:root[data-appearance-mode="dark"] .conversation-list .conversation-section {
  color: #8da6b7;
}

:root[data-appearance-mode="dark"] .nick-list li.nick:hover {
  background: #1c3041;
  border-color: #355167;
  box-shadow: 0 4px 12px rgba(3, 11, 18, 0.4);
}

:root[data-appearance-mode="dark"] .nick-list li.nick.is-expanded,
:root[data-appearance-mode="dark"] .conversation-list button.active {
  background: #213749;
  border-color: #3c5d74;
  box-shadow: inset 0 0 0 1px #2f4e63;
}

:root[data-appearance-mode="dark"] .conversation-list button.has-unread:not(.active) {
  border-color: #7c4a4d;
  background: #332127;
}

:root[data-appearance-mode="dark"] .conversation-list button.has-priority:not(.active),
:root[data-appearance-mode="dark"] .conversation-list button.has-unread.has-priority:not(.active),
:root[data-appearance-mode="dark"] .conversation-list button.has-private-unread:not(.active) {
  border-color: #7e6336;
  background: #352a1a;
  animation-name: convo-mention-pulse-dark;
}

@keyframes convo-mention-pulse-dark {
  0%, 49.9% {
    background-color: #1f1f1f;
    box-shadow: none;
  }
  50%, 100% {
    background-color: #352a1a;
    box-shadow: inset 0 0 0 1px rgba(239, 177, 77, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .conversation-list button.has-priority:not(.active),
  .conversation-list button.has-unread.has-priority:not(.active),
  .conversation-list button.has-private-unread:not(.active),
  .conversation-list button.has-priority:not(.active)::before,
  .conversation-list button.has-unread.has-priority:not(.active)::before,
  .conversation-list button.has-private-unread:not(.active)::before,
  .mobile-conversation-tab.has-priority,
  .mobile-conversation-tab.has-priority .mobile-conversation-tab-title {
    animation: none !important;
  }
}

:root[data-appearance-mode="dark"] .conv-icon,
:root[data-appearance-mode="dark"] .conv-mode-badge,
:root[data-appearance-mode="dark"] .conv-mode-badge.more,
:root[data-appearance-mode="dark"] .mini-action {
  color: #9bb0bf;
}

:root[data-appearance-mode="dark"] .conv-avatar {
  background: #2c2a4b;
  color: #c8b9ff;
}

:root[data-appearance-mode="dark"] .nick-list li.nick.role-user {
  color: #d4e2ed;
}

:root[data-appearance-mode="dark"] .rooms-tools,
:root[data-appearance-mode="dark"] .rooms-footer {
  background: #142434;
  border-color: var(--border);
  color: #95a9b8;
}

:root[data-appearance-mode="dark"] .rooms-footer strong {
  color: #d8e5ef;
}

:root[data-appearance-mode="dark"] .rooms-view-btn {
  border-color: #3a5263;
  background: #1b2d3d;
  color: #cfe0ec;
}

:root[data-appearance-mode="dark"] .rooms-view-btn.active {
  border-color: #347a60;
  background: #173b32;
  color: #9ceac8;
}

:root[data-appearance-mode="dark"] .rooms-tools input {
  border-color: #3a5263;
  background: #102030;
  color: #d8e6f2;
}

:root[data-appearance-mode="dark"] .composer-tools,
:root[data-appearance-mode="dark"] .message-form {
  background: #122131;
  border-color: var(--border);
  box-shadow: none;
}

:root[data-appearance-mode="dark"] .composer-tools > .fmt-btn,
:root[data-appearance-mode="dark"] .composer-tools > .composer-popover-wrap > .fmt-btn,
:root[data-appearance-mode="dark"] .chat-font-picker select,
:root[data-appearance-mode="dark"] .message-form .send-icon-btn {
  border-color: #32495c;
  background: linear-gradient(180deg, #1f3244 0%, #1a2a39 100%);
  color: #d4e3ef;
}

:root[data-appearance-mode="dark"] .composer-tools > .fmt-btn:hover,
:root[data-appearance-mode="dark"] .composer-tools > .composer-popover-wrap > .fmt-btn:hover,
:root[data-appearance-mode="dark"] .chat-font-picker select:hover,
:root[data-appearance-mode="dark"] .message-form .send-icon-btn:hover {
  background: linear-gradient(180deg, #284155 0%, #203447 100%);
  color: #f1f7fc;
}

:root[data-appearance-mode="dark"] .composer-tools > .fmt-btn.active,
:root[data-appearance-mode="dark"] .composer-tools > .composer-popover-wrap > .fmt-btn.active {
  background: #1d4b3a;
  border-color: #2f7b60;
  color: #c8f6e2;
}

:root[data-appearance-mode="dark"] .message-form #messageInput {
  background: #0e1a27;
  border-color: #2f4659;
  color: #e1edf6;
}

:root[data-appearance-mode="dark"] .message-form #messageInput::placeholder {
  color: #89a0b2;
}

:root[data-appearance-mode="dark"] .messages {
  color: #d4e2ed;
}

:root[data-appearance-mode="dark"] .msg,
:root[data-appearance-mode="dark"] .msg-text {
  color: #d4e2ed;
}

:root[data-appearance-mode="dark"] .msg.own {
  color: #d4e2ed;
}

:root[data-appearance-mode="dark"] .msg-time {
  color: #9bb0bf;
}

:root[data-appearance-mode="dark"] .msg-from,
:root[data-appearance-mode="dark"] .msg-from.role-user {
  color: #b9d9ff;
}

:root[data-appearance-mode="dark"] .msg.notice,
:root[data-appearance-mode="dark"] .msg.system {
  color: #9fb2c2;
}

:root[data-appearance-mode="dark"] .msg.system .msg-from,
:root[data-appearance-mode="dark"] .msg.notice .msg-from:not(.role-founder):not(.role-sop):not(.role-aop):not(.role-halfop):not(.role-voice):not(.role-user) {
  color: #bdd0df;
}

:root[data-appearance-mode="dark"] .msg-link,
:root[data-appearance-mode="dark"] .msg-nick-link {
  color: #69b9ff;
}

:root[data-appearance-mode="dark"] .msg-link:hover,
:root[data-appearance-mode="dark"] .msg-nick-link:hover {
  color: #8accff;
}

:root[data-appearance-mode="dark"] .composer-popover-panel {
  border-color: #34495a;
  background: #162738;
}

:root[data-appearance-mode="dark"] .radio-player {
  border-color: #314a5d;
  background: linear-gradient(180deg, #1e3142 0%, #182838 100%);
  color: #cedfeb;
}

:root[data-appearance-mode="dark"] .radio-label,
:root[data-appearance-mode="dark"] .radio-status {
  color: #b9cedd;
}

:root[data-appearance-mode="dark"] .radio-mini-btn {
  border-color: #3a5469;
  background: #1b2d3d;
  color: #d3e4f0;
}

:root[data-appearance-mode="dark"] .radio-mini-btn:hover {
  background: #274054;
  border-color: #4d6a80;
}

:root[data-appearance-mode="dark"] .radio-mini-btn.is-active {
  color: #82e6b9;
  border-color: #2d8768;
  background: #174133;
}

:root[data-appearance-mode="dark"] .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player {
  border-left-color: #2f4659 !important;
  background: linear-gradient(180deg, #1f3244 0%, #182838 100%) !important;
}

:root[data-appearance-mode="dark"] .app-shell.is-compact .composer-tools > .radio-player.desktop-toolbar-player .radio-mini-btn {
  border-right-color: #2f4659 !important;
  background: transparent !important;
  color: #d3e3ef !important;
}


.private-voice-note-btn {
  position: relative;
  overflow: hidden;
  margin-right: 3px;
  color: #2e6178;
}

.private-image-btn {
  position: relative;
  margin-right: 3px;
  color: #2e6178;
}

.private-image-btn.is-uploading {
  opacity: 0.7;
  cursor: wait;
}

.message-form .private-image-btn svg {
  width: 18px;
  height: 18px;
}

.private-voice-note-btn.recording {
  border-color: #d44444;
  color: #d44444;
  background: #fff4f4;
}

.message-form .private-voice-note-btn svg {
  width: 18px;
  height: 18px;
}

.private-voice-note-btn .voice-note-btn-time {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: currentColor;
  pointer-events: none;
}

.app-shell.is-compact .message-form .private-voice-note-btn {
  width: 30px;
  min-width: 30px;
  height: 31px;
  flex: 0 0 30px;
  margin-right: 2px;
}

.app-shell.is-compact .message-form .private-image-btn {
  width: 30px;
  min-width: 30px;
  height: 31px;
  flex: 0 0 30px;
  margin-right: 2px;
}

.app-shell.is-compact .private-voice-note-btn .voice-note-btn-time {
  font-size: 8px;
  bottom: 1px;
}

:root[data-feature-story-enabled="0"] #actionStories,
:root[data-feature-story-enabled="0"] .stories-rail,
:root[data-feature-story-enabled="0"] .stories-controls-menu {
  display: none !important;
}

:root[data-feature-voice-note-enabled="0"] .private-voice-note-btn {
  display: none !important;
}

.msg-voice-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: min(240px, 66vw);
  max-width: min(360px, 82vw);
  padding: 6px 9px;
  border-radius: 18px;
  background: linear-gradient(180deg, #e7f7d9 0%, #dbefcb 100%);
  border: 1px solid #c4dda9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.msg-pm-image {
  display: inline-grid;
  gap: 5px;
  width: min(300px, 72vw);
  max-width: 100%;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid #c9d7df;
  background: #f7fbfd;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.msg-pm-image.own {
  border-color: #b8d6ad;
  background: #eef8e7;
}

.msg-pm-image-img {
  display: block;
  width: 100%;
  height: min(220px, 54vw);
  border-radius: 7px;
  object-fit: cover;
  background: #ffffff;
}

.msg-pm-image:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.msg-pm-image-meta {
  font-size: 10px;
  color: #5d7280;
  line-height: 1.2;
  padding: 0 2px 1px;
}

.pm-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(10px);
}

.pm-image-lightbox-img {
  display: block;
  max-width: min(92vw, 1100px);
  max-height: min(88vh, 860px);
  border-radius: 8px;
  object-fit: contain;
  background: #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.pm-image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.msg-voice-note:not(.own) {
  background: linear-gradient(180deg, #f8fbfd 0%, #edf3f7 100%);
  border-color: #d4dee7;
}

.msg-voice-note.is-playing {
  border-color: #8bb66f;
}

.msg-voice-note-play {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(180deg, #4c7ea6 0%, #40698b 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.msg-voice-note:where(:hover, :focus-within) .msg-voice-note-play {
  transform: scale(1.04);
  box-shadow: 0 2px 6px rgba(29, 56, 79, 0.25);
}

.msg-voice-note.own .msg-voice-note-play {
  background: linear-gradient(180deg, #3eb878 0%, #2d9e62 100%);
}

.msg-voice-note-visual {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.msg-voice-note-wave {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(2px, 1fr);
  align-items: center;
  gap: 2px;
  min-height: 16px;
  isolation: isolate;
  cursor: pointer;
  border-radius: 10px;
  padding: 1px 2px;
}

.msg-voice-note-bar {
  display: block;
  width: 100%;
  height: calc(20% + (var(--h, 0.5) * 70%));
  border-radius: 99px;
  background: #9fbf9f;
  opacity: 0.9;
}

.msg-voice-note:not(.own) .msg-voice-note-bar {
  background: #9eb3c5;
}

.msg-voice-note.own .msg-voice-note-bar {
  background: #89b16e;
}

.msg-voice-note-wave-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(43, 57, 44, 0.2), rgba(43, 57, 44, 0.3));
  border-radius: 99px;
  z-index: 1;
  pointer-events: none;
}

.msg-voice-note-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
}

.msg-voice-note-player {
  display: none;
}

.msg-voice-note-elapsed {
  font-size: 10px;
  color: #526372;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}

.msg-voice-note-elapsed.is-empty {
  opacity: 0.45;
}

.msg-voice-note-duration {
  font-size: 10px;
  color: #526372;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

/* Desktop-small hardening (1368px class devices)
   Keep this block near file end so it overrides earlier breakpoint rules. */
@media (max-width: 1400px) and (min-width: 981px) {
  :root {
    --rail-width-collapsed: 62px;
    --rail-width-expanded: 194px;
    --nick-panel-width: 168px;
    --rooms-panel-width: 176px;
  }

  .app-shell {
    grid-template-columns: var(--rail-width-collapsed) minmax(340px, 1fr) var(--nick-panel-width) var(--rooms-panel-width);
  }

  .app-shell.hide-nick-panel {
    grid-template-columns: var(--rail-width-collapsed) minmax(340px, 1fr) 0 var(--rooms-panel-width);
  }

  .app-shell.rail-expanded {
    grid-template-columns: var(--rail-width-expanded) minmax(340px, 1fr) var(--nick-panel-width) var(--rooms-panel-width);
  }

  .app-shell.rail-expanded.hide-nick-panel {
    grid-template-columns: var(--rail-width-expanded) minmax(340px, 1fr) 0 var(--rooms-panel-width);
  }

  .action-rail {
    padding: 8px 4px;
  }

  .rail-top,
  .rail-bottom {
    gap: 6px;
  }

  .rail-btn {
    width: 100%;
    height: 38px;
    min-width: 0;
    border-radius: 10px;
  }

  .app-shell.rail-expanded:not(.is-compact) .rail-btn {
    width: 100%;
    min-width: 0;
    height: 38px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .app-shell.rail-expanded:not(.is-compact) .rail-text {
    font-size: 0.82rem;
    line-height: 1;
  }

  .rail-btn svg {
    width: 16px;
    height: 16px;
  }

  .chat-header {
    min-height: 52px;
    padding: 6px 8px;
    gap: 8px;
    grid-template-columns: 128px 1fr auto;
  }

  .nick-panel .panel-header,
  .rooms-panel .panel-header {
    height: 52px;
    min-height: 52px;
    padding: 6px 8px;
  }

  .messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .chat-area > .chat-header,
  .chat-area > .private-subheader,
  .chat-area > .topic-bar,
  .chat-area > .composer-tools,
  .chat-area > .message-form {
    flex: 0 0 auto;
  }

  .chat-area > .messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .rooms-tools {
    min-height: 48px;
    padding: 6px 8px;
  }

  .rooms-tools input {
    padding: 6px 8px;
    font-size: 0.76rem;
  }

  .nick-list li.nick {
    min-height: 32px;
    padding: 3px 6px;
  }

  .nick-list li.nick .label {
    font-size: 0.76rem;
  }

  .conversation-list button {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 0.76rem;
  }

  .composer-tools {
    padding: 0 7px;
  }

  .message-form {
    padding: 4px 7px;
  }

  .message-form #messageInput {
    height: 36px;
    min-height: 36px;
    padding: 7px 10px;
  }

  .message-form .send-icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }
}

/* Very short desktop windows (e.g. 1368x520/530)
   Compress vertical stack so composer/input stays visible. */
@media (max-height: 560px) and (min-width: 981px) {
  .app-shell {
    height: 100vh !important;
    min-height: 0;
  }

  .chat-area {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .chat-header {
    min-height: 44px !important;
    padding: 4px 7px !important;
    gap: 6px !important;
  }

  .topic-bar,
  .private-subheader {
    min-height: 24px !important;
    padding: 3px 7px !important;
  }

  .messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding-top: 6px !important;
    padding-bottom: 4px !important;
    overflow-y: auto !important;
  }

  .composer-tools {
    min-height: 30px;
    padding: 0 6px !important;
  }

  .composer-tools > .fmt-btn,
  .composer-tools > .composer-popover-wrap > .fmt-btn,
  .chat-font-picker select {
    height: 26px !important;
  }

  .message-form {
    padding: 3px 6px !important;
  }

  .message-form #messageInput {
    height: 32px !important;
    min-height: 32px !important;
    padding: 6px 9px !important;
  }

  .message-form .send-icon-btn {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
  }

  .nick-panel .panel-header,
  .rooms-panel .panel-header {
    height: 44px !important;
    min-height: 44px !important;
    padding: 4px 7px !important;
  }

  .rooms-tools {
    min-height: 40px !important;
    padding: 4px 7px !important;
  }

  .rooms-footer {
    padding: 6px 8px !important;
  }
}
