/* hub.css — host geometry for the Hub tab (module interface v1.7).
 *
 * Stage 1 is NAVIGATION PLUMBING ONLY. This file gives #hub-view the same shell
 * every other top-level view has and hides the chat surfaces behind it. The
 * Hub's own Today dashboard is Stage 2 and brings its own rules.
 *
 * EVERY RULE HERE IS INERT ON A TENANT WITHOUT THE HUB. `#app.hub-mode` is set
 * only by switchMode('hub'), which a tenant with no hub:true module can never
 * reach because the tab is never created.
 *
 * NOTE ON `display`: #hub-view carries an inline `style="display:none"` from
 * index.html and panels/nav.js flips it to `flex`. That is the ONE source of
 * truth for its visibility, so this file deliberately sets no display on
 * #hub-view — an inline style would beat a rule here anyway, and two owners of
 * one property is how a view ends up stuck open.
 */

#hub-view {
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

/* Same hide-list the More and Command tabs use (see styles/cc.css). #more-view
   and #command-view are display:none by default and only shown by their own
   mode class, so they need no rule here. #chat is visible by default and must
   be hidden explicitly. */
#app.hub-mode #chat,
#app.hub-mode #input-wrapper,
#app.hub-mode #scroll-bottom-btn {
  display: none !important;
}

/* ── v1.13: the Hub switcher (two or more hub:true panels) ──
 *
 * A strip of segments directly ABOVE #hub-view, one per Hub panel. It is a
 * sibling of #hub-view, not a child (see HUB_SWITCHER_ID in panels/nav.js for
 * why), so it is an in-flow flex item of #app sitting between the header and
 * the host, and it takes the rail offset from styles.css like every top-level
 * surface does.
 *
 * INERT ON EVERY TENANT WITH ONE OR ZERO HUB PANELS: nav.js creates #hub-switcher
 * lazily, only when the Hub holds two or more panels, so none of these selectors
 * matches anything there. Visibility is owned by nav.js through the inline
 * style, exactly like #hub-view, so this file sets no `display` on the strip.
 *
 * Mobile-first: the segments share the width evenly on a phone and never wrap;
 * with more panels than fit, the strip scrolls sideways rather than squeezing
 * labels below a readable size. From 600px the segments size to their labels.
 */
#hub-switcher {
  flex-shrink: 0;
  padding: 8px 12px 6px;
  background: var(--bg);
}

#hub-switcher .hub-switcher-track {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  overflow-x: auto;
  scrollbar-width: none;
}
#hub-switcher .hub-switcher-track::-webkit-scrollbar { display: none; }

#hub-switcher .hub-switcher-seg {
  flex: 1 1 0;
  min-width: max-content;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--md-sys-motion-duration-short4, 200ms) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short4, 200ms) var(--md-sys-motion-easing-standard);
}
#hub-switcher .hub-switcher-seg:hover {
  color: var(--md-sys-color-on-surface);
}
#hub-switcher .hub-switcher-seg[aria-selected='true'] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
#hub-switcher .hub-switcher-seg:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

@media (min-width: 600px) {
  #hub-switcher { padding: 10px 16px 8px; }
  #hub-switcher .hub-switcher-track { flex: 0 1 auto; }
  #hub-switcher .hub-switcher-seg { flex: 0 0 auto; }
}
