/* Monitoring and chats share one scroll area between the fixed dividers.
   Shared theme owns identity, row selection and menus. */
.chat-home .sidebar-navigation {
  --sidebar-row-height: 42px;
  display: flex; flex: 1 1 0; flex-direction: column; min-height: 0;
  margin-inline: -18px; padding: 12px 18px 0;
  border-top: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
.chat-home .chat-sidebar > .sidebar-navigation { flex-shrink: 1; }
.sidebar-monitoring { flex: 0 0 auto; padding-bottom: 12px; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding-left: 10px; margin-bottom: 4px; }
.sidebar-section-heading h2 { margin: 0; font-size: 12px; font-weight: 500; line-height: 1.5; }
.sidebar-section-heading h2 a { text-decoration: none; color: var(--muted); }
.sidebar-section-heading h2 a:hover { color: var(--green); }
.sidebar-section-add { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 21px; font-weight: 400; }
.sidebar-section-add:hover { color: var(--green); background: var(--ui-hover); }
.monitoring-topic-list { display: grid; gap: 4px; }
.monitoring-topic-empty { padding: 7px 10px; margin: 0; color: var(--muted); font-size: 12px; }
.monitoring-topic-empty a { color: var(--green); text-decoration: none; }
.chat-home .sidebar-navigation .chat-history-row { min-height: var(--sidebar-row-height); }
.chat-home .sidebar-navigation .chat-history-item { min-height: calc(var(--sidebar-row-height) - 2px); padding: 8px 0 8px 10px; text-decoration: none; }
.chat-home .sidebar-navigation .chat-history-item strong { line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-home .sidebar-navigation .chat-history-more { opacity: 1; }
.monitoring-topic-row .chat-history-item { min-width: 0; }
.monitoring-topic-row.is-paused .chat-history-item strong { color: var(--muted); }
.monitoring-extra { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 200ms cubic-bezier(.2,.8,.2,1), opacity 150ms ease; }
.monitoring-extra.is-expanded { grid-template-rows: 1fr; opacity: 1; }
.monitoring-extra-inner { min-height: 0; overflow: hidden; }
.monitoring-extra .monitoring-topic-list { padding-top: 4px; }
.monitoring-list-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 10px 0; }
.monitoring-list-controls button, .monitoring-list-controls a { border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 400; text-decoration: none; }
.monitoring-list-controls button:hover, .monitoring-list-controls a:hover { color: var(--green); }
.monitoring-list-controls button span { display: inline-block; margin-left: 4px; transition: transform 150ms ease; }
.monitoring-list-controls button[aria-expanded="true"] span { transform: rotate(180deg); }
.chat-home .sidebar-navigation .chat-history { display: block; flex: 0 0 auto; min-height: 0; overflow: visible; }
.chat-home .sidebar-navigation .chat-history h2::after { content: none; }
.chat-home .sidebar-navigation .chat-history-list { min-height: 0; overflow: visible; }
.monitoring-topic-actions a { display: block; min-height: 40px; padding: 8px 10px; border-radius: 3px; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 400; }
.monitoring-topic-actions a:hover { background: var(--ui-hover); }
@media(max-width:768px), (hover:none), (pointer:coarse) {
  .chat-home .sidebar-navigation { --sidebar-row-height: 46px; }
  .sidebar-section-heading { min-height: 44px; }
  .sidebar-section-add { width: 44px; height: 44px; }
}
@media(prefers-reduced-motion:reduce) {
  .monitoring-extra, .monitoring-list-controls button span { transition: none; }
}
