/* Temporarily hide answer details and review tools; keep their DOM for restoration. */
#chat-panel #trust-panel {
  display: none;
}

#chat-panel > :is(.chat-panel-shell, .academic-chat-shell, .palace-chat-shell) {
  grid-template-columns: minmax(0, 1fr);
}

#chat-panel .chat-main {
  grid-column: 1;
}

#chat-panel {
  --trust-panel-width: 0px;
}

#chat-panel :is(.copy-message-button, #copy-answer) {
  min-width: 76px;
  transition: transform 140ms ease, background-color 180ms ease, color 180ms ease;
}

#chat-panel :is(.copy-message-button, #copy-answer):active {
  transform: scale(0.94);
}

#chat-panel [data-copy-state] {
  opacity: 1;
}

#chat-panel [data-copy-state="success"] {
  color: #176443;
  background: #e8f5ed;
  border-radius: 6px;
  animation: copy-confirm 280ms ease-out;
}

#chat-panel [data-copy-state="error"] {
  color: #a32727;
  background: #fff0ed;
  border-radius: 6px;
}

@keyframes copy-confirm {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #chat-panel :is(.copy-message-button, #copy-answer) {
    animation: none;
    transition: none;
    transform: none;
  }
}

/* Let conversation search use the full available sidebar width. */
#chat-sidebar #chat-search {
  flex: 1;
  min-width: 0;
  width: 100%;
}

#chat-sidebar label[for="chat-search"] svg {
  flex-shrink: 0;
}

/* One scroll surface lets the branding and tools yield space to conversations. */
#chat-sidebar {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
#chat-sidebar > .sidebar-top,
#chat-sidebar > .sidebar-section {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
#chat-sidebar .sidebar-section {
  display: flex;
  flex-direction: column;
}
#chat-sidebar #chat-session-list {
  flex: 0 0 auto;
  overflow: visible;
  min-height: auto;
}
