/* One compact mobile header for chat and the shared application shell. */
.hal-mobile-navigation { display: none; }

@media (max-width: 720px) {
  body > .shell > header,
  body > .deck-app > header {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    padding: 10px 12px !important;
  }

  body > .shell > header .brand,
  body > .deck-app > header .brand { flex: 1 1 auto; min-width: 0; }

  body > .shell > header .header-actions,
  body > .deck-app > header .header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    width: auto !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
  }

  body > .shell > header .user-menu,
  body > .deck-app > header .user-menu { flex: 0 0 auto; width: auto; margin: 0; }

  body > .shell > header .user-trigger.has-user-avatar,
  body > .deck-app > header .user-trigger.has-user-avatar {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 6px !important;
    justify-content: center;
  }

  body > .shell > header .user-trigger.has-user-avatar > :not(.user-avatar),
  body > .deck-app > header .user-trigger.has-user-avatar > :not(.user-avatar) { display: none !important; }

  body > .shell > header .notification-wrap { position: static; }
  body > .shell > header .notification-trigger { width: 44px; height: 44px; }
  body > .shell > header .notification-menu { right: 12px; width: min(380px, calc(100vw - 24px)); }

  .hal-mobile-navigation { display: block; position: static; order: -1; }
  .hal-mobile-nav-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .hal-mobile-nav-trigger:hover,
  .hal-mobile-nav-trigger[aria-expanded="true"] { background: var(--sidebar-nav-bg, var(--surface-2)); }
  .hal-mobile-nav-trigger:focus-visible { outline: 2px solid var(--link, currentColor); outline-offset: 2px; }

  #hal-mobile-nav-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    z-index: 70;
    display: grid;
    gap: 4px;
    width: min(240px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid var(--panel-border, var(--line));
    border-radius: 14px;
    background: var(--menu-bg, var(--bg-ink));
    box-shadow: var(--shadow);
  }
  #hal-mobile-nav-panel[hidden] { display: none; }
  body > .shell > header #hal-mobile-nav-panel > .ghost-button,
  body > .deck-app > header #hal-mobile-nav-panel > .ghost-button {
    display: flex;
    order: 0 !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
  }
  body > .shell > header #hal-mobile-nav-panel > .ghost-button:hover { background: var(--sidebar-nav-bg, var(--surface-2)); }
}

@media (max-width: 720px) {
  #hal-mobile-nav-panel {
    width: min(320px, calc(100vw - 24px));
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #hal-mobile-nav-panel .hal-sidebar-nav {
    display: flex !important;
    flex: none;
    overflow: visible;
  }
}
