/* =========================================================
   NewChat v1.17.3 — Production Chat Layout
   Scoped to body.newchat-ux-rc4. No MutationObserver.
   ========================================================= */

body.newchat-ux-rc4 {
  --ux-rail-w: 68px;
  --ux-left-w: clamp(244px, 17vw, 282px);
  --ux-right-w: clamp(270px, 19vw, 320px);
  --ux-gap: 0px;
  --ux-radius: 22px;
  --ux-header-h: 72px;
  --ux-radio-h: 64px;
  --ux-shadow: 0 24px 70px rgba(2, 8, 23, .16);
  --ux-shadow-soft: 0 10px 30px rgba(2, 8, 23, .08);
  --ux-panel: var(--ut-card, #ffffff);
  --ux-panel-2: var(--ut-card2, #eef4fb);
  --ux-bg: var(--ut-bg, #edf4fb);
  --ux-sidebar: var(--ut-sidebar, #ffffff);
  --ux-text: var(--ut-text, #243244);
  --ux-muted: var(--ut-muted, #68788d);
  --ux-border: var(--ut-border, #d7e2ee);
  --ux-accent: var(--ut-accent, #54a8ff);
  --ux-accent-2: var(--ut-accent2, #4d45db);
  --ux-button-text: var(--ut-button-text, #ffffff);
  --ux-system: var(--ut-system, #65758a);
}

body.newchat-ux-rc4.chat-active {
  overflow: hidden !important;
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--ux-accent) 13%, transparent), transparent 34%),
    radial-gradient(circle at 96% 92%, color-mix(in srgb, var(--ux-accent-2) 11%, transparent), transparent 35%),
    var(--ux-bg) !important;
}

body.newchat-ux-rc4 .ux-rail svg,
body.newchat-ux-rc4 .ux-message-search svg,
body.newchat-ux-rc4 .ux-user-search svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.newchat-ux-rc4 .ux-rail,
body.newchat-ux-rc4 .ux-left-brand,
body.newchat-ux-rc4 .ux-message-search,
body.newchat-ux-rc4 .ux-user-search {
  box-sizing: border-box;
}

/* Desktop application shell */
@media (min-width: 901px) {
  html body.newchat-ux-rc4.chat-active main.shell.chat-shell {
    width: min(1880px, calc(100vw - 30px)) !important;
    max-width: none !important;
    height: calc(100dvh - 30px) !important;
    min-height: 680px !important;
    margin: 15px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--ux-border) 82%, transparent) !important;
    border-radius: 25px !important;
    background: var(--ux-panel) !important;
    box-shadow: var(--ux-shadow) !important;
  }

  html body.newchat-ux-rc4.chat-active main.shell.chat-shell > .hero,
  html body.newchat-ux-rc4.chat-active main.shell.chat-shell > #authCard {
    max-width: 980px;
    margin-inline: auto;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout.premium-dashboard.chat-layout {
    display: grid !important;
    grid-template-areas: "rail left center right" !important;
    grid-template-columns: var(--ux-rail-w) var(--ux-left-w) minmax(430px, 1fr) var(--ux-right-w) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: var(--ux-gap) !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--ux-panel) !important;
    box-shadow: none !important;
  }

  html body.newchat-ux-rc4.chat-active.left-menu-collapsed:not(.right-menu-collapsed) #chatLayout.premium-dashboard.chat-layout {
    grid-template-areas: "rail center right" !important;
    grid-template-columns: var(--ux-rail-w) minmax(430px, 1fr) var(--ux-right-w) !important;
  }

  html body.newchat-ux-rc4.chat-active.right-menu-collapsed:not(.left-menu-collapsed) #chatLayout.premium-dashboard.chat-layout {
    grid-template-areas: "rail left center" !important;
    grid-template-columns: var(--ux-rail-w) var(--ux-left-w) minmax(430px, 1fr) !important;
  }

  html body.newchat-ux-rc4.chat-active.left-menu-collapsed.right-menu-collapsed #chatLayout.premium-dashboard.chat-layout {
    grid-template-areas: "rail center" !important;
    grid-template-columns: var(--ux-rail-w) minmax(430px, 1fr) !important;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout > .ux-rail { grid-area: rail !important; }
  html body.newchat-ux-rc4.chat-active #chatLayout > .left-menu { grid-area: left !important; }
  html body.newchat-ux-rc4.chat-active #chatLayout > .center-chat-card { grid-area: center !important; }
  html body.newchat-ux-rc4.chat-active #chatLayout > .right-users-panel { grid-area: right !important; }

  html body.newchat-ux-rc4.chat-active.left-menu-collapsed #chatLayout > .left-menu,
  html body.newchat-ux-rc4.chat-active.right-menu-collapsed #chatLayout > .right-users-panel {
    display: none !important;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout > .mobile-chat-bar,
  html body.newchat-ux-rc4.chat-active #chatLayout > .mobile-backdrop {
    display: none !important;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout > .desktop-panel-reveal,
  html body.newchat-ux-rc4.chat-active #chatLayout > .connection-status {
    position: fixed !important;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout > .left-menu,
  html body.newchat-ux-rc4.chat-active #chatLayout > .right-users-panel,
  html body.newchat-ux-rc4.chat-active #chatLayout > .center-chat-card {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* Vertical icon rail */
body.newchat-ux-rc4 .ux-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 13px 9px;
  border-right: 1px solid var(--ux-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ux-sidebar) 97%, var(--ux-accent) 3%), var(--ux-sidebar));
  color: var(--ux-muted);
  z-index: 9;
}

body.newchat-ux-rc4 .ux-rail-brand {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, var(--ux-accent) 35%, var(--ux-border));
  border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--ux-accent-2) 13%, var(--ux-panel)), color-mix(in srgb, var(--ux-accent) 13%, var(--ux-panel)));
  box-shadow: var(--ux-shadow-soft);
}

body.newchat-ux-rc4 .ux-rail-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

body.newchat-ux-rc4 .ux-rail-btn {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: var(--ux-muted) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .ux-rail-btn svg {
  width: 22px;
  height: 22px;
}

body.newchat-ux-rc4 .ux-rail-btn span {
  position: absolute;
  left: 58px;
  top: 50%;
  z-index: 100;
  padding: 6px 9px;
  border: 1px solid var(--ux-border);
  border-radius: 9px;
  background: var(--ux-panel);
  color: var(--ux-text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-5px, -50%);
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: var(--ux-shadow-soft);
}

body.newchat-ux-rc4 .ux-rail-btn:hover,
body.newchat-ux-rc4 .ux-rail-btn:focus-visible,
body.newchat-ux-rc4 .ux-rail-btn.is-active {
  border-color: color-mix(in srgb, var(--ux-accent-2) 30%, var(--ux-border)) !important;
  background: color-mix(in srgb, var(--ux-accent-2) 11%, var(--ux-panel)) !important;
  color: var(--ux-accent-2) !important;
}

body.newchat-ux-rc4 .ux-rail-btn:hover span,
body.newchat-ux-rc4 .ux-rail-btn:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
}

body.newchat-ux-rc4 .ux-rail-profile {
  margin-top: auto;
}

/* Left rooms and conversations panel */
body.newchat-ux-rc4 .left-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 12px !important;
  overflow: hidden auto !important;
  border-right: 1px solid var(--ux-border) !important;
  background: var(--ux-sidebar) !important;
  color: var(--ux-text) !important;
}

body.newchat-ux-rc4 .ux-left-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 51px;
  padding: 5px 7px 10px;
  border-bottom: 1px solid var(--ux-border);
}

body.newchat-ux-rc4 .ux-left-brand img {
  width: 34px;
  height: 34px;
}

body.newchat-ux-rc4 .ux-left-brand div {
  display: grid;
  min-width: 0;
}

body.newchat-ux-rc4 .ux-left-brand strong {
  color: var(--ux-text);
  font-size: 16px;
  line-height: 1.2;
}

body.newchat-ux-rc4 .ux-left-brand span {
  color: var(--ux-muted);
  font-size: 10px;
}

body.newchat-ux-rc4 .left-menu .desktop-panel-tools {
  position: absolute !important;
  top: 13px !important;
  right: 11px !important;
  z-index: 5;
}

body.newchat-ux-rc4 .left-menu .desktop-layout-toggle {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 11px !important;
  border: 1px solid var(--ux-border) !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-muted) !important;
}

body.newchat-ux-rc4 .left-menu .side-card,
body.newchat-ux-rc4 .left-menu .profile-mini {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 10px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .left-menu .main-nav-card {
  padding-top: 3px !important;
}

body.newchat-ux-rc4 .left-menu h3,
body.newchat-ux-rc4 .right-users-panel h3 {
  margin: 4px 5px 8px !important;
  color: var(--ux-muted) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .085em !important;
  text-transform: uppercase !important;
}

body.newchat-ux-rc4 .left-menu .channel-list,
body.newchat-ux-rc4 .left-menu .private-list {
  display: grid !important;
  gap: 4px !important;
}

body.newchat-ux-rc4 .left-menu .channel-btn,
body.newchat-ux-rc4 .left-menu .private-btn,
body.newchat-ux-rc4 .left-menu .rules-menu-link,
body.newchat-ux-rc4 .left-menu .logout-menu-btn {
  width: 100% !important;
  min-height: 39px !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  padding: 8px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--ux-text) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .left-menu .channel-btn:hover,
body.newchat-ux-rc4 .left-menu .private-btn:hover,
body.newchat-ux-rc4 .left-menu .rules-menu-link:hover {
  border-color: var(--ux-border) !important;
  background: var(--ux-panel-2) !important;
}

body.newchat-ux-rc4 .left-menu .channel-btn.active {
  position: relative;
  border-color: color-mix(in srgb, var(--ux-accent-2) 24%, var(--ux-border)) !important;
  background: color-mix(in srgb, var(--ux-accent-2) 11%, var(--ux-panel)) !important;
  color: var(--ux-accent-2) !important;
}

body.newchat-ux-rc4 .left-menu .channel-btn.active::before {
  content: "";
  width: 3px;
  height: 20px;
  border-radius: 999px;
  background: var(--ux-accent-2);
}

body.newchat-ux-rc4 .left-menu .ux-left-private-card {
  min-height: 120px;
  max-height: 260px;
  overflow: hidden auto;
  border-top: 1px solid var(--ux-border) !important;
  border-bottom: 1px solid var(--ux-border) !important;
  border-radius: 0 !important;
}

body.newchat-ux-rc4 .left-menu .ux-left-private-card .side-help {
  margin: 0 5px 9px;
  color: var(--ux-muted) !important;
  font-size: 10px;
  line-height: 1.35;
}

body.newchat-ux-rc4 .left-menu .private-list-row {
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.newchat-ux-rc4 .left-menu .profile-mini {
  margin-top: auto !important;
  border: 1px solid var(--ux-border) !important;
  background: color-mix(in srgb, var(--ux-panel-2) 68%, var(--ux-panel)) !important;
}

body.newchat-ux-rc4 .left-menu .profile-stats,
body.newchat-ux-rc4 .left-menu .security-strip {
  display: none !important;
}

body.newchat-ux-rc4 .left-menu .presence-control {
  margin-top: 8px !important;
}

/* Central chat */
body.newchat-ux-rc4 .center-chat-card {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: var(--ux-panel) !important;
  color: var(--ux-text) !important;
  border-right: 1px solid var(--ux-border) !important;
}

body.newchat-ux-rc4 .center-chat-card > .chat-head {
  flex: 0 0 var(--ux-header-h) !important;
  min-height: var(--ux-header-h) !important;
  display: grid !important;
  grid-template-columns: minmax(210px, auto) minmax(160px, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 10px 15px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ux-border) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--ux-panel) 97%, var(--ux-accent) 3%) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .center-chat-card .channel-title-wrap {
  min-width: 0;
  gap: 10px !important;
}

body.newchat-ux-rc4 .center-chat-card .chat-header-logo {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid color-mix(in srgb, var(--ux-accent-2) 23%, var(--ux-border)) !important;
  border-radius: 13px !important;
  background: color-mix(in srgb, var(--ux-accent-2) 9%, var(--ux-panel)) !important;
}

body.newchat-ux-rc4 .center-chat-card .chat-header-logo img {
  width: 27px !important;
  height: 27px !important;
}

body.newchat-ux-rc4 #activeChannelTitle {
  display: block;
  overflow: hidden;
  color: var(--ux-text) !important;
  font-size: clamp(15px, 1.3vw, 20px) !important;
  font-weight: 800 !important;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.newchat-ux-rc4 #activeChannelHelp {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ux-muted) !important;
  font-size: 10px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.newchat-ux-rc4 .ux-message-search,
body.newchat-ux-rc4 .ux-user-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--ux-border);
  border-radius: 11px;
  background: var(--ux-panel-2);
  color: var(--ux-muted);
}

body.newchat-ux-rc4 .ux-message-search svg,
body.newchat-ux-rc4 .ux-user-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

body.newchat-ux-rc4 .ux-message-search input,
body.newchat-ux-rc4 .ux-user-search input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--ux-text) !important;
  box-shadow: none !important;
  font-size: 11px;
}

body.newchat-ux-rc4 .ux-message-search button {
  display: none;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--ux-muted) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .ux-message-search.has-value button { display: grid; place-items: center; }

body.newchat-ux-rc4 .center-chat-card .chat-head-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
  min-width: 0;
}

body.newchat-ux-rc4 .center-chat-card .compact-online-box,
body.newchat-ux-rc4 .center-chat-card .theme-menu-wrap,
body.newchat-ux-rc4 .center-chat-card .tool-btn {
  min-height: 38px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 11px !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-text) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .center-chat-card #channelMuteBtn {
  background: linear-gradient(135deg, var(--ux-accent-2), var(--ux-accent)) !important;
  color: var(--ux-button-text) !important;
  border-color: transparent !important;
}

/* Radio strip moved into the real center column */
body.newchat-ux-rc4 .center-chat-card > #radioCard.ux-radio-strip {
  flex: 0 0 var(--ux-radio-h) !important;
  min-height: var(--ux-radio-h) !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) auto !important;
  grid-template-areas:
    "art name actions"
    "art track actions" !important;
  align-items: center !important;
  gap: 2px 11px !important;
  margin: 0 !important;
  padding: 9px 14px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ux-border) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--ux-panel-2) 74%, var(--ux-panel)) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip::before {
  content: "♫";
  grid-area: art;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--ux-accent-2), var(--ux-accent));
  color: var(--ux-button-text);
  font-size: 18px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ux-accent-2) 24%, transparent);
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip > strong {
  grid-area: name;
  align-self: end;
  color: var(--ux-text) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip > #radioStatus {
  display: none !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip > .radio-actions {
  grid-area: actions;
  display: flex !important;
  gap: 6px !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip .radio-control-btn {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 50% !important;
  background: var(--ux-panel) !important;
  color: var(--ux-accent-2) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip .radio-play-btn {
  background: linear-gradient(135deg, var(--ux-accent-2), var(--ux-accent)) !important;
  color: var(--ux-button-text) !important;
  border-color: transparent !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioNowPlaying {
  grid-area: track;
  align-self: start;
  min-width: 0;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ux-text) !important;
  font-size: 12px !important;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioExtraInfo,
body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioDjLive,
body.newchat-ux-rc4 #radioCard.ux-radio-strip audio {
  display: none !important;
}

body.newchat-ux-rc4 .center-chat-card > .welcome-rules {
  margin: 10px 14px 0 !important;
  border-radius: 12px !important;
}

body.newchat-ux-rc4 .center-chat-card > #messages.messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 13px clamp(13px, 2.2vw, 28px) 24px !important;
  overflow-y: auto !important;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ux-border) 42%, transparent) 1px, transparent 1.15px) 0 0 / 20px 20px,
    color-mix(in srgb, var(--ux-bg) 42%, var(--ux-panel)) !important;
  color: var(--ux-text) !important;
  scroll-padding-bottom: 100px;
}

body.newchat-ux-rc4 #messages .message {
  width: min(76%, 780px) !important;
  max-width: min(76%, 780px) !important;
  margin: 0 0 10px !important;
}

body.newchat-ux-rc4 #messages .message.own {
  margin-left: auto !important;
}

body.newchat-ux-rc4 #messages .message.system {
  width: 100% !important;
  max-width: 100% !important;
  margin: 7px auto !important;
  text-align: center;
}

body.newchat-ux-rc4 #messages .message.system .message-bubble,
body.newchat-ux-rc4 #messages .system-message {
  width: fit-content !important;
  max-width: 90% !important;
  margin-inline: auto !important;
  padding: 6px 12px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--ux-panel-2) 82%, var(--ux-panel)) !important;
  color: var(--ux-system) !important;
  font-size: 10px !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #messages .message-bubble {
  padding: 11px 13px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 14px 14px 14px 5px !important;
  background: var(--ut-other-bubble, var(--ux-panel)) !important;
  color: var(--ux-text) !important;
  box-shadow: 0 7px 22px rgba(2, 8, 23, .055) !important;
}

body.newchat-ux-rc4 #messages .message.own .message-bubble {
  border-radius: 14px 14px 5px 14px !important;
  border-color: color-mix(in srgb, var(--ux-accent-2) 28%, var(--ux-border)) !important;
  background: linear-gradient(135deg, var(--ux-accent-2), var(--ut-own-bubble, var(--ux-accent))) !important;
  color: var(--ux-button-text) !important;
}

body.newchat-ux-rc4 #messages .message-head {
  margin-bottom: 5px !important;
  gap: 8px !important;
}

body.newchat-ux-rc4 #messages .message-author .avatar {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
}

body.newchat-ux-rc4 #messages .message-author strong {
  color: var(--ux-accent-2) !important;
  font-size: 11px !important;
}

body.newchat-ux-rc4 #messages .message.own .message-author strong,
body.newchat-ux-rc4 #messages .message.own .message-head span,
body.newchat-ux-rc4 #messages .message.own .message-text {
  color: var(--ux-button-text) !important;
}

body.newchat-ux-rc4 #messages .message-text {
  font-size: 12px !important;
  line-height: 1.55 !important;
}

body.newchat-ux-rc4 #messages .message-search-hidden,
body.newchat-ux-rc4 #userList .user-search-hidden {
  display: none !important;
}

body.newchat-ux-rc4 #messages .message-search-hit .message-bubble {
  outline: 2px solid color-mix(in srgb, var(--ux-accent) 65%, transparent) !important;
  outline-offset: 2px;
}

body.newchat-ux-rc4 .typing-indicator {
  flex: 0 0 auto;
  margin: 0 16px 5px !important;
}

body.newchat-ux-rc4 .center-chat-card > #botQuickbar {
  flex: 0 0 auto;
  display: flex !important;
  gap: 6px !important;
  min-height: 42px !important;
  padding: 6px 12px !important;
  overflow-x: auto !important;
  border-top: 1px solid var(--ux-border) !important;
  background: color-mix(in srgb, var(--ux-panel-2) 72%, var(--ux-panel)) !important;
}

body.newchat-ux-rc4 #botQuickbar .bot-chip {
  min-height: 30px !important;
  padding: 5px 10px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 999px !important;
  background: var(--ux-panel) !important;
  color: var(--ux-text) !important;
  font-size: 10px !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .center-chat-card > #composePreview {
  flex: 0 0 auto;
  margin: 0 !important;
}

body.newchat-ux-rc4 .center-chat-card > #messageForm.compact-message-composer {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) 42px !important;
  align-items: end !important;
  gap: 8px !important;
  min-height: 67px !important;
  margin: 0 !important;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom)) !important;
  border: 0 !important;
  border-top: 1px solid var(--ux-border) !important;
  border-radius: 0 !important;
  background: var(--ux-panel) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #messageForm #messageInput {
  min-height: 44px !important;
  max-height: 126px !important;
  margin: 0 !important;
  padding: 11px 13px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 13px !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-text) !important;
  caret-color: var(--ux-accent-2) !important;
  box-shadow: none !important;
  font-size: 12px !important;
}

body.newchat-ux-rc4 #messageForm #messageInput:focus {
  border-color: color-mix(in srgb, var(--ux-accent-2) 62%, var(--ux-border)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ux-accent-2) 11%, transparent) !important;
}

body.newchat-ux-rc4 #messageForm .composer-plus-btn,
body.newchat-ux-rc4 #messageForm .compact-send-btn {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border-radius: 13px !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #messageForm .composer-plus-btn {
  border: 1px solid var(--ux-border) !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-accent-2) !important;
}

body.newchat-ux-rc4 #messageForm .compact-send-btn {
  border: 0 !important;
  background: linear-gradient(135deg, var(--ux-accent-2), var(--ux-accent)) !important;
  color: var(--ux-button-text) !important;
}

body.newchat-ux-rc4 #messageForm .composer-popup {
  left: 12px !important;
  right: 12px !important;
  bottom: calc(100% + 8px) !important;
  padding: 9px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 14px !important;
  background: var(--ux-panel) !important;
  box-shadow: var(--ux-shadow-soft) !important;
}

/* Right member directory */
body.newchat-ux-rc4 .right-users-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
  background: var(--ux-sidebar) !important;
  color: var(--ux-text) !important;
}

body.newchat-ux-rc4 .right-users-panel .desktop-panel-tools {
  position: absolute !important;
  top: 13px !important;
  right: 11px !important;
  z-index: 5;
}

body.newchat-ux-rc4 .right-users-panel .desktop-layout-toggle {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 11px !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-muted) !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .right-users-panel .members-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 53px 0 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 .right-users-panel .panel-title-row {
  position: absolute;
  top: 17px;
  left: 17px;
  right: 58px;
  min-height: 31px;
}

body.newchat-ux-rc4 .right-users-panel .panel-title-row h3 {
  margin: 0 !important;
  color: var(--ux-text) !important;
  font-size: 12px !important;
  letter-spacing: .03em !important;
}

body.newchat-ux-rc4 .right-users-panel #rightOnlineBadge {
  height: 26px !important;
  min-width: 26px !important;
  padding: 0 7px !important;
  border: 1px solid color-mix(in srgb, var(--ux-accent-2) 25%, var(--ux-border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--ux-accent-2) 10%, var(--ux-panel)) !important;
  color: var(--ux-accent-2) !important;
}

body.newchat-ux-rc4 .ux-user-search {
  flex: 0 0 38px;
  margin: 0 5px 10px;
}

body.newchat-ux-rc4 .right-users-panel #userList {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 4px 8px !important;
  overflow-y: auto !important;
}

body.newchat-ux-rc4 #userList .user-group {
  margin: 0 0 13px !important;
}

body.newchat-ux-rc4 #userList .user-group-title {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 5px !important;
  padding: 6px 5px !important;
  background: var(--ux-sidebar) !important;
  color: var(--ux-muted) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: .065em;
  text-transform: uppercase;
}

body.newchat-ux-rc4 #userList ul {
  display: grid !important;
  gap: 3px !important;
}

body.newchat-ux-rc4 #userList li {
  min-height: 47px !important;
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 5px 6px !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #userList li:hover {
  border-color: var(--ux-border) !important;
  background: var(--ux-panel-2) !important;
}

body.newchat-ux-rc4 #userList li > .avatar {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
}

body.newchat-ux-rc4 #userList .user-list-main {
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ux-text) !important;
  box-shadow: none !important;
  text-align: left !important;
}

body.newchat-ux-rc4 #userList .user-list-main strong,
body.newchat-ux-rc4 #userList .user-list-main span,
body.newchat-ux-rc4 #userList .user-list-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.newchat-ux-rc4 #userList .user-list-main strong {
  font-size: 11px !important;
}

body.newchat-ux-rc4 #userList .user-list-main small,
body.newchat-ux-rc4 #userList .user-display-name {
  color: var(--ux-muted) !important;
  font-size: 9px !important;
}

body.newchat-ux-rc4 #userList .role-badge {
  padding: 3px 6px !important;
  border: 1px solid color-mix(in srgb, var(--ux-accent-2) 24%, var(--ux-border)) !important;
  border-radius: 7px !important;
  background: color-mix(in srgb, var(--ux-accent-2) 10%, var(--ux-panel)) !important;
  color: var(--ux-accent-2) !important;
  font-size: 8px !important;
}

/* Floating private-message dock remains above composer */
body.newchat-ux-rc4 .private-messages-dock {
  right: 24px !important;
  bottom: 89px !important;
}

body.newchat-ux-rc4 .private-inbox-pill,
body.newchat-ux-rc4 .private-inbox-panel {
  border: 1px solid var(--ux-border) !important;
  background: var(--ux-panel) !important;
  color: var(--ux-text) !important;
  box-shadow: var(--ux-shadow-soft) !important;
}

/* Tablet: retain four zones but reduce widths */
@media (min-width: 901px) and (max-width: 1180px) {
  body.newchat-ux-rc4 {
    --ux-left-w: 224px;
    --ux-right-w: 250px;
    --ux-rail-w: 60px;
  }

  body.newchat-ux-rc4 .ux-rail { padding-inline: 6px; }
  body.newchat-ux-rc4 .ux-rail-brand,
  body.newchat-ux-rc4 .ux-rail-btn { width: 44px; min-width: 44px; }
  body.newchat-ux-rc4 .ux-message-search { display: none; }
  body.newchat-ux-rc4 .center-chat-card > .chat-head {
    grid-template-columns: minmax(210px, 1fr) auto !important;
  }
}

/* Mobile: use the existing proven single-pane drawers. */
@media (max-width: 900px) {
  body.newchat-ux-rc4 {
    --ux-header-h: 58px;
    --ux-radio-h: 52px;
  }

  body.newchat-ux-rc4.chat-active {
    overflow: hidden !important;
  }

  body.newchat-ux-rc4 .ux-rail,
  body.newchat-ux-rc4 .ux-left-brand,
  body.newchat-ux-rc4 .ux-message-search,
  body.newchat-ux-rc4 .ux-user-search {
    display: none !important;
  }

  html body.newchat-ux-rc4.chat-active main.shell.chat-shell {
    width: 100% !important;
    height: var(--newchat-vvh, 100dvh) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout.premium-dashboard.chat-layout {
    display: block !important;
    width: 100% !important;
    height: var(--newchat-vvh, 100dvh) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html body.newchat-ux-rc4.chat-active #chatLayout > .center-chat-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: calc(var(--newchat-vvh, 100dvh) - var(--nc-mobile-bar-h, 66px)) !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body.newchat-ux-rc4 .center-chat-card > .chat-head {
    display: flex !important;
    flex: 0 0 var(--ux-header-h) !important;
    min-height: var(--ux-header-h) !important;
    padding: 7px 10px !important;
  }

  body.newchat-ux-rc4 .center-chat-card .channel-title-wrap {
    flex: 1 1 auto;
  }

  body.newchat-ux-rc4 .center-chat-card .chat-head-actions {
    flex: 0 0 auto;
  }

  body.newchat-ux-rc4 .center-chat-card .chat-head-actions > :not(.desktop-theme-wrap):not(.compact-online-box) {
    display: none !important;
  }

  body.newchat-ux-rc4 .center-chat-card .compact-online-box {
    display: none !important;
  }

  body.newchat-ux-rc4 .center-chat-card > #radioCard.ux-radio-strip {
    flex: 0 0 var(--ux-radio-h) !important;
    min-height: var(--ux-radio-h) !important;
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    gap: 1px 8px !important;
    padding: 6px 10px !important;
  }

  body.newchat-ux-rc4 #radioCard.ux-radio-strip::before {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 14px;
  }

  body.newchat-ux-rc4 #radioCard.ux-radio-strip > strong { font-size: 9px !important; }
  body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioNowPlaying { font-size: 10px !important; }
  body.newchat-ux-rc4 #radioCard.ux-radio-strip .radio-control-btn:not(.radio-play-btn) { display: none !important; }
  body.newchat-ux-rc4 #radioCard.ux-radio-strip .radio-control-btn {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  body.newchat-ux-rc4 .center-chat-card > #messages.messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 9px 18px !important;
    overflow-y: auto !important;
  }

  body.newchat-ux-rc4 #messages .message,
  body.newchat-ux-rc4 #messages .message.own {
    width: 94% !important;
    max-width: 94% !important;
  }

  body.newchat-ux-rc4 .center-chat-card > #botQuickbar {
    flex: 0 0 40px !important;
    min-height: 40px !important;
    padding: 5px 8px !important;
  }

  body.newchat-ux-rc4 .center-chat-card > #messageForm.compact-message-composer {
    flex: 0 0 auto !important;
    min-height: 62px !important;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
  }

  body.newchat-ux-rc4 .left-menu,
  body.newchat-ux-rc4 .right-users-panel {
    background: var(--ux-sidebar) !important;
  }

  body.newchat-ux-rc4 .left-menu .ux-left-private-card {
    max-height: none;
  }

  
}

@media (max-width: 540px) {
  body.newchat-ux-rc4 .center-chat-card > .chat-head {
    display: none !important;
  }

  body.newchat-ux-rc4 .center-chat-card > #radioCard.ux-radio-strip {
    flex-basis: 48px !important;
    min-height: 48px !important;
  }

  body.newchat-ux-rc4 #messages .message,
  body.newchat-ux-rc4 #messages .message.own {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.newchat-ux-rc4 #messages .message-bubble {
    padding: 10px 11px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.newchat-ux-rc4 *,
  body.newchat-ux-rc4 *::before,
  body.newchat-ux-rc4 *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* RC4 local validation corrections: explicit readable message content. */
body.newchat-ux-rc4 #messages .message:not(.own) .message-text,
body.newchat-ux-rc4 #messages .message:not(.own) .message-head > span,
body.newchat-ux-rc4 #messages .message:not(.own) .message-head small {
  color: var(--ux-text) !important;
}

body.newchat-ux-rc4 #messages .message:not(.own) .message-head > span,
body.newchat-ux-rc4 #messages .message:not(.own) .message-head small {
  opacity: .66 !important;
}

body.newchat-ux-rc4 #messages .reaction-bar,
body.newchat-ux-rc4 #messages .message-reactions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  margin-top: 8px !important;
}

body.newchat-ux-rc4 #messages .reaction-bar button,
body.newchat-ux-rc4 #messages .message-reactions button,
body.newchat-ux-rc4 #messages .reaction-btn {
  min-width: 0 !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 3px 8px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 9px !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-text) !important;
  font-size: 10px !important;
  box-shadow: none !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioNowPlaying {
  display: block !important;
}


/* =========================================================
   RC5 requested refinements
   ========================================================= */
body.newchat-ux-rc4 .desktop-theme-wrap { display: none !important; }

body.newchat-ux-rc4 .ux-rail-theme-popover {
  position: fixed;
  z-index: 10050;
  width: min(258px, calc(100vw - 24px));
  max-height: min(380px, calc(100dvh - 24px));
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--ux-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--ux-panel) 96%, transparent);
  box-shadow: 0 24px 60px rgba(0,0,0,.38);
  backdrop-filter: blur(16px);
}
body.newchat-ux-rc4 .ux-rail-theme-popover.hidden { display: none !important; }
body.newchat-ux-rc4 .ux-rail-theme-popover #themeMenu {
  position: static !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
body.newchat-ux-rc4 .ux-rail-theme-popover .theme-choice {
  width: 100% !important;
  min-height: 44px !important;
  display: grid !important;
  grid-template-columns: 46px 1fr auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 10px !important;
  border: 1px solid var(--ux-border) !important;
  border-radius: 12px !important;
  background: var(--ux-panel-2) !important;
  color: var(--ux-text) !important;
  text-align: left !important;
}
body.newchat-ux-rc4 .ux-rail-theme-popover .theme-choice > span {
  position: static !important;
  width: 42px !important;
  height: 28px !important;
  opacity: 1 !important;
  transform: none !important;
  border-radius: 9px !important;
  pointer-events: none !important;
}
body.newchat-ux-rc4 .ux-rail-theme-popover .theme-choice > b { font-size: 12px; }
body.newchat-ux-rc4 .ux-rail-theme-popover .theme-choice.active::after {
  content: "✓";
  color: var(--ux-accent-2);
  font-weight: 900;
}

body.newchat-ux-rc4 #profileMini {
  cursor: pointer;
  outline: none;
}
body.newchat-ux-rc4 #profileMini:hover,
body.newchat-ux-rc4 #profileMini:focus-visible {
  border-color: color-mix(in srgb, var(--ux-accent-2) 52%, var(--ux-border)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ux-accent-2) 12%, transparent) !important;
}
body.newchat-ux-rc4 .profile-card-hint {
  margin: 3px 0 0 !important;
  color: var(--ux-muted) !important;
  font-size: 11px !important;
}
body.newchat-ux-rc4 .left-profile-card > .left-presence-control { display: none !important; }

body.newchat-ux-rc4 .profile-presence-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 250px);
  gap: 14px;
  align-items: center;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--ux-border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--ux-accent-2) 7%, var(--ux-panel-2));
}
body.newchat-ux-rc4 .profile-presence-section div { display: grid; gap: 3px; }
body.newchat-ux-rc4 .profile-presence-section span { color: var(--ux-muted); font-size: 12px; }
body.newchat-ux-rc4 #profilePresenceSelect {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--ux-border);
  border-radius: 12px;
  background: var(--ux-input);
  color: var(--ux-text);
}
body.newchat-ux-rc4 .guest-profile-notice {
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--ux-accent) 32%, var(--ux-border));
  border-radius: 13px;
  background: color-mix(in srgb, var(--ux-accent) 8%, var(--ux-panel));
  color: var(--ux-text);
  line-height: 1.5;
}
body.newchat-ux-rc4 .guest-profile-mode .profile-preview { margin-bottom: 4px; }
body.newchat-ux-rc4 .guest-profile-mode .settings-actions { justify-content: flex-end; }

body.newchat-ux-rc4 #welcomeRules[data-channel-topic="help"] {
  border-color: color-mix(in srgb, #f59e0b 48%, var(--ux-border)) !important;
  background: color-mix(in srgb, #f59e0b 10%, var(--ux-panel)) !important;
}
body.newchat-ux-rc4 #welcomeRules[data-channel-topic="help"]::before { content: "🛟" !important; }
body.newchat-ux-rc4 #welcomeRules #channelTopicText { margin-left: 4px; }

body.newchat-ux-rc4 .bot-location-search { position: relative; }
body.newchat-ux-rc4 #botCitySuggestions.bot-city-suggestions {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 8px;
}
body.newchat-ux-rc4 #botCitySuggestions.hidden { display: none !important; }
body.newchat-ux-rc4 .bot-city-suggestion {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ux-border);
  border-radius: 11px;
  background: var(--ux-panel-2);
  color: var(--ux-text);
  text-align: left;
}
body.newchat-ux-rc4 .bot-city-suggestion strong {
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ux-accent-2) 16%, transparent);
  color: var(--ux-accent-2);
  font-size: 9px;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  body.newchat-ux-rc4 .profile-presence-section { grid-template-columns: 1fr; }
  body.newchat-ux-rc4 .ux-rail-theme-popover { display: none !important; }
}
/* =========================================================
   RC6 immediate refinements
   ========================================================= */

/* One visible NewChat mark per viewport: left desktop brand or mobile header. */
body.newchat-ux-rc4 .ux-rail-brand,
body.newchat-ux-rc4 .center-chat-card .chat-header-logo {
  display: none !important;
}

body.newchat-ux-rc4 .center-chat-card .channel-title-wrap {
  gap: 0 !important;
}

/* Compact profile card: identity only. Status lives inside the profile modal. */
body.newchat-ux-rc4 .left-profile-card .profile-card-hint,
body.newchat-ux-rc4 .left-profile-card #myPresenceText,
body.newchat-ux-rc4 .left-profile-card #myRole {
  display: none !important;
}

body.newchat-ux-rc4 .left-profile-card .profile-mini-text {
  min-width: 0;
  display: flex;
  align-items: center;
}

body.newchat-ux-rc4 .left-profile-card .profile-mini-text > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* High-contrast online counter across all eight themes. */
body.newchat-ux-rc4 .center-chat-card .compact-online-box {
  min-width: max-content !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 13px !important;
  border: 1px solid color-mix(in srgb, #22c55e 44%, var(--ux-border)) !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, #22c55e 11%, var(--ux-panel)) !important;
  color: var(--ux-text) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.newchat-ux-rc4 .center-chat-card .compact-online-box .dot {
  width: 10px !important;
  height: 10px !important;
  flex: 0 0 10px !important;
  border-radius: 50%;
  background: #22c55e !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 16%, transparent), 0 0 12px color-mix(in srgb, #22c55e 55%, transparent) !important;
}

body.newchat-ux-rc4 .center-chat-card .compact-online-box #onlineCount {
  color: var(--ux-text) !important;
  opacity: 1 !important;
  white-space: nowrap;
}

/* Radio no longer consumes permanent layout height. */
body.newchat-ux-rc4 .center-chat-card {
  position: relative !important;
}

html body.newchat-ux-rc4.chat-active .center-chat-card > #radioCard.ux-radio-strip {
  position: absolute !important;
  top: calc(var(--ux-header-h) + 10px) !important;
  left: 16px !important;
  right: 16px !important;
  z-index: 140 !important;
  width: auto !important;
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) auto !important;
  grid-template-areas:
    "art name actions"
    "art track actions" !important;
  gap: 1px 10px !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--ux-accent-2) 35%, var(--ux-border)) !important;
  border-radius: 15px !important;
  background: color-mix(in srgb, var(--ux-panel) 94%, transparent) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.34) !important;
  backdrop-filter: blur(18px);
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-10px) scale(.985);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

html body.newchat-ux-rc4.chat-active.radio-toast-visible .center-chat-card > #radioCard.ux-radio-strip,
html body.newchat-ux-rc4.chat-active.radio-player-pinned .center-chat-card > #radioCard.ux-radio-strip {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1);
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip::before {
  width: 38px !important;
  height: 38px !important;
  border-radius: 11px !important;
  font-size: 16px !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip > strong {
  font-size: 10px !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioNowPlaying {
  font-size: 11px !important;
}

body.newchat-ux-rc4 #radioCard.ux-radio-strip .radio-control-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
}

body.newchat-ux-rc4:not(.radio-player-pinned) #radioCard.ux-radio-strip .radio-control-btn:not(.radio-play-btn) {
  display: none !important;
}

html body.newchat-ux-rc4.chat-active.radio-player-pinned .center-chat-card > #radioCard.ux-radio-strip {
  height: auto !important;
  min-height: 78px !important;
  max-height: 118px !important;
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  grid-template-areas:
    "art name actions"
    "art track actions"
    "art status actions" !important;
  padding: 10px 12px !important;
}

body.newchat-ux-rc4.radio-player-pinned #radioCard.ux-radio-strip > #radioStatus {
  grid-area: status;
  display: block !important;
  min-width: 0;
  overflow: hidden;
  margin: 2px 0 0 !important;
  color: var(--ux-muted) !important;
  font-size: 10px !important;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.newchat-ux-rc4.radio-player-pinned #radioCard.ux-radio-strip .radio-control-btn:not(.radio-play-btn) {
  display: grid !important;
  place-items: center !important;
}

/* Help keeps only its dedicated guidance; generic inline welcome is not rendered by app.js. */
body.newchat-ux-rc4 #messages .welcome-message-inline {
  transition: opacity .16s ease;
}

/* Local build marker. */


@media (max-width: 900px) {
  /* The count is represented by the mobile layout and must not crowd the room title. */
  body.newchat-ux-rc4 .center-chat-card .compact-online-box {
    display: none !important;
  }

  html body.newchat-ux-rc4.chat-active .center-chat-card > #radioCard.ux-radio-strip {
    position: fixed !important;
    top: calc(var(--nc-mobile-bar-h, 66px) + env(safe-area-inset-top) + 7px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    grid-template-columns: 36px minmax(0, 1fr) auto !important;
    padding: 6px 8px !important;
    border-radius: 14px !important;
  }

  body.newchat-ux-rc4 #radioCard.ux-radio-strip::before {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  body.newchat-ux-rc4 #radioCard.ux-radio-strip > strong {
    font-size: 9px !important;
  }

  body.newchat-ux-rc4 #radioCard.ux-radio-strip #radioNowPlaying {
    font-size: 10px !important;
  }

  html body.newchat-ux-rc4.chat-active.radio-player-pinned .center-chat-card > #radioCard.ux-radio-strip {
    height: auto !important;
    min-height: 74px !important;
    max-height: 108px !important;
  }
}

@media (max-width: 540px) {
  html body.newchat-ux-rc4.chat-active .center-chat-card > #radioCard.ux-radio-strip {
    top: calc(var(--nc-mobile-bar-h, 66px) + env(safe-area-inset-top) + 5px) !important;
  }
}

/* =========================================================
   NewChat v1.17.3 RC11 — Header, Topic & Bot Repair
   ========================================================= */

html body.newchat-ux-rc4 #profileMini.left-profile-card {
  display: none !important;
}

html body.newchat-ux-rc4 #messages .welcome-message-inline {
  display: none !important;
}

html body.newchat-ux-rc4 .center-chat-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* One topic bar. Reset the old absolute shield positioning completely. */
html body.newchat-ux-rc4 .center-chat-card > #welcomeRules.welcome-rules {
  position: relative !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 52px !important;
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  column-gap: 9px !important;
  row-gap: 2px !important;
  margin: 8px 14px 0 !important;
  padding: 9px 13px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  border-radius: 11px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
}

html body.newchat-ux-rc4 .center-chat-card > #welcomeRules.hidden {
  display: none !important;
}

html body.newchat-ux-rc4 #welcomeRules::before {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  align-self: center !important;
  justify-self: center !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 17px !important;
  line-height: 1 !important;
  transform: none !important;
  filter: none !important;
}

html body.newchat-ux-rc4 #welcomeRules #channelTopicTitle {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--ux-text) !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body.newchat-ux-rc4 #welcomeRules #channelTopicText {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--ux-text) !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Bot cards fit their text and never show member moderation controls. */
html body.newchat-ux-rc4 #messages .message.bot {
  width: fit-content !important;
  max-width: min(82%, 780px) !important;
  min-width: min(320px, 82%) !important;
  margin-right: auto !important;
}

html body.newchat-ux-rc4 #messages .message.bot .message-bubble {
  width: auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 12px !important;
}

html body.newchat-ux-rc4 #messages .message.bot .moderation-tools,
html body.newchat-ux-rc4 #messages .message.bot .report-tools {
  display: none !important;
}

/* Desktop header: title, search and action group are three real grid columns.
   No absolute positioning, so Mute and Online cannot overlap. */
@media (min-width: 901px) {
  html body.newchat-ux-rc4 {
    --ux-header-h: 64px;
  }

  html body.newchat-ux-rc4 .center-chat-card > .chat-head {
    position: relative !important;
    flex: 0 0 var(--ux-header-h) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: var(--ux-header-h) !important;
    display: grid !important;
    grid-template-columns: minmax(180px, 270px) minmax(190px, 1fr) max-content !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 7px 14px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  html body.newchat-ux-rc4 .center-chat-card > .chat-head > * {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html body.newchat-ux-rc4 .center-chat-card .channel-title-wrap {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body.newchat-ux-rc4 #activeChannelTitle {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
    font-size: clamp(15px, 1.05vw, 18px) !important;
    line-height: 1.12 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.newchat-ux-rc4 #activeChannelHelp {
    display: block !important;
    width: 100% !important;
    margin-top: 2px !important;
    overflow: hidden !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.newchat-ux-rc4 .ux-message-search {
    width: min(100%, 480px) !important;
    max-width: 480px !important;
    min-width: 0 !important;
    height: 34px !important;
    justify-self: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }

  html body.newchat-ux-rc4 .center-chat-card .chat-head-actions {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
  }

  html body.newchat-ux-rc4 .center-chat-card #channelMuteBtn {
    width: auto !important;
    min-width: 118px !important;
    max-width: none !important;
    min-height: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    overflow: visible !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
  }

  html body.newchat-ux-rc4 .center-chat-card .compact-online-box {
    width: auto !important;
    min-width: 88px !important;
    max-width: none !important;
    min-height: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 11px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html body.newchat-ux-rc4 .center-chat-card .compact-online-box .dot {
    width: 8px !important;
    min-width: 8px !important;
    height: 8px !important;
    flex: 0 0 8px !important;
  }

  html body.newchat-ux-rc4 .center-chat-card > #messages.messages {
    padding-top: 9px !important;
  }
}

@media (min-width: 1181px) and (max-width: 1360px) {
  html body.newchat-ux-rc4 .center-chat-card > .chat-head {
    grid-template-columns: minmax(165px, 225px) minmax(180px, 1fr) max-content !important;
    gap: 10px !important;
  }

  html body.newchat-ux-rc4 .ux-message-search {
    max-width: 360px !important;
  }
}

/* Hide search before it can crowd Mute + Online. */
@media (min-width: 901px) and (max-width: 1180px) {
  html body.newchat-ux-rc4 .center-chat-card > .chat-head {
    grid-template-columns: minmax(0, 1fr) max-content !important;
    gap: 10px !important;
    padding-inline: 14px !important;
  }

  html body.newchat-ux-rc4 .ux-message-search {
    display: none !important;
  }
}

@media (max-width: 900px) {
  html body.newchat-ux-rc4 .center-chat-card > #welcomeRules.welcome-rules {
    min-height: 54px !important;
    margin: 7px 9px 0 !important;
    padding: 8px 10px !important;
  }

  html body.newchat-ux-rc4 #welcomeRules #channelTopicTitle,
  html body.newchat-ux-rc4 #welcomeRules #channelTopicText {
    white-space: normal !important;
    text-overflow: clip !important;
  }

  html body.newchat-ux-rc4 #messages .message.bot {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}


/* NEWCHAT_MOBILE_GUEST_HF3_START */

.mobile-completion-nav,
.mobile-drawer-shortcuts {
  display: none;
}

.guest-inline-registration {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--ux-accent-2) 40%, var(--ux-border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--ux-accent-2) 7%, var(--ux-panel));
}

.guest-inline-registration-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.guest-inline-registration-head strong {
  color: var(--ux-text);
  font-size: 15px;
}

.guest-inline-registration-head span,
.guest-inline-registration-note {
  color: var(--ux-muted);
  font-size: 12px;
  line-height: 1.45;
}

#guestInlineRegisterForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#guestInlineRegisterForm label {
  display: grid;
  gap: 5px;
  color: var(--ux-muted);
  font-size: 11px;
}

#guestInlineRegisterForm input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--ux-border);
  border-radius: 12px;
  background: var(--ux-input);
  color: var(--ux-text);
  box-sizing: border-box;
}

#guestInlineRegisterSubmit {
  grid-column: 1 / -1;
  min-height: 45px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ux-accent-2), var(--ux-accent));
  color: var(--ux-button-text);
}

#guestInlineRegisterSubmit:disabled {
  opacity: .65;
}

.guest-inline-registration-note {
  margin: 10px 0 0;
}

#guestInlineRegisterAlert {
  margin-top: 10px;
}

#guestInlineRegisterAlert a {
  color: inherit;
  font-weight: 800;
}

.logout-menu-btn svg,
.mobile-drawer-shortcuts svg,
.mobile-completion-nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-menu-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

@media (max-width: 900px) {
  html body.newchat-ux-rc4.chat-active {
    --nc-mobile-bottom-nav-h: 66px;
  }

  html body.newchat-ux-rc4.chat-active .mobile-completion-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    height: calc(var(--nc-mobile-bottom-nav-h) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ux-border);
    background: color-mix(in srgb, var(--ux-panel) 96%, transparent);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
  }

  html body.newchat-ux-rc4.chat-active .mobile-completion-nav > button {
    min-width: 0;
    min-height: 54px;
    display: grid;
    grid-template-rows: 25px auto;
    place-items: center;
    gap: 2px;
    padding: 5px 2px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--ux-muted);
    box-shadow: none;
  }

  html body.newchat-ux-rc4.chat-active .mobile-completion-nav > button span {
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.newchat-ux-rc4.chat-active .mobile-completion-nav > button.is-active {
    background: color-mix(in srgb, var(--ux-accent-2) 14%, transparent);
    color: var(--ux-accent-2);
  }

  html body.newchat-ux-rc4.chat-active:not(.mobile-keyboard-open)
  .center-chat-card > #messageForm.compact-message-composer {
    margin-bottom: calc(var(--nc-mobile-bottom-nav-h) + env(safe-area-inset-bottom)) !important;
  }

  html body.newchat-ux-rc4.chat-active.mobile-keyboard-open .mobile-completion-nav {
    display: none !important;
  }

  html body.newchat-ux-rc4.chat-active.mobile-keyboard-open
  .center-chat-card > #messageForm.compact-message-composer {
    margin-bottom: 0 !important;
  }

  html body.newchat-ux-rc4.chat-active .premium-dashboard .left-menu,
  html body.newchat-ux-rc4.chat-active .premium-dashboard .right-users-panel {
    width: min(88vw, 380px) !important;
    padding: 10px 12px calc(18px + var(--nc-mobile-bottom-nav-h) + env(safe-area-inset-bottom)) !important;
  }

  html body.newchat-ux-rc4 .mobile-panel-close {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin-bottom: 8px !important;
    font-size: 25px !important;
  }

  html body.newchat-ux-rc4 .mobile-drawer-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
  }

  html body.newchat-ux-rc4 .mobile-drawer-shortcuts > button {
    min-width: 0;
    min-height: 58px;
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 7px 4px;
    border: 1px solid var(--ux-border);
    border-radius: 13px;
    background: var(--ux-panel-2);
    color: var(--ux-text);
    box-shadow: none;
  }

  html body.newchat-ux-rc4 .mobile-drawer-shortcuts span {
    font-size: 10px;
    font-weight: 700;
  }

  html body.newchat-ux-rc4 .left-menu .main-nav-card {
    padding: 11px !important;
  }

  html body.newchat-ux-rc4 .left-menu .channel-btn,
  html body.newchat-ux-rc4 .left-menu .static-menu-btn,
  html body.newchat-ux-rc4 .left-menu .rules-menu-link,
  html body.newchat-ux-rc4 .left-menu .logout-menu-btn {
    min-height: 50px !important;
    padding: 10px 13px !important;
    border-radius: 13px !important;
    font-size: 14px !important;
  }

  html body.newchat-ux-rc4 .left-menu .ux-left-private-card {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 12px !important;
  }

  html body.newchat-ux-rc4 .left-menu .private-list {
    min-height: 0 !important;
    max-height: 230px !important;
    overflow-y: auto !important;
  }

  html body.newchat-ux-rc4 .profile-modal-box {
    width: min(96vw, 620px) !important;
    max-height: calc(100dvh - 18px) !important;
    padding: 18px 15px calc(18px + env(safe-area-inset-bottom)) !important;
    border-radius: 18px !important;
  }

  html body.newchat-ux-rc4 .profile-presence-section {
    margin-block: 10px !important;
    padding: 12px !important;
  }

  html body.newchat-ux-rc4 .guest-profile-notice {
    padding: 11px 12px !important;
    font-size: 12px !important;
  }

  html body.newchat-ux-rc4 .guest-inline-registration {
    margin-top: 10px;
    padding: 12px;
  }

  html body.newchat-ux-rc4 #guestInlineRegisterForm {
    grid-template-columns: 1fr;
  }

  html body.newchat-ux-rc4 #guestInlineRegisterSubmit {
    grid-column: 1;
  }
}

@media (max-width: 420px) {
  html body.newchat-ux-rc4.chat-active .mobile-completion-nav > button span {
    font-size: 8px;
  }

  html body.newchat-ux-rc4.chat-active .mobile-completion-nav svg {
    width: 20px;
    height: 20px;
  }
}

/* NEWCHAT_MOBILE_GUEST_HF3_END */

