/* One header; compact navigation is shared by touch browsers and native apps. */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 76px; min-height: 76px;
  padding: 12px 20px; gap: 24px; flex-wrap: nowrap; background: #fff;
}
.header-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px; color: var(--green); background: transparent; cursor: pointer; }
.header-icon:hover { background: var(--sage); }
.header-icon svg { width: 22px; height: 22px; }
.header-icon:focus-visible, .profile-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.workspace-search { display: flex; align-items: center; flex: 1; min-width: 0; max-width: 620px; margin: 0; border: 1px solid var(--line); background: #f5f7f2; border-radius: 14px; }
.workspace-search:focus-within { border-color: #718a75; }
.workspace-search input { min-width: 0; width: 100%; padding: 10px 4px 10px 14px; height: 44px; font-size: 16px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); }
.workspace-search input:focus { outline: none; box-shadow: none; }
.topbar .user-menu { margin-left: auto; width: auto; flex-wrap: nowrap; gap: 16px; min-width: 0; }
.profile-link { display: flex; align-items: center; gap: 10px; min-height: 44px; border-radius: 12px; }
.profile-link .avatar { width: 38px; height: 38px; }
.profile-link .user-name { font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-link .user-name small { font-size: 10px; }
.navigation-backdrop[hidden], .native-signout-note { display: none; }
.native-workspace .native-signout-note { display: block; }
.profile-signout { border-color: #e6d8ce; background: #fffdfb; }
.profile-signout p { max-width: 65ch; color: var(--muted); line-height: 1.65; }
.profile-signout form { margin-top: 20px; }
.signout-button { color: #8c3d29; background: #f8eee8; border: 1px solid #e3cfc3; }
.signout-button:hover { background: #f0e0d5; }
.search-empty, .search-results { padding: 24px; margin: 20px 0; }
.search-tools { margin-top: 28px; flex-wrap: wrap; }
.compact-navigation { --workspace-header-height: 68px; scroll-padding-top: 84px; }
.compact-navigation .app-shell { display: block; }
.compact-navigation .workspace { margin: 0; width: 100%; }
.compact-navigation .topbar { height: var(--workspace-header-height); min-height: var(--workspace-header-height); gap: 10px; padding: 10px 12px; flex-wrap: nowrap; }
.compact-navigation .topbar .user-menu { width: auto; flex-wrap: nowrap; gap: 0; }
.compact-navigation .topbar .workspace-print-button { display: none; }
.compact-navigation .sidebar { display: none; position: fixed; inset: var(--workspace-header-height) auto 0 0; width: min(340px, 88vw); padding: 14px; height: auto; overflow-y: auto; overscroll-behavior: contain; z-index: 29; box-shadow: 8px 0 32px #18342126; }
.compact-navigation .sidebar .brand, .compact-navigation .sidebar .farm-label, .compact-navigation .sidebar-bottom { display: none; }
.compact-navigation .sidebar nav { display: flex; flex-direction: column; overflow: visible; padding: 0; gap: 4px; }
.compact-navigation .sidebar .nav-item { white-space: normal; font-size: 14px; min-height: 48px; margin: 0; }
.compact-navigation .sidebar .nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.compact-navigation .nav-label { display: block !important; margin: 8px 12px; padding: 0; }
.compact-navigation .nav-label.second { margin-top: 22px; }
.compact-navigation.navigation-open .sidebar { display: block; }
.compact-navigation.navigation-open body { overflow: hidden; }
.navigation-backdrop { position: fixed; inset: var(--workspace-header-height) 0 0; z-index: 28; border: 0; border-radius: 0; padding: 0; background: #162d3159; }
.compact-navigation .main-content { scroll-margin-top: 84px; }
/* Keep the same header available inside the full-height assistant view. */
.compact-navigation body:has(.assistant-chat) .topbar { display: flex; flex: none; }
.compact-navigation body:has(.assistant-chat) .sidebar { position: fixed; width: min(340px, 88vw); padding: 14px; }
@media (max-width: 520px) {
  .compact-navigation .topbar { gap: 6px; padding-inline: 8px; }
  .compact-navigation .profile-link { gap: 6px; }
  .compact-navigation .profile-link .user-name { max-width: 80px; font-size: 11px; }
  .compact-navigation .profile-link .avatar { width: 32px; height: 32px; }
  .compact-navigation .workspace-search input { padding-left: 10px; }
}
@media (max-width: 380px) { .compact-navigation .profile-link .user-name { display: none; } }
@media print { .navigation-backdrop, .profile-signout { display: none !important; } }

/* Live search uses real links, including touch and keyboard navigation. */
.workspace-search { position: relative; }
.workspace-suggestions { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(480px, 60dvh); overflow-y: auto; overscroll-behavior: contain; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 36px #18342126; padding: 8px; }
.workspace-suggestions[hidden] { display: none; }
.suggestion-status { margin: 0; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.suggestion-results h2 { padding: 12px 12px 4px; margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.suggestion-results a { display: block; padding: 12px; min-height: 44px; border-radius: 10px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; text-decoration: none; }
.suggestion-results a:hover, .suggestion-results a:focus { background: var(--sage); outline: 2px solid var(--green); outline-offset: -2px; }
.suggestion-results .suggestion-all { margin-top: 8px; border-top: 1px solid var(--line); font-weight: 600; }
form[data-live-filters] .live-filter-status { flex-basis: 100%; grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
form[data-live-filters] .live-filter-status:empty { display: none; }
.compact-navigation .workspace-search { position: static; }
.compact-navigation .workspace-suggestions { left: 12px; right: 12px; top: calc(100% + 4px); }
.topbar { transition: transform .18s ease; }
.topbar.topbar-away { transform: translateY(-110%); }
.topbar:focus-within, .navigation-open .topbar { transform: none; }
@media (prefers-reduced-motion: reduce) { .topbar { transition: none; } }
.document-inspector { top: 88px; }
@media (max-width: 800px) { .document-inspector { position: relative; top: auto; } }
