/* ==========================================================================
   Custom scrollbar — one shared look for every real scroll container, so a
   plain thick browser-grey bar never shows up anywhere in the panel.

   `.custom-scrollbar` is the reusable class (applied via HTML to
   .workspace-scroll and .sidebar-nav); everything else below already had its
   own scroll container selector, so it's grouped into the same rule instead
   of adding the class to a dozen more templates for an identical result. */
.custom-scrollbar,
.sidebar-nav,
.log-list,
.modal,
.drawer,
.combo-list,
.dialogue-list-scroll,
.dialogue-messages,
.test-chat-messages {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.custom-scrollbar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.log-list::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.drawer::-webkit-scrollbar,
.combo-list::-webkit-scrollbar,
.dialogue-list-scroll::-webkit-scrollbar,
.dialogue-messages::-webkit-scrollbar,
.test-chat-messages::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
.custom-scrollbar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.log-list::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track,
.drawer::-webkit-scrollbar-track,
.combo-list::-webkit-scrollbar-track,
.dialogue-list-scroll::-webkit-scrollbar-track,
.dialogue-messages::-webkit-scrollbar-track,
.test-chat-messages::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.custom-scrollbar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.log-list::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
.drawer::-webkit-scrollbar-thumb,
.combo-list::-webkit-scrollbar-thumb,
.dialogue-list-scroll::-webkit-scrollbar-thumb,
.dialogue-messages::-webkit-scrollbar-thumb,
.test-chat-messages::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: var(--scrollbar-thumb-border) solid transparent;
  border-radius: var(--radius-full);
  background: var(--scrollbar-thumb) padding-box;
  transition: background-color 160ms ease, border-width 160ms ease;
}
.custom-scrollbar:hover::-webkit-scrollbar-thumb,
.custom-scrollbar.is-scrolling::-webkit-scrollbar-thumb,
.sidebar-nav:hover::-webkit-scrollbar-thumb,
.sidebar-nav.is-scrolling::-webkit-scrollbar-thumb,
.log-list:hover::-webkit-scrollbar-thumb,
.log-list.is-scrolling::-webkit-scrollbar-thumb,
.modal:hover::-webkit-scrollbar-thumb,
.modal.is-scrolling::-webkit-scrollbar-thumb,
.drawer:hover::-webkit-scrollbar-thumb,
.drawer.is-scrolling::-webkit-scrollbar-thumb,
.combo-list:hover::-webkit-scrollbar-thumb,
.dialogue-list-scroll:hover::-webkit-scrollbar-thumb,
.dialogue-messages:hover::-webkit-scrollbar-thumb,
.test-chat-messages:hover::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-hover) padding-box;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.log-list::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover,
.drawer::-webkit-scrollbar-thumb:hover,
.combo-list::-webkit-scrollbar-thumb:hover,
.dialogue-list-scroll::-webkit-scrollbar-thumb:hover,
.dialogue-messages::-webkit-scrollbar-thumb:hover,
.test-chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover) padding-box;
}
.custom-scrollbar::-webkit-scrollbar-thumb:active,
.sidebar-nav::-webkit-scrollbar-thumb:active,
.log-list::-webkit-scrollbar-thumb:active,
.modal::-webkit-scrollbar-thumb:active,
.drawer::-webkit-scrollbar-thumb:active,
.combo-list::-webkit-scrollbar-thumb:active,
.dialogue-list-scroll::-webkit-scrollbar-thumb:active,
.dialogue-messages::-webkit-scrollbar-thumb:active,
.test-chat-messages::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active) padding-box;
}
.custom-scrollbar::-webkit-scrollbar-corner,
.sidebar-nav::-webkit-scrollbar-corner,
.log-list::-webkit-scrollbar-corner,
.modal::-webkit-scrollbar-corner,
.drawer::-webkit-scrollbar-corner,
.combo-list::-webkit-scrollbar-corner,
.dialogue-list-scroll::-webkit-scrollbar-corner,
.dialogue-messages::-webkit-scrollbar-corner,
.test-chat-messages::-webkit-scrollbar-corner {
  background: transparent;
}

/* Sidebar nav and dropdowns read a bit visually "smaller" than the big
   workspace scrollbar, so their thumb/track track that scale down too. */
.sidebar-nav { --scrollbar-size: 7px; --scrollbar-thumb-border: 2px; }
.modal, .combo-list, .dialogue-list-scroll { --scrollbar-size: 8px; }

@media (forced-colors: active) {
  .custom-scrollbar, .sidebar-nav, .log-list, .modal, .drawer,
  .combo-list, .dialogue-list-scroll, .dialogue-messages, .test-chat-messages {
    scrollbar-color: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .custom-scrollbar::-webkit-scrollbar-thumb,
  .sidebar-nav::-webkit-scrollbar-thumb,
  .log-list::-webkit-scrollbar-thumb,
  .modal::-webkit-scrollbar-thumb,
  .drawer::-webkit-scrollbar-thumb,
  .combo-list::-webkit-scrollbar-thumb,
  .dialogue-list-scroll::-webkit-scrollbar-thumb,
  .dialogue-messages::-webkit-scrollbar-thumb,
  .test-chat-messages::-webkit-scrollbar-thumb {
    transition: none;
  }
}
/* Touch devices already draw their own thin overlay scrollbar — don't fight
   it with a custom-width one that can end up harder to grab with a finger. */
@media (pointer: coarse) {
  .custom-scrollbar, .sidebar-nav, .log-list, .modal, .drawer,
  .combo-list, .dialogue-list-scroll, .dialogue-messages, .test-chat-messages {
    scrollbar-width: auto;
  }
  .custom-scrollbar::-webkit-scrollbar,
  .sidebar-nav::-webkit-scrollbar,
  .log-list::-webkit-scrollbar,
  .modal::-webkit-scrollbar,
  .drawer::-webkit-scrollbar,
  .combo-list::-webkit-scrollbar,
  .dialogue-list-scroll::-webkit-scrollbar,
  .dialogue-messages::-webkit-scrollbar,
  .test-chat-messages::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

/* Space Grotesk carries every heading and headline figure — the one place the
   type system shows personality instead of just relaying text. */
h1, h2, h3,
.modal-title, .sidebar-brand, .empty-state-title, .stat-value {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1.15;
  transition: color var(--transition-base) var(--ease);
}

/* StatCard — deliberately plain (label / big number / muted sub-line), no icon
   chips: real usage numbers here rarely have a meaningful icon to attach, and a
   decorative chip on every card read as noise rather than hierarchy. A touch
   roomier than the default .card padding so a row of five doesn't feel cramped. */
.stat-card-plain { padding: 0.9rem 1rem; }
/* Narrower/tighter than the shared .stat-value default — matches the reference
   mockup's own .stat-card proportions for this specific 5-up row. */
.stats-grid-5 .stat-value { font-size: 1.35rem; }
.stat-round-icon {
  width: 1.625rem;
  height: 1.625rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}
.stat-round-icon .icon { width: 0.85rem; height: 0.85rem; }

/* Five-up stats row (mirrors the reference mockup's .stats-grid) — collapses
   the same way the old 4-up grid did, just with one more breakpoint tier since
   there's one more card to fit. */
.stats-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 1150px) { .stats-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

