/* Header readability and compact geometry; desktop layout keeps its owner. */
html body:not(.soc-auth-shell-active) #topbarNotificationsDrawer .notification-empty-state > p,
html body:not(.soc-auth-shell-active) #topbarNotificationsDrawer .topbar-notification-unread-toggle,
html body:not(.soc-auth-shell-active) #topbarGlobalSearchPanel :is(.topbar-global-search-result-copy span, .topbar-global-search-result-meta, .topbar-global-search-empty) {
  color: var(--soc-text-sub) !important;
}

html body:not(.soc-auth-shell-active) #topbarGlobalSearchPanel .topbar-global-search-result-section {
  background: var(--soc-surface-2) !important;
  color: var(--soc-text) !important;
}

html body:not(.soc-auth-shell-active) #topbarGlobalSearchPanel .topbar-global-search-result:is(:hover, :focus-visible) {
  background: var(--soc-surface-2) !important;
}

html body:not(.soc-auth-shell-active) #topbarGlobalSearchPanel .topbar-global-search-result:is(:hover, :focus-visible) :is(.topbar-global-search-result-copy span, .topbar-global-search-result-meta) {
  color: var(--soc-text) !important;
}

html body:not(.soc-auth-shell-active) .soc-app-shell > header.topbar .topbar-global-search-input::placeholder {
  color: var(--soc-text-sub) !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

html body:not(.soc-auth-shell-active) .soc-app-shell > header.topbar :is(button, input):focus-visible {
  outline: 2px solid var(--ui-focus-color, #111827) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

html body:not(.soc-auth-shell-active) .soc-app-shell > header.topbar #topbarThemeToggleBtn .topbar-theme-track {
  background: var(--soc-primary-deep) !important;
}

/* Shared P2 shell geometry. DOM order remains the keyboard order. */
html body:not(.soc-auth-shell-active) #appShellTopbar.topbar {
  --shell-tool-size: 40px;
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; gap: 16px !important;
  width: 100% !important; min-width: 0 !important; height: 64px !important;
  min-height: 64px !important; max-height: 64px !important; padding: 0 24px !important;
  box-sizing: border-box !important; background: var(--soc-surface) !important;
}
html body #appShellTopbar > .topbar-left {
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; flex: 1 1 0 !important; width: auto !important;
  min-width: 0 !important; max-width: none !important; gap: 16px !important;
}
/* R9 A8-3: .topbar-left clips (overflow hidden) exactly at the logo's left edge, which cut the brand button's ring; the
   logo artwork fills that button, so an inset ring would cover it. 4px of room inside the clip, given back by the
   margin, keeps every item where it was. */
html body.soc-desktop-shell:not(.soc-auth-shell-active) #appShellTopbar > .topbar-left { padding-left: 4px !important; margin-left: -4px !important; }
html body #appShellTopbar > .topbar-right {
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: flex-end !important;
  flex: 0 1 auto !important; gap: 8px !important; width: auto !important;
  min-width: 0 !important; max-width: none !important; height: auto !important; padding: 0 !important;
}
html body #appShellTopbar .topbar-right > :is(#topbarNotificationsBtn, #topbarThemeToggleBtn, #topbarGlobalSearchBtn, #topbarMyProfileBtn) { order: 0 !important; margin: 0 !important; }
html body #appShellTopbar :is(#topbarNotificationsBtn, #topbarThemeToggleBtn, #topbarMyProfileBtn) {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  flex: 0 0 auto !important; width: var(--shell-tool-size) !important; min-width: var(--shell-tool-size) !important;
  height: var(--shell-tool-size) !important; min-height: var(--shell-tool-size) !important;
  padding: 0 !important; border: 0 !important; border-radius: 8px !important;
  color: var(--soc-text) !important; background: transparent !important;
}
html body #appShellTopbar #topbarMyProfileBtn { width: auto !important; max-width: 160px !important; }
html body #appShellTopbar .topbar-admin-profile-copy { display: grid !important; min-width: 0 !important; white-space: normal !important; overflow-wrap: anywhere; text-align: left; gap: 2px !important; }
html body #appShellTopbar #topbarProfileName { color: var(--soc-text) !important; font-size: 13px !important; }
html body #appShellTopbar #topbarProfileRole { color: var(--soc-text-sub) !important; font-size: 12px !important; }
html body #appShellTopbar .topbar-profile-label { display: none; }
html body #appShellTopbar #topbarGlobalSearchBtn {
  display: flex !important; position: relative !important; flex: 0 1 280px !important;
  width: clamp(160px, 20vw, 280px) !important; min-width: 0 !important;
  height: var(--shell-tool-size) !important; padding: 0 12px !important;
  box-sizing: border-box !important;
}
html body #appShellTopbar #topbarThemeToggleBtn { width: 64px !important; min-width: 64px !important; max-width: 64px !important; }
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-track { width: 64px !important; height: 32px !important; padding: 0 !important; border-width: 1px !important; box-sizing: border-box !important; }
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-icon { width: 18px !important; height: 18px !important; color: #ffffff !important; opacity: 1 !important; }
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-icon svg { width: 18px !important; height: 18px !important; }
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-thumb { width: 26px !important; height: 26px !important; top: 50% !important; left: 3px !important; transform: translateY(-50%) !important; background: #ffffff !important; border: 0 !important; z-index: 2 !important; }
html body #appShellTopbar #topbarThemeToggleBtn[data-theme="dark"] .topbar-theme-thumb { transform: translate(30px, -50%) !important; }
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-icon-sun { left: 8px !important; }
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-icon-moon { right: 8px !important; }
html body #appShellTopbar #topbarThemeToggleBtn[data-theme="light"] .topbar-theme-icon-sun,
html body #appShellTopbar #topbarThemeToggleBtn[data-theme="dark"] .topbar-theme-icon-moon { opacity: 0 !important; }
html body #appShellTopbar #topbarDateStatus { display: none !important; }
html body #appShellTopbar #topbarCurrentTitle { min-width: 0 !important; white-space: normal !important; overflow-wrap: anywhere; font-size: 20px !important; line-height: 1.3 !important; }
html body #appShellTopbar :is(#topbarNotificationsBtn, #topbarThemeToggleBtn, #topbarMyProfileBtn).hidden,
html body #appShellTopbar .hidden { display: none !important; }
html body #appShellTopbar#appShellTopbar .topbar-brand-heading { flex: 0 0 160px !important; width: 160px !important; min-width: 0 !important; max-width: 160px !important; height: 44px !important; min-height: 44px !important; max-height: 44px !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
html body #appShellTopbar#appShellTopbar .topbar-brand-link { width: 100% !important; min-width: 0 !important; max-width: 100% !important; height: 44px !important; padding: 0 !important; }
html body #appShellTopbar#appShellTopbar .topbar-brand-wordmark { width: 100% !important; min-width: 0 !important; max-width: 100% !important; height: auto !important; max-height: 28px !important; object-fit: contain !important; }
html body:not(.soc-auth-shell-active) #menuSheetPanel #mobileMenuRootPage > .mobile-nav-actions { display: flex !important; gap: 8px !important; padding: 16px !important; margin-top: auto !important; }
html body:not(.soc-auth-shell-active) #menuSheetPanel #mobileMenuRootPage > .mobile-nav-actions > :is(#mobileMyProfileBtn, #mobileLogoutBtn) { flex: 1 1 0; min-height: 44px !important; }
html body:not(.soc-auth-shell-active) #menuSheetPanel #mobileMenuRootPage > .mobile-nav-actions > :is(#mobileMyProfileBtn, #mobileLogoutBtn):focus-visible {
  outline: 2px solid var(--ui-focus-color, #111827) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}
html body:not(.soc-auth-shell-active) .mobile-nav-actions-divider { display: none !important; }
@media (max-width: 1023px) {
  html body:has(#appShellTopbar):not(.nav-open) #menuSheetPanel { display: none !important; }
  html body:not(.soc-auth-shell-active) #appShellTopbar.topbar { gap: 8px !important; padding: 8px 16px !important; }
  html body #appShellTopbar > .topbar-left { gap: 8px !important; }
  html body #appShellTopbar #menuToggleBtn { width: 44px !important; min-width: 44px !important; min-height: 44px !important; }
  html body #appShellTopbar#appShellTopbar .topbar-brand-heading { flex-basis: 136px !important; width: 136px !important; max-width: 136px !important; }
  html body #appShellTopbar .topbar-admin-profile-copy { display: none !important; }
  html body #appShellTopbar .topbar-profile-label { display: inline; font-size: 12px; white-space: nowrap; }
  html body #appShellTopbar #topbarGlobalSearchBtn { width: 160px !important; }
}
@media (max-width: 767px) {
  html body:not(.soc-auth-shell-active) #appShellTopbar.topbar { --shell-tool-size: 44px; --soc-topbar-height: 112px !important; flex-wrap: wrap !important; height: auto !important; min-height: 112px !important; max-height: none !important; padding: 8px 10px !important; }
  html body #appShellTopbar > .topbar-left { flex-basis: 100% !important; height: 44px !important; }
  html body #appShellTopbar > .topbar-right { flex: 1 1 100% !important; width: 100% !important; min-height: 44px !important; }
  html body #appShellTopbar #topbarGlobalSearchBtn { flex: 1 1 0 !important; width: 0 !important; }
  html body #appShellTopbar #topbarMyProfileBtn { width: 44px !important; }
  html body #appShellTopbar #topbarCurrentTitle { font-size: 14px !important; }
  html body #appShellTopbar #topbarBreadcrumb { min-width: 0 !important; gap: 4px !important; flex-wrap: wrap; }
  html body #appShellTopbar #topbarGlobalSearchPanel { top: 120px !important; max-height: calc(100dvh - 144px) !important; }
}

/* Mark 2026-10-09 decision 11: the light/dark toggle is vivid #ff6b00 in both themes (was a dull #e45800 / #d5610f). */
html body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-track,
html[data-theme="dark"] body #appShellTopbar #topbarThemeToggleBtn .topbar-theme-track {
  background: #ff6b00 !important;
  background-image: none !important;
  border-color: #ff6b00 !important;
}
