/* The top bar: logo, search, where you are, links and tabs. Loaded by every page, including the sale dashboards,
   whose own content isn't styled by the component library (so this file only touches the header). */
/* ---------- header ---------- */
header.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line);
  padding: 0 max(var(--sp-page), env(safe-area-inset-right, 0px)) 0 max(var(--sp-page), env(safe-area-inset-left, 0px)); }
.bar-in { max-width: var(--wrap-wide); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-block: 14px; }
.bar-in:has(> .bar-top) { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; padding-bottom: 0; }
.bar-in:has(> .bar-top):not(:has(> .tabs)) { padding-bottom: 14px; }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.brand, .bar h1 { font-family: var(--font-head); font-size: var(--fs-md); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.01em; margin: 0; color: var(--bar-ink); line-height: 1.2; }
.brand b, .bar h1 b { color: var(--brand); }
.bar a.home-link, .brand a, a.brand { color: inherit; text-decoration: none; }
a.brand { color: var(--bar-ink); }
.bar a.home-link, a.brand { display: inline-flex; align-items: center; min-height: 32px; }
.who { font-size: var(--fs-sm); color: var(--bar-muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.who a, .metarow a { color: var(--bar-ink); text-decoration: none; font-weight: var(--fw-medium); }
.who a:hover, .metarow a:hover { color: var(--accent); }
.who button { font: var(--fw-medium) var(--fs-sm) var(--font-sans); background: transparent; color: var(--bar-ink); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 12px; height: 34px; cursor: pointer; }
.bar a.back { color: var(--bar-ink); font-weight: var(--fw-medium); text-decoration: none; min-height: 34px; display: inline-flex; align-items: center; }
/* meta row: where you are · Live | links */
.metarow, .sync { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); color: var(--bar-muted); }
.metarow .sep, .sync .sep { width: 1px; height: 12px; background: var(--line-strong); }
@media (max-width: 520px) { .metarow .sep { display: none; } .metarow .links { flex-basis: 100%; } }
.metarow .links, .sync .links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dot-live::before, #sync::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin-right: 6px; vertical-align: 1px; }
#sync.live::before, .dot-live.on::before { background: var(--ok); }
#sync.off::before { background: var(--bad); }
#sync.busy::before { background: var(--warn); }
/* tabs: scroll sideways, fading out at the edge rather than being cut off */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.tabs.at-end { -webkit-mask-image: none; mask-image: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; font: var(--fw-medium) var(--fs-desc) var(--font-sans); color: var(--bar-muted); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; min-height: 40px; cursor: pointer; white-space: nowrap; border-radius: 0; }
.tabs button:hover { color: var(--bar-ink); }
.tabs button[aria-selected="true"] { color: var(--bar-ink); font-weight: var(--fw-semibold); border-bottom-color: var(--accent); }

main .tabs { border-bottom: 1px solid var(--line); }
/* the logo: the full lockup when there's room, the mark alone on phones (brand guidelines §02). Inline SVG, so the wordmark uses the page's IBM Plex. */
a.brand.logo { display: inline-flex; align-items: center; min-height: 40px; color: var(--bar-ink); text-decoration: none; text-transform: none; letter-spacing: 0; }
.logo svg { display: block; width: auto; }
.logo .logo-full { height: 22px; }
.logo .logo-mark { height: 28px; display: none; }
.brand-h { margin: 0; line-height: 1; }
@media (max-width: 520px) { .logo .logo-full { display: none; } .logo .logo-mark { display: block; } }
.signin-logo { margin: 0; display: flex; justify-content: center; color: var(--ink); }
.signin-logo svg { height: 88px; width: auto; }
