/* R502: unified chat-header controls and collision-safe server banners. */

.chat-head .ob-top-actions {
  min-width: 0;
  max-width: min(72%, 760px);
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  border: 1px solid color-mix(in srgb, var(--line, #ffffff20) 78%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-2, #2b2d31) 82%, transparent);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}

.chat-head .ob-top-actions::-webkit-scrollbar { display: none; }

.chat-head .ob-top-actions > button {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  flex: 0 0 34px !important;
  display: inline-grid !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--muted, #b5bac1) !important;
  font: inherit !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, transform .1s ease !important;
}

.chat-head .ob-top-actions > button:hover {
  background: color-mix(in srgb, var(--text, #f2f3f5) 10%, transparent) !important;
  color: var(--text, #f2f3f5) !important;
  transform: none !important;
}

.chat-head .ob-top-actions > button:active {
  transform: scale(.94) !important;
}

.chat-head .ob-top-actions > button:focus-visible {
  outline: 2px solid var(--brand, #5865f2) !important;
  outline-offset: 2px !important;
}

.chat-head .ob-top-actions > button.hidden,
.chat-head .ob-top-actions > button[hidden] { display: none !important; }

.chat-head .ob-top-actions :is(.lucide-ui-icon, svg) {
  width: 18px !important;
  height: 18px !important;
}

.chat-head .ob-top-actions .icon-btn-label > span,
.chat-head .ob-top-actions #obBoostServerButton > span:last-child { display: none !important; }

.chat-head .ob-top-actions .r432-switcher-trigger kbd { display: none !important; }

.chat-head .ob-top-actions .ob-saved-head-button {
  font-size: 0 !important;
}

.chat-head .ob-top-actions .ob-saved-head-button::before {
  content: "✎";
  font-size: 16px;
}

.chat-head .ob-top-actions .ob-saved-head-button[style*="display: none"] {
  display: none !important;
}

.chat-head .ob-top-actions #orbyteActivityOpen svg {
  width: 18px !important;
  height: 18px !important;
}

.chat-head .ob-top-actions #obBoostServerButton {
  color: #ff91d4 !important;
  background: color-mix(in srgb, #ff73c6 12%, transparent) !important;
}

.chat-head .ob-top-actions #obBoostServerButton > span:first-child { margin: 0 !important; }

.chat-head .ob-top-actions #serverSearchBtn:not(.hidden)::before { display: none !important; }

@media (min-width: 1280px) {
  .chat-head .ob-top-actions #serverSearchBtn:not(.hidden) {
    width: 154px !important;
    min-width: 154px !important;
    flex-basis: 154px !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding: 0 10px !important;
    background: color-mix(in srgb, var(--bg-0, #1e1f22) 78%, transparent) !important;
  }
  .chat-head .ob-top-actions #serverSearchBtn:not(.hidden)::before {
    content: "Search" !important;
    display: block !important;
    margin-right: auto !important;
    color: var(--faint, #949ba4) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
  }
  .chat-head .ob-top-actions #obBoostServerButton:not([hidden]) {
    width: auto !important;
    min-width: 104px !important;
    flex-basis: auto !important;
    display: inline-flex !important;
    gap: 6px !important;
    padding: 0 10px !important;
  }
  .chat-head .ob-top-actions #obBoostServerButton > span:last-child { display: inline !important; }
}

/* The banner is 132px tall plus its top margin. Reserve that space in the
   sidebar grid so Minecraft and the first channel cannot render underneath. */
html[data-orbyte-client="desktop"] #app .channel-panel:has(> #serverName.server-head.has-server-banner) {
  grid-template-rows: 148px minmax(0, 1fr) 60px !important;
}

html[data-orbyte-client="mobile"] #app .channel-panel:has(> #serverName.server-head.has-server-banner) {
  grid-template-rows: minmax(140px, auto) minmax(0, 1fr) auto !important;
}

#app .channel-panel > #serverName.server-head.has-server-banner {
  position: relative !important;
  z-index: 2 !important;
  overflow: hidden !important;
}

#app .channel-panel > .channel-scroll {
  position: relative !important;
  z-index: 1 !important;
}

#app .channel-panel .orbyte-minecraft-tab {
  position: relative !important;
  z-index: 0 !important;
  margin-top: 2px !important;
}

#callEndBtn[data-ob-leaving="1"] {
  opacity: .72 !important;
  transform: scale(.92) !important;
  pointer-events: none !important;
}

@media (max-width: 760px) {
  .chat-head .ob-top-actions {
    max-width: calc(100% - 112px);
    padding: 2px;
    border-color: transparent;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .chat-head .ob-top-actions > button {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    flex-basis: 38px !important;
    border-radius: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-head .ob-top-actions > button { transition: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .chat-head .ob-top-actions {
    background: var(--bg-2, #2b2d31) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@media (prefers-contrast: more) {
  .chat-head .ob-top-actions { border-color: currentColor !important; }
}
