/* AGENT-GUARD: Header layout only. Keep action IDs, permissions, dialogs and session termination intact. */
.hub-header {
  position: relative;
  z-index: 12;
  display: grid !important;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) !important;
  grid-template-areas: "brand session" "brand actions" "status status" !important;
  align-items: center !important;
  gap: 3px 14px !important;
  padding: 4px 12px !important;
}
.hub-header > .header-brand-block {
  grid-area: brand !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  min-width: 0;
  width: auto !important;
}
.hub-header .header-brand-title { margin: 0; line-height: 1; }
.hub-header .header-brand-logo { width: min(160px, 100%) !important; height: auto !important; max-height: 28px !important; object-fit: contain; }
.hub-header-main, .hub-header-account { display: contents; }
.hub-header-session { grid-area: session; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.hub-header .language-picker { display: flex; flex: 0 0 auto; width: auto !important; gap: 8px; align-items: center; margin: 0; grid-area: auto; }
.hub-header .language-picker { font-size: 12px; }
.hub-header .language-picker select { width: 64px !important; min-width: 56px; min-height: 28px !important; height: 28px; padding: 1px 8px !important; font-size: 12px; line-height: normal !important; box-sizing: border-box; }
.hub-header #currentUserBadge { grid-area: auto; min-height: 26px; max-width: 100%; padding: 2px 10px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-header #mobileSidebarOpenButton { display: none; }
.hub-header-actions { grid-area: actions; display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); grid-auto-rows: 32px; gap: 6px; min-width: 0; }
.hub-header .hub-header-actions > button {
  grid-area: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: normal;
  text-align: center;
}
.hub-header-actions > #logoutAllButton { color: var(--hub-danger, #9f2942); background: var(--hub-panel-strong, #fff); border: 1px solid currentColor; box-shadow: none; }
.hub-header-status { grid-area: status; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.hub-header-versions { display: flex; flex-direction: row !important; flex: 0 1 auto; width: auto !important; flex-wrap: wrap; align-items: center; gap: 6px; }
.hub-header-versions > .meta { flex: 0 0 auto; width: auto !important; min-width: 0; min-height: 16px; padding: 1px 7px; font-size: 10px; line-height: 1.2; }
.hub-header #meta-summary { grid-area: auto; display: block !important; flex: 1 1 280px; width: auto !important; margin: 0; min-width: 0; max-width: 100%; white-space: normal; font-size: 10px; line-height: 1.3; text-align: end; }
@media (min-width: 1101px) { .hub-header { grid-column: 2; grid-row: 1; } }
body.app-host-shell .hub-header { position: sticky; top: max(6px, var(--mobile-safe-top, 0px)); z-index: 112; }
@media (max-width: 1100px) {
  .hub-header { grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) !important; grid-template-areas: "brand session" "actions actions" "status status" !important; gap: 6px 12px !important; }
  .hub-header #mobileSidebarOpenButton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .hub-header-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 44px; }
  .hub-header .hub-header-actions > button { min-height: 44px !important; }
  .hub-header .language-picker select { min-height: 44px !important; height: 44px; }
}
@media (max-width: 700px) {
  .hub-header { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "brand" "session" "actions" "status" !important; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px !important; gap: 6px !important; }
  .hub-header .header-brand-logo { width: 132px !important; max-height: 30px !important; }
  .hub-header > .header-brand-block { justify-content: space-between !important; }
  .hub-header-session { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .hub-header #impersonationRevertButton { grid-column: 1 / -1; min-height: 44px; width: 100%; white-space: normal; }
  .hub-header #currentUserBadge { flex: 1; min-width: 0; font-size: 12px; }
  .hub-header-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .hub-header .hub-header-actions > button { padding: 3px 5px !important; font-size: 12px !important; }
  .hub-header-status { gap: 6px; }
  .hub-header #meta-summary { text-align: start; }
}
@media (max-width: 350px) { .hub-header-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
