:root { --workspace-nav-height: 64px; --workspace-tools-height: 48px; }
.rb-workspace-nav {
  box-sizing: border-box; position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px; flex: 0 0 auto;
  width: 100%; min-height: 64px; padding: 8px 20px;
  background: var(--surface-raised, #12243b); color: var(--text-primary, #e2e8f0);
  border-bottom: 1px solid var(--border-color, #2a4a74);
  font: 500 13px/1.4 "DM Sans", "Segoe UI", Arial, sans-serif;
}
.rb-workspace-nav *, .rb-workspace-section * { box-sizing: border-box; }
.rb-workspace-nav .rb-workspace-brand { display: flex; flex: 0 0 auto; padding: 0; margin-right: auto; background: none; border: 0; }
.rb-workspace-nav .rb-workspace-brand img { display: block; width: 116px; height: 40px; object-fit: contain; }
.rb-workspace-destinations { display: flex; align-items: center; gap: 3px; }
.rb-workspace-nav .rb-workspace-link, .rb-workspace-nav .rb-workspace-toggle,
.rb-workspace-nav .rb-workspace-dropdown > a, .rb-workspace-nav .rb-workspace-dropdown form > button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 8px 10px; margin: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-primary, #e2e8f0) !important;
  font: inherit; text-decoration: none !important; white-space: nowrap; cursor: pointer;
  box-shadow: none; letter-spacing: normal; text-transform: none; width: auto;
}
.rb-workspace-nav a:hover, .rb-workspace-nav button:hover,
.rb-workspace-nav .is-active, .rb-workspace-nav [aria-current], .rb-workspace-section [aria-current] {
  background: var(--surface-hover, rgba(217,119,6,.16)); color: var(--link-color, #fbbf24) !important;
}
.rb-workspace-nav :focus-visible, .rb-workspace-section a:focus-visible { outline: 2px solid var(--link-color, #d97706); outline-offset: 2px; }
.rb-workspace-disclosure { position: relative; }
.rb-workspace-nav .rb-workspace-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 230px; padding: 8px;
  border: 1px solid var(--border-color, #2a4a74); border-radius: 10px;
  background: var(--surface-raised, #12243b); box-shadow: 0 12px 28px rgba(0,0,0,.22);
  max-height: calc(100dvh - 84px); overflow-y: auto;
}
.rb-workspace-nav [hidden] { display: none !important; }
.rb-workspace-nav .rb-workspace-dropdown > a, .rb-workspace-nav .rb-workspace-dropdown form > button { display: flex; width: 100%; }
.rb-workspace-nav .rb-workspace-dropdown form { margin: 0; padding: 0; }
.rb-workspace-nav .rb-workspace-identity { display: block; padding: 8px 10px; color: var(--text-muted, #94a3b8); overflow-wrap: anywhere; }
.rb-workspace-nav .rb-appearance { padding: 10px; margin: 6px 0; border-top: 1px solid var(--border-color, #2a4a74); border-bottom: 1px solid var(--border-color, #2a4a74); }
.rb-workspace-nav .rb-workspace-count { padding: 1px 5px; border-radius: 20px; background: #d97706; color: #120b04; font-size: 11px; }
.rb-workspace-nav .rb-workspace-toggle { display: none; }
.rb-workspace-section { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; background: var(--surface-raised, #12243b); border-bottom: 1px solid var(--border-color, #2a4a74); }
.rb-workspace-section a { padding: 6px 10px; border-radius: 6px; color: var(--text-primary, #e2e8f0); font: 500 13px/1.4 "DM Sans", sans-serif; text-decoration: none; }
.rb-custom-agent-add { display: inline-flex; padding: 9px 14px; border-radius: 8px; background: #d97706; color: #120b04 !important; text-decoration: none !important; font-weight: 700; white-space: nowrap; }
body.rb-has-workspace-nav.rb-site-editor #main { height: calc(100dvh - var(--workspace-nav-height) - var(--workspace-tools-height)); }
body.rb-has-workspace-nav .chat-shell { height: calc(100dvh - var(--workspace-nav-height)); }
body.rb-has-workspace-nav .wire-shell { --wire-nav-height: var(--workspace-nav-height); --wire-sticky-top: calc(var(--workspace-nav-height) + 14px); }
body.rb-has-workspace-nav #top-bar { flex-shrink: 0; }
@media (max-width: 1200px) {
  .rb-workspace-nav { padding: 8px 14px; }
  .rb-workspace-nav .rb-workspace-toggle { display: inline-flex; }
  .rb-workspace-destinations { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 12px; background: var(--surface-raised, #12243b); border-bottom: 1px solid var(--border-color, #2a4a74); max-height: calc(100dvh - 64px); overflow-y: auto; }
  .rb-workspace-nav.is-mobile-open .rb-workspace-destinations { display: flex; flex-direction: column; align-items: stretch; }
  .rb-workspace-nav .rb-workspace-link { width: 100%; min-height: 44px; }
  .rb-workspace-nav .rb-workspace-dropdown { position: static; max-height: none; margin: 4px 0 8px 12px; box-shadow: none; }
}
@media print { .rb-workspace-nav, .rb-workspace-section { display: none !important; } }

body.rb-has-workspace-nav.rb-agent-builder #main { height: calc(100dvh - var(--workspace-nav-height) - var(--workspace-tools-height) - 110px); }
@media (max-width: 820px) { body.rb-has-workspace-nav #dashboardSideNav { top: var(--workspace-nav-height); } }
@media (max-width: 960px) { body.rb-has-workspace-nav .sessions-panel { top: calc(var(--workspace-nav-height) + 56px); height: calc(100dvh - var(--workspace-nav-height) - 56px); } }
@media (max-width: 700px) {
 body.rb-has-workspace-nav.rb-site-editor #top-bar { height: auto; min-height: 48px; flex-wrap: wrap; padding: 8px 12px; }
 body.rb-has-workspace-nav.rb-site-editor .top-actions { flex-wrap: wrap; }
}

body.rb-has-workspace-nav { margin: 0; }
.rb-workspace-nav .rb-workspace-brand .rb-workspace-logo-dark { display: none; }
html[data-theme="dark"] .rb-workspace-nav .rb-workspace-brand .rb-workspace-logo-light { display: none; }
html[data-theme="dark"] .rb-workspace-nav .rb-workspace-brand .rb-workspace-logo-dark { display: block; }

body.rb-has-workspace-nav .chat-shell > header { z-index: 20; }
body.rb-has-workspace-nav.rb-document-library > header { top: var(--workspace-nav-height); }
body.rb-has-workspace-nav.rb-document-library .left-rail { top: calc(var(--workspace-nav-height) + 74px); max-height: calc(100dvh - var(--workspace-nav-height) - 86px); }

@media (max-width: 820px) {
 body.rb-has-workspace-nav #dashboardSideNav:not(.open) { visibility: hidden; }
}

/* Wire retains its contrasting, full-width section treatment in Quick Links. */
.toolbar-actions .rb-quick-disclosure {
 display: block; width: 100%; min-width: 0; box-sizing: border-box;
 border: 1px solid #D4CFC6; border-radius: 10px; overflow: hidden;
 background: #F0EDE6;
 box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 2px 0 rgba(30,58,95,.18);
}
.toolbar-actions .rb-quick-disclosure > summary {
 display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
 min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none;
 border: 0; border-radius: 0; background: linear-gradient(180deg,#FFFDF6,#F0EDE6); color: #1E3A5F;
 font: 800 13px/1.4 "DM Sans", "Segoe UI", Arial, sans-serif;
}
.rb-quick-disclosure > summary::-webkit-details-marker { display: none; }
.toolbar-actions .rb-quick-disclosure > summary:hover { background: #FFF7E8; color: #1E3A5F; }
.rb-quick-disclosure > summary:focus-visible { outline: 2px solid #D97706; outline-offset: -3px; }
.rb-quick-caret { margin-left: auto; }
.rb-quick-disclosure[open] .rb-quick-caret { transform: rotate(180deg); }
.rb-quick-count { background: #1E3A5F; color: white; padding: 1px 6px; border-radius: 20px; font-size: 11px; }
.rb-quick-dropdown { display: flex; flex-direction: column; border-top: 1px solid #D4CFC6; }
.toolbar-actions .rb-quick-dropdown a.secondary {
 display: flex; width: 100%; box-sizing: border-box; min-height: 40px; padding: 9px 14px;
 border: 0; border-radius: 0; background: transparent; color: #1E3A5F;
 box-shadow: none; transform: none; font-weight: 600;
}
.toolbar-actions .rb-quick-dropdown a.secondary + a.secondary { border-top: 1px solid rgba(212,207,198,.6); }
.toolbar-actions .rb-quick-dropdown a.secondary:hover { background: #FFF7E8; color: #1E3A5F; }
.toolbar-actions .rb-quick-dropdown a.secondary:focus-visible { outline: 2px solid #D97706; outline-offset: -3px; }
