/* Shared header (`<header class="brand">`) styles.
   Extracted from the near-identical copies duplicated inline across ~30 pages
   (see docs/plan-ui1-shared-header.md, Section 1.1/1.4). Canonical class set
   is `.user-nav` (the majority variant across pages today); the `.brand-meta`
   and unclassed-`<div>` variants used by a handful of other pages are
   reconciled to this file only as each of those pages is converted to the
   shared header component (later steps), not retroactively renamed here. */

header.brand {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  max-width: none;
  width: 100%;
  margin: 0 0 28px;
  box-sizing: border-box;
  padding: 18px 32px;
  /* Reserves the rendered height (60px logo + 18px*2 padding + 1px
     border-bottom = 97px, box-sizing: border-box so min-height includes
     padding/border) so an empty mount takes up the right space before
     header.js fills it in -- no blank-to-full snap on first paint. */
  min-height: 97px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(15,30,45,0.06);
  position: relative;
  overflow: hidden;
}
header.brand::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  pointer-events: none;
}
.brand-logo-primary { height: 60px; width: auto; display: block; }
a.logo-link { display: block; line-height: 0; }
.legacy-mark { display: inline-flex; align-items: center; height: 20px; }
.legacy-mark img { height: 20px; width: auto; display: block; opacity: 0.8; }
.user-nav {
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.user-nav strong { color: var(--ink-soft); font-weight: 600; font-size: 13px; display: block; }
.user-nav-links { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
/* Pending-count badge (2026-09-01, update-request visibility plan piece
   1) -- "is there anything waiting" without a click. */
.count-badge {
  display: inline-block; font-size: 10px; font-weight: 700; color: #fff;
  background: var(--accent-deep); border-radius: 100px; padding: 1px 6px; margin-left: 4px;
}
.user-nav a, .user-nav button.link-btn {
  font-family: inherit;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.user-nav a:hover, .user-nav button.link-btn:hover { text-decoration: underline; }
.sep { color: var(--line-soft); }

@media (max-width: 720px) {
  header.brand { grid-template-columns: auto 1fr; padding: 16px 32px; gap: 16px; }
  .user-nav { grid-column: 1 / -1; text-align: left; }
}

/* Global search box (web/js/headerSearch.js).  Everything is scoped to a header
   that carries .hs-has-search, which the script adds only when it mounts the box,
   so a header without the box (lab, public pages) is untouched.  overflow:visible
   lets the results list drop out of the header; the accent bar is an absolutely
   positioned ::before inside the padding box, so nothing relies on the clip. */
header.brand.hs-has-search { overflow: visible; }
.hs { position: relative; width: 100%; min-width: 180px; max-width: 460px; justify-self: center; text-align: left; font-family: inherit; }
.hs-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hs-field { display: flex; align-items: center; background: var(--card, #fff); border: 1px solid var(--line, #c9d4de); border-radius: var(--radius, 6px); }
.hs-field:focus-within { border-color: var(--accent, #2265b0); box-shadow: 0 0 0 2px var(--accent, #2265b0); }
.hs-input { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 12px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink, #0f1e2d); outline: none; }
.hs-input::placeholder { color: var(--muted, #5a6a78); opacity: 1; }
.hs-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1000; max-height: 60vh; overflow-x: hidden; overflow-y: auto; background: var(--card, #fff); border: 1px solid var(--line, #c9d4de); border-radius: 8px; box-shadow: 0 1px 3px rgba(15,30,45,0.06), 0 10px 26px -6px rgba(15,30,45,0.22); }
.hs-drop[hidden], .hs-list[hidden], .hs-note[hidden], .hs-foot[hidden] { display: none; }
.hs-list { margin: 0; padding: 0; list-style: none; }
.hs-list li + li .hs-opt { border-top: 1px solid var(--line-soft, #dde5ed); }
.hs-opt { display: block; min-height: 44px; padding: 8px 12px; box-sizing: border-box; color: var(--ink, #0f1e2d); text-decoration: none; cursor: pointer; }
.hs-opt:hover { background: var(--paper, #f1f4f7); text-decoration: none; }
.hs-opt.is-locked { background: var(--paper, #f1f4f7); color: var(--ink-soft, #243342); }
.hs-opt.is-active, .hs-opt.is-active:hover { background: var(--accent-soft, #daeaf7); outline: 2px solid var(--accent, #2265b0); outline-offset: -2px; }
.hs-opt.is-locked.is-active, .hs-opt.is-locked.is-active:hover { background: var(--line-soft, #dde5ed); }
.hs-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 1.4; }
.hs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.hs-code { font-size: 12px; color: var(--ink-soft, #243342); font-variant-numeric: tabular-nums; }
.hs-chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--line, #c9d4de); border-radius: 100px; background: var(--card, #fff); font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--ink-soft, #243342); }
.hs-badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--muted, #5a6a78); border-radius: 4px; background: var(--card, #fff); font-size: 11px; font-weight: 700; line-height: 1.5; letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink-soft, #243342); }
.hs-line { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink-soft, #243342); overflow-wrap: anywhere; }
.hs-note { padding: 12px; font-size: 13px; line-height: 1.45; color: var(--ink-soft, #243342); }
.hs-foot { padding: 8px 12px; border-top: 1px solid var(--line-soft, #dde5ed); background: var(--paper, #f1f4f7); font-size: 12px; color: var(--ink-soft, #243342); }
.hs-msg { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1001; padding: 10px 12px; border: 1px solid var(--warning, #b04a3c); border-radius: 8px; background: var(--warning-soft, #fbeeea); color: var(--ink, #0f1e2d); font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: 0 6px 18px -6px rgba(15,30,45,0.25); }
.hs-msg:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .hs-opt { transition: background-color 0.08s; }
}
/* Below 960px the box no longer fits between the logo and the user links, so it
   takes its own full-width row under them. */
@media (max-width: 960px) {
  header.brand.hs-has-search { grid-template-columns: auto 1fr; }
  header.brand.hs-has-search .hs { order: 3; grid-column: 1 / -1; justify-self: stretch; max-width: none; min-width: 0; }
}
@media (max-width: 720px) {
  header.brand.hs-has-search .user-nav { min-width: 0; }
  header.brand.hs-has-search .user-nav-links { flex-wrap: wrap; justify-content: flex-start; gap: 4px 12px; }
  .hs-input { height: 44px; font-size: 16px; }
}
