/* Room remark: preserve both centered and QQ-like left layouts. */
.chat-page.chat-room .chat-head .chat-title {
  gap: 10px;
  max-width: min(340px, calc(100vw - 170px));
}
.chat-page.chat-room .chat-head .chat-title-role-avatar,
.chat-page.chat-room .chat-head .chat-title-role-avatar-image {
  width: 42px;
  height: 42px;
}
.chat-page.chat-room .chat-head .chat-title-online-dot {
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-width: 2px;
}
.chat-page.chat-room[data-chat-header-layout="left"] .chat-head {
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
}
.chat-page.chat-room[data-chat-header-layout="left"] .chat-head .chat-title {
  justify-self: start;
  justify-content: flex-start;
  max-width: 100%;
  margin-left: 4px;
}
.chat-page.chat-room[data-chat-header-layout="left"] .chat-head .chat-head-actions {
  grid-column: 3;
  justify-self: end;
}

/* Welcome controls float over the page, alongside the shared Whisper header. */
.chat-page:not(.chat-room) .chat-head {
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.chat-page:not(.chat-room) .chat-head .chat-title {
  display: none !important;
}
.chat-page:not(.chat-room) .chat-head .chat-head-actions {
  grid-column: 3;
  justify-self: end;
}
.chat-page:not(.chat-room) .chat-head .icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-card) 60%, transparent);
  color: var(--text) !important;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / .3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chat-page:not(.chat-room) .chat-head .icon-btn:hover {
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
}
.chat-page:not(.chat-room) .chat-head .icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.chat-page:not(.chat-room) .chat-head #openLeft svg,
.chat-page:not(.chat-room) .chat-head #openRight svg {
  width: 20px;
  height: 20px;
}
html[data-theme="liquid-glass"] .chat-page:not(.chat-room) .chat-head .icon-btn {
  border-color: var(--liquid-outline);
  background: color-mix(in srgb, var(--bg-card) var(--liquid-material-opacity, 40%), transparent);
  backdrop-filter: blur(var(--liquid-material-blur, 4px));
  -webkit-backdrop-filter: blur(var(--liquid-material-blur, 4px));
}

/* One continuous page backdrop above, behind and below the floating dock. */
.chat-page:not(.chat-room):not(.workspace-open) .chat-main {
  background: transparent !important;
  background-image: none !important;
}

/* Rounded conversation-mode control and quieter settings groups. */
.chat-page #rightDrawer .mode-segmented-v80 {
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  overflow: hidden;
}
.chat-page #rightDrawer .mode-segmented-v80 button {
  min-height: 30px;
  border-radius: 999px;
}
.chat-page #rightDrawer :is(
  .drawer-head,
  .right-menu-model,
  .right-menu-section,
  .right-menu-switches,
  .right-menu-switches .setting-row
) {
  border-top: 0;
  border-bottom: 0;
}

/* Secondary copy follows the drawer's light/dark and wallpaper ink. */
.chat-page :is(#leftDrawer, #rightDrawer) .sidebar-helper-note-v1,
.chat-page :is(#leftDrawer, #rightDrawer) .sidebar-helper-note-v1 :is(span, small, em, b, strong) {
  color: color-mix(in srgb, var(--chat-text, var(--text)) 62%, transparent) !important;
}

/* Match the native solid status pixel, fading into the live glass below. */
.chat-page .drawer {
  visibility: hidden;
  transition: transform .24s ease, visibility 0s linear .24s;
}
.chat-page .drawer.open {
  visibility: visible;
  transition-delay: 0s;
}
html[data-theme="liquid-glass"] .chat-page .drawer.open .drawer-head {
  background: linear-gradient(180deg,
    var(--chat-drawer-join-color, var(--bg-card)) 0 calc(var(--app-safe-top, 0px) + 8px),
    transparent 100%) !important;
  border-top: 0 !important;
  box-shadow: none !important;
}

/* Keep touch, wheel and keyboard scrolling without a visible drawer scrollbar. */
.chat-page .drawer .drawer-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-page .drawer .drawer-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
